summaryrefslogtreecommitdiff
path: root/gst/vaapi
diff options
context:
space:
mode:
Diffstat (limited to 'gst/vaapi')
-rw-r--r--gst/vaapi/gstvaapidecode.c16
-rw-r--r--gst/vaapi/gstvaapipluginbase.c3
-rw-r--r--gst/vaapi/gstvaapipluginutil.c4
-rw-r--r--gst/vaapi/gstvaapipostproc.c7
4 files changed, 18 insertions, 12 deletions
diff --git a/gst/vaapi/gstvaapidecode.c b/gst/vaapi/gstvaapidecode.c
index 7b62ad08..d7ed728a 100644
--- a/gst/vaapi/gstvaapidecode.c
+++ b/gst/vaapi/gstvaapidecode.c
@@ -198,17 +198,18 @@ gst_vaapidecode_update_src_caps (GstVaapiDecode * decode)
{
GstVideoDecoder *const vdec = GST_VIDEO_DECODER (decode);
GstVideoCodecState *state, *ref_state;
+ GstVaapiCapsFeature feature;
+ GstCapsFeatures *features = NULL;
GstVideoInfo *vi;
GstVideoFormat format = GST_VIDEO_FORMAT_I420;
+ GstClockTime latency;
+ gint fps_d, fps_n;
if (!decode->input_state)
return FALSE;
ref_state = decode->input_state;
- GstCapsFeatures *features = NULL;
- GstVaapiCapsFeature feature;
-
feature =
gst_vaapi_find_preferred_caps_feature (GST_VIDEO_DECODER_SRC_PAD (vdec),
GST_VIDEO_INFO_FORMAT (&ref_state->info), &format);
@@ -246,8 +247,8 @@ gst_vaapidecode_update_src_caps (GstVaapiDecode * decode)
gst_caps_replace (&decode->srcpad_caps, state->caps);
gst_video_codec_state_unref (state);
- gint fps_n = GST_VIDEO_INFO_FPS_N (vi);
- gint fps_d = GST_VIDEO_INFO_FPS_D (vi);
+ fps_n = GST_VIDEO_INFO_FPS_N (vi);
+ fps_d = GST_VIDEO_INFO_FPS_D (vi);
if (fps_n <= 0 || fps_d <= 0) {
GST_DEBUG_OBJECT (decode, "forcing 25/1 framerate for latency calculation");
fps_n = 25;
@@ -258,7 +259,7 @@ gst_vaapidecode_update_src_caps (GstVaapiDecode * decode)
* latency in general, with perfectly known unit boundaries (NALU,
* AU), and up to 2 frames when we need to wait for the second frame
* start to determine the first frame is complete */
- GstClockTime latency = gst_util_uint64_scale (2 * GST_SECOND, fps_d, fps_n);
+ latency = gst_util_uint64_scale (2 * GST_SECOND, fps_d, fps_n);
gst_video_decoder_set_latency (vdec, latency, latency);
return TRUE;
@@ -464,6 +465,7 @@ gst_vaapidecode_handle_frame (GstVideoDecoder * vdec,
{
GstVaapiDecode *const decode = GST_VAAPIDECODE (vdec);
GstVaapiDecoderStatus status;
+ GstVaapiPluginBase *plugin;
GstFlowReturn ret;
if (!decode->input_state)
@@ -478,7 +480,7 @@ gst_vaapidecode_handle_frame (GstVideoDecoder * vdec,
if (!gst_video_decoder_negotiate (vdec))
goto not_negotiated;
- GstVaapiPluginBase *const plugin = GST_VAAPI_PLUGIN_BASE (vdec);
+ plugin = GST_VAAPI_PLUGIN_BASE (vdec);
if (!gst_vaapi_plugin_base_set_caps (plugin, NULL, decode->srcpad_caps))
goto not_negotiated;
diff --git a/gst/vaapi/gstvaapipluginbase.c b/gst/vaapi/gstvaapipluginbase.c
index 45c32b59..9e878cea 100644
--- a/gst/vaapi/gstvaapipluginbase.c
+++ b/gst/vaapi/gstvaapipluginbase.c
@@ -180,12 +180,13 @@ error_create_proxy:
void
gst_vaapi_plugin_base_class_init (GstVaapiPluginBaseClass * klass)
{
+ GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
+
klass->has_interface = default_has_interface;
klass->display_changed = default_display_changed;
plugin_parent_class = g_type_class_peek_parent (klass);
- GstElementClass *const element_class = GST_ELEMENT_CLASS (klass);
element_class->set_context = GST_DEBUG_FUNCPTR (plugin_set_context);
}
diff --git a/gst/vaapi/gstvaapipluginutil.c b/gst/vaapi/gstvaapipluginutil.c
index e07d2b61..7f628d8c 100644
--- a/gst/vaapi/gstvaapipluginutil.c
+++ b/gst/vaapi/gstvaapipluginutil.c
@@ -412,14 +412,14 @@ GstCaps *
gst_vaapi_video_format_new_template_caps_with_features (GstVideoFormat format,
const gchar * features_string)
{
+ GstCapsFeatures *features;
GstCaps *caps;
caps = gst_vaapi_video_format_new_template_caps (format);
if (!caps)
return NULL;
- GstCapsFeatures *const features =
- gst_caps_features_new (features_string, NULL);
+ features = gst_caps_features_new (features_string, NULL);
if (!features) {
gst_caps_unref (caps);
return NULL;
diff --git a/gst/vaapi/gstvaapipostproc.c b/gst/vaapi/gstvaapipostproc.c
index ab5b7882..9583c27e 100644
--- a/gst/vaapi/gstvaapipostproc.c
+++ b/gst/vaapi/gstvaapipostproc.c
@@ -479,6 +479,7 @@ gst_vaapipostproc_process_vpp (GstBaseTransform * trans, GstBuffer * inbuf,
GstVaapiDeinterlaceMethod deint_method;
guint flags, deint_flags;
gboolean tff, deint, deint_refs, deint_changed;
+ const GstVideoCropMeta *crop_meta;
GstVaapiRectangle *crop_rect = NULL;
GstVaapiRectangle tmp_rect;
@@ -527,7 +528,7 @@ gst_vaapipostproc_process_vpp (GstBaseTransform * trans, GstBuffer * inbuf,
goto error_invalid_buffer;
inbuf_surface = gst_vaapi_video_meta_get_surface (inbuf_meta);
- GstVideoCropMeta *const crop_meta = gst_buffer_get_video_crop_meta (inbuf);
+ crop_meta = gst_buffer_get_video_crop_meta (inbuf);
if (crop_meta) {
crop_rect = &tmp_rect;
crop_rect->x = crop_meta->x;
@@ -974,11 +975,13 @@ expand_allowed_srcpad_caps (GstVaapiPostproc * postproc, GstCaps * caps)
num_structures = gst_caps_get_size (caps);
for (i = 0; i < num_structures; i++) {
GstCapsFeatures *const features = gst_caps_get_features (caps, i);
+ GstStructure *structure;
+
if (gst_caps_features_contains (features,
GST_CAPS_FEATURE_META_GST_VIDEO_GL_TEXTURE_UPLOAD_META))
continue;
- GstStructure *const structure = gst_caps_get_structure (caps, i);
+ structure = gst_caps_get_structure (caps, i);
if (!structure)
continue;
gst_structure_set_value (structure, "format", &value);