avcodecmap: Set AAC/H264/H265 stream-format for demuxer/encoder situations if no codec_data is provided

This fixes output of the above formats from demuxers.
This commit is contained in:
Sebastian Dröge 2020-01-23 10:03:40 +02:00 committed by Sebastian Dröge
parent 6c3fc7a16d
commit c057fef347

View file

@ -1299,6 +1299,14 @@ gst_ffmpeg_codecid_to_caps (enum AVCodecID codec_id,
g_value_unset (&item);
gst_caps_set_value (caps, "stream-format", &arr);
g_value_unset (&arr);
} else {
if (context && context->extradata_size > 0) {
gst_caps_set_simple (caps, "stream-format", G_TYPE_STRING, "avc",
NULL);
} else {
gst_caps_set_simple (caps, "stream-format", G_TYPE_STRING,
"byte-stream", NULL);
}
}
break;
@ -1320,6 +1328,15 @@ gst_ffmpeg_codecid_to_caps (enum AVCodecID codec_id,
g_value_unset (&item);
gst_caps_set_value (caps, "stream-format", &arr);
g_value_unset (&arr);
} else {
if (context && context->extradata_size > 0) {
/* FIXME: Assume hvc1 */
gst_caps_set_simple (caps, "stream-format", G_TYPE_STRING, "hvc1",
NULL);
} else {
gst_caps_set_simple (caps, "stream-format", G_TYPE_STRING,
"byte-stream", NULL);
}
}
break;
@ -1448,12 +1465,18 @@ gst_ffmpeg_codecid_to_caps (enum AVCodecID codec_id,
g_value_unset (&arr);
} else {
gst_caps_set_simple (caps, "mpegversion", G_TYPE_INT, 4,
"stream-format", G_TYPE_STRING, "raw",
"base-profile", G_TYPE_STRING, "lc", NULL);
if (context && context->extradata_size > 0)
if (context && context->extradata_size > 0) {
gst_caps_set_simple (caps, "stream-format", G_TYPE_STRING, "raw",
NULL);
gst_codec_utils_aac_caps_set_level_and_profile (caps,
context->extradata, context->extradata_size);
} else {
/* FIXME: Assume adts */
gst_caps_set_simple (caps, "stream-format", G_TYPE_STRING, "adts",
NULL);
}
}
break;