static void gst_burn_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec) { GstBurn *filter = GST_BURN (object); switch (prop_id) { case PROP_ADJUSTMENT: filter->adjustment = g_value_get_uint (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } }
static void gst_burn_get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspec) { GstBurn *filter = GST_BURN (object); GST_OBJECT_LOCK (filter); switch (prop_id) { case PROP_SILENT: g_value_set_boolean (value, filter->silent); break; case PROP_ADJUSTMENT: g_value_set_uint (value, filter->adjustment); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } GST_OBJECT_UNLOCK (filter); }
/* Actual processing. */ static GstFlowReturn gst_burn_transform_frame (GstVideoFilter * vfilter, GstVideoFrame * in_frame, GstVideoFrame * out_frame) { GstBurn *filter = GST_BURN (vfilter); gint video_size, adjustment, width, height; guint32 *src, *dest; GstClockTime timestamp; gint64 stream_time; src = GST_VIDEO_FRAME_PLANE_DATA (in_frame, 0); dest = GST_VIDEO_FRAME_PLANE_DATA (out_frame, 0); width = GST_VIDEO_FRAME_WIDTH (in_frame); height = GST_VIDEO_FRAME_HEIGHT (in_frame); video_size = width * height; /* GstController: update the properties */ timestamp = GST_BUFFER_TIMESTAMP (in_frame->buffer); stream_time = gst_segment_to_stream_time (&GST_BASE_TRANSFORM (filter)->segment, GST_FORMAT_TIME, timestamp); GST_DEBUG_OBJECT (filter, "sync to %" GST_TIME_FORMAT, GST_TIME_ARGS (timestamp)); if (GST_CLOCK_TIME_IS_VALID (stream_time)) gst_object_sync_values (GST_OBJECT (filter), stream_time); GST_OBJECT_LOCK (filter); adjustment = filter->adjustment; GST_OBJECT_UNLOCK (filter); /*** Now the image processing work.... ***/ orc_gaudi_burn (dest, src, adjustment, video_size); return GST_FLOW_OK; }