summaryrefslogtreecommitdiffstats
path: root/gst/videobox
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2005-08-04 20:05:51 +0000
committerAndy Wingo <wingo@pobox.com>2005-08-04 20:05:51 +0000
commit284327da55e36fcda8e9665b4e01f7d5a198d738 (patch)
tree343c2fb359e7e346a103991e83a5e142248e5190 /gst/videobox
parent6af187c535f54a4cd71aa85fe7b204b4cec2eac4 (diff)
sys/oss/gstossaudio.c (plugin_init): Second-class citizen.
Original commit message from CVS: 2005-08-04 Andy Wingo <wingo@pobox.com> * sys/oss/gstossaudio.c (plugin_init): Second-class citizen. * gst/videobox/gstvideobox.c (gst_video_box_get_size): Update for API changes. * configure.ac (DEFAULT_AUDIOSINK, DEFAULT_VIDEOSINK): Set to autoaudiosink and autovideosink.
Diffstat (limited to 'gst/videobox')
-rw-r--r--gst/videobox/gstvideobox.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/gst/videobox/gstvideobox.c b/gst/videobox/gstvideobox.c
index daf51a37..9b53078d 100644
--- a/gst/videobox/gstvideobox.c
+++ b/gst/videobox/gstvideobox.c
@@ -129,7 +129,7 @@ static GstCaps *gst_video_box_transform_caps (GstBaseTransform * trans,
GstPad * pad, GstCaps * from);
static gboolean gst_video_box_set_caps (GstBaseTransform * trans,
GstCaps * in, GstCaps * out);
-static guint gst_video_box_get_size (GstBaseTransform * trans);
+static guint gst_video_box_get_size (GstBaseTransform * trans, GstCaps * caps);
static GstFlowReturn gst_video_box_transform (GstBaseTransform * trans,
GstBuffer * in, GstBuffer * out);
@@ -391,18 +391,23 @@ gst_video_box_set_caps (GstBaseTransform * trans, GstCaps * in, GstCaps * out)
#define GST_VIDEO_I420_SIZE(w,h) (GST_VIDEO_I420_V_OFFSET(w,h)+(GST_VIDEO_I420_V_ROWSTRIDE(w)*ROUND_UP_2(h)/2))
static guint
-gst_video_box_get_size (GstBaseTransform * trans)
+gst_video_box_get_size (GstBaseTransform * trans, GstCaps * caps)
{
- guint size;
+ guint size = -1;
GstVideoBox *video_box;
video_box = GST_VIDEO_BOX (trans);
- if (video_box->use_alpha) {
- size = video_box->out_height * video_box->out_height * 4;
- } else {
- size = GST_VIDEO_I420_SIZE (video_box->out_width, video_box->out_height);
+ if (gst_caps_is_equal (caps, GST_PAD_CAPS (trans->sinkpad))) {
+ size = GST_VIDEO_I420_SIZE (video_box->in_width, video_box->in_height);
+ } else if (gst_caps_is_equal (caps, GST_PAD_CAPS (trans->srcpad))) {
+ if (video_box->use_alpha) {
+ size = video_box->out_height * video_box->out_height * 4;
+ } else {
+ size = GST_VIDEO_I420_SIZE (video_box->out_width, video_box->out_height);
+ }
}
+
return size;
}