Author: dmeyer
Date: Sun Feb 11 19:35:08 2007
New Revision: 2484
Added:
trunk/WIP/record/test/dvbc.conf
- copied unchanged from r2482, /trunk/WIP/record/src/dvbc.conf
trunk/WIP/record/test/dvbs.conf
- copied unchanged from r2482, /trunk/WIP/record/src/dvbs.conf
trunk/WIP/record/test/dvbt.conf
- copied unchanged from r2482, /trunk/WIP/record/src/dvbt.conf
Removed:
trunk/WIP/record/src/dvbc.conf
trunk/WIP/record/src/dvbs.conf
trunk/WIP/record/src/dvbt.conf
Modified:
trunk/WIP/record/src/device.py
trunk/WIP/record/src/dvbconfigreader.py
trunk/WIP/record/src/dvbdevice.py
trunk/WIP/record/src/gstdvbtuner.c
trunk/WIP/record/src/gstdvbtuner.h
trunk/WIP/record/src/gstmain.c
trunk/WIP/record/src/gsttssplitter.c
trunk/WIP/record/src/gsttssplitter.h
Log:
some cleanup
Modified: trunk/WIP/record/src/device.py
==============================================================================
--- trunk/WIP/record/src/device.py (original)
+++ trunk/WIP/record/src/device.py Sun Feb 11 19:35:08 2007
@@ -36,7 +36,7 @@
Basic device class defining the needed functions all devices need to
provide. Override all the functions without calling this class.
"""
- def start_recording(self, channel, filter_chain):
+ def start_recording(self, channel):
"""
Start recording the channel to the filter chain. This function needs
to return a unique id for stopping the recording later.
Modified: trunk/WIP/record/src/dvbconfigreader.py
==============================================================================
--- trunk/WIP/record/src/dvbconfigreader.py (original)
+++ trunk/WIP/record/src/dvbconfigreader.py Sun Feb 11 19:35:08 2007
@@ -1,12 +1,10 @@
#!/usr/bin/python
# -*- coding: iso-8859-1 -*-
# -----------------------------------------------------------------------------
-# device.py - Devices for recordings
+# dvbconfigreader.py - Read channels.conf
# -----------------------------------------------------------------------------
# $Id$
#
-# This file defines the possible devices for recording.
-#
# -----------------------------------------------------------------------------
# kaa-record - A recording module
# Copyright (C) 2007 S�nke Schwardt, Dirk Meyer
@@ -42,22 +40,6 @@
# get logging object
log = logging.getLogger('record')
-# TODO FIXME add more debug output to logger
-
-#
-# DVB-S
-#ARD - Das Erste:11836:h:S19.2E:27500:101:102:104:0:28106:0:0:0
-#RTL World - RTL2:12187:h:S19.2E:27500:167:136=ger:71:0:12060:1:1089:0
-#
-# DVB-T
-#Das Erste:706000:I999C23D23M16B8T8G4Y0:T:27500:257:258:260:0:224:0:0:0
-#ZDF:522000:I999C23D12M16B8T8G4Y0:T:27500:545:546,547;559:551:0:514:0:0:0
-#
-# DVB-C
-#PREMIERE SERIE:346000:M64:C:6900:2559:2560;2563:32:1:16:133:2:0
-#PREMIERE KRIMI:346000:M64:C:6900:2815:2816:32:1:23:133:2:0
-#
-
class DVBChannel:
# TODO / FIXME add missing compare function
map_hierarchy = { 'default': 'AUTO',
@@ -66,25 +48,25 @@
'1': '1',
'2': '2',
'4': '4' }
-
+
map_bandwidth = { 'default': 'AUTO',
'999': 'AUTO',
'6': '6_MHZ',
'7': '7_MHZ',
'8': '8_MHZ' }
-
+
map_transmissionmode = { 'default': 'AUTO',
'999': 'AUTO',
'2': '2K',
'8': '8K' }
-
+
map_guardinterval = { 'default': 'AUTO',
'999': 'AUTO',
'4': '1/4',
'8': '1/8',
'16': '1/16',
'32': '1/32' }
-
+
map_modulation = { 'default': 'AUTO',
'999': 'AUTO',
'16': 'QAM_16',
@@ -92,7 +74,7 @@
'64': 'QAM_64',
'128': 'QAM_128',
'256': 'QAM_256' }
-
+
map_fec = { 'default': 'AUTO',
'999': 'AUTO',
'0': 'NONE',
@@ -104,7 +86,7 @@
'67': '6/7',
'78': '7/8',
'89': '8/9' }
-
+
map_inversion = { 'default': 'AUTO',
'999': 'AUTO',
'0': 'OFF',
@@ -193,10 +175,10 @@
lst = []
for t in i.split(','):
if '=' in t:
- lst.append( t.split('=') )
+ lst.append( tuple(t.split('=')) )
else:
- lst.append( [ t, '' ] )
- self.config['apids'].append(lst)
+ lst.append( ( t, '' ) )
+ self.config['apids'].extend(lst)
self.config['tpid'] = cells[7]
self.config['caid'] = cells[8]
@@ -218,23 +200,26 @@
self.map_config( 'dataratehigh', self.map_fec )
self.map_config( 'inversion', self.map_inversion )
-
+
def map_config(self, key, keydict):
if not self.config.has_key( key ):
- return
+ return
if self.config[ key ] in keydict.keys():
self.config[ key ] = keydict[ self.config[ key ] ]
else:
- log.warn('failed to parse %s (%s) - using default %s' % (key,
self.config[key], keydict['default']))
+ log.warn('failed to parse %s (%s) - using default %s',
+ key, self.config[key], keydict['default'])
self.config[key] = keydict[ 'default' ]
-
-
+
+
+ def __repr__(self):
+ return '<kaa.record.DVBChannel %s>' % self.config['name']
+
+
def __str__(self):
- return '%s channel: %s [%s] (vpid=%s apids=%s)' % (self.cfgtype,
-
self.config['name'].ljust(25),
-
self.config['bouquet'].ljust(25),
- self.config['vpid'],
- self.config['apids'])
+ return '%s channel: %-25s [%-25s] (vpid=%s apids=%s)' \
+ % (self.cfgtype, self.config['name'], self.config['bouquet'],
+ self.config['vpid'], self.config['apids'])
@@ -257,8 +242,10 @@
def remove(self, channame):
- # TODO FIXME return value returns True if channel with channame was
found and deleted otherwise False
- self.chanlist = filter(lambda chan: chan.config['name'] == channame,
self.chanlist)
+ # TODO FIXME return value returns True if channel with channame
+ # was found and deleted otherwise False
+ self.chanlist = filter(lambda chan: chan.config['name'] == channame,
+ self.chanlist)
return True
@@ -277,7 +264,7 @@
"""
if type(key) is types.IntType:
return self.chanlist[key]
-
+
if type(key) is types.StringType:
for chan in self.chanlist:
if chan.config['name'] == key:
@@ -286,11 +273,14 @@
raise TypeError()
+ def __repr__(self):
+ return '<kaa.record.DVBMultiplex: %s' % self.name
+
def __str__(self):
- s = '\nMULTIPLEX: name=%s (f=%s)' % (self.name.__str__().ljust(14),
self.frequency)
+ s = 'Multiplex: %-25s (f=%s)\n' % (self.name, self.frequency)
for chan in self.chanlist:
s += str(chan) + '\n'
- return s
+ return s + '\n'
@@ -303,26 +293,28 @@
self.f = open(cfgname)
for line in self.f:
channel = DVBChannel(line)
-
+
if self.cfgtype == None:
self.cfgtype = channel.cfgtype
+ elif self.cfgtype is not channel.cfgtype:
+ if channel.cfgtype != 'COMMENT':
+ log.warn('Oops: mixed mode config file!')
+ log.warn('Drop: %s' % line.strip())
+ continue
+
+ for mplex in self.multiplexlist:
+ added = mplex.add( channel )
+ if added:
+ log.info('added channel %s to mplex %s',
+ channel.config['name'], mplex.name)
+ break
else:
- if self.cfgtype is not channel.cfgtype:
- if channel.cfgtype != 'COMMENT':
- log.warn('Oops: mixed mode config file! Dropping this
line!\nline: %s' % line)
- channel = None
-
- if channel:
- for mplex in self.multiplexlist:
- added = mplex.add( channel )
- if added:
- log.info('added channel %s to mplex %s' %
(channel.config['name'], mplex.name))
- break
- else:
- mplex = DVBMultiplex( channel.config['frequency'],
channel.config['frequency'], )
- mplex.add( channel )
- self.multiplexlist.append(mplex)
- log.info('added channel %s to new mplex %s' %
(channel.config['name'], mplex.name))
+ mplex = DVBMultiplex( channel.config['frequency'],
+ channel.config['frequency'], )
+ mplex.add( channel )
+ self.multiplexlist.append(mplex)
+ log.info('added channel %s to new mplex %s',
+ channel.config['name'], mplex.name)
# TODO FIXME add missing __getitem__, __contains__
@@ -345,7 +337,7 @@
"""
if type(key) is types.IntType:
return self.multiplexlist[key]
-
+
if type(key) is types.StringType:
for mplex in self.multiplexlist:
if mplex.name == key:
@@ -366,7 +358,7 @@
for mplex in self.multiplexlist:
s += str(mplex)
return s
-
+
if __name__ == '__main__':
log = logging.getLogger()
@@ -379,7 +371,7 @@
log.addHandler(handler)
logging.getLogger().setLevel(logging.DEBUG)
- ccr = DVBChannelConfReader('./dvbs.conf')
+ ccr = DVBChannelConfReader('test/dvbs.conf')
print ccr
print '---------------'
print 'find channel "n-tv":'
Modified: trunk/WIP/record/src/dvbdevice.py
==============================================================================
--- trunk/WIP/record/src/dvbdevice.py (original)
+++ trunk/WIP/record/src/dvbdevice.py Sun Feb 11 19:35:08 2007
@@ -34,16 +34,11 @@
# python imports
import os
import logging
-import traceback
-from types import *
-import urllib
+
import pygst
pygst.require('0.10')
import gst
-# kaa imports
-from kaa.notifier import OneShotTimer, SocketDispatcher, Timer
-
import dvbconfigreader
# get logging object
@@ -60,12 +55,12 @@
Init the device by creating a gstreamer tuner object for the dvb
adapter specified by 'adapter'. Additionally a DVBChannelConfigReader
instance will read the given channel config file 'channelconffile'.
-
+
adapter is of type int and specifies the local dvb adapter:
- e.g. 2 for /dev/dvb/adapter0/*
-
+ e.g. 2 for /dev/dvb/adapter2/*
+
channelconffile is of type string and specifies the path to a
- channels.conf file that will be used for tuning.
+ channels.conf file that will be used for tuning.
"""
# save adapter TODO FIXME unneccessary?
@@ -74,9 +69,6 @@
self.channelconffile = channelconffile
# read adapter config file
self.channelconfig = DVBChannelConfReader( channelconffile )
- #
-
-# DEFINIERE HIER EINE FILTER-QUEUE
# create gstreamer dvbtuner object
self._tuner = gst.element_factory_make("dvbtuner", "tuner")
@@ -88,7 +80,8 @@
# get frontend type and some additional information
frontendtype = tuner.get_property('frontendtype')
log.info('dvb device %s: type=%s name="%s" hwdecoder=%s' %
- (adapternumber, frontendlist[ frontendtype ],
tuner.get_property('frontendname'),
+ (adapternumber, frontendlist[ frontendtype ],
+ tuner.get_property('frontendname'),
tuner.get_property('hwdecoder')))
@@ -99,32 +92,10 @@
should be recorded. This functions gets all ids for the channel and
starts the recording at C++ level.
"""
-
-# AUFNAHME STARTEN
-# - TUNER AUF ENTSPRECHENDE FREQUENZ/CHANNEL SETZEN, WENN ER DORT NOCH
NICHT IST
-# - FILTERQUEUE ANPASSEN ==> NEUEN FILTER IN DIE QUEUE EINH�NGEN
-# - RECORDING-ID ZUR�CKGEBEN
-# (RECORDING-ID==FILTER-ID, WIRD BEN�TIGT, UM SP�TER DEN FILTER
MODIFIZIEREN ZU K�NNEN)
-
- pids = self._device.get_pids(channel)
- log.info("start recording %s with pid list %s" % (channel, pids))
- filter_chain.set_pids(pids[0][0], pids[1][0])
-
- # create real filter chain
- filter_chain = filter_chain._create()
-
- # start recording
- rec_id = self._device.start_recording(channel, filter_chain)
-
- # create FDSplitter if not existing
- if self._fdsplitter == None:
- self._fdsplitter = FDSplitter( self.adapter + '/dvr0',
FDSplitter.INPUT_TS )
-
- chain_id = self._fdsplitter.add_filter_chain( filter_chain )
-
- self.recid2chainid[ rec_id ] = chain_id
-
- return rec_id
+ # tune to channel if needed
+ # create new tssplitter pad
+ # return id
+ pass
def stop_recording(self, id):
@@ -132,34 +103,11 @@
Stop the recording with the given id.
"""
-# AUFNAME STOPPEN
-# - FILTER RAUSSUCHEN UND ENTFERNEN
-# - DIE FILTERQUEUE UND DER TUNER WERDEN ERST DANN DEAKTIVIERT, WENN
JEMAND DAS AKTUELLE OBJEKT WEGWIRFT
-
- # remove filter chain
- if not self.recid2chainid.has_key(id):
- log.error("recid %d not found" % id)
- return None
-
- self._fdsplitter.remove_filter_chain( self.recid2chainid[id] )
+ # FIXME: get filter and remove
+ pass
- # remove id from map
- del self.recid2chainid[id]
- # check if last filter chain was removed
- if not self.recid2chainid:
- self._fdsplitter = None
-
- # stop recording
- return self._device.stop_recording(id)
-
-
- def get_bouquet_list(self):
+ def get_channel_list(self):
"""
- Return bouquet list from C++ object.
"""
-
- # EINE MULTIPLEX LISTE ZUSAMMENBAUEN UND ZUR�CKGEBEN
-
- return self._device.get_bouquet_list()
-
+ pass
Modified: trunk/WIP/record/src/gstdvbtuner.c
==============================================================================
--- trunk/WIP/record/src/gstdvbtuner.c (original)
+++ trunk/WIP/record/src/gstdvbtuner.c Sun Feb 11 19:35:08 2007
@@ -1,58 +1,33 @@
/*
- * GStreamer
- * Copyright 2005 Thomas Vander Stichele <[EMAIL PROTECTED]>
- * Copyright 2005 Ronald S. Bultje <[EMAIL PROTECTED]>
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
+ * ----------------------------------------------------------------------------
+ * GStreamer DVB Tuner
+ * ----------------------------------------------------------------------------
+ * $Id$
*
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
+ * ----------------------------------------------------------------------------
+ * kaa.record - Recording Module based on GStreamer
+ * Copyright (C) 2007 S�nke Schwardt, Dirk Meyer
*
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
+ * First Edition: S�nke Schwardt <[EMAIL PROTECTED]>
+ * Maintainer: S�nke Schwardt <[EMAIL PROTECTED]>
*
- * Alternatively, the contents of this file may be used under the
- * GNU Lesser General Public License Version 2.1 (the "LGPL"), in
- * which case the following provisions apply instead of the ones
- * mentioned above:
+ * Please see the file AUTHORS for a complete list of authors.
*
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
*
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MER-
+ * CHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+ * Public License for more details.
*
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-/**
- * SECTION:element-plugin
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * <refsect2>
- * <title>Example launch line</title>
- * <para>
- * <programlisting>
- * gst-launch -v -m audiotestsrc ! plugin ! fakesink silent=TRUE
- * </programlisting>
- * </para>
- * </refsect2>
+ * ----------------------------------------------------------------------------
*/
#include <stdint.h>
@@ -408,46 +383,46 @@
gobject_class->set_property = gst_dvbtuner_set_property;
gobject_class->get_property = gst_dvbtuner_get_property;
- g_object_class_install_property (gobject_class, PROP_DEBUG_OUTPUT,
- g_param_spec_boolean ("debug-output", "DebugOutput", "Produce verbose
debug output?",
- FALSE, G_PARAM_READWRITE));
-
- g_object_class_install_property (gobject_class, PROP_ADAPTER,
- g_param_spec_uint ("adapter", "Adapter", "Number of adapter",
- 0, 1024, 0, G_PARAM_READWRITE));
+ g_object_class_install_property (gobject_class, PROP_DEBUG_OUTPUT,
+ g_param_spec_boolean ("debug-output", "DebugOutput", "Produce verbose
debug output?",
+ FALSE, G_PARAM_READWRITE));
+
+ g_object_class_install_property (gobject_class, PROP_ADAPTER,
+ g_param_spec_uint ("adapter", "Adapter", "Number of adapter",
+ 0, 1024, 0, G_PARAM_READWRITE));
g_object_class_install_property (gobject_class, PROP_FRONTENDNAME,
- g_param_spec_string ("frontendname", "FrontendName", "name of frontend",
- "", G_PARAM_READABLE));
+ g_param_spec_string ("frontendname", "FrontendName", "name of frontend",
+ "", G_PARAM_READABLE));
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_FRONTENDTYPE,
g_param_spec_enum ("frontendtype", "Frontend Type",
"Type of frontend",
GST_TYPE_FRONTENDTYPE_PATTERN, 1, G_PARAM_READABLE));
- g_object_class_install_property (gobject_class, PROP_HWDECODER,
- g_param_spec_boolean ("hwdecoder", "HardwareDecoder", "Is a hardware
decoder present?",
- FALSE, G_PARAM_READABLE));
-
- g_object_class_install_property (gobject_class, PROP_STATUS,
- g_param_spec_string ("status", "FrontendStatus", "current frontend
status",
- "", G_PARAM_READABLE));
-
- g_object_class_install_property (gobject_class, PROP_FREQUENCY,
- g_param_spec_uint ("frequency", "Frequency", "frequency of channel",
- 0, G_MAXUINT, 0, G_PARAM_READWRITE));
-
- g_object_class_install_property (gobject_class, PROP_POLARISATION,
- g_param_spec_boolean ("polarisation", "Polarisation", "polarisation
(true=H ; false=V)",
- FALSE, G_PARAM_READWRITE));
-
- g_object_class_install_property (gobject_class, PROP_SAT_NO,
- g_param_spec_uint ("sat-no", "SatNo", "FIXME SatNo",
- 0, G_MAXUINT, 0, G_PARAM_READWRITE));
-
- g_object_class_install_property (gobject_class, PROP_SYM_RATE,
- g_param_spec_uint ("symbol-rate", "Symbol-rate", "FIXME symbol-rate",
- 0, G_MAXUINT, 0, G_PARAM_READWRITE));
+ g_object_class_install_property (gobject_class, PROP_HWDECODER,
+ g_param_spec_boolean ("hwdecoder", "HardwareDecoder", "Is a hardware
decoder present?",
+ FALSE, G_PARAM_READABLE));
+
+ g_object_class_install_property (gobject_class, PROP_STATUS,
+ g_param_spec_string ("status", "FrontendStatus", "current frontend status",
+ "", G_PARAM_READABLE));
+
+ g_object_class_install_property (gobject_class, PROP_FREQUENCY,
+ g_param_spec_uint ("frequency", "Frequency", "frequency of channel",
+ 0, G_MAXUINT, 0, G_PARAM_READWRITE));
+
+ g_object_class_install_property (gobject_class, PROP_POLARISATION,
+ g_param_spec_boolean ("polarisation", "Polarisation", "polarisation
(true=H ; false=V)",
+ FALSE, G_PARAM_READWRITE));
+
+ g_object_class_install_property (gobject_class, PROP_SAT_NO,
+ g_param_spec_uint ("sat-no", "SatNo", "FIXME SatNo",
+ 0, G_MAXUINT, 0, G_PARAM_READWRITE));
+
+ g_object_class_install_property (gobject_class, PROP_SYM_RATE,
+ g_param_spec_uint ("symbol-rate", "Symbol-rate", "FIXME symbol-rate",
+ 0, G_MAXUINT, 0, G_PARAM_READWRITE));
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_INVERSION,
g_param_spec_enum ("inversion", "Inversion", "FIXME inversion",
@@ -500,7 +475,7 @@
G_TYPE_NONE, /* return
type */
1, /* n_params
*/
G_TYPE_INT); /* param
types */
-
+
gst_dvbtuner_signals[SIGNAL_REMOVE_PID] =
g_signal_new ("remove-pid", /* signal
name */
G_TYPE_FROM_CLASS (klass), /* itype */
@@ -512,7 +487,7 @@
G_TYPE_NONE, /* return
type */
1, /* n_params
*/
G_TYPE_INT); /* param
types */
-
+
gst_dvbtuner_signals[SIGNAL_CLEAR_PIDS] =
g_signal_new ("clear-pids", /* signal
name */
G_TYPE_FROM_CLASS (klass), /* itype */
@@ -551,7 +526,7 @@
GstDvbTunerClass * gclass)
{
int i;
-
+
/* GstElementClass *klass = GST_ELEMENT_GET_CLASS (filter); */
/* filter->sinkpad = */
@@ -588,7 +563,7 @@
for(i = 0; i < GST_DVBTUNER_INIT_PIDLIST_LEN; ++i) {
filter->pidlist.array[i].pid = -1;
filter->pidlist.array[i].fd = -1;
- }
+ }
filter->pidlist.cnt = 4;
filter->pidlist.free = 4;
@@ -613,16 +588,16 @@
filter->debug_output = g_value_get_boolean (value);
break;
}
- case PROP_ADAPTER:
+ case PROP_ADAPTER:
{
guint new_adapter = g_value_get_uint(value);
DEBUGf("setting adapter from %d to %d", filter->adapter, new_adapter);
filter->adapter = new_adapter;
-
+
gst_dvbtuner_set_new_adapter_fn(filter);
-
+
gst_dvbtuner_tuner_init(filter);
- break;
+ break;
}
default:
{
@@ -656,7 +631,7 @@
filter->sat_no = g_value_get_uint(value);
break;
}
-
+
case PROP_SYM_RATE:
{
/* FIXME: adjust value (multiply with 1000) or not? */
@@ -694,13 +669,13 @@
filter->feparam.u.qam.symbol_rate = g_value_get_uint(value);
break;
}
-
+
case PROP_FEC:
{
filter->feparam.u.qam.fec_inner = g_value_get_enum (value);
break;
}
-
+
case PROP_MODULATION:
{
filter->feparam.u.qam.modulation = g_value_get_enum (value);
@@ -715,7 +690,7 @@
}
break;
}
-
+
case FE_OFDM:
{
switch (prop_id) {
@@ -739,7 +714,7 @@
filter->feparam.u.ofdm.bandwidth = g_value_get_enum(value);
break;
}
-
+
case PROP_CODE_RATE_HIGH_PRIO:
{
filter->feparam.u.ofdm.code_rate_HP = g_value_get_enum(value);
@@ -784,7 +759,7 @@
}
break;
}
-
+
case FE_ATSC:
{
switch (prop_id) {
@@ -827,30 +802,30 @@
break;
}
- case PROP_ADAPTER:
+ case PROP_ADAPTER:
{
g_value_set_uint (value, filter->adapter);
- break;
+ break;
}
- case PROP_FRONTENDTYPE:
+ case PROP_FRONTENDTYPE:
{
if (filter->fd_frontend_dev >= 0) {
- g_value_set_enum (value, filter->feinfo.type);
+ g_value_set_enum (value, filter->feinfo.type);
} else {
g_value_set_enum (value, GST_FRONTENDTYPE_UNKNOWN);
}
- break;
+ break;
}
case PROP_FRONTENDNAME:
{
if (filter->fn_frontend_dev && filter->feinfo.name) {
- g_value_set_string (value, filter->feinfo.name);
+ g_value_set_string (value, filter->feinfo.name);
} else {
g_value_set_string (value, "");
}
- break;
+ break;
}
case PROP_HWDECODER:
@@ -895,7 +870,7 @@
g_value_set_uint (value, filter->sat_no);
break;
}
-
+
case PROP_SYM_RATE:
{
/* FIXME: adjust value (multiply with 1000) or not? */
@@ -932,13 +907,13 @@
g_value_set_uint (value, filter->feparam.u.qam.symbol_rate);
break;
}
-
+
case PROP_FEC:
{
g_value_set_uint (value, filter->feparam.u.qam.fec_inner);
break;
}
-
+
case PROP_MODULATION:
{
g_value_set_enum (value, filter->feparam.u.qam.modulation);
@@ -974,7 +949,7 @@
g_value_set_enum (value, filter->feparam.u.ofdm.bandwidth);
break;
}
-
+
case PROP_CODE_RATE_HIGH_PRIO:
{
g_value_set_enum (value, filter->feparam.u.ofdm.code_rate_HP);
@@ -1019,7 +994,7 @@
}
break;
}
-
+
case FE_ATSC:
{
switch (prop_id) {
@@ -1051,7 +1026,7 @@
/******/
static void
-gst_dvbtuner_set_new_adapter_fn(GstDvbTuner *filter)
+gst_dvbtuner_set_new_adapter_fn(GstDvbTuner *filter)
{
if (filter->fn_frontend_dev) {
g_free(filter->fn_frontend_dev);
@@ -1064,23 +1039,23 @@
}
filter->fn_demux_dev = g_malloc( GST_DVBTUNER_FN_MAX_LEN+1 );
snprintf(filter->fn_demux_dev, GST_DVBTUNER_FN_MAX_LEN,
"/dev/dvb/adapter%i/demux0", filter->adapter);
-
+
if (filter->fn_dvr_dev) {
g_free(filter->fn_dvr_dev);
}
filter->fn_dvr_dev = g_malloc( GST_DVBTUNER_FN_MAX_LEN+1 );
snprintf(filter->fn_dvr_dev, GST_DVBTUNER_FN_MAX_LEN,
"/dev/dvb/adapter%i/dvr0", filter->adapter);
-
+
if (filter->fn_video_dev) {
g_free(filter->fn_video_dev);
}
filter->fn_video_dev = g_malloc( GST_DVBTUNER_FN_MAX_LEN+1 );
- snprintf(filter->fn_video_dev, GST_DVBTUNER_FN_MAX_LEN,
"/dev/dvb/adapter%i/video0", filter->adapter);
+ snprintf(filter->fn_video_dev, GST_DVBTUNER_FN_MAX_LEN,
"/dev/dvb/adapter%i/video0", filter->adapter);
}
static void
-gst_dvbtuner_tuner_release(GstDvbTuner *filter)
+gst_dvbtuner_tuner_release(GstDvbTuner *filter)
{
if (filter->fd_frontend_dev != -1) {
close(filter->fd_frontend_dev);
@@ -1091,7 +1066,7 @@
close(filter->fd_video_dev);
filter->fd_video_dev = -1;
}
-
+
DEBUGf("FIXME! NOW!");
// - alle file deskriptoren schlie�en
// - set status to DOWN
@@ -1132,7 +1107,7 @@
if(filter->feinfo.type==FE_OFDM) DEBUGf("TER Card (DVB-T)");
if(filter->feinfo.type==FE_ATSC) DEBUGf("US Card (?)");
}
-
+
if ((filter->fd_video_dev=open(filter->fn_video_dev, O_RDWR)) < 0) {
filter->hwdecoder = FALSE;
DEBUGf("hardware decoder absent");
@@ -1162,7 +1137,7 @@
/* request more mempry if needed */
if (filter->pidlist.free == 0) {
- DEBUGf("no free space (cnt=%d/free=%d) - requesting more memory",
+ DEBUGf("no free space (cnt=%d/free=%d) - requesting more memory",
filter->pidlist.cnt, filter->pidlist.free);
gint oldsize = filter->pidlist.cnt;
@@ -1175,7 +1150,7 @@
filter->pidlist.array[i].fd = -1;
}
}
-
+
/* add new pid and fd */
i = 0;
while((i < filter->pidlist.cnt) && (filter->pidlist.array[i].pid != -1)) {
@@ -1198,8 +1173,8 @@
M.output = DMX_OUT_TS_TAP;
M.pes_type = DMX_PES_OTHER;
M.flags = DMX_IMMEDIATE_START;
-
- DEBUGf( "ioctl(%d, DMX_SET_PES_FILTER) pid=%d",
+
+ DEBUGf( "ioctl(%d, DMX_SET_PES_FILTER) pid=%d",
filter->pidlist.array[i].fd, filter->pidlist.array[i].pid);
if (ioctl(filter->pidlist.array[i].fd, DMX_SET_PES_FILTER, &M) < 0) {
g_warning("ioctl failed: %s", strerror(errno));
@@ -1219,7 +1194,7 @@
filter->pidlist.array[i].fd, filter->pidlist.array[i].pid);
ioctl(filter->pidlist.array[i].fd, DMX_STOP);
close(filter->pidlist.array[i].fd);
-
+
filter->pidlist.array[i].pid = -1;
filter->pidlist.array[i].fd = -1;
@@ -1262,7 +1237,7 @@
return -1;
}
- if (ioctl(filter->fd_frontend_dev, FE_SET_VOLTAGE,
+ if (ioctl(filter->fd_frontend_dev, FE_SET_VOLTAGE,
filter->hor_polarisation ? SEC_VOLTAGE_13 : SEC_VOLTAGE_18) < 0) {
g_warning( "FE_SET_VOLTAGE: failed");
return -1;
@@ -1275,14 +1250,14 @@
}
usleep(15000);
- if (ioctl(filter->fd_frontend_dev, FE_DISEQC_SEND_BURST,
+ if (ioctl(filter->fd_frontend_dev, FE_DISEQC_SEND_BURST,
(filter->sat_no / 4) % 2 ? SEC_MINI_B : SEC_MINI_A) < 0) {
g_warning( "FE_DISEQC_SEND_BURST: failed");
return -1;
}
usleep(15000);
- if (ioctl(filter->fd_frontend_dev, FE_SET_TONE,
+ if (ioctl(filter->fd_frontend_dev, FE_SET_TONE,
filter->tone ? SEC_TONE_ON : SEC_TONE_OFF) < 0) {
g_warning( "FE_SET_TONE: failed");
return -1;
@@ -1323,13 +1298,13 @@
} else {
DEBUGf( "FIXME: print debug output" );
}
-
+
/* discard stale events */
while (ioctl(filter->fd_frontend_dev, FE_GET_EVENT, &event) != -1);
DEBUGf("about to set frontend parameters\n");
if (ioctl(filter->fd_frontend_dev, FE_SET_FRONTEND, &filter->feparam) < 0) {
- g_warning("ioctl(%d, FE_SET_FRONTEND, feparam) failed: %s",
+ g_warning("ioctl(%d, FE_SET_FRONTEND, feparam) failed: %s",
filter->fd_frontend_dev, strerror(errno));
}
@@ -1350,9 +1325,9 @@
snprintf(txt, 8191, "FRONTEND NOT READY");
} else {
-
+
snprintf(txt, 8191, "ERROR");
-
+
if (ioctl(filter->fd_frontend_dev, FE_READ_STATUS, &status) < 0) {
g_warning("FE_READ_STATUS failed: %s", strerror(errno));
return txt;
@@ -1384,7 +1359,7 @@
(status & FE_HAS_SYNC ? " FE_HAS_SYNC" : ""),
signal,snr, ber, uncorrected_blocks );
}
-
+
// DEBUGf( "%s", txt );
return txt;
Modified: trunk/WIP/record/src/gstdvbtuner.h
==============================================================================
--- trunk/WIP/record/src/gstdvbtuner.h (original)
+++ trunk/WIP/record/src/gstdvbtuner.h Sun Feb 11 19:35:08 2007
@@ -1,45 +1,33 @@
/*
- * GStreamer
- * Copyright 2005 Thomas Vander Stichele <[EMAIL PROTECTED]>
- * Copyright 2005 Ronald S. Bultje <[EMAIL PROTECTED]>
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- * Alternatively, the contents of this file may be used under the
- * GNU Lesser General Public License Version 2.1 (the "LGPL"), in
- * which case the following provisions apply instead of the ones
- * mentioned above:
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * ----------------------------------------------------------------------------
+ * GStreamer DVB Tuner
+ * ----------------------------------------------------------------------------
+ * $Id$
+ *
+ * ----------------------------------------------------------------------------
+ * kaa.record - Recording Module based on GStreamer
+ * Copyright (C) 2007 S�nke Schwardt, Dirk Meyer
+ *
+ * First Edition: S�nke Schwardt <[EMAIL PROTECTED]>
+ * Maintainer: S�nke Schwardt <[EMAIL PROTECTED]>
+ *
+ * Please see the file AUTHORS for a complete list of authors.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MER-
+ * CHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+ * Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * ----------------------------------------------------------------------------
*/
#ifndef __GST_DVBTUNER_H__
@@ -117,7 +105,7 @@
/* properties */
/**************/
gboolean debug_output;
- guint32 adapter;
+ guint32 adapter;
gboolean hwdecoder;
/****************/
@@ -141,7 +129,7 @@
struct dvb_frontend_parameters feparam;
};
-struct _GstDvbTunerClass
+struct _GstDvbTunerClass
{
GstElementClass parent_class;
Modified: trunk/WIP/record/src/gstmain.c
==============================================================================
--- trunk/WIP/record/src/gstmain.c (original)
+++ trunk/WIP/record/src/gstmain.c Sun Feb 11 19:35:08 2007
@@ -1,3 +1,35 @@
+/*
+ * ----------------------------------------------------------------------------
+ * Main GStreamer Module for kaa.record
+ * ----------------------------------------------------------------------------
+ * $Id$
+ *
+ * ----------------------------------------------------------------------------
+ * kaa.record - Recording Module based on GStreamer
+ * Copyright (C) 2007 S�nke Schwardt, Dirk Meyer
+ *
+ * First Edition: S�nke Schwardt <[EMAIL PROTECTED]>
+ * Maintainer: S�nke Schwardt <[EMAIL PROTECTED]>
+ *
+ * Please see the file AUTHORS for a complete list of authors.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MER-
+ * CHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+ * Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * ----------------------------------------------------------------------------
+ */
+
#include "config.h"
#include <gst/gst.h>
Modified: trunk/WIP/record/src/gsttssplitter.c
==============================================================================
--- trunk/WIP/record/src/gsttssplitter.c (original)
+++ trunk/WIP/record/src/gsttssplitter.c Sun Feb 11 19:35:08 2007
@@ -1,3 +1,34 @@
+/*
+ * ----------------------------------------------------------------------------
+ * GStreamer Transport Stream Splitter
+ * ----------------------------------------------------------------------------
+ * $Id$
+ *
+ * ----------------------------------------------------------------------------
+ * kaa.record - Recording Module based on GStreamer
+ * Copyright (C) 2007 S�nke Schwardt, Dirk Meyer
+ *
+ * First Edition: S�nke Schwardt <[EMAIL PROTECTED]>
+ * Maintainer: S�nke Schwardt <[EMAIL PROTECTED]>
+ *
+ * Please see the file AUTHORS for a complete list of authors.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MER-
+ * CHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+ * Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * ----------------------------------------------------------------------------
+ */
#include <assert.h>
#include <string.h>
@@ -615,6 +646,7 @@
if (!pidfilter)
return;
+#ifdef THIS_IS_BROKEN
// remove pad
gst_element_remove_pad(GST_ELEMENT (filter), pidfilter.pad);
gst_object_unref(pidfilter.pad);
@@ -643,6 +675,6 @@
}
}
filter->filterlist_free += 1;
-
+#endif
return;
}
Modified: trunk/WIP/record/src/gsttssplitter.h
==============================================================================
--- trunk/WIP/record/src/gsttssplitter.h (original)
+++ trunk/WIP/record/src/gsttssplitter.h Sun Feb 11 19:35:08 2007
@@ -1,45 +1,33 @@
/*
- * GStreamer
- * Copyright 2005 Thomas Vander Stichele <[EMAIL PROTECTED]>
- * Copyright 2005 Ronald S. Bultje <[EMAIL PROTECTED]>
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- * Alternatively, the contents of this file may be used under the
- * GNU Lesser General Public License Version 2.1 (the "LGPL"), in
- * which case the following provisions apply instead of the ones
- * mentioned above:
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * ----------------------------------------------------------------------------
+ * GStreamer Transport Stream Splitter
+ * ----------------------------------------------------------------------------
+ * $Id$
+ *
+ * ----------------------------------------------------------------------------
+ * kaa.record - Recording Module based on GStreamer
+ * Copyright (C) 2007 S�nke Schwardt, Dirk Meyer
+ *
+ * First Edition: S�nke Schwardt <[EMAIL PROTECTED]>
+ * Maintainer: S�nke Schwardt <[EMAIL PROTECTED]>
+ *
+ * Please see the file AUTHORS for a complete list of authors.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MER-
+ * CHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+ * Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * ----------------------------------------------------------------------------
*/
#ifndef __GST_TSSPLITTER_H__
@@ -95,7 +83,7 @@
struct _GstTSSplitter
{
- GstElement element;
+ GstElement element;
GstPad *sinkpad, *srcpad;
@@ -108,7 +96,7 @@
GstTSSplitterFilter *filterlist;
};
-struct _GstTSSplitterClass
+struct _GstTSSplitterClass
{
GstElementClass parent_class;
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog