summaryrefslogtreecommitdiffstats
path: root/gst/videofilter/gstvideoflip.c
diff options
context:
space:
mode:
authorThomas Vander Stichele <thomas@apestaart.org>2005-07-25 14:06:15 +0000
committerThomas Vander Stichele <thomas@apestaart.org>2005-07-25 14:06:15 +0000
commit6c3ff34ee03b5b4a2e0c93d369bfe66bcd8d66f3 (patch)
treec4efb39c7c2ef4ca2cc06d7be0570f39fda96900 /gst/videofilter/gstvideoflip.c
parent9cb331788cd821a5bbd4360a33b2973fd490e2e7 (diff)
forward port from 0.9 and enable videoflip now that it works
Original commit message from CVS: forward port from 0.9 and enable videoflip now that it works
Diffstat (limited to 'gst/videofilter/gstvideoflip.c')
-rw-r--r--gst/videofilter/gstvideoflip.c56
1 files changed, 27 insertions, 29 deletions
diff --git a/gst/videofilter/gstvideoflip.c b/gst/videofilter/gstvideoflip.c
index c95b53ce..4d6d37d6 100644
--- a/gst/videofilter/gstvideoflip.c
+++ b/gst/videofilter/gstvideoflip.c
@@ -45,6 +45,9 @@ enum
/* FILL ME */
};
+GST_DEBUG_CATEGORY_STATIC (gst_videoflip_debug);
+#define GST_CAT_DEFAULT gst_videoflip_debug
+
static void gst_videoflip_base_init (gpointer g_class);
static void gst_videoflip_class_init (gpointer g_class, gpointer class_data);
static void gst_videoflip_init (GTypeInstance * instance, gpointer g_class);
@@ -164,7 +167,7 @@ gst_videoflip_init (GTypeInstance * instance, gpointer g_class)
GstVideoflip *videoflip = GST_VIDEOFLIP (instance);
GstVideofilter *videofilter;
- GST_DEBUG ("gst_videoflip_init");
+ GST_DEBUG_OBJECT (videoflip, "gst_videoflip_init");
videofilter = GST_VIDEOFILTER (videoflip);
@@ -175,17 +178,21 @@ static void
gst_videoflip_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec)
{
- GstVideoflip *src;
+ GstVideoflip *videoflip;
+ GstVideofilter *videofilter;
g_return_if_fail (GST_IS_VIDEOFLIP (object));
- src = GST_VIDEOFLIP (object);
+ videoflip = GST_VIDEOFLIP (object);
+ videofilter = GST_VIDEOFILTER (object);
- GST_DEBUG ("gst_videoflip_set_property");
+ GST_DEBUG_OBJECT (videoflip, "gst_videoflip_set_property");
switch (prop_id) {
case ARG_METHOD:
- src->method = g_value_get_enum (value);
- /* FIXME is this ok? (threading issues) */
- gst_videoflip_setup (GST_VIDEOFILTER (src));
+ videoflip->method = g_value_get_enum (value);
+ if (videofilter->inited) {
+ GST_DEBUG_OBJECT (videoflip, "setting up videoflip again");
+ gst_videofilter_setup (videofilter);
+ }
break;
default:
break;
@@ -196,14 +203,14 @@ static void
gst_videoflip_get_property (GObject * object, guint prop_id, GValue * value,
GParamSpec * pspec)
{
- GstVideoflip *src;
+ GstVideoflip *videoflip;
g_return_if_fail (GST_IS_VIDEOFLIP (object));
- src = GST_VIDEOFLIP (object);
+ videoflip = GST_VIDEOFLIP (object);
switch (prop_id) {
case ARG_METHOD:
- g_value_set_enum (value, src->method);
+ g_value_set_enum (value, videoflip->method);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
@@ -214,8 +221,7 @@ gst_videoflip_get_property (GObject * object, guint prop_id, GValue * value,
static gboolean
plugin_init (GstPlugin * plugin)
{
- if (!gst_library_load ("gstvideofilter"))
- return FALSE;
+ GST_DEBUG_CATEGORY_INIT (gst_videoflip_debug, "videoflip", 0, "videoflip");
return gst_element_register (plugin, "videoflip", GST_RANK_NONE,
GST_TYPE_VIDEOFLIP);
@@ -225,20 +231,20 @@ GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
GST_VERSION_MINOR,
"videoflip",
"Flips and rotates video",
- plugin_init, VERSION, GST_LICENSE, GST_PACKAGE, GST_ORIGIN)
+ plugin_init, VERSION, GST_LICENSE, GST_PACKAGE, GST_ORIGIN);
- static void gst_videoflip_flip (GstVideoflip * videoflip,
+static void gst_videoflip_flip (GstVideoflip * videoflip,
unsigned char *dest, unsigned char *src, int sw, int sh, int dw, int dh);
- static void gst_videoflip_setup (GstVideofilter * videofilter)
+static void
+gst_videoflip_setup (GstVideofilter * videofilter)
{
int from_width, from_height;
GstVideoflip *videoflip;
- GST_DEBUG ("gst_videoflip_setup");
-
videoflip = GST_VIDEOFLIP (videofilter);
+ GST_DEBUG_OBJECT (videoflip, "gst_videoflip_setup");
from_width = gst_videofilter_get_input_width (videofilter);
from_height = gst_videofilter_get_input_height (videofilter);
@@ -265,25 +271,16 @@ GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
break;
}
- GST_DEBUG ("format=%p \"%s\" from %dx%d to %dx%d",
+ GST_DEBUG_OBJECT (videoflip, "format=%p \"%s\" from %dx%d to %dx%d",
videofilter->format, videofilter->format->fourcc,
from_width, from_height, videofilter->to_width, videofilter->to_height);
if (videoflip->method == GST_VIDEOFLIP_METHOD_IDENTITY) {
- GST_DEBUG ("videoflip: using passthru");
+ GST_DEBUG_OBJECT (videoflip, "videoflip: using passthru");
videofilter->passthru = TRUE;
} else {
videofilter->passthru = FALSE;
}
-
- videofilter->from_buf_size =
- (videofilter->from_width * videofilter->from_height *
- videofilter->format->depth) / 8;
- videofilter->to_buf_size =
- (videofilter->to_width * videofilter->to_height *
- videofilter->format->depth) / 8;
-
- videofilter->inited = TRUE;
}
static void
@@ -303,7 +300,8 @@ gst_videoflip_planar411 (GstVideofilter * videofilter, void *dest, void *src)
dw = videofilter->to_width;
dh = videofilter->to_height;
- GST_DEBUG ("videoflip: scaling planar 4:1:1 %dx%d to %dx%d", sw, sh, dw, dh);
+ GST_LOG_OBJECT (videoflip, "videoflip: scaling planar 4:1:1 %dx%d to %dx%d",
+ sw, sh, dw, dh);
gst_videoflip_flip (videoflip, dest, src, sw, sh, dw, dh);