Merge lp://staging/~samuel-buffet/entertainer/ftx2 into lp://staging/entertainer
Proposed by
Samuel Buffet
Status: | Merged | ||||||||
---|---|---|---|---|---|---|---|---|---|
Merged at revision: | not available | ||||||||
Proposed branch: | lp://staging/~samuel-buffet/entertainer/ftx2 | ||||||||
Merge into: | lp://staging/entertainer | ||||||||
To merge this branch: | bzr merge lp://staging/~samuel-buffet/entertainer/ftx2 | ||||||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Matt Layman | Approve | ||
Paul Hummer | Approve | ||
Review via email: mp+2654@code.staging.launchpad.net |
To post a comment you must log in.
Hi,
A small work around the MediaPlayer.
First, I've added error management to the gst pipeline bus handler.
and removed a none used method of the MediaPlayer.
Samuel
the diff : /frontend/ media_player. py' frontend/ media_player. py 2008-12-14 20:01:49 +0000 frontend/ media_player. py 2009-01-06 11:57:34 +0000
=== modified file 'entertainerlib
--- entertainerlib/
+++ entertainerlib/
@@ -8,11 +8,10 @@
# see the pyclutter README for details
import cluttergst
-import clutter
import gst
-from entertainerlib. frontend. gui.widgets. texture import Texture frontend. medialibrary. playable import Playable utils.logger import Logger
from entertainerlib.
+from entertainerlib.
class MediaPlayer( object) :
self. repeat = False # Repeat mode
self. playing = False # Is media player currently playing
"""
@@ -58,6 +57,8 @@
+ self.logger = Logger( ).getLogger( 'frontend. MediaPlayer' )
self. video_texture = cluttergst. VideoTexture( )
self. playbin = self.video_ texture. get_playbin( ) get_bus( ) get_type( ) == Playable. VIDEO_STREAM \
self. video_texture. set_property( "position" , 0)
self. next() texture. set_playing( False) texture. set_property( "position" , 0) parse_error( ) error(" Error: %s" % err, debug)
+
self.bus = self.playbin.
@@ -72,8 +73,6 @@
Callback function that is called every time when message occurs on
Gstreamer messagebus.
"""
- # TODO: Figure out what needs to be done (if anything) with the bus
- # variable on callback
if message.type == gst.MESSAGE_EOS:
if self.media.
or self.playlist is None:
@@ -81,6 +80,11 @@
else:
+ elif message.type == gst.MESSAGE_ERROR:
+ self.video_
+ self.video_
+ err, debug = message.
+ self.logger.
def set_playlist(self, playlist):
y_ offset = -int((fake_height - self.stage_height) / 2)
self. video_texture. set_position( 0, y_offset)
"""
@@ -488,19 +492,3 @@
- def get_texture(self): get_type( ) == Playable. VIDEO_STREAM: CloneTexture( self.video_ texture) get_type( ) == Playable. AUDIO_STREAM: get_album_ art_url( )
- """
- Get media's texture. This is a video texture or album art texture.
- @return: clutter.Actor
- """
- if self.media.
- return clutter.
-
- elif self.media.
- url = self.media.
- if url is not None:
- texture = Texture(url)
- return texture
- else:
- pass #FIXME: Return default album art
-