summaryrefslogtreecommitdiffstats
path: root/ext/sdl
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@gmail.com>2002-05-26 21:59:21 +0000
committerWim Taymans <wim.taymans@gmail.com>2002-05-26 21:59:21 +0000
commitd18d4fd5a1986d59af029a482e094a3707828438 (patch)
treebeacf1328f92d1827aed3be348f607dca5d0839d /ext/sdl
parentcff445b737c736d65b85d861dbe9baeb28c5ae50 (diff)
downloadgst-plugins-bad-d18d4fd5a1986d59af029a482e094a3707828438.tar.gz
gst-plugins-bad-d18d4fd5a1986d59af029a482e094a3707828438.tar.bz2
gst-plugins-bad-d18d4fd5a1986d59af029a482e094a3707828438.zip
- Changed plugins for new APIs
Original commit message from CVS: - Changed plugins for new APIs - modularized audiofile. - added seeking, query and convert functions for mad, mpeg2dec, avidemux, mpegdemux, mpegparse - sync updates to oss. removed the ossclock for now
Diffstat (limited to 'ext/sdl')
-rw-r--r--ext/sdl/sdlvideosink.c33
1 files changed, 26 insertions, 7 deletions
diff --git a/ext/sdl/sdlvideosink.c b/ext/sdl/sdlvideosink.c
index 065a0c0b..244d9a7a 100644
--- a/ext/sdl/sdlvideosink.c
+++ b/ext/sdl/sdlvideosink.c
@@ -190,6 +190,7 @@ gst_sdlvideosink_init (GstSDLVideoSink *sdlvideosink)
GST_ELEMENT (sdlvideosink)->setclockfunc = gst_sdlvideosink_set_clock;
GST_FLAG_SET(sdlvideosink, GST_ELEMENT_THREAD_SUGGESTED);
+ GST_FLAG_SET(sdlvideosink, GST_ELEMENT_EVENT_AWARE);
}
@@ -399,7 +400,7 @@ static void
gst_sdlvideosink_chain (GstPad *pad, GstBuffer *buf)
{
GstSDLVideoSink *sdlvideosink;
- SDL_Event event;
+ SDL_Event sdl_event;
g_return_if_fail (pad != NULL);
g_return_if_fail (GST_IS_PAD (pad));
@@ -407,24 +408,42 @@ gst_sdlvideosink_chain (GstPad *pad, GstBuffer *buf)
sdlvideosink = GST_SDLVIDEOSINK (gst_pad_get_parent (pad));
- GST_DEBUG (0,"videosink: clock wait: %llu", GST_BUFFER_TIMESTAMP(buf));
- while (SDL_PollEvent(&event))
+ while (SDL_PollEvent(&sdl_event))
{
- switch(event.type)
+ switch(sdl_event.type)
{
case SDL_VIDEORESIZE:
/* create a SDL window of the size requested by the user */
- sdlvideosink->window_width = event.resize.w;
- sdlvideosink->window_height = event.resize.h;
+ sdlvideosink->window_width = sdl_event.resize.w;
+ sdlvideosink->window_height = sdl_event.resize.h;
gst_sdlvideosink_create(sdlvideosink, FALSE);
break;
}
}
+ if (GST_IS_EVENT (buf)) {
+ GstEvent *event = GST_EVENT (buf);
+ gint64 offset;
+
+ switch (GST_EVENT_TYPE (event)) {
+ case GST_EVENT_DISCONTINUOUS:
+ offset = GST_EVENT_DISCONT_OFFSET (event, 0).value;
+ g_print ("sdl discont %lld\n", offset);
+ gst_clock_handle_discont (sdlvideosink->clock, (guint64) GST_EVENT_DISCONT_OFFSET (event, 0).value);
+ break;
+ default:
+ gst_pad_event_default (pad, event);
+ break;
+ }
+ gst_event_free (event);
+ return;
+ }
+
+ GST_DEBUG (0,"videosink: clock wait: %llu", GST_BUFFER_TIMESTAMP(buf));
if (sdlvideosink->clock) {
gst_element_clock_wait (GST_ELEMENT (sdlvideosink),
- sdlvideosink->clock, GST_BUFFER_TIMESTAMP (buf));
+ sdlvideosink->clock, GST_BUFFER_TIMESTAMP (buf), NULL);
}
if (!gst_sdlvideosink_lock(sdlvideosink))