[FFmpeg-devel] [PATCH 2/2] v4l2: allow to convert monotonic timestamps.

Luca Abeni lucabe72 at email.it
Mon Mar 26 14:20:10 CEST 2012

Hi all,

On 03/21/2012 09:32 PM, Michael Niedermayer wrote:
> On Wed, Mar 21, 2012 at 07:52:24PM +0100, Nicolas George wrote:
>> L'octidi 18 ventôse, an CCXX, Nicolas George a écrit :
>>> Signed-off-by: Nicolas George<nicolas.george at normalesup.org>
>>> ---
>>>   configure            |    2 +
>>>   doc/indevs.texi      |    7 +++++
>>>   libavdevice/Makefile |    2 +-
>>>   libavdevice/v4l2.c   |   72 ++++++++++++++++++++++++++++++++++++++++++++++++++
>>>   4 files changed, 82 insertions(+), 1 deletions(-)
>> Ping?
> luca, do you have time to review the patch ?
I finally found the time to look at this patch... I found it on the mailing list
archives, here:
(please correct me if I looked at the wrong version of the patch).

I think the concept (allowing to convert from monotonic timestamps to
gettimeofday() times) is very good; I just have some questions on the
It seems to me that detect_timestamp() is invoked only when ts_mode == V4L_TS_ABS,
(use absolute timestamps) and it will either set ts_mode = V4L_TS_DEFAULT or fail...
What is the exact meaning of V4L_TS_ABS? Based on the source code, I'd call it
V4L_TS_AUTODETECT (isn't this what it is really doing?).
And I'd also offer an option to always perform the conversion, without any kind
of autodetection.
Regarding the timestamps filtering code, I think it is ok if tested.

Also, it seems to me that the patch is adding two options (-ts and -timestamps) to
do the same thing... Why?

Finally, maybe (but I am not sure about this) av_gettime_monotonic() can be moved
to libavformat/utils.c, where av_gettime() already is.


More information about the ffmpeg-devel mailing list