diff options
author | Aaron Bockover <abockover@novell.com> | 2010-05-01 16:19:34 -0400 |
---|---|---|
committer | Gabriel Burt <gabriel.burt@gmail.com> | 2010-05-05 13:00:20 -0700 |
commit | 074a32f7a180350aff599a0e90a178c5667403ac (patch) | |
tree | 034fb31974ce89d57e7bdbac2bd4bec76627cdcc /libbanshee | |
parent | b9d78821e3dc28dd1f5426c68b854a96f869fb0e (diff) |
[XOverlay] fix video embed bnc#585817, bgo#548635
GStreamer requires an X11 window handle to be set on the XOverlay
interface of the video sink in order to render video. If one is not set
in time, GStreamer will create its own X window. Closing this window
will result in a crash, since it becomes unrealized, after which
GStreamer will continue to try to render to it.
Before, the X11 video window was created when the Now Playing UI
was realized. The window is now created when the pipeline is created, by
raising the new PrepareVideoWindow event. Technically, this event should
be raised when the prepare-xwindow-id message is pushed onto the
pipeline bus, but this is raised out of the main thread.
Diffstat (limited to 'libbanshee')
-rw-r--r-- | libbanshee/banshee-player-private.h | 2 | ||||
-rw-r--r-- | libbanshee/banshee-player-video.c | 10 |
2 files changed, 12 insertions, 0 deletions
diff --git a/libbanshee/banshee-player-private.h b/libbanshee/banshee-player-private.h index 3e0ad26e0..66ee2a778 100644 --- a/libbanshee/banshee-player-private.h +++ b/libbanshee/banshee-player-private.h @@ -98,6 +98,7 @@ typedef void (* BansheePlayerVisDataCallback) (BansheePlayer *player, gint typedef void (* BansheePlayerNextTrackStartingCallback) (BansheePlayer *player); typedef void (* BansheePlayerAboutToFinishCallback) (BansheePlayer *player); typedef GstElement * (* BansheePlayerVideoPipelineSetupCallback) (BansheePlayer *player, GstBus *bus); +typedef void (* BansheePlayerVideoPrepareWindowCallback) (BansheePlayer *player); typedef void (* BansheePlayerVolumeChangedCallback) (BansheePlayer *player, gdouble new_volume); typedef void (* BansheePlayerVideoGeometryNotifyCallback) (BansheePlayer *player, gint width, gint height, gint fps_n, gint fps_d, gint par_n, gint par_d); @@ -119,6 +120,7 @@ struct BansheePlayer { BansheePlayerNextTrackStartingCallback next_track_starting_cb; BansheePlayerAboutToFinishCallback about_to_finish_cb; BansheePlayerVideoPipelineSetupCallback video_pipeline_setup_cb; + BansheePlayerVideoPrepareWindowCallback video_prepare_window_cb; BansheePlayerVolumeChangedCallback volume_changed_cb; BansheePlayerVideoGeometryNotifyCallback video_geometry_notify_cb; diff --git a/libbanshee/banshee-player-video.c b/libbanshee/banshee-player-video.c index e757a9944..e092095bb 100644 --- a/libbanshee/banshee-player-video.c +++ b/libbanshee/banshee-player-video.c @@ -251,6 +251,10 @@ _bp_video_pipeline_setup (BansheePlayer *player, GstBus *bus) #endif #endif + + if (player->video_prepare_window_cb != NULL) { + player->video_prepare_window_cb (player); + } } P_INVOKE void @@ -265,6 +269,12 @@ bp_set_video_geometry_notify_callback (BansheePlayer *player, BansheePlayerVideo SET_CALLBACK (video_geometry_notify_cb); } +P_INVOKE void +bp_set_video_prepare_window_callback (BansheePlayer *player, BansheePlayerVideoPrepareWindowCallback cb) +{ + SET_CALLBACK (video_prepare_window_cb); +} + // --------------------------------------------------------------------------- // Public Functions // --------------------------------------------------------------------------- |