summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorVíctor Manuel Jáquez Leal <vjaquez@igalia.com>2021-07-17 20:37:52 +0200
committerVíctor Manuel Jáquez Leal <vjaquez@igalia.com>2021-07-17 20:51:29 +0200
commitd2d7ce7157be5680ae985d6824fa18293c7cce44 (patch)
tree192daa2746f514581ad88e0061450fad15758341 /sys
parent1bf2805560feb8cc890850b74dd75d737d5bdb04 (diff)
downloadgstreamer-plugins-bad-d2d7ce7157be5680ae985d6824fa18293c7cce44.tar.gz
va: Refactor _change_resolution() to _update_frame_size().
Rename gst_va_decoder_change_resolution() to gst_va_decoder_update_frame_size() which resembles gst_va_decoder_set_frame_size(). Also added a comment to clarify the function use and makes more specific the error message. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2417>
Diffstat (limited to 'sys')
-rw-r--r--sys/va/gstvadecoder.c6
-rw-r--r--sys/va/gstvadecoder.h2
-rw-r--r--sys/va/gstvavp9dec.c2
3 files changed, 6 insertions, 4 deletions
diff --git a/sys/va/gstvadecoder.c b/sys/va/gstvadecoder.c
index 3993a32e1..44d4e6dbf 100644
--- a/sys/va/gstvadecoder.c
+++ b/sys/va/gstvadecoder.c
@@ -354,8 +354,10 @@ gst_va_decoder_set_frame_size (GstVaDecoder * self, gint coded_width,
coded_height, NULL);
}
+/* This function is only used by codecs where frame size can change
+ * without a context reset, as for example VP9 */
gboolean
-gst_va_decoder_change_resolution (GstVaDecoder * self, gint coded_width,
+gst_va_decoder_update_frame_size (GstVaDecoder * self, gint coded_width,
gint coded_height)
{
g_return_val_if_fail (GST_IS_VA_DECODER (self), FALSE);
@@ -368,7 +370,7 @@ gst_va_decoder_change_resolution (GstVaDecoder * self, gint coded_width,
GST_OBJECT_LOCK (self);
if (self->context == VA_INVALID_ID) {
GST_OBJECT_UNLOCK (self);
- GST_INFO_OBJECT (self, "decoder does not have a format");
+ GST_INFO_OBJECT (self, "decoder does not have a context");
return FALSE;
}
GST_OBJECT_UNLOCK (self);
diff --git a/sys/va/gstvadecoder.h b/sys/va/gstvadecoder.h
index 3b91f33c1..60bb63d0c 100644
--- a/sys/va/gstvadecoder.h
+++ b/sys/va/gstvadecoder.h
@@ -52,7 +52,7 @@ gboolean gst_va_decoder_set_frame_size_with_surfaces
gboolean gst_va_decoder_set_frame_size (GstVaDecoder * self,
gint coded_width,
gint coded_height);
-gboolean gst_va_decoder_change_resolution (GstVaDecoder * self,
+gboolean gst_va_decoder_update_frame_size (GstVaDecoder * self,
gint coded_width,
gint coded_height);
GstCaps * gst_va_decoder_get_srcpad_caps (GstVaDecoder * self);
diff --git a/sys/va/gstvavp9dec.c b/sys/va/gstvavp9dec.c
index d12fbc9df..dcecd8dae 100644
--- a/sys/va/gstvavp9dec.c
+++ b/sys/va/gstvavp9dec.c
@@ -557,7 +557,7 @@ gst_va_vp9_dec_negotiate (GstVideoDecoder * decoder)
return FALSE;
if (base->profile == cur_profile && base->rt_format == cur_rtformat) {
- if (!gst_va_decoder_change_resolution (base->decoder, base->width,
+ if (!gst_va_decoder_update_frame_size (base->decoder, base->width,
base->height))
return FALSE;