[FFmpeg-devel] [PATCH] move avc sps/pps generation in a function in movenc

Aurelien Jacobs aurel
Fri Jan 11 01:41:19 CET 2008


Baptiste Coudurier wrote:

> Hi,
> 
> Aurelien Jacobs wrote:
> > Baptiste Coudurier wrote:
> > 
> >> Hi
> >>
> >> Aurelien Jacobs wrote:
> >>> Hi,
> >>>
> >>> The attached patch moves the avc sps/pps generation code in a
> >>> function. The final goal is to reuse this function from
> >>> matroskaenc (and so the next step will obviously be to move this
> >>> func in its own file). Is this patch OK ?
> >>>
> >>> Aurel
> >>>
> >>>
> >>>  {
> >>>      ByteIOContext *pb;
> >>> -    uint8_t *p = *buf;
> >>> +    uint8_t *p = buf_in;
> >>>      uint8_t *end = p + *size;
> >>>      uint8_t *nal_start, *nal_end;
> >>>      int ret = url_open_dyn_buf(&pb);
> >>> @@ -475,22 +475,20 @@
> >>>      return 0;
> >>>  }
> >>>  
> >>> -static int mov_write_avcc_tag(ByteIOContext *pb, MOVTrack *track)
> >>> +static int avc_write_sps_pps(ByteIOContext *pb, uint8_t *data,
> >>> int len)
> >> This specific formating was defined by iso and meant to be put in
> >> 'avcC' atom in iso media, loosing this information would be sad
> >> IMHO, I'd prefer something like isom_write_avcc.
> > 
> > And this specific formatting is also described in the matroska
> > spec...

Right.

> I guess pasted from iso specs.
> 
> > So I thought that describing what the function does instead of who
> > specified it, was more useful.
> > But if you insist, I will change the name. I don't care about it.
> 
> IMHO avc_write_sps_pps is not adequate due to the specific formatting,
> so yes please.

OK.

> > So, now, do you think the patch is OK, and do you want me to rename
> > the function to isom_write_avcc or not ?
> 
> Yes, parts are OK, checking return value for avc_parse_nal_units (both
> cases),

Will do.

> then to correctly split parts in commits IMHO, extract
> isom_write_avcc function, and then change prototype of
> avc_parse_nal_units.

Unfortunately, I can't use current avc_parse_nal_units prototype
along with my definition of isom_write_avcc. So I would also need
to change avc_parse_nal_units prototype (and code) later. That's
not very nice, and IMO overkill. So I guess I will commit
avc_parse_nal_units prototype change along with isom_write_avcc
function extraction.

Aurel




More information about the ffmpeg-devel mailing list