summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/libav/gstavauddec.c5
-rw-r--r--ext/libav/gstavcodecmap.c45
-rw-r--r--ext/libav/gstavviddec.c14
3 files changed, 0 insertions, 64 deletions
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 <gst/audio/audio.h>
#include <gst/pbutils/codec-utils.h>
-/*
- * 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);