Set a fraction value

Tim-Philipp Müller t.i.m at zen.co.uk
Tue May 14 01:59:23 PDT 2013


On Tue, 2013-05-14 at 07:34 +0200, Jorge Fernandez Monteagudo wrote:

Hi,

> I have another begginer question. I'm trying to set a framerate fraction value in C code.
> I can set the value through the command line
> 
> gst-launch-0.10 ....   ! TIViddec2 engineName=codecServer framerate=24/1 ! ....
> 
> but when I try to implement this on code I do
> 
>   gdouble framerate = 24.0 / 1.0;
>   g_object_set( G_OBJECT(video_decode), "framerate", framerate, NULL );
> 
> is it correct?

I'm going to assume that the "framerate" property is of a fraction type
and not a double type. If so, you have to do:

  g_object_set (video_decode, "framerate", 24, 1, NULL);

or

  gst_util_set_object_arg (G_OBJECT (video_decode), "framerate",
"24/1");

Cheers
 -Tim



More information about the gstreamer-devel mailing list