From: Wim Taymans Date: Sun, 3 Feb 2002 20:10:03 +0000 (+0000) Subject: Assorted fixes. X-Git-Tag: 1.19.3~507^2~25075 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fac29d09ff70d5faa2ee6fc38e827d6bffb8c6f2;p=platform%2Fupstream%2Fgstreamer.git Assorted fixes. Original commit message from CVS: Assorted fixes. Use the new clocking stuff. --- diff --git a/configure.ac b/configure.ac index 91be69f5de..1c183b1892 100644 --- a/configure.ac +++ b/configure.ac @@ -763,6 +763,7 @@ gst/chart/Makefile gst/cutter/Makefile gst/deinterlace/Makefile gst/flx/Makefile +gst/goom/Makefile gst/intfloat/Makefile gst/law/Makefile gst/level/Makefile @@ -835,6 +836,7 @@ ext/shout/Makefile ext/sidplay/Makefile ext/smoothwave/Makefile ext/vorbis/Makefile +ext/tarkin/Makefile ext/xmms/Makefile gst-libs/Makefile gst-libs/gst/Makefile diff --git a/ext/sdl/sdlvideosink.c b/ext/sdl/sdlvideosink.c index d84cde3c87..2930582614 100644 --- a/ext/sdl/sdlvideosink.c +++ b/ext/sdl/sdlvideosink.c @@ -23,6 +23,7 @@ #include #include #include +#include #include "sdlvideosink.h" @@ -152,6 +153,16 @@ gst_sdlvideosink_class_init (GstSDLVideoSinkClass *klass) } +static void +gst_sdlvideosink_set_clock (GstElement *element, GstClock *clock) +{ + GstSDLVideoSink *sdlvideosink; + + sdlvideosink = GST_SDLVIDEOSINK (element); + + sdlvideosink->clock = clock; +} + static void gst_sdlvideosink_init (GstSDLVideoSink *sdlvideosink) { @@ -161,9 +172,6 @@ gst_sdlvideosink_init (GstSDLVideoSink *sdlvideosink) gst_pad_set_chain_function (sdlvideosink->sinkpad, gst_sdlvideosink_chain); gst_pad_set_connect_function (sdlvideosink->sinkpad, gst_sdlvideosink_sinkconnect); - sdlvideosink->clock = gst_clock_get_system(); - gst_clock_register(sdlvideosink->clock, GST_OBJECT(sdlvideosink)); - sdlvideosink->window_width = -1; sdlvideosink->window_height = -1; @@ -177,6 +185,9 @@ gst_sdlvideosink_init (GstSDLVideoSink *sdlvideosink) sdlvideosink->capslist = capslist; + sdlvideosink->clock = NULL; + GST_ELEMENT (sdlvideosink)->setclockfunc = gst_sdlvideosink_set_clock; + GST_FLAG_SET(sdlvideosink, GST_ELEMENT_THREAD_SUGGESTED); } @@ -320,7 +331,6 @@ static void gst_sdlvideosink_chain (GstPad *pad, GstBuffer *buf) { GstSDLVideoSink *sdlvideosink; - GstClockTimeDiff jitter; SDL_Event event; g_return_if_fail (pad != NULL); @@ -344,15 +354,9 @@ gst_sdlvideosink_chain (GstPad *pad, GstBuffer *buf) } } - jitter = gst_clock_current_diff(sdlvideosink->clock, GST_BUFFER_TIMESTAMP (buf)); - - if (jitter > 500000 || jitter < -500000) - { - GST_DEBUG (0, "jitter: %lld\n", jitter); - gst_clock_set (sdlvideosink->clock, GST_BUFFER_TIMESTAMP (buf)); - } - else { - gst_clock_wait(sdlvideosink->clock, GST_BUFFER_TIMESTAMP(buf), GST_OBJECT(sdlvideosink)); + if (sdlvideosink->clock) { + gst_element_clock_wait (GST_ELEMENT (sdlvideosink), + sdlvideosink->clock, GST_BUFFER_TIMESTAMP (buf)); } /* Lock SDL/yuv-overlay */ @@ -482,7 +486,7 @@ gst_sdlvideosink_change_state (GstElement *element) else { char SDL_hack[32]; - sprintf(SDL_hack, "%ld", sdlvideosink->window_id); + sprintf(SDL_hack, "%d", sdlvideosink->window_id); setenv("SDL_WINDOWID", SDL_hack, 1); } if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_NOPARACHUTE) < 0 )