mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-18 07:47:17 +00:00
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:
parent
6c3fc7a16d
commit
c057fef347
1 changed files with 25 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue