[vlc-devel] [Patch] Implementing MP4 DEMUX_GET_FPS control query

Hugo Beauzée-Luyssen beauze.h at gmail.com
Thu Oct 8 19:48:09 CEST 2009


On Oct 8, 2009, at 6:22 PM, Jean-Baptiste Kempf <jb at videolan.org> wrote:

> On Mon, Oct 05, 2009 at 04:55:43PM +0200, Hugo Beauzee-Luyssen wrote :
>> This patch add support for the DEMUX_GET_FPS control query, in the  
>> MP4
>> demux, updated with the given recommendations on IRC.
>
> I think this patch is correctly 'showing' the value, but I think that
> the value computed before is not accurate, which is problematic.
>
>> From 4c572be4c4fef464dd5c5470263a88ddfc0200b7 Mon Sep 17 00:00:00  
>> 2001
>> From: Hugo Beauzee-Luyssen <beauze.h at gmail.com>
>> Date: Wed, 23 Sep 2009 15:00:43 +0200
>> Subject: [PATCH] Implementing MP4 DEMUX_GET_FPS control query
>>
>> ---
>> modules/demux/mp4/mp4.c |    8 ++++++--
>> 1 files changed, 6 insertions(+), 2 deletions(-)
>>
>> diff --git a/modules/demux/mp4/mp4.c b/modules/demux/mp4/mp4.c
>> index 76aa37c..724469d 100644
>> --- a/modules/demux/mp4/mp4.c
>> +++ b/modules/demux/mp4/mp4.c
>> @@ -155,6 +155,7 @@ struct demux_sys_t
>>     uint64_t     i_duration;     /* movie duration */
>>     unsigned int i_tracks;       /* number of tracks */
>>     mp4_track_t  *track;         /* array of track */
>> +    float        f_fps;          /* number of frame per seconds */
>>
>>     /* */
>>     MP4_Box_t    *p_tref_chap;
>> @@ -837,8 +838,9 @@ static int Control( demux_t *p_demux, int  
>> i_query, va_list args )
>>             return VLC_SUCCESS;
>>
>>         case DEMUX_GET_FPS:
>> -            msg_Warn( p_demux, "DEMUX_GET_FPS unimplemented !!" );
>> -            return VLC_EGENERIC;
>> +            pf = (double*)va_arg( args, double* );
>> +            *pf = (double)p_sys->f_fps;
>> +            return VLC_SUCCESS;
>>
>>         case DEMUX_GET_META:
>>         {
>> @@ -1518,6 +1520,8 @@ static int TrackCreateES( demux_t *p_demux,  
>> mp4_track_t *p_track,
>>             p_track->fmt.video.i_frame_rate_base =
>>                 p_box->data.p_stts->i_sample_delta[0];
>>         }
>> +        p_demux->p_sys->f_fps = (float)p_track- 
>> >fmt.video.i_frame_rate /
>> +                                (float)p_track- 
>> >fmt.video.i_frame_rate_base;
>>
>>         break;
>>
>> -- 
>> 1.6.3.3
>>
>
>> _______________________________________________
>> vlc-devel mailing list
>> To unsubscribe or modify your subscription options:
>> http://mailman.videolan.org/listinfo/vlc-devel
>
>
>
This value is computed the way vlc computes its own fps information.  
Therefore, I don't see how to do it better, or more accurate.

Regards,



More information about the vlc-devel mailing list