Transmit absolute time

Pietro Bonfa' pietro_bonfa at yahoo.it
Sat Oct 24 07:07:51 PDT 2015


On 10/24/2015 01:08 PM, Sebastian Dröge wrote:
> On Sa, 2015-10-24 at 12:52 +0200, Pietro Bonfa' wrote:
>> On 10/23/2015 09:38 AM, Sebastian Dröge wrote:
>>> That the base time is not known when the first buffer happens in
>>> the
>>> source is indeed a problem. How are you generating buffers and
>>> when?
>>
>> Yes, the buffers are generated by appsrc. They are generated when the
>> callback function connected to the "need-data" signal is called so I
>> assumed that checking the state of the pipeline was not needed.
>> I will check that in the real implementation running_time + base_time
>> gives exactly the time when the buffer is captured and report back.
> 
> Are you timestamping the buffers outside appsrc yourself, or using the
> do-timestamp=true property?

I'm using this DIY approach (reporting relevant code from the attachment
of the previous email also available here
https://github.com/bonfus/GstMadness/blob/master/AppSrcAndSync/test7.c)


static uint frame_count = 0;
ctx->timestamp = gst_util_uint64_scale_int (1, GST_SECOND, 2) * frame_count;

// simulate wait for camera to produce frame
struct timespec a;
a.tv_sec=0;
a.tv_nsec=100;
while (ctx->timestamp > (gst_clock_get_time (global_clock)-ctx->begin))
{
  nanosleep(&a, NULL);
}

GST_BUFFER_PTS (buffer) = ctx->timestamp;

However let me mention that this is just some (bad) code I wrapped from
various examples in order to learn something about timestamping. I don't
really care if the code is wrong. I care to know that my conclusion from
the previous post were wrong as you told me!

> 
>> Finally, just to keep you posted, I implemented metadata in the
>> GstElement that parses the RTP extension and then I discovered that
>> metadata are generally not copied through the pipeline (damn!).
> 
> If you're using 1.6, generic metadata will be copied over. If an
> element doesn't you found a bug :)

Is there a special definition for generic metadata?

I found that identity, queue and tee copy my metadata while rtph264depay
doesn't.

> 
> Which tags did you use to register your metadata?
> 

Initially I just used some dummy values like

static const gchar *tags[] = { "id", "val", NULL };

(full code
https://github.com/bonfus/GstMadness/blob/master/atime/gstrtpatimemeta.c)

then, after I saw your email, I changed those values to something else like:

static const gchar *tags[] = { "atime", "buf", NULL };
or
static const gchar *tags[] = { "memory", "colorspace", "size", NULL };
// from gstvideometa


but this didn't change anything and honestly I do not understand why
these tags are important (nothing about it in the docs, I thought they
were just meant to be used by the user with gst_meta_api_type_get_tags.

Many thanks,
Pietro


> 
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
> 



More information about the gstreamer-devel mailing list