[FFmpeg-devel] [PATCH] lavc/mediacodecdec_h264: use ff_h264_decode_extradata to extract PPS/SPS

Hendrik Leppkes h.leppkes at gmail.com
Mon Jun 13 12:23:07 CEST 2016


On Mon, Jun 13, 2016 at 11:51 AM, Matthieu Bouron
<matthieu.bouron at gmail.com> wrote:
> On Fri, Jun 10, 2016 at 03:08:48PM +0200, Matthieu Bouron wrote:
>> From: Matthieu Bouron <matthieu.bouron at stupeflix.com>
>>
>> Fixes playback of HLS streams on MediaTek devices which requires PPS/SPS
>> to be set in their respective csd-{0,1} buffers.
>> ---
>>
>> Hello,
>>
>> The attached patch fixes playback of HLS streams on MediaTek devices which
>> requires PPS/SPS to be set in their respetive csd-{0,1} buffers (instead of
>> having sps+pps in the csd-0 which works on other devices).
>>
>> I'm not sure if I can use the ff_h264_decode_extradata this way (or at least
>> initialize the H264Context with zeroes minus the avctx field).
>
> Rebased patch (after the h264 ps merged) attached.
>
> I still have the same question, is my use of
> H264Context + ff_h264_decode_extradata correct ?
>

Using H264 decoder internals seems to be a rather unfortunate
solution, as its prone to breakage, often subtle, as the h264 decoder
gets changed and not all inter-module dependencies are known.
So if possible at all, not using something that uses H264Context for
example would be nice.

For the record, ff_h264_decode_extradata is scheduled for refactoring
to make it independent of H264Context so it can be more easily shared
with the h264 decoder and the h264 parser.
Once that is done, it may give you a cleaner interface to use it from
mediacodec as well.

- Hendrik


More information about the ffmpeg-devel mailing list