From 46c2655999759820618416f245c06816c33a4e02 Mon Sep 17 00:00:00 2001 From: Thomas Vander Stichele Date: Mon, 26 Apr 2004 13:47:38 +0000 Subject: [PATCH] fix jpeg getcaps so it negotiates correctly Original commit message from CVS: fix jpeg getcaps so it negotiates correctly --- ChangeLog | 7 +++++++ ext/jpeg/gstjpegenc.c | 9 ++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index dea300d568..fd3c7aaeeb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2004-04-26 Thomas Vander Stichele + + * Makefile.am: + * ext/jpeg/gstjpegenc.c: (gst_jpegenc_get_type), + (gst_jpegenc_class_init), (gst_jpegenc_getcaps): + fix _getcaps so it only negotiates to its supported format + 2004-04-25 Benjamin Otte * gst/audioconvert/gstaudioconvert.c: (_fixate_caps_to_int): diff --git a/ext/jpeg/gstjpegenc.c b/ext/jpeg/gstjpegenc.c index 4e646198a0..57eaaf9153 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; }