Changeset 469
- Timestamp:
- 23-05-11 20:05:31 (2 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
morituri/common/encode.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ChangeLog
r468 r469 1 2011-05-23 Thomas Vander Stichele <thomas at apestaart dot org> 2 3 * morituri/common/encode.py: 4 Convert TagReadTask to gstreamer.GstPipelineTask and 5 remove lots of duplicate code. 6 1 7 2011-05-23 Thomas Vander Stichele <thomas at apestaart dot org> 2 8 -
trunk/morituri/common/encode.py
r468 r469 252 252 self.warning('No peak found, something went wrong!') 253 253 254 class TagReadTask( task.Task):254 class TagReadTask(gstreamer.GstPipelineTask): 255 255 """ 256 256 I am a task that reads tags. … … 273 273 self._path = path 274 274 275 def start(self, runner): 276 task.Task.start(self, runner) 277 278 # here to avoid import gst eating our options 279 import gst 280 281 self._pipeline = gst.parse_launch(''' 275 def getPipelineDesc(self): 276 return ''' 282 277 filesrc location="%s" ! 283 278 decodebin name=decoder ! 284 279 fakesink''' % ( 285 common.quoteParse(self._path).encode('utf-8'))) 286 287 self.debug('pausing pipeline') 288 self._pipeline.set_state(gst.STATE_PAUSED) 289 ret = self._pipeline.get_state() 290 self.debug('paused pipeline, get_state returned %r', ret) 291 292 # add eos handling 293 bus = self._pipeline.get_bus() 294 bus.add_signal_watch() 295 bus.connect('message::eos', self._message_eos_cb) 296 297 # set up tag callbacks 298 bus.connect('message::tag', self._message_tag_cb) 299 300 def play(): 301 self._pipeline.set_state(gst.STATE_PLAYING) 302 return False 303 self.runner.schedule(0, play) 304 305 def _message_eos_cb(self, bus, message): 280 common.quoteParse(self._path).encode('utf-8')) 281 282 def bus_eos_cb(self, bus, message): 306 283 self.debug('eos, scheduling stop') 307 284 self.runner.schedule(0, self.stop) 308 285 309 def _message_tag_cb(self, bus, message):286 def bus_tag_cb(self, bus, message): 310 287 taglist = message.parse_tag() 311 288 self.taglist = taglist 312 313 def stop(self):314 # here to avoid import gst eating our options315 import gst316 317 self.debug('stopping')318 self.debug('setting state to NULL')319 self._pipeline.set_state(gst.STATE_NULL)320 self.debug('set state to NULL')321 task.Task.stop(self)322 289 323 290 class TagWriteTask(task.Task):
Note: See TracChangeset
for help on using the changeset viewer.
