conduit r1677 - in trunk: . conduit/modules conduit/utils
- From: jstowers svn gnome org
- To: svn-commits-list gnome org
- Subject: conduit r1677 - in trunk: . conduit/modules conduit/utils
- Date: Fri, 22 Aug 2008 14:33:58 +0000 (UTC)
Author: jstowers
Date: Fri Aug 22 14:33:58 2008
New Revision: 1677
URL: http://svn.gnome.org/viewvc/conduit?rev=1677&view=rev
Log:
* conduit/modules/AudioVideoConverterModule.py:
* conduit/utils/MediaFile.py: Handle missing gstreamer nicer.
Fixes #548960
Modified:
trunk/ (props changed)
trunk/ChangeLog
trunk/conduit/modules/AudioVideoConverterModule.py
trunk/conduit/utils/MediaFile.py
Modified: trunk/conduit/modules/AudioVideoConverterModule.py
==============================================================================
--- trunk/conduit/modules/AudioVideoConverterModule.py (original)
+++ trunk/conduit/modules/AudioVideoConverterModule.py Fri Aug 22 14:33:58 2008
@@ -11,14 +11,20 @@
import conduit.datatypes.Video as Video
import gobject
-import pygst
-pygst.require('0.10')
-import gst
-from gst.extend import discoverer
-
-MODULES = {
- "AudioVideoConverter" : { "type": "converter" }
-}
+
+try:
+ import gst
+ from gst.extend import discoverer
+ from gst import Pipeline
+ MODULES = {
+ "AudioVideoConverter" : { "type": "converter" }
+ }
+ log.info("Module Information: %s" % Utils.get_module_information(gst, "pygst_version"))
+except ImportError:
+ class Pipeline:
+ pass
+ MODULES = {}
+ log.info("GStreamer transcoding disabled")
'''
GStreamer Conversion properties
@@ -48,7 +54,7 @@
specified, the other is calculated to keep the video proportional.
'''
-class GStreamerConversionPipeline(gst.Pipeline):
+class GStreamerConversionPipeline(Pipeline):
"""
Converts between different multimedia formats.
This class is event-based and needs a mainloop to work properly.
@@ -72,7 +78,7 @@
def __init__(self, **kwargs):
- gst.Pipeline.__init__(self)
+ Pipeline.__init__(self)
#if 'file_mux' not in kwargs:
# raise Exception('Output file format not specified')
self._has_video_enc = ('vcodec' in kwargs) or ('vcodec_pass1' in kwargs) or ('vcodec_pass2' in kwargs)
Modified: trunk/conduit/utils/MediaFile.py
==============================================================================
--- trunk/conduit/utils/MediaFile.py (original)
+++ trunk/conduit/utils/MediaFile.py Fri Aug 22 14:33:58 2008
@@ -1,14 +1,15 @@
+import threading
import conduit
import conduit.datatypes.File as File
import logging
log = logging.getLogger("datatypes.Audio")
-import pygst
-pygst.require('0.10')
-import gst
-from gst.extend import discoverer
-import threading
-from threading import Lock
+try:
+ import gst
+ from gst.extend import discoverer
+ GST_AVAILABLE = False
+except ImportError:
+ GST_AVAILABLE = False
class MediaFile(File.File):
@@ -46,11 +47,11 @@
return tags
def _get_metadata(self, name):
- tags = self.get_media_tags()
- if name in tags:
- return tags[name]
- else:
- return None
+ if GST_AVAILABLE:
+ tags = self.get_media_tags()
+ if name in tags:
+ return tags[name]
+ return None
def __getattr__(self, name):
# Get metadata only when needed
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]