structure = gst_caps_get_structure (incaps, 0);
+ GST_OBJECT_LOCK (filter);
if (gst_structure_get_int (structure, "width", &filter->width) &&
gst_structure_get_int (structure, "height", &filter->height)) {
ret = TRUE;
}
+ GST_OBJECT_UNLOCK (filter);
return ret;
}
{
GstAgingTV *agingtv = GST_AGINGTV (object);
+ GST_OBJECT_LOCK (agingtv);
switch (prop_id) {
case PROP_SCRATCH_LINES:
g_value_set_uint (value, agingtv->scratch_lines);
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
}
+ GST_OBJECT_UNLOCK (agingtv);
}
static void
GstBuffer * out)
{
GstAgingTV *agingtv = GST_AGINGTV (trans);
- gint width = agingtv->width;
- gint height = agingtv->height;
- gint video_size = width * height;
+ gint width, height, video_size;
guint32 *src = (guint32 *) GST_BUFFER_DATA (in);
guint32 *dest = (guint32 *) GST_BUFFER_DATA (out);
- gint area_scale = width * height / 64 / 480;
+ gint area_scale;
GstFlowReturn ret = GST_FLOW_OK;
GstClockTime timestamp, stream_time;
if (GST_CLOCK_TIME_IS_VALID (stream_time))
gst_object_sync_values (G_OBJECT (agingtv), stream_time);
+ GST_OBJECT_LOCK (agingtv);
+ width = agingtv->width;
+ height = agingtv->height;
+ video_size = width * height;
+
+ area_scale = width * height / 64 / 480;
if (area_scale <= 0)
area_scale = 1;
pits (dest, width, height, area_scale, &agingtv->pits_interval);
if (area_scale > 1 && agingtv->dusts)
dusts (dest, width, height, &agingtv->dust_interval, area_scale);
+ GST_OBJECT_UNLOCK (agingtv);
return ret;
}
agingtv->color_aging = DEFAULT_COLOR_AGING;
agingtv->pits = DEFAULT_PITS;
agingtv->dusts = DEFAULT_DUSTS;
-
- gst_pad_use_fixed_caps (GST_BASE_TRANSFORM_SINK_PAD (agingtv));
- gst_pad_use_fixed_caps (GST_BASE_TRANSFORM_SRC_PAD (agingtv));
}
structure = gst_caps_get_structure (incaps, 0);
+ GST_OBJECT_LOCK (filter);
if (gst_structure_get_int (structure, "width", &filter->width) &&
gst_structure_get_int (structure, "height", &filter->height)) {
g_free (filter->dicemap);
gst_dicetv_create_map (filter);
ret = TRUE;
}
+ GST_OBJECT_UNLOCK (filter);
return ret;
}
guint32 *src, *dest;
gint i, map_x, map_y, map_i, base, dx, dy, di;
gint video_width, g_cube_bits, g_cube_size;
+ gint g_map_height, g_map_width;
GstFlowReturn ret = GST_FLOW_OK;
GstClockTime timestamp, stream_time;
+ const guint8 *dicemap;
src = (guint32 *) GST_BUFFER_DATA (in);
dest = (guint32 *) GST_BUFFER_DATA (out);
if (GST_CLOCK_TIME_IS_VALID (stream_time))
gst_object_sync_values (G_OBJECT (filter), stream_time);
+ GST_OBJECT_LOCK (filter);
video_width = filter->width;
g_cube_bits = filter->g_cube_bits;
g_cube_size = filter->g_cube_size;
+ g_map_height = filter->g_map_height;
+ g_map_width = filter->g_map_width;
+
+ dicemap = filter->dicemap;
map_i = 0;
- for (map_y = 0; map_y < filter->g_map_height; map_y++) {
- for (map_x = 0; map_x < filter->g_map_width; map_x++) {
+ for (map_y = 0; map_y < g_map_height; map_y++) {
+ for (map_x = 0; map_x < g_map_width; map_x++) {
base = (map_y << g_cube_bits) * video_width + (map_x << g_cube_bits);
- switch (filter->dicemap[map_i]) {
+ switch (dicemap[map_i]) {
case DICE_UP:
for (dy = 0; dy < g_cube_size; dy++) {
i = base + dy * video_width;
map_i++;
}
}
+ GST_OBJECT_UNLOCK (filter);
return ret;
}
switch (prop_id) {
case PROP_CUBE_BITS:
+ GST_OBJECT_LOCK (filter);
filter->g_cube_bits = g_value_get_int (value);
gst_dicetv_create_map (filter);
+ GST_OBJECT_UNLOCK (filter);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
filter->g_cube_size = 0;
filter->g_map_height = 0;
filter->g_map_width = 0;
-
- gst_pad_use_fixed_caps (GST_BASE_TRANSFORM_SINK_PAD (filter));
- gst_pad_use_fixed_caps (GST_BASE_TRANSFORM_SRC_PAD (filter));
}
structure = gst_caps_get_structure (incaps, 0);
+ GST_OBJECT_LOCK (edgetv);
if (gst_structure_get_int (structure, "width", &edgetv->width) &&
gst_structure_get_int (structure, "height", &edgetv->height)) {
guint map_size;
edgetv->map = (guint32 *) g_malloc0 (map_size);
ret = TRUE;
}
+ GST_OBJECT_UNLOCK (edgetv);
return ret;
}
guint32 *src, *dest;
guint32 p, q;
guint32 v0, v1, v2, v3;
+ gint height, width, map_height, map_width;
+ gint video_width_margin;
+ guint32 *map;
GstFlowReturn ret = GST_FLOW_OK;
src = (guint32 *) GST_BUFFER_DATA (in);
dest = (guint32 *) GST_BUFFER_DATA (out);
- src += filter->width * 4 + 4;
- dest += filter->width * 4 + 4;
-
- for (y = 1; y < filter->map_height - 1; y++) {
- for (x = 1; x < filter->map_width - 1; x++) {
+ GST_OBJECT_LOCK (filter);
+ map = filter->map;
+ height = filter->height;
+ width = filter->width;
+ map_height = filter->map_height;
+ map_width = filter->map_width;
+ video_width_margin = filter->video_width_margin;
+ src += width * 4 + 4;
+ dest += width * 4 + 4;
+
+ for (y = 1; y < map_height - 1; y++) {
+ for (x = 1; x < map_width - 1; x++) {
p = *src;
q = *(src - 4);
v2 = (r << 17) | (g << 9) | b;
/* difference between the current pixel and upper neighbor. */
- q = *(src - filter->width * 4);
+ q = *(src - width * 4);
r = ((p & 0xff0000) - (q & 0xff0000)) >> 16;
g = ((p & 0xff00) - (q & 0xff00)) >> 8;
b = (p & 0xff) - (q & 0xff);
b = 255;
v3 = (r << 17) | (g << 9) | b;
- v0 = filter->map[(y - 1) * filter->map_width * 2 + x * 2];
- v1 = filter->map[y * filter->map_width * 2 + (x - 1) * 2 + 1];
- filter->map[y * filter->map_width * 2 + x * 2] = v2;
- filter->map[y * filter->map_width * 2 + x * 2 + 1] = v3;
+ v0 = map[(y - 1) * map_width * 2 + x * 2];
+ v1 = map[y * map_width * 2 + (x - 1) * 2 + 1];
+ map[y * map_width * 2 + x * 2] = v2;
+ map[y * map_width * 2 + x * 2 + 1] = v3;
r = v0 + v1;
g = r & 0x01010100;
dest[0] = r | (g - (g >> 8));
dest[3] = v3;
r = v2 + v1;
g = r & 0x01010100;
- dest[filter->width] = r | (g - (g >> 8));
+ dest[width] = r | (g - (g >> 8));
r = v2 + v3;
g = r & 0x01010100;
- dest[filter->width + 1] = r | (g - (g >> 8));
- dest[filter->width + 2] = v3;
- dest[filter->width + 3] = v3;
- dest[filter->width * 2] = v2;
- dest[filter->width * 2 + 1] = v2;
- dest[filter->width * 3] = v2;
- dest[filter->width * 3 + 1] = v2;
+ dest[width + 1] = r | (g - (g >> 8));
+ dest[width + 2] = v3;
+ dest[width + 3] = v3;
+ dest[width * 2] = v2;
+ dest[width * 2 + 1] = v2;
+ dest[width * 3] = v2;
+ dest[width * 3 + 1] = v2;
src += 4;
dest += 4;
}
- src += filter->width * 3 + 8 + filter->video_width_margin;
- dest += filter->width * 3 + 8 + filter->video_width_margin;
+ src += width * 3 + 8 + video_width_margin;
+ dest += width * 3 + 8 + video_width_margin;
}
+ GST_OBJECT_UNLOCK (filter);
return ret;
}
GstFlowReturn ret = GST_FLOW_OK;
gint8 *p;
guint8 *diff;
- gint x, y;
+ gint x, y, width, height;
GstClockTime timestamp, stream_time;
+ guint8 phase;
timestamp = GST_BUFFER_TIMESTAMP (in);
stream_time =
if (G_UNLIKELY (filter->opmap[0] == NULL))
return GST_FLOW_NOT_NEGOTIATED;
+ GST_OBJECT_LOCK (filter);
switch (filter->mode) {
default:
case 0:
diff = filter->diff;
image_y_over (src, diff, filter->threshold, filter->width * filter->height);
+ height = filter->height;
+ width = filter->width;
+ phase = filter->phase;
- for (y = 0; y < filter->height; y++) {
- for (x = 0; x < filter->width; x++) {
- *dest++ = palette[(((guint8) (*p + filter->phase)) ^ *diff++) & 255];
+ for (y = 0; y < height; y++) {
+ for (x = 0; x < width; x++) {
+ *dest++ = palette[(((guint8) (*p + phase)) ^ *diff++) & 255];
p++;
}
}
+ GST_OBJECT_UNLOCK (filter);
return ret;
}
structure = gst_caps_get_structure (incaps, 0);
+ GST_OBJECT_LOCK (filter);
if (gst_structure_get_int (structure, "width", &filter->width) &&
gst_structure_get_int (structure, "height", &filter->height)) {
gint i;
ret = TRUE;
}
+ GST_OBJECT_UNLOCK (filter);
return ret;
}
{
GstOpTV *filter = GST_OPTV (object);
+ GST_OBJECT_LOCK (filter);
switch (prop_id) {
case PROP_MODE:
filter->mode = g_value_get_enum (value);
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
+ GST_OBJECT_UNLOCK (filter);
}
static void
#include "gstquark.h"
#include "gsteffectv.h"
+#include <gst/controller/gstcontroller.h>
#include <gst/video/video.h>
/* number of frames of time-buffer. It should be as a configurable paramater */
structure = gst_caps_get_structure (incaps, 0);
+ GST_OBJECT_LOCK (filter);
if (gst_structure_get_int (structure, "width", &filter->width) &&
gst_structure_get_int (structure, "height", &filter->height)) {
gst_quarktv_planetable_clear (filter);
filter->area = filter->width * filter->height;
ret = TRUE;
}
+ GST_OBJECT_UNLOCK (filter);
return ret;
}
gint area;
guint32 *src, *dest;
GstFlowReturn ret = GST_FLOW_OK;
+ GstClockTime timestamp;
+ GstBuffer **planetable;
+ gint planes, current_plane;
- area = filter->area;
- src = (guint32 *) GST_BUFFER_DATA (in);
- dest = (guint32 *) GST_BUFFER_DATA (out);
+ timestamp = GST_BUFFER_TIMESTAMP (in);
+ timestamp =
+ gst_segment_to_stream_time (&trans->segment, GST_FORMAT_TIME, timestamp);
+
+ GST_DEBUG_OBJECT (filter, "sync to %" GST_TIME_FORMAT,
+ GST_TIME_ARGS (timestamp));
+
+ if (GST_CLOCK_TIME_IS_VALID (timestamp))
+ gst_object_sync_values (G_OBJECT (filter), timestamp);
if (G_UNLIKELY (filter->planetable == NULL))
return GST_FLOW_WRONG_STATE;
- if (filter->planetable[filter->current_plane])
- gst_buffer_unref (filter->planetable[filter->current_plane]);
+ GST_OBJECT_LOCK (filter);
+ area = filter->area;
+ src = (guint32 *) GST_BUFFER_DATA (in);
+ dest = (guint32 *) GST_BUFFER_DATA (out);
+ planetable = filter->planetable;
+ planes = filter->planes;
+ current_plane = filter->current_plane;
- filter->planetable[filter->current_plane] = gst_buffer_ref (in);
+ if (planetable[current_plane])
+ gst_buffer_unref (planetable[current_plane]);
+ planetable[current_plane] = gst_buffer_ref (in);
/* For each pixel */
while (--area) {
GstBuffer *rand;
/* pick a random buffer */
- rand =
- filter->planetable[(filter->current_plane +
- (fastrand () >> 24)) % filter->planes];
+ rand = planetable[(current_plane + (fastrand () >> 24)) % planes];
/* Copy the pixel from the random buffer to dest */
dest[area] =
filter->current_plane--;
if (filter->current_plane < 0)
- filter->current_plane = filter->planes - 1;
+ filter->current_plane = planes - 1;
+ GST_OBJECT_UNLOCK (filter);
return ret;
}
{
GstQuarkTV *filter = GST_QUARKTV (object);
+ GST_OBJECT_LOCK (filter);
switch (prop_id) {
case PROP_PLANES:
{
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
+ GST_OBJECT_UNLOCK (filter);
}
static void
g_object_class_install_property (gobject_class, PROP_PLANES,
g_param_spec_int ("planes", "Planes",
"Number of planes", 0, 64, PLANES,
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | GST_PARAM_CONTROLLABLE));
trans_class->set_caps = GST_DEBUG_FUNCPTR (gst_quarktv_set_caps);
trans_class->transform = GST_DEBUG_FUNCPTR (gst_quarktv_transform);
guint8 *diff, *p;
guint32 *palette;
- palette = &palettes[COLORS * filter->color];
-
timestamp = GST_BUFFER_TIMESTAMP (in);
stream_time =
gst_segment_to_stream_time (&trans->segment, GST_FORMAT_TIME, timestamp);
src = (guint32 *) GST_BUFFER_DATA (in);
dest = (guint32 *) GST_BUFFER_DATA (out);
+ GST_OBJECT_LOCK (filter);
+ palette = &palettes[COLORS * filter->color];
diff = filter->diff;
if (filter->mode == 3 && filter->trigger)
filter->snaptime = filter->interval;
}
}
+ GST_OBJECT_UNLOCK (filter);
return ret;
}
structure = gst_caps_get_structure (incaps, 0);
+ GST_OBJECT_LOCK (filter);
if (gst_structure_get_int (structure, "width", &filter->width) &&
gst_structure_get_int (structure, "height", &filter->height)) {
filter->buf_width_blocks = filter->width / 32;
if (filter->buf_width_blocks > 255)
- return FALSE;
+ goto out;
filter->buf_width = filter->buf_width_blocks * 32;
filter->buf_height = filter->height;
ret = TRUE;
}
+out:
+ GST_OBJECT_UNLOCK (filter);
return ret;
}
{
GstRadioacTV *filter = GST_RADIOACTV (object);
+ GST_OBJECT_LOCK (filter);
switch (prop_id) {
case PROP_MODE:
filter->mode = g_value_get_enum (value);
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
+ GST_OBJECT_UNLOCK (filter);
}
static void
#include "gstrev.h"
#include <gst/video/video.h>
+#include <gst/controller/gstcontroller.h>
#define THE_COLOR 0xffffffff
structure = gst_caps_get_structure (incaps, 0);
+ GST_OBJECT_LOCK (filter);
if (gst_structure_get_int (structure, "width", &filter->width) &&
gst_structure_get_int (structure, "height", &filter->height)) {
ret = TRUE;
}
+ GST_OBJECT_UNLOCK (filter);
return ret;
}
guint32 *nsrc;
gint y, x, R, G, B, yval;
GstFlowReturn ret = GST_FLOW_OK;
+ gint linespace, vscale;
+ GstClockTime timestamp, stream_time;
+
+ timestamp = GST_BUFFER_TIMESTAMP (in);
+ stream_time =
+ gst_segment_to_stream_time (&trans->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 (G_OBJECT (filter), stream_time);
src = (guint32 *) GST_BUFFER_DATA (in);
dest = (guint32 *) GST_BUFFER_DATA (out);
+ GST_OBJECT_LOCK (filter);
width = filter->width;
height = filter->height;
/* Clear everything to black */
memset (dest, 0, width * height * sizeof (guint32));
+ linespace = filter->linespace;
+ vscale = filter->vscale;
+
/* draw the offset lines */
- for (y = 0; y < height; y += filter->linespace) {
+ for (y = 0; y < height; y += linespace) {
for (x = 0; x <= width; x++) {
nsrc = src + (y * width) + x;
G = ((*nsrc) & 0xff00) >> (8 - 2);
B = (*nsrc) & 0xff;
- yval = y - ((short) (R + G + B) / filter->vscale);
+ yval = y - ((short) (R + G + B) / vscale);
if (yval > 0) {
dest[x + (yval * width)] = THE_COLOR;
}
}
}
+ GST_OBJECT_UNLOCK (filter);
return ret;
}
{
GstRevTV *filter = GST_REVTV (object);
+ GST_OBJECT_LOCK (filter);
switch (prop_id) {
case PROP_DELAY:
filter->vgrabtime = g_value_get_int (value);
filter->vscale = g_value_get_int (value);
break;
default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
+ GST_OBJECT_UNLOCK (filter);
}
static void
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_DELAY,
g_param_spec_int ("delay", "Delay", "Delay in frames between updates",
- 1, 100, 1, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+ 1, 100, 1,
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | GST_PARAM_CONTROLLABLE));
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_LINESPACE,
- g_param_spec_int ("linespace", "Linespace", "Control line spacing",
- 1, 100, 6, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+ g_param_spec_int ("linespace", "Linespace", "Control line spacing", 1,
+ 100, 6,
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | GST_PARAM_CONTROLLABLE));
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_GAIN,
- g_param_spec_int ("gain", "Gain", "Control gain",
- 1, 200, 50, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+ g_param_spec_int ("gain", "Gain", "Control gain", 1, 200, 50,
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | GST_PARAM_CONTROLLABLE));
trans_class->set_caps = GST_DEBUG_FUNCPTR (gst_revtv_set_caps);
trans_class->transform = GST_DEBUG_FUNCPTR (gst_revtv_transform);
#include "gsteffectv.h"
#include <gst/video/video.h>
+#include <gst/controller/gstcontroller.h>
#define DEFAULT_MODE 0
gint width, height;
gint *p, *q, *r;
gint8 *vp;
+ GstClockTime timestamp, stream_time;
+
+ timestamp = GST_BUFFER_TIMESTAMP (in);
+ stream_time =
+ gst_segment_to_stream_time (&trans->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 (G_OBJECT (filter), stream_time);
src = (guint32 *) GST_BUFFER_DATA (in);
dest = (guint32 *) GST_BUFFER_DATA (out);
+ GST_OBJECT_LOCK (filter);
/* impact from the motion or rain drop */
if (filter->mode)
raindrop (filter);
dest += filter->width;
vp += 2;
}
+ GST_OBJECT_UNLOCK (filter);
return ret;
}
structure = gst_caps_get_structure (incaps, 0);
+ GST_OBJECT_LOCK (filter);
if (gst_structure_get_int (structure, "width", &filter->width) &&
gst_structure_get_int (structure, "height", &filter->height)) {
ret = TRUE;
}
+ GST_OBJECT_UNLOCK (filter);
return ret;
}
{
GstRippleTV *filter = GST_RIPPLETV (object);
+ GST_OBJECT_LOCK (filter);
switch (prop_id) {
case PROP_RESET:{
memset (filter->map, 0,
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
+ GST_OBJECT_UNLOCK (filter);
}
static void
g_object_class_install_property (gobject_class, PROP_RESET,
g_param_spec_boolean ("reset", "Reset",
"Reset all current ripples", FALSE,
- G_PARAM_WRITABLE | G_PARAM_STATIC_STRINGS));
+ G_PARAM_WRITABLE | G_PARAM_STATIC_STRINGS | GST_PARAM_CONTROLLABLE));
g_object_class_install_property (gobject_class, PROP_MODE,
g_param_spec_enum ("mode", "Mode",
"Mode", GST_TYPE_RIPPLETV_MODE, DEFAULT_MODE,
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | GST_PARAM_CONTROLLABLE));
trans_class->set_caps = GST_DEBUG_FUNCPTR (gst_rippletv_set_caps);
trans_class->transform = GST_DEBUG_FUNCPTR (gst_rippletv_transform);
structure = gst_caps_get_structure (incaps, 0);
+ GST_OBJECT_LOCK (filter);
if (gst_structure_get_int (structure, "width", &filter->width) &&
gst_structure_get_int (structure, "height", &filter->height)) {
gint area = filter->width * filter->height;
gst_shagadelic_initialize (filter);
ret = TRUE;
}
+ GST_OBJECT_UNLOCK (filter);
return ret;
}
src = (guint32 *) GST_BUFFER_DATA (in);
dest = (guint32 *) GST_BUFFER_DATA (out);
+ GST_OBJECT_LOCK (filter);
width = filter->width;
height = filter->height;
filter->ry += filter->rvy;
filter->bx += filter->bvx;
filter->by += filter->bvy;
+ GST_OBJECT_UNLOCK (filter);
return ret;
}
gint plane = filter->plane;
guint stride_mask, stride_shift, stride;
+ GST_OBJECT_LOCK (filter);
if (filter->feedback) {
stride_mask = 0xfcfcfcfc;
stride = 8;
plane++;
filter->plane = plane & (PLANES - 1);
+ GST_OBJECT_UNLOCK (filter);
return ret;
}
structure = gst_caps_get_structure (incaps, 0);
+ GST_OBJECT_LOCK (filter);
if (gst_structure_get_int (structure, "width", &filter->width) &&
gst_structure_get_int (structure, "height", &filter->height)) {
gint i;
ret = TRUE;
}
+ GST_OBJECT_UNLOCK (filter);
return ret;
}
#include "gstvertigo.h"
#include <gst/video/video.h>
+#include <gst/controller/gstcontroller.h>
GST_BOILERPLATE (GstVertigoTV, gst_vertigotv, GstVideoFilter,
GST_TYPE_VIDEO_FILTER);
structure = gst_caps_get_structure (incaps, 0);
+ GST_OBJECT_LOCK (filter);
if (gst_structure_get_int (structure, "width", &filter->width) &&
gst_structure_get_int (structure, "height", &filter->height)) {
gint area = filter->width * filter->height;
ret = TRUE;
}
+ GST_OBJECT_UNLOCK (filter);
return ret;
}
guint32 v;
gint x, y, ox, oy, i, width, height, area;
GstFlowReturn ret = GST_FLOW_OK;
+ GstClockTime timestamp, stream_time;
+
+ timestamp = GST_BUFFER_TIMESTAMP (in);
+ stream_time =
+ gst_segment_to_stream_time (&trans->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 (G_OBJECT (filter), stream_time);
src = (guint32 *) GST_BUFFER_DATA (in);
dest = (guint32 *) GST_BUFFER_DATA (out);
+ GST_OBJECT_LOCK (filter);
+
width = filter->width;
height = filter->height;
area = width * height;
p = filter->current_buffer;
filter->current_buffer = filter->alt_buffer;
filter->alt_buffer = p;
+ GST_OBJECT_UNLOCK (filter);
return ret;
}
{
GstVertigoTV *filter = GST_VERTIGOTV (object);
+ GST_OBJECT_LOCK (filter);
switch (prop_id) {
case PROP_SPEED:
filter->phase_increment = g_value_get_float (value);
default:
break;
}
+ GST_OBJECT_UNLOCK (filter);
}
static void
structure = gst_caps_get_structure (incaps, 0);
+ GST_OBJECT_LOCK (filter);
if (gst_structure_get_int (structure, "width", &filter->width) &&
gst_structure_get_int (structure, "height", &filter->height)) {
g_free (filter->disttable);
initDistTable (filter);
ret = TRUE;
}
+ GST_OBJECT_UNLOCK (filter);
return ret;
}
gst_warptv_transform (GstBaseTransform * trans, GstBuffer * in, GstBuffer * out)
{
GstWarpTV *warptv = GST_WARPTV (trans);
- int width = warptv->width;
- int height = warptv->height;
+ gint width, height;
guint32 *src = (guint32 *) GST_BUFFER_DATA (in);
guint32 *dest = (guint32 *) GST_BUFFER_DATA (out);
gint xw, yw, cw;
gint32 *ctable;
GstFlowReturn ret = GST_FLOW_OK;
+ GST_OBJECT_LOCK (warptv);
+ width = warptv->width;
+ height = warptv->height;
+
xw = (gint) (sin ((warptv->tval + 100) * M_PI / 128) * 30);
yw = (gint) (sin ((warptv->tval) * M_PI / 256) * -35);
cw = (gint) (sin ((warptv->tval - 70) * M_PI / 64) * 50);
}
warptv->tval = (warptv->tval + 1) & 511;
+ GST_OBJECT_UNLOCK (warptv);
return ret;
}