[gst-devel] frame_time hack

Xavier Bestel xavier.bestel at free.fr
Wed Sep 26 13:02:02 CEST 2001


Hi !

I just implemented frame_time parameter for xvideosink.c
However I use plain gtk1.2, so have no 64bits types for GValue and
GtkArg. As a consequence it's a bit hacky.

Here we go:

Index: xvideosink.c
===================================================================
RCS file: /cvsroot/gstreamer/gstreamer/plugins/xvideosink/xvideosink.c,v
retrieving revision 1.22
diff -u -r1.22 xvideosink.c
--- xvideosink.c	2001/09/10 19:00:42	1.22
+++ xvideosink.c	2001/09/26 19:52:18
@@ -465,6 +465,7 @@
   }
   g_mutex_unlock (xvideosink->lock);
 
+  xvideosink->frame_time = GST_BUFFER_TIMESTAMP(buf);
   g_signal_emit(G_OBJECT(xvideosink),gst_xvideosink_signals[SIGNAL_FRAME_DISPLAYED],0);
 
   gst_buffer_unref(buf);
@@ -494,7 +495,8 @@
       xvideosink->frames_displayed = g_value_get_int (value);
       break;
     case ARG_FRAME_TIME:
-      xvideosink->frame_time = g_value_get_int (value);
+      //xvideosink->frame_time = g_value_get_int64 (value);
+      xvideosink->frame_time = *(gint64*)value;	//FIXME
       break;
     case ARG_DISABLE_XV:
       xvideosink->disable_xv = g_value_get_boolean (value);
@@ -542,7 +544,8 @@
       break;
     }
     case ARG_FRAME_TIME: {
-      g_value_set_int (value, xvideosink->frame_time/1000000);
+      //g_value_set_int64 (value, xvideosink->frame_time);
+      *(gint64*)value = xvideosink->frame_time;	//FIXME
       break;
     }
     case ARG_DISABLE_XV:


To use it, you'll have to cast by hand the GtkArg like this:

  GtkArg arg;

  arg.name = "frame_time";
  gtk_object_getv(GTK_OBJECT(data), 1, &arg);
  g_print("frame time: %lld\n", *(gint64*)&arg);


unless you have 64bits values in your glib/gtk, of course.

         Xav





More information about the gstreamer-devel mailing list