gst/ffmpegcolorspace/: Only set/get on the PAL8 format, ffmpegcolorspace doesn't support it on other formats. Also ad...

Original commit message from CVS:
* gst/ffmpegcolorspace/gstffmpegcodecmap.c:
(gst_ffmpeg_pixfmt_to_caps):
* gst/ffmpegcolorspace/gstffmpegcolorspace.c:
(gst_ffmpegcsp_get_unit_size):
Only set/get on the PAL8 format, ffmpegcolorspace doesn't support
it on other formats. Also adjust the unit size only for that format
to not include the palette. Fixes bug #540497.
This commit is contained in:
Sebastian Dröge 2008-06-30 08:29:09 +00:00
parent e0d27d23cc
commit a97dc76ad7
3 changed files with 13 additions and 2 deletions

View file

@ -1,3 +1,13 @@
2008-06-30 Sebastian Dröge <sebastian.droege@collabora.co.uk>
* gst/ffmpegcolorspace/gstffmpegcodecmap.c:
(gst_ffmpeg_pixfmt_to_caps):
* gst/ffmpegcolorspace/gstffmpegcolorspace.c:
(gst_ffmpegcsp_get_unit_size):
Only set/get on the PAL8 format, ffmpegcolorspace doesn't support
it on other formats. Also adjust the unit size only for that format
to not include the palette. Fixes bug #540497.
2008-06-29 Stefan Kost <ensonic@users.sf.net>
* gst/adder/gstadder.c:

View file

@ -390,7 +390,7 @@ gst_ffmpeg_pixfmt_to_caps (enum PixelFormat pix_fmt, AVCodecContext * context)
"bpp", G_TYPE_INT, bpp,
"depth", G_TYPE_INT, depth,
"endianness", G_TYPE_INT, endianness, NULL);
if (context) {
if (context && context->pix_fmt == PIX_FMT_PAL8) {
gst_ffmpeg_set_palette (caps, context);
}
}

View file

@ -412,7 +412,8 @@ gst_ffmpegcsp_get_unit_size (GstBaseTransform * btrans, GstCaps * caps,
* GStreamer currently puts it into the caps as 'palette_data' field,
* so for paletted data the frame size avpicture_get_size() returns is
* 1024 bytes larger than what GStreamer expects. */
if (gst_structure_has_field (structure, "palette_data")) {
if (gst_structure_has_field (structure, "palette_data") &&
ctx->pix_fmt == PIX_FMT_PAL8) {
*size -= 4 * 256; /* = AVPALETTE_SIZE */
}