mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-28 01:58:19 +00:00
vaapidecode: simplify copy of GstVideoCodecState
Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
This commit is contained in:
parent
d20ae26673
commit
5ab4c15754
1 changed files with 2 additions and 17 deletions
|
@ -140,31 +140,16 @@ static GstVideoCodecState *
|
||||||
copy_video_codec_state (const GstVideoCodecState * in_state)
|
copy_video_codec_state (const GstVideoCodecState * in_state)
|
||||||
{
|
{
|
||||||
GstVideoCodecState *state;
|
GstVideoCodecState *state;
|
||||||
GstStructure *structure;
|
|
||||||
const GValue *codec_data;
|
|
||||||
|
|
||||||
g_return_val_if_fail (in_state != NULL, NULL);
|
g_return_val_if_fail (in_state != NULL, NULL);
|
||||||
|
|
||||||
state = g_slice_new0 (GstVideoCodecState);
|
state = g_slice_new0 (GstVideoCodecState);
|
||||||
state->ref_count = 1;
|
state->ref_count = 1;
|
||||||
gst_video_info_init (&state->info);
|
state->info = in_state->info;
|
||||||
if (G_UNLIKELY (!gst_video_info_from_caps (&state->info, in_state->caps)))
|
|
||||||
goto fail;
|
|
||||||
state->caps = gst_caps_copy (in_state->caps);
|
state->caps = gst_caps_copy (in_state->caps);
|
||||||
|
state->codec_data = gst_buffer_copy_deep (in_state->codec_data);
|
||||||
structure = gst_caps_get_structure (state->caps, 0);
|
|
||||||
|
|
||||||
codec_data = gst_structure_get_value (structure, "codec_data");
|
|
||||||
if (codec_data && G_VALUE_TYPE (codec_data) == GST_TYPE_BUFFER)
|
|
||||||
state->codec_data = GST_BUFFER (g_value_dup_boxed (codec_data));
|
|
||||||
|
|
||||||
return state;
|
return state;
|
||||||
|
|
||||||
fail:
|
|
||||||
{
|
|
||||||
g_slice_free (GstVideoCodecState, state);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
|
|
Loading…
Reference in a new issue