From: Sebastian Dröge Date: Tue, 4 Dec 2012 17:02:56 +0000 (+0100) Subject: av: Remove palette support for now X-Git-Tag: 1.1.1~79 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0f206124b682790a3f96a3bee110f9c2350f3348;p=platform%2Fupstream%2Fgst-libav.git av: Remove palette support for now It was never ported to the way how paletted color formats work in 1.0 anyway and the API changed in libav upstream. --- diff --git a/ext/libav/gstavauddec.c b/ext/libav/gstavauddec.c index 3b60701..1c084d6 100644 --- a/ext/libav/gstavauddec.c +++ b/ext/libav/gstavauddec.c @@ -166,11 +166,6 @@ gst_ffmpegauddec_close (GstFFMpegAudDec * ffmpegdec) gst_ffmpeg_avcodec_close (ffmpegdec->context); ffmpegdec->opened = FALSE; - if (ffmpegdec->context->palctrl) { - av_free (ffmpegdec->context->palctrl); - ffmpegdec->context->palctrl = NULL; - } - if (ffmpegdec->context->extradata) { av_free (ffmpegdec->context->extradata); ffmpegdec->context->extradata = NULL; diff --git a/ext/libav/gstavcodecmap.c b/ext/libav/gstavcodecmap.c index 3850241..2211c11 100644 --- a/ext/libav/gstavcodecmap.c +++ b/ext/libav/gstavcodecmap.c @@ -36,44 +36,6 @@ #include #include -/* - * Read a palette from a caps. - */ - -static void -gst_ffmpeg_get_palette (const GstCaps * caps, AVCodecContext * context) -{ - GstStructure *str = gst_caps_get_structure (caps, 0); - const GValue *palette_v; - GstBuffer *palette; - - /* do we have a palette? */ - if ((palette_v = gst_structure_get_value (str, "palette_data")) && context) { - palette = gst_value_get_buffer (palette_v); - GST_DEBUG ("got palette data %p", palette); - if (gst_buffer_get_size (palette) >= AVPALETTE_SIZE) { - if (context->palctrl) - av_free (context->palctrl); - context->palctrl = av_malloc (sizeof (AVPaletteControl)); - context->palctrl->palette_changed = 1; - gst_buffer_extract (palette, 0, context->palctrl->palette, - AVPALETTE_SIZE); - GST_DEBUG ("extracted palette data"); - } - } -} - -static void -gst_ffmpeg_set_palette (GstCaps * caps, AVCodecContext * context) -{ - if (context->palctrl) { - GstBuffer *palette = gst_buffer_new_and_alloc (AVPALETTE_SIZE); - - gst_buffer_fill (palette, 0, context->palctrl->palette, AVPALETTE_SIZE); - gst_caps_set_simple (caps, "palette_data", GST_TYPE_BUFFER, palette, NULL); - } -} - /* IMPORTANT: Keep this sorted by the ffmpeg channel masks */ static const struct { @@ -1743,11 +1705,6 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id, gst_buffer_unref (data); } - /* palette */ - if (context) { - gst_ffmpeg_set_palette (caps, context); - } - GST_LOG ("caps for codec_id=%d: %" GST_PTR_FORMAT, codec_id, caps); } else { @@ -2039,8 +1996,6 @@ gst_ffmpeg_caps_to_pixfmt (const GstCaps * caps, context->sample_aspect_ratio.num); } - gst_ffmpeg_get_palette (caps, context); - if (!raw) return; diff --git a/ext/libav/gstavviddec.c b/ext/libav/gstavviddec.c index b7bfaaf..0ddd628 100644 --- a/ext/libav/gstavviddec.c +++ b/ext/libav/gstavviddec.c @@ -284,11 +284,6 @@ gst_ffmpegviddec_close (GstFFMpegVidDec * ffmpegdec) gst_ffmpeg_avcodec_close (ffmpegdec->context); ffmpegdec->opened = FALSE; - if (ffmpegdec->context->palctrl) { - av_free (ffmpegdec->context->palctrl); - ffmpegdec->context->palctrl = NULL; - } - if (ffmpegdec->context->extradata) { av_free (ffmpegdec->context->extradata); ffmpegdec->context->extradata = NULL; @@ -1062,15 +1057,6 @@ gst_ffmpegviddec_video_frame (GstFFMpegVidDec * ffmpegdec, /* now decode the frame */ gst_avpacket_init (&packet, data, size); - if (ffmpegdec->context->palctrl) { - guint8 *pal; - - pal = av_packet_new_side_data (&packet, AV_PKT_DATA_PALETTE, - AVPALETTE_SIZE); - memcpy (pal, ffmpegdec->context->palctrl->palette, AVPALETTE_SIZE); - GST_DEBUG_OBJECT (ffmpegdec, "copy pal %p %p", &packet, pal); - } - len = avcodec_decode_video2 (ffmpegdec->context, ffmpegdec->picture, &have_data, &packet);