Revert "videoconvertscale: Add properties to disable scaling/converting in videoconvert/videoscale"

This reverts commit cd7a91cef1.

Reverting properties, scaling in videoconvert and converting in
videoscale will be disabled by the other commit

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2778>
This commit is contained in:
Seungha Yang 2022-08-05 20:16:00 +09:00 committed by GStreamer Marge Bot
parent 3cd79c4262
commit 0d5c937642
11 changed files with 13 additions and 258 deletions

View file

@ -112,9 +112,7 @@ VALGRIND_BLACKLIST = [
(r'check.gst-editing-services.pythontests', 'Need to figure out how to introduce python suppressions'),
(r'check.gst-editing-services.check_keyframes_in_compositor_two_sources', 'Valgrind exit with an exitcode 20 but shows no issue: https://gitlab.freedesktop.org/thiblahute/gst-editing-services/-/jobs/4079972'),
(r'check.gst-plugins-good.elements_splitmuxsrc.test_splitmuxsrc_sparse_streams', 'https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/739'),
(r'check.gst-plugins-good.elements_udpsrc.test_udpsrc_empty_packet', 'https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/740'),
(r'check.gst-plugins-base.validate.convertscale.scale_disable_convert', 'Use of uninitialised value of size 8 in digest_to_string that needs investigating'),
(r'check.gst-plugins-base.validate.convertscale.convert_disable_scale', 'Use of uninitialised value of size 8 in digest_to_string that needs investigating'),
(r'check.gst-plugins-good.elements_udpsrc.test_udpsrc_empty_packet', 'https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/740')
]

View file

