From 46c2655999759820618416f245c06816c33a4e02 Mon Sep 17 00:00:00 2001 From: Thomas Vander Stichele Date: Mon, 26 Apr 2004 13:47:38 +0000 Subject: fix jpeg getcaps so it negotiates correctly Original commit message from CVS: fix jpeg getcaps so it negotiates correctly --- ext/jpeg/gstjpegenc.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'ext') diff --git a/ext/jpeg/gstjpegenc.c b/ext/jpeg/gstjpegenc.c index 4e646198..57eaaf91 100644 --- a/ext/jpeg/gstjpegenc.c +++ b/ext/jpeg/gstjpegenc.c @@ -230,8 +230,10 @@ gst_jpegenc_getcaps (GstPad * pad) GstCaps *caps; const char *name; int i; - GstStructure *structure; + GstStructure *structure = NULL; + /* we want to proxy properties like width, height and framerate from the + other end of the element */ otherpad = (pad == jpegenc->srcpad) ? jpegenc->sinkpad : jpegenc->srcpad; caps = gst_pad_get_allowed_caps (otherpad); if (pad == jpegenc->srcpad) { @@ -246,6 +248,11 @@ gst_jpegenc_getcaps (GstPad * pad) gst_structure_remove_field (structure, "format"); } + /* ... but for the sink pad, we only do I420 anyway, so add that */ + if (pad == jpegenc->sinkpad) { + gst_structure_set (structure, "format", GST_TYPE_FOURCC, + GST_STR_FOURCC ("I420"), NULL); + } return caps; } -- cgit