[FFmpeg-devel] [PATCH] avformat/avcodec: Add DTS-UHD demuxer and parser, movenc support.
Roy Funderburk
royffmpeg at funderburk.us
Wed Jun 14 03:00:38 EEST 2023
On 6/13/23 11:35 AM, Paul B Mahol wrote:
> Doing allocation in probe?
> Probing should be very fast.
In line 143 of the avformat patch, memory allocation is removed from the probe
>>+int dtsuhd_frame(DTSUHD *h, const uint8_t *data, size_t data_bytes,
>>+ DTSUHDFrameInfo *fi, DTSUHDDescriptorInfo *di)
>>+{
>>+ gb = &h->gb;
>>+ init_get_bits(gb, data, data_bytes * 8);
> init_get_bits8, and check return code.
In line 986 of the avcodec patch, changed to using init_get_bits8 and added return code check.
>>+ fi->sync = h->is_sync_frame;
>>+ fi->frame_bytes = h->frame_bytes;
>>+ fi->sample_rate = h->sample_rate;
>>+ fi->sample_count = (h->frame_duration * fi->sample_rate) /(h->clock_rate * fraction);
>>+ fi->duration = (double)fi->sample_count / fi->sample_rate;
>Please no double type.
>Also make use of av_rescale.
Around line 1108 of the avcodec patch, I found the duration was not needed and removed it.
On 6/13/23 12:04 PM, Anton Khirnov wrote:
> Also do note that sharing structs across libraries opens you to various
> compatibility questions [2]. It might be easier to sidestep them by
> having a function in libavcodec that accepts AVCodecParameters and fills
> them according to the data, rather than pass codec-specific structs
> between libavformat and libavcodec.
In line 1061 of the avcodec patch, changed the function to:
int av_dtsuhd_frame(DTSUHD *h, const uint8_t *data, size_t data_bytes,
AVCodecParameters *codecpar, uint8_t **udts, int *udts_size)
Thank you for reviewing this,
-Roy
-------------- next part --------------
An embedded message was scrubbed...
From: Roy Funderburk <royffmpeg at funderburk.us>
Subject: [PATCH] avcodec: Add DTS-UHD parser.
Date: Sat, 15 Apr 2023 13:04:42 -0700
Size: 46690
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20230613/ba47cbd7/attachment.eml>
-------------- next part --------------
An embedded message was scrubbed...
From: Roy Funderburk <royffmpeg at funderburk.us>
Subject: [PATCH] avformat: Add DTS-UHD demuxer and movenc support.
Date: Sat, 15 Apr 2023 13:04:42 -0700
Size: 12533
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20230613/ba47cbd7/attachment-0001.eml>
More information about the ffmpeg-devel
mailing list