[FFmpeg-devel] [PATCH] H.264 timestamps in h264_parser - complete set

Michael Niedermayer michaelni
Wed Feb 18 15:48:00 CET 2009


On Wed, Feb 18, 2009 at 03:12:24PM +0100, Ivan Schreter wrote:
> Michael Niedermayer wrote:
>> On Wed, Feb 18, 2009 at 12:33:57PM +0100, Ivan Schreter wrote:
>>   
>>> Michael Niedermayer wrote:
>>> [...]
>>>     
>>>> I do not like this implementation
>>>> its not hard to add a keyframe field and set that to -1 by default
>>>> and treat that default as I_TYPE == keyframe
>>>>         
>>> I can do that easily (also wanted originally), but what about binary 
>>> compatibility? If I add a field, minor version must be bumped up, right? 
>>> How do I do that?
>>>     
>>
>> you increase minor by 1 and rest micro to 0
>>
>>
>>   
>>> Furthermore, lavf must check version of lavc whether the field exists at 
>>> all.
>>>
>>> Again, no problem to go this way, but I simply don't know how to do it 
>>> correctly. Please explain in more detail (and maybe a howto on FFmpeg 
>>> website would be also a good investition :-).
>>>
>>> Or do we expect to have same SVN revision of lavf and lavc on the system 
>>> (at least under same major/minor)?
>>>     
>>
>> lets assume we now have
>> lavc 1.2.3
>> lavf 2.3.4
>> then when keyframe is added
>> lavc 1.3.0
>> lavf 2.3.5 would depend on lavc >= 1.3.0
>> the old 2.3.4 would work with 1.3.0 as well
>>
>>   
>
> OK, so the attached key frame patch should do it. 

> How do I express the 
> dependency?

well, it does not seem we do express that currently though it could be
done in libavformat/libavformat.pc i suspect not that i know the syntax or
ask you to do that.


[...]
> Index: libavformat/utils.c
> ===================================================================
> --- libavformat/utils.c	(revision 17429)
> +++ libavformat/utils.c	(working copy)
> @@ -899,8 +899,21 @@
>      else if (pc) {
>          pkt->flags = 0;
>          /* keyframe computation */

> -            if (pc->pict_type == FF_I_TYPE)
> +        switch (pc->key_frame) {
> +            case 0:
> +                // not a key frame
> +                break;
> +            case -1:
> +                // not set, use fallback via picture type
> +                if (pc->pict_type == FF_I_TYPE) {
> +                    pkt->flags |= PKT_FLAG_KEY;
> +                }
> +                break;
> +            default:
> +                // key frame
>                  pkt->flags |= PKT_FLAG_KEY;
> +                break;
> +        }

if(pc->key_frame==1)
    pkt->flags |= PKT_FLAG_KEY;
else if(pc->key_frame==-1 && pc->pict_type == FF_I_TYPE)
    pkt->flags |= PKT_FLAG_KEY;


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I do not agree with what you have to say, but I'll defend to the death your
right to say it. -- Voltaire
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090218/e700ec6d/attachment.pgp>



More information about the ffmpeg-devel mailing list