summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVíctor Manuel Jáquez Leal <victorx.jaquez@intel.com>2015-09-23 12:13:41 +0200
committerVíctor Manuel Jáquez Leal <victorx.jaquez@intel.com>2015-09-23 12:45:27 +0200
commitab0a58a647e0c9fd3393ac28812f96d4d3eb9ae4 (patch)
treed8efbb4f2ebbbc99baa8888bece0925ed3082b20
parent3bdc796992d1564b596ed69dbb408acc0bf82494 (diff)
vaapidecode: simplify copy of GstVideoCodecState
Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
-rw-r--r--gst/vaapi/gstvaapidecode.c19
1 files changed, 2 insertions, 17 deletions
diff --git a/gst/vaapi/gstvaapidecode.c b/gst/vaapi/gstvaapidecode.c
index e8acad4e..417ad3c0 100644
--- a/gst/vaapi/gstvaapidecode.c
+++ b/gst/vaapi/gstvaapidecode.c
@@ -144,31 +144,16 @@ static GstVideoCodecState *
copy_video_codec_state (const GstVideoCodecState * in_state)
{
GstVideoCodecState *state;
- GstStructure *structure;
- const GValue *codec_data;
g_return_val_if_fail (in_state != NULL, NULL);
state = g_slice_new0 (GstVideoCodecState);
state->ref_count = 1;
- gst_video_info_init (&state->info);
- if (G_UNLIKELY (!gst_video_info_from_caps (&state->info, in_state->caps)))
- goto fail;
+ state->info = in_state->info;
state->caps = gst_caps_copy (in_state->caps);
-
- 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));
+ state->codec_data = gst_buffer_copy_deep (in_state->codec_data);
return state;
-
-fail:
- {
- g_slice_free (GstVideoCodecState, state);
- return NULL;
- }
}
static gboolean