From: <tho...@fr...> - 2004-07-26 13:30:45
|
CVS Root: /home/cvs/gstreamer Module: gst-plugins Changes by: thomasvs Date: Mon Jul 26 2004 23:30:40 EST Log message: don't make function do two things Modified files: . : ChangeLog gst/ffmpegcolorspace: gstffmpegcodecmap.c gstffmpegcodecmap.h gstffmpegcolorspace.c Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/ChangeLog.diff?r1=1.914&r2=1.915 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/gst/ffmpegcolorspace/gstffmpegcodecmap.c.diff?r1=1.5&r2=1.6 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/gst/ffmpegcolorspace/gstffmpegcodecmap.h.diff?r1=1.1&r2=1.2 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/gst/ffmpegcolorspace/gstffmpegcolorspace.c.diff?r1=1.12&r2=1.13 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /home/cvs/gstreamer/gst-plugins/ChangeLog,v retrieving revision 1.914 retrieving revision 1.915 diff -u -d -r1.914 -r1.915 --- ChangeLog 26 Jul 2004 13:20:02 -0000 1.914 +++ ChangeLog 26 Jul 2004 13:30:28 -0000 1.915 @@ -1,3 +1,12 @@ +2004-07-26 Thomas Vander Stichele <thomas at apestaart dot org> + + * 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 <ste...@fr...> * gst/ac3parse/ac3parse.vcproj Index: gstffmpegcodecmap.c RCS file: /home/cvs/gstreamer/gst-plugins/gst/ffmpegcolorspace/gstffmpegcodecmap.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- gstffmpegcodecmap.c 6 Jun 2004 20:59:00 -0000 1.5 +++ gstffmpegcodecmap.c 26 Jul 2004 13:30:28 -0000 1.6 @@ -191,8 +191,7 @@ */ 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 @@ 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; Index: gstffmpegcodecmap.h RCS file: /home/cvs/gstreamer/gst-plugins/gst/ffmpegcolorspace/gstffmpegcodecmap.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- gstffmpegcodecmap.h 15 Mar 2004 16:27:29 -0000 1.1 +++ gstffmpegcodecmap.h 26 Jul 2004 13:30:28 -0000 1.2 @@ -31,8 +31,6 @@ /* Disect a GstCaps */ -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__ */ Index: gstffmpegcolorspace.c RCS file: /home/cvs/gstreamer/gst-plugins/gst/ffmpegcolorspace/gstffmpegcolorspace.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- gstffmpegcolorspace.c 26 Jul 2004 12:07:37 -0000 1.12 +++ gstffmpegcolorspace.c 26 Jul 2004 13:30:28 -0000 1.13 @@ -165,15 +165,22 @@ 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 @@ /* 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 @@ /* 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; } |