diff --git a/ChangeLog b/ChangeLog index 06ead7600a..413c045d9d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2004-07-26 Thomas Vander Stichele + + * gst/ffmpegcolorspace/gstffmpegcodecmap.c: + (gst_ffmpeg_caps_to_pix_fmt): + * gst/ffmpegcolorspace/gstffmpegcodecmap.h: + * gst/ffmpegcolorspace/gstffmpegcolorspace.c: + (gst_ffmpegcolorspace_pad_link): + don't make function do two things at the same time without reason. + 2004-07-26 Steve Lhomme * gst/ac3parse/ac3parse.vcproj diff --git a/gst/ffmpegcolorspace/gstffmpegcodecmap.c b/gst/ffmpegcolorspace/gstffmpegcodecmap.c index 0eaf3aa393..7d6e1361ce 100644 --- a/gst/ffmpegcolorspace/gstffmpegcodecmap.c +++ b/gst/ffmpegcolorspace/gstffmpegcodecmap.c @@ -191,8 +191,7 @@ gst_ffmpeg_pix_fmt_to_caps (void) */ enum PixelFormat -gst_ffmpeg_caps_to_pix_fmt (const GstCaps * caps, - int *width, int *height, double *framerate) +gst_ffmpeg_caps_to_pix_fmt (const GstCaps * caps) { GstStructure *structure; enum PixelFormat pix_fmt = PIX_FMT_NB; @@ -200,10 +199,6 @@ gst_ffmpeg_caps_to_pix_fmt (const GstCaps * caps, g_return_val_if_fail (gst_caps_get_size (caps) == 1, PIX_FMT_NB); structure = gst_caps_get_structure (caps, 0); - gst_structure_get_int (structure, "width", width); - gst_structure_get_int (structure, "height", height); - gst_structure_get_double (structure, "framerate", framerate); - if (strcmp (gst_structure_get_name (structure), "video/x-raw-yuv") == 0) { guint32 fourcc; diff --git a/gst/ffmpegcolorspace/gstffmpegcodecmap.h b/gst/ffmpegcolorspace/gstffmpegcodecmap.h index 48312d63ea..9a00ff47bf 100644 --- a/gst/ffmpegcolorspace/gstffmpegcodecmap.h +++ b/gst/ffmpegcolorspace/gstffmpegcodecmap.h @@ -31,8 +31,6 @@ gst_ffmpeg_pix_fmt_to_caps (void); /* Disect a GstCaps */ enum PixelFormat -gst_ffmpeg_caps_to_pix_fmt (const GstCaps *caps, - int *width, int *height, - double *fps); +gst_ffmpeg_caps_to_pix_fmt (const GstCaps *caps); #endif /* __GST_FFMPEG_CODECMAP_H__ */ diff --git a/gst/ffmpegcolorspace/gstffmpegcolorspace.c b/gst/ffmpegcolorspace/gstffmpegcolorspace.c index a617904456..dfbdbbaa67 100644 --- a/gst/ffmpegcolorspace/gstffmpegcolorspace.c +++ b/gst/ffmpegcolorspace/gstffmpegcolorspace.c @@ -165,15 +165,22 @@ static GstPadLinkReturn gst_ffmpegcolorspace_pad_link (GstPad * pad, const GstCaps * caps) { GstFFMpegColorspace *space; + GstStructure *structure; const GstCaps *othercaps; GstPad *otherpad; GstPadLinkReturn ret; + enum PixelFormat pix_fmt; int height, width; double framerate; - enum PixelFormat pix_fmt; space = GST_FFMPEGCOLORSPACE (gst_pad_get_parent (pad)); + structure = gst_caps_get_structure (caps, 0); + + gst_structure_get_int (structure, "width", &width); + gst_structure_get_int (structure, "height", &height); + gst_structure_get_double (structure, "framerate", &framerate); + otherpad = (pad == space->srcpad) ? space->sinkpad : space->srcpad; GST_DEBUG_OBJECT (space, "pad_link on %s:%s with caps %" GST_PTR_FORMAT, @@ -183,7 +190,7 @@ gst_ffmpegcolorspace_pad_link (GstPad * pad, const GstCaps * caps) /* loop over all possibilities and select the first one we can convert and * is accepted by the peer */ - pix_fmt = gst_ffmpeg_caps_to_pix_fmt (caps, &width, &height, &framerate); + pix_fmt = gst_ffmpeg_caps_to_pix_fmt (caps); if (pix_fmt == PIX_FMT_NB) { /* we disable ourself here */ if (pad == space->srcpad) { @@ -199,13 +206,13 @@ gst_ffmpegcolorspace_pad_link (GstPad * pad, const GstCaps * caps) /* set the size on the otherpad */ othercaps = gst_pad_get_negotiated_caps (otherpad); if (othercaps) { - GstCaps *caps = gst_caps_copy (othercaps); + GstCaps *newothercaps = gst_caps_copy (othercaps); - gst_caps_set_simple (caps, + gst_caps_set_simple (newothercaps, "width", G_TYPE_INT, width, "height", G_TYPE_INT, height, "framerate", G_TYPE_DOUBLE, framerate, NULL); - ret = gst_pad_try_set_caps (otherpad, caps); + ret = gst_pad_try_set_caps (otherpad, newothercaps); if (GST_PAD_LINK_FAILED (ret)) { return ret; }