diff --git a/framework/subsystems/odeviced/audio.py b/framework/subsystems/odeviced/audio.py
index 3e03931..ec3a977 100644
|
a
|
b
|
class GStreamerPlayer( Player ): |
| 98 | 98 | A Gstreamer based Player. |
| 99 | 99 | """ |
| 100 | 100 | |
| 101 | | decoderMap = { \ |
| 102 | | "sid": "siddec", |
| 103 | | "mod": "modplug", |
| 104 | | "mp3": "mad", |
| 105 | | "wav": "wavparse", |
| 106 | | } |
| 107 | | |
| 108 | 101 | def __init__( self, *args, **kwargs ): |
| 109 | 102 | Player.__init__( self, *args, **kwargs ) |
| 110 | 103 | self.pipelines = {} |
| … |
… |
class GStreamerPlayer( Player ): |
| 166 | 159 | else: |
| 167 | 160 | pipeline = self.createPipeline( name ) |
| 168 | 161 | if pipeline is None: |
| 169 | | error_cb( UnknownFormat( "known formats are %s" % self.decoderMap.keys() ) ) |
| | 162 | error_cb( NoPipeline( "The GStreamer pipeline was not created" ) ) |
| 170 | 163 | else: |
| 171 | 164 | bus = pipeline.get_bus() |
| 172 | 165 | bus.add_signal_watch() |
| … |
… |
class GStreamerPlayer( Player ): |
| 189 | 182 | ok_cb() |
| 190 | 183 | |
| 191 | 184 | def createPipeline( self, name ): |
| 192 | | try: |
| 193 | | decoder = GStreamerPlayer.decoderMap[ name.split( '.' )[-1] ] |
| 194 | | except KeyError: |
| 195 | | return None |
| 196 | | else: |
| 197 | | # parse_launch may burn a few cycles compared to element_factory_make, |
| 198 | | # however it should still be faster than creating the pipeline from |
| 199 | | # individual elements in python, since it's all happening in compiled code |
| 200 | | return gst.parse_launch( "filesrc location=%s ! %s ! alsasink" % ( name, decoder ) ) |
| | 185 | # parse_launch may burn a few cycles compared to element_factory_make, |
| | 186 | # however it should still be faster than creating the pipeline from |
| | 187 | # individual elements in python, since it's all happening in compiled code |
| | 188 | return gst.parse_launch( "filesrc location=%s ! decodebin ! audioconvert ! alsasink" % ( name ) ) |
| 201 | 189 | |
| 202 | 190 | #----------------------------------------------------------------------------# |
| 203 | 191 | class AlsaScenarios( object ): |