*
* + deinterlacing
* + HDR tone mapping
- * + colorimetry
- * + cropping
*/
#ifdef HAVE_CONFIG_H
GstVaBaseTransform parent;
gboolean rebuild_filters;
- gboolean forward_crop;
guint op_flags;
/* filters */
_update_properties_unlocked (self);
GST_OBJECT_UNLOCK (object);
- /* no reconfig here because it's done in
- * _update_properties_unlocked() */
gst_va_vpp_update_passthrough (self, FALSE);
}
gst_va_vpp_propose_allocation (GstBaseTransform * trans,
GstQuery * decide_query, GstQuery * query)
{
- GstVaVpp *self = GST_VA_VPP (trans);
-
- if (!GST_BASE_TRANSFORM_CLASS (parent_class)->propose_allocation (trans,
- decide_query, query)) {
- self->forward_crop = FALSE;
- return FALSE;
- }
+ /* if we are not passthrough, we can handle crop meta */
+ if (decide_query)
+ gst_query_add_allocation_meta (query, GST_VIDEO_CROP_META_API_TYPE, NULL);
- self->forward_crop =
- (gst_query_find_allocation_meta (query, GST_VIDEO_CROP_META_API_TYPE,
- NULL)
- && gst_query_find_allocation_meta (query, GST_VIDEO_META_API_TYPE, NULL));
-
-
- gst_query_add_allocation_meta (query, GST_VIDEO_CROP_META_API_TYPE, NULL);
-
- return TRUE;
+ return GST_BASE_TRANSFORM_CLASS (parent_class)->propose_allocation (trans,
+ decide_query, query);
}
static void
GstVaVpp *self = GST_VA_VPP (trans);
GstVaBaseTransform *btrans = GST_VA_BASE_TRANSFORM (self);
GstClockTime ts, stream_time;
+ gboolean is_passthrough;
ts = GST_BUFFER_TIMESTAMP (inbuf);
stream_time =
if (GST_CLOCK_TIME_IS_VALID (stream_time))
gst_object_sync_values (GST_OBJECT (self), stream_time);
+ gst_va_vpp_rebuild_filters (self);
+ gst_va_vpp_update_passthrough (self, TRUE);
+
+ /* cropping is only enabled if vapostproc is not in passthrough */
+ is_passthrough = gst_base_transform_is_passthrough (trans);
GST_OBJECT_LOCK (self);
- if (gst_buffer_get_video_crop_meta (inbuf)) {
- /* enable cropping if either already do operations on frame or
- * downstream doesn't support cropping */
- if (self->op_flags == 0 && self->forward_crop) {
- self->op_flags &= ~VPP_CONVERT_CROP;
- } else {
- self->op_flags |= VPP_CONVERT_CROP;
- }
+ if (!is_passthrough && gst_buffer_get_video_crop_meta (inbuf)) {
+ self->op_flags |= VPP_CONVERT_CROP;
} else {
self->op_flags &= ~VPP_CONVERT_CROP;
}
gst_va_filter_enable_cropping (btrans->filter,
(self->op_flags & VPP_CONVERT_CROP));
GST_OBJECT_UNLOCK (self);
-
- gst_va_vpp_rebuild_filters (self);
- gst_va_vpp_update_passthrough (self, TRUE);
}
static GstFlowReturn
break;
}
- /* TODO: add cropping factor */
*w_factor = GST_VIDEO_INFO_WIDTH (&btrans->out_info);
*w_factor /= w;
new_x *= w_factor;
new_y *= h_factor;
- /* TODO: crop compensation */
+ /* crop compensation is done by videocrop */
GST_TRACE_OBJECT (self, "from %fx%f to %fx%f", x, y, new_x, new_y);
gst_structure_set (structure, "pointer_x", G_TYPE_DOUBLE, new_x,
_update_properties_unlocked (self);
GST_OBJECT_UNLOCK (self);
- /* no reconfig here because it's done in
- * _update_properties_unlocked */
gst_va_vpp_update_passthrough (self, FALSE);
break;