mirror of https://git.ffmpeg.org/ffmpeg.git
lavc/mediacodecdec: set codec profile and level from extradata for H264+HEVC
This value is later passed to MediaCodec and checked at decoder init. Notably decoding of 10-bit streams before this commit would "work" without returning errors but only return garbage output (on most Android devices).
This commit is contained in:
parent
12f21849e5
commit
b32b32ba89
|
@ -155,6 +155,9 @@ static int h264_set_extradata(AVCodecContext *avctx, FFAMediaFormat *format)
|
|||
uint8_t *data = NULL;
|
||||
int data_size = 0;
|
||||
|
||||
avctx->profile = ff_h264_get_profile(sps);
|
||||
avctx->level = sps->level_idc;
|
||||
|
||||
if ((ret = h2645_ps_to_nalu(sps->data, sps->data_size, &data, &data_size)) < 0) {
|
||||
goto done;
|
||||
}
|
||||
|
@ -236,6 +239,9 @@ static int hevc_set_extradata(AVCodecContext *avctx, FFAMediaFormat *format)
|
|||
uint8_t *data;
|
||||
int data_size;
|
||||
|
||||
avctx->profile = sps->ptl.general_ptl.profile_idc;
|
||||
avctx->level = sps->ptl.general_ptl.level_idc;
|
||||
|
||||
if ((ret = h2645_ps_to_nalu(vps->data, vps->data_size, &vps_data, &vps_data_size)) < 0 ||
|
||||
(ret = h2645_ps_to_nalu(sps->data, sps->data_size, &sps_data, &sps_data_size)) < 0 ||
|
||||
(ret = h2645_ps_to_nalu(pps->data, pps->data_size, &pps_data, &pps_data_size)) < 0) {
|
||||
|
|
Loading…
Reference in New Issue