Author: dmeyer
Date: Fri Feb 23 16:42:39 2007
New Revision: 2514
Modified:
trunk/WIP/record/src/__init__.py
trunk/WIP/record/src/channel.py
trunk/WIP/record/src/device.py
trunk/WIP/record/src/gstdvbsrc.py
trunk/WIP/record/src/sink.py
trunk/WIP/record/test/pmt.py
Log:
cleanup, add doc
Modified: trunk/WIP/record/src/__init__.py
==============================================================================
--- trunk/WIP/record/src/__init__.py (original)
+++ trunk/WIP/record/src/__init__.py Fri Feb 23 16:42:39 2007
@@ -1,3 +1,31 @@
+# -*- coding: iso-8859-1 -*-
+# -----------------------------------------------------------------------------
+# kaa.record API
+# -----------------------------------------------------------------------------
+# $Id$
+#
+# -----------------------------------------------------------------------------
+# kaa-record - A recording module
+# Copyright (C) 2007 S�nke Schwardt, Dirk Meyer
+#
+# 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
+#
+# -----------------------------------------------------------------------------
+
import gst
import os
@@ -5,10 +33,8 @@
# add our gstreamer plugins
gst.plugin_load_file(dirname + '/_gstrecord.so')
+# imports from submodules
from channel import *
from device import Device
from sink import *
from recording import Recording
-
-# FIXME: remove this
-from gstdvbsrc import DVBsrc
Modified: trunk/WIP/record/src/channel.py
==============================================================================
--- trunk/WIP/record/src/channel.py (original)
+++ trunk/WIP/record/src/channel.py Fri Feb 23 16:42:39 2007
@@ -1,4 +1,3 @@
-#!/usr/bin/python
# -*- coding: iso-8859-1 -*-
# -----------------------------------------------------------------------------
# channels.py - Read channels.conf to Channel objects
@@ -120,13 +119,13 @@
if len(cells) == 13 and cells[2].startswith('INVERSION_'):
self.cfgtype = 'DVB-T'
return self.parse_dvbt(cells)
-
+
log.error('failed to parse config line:\n%s' % self.line)
return None
def parse_vdr_style(self, line):
-
+
cells = self.line.split(':')
if ';' in cells[0]:
@@ -172,7 +171,7 @@
if len(cells[3]) > 1:
self.config['source'] = cells[3][1:]
- self.config['symbolrate'] = cells[4]
+ self.config['symbol-rate'] = cells[4]
self.config['vpid'] = cells[5]
self.config['apids'] = []
@@ -230,7 +229,7 @@
self.config['apids'] = [ cells[11] ]
self.config['tpid'] = cells[12]
-
+
def map_config(self, key, keydict):
if not self.config.has_key( key ):
return
@@ -328,7 +327,7 @@
if channel.cfgtype == None:
# ignore bad line
continue
-
+
if self.cfgtype == None:
self.cfgtype = channel.cfgtype
elif self.cfgtype is not channel.cfgtype:
Modified: trunk/WIP/record/src/device.py
==============================================================================
--- trunk/WIP/record/src/device.py (original)
+++ trunk/WIP/record/src/device.py Fri Feb 23 16:42:39 2007
@@ -2,7 +2,7 @@
# -----------------------------------------------------------------------------
# device.py - General Device Wrapper
# -----------------------------------------------------------------------------
-# $Id: recording.py 915 2005-11-23 19:26:28Z dmeyer $
+# $Id$
#
# -----------------------------------------------------------------------------
# kaa-record - A recording module
Modified: trunk/WIP/record/src/gstdvbsrc.py
==============================================================================
--- trunk/WIP/record/src/gstdvbsrc.py (original)
+++ trunk/WIP/record/src/gstdvbsrc.py Fri Feb 23 16:42:39 2007
@@ -1,3 +1,35 @@
+# -*- coding: iso-8859-1 -*-
+# -----------------------------------------------------------------------------
+# gstdvbsrc.py - Gstreamer DVB source element
+# -----------------------------------------------------------------------------
+# $Id$
+#
+# -----------------------------------------------------------------------------
+# kaa-record - A recording module
+# Copyright (C) 2007 S�nke Schwardt, Dirk Meyer
+#
+# First Edition: Dirk Meyer <[EMAIL PROTECTED]>
+# Maintainer: Dirk Meyer <[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
+#
+# -----------------------------------------------------------------------------
+
+# gstreamer imports
import pygst
pygst.require('0.10')
import gst
@@ -16,7 +48,7 @@
self._pids = []
self._newpad = None
self._nextid = 0
-
+
def set_property(self, prop, value):
if prop == 'adapter':
@@ -28,13 +60,11 @@
channel = value
frontendtype = self._tuner.get_property('frontendtype')
if frontendtype == 0:
- # TODO FIXME I have to fix parser and tuner! -
- # they should use the same keywords
- channel.config['symbol-rate'] =
int(channel.config['symbolrate'])
- # Note from Dischi: for some reason we need the not, took me
some time
- # to find this. BTW, polarisation vs. polarization.
+ # Note from Dischi: for some reason we need the not,
+ # took me some time to find this.
+ # BTW, polarisation vs. polarization.
channel.config['polarisation'] = not
channel.config['horizontal_polarization']
-
+
for cfgitem in [ 'frequency', 'symbol-rate', 'polarisation' ]:
print '%s ==> %s' % (cfgitem, channel.config[ cfgitem ])
self._tuner.set_property( cfgitem, channel.config[ cfgitem
] )
@@ -46,20 +76,20 @@
# TODO FIXME I have to fix parser and tuner! -
# they should use the same keywords
channel.config['constellation'] = channel.config['modulation']
-
+
for cfgitem in [ 'frequency', 'inversion', 'bandwidth',
'code-rate-high-prio', 'code-rate-low-prio',
'constellation', 'transmission-mode',
'guard-interval', 'hierarchy' ]:
print '%s ==> %s' % (cfgitem, channel.config[ cfgitem ])
self._tuner.set_property( cfgitem, channel.config[ cfgitem
] )
-
+
elif frontendtype == 3:
raise AttributeError('FIXME: ATSC tuning unsupported')
else:
- print 'OH NO! Please fix this code!'
-
+ raise AttributeError('unsupported card type')
+
# tune to channel
self._tuner.emit("tune")
return True
Modified: trunk/WIP/record/src/sink.py
==============================================================================
--- trunk/WIP/record/src/sink.py (original)
+++ trunk/WIP/record/src/sink.py Fri Feb 23 16:42:39 2007
@@ -1,5 +1,37 @@
+# -*- coding: iso-8859-1 -*-
+# -----------------------------------------------------------------------------
+# sink.py - Output Modules for Recordings
+# -----------------------------------------------------------------------------
+# $Id$
+#
+# -----------------------------------------------------------------------------
+# kaa-record - A recording module
+# Copyright (C) 2007 S�nke Schwardt, Dirk Meyer
+#
+# First Edition: Dirk Meyer <[EMAIL PROTECTED]>
+# Maintainer: Dirk Meyer <[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
+#
+# -----------------------------------------------------------------------------
+
__all__ = [ 'Filewriter' ]
+# gstreamer imports
import pygst
pygst.require('0.10')
import gst
Modified: trunk/WIP/record/test/pmt.py
==============================================================================
--- trunk/WIP/record/test/pmt.py (original)
+++ trunk/WIP/record/test/pmt.py Fri Feb 23 16:42:39 2007
@@ -13,6 +13,7 @@
# import kaa.record2 for the dvbtuner module
import kaa.record2
+import kaa.record2.gstdvbsrc
# test app logic
@@ -44,7 +45,7 @@
pipeline.get_bus().add_watch(bus_event)
# create DVBsrc object and add it
-dvb = kaa.record2.DVBsrc()
+dvb = kaa.record2.gstdvbsrc.DVBsrc()
# FIXME: it would be nice to do
# gst.element_factory_make("dvbsrc")
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog