From 6434d69f8c1ed94271c4fa9c8ce6275106e42dd0 Mon Sep 17 00:00:00 2001 From: Seungha Yang Date: Sun, 24 Oct 2021 22:07:38 +0900 Subject: [PATCH] codecs: Stop claiming constness for refcounted object It's almost pointless and makes little sense as subclass might want to modify refcount of the object or so. And all subclasses are already casting them to non-const version as well. In a general sense, we need to avoid passing refcounted object with const qualifier. Part-of: --- .../gst-plugins-bad/gst-libs/gst/codecs/gsth264decoder.h | 2 +- .../gst-plugins-bad/gst-libs/gst/codecs/gstmpeg2decoder.h | 2 +- subprojects/gst-plugins-bad/sys/d3d11/gstd3d11h264dec.cpp | 10 +++++----- subprojects/gst-plugins-bad/sys/d3d11/gstd3d11mpeg2dec.cpp | 10 +++++----- subprojects/gst-plugins-bad/sys/nvcodec/gstnvh264dec.c | 9 +++++---- .../gst-plugins-bad/sys/v4l2codecs/gstv4l2codech264dec.c | 5 ++--- subprojects/gst-plugins-bad/sys/va/gstvah264dec.c | 4 ++-- subprojects/gst-plugins-bad/sys/va/gstvampeg2dec.c | 4 ++-- 8 files changed, 23 insertions(+), 23 deletions(-) diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth264decoder.h b/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth264decoder.h index a95d667..faf66de 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth264decoder.h +++ b/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth264decoder.h @@ -151,7 +151,7 @@ struct _GstH264DecoderClass * Since: 1.20 */ GstFlowReturn (*new_field_picture) (GstH264Decoder * decoder, - const GstH264Picture * first_field, + GstH264Picture * first_field, GstH264Picture * second_field); /** diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstmpeg2decoder.h b/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstmpeg2decoder.h index de22be0..0e36084 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstmpeg2decoder.h +++ b/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstmpeg2decoder.h @@ -113,7 +113,7 @@ struct _GstMpeg2DecoderClass * Since: 1.20 */ GstFlowReturn (*new_field_picture) (GstMpeg2Decoder * decoder, - const GstMpeg2Picture * first_field, + GstMpeg2Picture * first_field, GstMpeg2Picture * second_field); /** diff --git a/subprojects/gst-plugins-bad/sys/d3d11/gstd3d11h264dec.cpp b/subprojects/gst-plugins-bad/sys/d3d11/gstd3d11h264dec.cpp index 6691a14..89fcedb 100644 --- a/subprojects/gst-plugins-bad/sys/d3d11/gstd3d11h264dec.cpp +++ b/subprojects/gst-plugins-bad/sys/d3d11/gstd3d11h264dec.cpp @@ -146,8 +146,9 @@ static GstFlowReturn gst_d3d11_h264_dec_new_sequence (GstH264Decoder * decoder, const GstH264SPS * sps, gint max_dpb_size); static GstFlowReturn gst_d3d11_h264_dec_new_picture (GstH264Decoder * decoder, GstVideoCodecFrame * frame, GstH264Picture * picture); -static GstFlowReturn gst_d3d11_h264_dec_new_field_picture (GstH264Decoder * - decoder, const GstH264Picture * first_field, GstH264Picture * second_field); +static GstFlowReturn +gst_d3d11_h264_dec_new_field_picture (GstH264Decoder * decoder, + GstH264Picture * first_field, GstH264Picture * second_field); static GstFlowReturn gst_d3d11_h264_dec_start_picture (GstH264Decoder * decoder, GstH264Picture * picture, GstH264Slice * slice, GstH264Dpb * dpb); static GstFlowReturn gst_d3d11_h264_dec_decode_slice (GstH264Decoder * decoder, @@ -497,13 +498,12 @@ gst_d3d11_h264_dec_new_picture (GstH264Decoder * decoder, static GstFlowReturn gst_d3d11_h264_dec_new_field_picture (GstH264Decoder * decoder, - const GstH264Picture * first_field, GstH264Picture * second_field) + GstH264Picture * first_field, GstH264Picture * second_field) { GstD3D11H264Dec *self = GST_D3D11_H264_DEC (decoder); GstBuffer *view_buffer; - view_buffer = (GstBuffer *) gst_h264_picture_get_user_data ((GstH264Picture *) - first_field); + view_buffer = (GstBuffer *) gst_h264_picture_get_user_data (first_field); if (!view_buffer) { GST_WARNING_OBJECT (self, "First picture does not have output view buffer"); diff --git a/subprojects/gst-plugins-bad/sys/d3d11/gstd3d11mpeg2dec.cpp b/subprojects/gst-plugins-bad/sys/d3d11/gstd3d11mpeg2dec.cpp index fbdebfa..5d9e457 100644 --- a/subprojects/gst-plugins-bad/sys/d3d11/gstd3d11mpeg2dec.cpp +++ b/subprojects/gst-plugins-bad/sys/d3d11/gstd3d11mpeg2dec.cpp @@ -123,9 +123,9 @@ static GstFlowReturn gst_d3d11_mpeg2_dec_new_sequence (GstMpeg2Decoder * const GstMpegVideoSequenceScalableExt * seq_scalable_ext); static GstFlowReturn gst_d3d11_mpeg2_dec_new_picture (GstMpeg2Decoder * decoder, GstVideoCodecFrame * frame, GstMpeg2Picture * picture); -static GstFlowReturn gst_d3d11_mpeg2_dec_new_field_picture (GstMpeg2Decoder * - decoder, const GstMpeg2Picture * first_field, - GstMpeg2Picture * second_field); +static GstFlowReturn +gst_d3d11_mpeg2_dec_new_field_picture (GstMpeg2Decoder * decoder, + GstMpeg2Picture * first_field, GstMpeg2Picture * second_field); static GstFlowReturn gst_d3d11_mpeg2_dec_start_picture (GstMpeg2Decoder * decoder, GstMpeg2Picture * picture, GstMpeg2Slice * slice, GstMpeg2Picture * prev_picture, GstMpeg2Picture * next_picture); @@ -438,13 +438,13 @@ gst_d3d11_mpeg2_dec_new_picture (GstMpeg2Decoder * decoder, static GstFlowReturn gst_d3d11_mpeg2_dec_new_field_picture (GstMpeg2Decoder * decoder, - const GstMpeg2Picture * first_field, GstMpeg2Picture * second_field) + GstMpeg2Picture * first_field, GstMpeg2Picture * second_field) { GstD3D11Mpeg2Dec *self = GST_D3D11_MPEG2_DEC (decoder); GstBuffer *view_buffer; view_buffer = (GstBuffer *) - gst_mpeg2_picture_get_user_data ((GstMpeg2Picture *) first_field); + gst_mpeg2_picture_get_user_data (first_field); if (!view_buffer) { GST_WARNING_OBJECT (self, "First picture does not have output view buffer"); diff --git a/subprojects/gst-plugins-bad/sys/nvcodec/gstnvh264dec.c b/subprojects/gst-plugins-bad/sys/nvcodec/gstnvh264dec.c index 5b81c94..c0b7c76 100644 --- a/subprojects/gst-plugins-bad/sys/nvcodec/gstnvh264dec.c +++ b/subprojects/gst-plugins-bad/sys/nvcodec/gstnvh264dec.c @@ -141,8 +141,9 @@ static GstFlowReturn gst_nv_h264_dec_new_sequence (GstH264Decoder * decoder, const GstH264SPS * sps, gint max_dpb_size); static GstFlowReturn gst_nv_h264_dec_new_picture (GstH264Decoder * decoder, GstVideoCodecFrame * frame, GstH264Picture * picture); -static GstFlowReturn gst_nv_h264_dec_new_field_picture (GstH264Decoder * - decoder, const GstH264Picture * first_field, GstH264Picture * second_field); +static GstFlowReturn +gst_nv_h264_dec_new_field_picture (GstH264Decoder * decoder, + GstH264Picture * first_field, GstH264Picture * second_field); static GstFlowReturn gst_nv_h264_dec_output_picture (GstH264Decoder * decoder, GstVideoCodecFrame * frame, GstH264Picture * picture); static GstFlowReturn gst_nv_h264_dec_start_picture (GstH264Decoder * decoder, @@ -486,12 +487,12 @@ gst_nv_h264_dec_new_picture (GstH264Decoder * decoder, static GstFlowReturn gst_nv_h264_dec_new_field_picture (GstH264Decoder * decoder, - const GstH264Picture * first_field, GstH264Picture * second_field) + GstH264Picture * first_field, GstH264Picture * second_field) { GstNvDecoderFrame *nv_frame; nv_frame = (GstNvDecoderFrame *) - gst_h264_picture_get_user_data ((GstH264Picture *) first_field); + gst_h264_picture_get_user_data (first_field); if (!nv_frame) { GST_ERROR_OBJECT (decoder, "No decoder frame in the first picture %p", first_field); diff --git a/subprojects/gst-plugins-bad/sys/v4l2codecs/gstv4l2codech264dec.c b/subprojects/gst-plugins-bad/sys/v4l2codecs/gstv4l2codech264dec.c index 9c7260b..cf0bee2 100644 --- a/subprojects/gst-plugins-bad/sys/v4l2codecs/gstv4l2codech264dec.c +++ b/subprojects/gst-plugins-bad/sys/v4l2codecs/gstv4l2codech264dec.c @@ -1307,11 +1307,10 @@ gst_v4l2_codec_h264_dec_end_picture (GstH264Decoder * decoder, static GstFlowReturn gst_v4l2_codec_h264_dec_new_field_picture (GstH264Decoder * decoder, - const GstH264Picture * first_field, GstH264Picture * second_field) + GstH264Picture * first_field, GstH264Picture * second_field) { GstV4l2CodecH264Dec *self = GST_V4L2_CODEC_H264_DEC (decoder); - GstV4l2Request *request = - gst_h264_picture_get_user_data ((GstH264Picture *) first_field); + GstV4l2Request *request = gst_h264_picture_get_user_data (first_field); if (!request) { GST_WARNING_OBJECT (self, diff --git a/subprojects/gst-plugins-bad/sys/va/gstvah264dec.c b/subprojects/gst-plugins-bad/sys/va/gstvah264dec.c index fddd8fb..80e95cc 100644 --- a/subprojects/gst-plugins-bad/sys/va/gstvah264dec.c +++ b/subprojects/gst-plugins-bad/sys/va/gstvah264dec.c @@ -527,13 +527,13 @@ error: static GstFlowReturn gst_va_h264_dec_new_field_picture (GstH264Decoder * decoder, - const GstH264Picture * first_field, GstH264Picture * second_field) + GstH264Picture * first_field, GstH264Picture * second_field) { GstVaDecodePicture *first_pic, *second_pic; GstVaH264Dec *self = GST_VA_H264_DEC (decoder); GstVaBaseDec *base = GST_VA_BASE_DEC (decoder); - first_pic = gst_h264_picture_get_user_data ((GstH264Picture *) first_field); + first_pic = gst_h264_picture_get_user_data (first_field); if (!first_pic) return GST_FLOW_ERROR; diff --git a/subprojects/gst-plugins-bad/sys/va/gstvampeg2dec.c b/subprojects/gst-plugins-bad/sys/va/gstvampeg2dec.c index 9c2f574..2a8de73 100644 --- a/subprojects/gst-plugins-bad/sys/va/gstvampeg2dec.c +++ b/subprojects/gst-plugins-bad/sys/va/gstvampeg2dec.c @@ -324,13 +324,13 @@ error: static GstFlowReturn gst_va_mpeg2_dec_new_field_picture (GstMpeg2Decoder * decoder, - const GstMpeg2Picture * first_field, GstMpeg2Picture * second_field) + GstMpeg2Picture * first_field, GstMpeg2Picture * second_field) { GstVaDecodePicture *first_pic, *second_pic; GstVaMpeg2Dec *self = GST_VA_MPEG2_DEC (decoder); GstVaBaseDec *base = GST_VA_BASE_DEC (decoder); - first_pic = gst_mpeg2_picture_get_user_data ((GstMpeg2Picture *) first_field); + first_pic = gst_mpeg2_picture_get_user_data (first_field); if (!first_pic) return GST_FLOW_ERROR; -- 2.7.4