mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-29 19:50:40 +00:00
vaapih264enc: common fail for gst_vaapiencode_h264_set_config()
Add a common fail code path for gst_vaapiencode_h264_set_config().
This commit is contained in:
parent
eda173b3b0
commit
a56ac3bffe
1 changed files with 11 additions and 8 deletions
|
@ -261,9 +261,7 @@ gst_vaapiencode_h264_set_config (GstVaapiEncode * base_encode)
|
||||||
encode->is_avc = FALSE;
|
encode->is_avc = FALSE;
|
||||||
} else if (gst_caps_is_empty (allowed_caps)) {
|
} else if (gst_caps_is_empty (allowed_caps)) {
|
||||||
GST_INFO_OBJECT (encode, "downstream has EMPTY caps");
|
GST_INFO_OBJECT (encode, "downstream has EMPTY caps");
|
||||||
gst_caps_unref (template_caps);
|
goto fail;
|
||||||
gst_caps_unref (allowed_caps);
|
|
||||||
return FALSE;
|
|
||||||
} else {
|
} else {
|
||||||
const char *stream_format = NULL;
|
const char *stream_format = NULL;
|
||||||
GstStructure *structure;
|
GstStructure *structure;
|
||||||
|
@ -272,11 +270,9 @@ gst_vaapiencode_h264_set_config (GstVaapiEncode * base_encode)
|
||||||
GstCaps *available_caps;
|
GstCaps *available_caps;
|
||||||
|
|
||||||
available_caps = get_available_caps (encode);
|
available_caps = get_available_caps (encode);
|
||||||
if (!available_caps) {
|
if (!available_caps)
|
||||||
gst_caps_unref (template_caps);
|
goto fail;
|
||||||
gst_caps_unref (allowed_caps);
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
if (!gst_caps_can_intersect (allowed_caps, available_caps)) {
|
if (!gst_caps_can_intersect (allowed_caps, available_caps)) {
|
||||||
GST_INFO_OBJECT (encode, "downstream requested an unsupported profile, "
|
GST_INFO_OBJECT (encode, "downstream requested an unsupported profile, "
|
||||||
"but encoder will try to output a compatible one");
|
"but encoder will try to output a compatible one");
|
||||||
|
@ -319,6 +315,13 @@ gst_vaapiencode_h264_set_config (GstVaapiEncode * base_encode)
|
||||||
base_encode->need_codec_data = encode->is_avc;
|
base_encode->need_codec_data = encode->is_avc;
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
fail:
|
||||||
|
{
|
||||||
|
gst_caps_unref (template_caps);
|
||||||
|
gst_caps_unref (allowed_caps);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Reference in a new issue