mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 09:10:36 +00:00
gst/audioconvert/gstaudioconvert.c: make sure we don't allow depth > width
Original commit message from CVS: * gst/audioconvert/gstaudioconvert.c: (gst_audio_convert_parse_caps): make sure we don't allow depth > width * gst/audioconvert/gstaudioconvert.c: (gst_audio_convert_fixate): fixate endianness to G_BYTE_ORDER as default * gst/audioscale/gstaudioscale.c: we don't handle another endianness as host-endianness
This commit is contained in:
parent
7e27333a2b
commit
4f845c50ce
3 changed files with 45 additions and 3 deletions
10
ChangeLog
10
ChangeLog
|
@ -1,3 +1,13 @@
|
||||||
|
2004-05-25 Benjamin Otte <in7y118@public.uni-hamburg.de>
|
||||||
|
|
||||||
|
* gst/audioconvert/gstaudioconvert.c:
|
||||||
|
(gst_audio_convert_parse_caps):
|
||||||
|
make sure we don't allow depth > width
|
||||||
|
* gst/audioconvert/gstaudioconvert.c: (gst_audio_convert_fixate):
|
||||||
|
fixate endianness to G_BYTE_ORDER as default
|
||||||
|
* gst/audioscale/gstaudioscale.c:
|
||||||
|
we don't handle another endianness as host-endianness
|
||||||
|
|
||||||
2004-05-25 David Schleef <ds@schleef.org>
|
2004-05-25 David Schleef <ds@schleef.org>
|
||||||
|
|
||||||
* gst/ffmpegcolorspace/mem.c: malloc() is in stdlib.h, not malloc.h
|
* gst/ffmpegcolorspace/mem.c: malloc() is in stdlib.h, not malloc.h
|
||||||
|
|
|
@ -149,7 +149,21 @@ GST_STATIC_CAPS ( \
|
||||||
"rate = (int) [ 1, MAX ], " \
|
"rate = (int) [ 1, MAX ], " \
|
||||||
"channels = (int) [ 1, 2 ], " \
|
"channels = (int) [ 1, 2 ], " \
|
||||||
"endianness = (int) { LITTLE_ENDIAN, BIG_ENDIAN }, " \
|
"endianness = (int) { LITTLE_ENDIAN, BIG_ENDIAN }, " \
|
||||||
"width = (int) { 8, 16, 32 }, " \
|
"width = (int) 8, " \
|
||||||
|
"depth = (int) [ 1, 8 ], " \
|
||||||
|
"signed = (boolean) { true, false }; " \
|
||||||
|
"audio/x-raw-int, " \
|
||||||
|
"rate = (int) [ 1, MAX ], " \
|
||||||
|
"channels = (int) [ 1, 2 ], " \
|
||||||
|
"endianness = (int) { LITTLE_ENDIAN, BIG_ENDIAN }, " \
|
||||||
|
"width = (int) 16, " \
|
||||||
|
"depth = (int) [ 1, 16 ], " \
|
||||||
|
"signed = (boolean) { true, false }; " \
|
||||||
|
"audio/x-raw-int, " \
|
||||||
|
"rate = (int) [ 1, MAX ], " \
|
||||||
|
"channels = (int) [ 1, 2 ], " \
|
||||||
|
"endianness = (int) { LITTLE_ENDIAN, BIG_ENDIAN }, " \
|
||||||
|
"width = (int) 32, " \
|
||||||
"depth = (int) [ 1, 32 ], " \
|
"depth = (int) [ 1, 32 ], " \
|
||||||
"signed = (boolean) { true, false }; " \
|
"signed = (boolean) { true, false }; " \
|
||||||
"audio/x-raw-float, " \
|
"audio/x-raw-float, " \
|
||||||
|
@ -346,6 +360,10 @@ gst_audio_convert_parse_caps (const GstCaps * gst_caps,
|
||||||
GST_DEBUG ("could not get some values from structure");
|
GST_DEBUG ("could not get some values from structure");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
if (caps->is_int && caps->depth > caps->width) {
|
||||||
|
GST_DEBUG ("width > depth, not allowed - make us advertise correct caps");
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -489,6 +507,10 @@ gst_audio_convert_fixate (GstPad * pad, const GstCaps * caps)
|
||||||
return copy;
|
return copy;
|
||||||
if (_fixate_caps_to_int (©, "depth", ac_caps.is_int ? ac_caps.depth : 16))
|
if (_fixate_caps_to_int (©, "depth", ac_caps.is_int ? ac_caps.depth : 16))
|
||||||
return copy;
|
return copy;
|
||||||
|
if (_fixate_caps_to_int (©, "endianness",
|
||||||
|
ac_caps.is_int ? ac_caps.endianness : G_BYTE_ORDER))
|
||||||
|
return copy;
|
||||||
|
|
||||||
|
|
||||||
gst_caps_free (copy);
|
gst_caps_free (copy);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
|
@ -56,14 +56,24 @@ static GstStaticPadTemplate gst_audioscale_sink_template =
|
||||||
GST_STATIC_PAD_TEMPLATE ("sink",
|
GST_STATIC_PAD_TEMPLATE ("sink",
|
||||||
GST_PAD_SINK,
|
GST_PAD_SINK,
|
||||||
GST_PAD_ALWAYS,
|
GST_PAD_ALWAYS,
|
||||||
GST_STATIC_CAPS (GST_AUDIO_INT_PAD_TEMPLATE_CAPS)
|
GST_STATIC_CAPS ("audio/x-raw-int, "
|
||||||
|
"rate = (int) [ 1, MAX ], "
|
||||||
|
"channels = (int) [ 1, MAX ], "
|
||||||
|
"endianness = (int) BYTE_ORDER, "
|
||||||
|
"width = (int) { 8, 16, 24, 32 }, "
|
||||||
|
"depth = (int) [ 1, 32 ], " "signed = (boolean) { true, false }")
|
||||||
);
|
);
|
||||||
|
|
||||||
static GstStaticPadTemplate gst_audioscale_src_template =
|
static GstStaticPadTemplate gst_audioscale_src_template =
|
||||||
GST_STATIC_PAD_TEMPLATE ("src",
|
GST_STATIC_PAD_TEMPLATE ("src",
|
||||||
GST_PAD_SRC,
|
GST_PAD_SRC,
|
||||||
GST_PAD_ALWAYS,
|
GST_PAD_ALWAYS,
|
||||||
GST_STATIC_CAPS (GST_AUDIO_INT_PAD_TEMPLATE_CAPS)
|
GST_STATIC_CAPS ("audio/x-raw-int, "
|
||||||
|
"rate = (int) [ 1, MAX ], "
|
||||||
|
"channels = (int) [ 1, MAX ], "
|
||||||
|
"endianness = (int) BYTE_ORDER, "
|
||||||
|
"width = (int) { 8, 16, 24, 32 }, "
|
||||||
|
"depth = (int) [ 1, 32 ], " "signed = (boolean) { true, false }")
|
||||||
);
|
);
|
||||||
|
|
||||||
#define GST_TYPE_AUDIOSCALE_METHOD (gst_audioscale_method_get_type())
|
#define GST_TYPE_AUDIOSCALE_METHOD (gst_audioscale_method_get_type())
|
||||||
|
|
Loading…
Reference in a new issue