@ -13712,20 +13712,6 @@
"presence": "always"
}
},
"properties": {
"disable-scaling": {
"blurb": "Disables frame scaling",
"conditionally-available": false,
"construct": true,
"construct-only": false,
"controllable": false,
"default": "false",
"mutable": "ready",
"readable": true,
"type": "gboolean",
"writable": true
}
},
"rank": "marginal"
},
"videoconvertscale": {
@ -13978,18 +13964,6 @@
}
},
"properties": {
"disable-conversion": {
"blurb": "Disables colorspace conversions",
"conditionally-available": false,
"construct": true,
"construct-only": false,
"controllable": false,
"default": "false",
"mutable": "ready",
"readable": true,
"type": "gboolean",
"writable": true
},
"gamma-decode": {
"blurb": "Decode gamma before scaling",
"conditionally-available": false,

View file

@ -46,65 +46,10 @@ G_DEFINE_TYPE (GstVideoConvert, gst_video_convert,
GST_ELEMENT_REGISTER_DEFINE (videoconvert, "videoconvert",
GST_RANK_MARGINAL, gst_video_convert_get_type ());
enum
{
PROP_0,
PROP_DISABLE_SCALING,
};
#define DEFAULT_PROP_DISABLE_SCALING FALSE
static void
gst_video_convert_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec)
{
switch (prop_id) {
case PROP_DISABLE_SCALING:
g_value_set_boolean (value,
!gst_video_convert_scale_get_scales (GST_VIDEO_CONVERT_SCALE
(object)));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
gst_video_convert_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec)
{
switch (prop_id) {
case PROP_DISABLE_SCALING:
gst_video_convert_scale_set_scales (GST_VIDEO_CONVERT_SCALE (object),
!g_value_get_boolean (value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
gst_video_convert_class_init (GstVideoConvertClass * klass)
{
GObjectClass *gobject_class = (GObjectClass *) klass;
gobject_class->set_property = gst_video_convert_set_property;
gobject_class->get_property = gst_video_convert_get_property;
((GstVideoConvertScaleClass *) klass)->any_memory = TRUE;
/**
* videoconvert::disable-scaling:
*
* Since: 1.22
*/
g_object_class_install_property (gobject_class, PROP_DISABLE_SCALING,
g_param_spec_boolean ("disable-scaling", "Disable Scaling",
"Disables frame scaling", DEFAULT_PROP_DISABLE_SCALING,
G_PARAM_CONSTRUCT | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS |
GST_PARAM_MUTABLE_READY));
}
static void

View file

@ -107,9 +107,6 @@ typedef struct
gint borders_h;
gint borders_w;
gboolean scales;
gboolean converts;
} GstVideoConvertScalePrivate;
#define gst_video_convert_scale_parent_class parent_class
@ -118,7 +115,7 @@ G_DEFINE_TYPE_WITH_PRIVATE (GstVideoConvertScale, gst_video_convert_scale,
GST_ELEMENT_REGISTER_DEFINE (videoconvertscale, "videoconvertscale",
GST_RANK_SECONDARY, GST_TYPE_VIDEO_CONVERT_SCALE);
#define PRIV(self) ((GstVideoConvertScalePrivate*)gst_video_convert_scale_get_instance_private(((GstVideoConvertScale*) self)))
#define PRIV(self) gst_video_convert_scale_get_instance_private(((GstVideoConvertScale*) self))
#define GST_CAT_DEFAULT video_convertscale_debug
GST_DEBUG_CATEGORY_STATIC (video_convertscale_debug);
@ -429,8 +426,6 @@ gst_video_convert_scale_init (GstVideoConvertScale * self)
priv->matrix_mode = DEFAULT_PROP_MATRIX_MODE;
priv->gamma_mode = DEFAULT_PROP_GAMMA_MODE;
priv->primaries_mode = DEFAULT_PROP_PRIMARIES_MODE;
priv->scales = TRUE;
priv->converts = TRUE;
}
static void
@ -574,14 +569,12 @@ gst_video_convert_scale_get_property (GObject * object, guint prop_id,
}
static GstCaps *
gst_video_convert_caps_remove_format_and_rangify_size_info (GstVideoConvertScale
* self, GstCaps * caps)
gst_video_convert_caps_remove_format_and_rangify_size_info (GstCaps * caps)
{
GstCaps *ret;
GstStructure *structure;
GstCapsFeatures *features;
gint i, n;
GstVideoConvertScalePrivate *priv = PRIV (self);
ret = gst_caps_new_empty ();
@ -603,21 +596,15 @@ gst_video_convert_caps_remove_format_and_rangify_size_info (GstVideoConvertScale
|| gst_caps_features_is_equal (features, features_format_interlaced)
|| gst_caps_features_is_equal (features,
features_format_interlaced_sysmem))) {
if (priv->scales) {
gst_structure_set (structure, "width", GST_TYPE_INT_RANGE, 1, G_MAXINT,
"height", GST_TYPE_INT_RANGE, 1, G_MAXINT, NULL);
/* if pixel aspect ratio, make a range of it */
if (gst_structure_has_field (structure, "pixel-aspect-ratio")) {
gst_structure_set (structure, "pixel-aspect-ratio",
GST_TYPE_FRACTION_RANGE, 1, G_MAXINT, G_MAXINT, 1, NULL);
}
}
if (priv->converts) {
gst_structure_remove_fields (structure, "format", "colorimetry",
"chroma-site", NULL);
gst_structure_set (structure, "width", GST_TYPE_INT_RANGE, 1, G_MAXINT,
"height", GST_TYPE_INT_RANGE, 1, G_MAXINT, NULL);
/* if pixel aspect ratio, make a range of it */
if (gst_structure_has_field (structure, "pixel-aspect-ratio")) {
gst_structure_set (structure, "pixel-aspect-ratio",
GST_TYPE_FRACTION_RANGE, 1, G_MAXINT, G_MAXINT, 1, NULL);
}
gst_structure_remove_fields (structure, "format", "colorimetry",
"chroma-site", NULL);
}
gst_caps_append_structure_full (ret, structure,
gst_caps_features_copy (features));
@ -632,13 +619,12 @@ gst_video_convert_scale_transform_caps (GstBaseTransform * trans,
{
gint i;
GstCaps *ret;
GstVideoConvertScale *self = GST_VIDEO_CONVERT_SCALE (trans);
GST_DEBUG_OBJECT (trans,
"Transforming caps %" GST_PTR_FORMAT " in direction %s", caps,
(direction == GST_PAD_SINK) ? "sink" : "src");
ret = gst_video_convert_caps_remove_format_and_rangify_size_info (self, caps);
ret = gst_video_convert_caps_remove_format_and_rangify_size_info (caps);
if (filter) {
GstCaps *intersection;
@ -1801,39 +1787,3 @@ gst_video_convert_scale_src_event (GstBaseTransform * trans, GstEvent * event)
return ret;
}
void
gst_video_convert_scale_set_scales (GstVideoConvertScale * self,
gboolean scales)
{
GstVideoConvertScalePrivate *priv = PRIV (self);
if (!scales)
g_assert (priv->converts);
priv->scales = scales;
}
void
gst_video_convert_scale_set_converts (GstVideoConvertScale * self,
gboolean converts)
{
GstVideoConvertScalePrivate *priv = PRIV (self);
if (!converts)
g_assert (priv->scales);
priv->converts = converts;
}
gboolean
gst_video_convert_scale_get_scales (GstVideoConvertScale * self)
{
return PRIV (self)->scales;
}
gboolean
gst_video_convert_scale_get_converts (GstVideoConvertScale * self)
{
return PRIV (self)->converts;
}

View file

@ -69,11 +69,6 @@ typedef enum {
GST_VIDEO_SCALE_MITCHELL
} GstVideoScaleMethod;
void gst_video_convert_scale_set_scales (GstVideoConvertScale *self, gboolean scales);
void gst_video_convert_scale_set_converts (GstVideoConvertScale *self, gboolean converts);
gboolean gst_video_convert_scale_get_scales (GstVideoConvertScale *self);
gboolean gst_video_convert_scale_get_converts (GstVideoConvertScale *self);
GST_ELEMENT_REGISTER_DECLARE (videoconvertscale);
G_END_DECLS

View file

@ -51,7 +51,6 @@
#endif
#define DEFAULT_PROP_GAMMA_DECODE FALSE
#define DEFAULT_PROP_DISABLE_CONVERSION FALSE
#include "gstvideoscale.h"
@ -62,8 +61,7 @@ GST_ELEMENT_REGISTER_DEFINE (videoscale, "videoscale",
enum
{
PROP_0,
PROP_GAMMA_DECODE,
PROP_DISABLE_CONVERSION,
PROP_GAMMA_DECODE
};
static void
@ -80,11 +78,6 @@ gst_video_scale_get_property (GObject * object, guint prop_id,
break;
}
case PROP_DISABLE_CONVERSION:
g_value_set_boolean (value,
!gst_video_convert_scale_get_converts (GST_VIDEO_CONVERT_SCALE
(object)));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@ -105,10 +98,6 @@ gst_video_scale_set_property (GObject * object, guint prop_id,
break;
}
case PROP_DISABLE_CONVERSION:
gst_video_convert_scale_set_converts (GST_VIDEO_CONVERT_SCALE (object),
!g_value_get_boolean (value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@ -129,17 +118,6 @@ gst_video_scale_class_init (GstVideoScaleClass * klass)
g_param_spec_boolean ("gamma-decode", "Gamma Decode",
"Decode gamma before scaling", DEFAULT_PROP_GAMMA_DECODE,
G_PARAM_CONSTRUCT | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
/**
* videoscale::disable-conversion:
*
* Since: 1.22
*/
g_object_class_install_property (gobject_class, PROP_DISABLE_CONVERSION,
g_param_spec_boolean ("disable-conversion", "Disable Conversion",
"Disables colorspace conversions", DEFAULT_PROP_DISABLE_CONVERSION,
G_PARAM_CONSTRUCT | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS |
GST_PARAM_MUTABLE_READY));
}
static void

View file

@ -1,37 +0,0 @@
meta,
handles-states=true,
ignore-eos=true,
allow-errors=true,
args = {
"videotestsrc num-buffers=1 ! video/x-raw,format=ARGB,width=20,height=20 ! videoconvert name=converter ! video/x-raw,format=I420,width=100,height=100 ! fakevideosink",
},
configs = {
"$(validateflow), pad=converter:src, buffers-checksum=as-id, ignored-event-types={ tag, eos }",
},
expected-issues = {
[
expected-issue,
level=critical,
issue-id=runtime::not-negotiated,
details="\
.*Caps negotiation failed starting from pad 'capsfilter1:sink' as the QUERY_CAPS returned EMPTY caps for the following possible reasons:.*\\n\
.*-> Field 'width' downstream value from structure 0 '.*100' can't intersect with filter value from structure number 0 '.*20'.*\\n\
.*-> Field 'height' downstream value from structure 0 '.*100' can't intersect with filter value from structure number 0 '.*20'.*\
",
],
[
expected-issue,
level=critical,
issue-id=scenario::execution-error,
details="Error message happened while executing action",
],
}
play
set-state, state=ready, on-message=eos
set-properties, converter::disable-scaling=true
play
stop, on-message=error

View file

@ -1,5 +0,0 @@
event stream-start: GstEventStreamStart, flags=(GstStreamFlags)GST_STREAM_FLAG_NONE, group-id=(uint)1;
event caps: video/x-raw, format=(string)I420, framerate=(fraction)30/1, height=(int)100, interlace-mode=(string)progressive, multiview-mode=(string)mono, pixel-aspect-ratio=(fraction)1/1, width=(int)100;
event segment: format=TIME, start=0:00:00.000000000, offset=0:00:00.000000000, stop=none, time=0:00:00.000000000, base=0:00:00.000000000, position=0:00:00.000000000
buffer: content-id=0, pts=0:00:00.000000000, dur=0:00:00.033333333, flags=discont, meta=GstVideoMeta
event stream-start: GstEventStreamStart, flags=(GstStreamFlags)GST_STREAM_FLAG_NONE, group-id=(uint)2;

View file

@ -1,36 +0,0 @@
meta,
handles-states=true,
ignore-eos=true,
allow-errors=true,
args = {
"videotestsrc num-buffers=1 ! video/x-raw,format=ARGB,width=20,height=20 ! videoscale name=scaler ! video/x-raw,format=I420,width=100,height=100 ! fakevideosink",
},
configs = {
"$(validateflow), pad=scaler:src, buffers-checksum=as-id, ignored-event-types={ tag, eos }",
},
expected-issues = {
[
expected-issue,
level=critical,
issue-id=runtime::not-negotiated,
details="\
.*Caps negotiation failed starting from pad 'capsfilter.*:sink' as the QUERY_CAPS returned EMPTY caps for the following possible reasons:.*\\n\
-> Field 'format' downstream value from structure 0 '\\(gchararray\\)I420' can't intersect with filter value from structure number 0 '\\(gchararray\\)ARGB'\
",
],
[
expected-issue,
level=critical,
issue-id=scenario::execution-error,
details="Error message happened while executing action",
],
}
play
set-state, state=ready, on-message=eos
set-properties, scaler::disable-conversion=true
play
stop, on-message=error

View file

@ -1,5 +0,0 @@
event stream-start: GstEventStreamStart, flags=(GstStreamFlags)GST_STREAM_FLAG_NONE, group-id=(uint)1;
event caps: video/x-raw, format=(string)I420, framerate=(fraction)30/1, height=(int)100, interlace-mode=(string)progressive, multiview-mode=(string)mono, pixel-aspect-ratio=(fraction)1/1, width=(int)100;
event segment: format=TIME, start=0:00:00.000000000, offset=0:00:00.000000000, stop=none, time=0:00:00.000000000, base=0:00:00.000000000, position=0:00:00.000000000
buffer: content-id=0, pts=0:00:00.000000000, dur=0:00:00.033333333, flags=discont, meta=GstVideoMeta
event stream-start: GstEventStreamStart, flags=(GstStreamFlags)GST_STREAM_FLAG_NONE, group-id=(uint)2;

View file

@ -20,8 +20,6 @@ tests = [
'compositor/renogotiate_failing_unsupported_src_format',
'giosrc/read-growing-file',
'encodebin/set-encoder-properties',
'convertscale/convert_disable_scale',
'convertscale/scale_disable_convert',
]
env = environment()