gint borders_h;
gint borders_w;
-
- gboolean scales;
- gboolean converts;
} GstVideoConvertScalePrivate;
#define gst_video_convert_scale_parent_class parent_class
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);
gst_element_class_set_static_metadata (element_class,
"Video colorspace converter and scaler",
"Filter/Converter/Video/Scaler/Colorspace",
- "Resizes video and allow color conversion",
+ "Resizes video and converts from one colorspace to another",
"Wim Taymans <wim.taymans@gmail.com>");
gst_element_class_add_pad_template (element_class,
filter_class->set_info = GST_DEBUG_FUNCPTR (gst_video_convert_scale_set_info);
filter_class->transform_frame =
GST_DEBUG_FUNCPTR (gst_video_convert_scale_transform_frame);
+
+ klass->any_memory = FALSE;
+ klass->converts = TRUE;
+ klass->scales = TRUE;
}
static void
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
gst_video_convert_caps_remove_format_and_rangify_size_info (GstVideoConvertScale
* self, GstCaps * caps)
{
+ GstVideoConvertScaleClass *klass = GST_VIDEO_CONVERT_SCALE_GET_CLASS (self);
GstCaps *ret;
GstStructure *structure;
GstCapsFeatures *features;
gint i, n;
- GstVideoConvertScalePrivate *priv = PRIV (self);
ret = gst_caps_new_empty ();
|| gst_caps_features_is_equal (features, features_format_interlaced)
|| gst_caps_features_is_equal (features,
features_format_interlaced_sysmem))) {
-
- if (priv->scales) {
+ if (klass->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 (priv->converts) {
+ if (klass->converts) {
gst_structure_remove_fields (structure, "format", "colorimetry",
"chroma-site", NULL);
}
gst_video_convert_scale_transform_caps (GstBaseTransform * trans,
GstPadDirection direction, GstCaps * caps, GstCaps * filter)
{
+ GstVideoConvertScale *self = GST_VIDEO_CONVERT_SCALE (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,
* we're converting between equivalent transfer functions, do passthrough */
tmp_info = *in_info;
tmp_info.colorimetry.transfer = out_info->colorimetry.transfer;
- if (gst_video_info_is_equal (&tmp_info, out_info)) {
- if (gst_video_transfer_function_is_equivalent (in_info->colorimetry.
- transfer, in_info->finfo->bits, out_info->colorimetry.transfer,
- out_info->finfo->bits)) {
- gst_base_transform_set_passthrough (GST_BASE_TRANSFORM (filter), TRUE);
- }
+ if (gst_video_info_is_equal (&tmp_info, out_info) &&
+ gst_video_transfer_function_is_equivalent (in_info->colorimetry.transfer,
+ in_info->finfo->bits, out_info->colorimetry.transfer,
+ out_info->finfo->bits)) {
+ gst_base_transform_set_passthrough (GST_BASE_TRANSFORM (filter), TRUE);
} else {
GstStructure *options;
GST_CAT_DEBUG_OBJECT (CAT_PERFORMANCE, filter, "setup videoscaling");
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;
-}