summaryrefslogtreecommitdiffstats
path: root/gst/videobox
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@collabora.co.uk>2008-10-21 12:38:35 +0000
committerJan Schmidt <thaytan@mad.scientist.com>2008-10-21 12:38:35 +0000
commit8508561fcc08936cfc3e85f0b68fbdd0f205b494 (patch)
tree9b5e53a6e1d8615092c2f3c2dfa6ebcc5f093ad6 /gst/videobox
parenta39bf9ad081d1729f27b528a8b56e9c083ed7b3e (diff)
gst/videobox/gstvideobox.c: support dynamically changing properties in videobox
Original commit message from CVS: * gst/videobox/gstvideobox.c: support dynamically changing properties in videobox Fixed: #557085 Patch By: Wim Taymans <wim.taymans@collabora.co.uk>
Diffstat (limited to 'gst/videobox')
-rw-r--r--gst/videobox/gstvideobox.c47
1 files changed, 19 insertions, 28 deletions
diff --git a/gst/videobox/gstvideobox.c b/gst/videobox/gstvideobox.c
index 2f9d17d0..0e6e112c 100644
--- a/gst/videobox/gstvideobox.c
+++ b/gst/videobox/gstvideobox.c
@@ -133,7 +133,6 @@ static void gst_video_box_set_property (GObject * object, guint prop_id,
static void gst_video_box_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec);
-static gboolean video_box_recalc_transform (GstVideoBox * video_box);
static GstCaps *gst_video_box_transform_caps (GstBaseTransform * trans,
GstPadDirection direction, GstCaps * from);
static gboolean gst_video_box_set_caps (GstBaseTransform * trans,
@@ -304,7 +303,7 @@ gst_video_box_set_property (GObject * object, guint prop_id,
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
- video_box_recalc_transform (video_box);
+ GST_DEBUG_OBJECT (video_box, "Calling reconfigure");
gst_base_transform_reconfigure (GST_BASE_TRANSFORM (video_box));
GST_BASE_TRANSFORM_UNLOCK (GST_BASE_TRANSFORM_CAST (video_box));
}
@@ -374,7 +373,7 @@ gst_video_box_transform_caps (GstBaseTransform * trans,
if (width <= 0)
width = 1;
- GST_DEBUG ("New caps width: %d", width);
+ GST_DEBUG_OBJECT (trans, "New caps width: %d", width);
gst_structure_set (structure, "width", G_TYPE_INT, width, NULL);
}
@@ -390,7 +389,7 @@ gst_video_box_transform_caps (GstBaseTransform * trans,
if (height <= 0)
height = 1;
- GST_DEBUG ("New caps height: %d", height);
+ GST_DEBUG_OBJECT (trans, "New caps height: %d", height);
gst_structure_set (structure, "height", G_TYPE_INT, height, NULL);
}
@@ -408,26 +407,6 @@ gst_video_box_transform_caps (GstBaseTransform * trans,
}
static gboolean
-video_box_recalc_transform (GstVideoBox * video_box)
-{
- gboolean res = TRUE;
-
- /* if we have the same format in and out and we don't need to perform and
- * cropping at all, we can just operate in passthorugh mode */
- if (video_box->in_fourcc == video_box->out_fourcc &&
- video_box->box_left == 0 && video_box->box_right == 0 &&
- video_box->box_top == 0 && video_box->box_bottom == 0) {
-
- GST_LOG_OBJECT (video_box, "we are using passthrough");
- gst_base_transform_set_passthrough (GST_BASE_TRANSFORM (video_box), TRUE);
- } else {
- GST_LOG_OBJECT (video_box, "we are not using passthrough");
- gst_base_transform_set_passthrough (GST_BASE_TRANSFORM (video_box), FALSE);
- }
- return res;
-}
-
-static gboolean
gst_video_box_set_caps (GstBaseTransform * trans, GstCaps * in, GstCaps * out)
{
GstVideoBox *video_box;
@@ -450,11 +429,23 @@ gst_video_box_set_caps (GstBaseTransform * trans, GstCaps * in, GstCaps * out)
if (!ret)
goto no_caps;
- GST_DEBUG ("Input w: %d h: %d", video_box->in_width, video_box->in_height);
- GST_DEBUG ("Output w: %d h: %d", video_box->out_width, video_box->out_height);
+ GST_DEBUG_OBJECT (trans, "Input w: %d h: %d", video_box->in_width,
+ video_box->in_height);
+ GST_DEBUG_OBJECT (trans, "Output w: %d h: %d", video_box->out_width,
+ video_box->out_height);
- /* recalc the transformation strategy */
- ret = video_box_recalc_transform (video_box);
+ /* if we have the same format in and out and we don't need to perform and
+ * cropping at all, we can just operate in passthorugh mode */
+ if (video_box->in_fourcc == video_box->out_fourcc &&
+ video_box->box_left == 0 && video_box->box_right == 0 &&
+ video_box->box_top == 0 && video_box->box_bottom == 0) {
+
+ GST_LOG_OBJECT (video_box, "we are using passthrough");
+ gst_base_transform_set_passthrough (GST_BASE_TRANSFORM (video_box), TRUE);
+ } else {
+ GST_LOG_OBJECT (video_box, "we are not using passthrough");
+ gst_base_transform_set_passthrough (GST_BASE_TRANSFORM (video_box), FALSE);
+ }
return ret;