Assorted fixes.
authorWim Taymans <wim.taymans@gmail.com>
Sun, 3 Feb 2002 20:10:03 +0000 (20:10 +0000)
committerWim Taymans <wim.taymans@gmail.com>
Sun, 3 Feb 2002 20:10:03 +0000 (20:10 +0000)
Original commit message from CVS:
Assorted fixes.
Use the new clocking stuff.

configure.ac
ext/sdl/sdlvideosink.c

index 91be69f5de2f531c0791aacace3ebf2855639a10..1c183b1892499f5e536f616cd85881f3fdbfb62c 100644 (file)
@@ -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
index d84cde3c871638988e66ebc2927db63a7860ecb6..29305826142c2f1e94d06f4a7ceeb0f569d22383 100644 (file)
@@ -23,6 +23,7 @@
 #include <signal.h>
 #include <string.h>
 #include <sys/time.h>
+#include <stdlib.h>
 
 #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 )