summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVíctor Manuel Jáquez Leal <vjaquez@igalia.com>2020-01-17 13:38:29 +0100
committerVíctor Manuel Jáquez Leal <vjaquez@igalia.com>2020-01-19 14:57:04 +0100
commit5e26efbcf21e0ebfc35bb92f0f522b9e075082c9 (patch)
treebd039a213179349bc84a63ab821e1ae9c78b14ee
parentd576963979db4b0d657ff45f1927372425c09546 (diff)
vaapih264enc: force byte-stream if avc isn't supported
Removing the validation in gst_vaapiencode_h264_get_caps() since that ought be handled in gst_vaapiencode_h264_set_config()
-rw-r--r--gst/vaapi/gstvaapiencode_h264.c20
1 files changed, 5 insertions, 15 deletions
diff --git a/gst/vaapi/gstvaapiencode_h264.c b/gst/vaapi/gstvaapiencode_h264.c
index 00d04e08..4a3b4acb 100644
--- a/gst/vaapi/gstvaapiencode_h264.c
+++ b/gst/vaapi/gstvaapiencode_h264.c
@@ -298,6 +298,11 @@ gst_vaapiencode_h264_set_config (GstVaapiEncode * base_encode)
tmp_caps = gst_caps_from_string (GST_CODEC_CAPS);
gst_caps_set_simple (tmp_caps, "profile", G_TYPE_STRING,
gst_vaapi_profile_get_name (profile), NULL);
+ if (!gst_vaapi_encoder_h264_supports_avc (encoder)) {
+ gst_caps_set_simple (tmp_caps, "stream-format", G_TYPE_STRING,
+ "byte-stream", NULL);
+ }
+
profile_caps = gst_caps_intersect (available_caps, tmp_caps);
gst_caps_unref (tmp_caps);
if (gst_caps_is_empty (profile_caps)) {
@@ -394,23 +399,8 @@ gst_vaapiencode_h264_get_caps (GstVaapiEncode * base_encode)
GstVaapiEncoderH264 *const encoder =
GST_VAAPI_ENCODER_H264 (base_encode->encoder);
GstVaapiProfile profile;
- GstCaps *available_caps;
- GstStructure *structure;
- const char *stream_format;
GstCaps *caps;
- if (encode->is_avc) {
- available_caps = get_available_caps (encode);
- structure = gst_caps_get_structure (available_caps, 0);
- stream_format = gst_structure_get_string (structure, "stream-format");
- if (g_strcmp0 (stream_format, "byte-stream") == 0) {
- GST_WARNING_OBJECT (encode,
- "downstream prefers avc, but the driver does not support it");
- encode->is_avc = FALSE;
- base_encode->need_codec_data = FALSE;
- }
- }
-
caps = gst_caps_from_string (GST_CODEC_CAPS);
gst_caps_set_simple (caps, "stream-format", G_TYPE_STRING,