InDashPC.org Forum Index InDashPC.org
In Dash Car PC forum
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Multiple monitors in pymedia?

 
Post new topic   Reply to topic    InDashPC.org Forum Index -> Software
View previous topic :: View next topic  
Author Message
feesta
Newbie


Joined: 04 Nov 2005
Posts: 9
Location: Pittsburgh

PostPosted: Thu Dec 08, 2005 7:10 am    Post subject: Multiple monitors in pymedia? Reply with quote

If I have two monitors running in X, using pymedia, can I output video to them seperately? I'm setting up kind of a video jukebox with multiple screens.
Thanks!
Back to top
View user's profile Send private message Visit poster's website
jbors
Site Admin


Joined: 12 Nov 2004
Posts: 1675

PostPosted: Thu Dec 08, 2005 9:43 am    Post subject: Reply with quote

pymedia itself does not define the video where you want the data to be rendered.
Instead you can create video surfaces on a display of your choice and play video there. See player.py example in a latest pymedia.
Code:
class PlayerCallback:
  # ------------------------------------
  def __init__( self ):
    self.overlay= None
 
  # ------------------------------------
  def removeOverlay( self ):
    # Remove overlay if any
    self.overlay= None
 
  # ------------------------------------
  def createOverlay( self, vfr ):
    # Create overlay if any
    self.overlay= pygame.Overlay( YV12, vfr.size )
    # Locate overlay on the screen
    res= pygame.display.get_surface().get_size()
    self.overlay.set_location( (0,0)+res )
 
  # ------------------------------------
  # Process incoming audio data ( usefull for visualization or sound post processing )
  # You can return audio stream as a string once you did something to it
  def onAudioReady( self, afr ):
    pass
   
  # ------------------------------------
  def onVideoReady( self, vfr ):
    if not self.overlay:
      self.createOverlay( vfr )
   
    # Display it
    try:
      # Part for a new pydfb and pygame syntax
      self.overlay.set_data( vfr.data )
      self.overlay.display()
    except:
      # old pygame syntax if any
      self.overlay.display( vfr.data )

So open player instance and pass the callback which will render to an appropriate monitor...
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    InDashPC.org Forum Index -> Software All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group