don't make function do two things
Original commit message from CVS: don't make function do two things
This commit is contained in:
parent
17615126c2
commit
9d17d2d661
@ -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 <steve.lhomme@free.fr>
|
2004-07-26 Steve Lhomme <steve.lhomme@free.fr>
|
||||||
|
|
||||||
* gst/ac3parse/ac3parse.vcproj
|
* gst/ac3parse/ac3parse.vcproj
|
||||||
|
@ -191,8 +191,7 @@ gst_ffmpeg_pix_fmt_to_caps (void)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
enum PixelFormat
|
enum PixelFormat
|
||||||
gst_ffmpeg_caps_to_pix_fmt (const GstCaps * caps,
|
gst_ffmpeg_caps_to_pix_fmt (const GstCaps * caps)
|
||||||
int *width, int *height, double *framerate)
|
|
||||||
{
|
{
|
||||||
GstStructure *structure;
|
GstStructure *structure;
|
||||||
enum PixelFormat pix_fmt = PIX_FMT_NB;
|
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);
|
g_return_val_if_fail (gst_caps_get_size (caps) == 1, PIX_FMT_NB);
|
||||||
structure = gst_caps_get_structure (caps, 0);
|
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) {
|
if (strcmp (gst_structure_get_name (structure), "video/x-raw-yuv") == 0) {
|
||||||
guint32 fourcc;
|
guint32 fourcc;
|
||||||
|
|
||||||
|
@ -31,8 +31,6 @@ gst_ffmpeg_pix_fmt_to_caps (void);
|
|||||||
/* Disect a GstCaps */
|
/* Disect a GstCaps */
|
||||||
|
|
||||||
enum PixelFormat
|
enum PixelFormat
|
||||||
gst_ffmpeg_caps_to_pix_fmt (const GstCaps *caps,
|
gst_ffmpeg_caps_to_pix_fmt (const GstCaps *caps);
|
||||||
int *width, int *height,
|
|
||||||
double *fps);
|
|
||||||
|
|
||||||
#endif /* __GST_FFMPEG_CODECMAP_H__ */
|
#endif /* __GST_FFMPEG_CODECMAP_H__ */
|
||||||
|
@ -165,15 +165,22 @@ static GstPadLinkReturn
|
|||||||
gst_ffmpegcolorspace_pad_link (GstPad * pad, const GstCaps * caps)
|
gst_ffmpegcolorspace_pad_link (GstPad * pad, const GstCaps * caps)
|
||||||
{
|
{
|
||||||
GstFFMpegColorspace *space;
|
GstFFMpegColorspace *space;
|
||||||
|
GstStructure *structure;
|
||||||
const GstCaps *othercaps;
|
const GstCaps *othercaps;
|
||||||
GstPad *otherpad;
|
GstPad *otherpad;
|
||||||
GstPadLinkReturn ret;
|
GstPadLinkReturn ret;
|
||||||
|
enum PixelFormat pix_fmt;
|
||||||
int height, width;
|
int height, width;
|
||||||
double framerate;
|
double framerate;
|
||||||
enum PixelFormat pix_fmt;
|
|
||||||
|
|
||||||
space = GST_FFMPEGCOLORSPACE (gst_pad_get_parent (pad));
|
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;
|
otherpad = (pad == space->srcpad) ? space->sinkpad : space->srcpad;
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (space, "pad_link on %s:%s with caps %" GST_PTR_FORMAT,
|
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
|
/* loop over all possibilities and select the first one we can convert and
|
||||||
* is accepted by the peer */
|
* 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) {
|
if (pix_fmt == PIX_FMT_NB) {
|
||||||
/* we disable ourself here */
|
/* we disable ourself here */
|
||||||
if (pad == space->srcpad) {
|
if (pad == space->srcpad) {
|
||||||
@ -199,13 +206,13 @@ gst_ffmpegcolorspace_pad_link (GstPad * pad, const GstCaps * caps)
|
|||||||
/* set the size on the otherpad */
|
/* set the size on the otherpad */
|
||||||
othercaps = gst_pad_get_negotiated_caps (otherpad);
|
othercaps = gst_pad_get_negotiated_caps (otherpad);
|
||||||
if (othercaps) {
|
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,
|
"width", G_TYPE_INT, width,
|
||||||
"height", G_TYPE_INT, height,
|
"height", G_TYPE_INT, height,
|
||||||
"framerate", G_TYPE_DOUBLE, framerate, NULL);
|
"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)) {
|
if (GST_PAD_LINK_FAILED (ret)) {
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user