summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2014-01-03 16:28:44 +0100
committerSebastian Dröge <sebastian@centricular.com>2014-01-03 16:28:44 +0100
commit1409e1692b8c9b2c2169918204281f526259b35d (patch)
tree53e381a4a0891d0ffc51e8444dd2ecb2e5243e19
parentfc57f7fb1b0ccb009550d9364d37ab73f0e314dc (diff)
av: Update for CodecID -> AVCodecID related changes
-rw-r--r--ext/libav/gstavcodecmap.c91
-rw-r--r--ext/libav/gstavcodecmap.h14
-rw-r--r--ext/libav/gstavmux.c6
-rw-r--r--ext/libav/gstavutils.c2
-rw-r--r--ext/libav/gstavutils.h2
5 files changed, 50 insertions, 65 deletions
diff --git a/ext/libav/gstavcodecmap.c b/ext/libav/gstavcodecmap.c
index 9578194..5fe1b75 100644
--- a/ext/libav/gstavcodecmap.c
+++ b/ext/libav/gstavcodecmap.c
@@ -255,7 +255,7 @@ gst_ffmpeg_video_set_pix_fmts (GstCaps * caps, const enum AVPixelFormat *fmts)
*/
static GstCaps *
gst_ff_vid_caps_new (AVCodecContext * context, AVCodec * codec,
- enum CodecID codec_id, gboolean encode, const char *mimetype,
+ enum AVCodecID codec_id, gboolean encode, const char *mimetype,
const char *fieldname, ...)
{
GstCaps *caps = NULL;
@@ -512,7 +512,7 @@ gst_ffmpeg_audio_set_sample_fmts (GstCaps * caps,
*/
static GstCaps *
gst_ff_aud_caps_new (AVCodecContext * context, AVCodec * codec,
- enum CodecID codec_id, gboolean encode, const char *mimetype,
+ enum AVCodecID codec_id, gboolean encode, const char *mimetype,
const char *fieldname, ...)
{
GstCaps *caps = NULL;
@@ -726,7 +726,7 @@ gst_ff_aud_caps_new (AVCodecContext * context, AVCodec * codec,
*/
GstCaps *
-gst_ffmpeg_codecid_to_caps (enum CodecID codec_id,
+gst_ffmpeg_codecid_to_caps (enum AVCodecID codec_id,
AVCodecContext * context, gboolean encode)
{
GstCaps *caps = NULL;
@@ -828,12 +828,10 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id,
break;
}
- /* FIXME: context->sub_id must be filled in during decoding */
caps =
gst_ff_vid_caps_new (context, NULL, codec_id, encode,
"video/x-pn-realvideo", "rmversion", G_TYPE_INT, version, NULL);
if (context) {
- gst_caps_set_simple (caps, "format", G_TYPE_INT, context->sub_id, NULL);
if (context->extradata_size >= 8) {
gst_caps_set_simple (caps,
"subformat", G_TYPE_INT, GST_READ_UINT32_BE (context->extradata),
@@ -1667,7 +1665,6 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id,
case AV_CODEC_ID_FLIC:
case AV_CODEC_ID_VMDVIDEO:
case AV_CODEC_ID_VMDAUDIO:
- case AV_CODEC_ID_SNOW:
case AV_CODEC_ID_VIXL:
case AV_CODEC_ID_QPEG:
case AV_CODEC_ID_PGMYUV:
@@ -2118,7 +2115,7 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id,
static GstCaps *
gst_ffmpeg_pixfmt_to_caps (enum PixelFormat pix_fmt, AVCodecContext * context,
- enum CodecID codec_id)
+ enum AVCodecID codec_id)
{
GstCaps *caps = NULL;
GstVideoFormat format;
@@ -2179,7 +2176,7 @@ gst_ffmpeg_smpfmt_to_audioformat (enum AVSampleFormat sample_fmt)
static GstCaps *
gst_ffmpeg_smpfmt_to_caps (enum AVSampleFormat sample_fmt,
- AVCodecContext * context, AVCodec * codec, enum CodecID codec_id)
+ AVCodecContext * context, AVCodec * codec, enum AVCodecID codec_id)
{
GstCaps *caps = NULL;
GstAudioFormat format;
@@ -2216,7 +2213,7 @@ caps_has_field (GstCaps * caps, const gchar * field)
GstCaps *
gst_ffmpeg_codectype_to_audio_caps (AVCodecContext * context,
- enum CodecID codec_id, gboolean encode, AVCodec * codec)
+ enum AVCodecID codec_id, gboolean encode, AVCodec * codec)
{
GstCaps *caps = NULL;
@@ -2244,7 +2241,7 @@ gst_ffmpeg_codectype_to_audio_caps (AVCodecContext * context,
GstCaps *
gst_ffmpeg_codectype_to_video_caps (AVCodecContext * context,
- enum CodecID codec_id, gboolean encode, AVCodec * codec)
+ enum AVCodecID codec_id, gboolean encode, AVCodec * codec)
{
GstCaps *caps;
@@ -2799,7 +2796,7 @@ full_copy:
*/
void
-gst_ffmpeg_caps_with_codecid (enum CodecID codec_id,
+gst_ffmpeg_caps_with_codecid (enum AVCodecID codec_id,
enum AVMediaType codec_type, const GstCaps * caps, AVCodecContext * context)
{
GstStructure *str;
@@ -2939,18 +2936,6 @@ gst_ffmpeg_caps_with_codecid (enum CodecID codec_id,
}
break;
- case AV_CODEC_ID_RV10:
- case AV_CODEC_ID_RV20:
- case AV_CODEC_ID_RV30:
- case AV_CODEC_ID_RV40:
- {
- gint format;
-
- if (gst_structure_get_int (str, "format", &format))
- context->sub_id = format;
-
- break;
- }
case AV_CODEC_ID_COOK:
case AV_CODEC_ID_RA_288:
case AV_CODEC_ID_RA_144:
@@ -3174,14 +3159,14 @@ gst_ffmpeg_formatid_to_caps (const gchar * format_name)
gboolean
gst_ffmpeg_formatid_get_codecids (const gchar * format_name,
- enum CodecID ** video_codec_list, enum CodecID ** audio_codec_list,
+ enum AVCodecID ** video_codec_list, enum AVCodecID ** audio_codec_list,
AVOutputFormat * plugin)
{
- static enum CodecID tmp_vlist[] = {
+ static enum AVCodecID tmp_vlist[] = {
AV_CODEC_ID_NONE,
AV_CODEC_ID_NONE
};
- static enum CodecID tmp_alist[] = {
+ static enum AVCodecID tmp_alist[] = {
AV_CODEC_ID_NONE,
AV_CODEC_ID_NONE
};
@@ -3189,12 +3174,12 @@ gst_ffmpeg_formatid_get_codecids (const gchar * format_name,
GST_LOG ("format_name : %s", format_name);
if (!strcmp (format_name, "mp4")) {
- static enum CodecID mp4_video_list[] = {
+ static enum AVCodecID mp4_video_list[] = {
AV_CODEC_ID_MPEG4, AV_CODEC_ID_H264,
AV_CODEC_ID_MJPEG,
AV_CODEC_ID_NONE
};
- static enum CodecID mp4_audio_list[] = {
+ static enum AVCodecID mp4_audio_list[] = {
AV_CODEC_ID_AAC, AV_CODEC_ID_MP3,
AV_CODEC_ID_NONE
};
@@ -3202,12 +3187,12 @@ gst_ffmpeg_formatid_get_codecids (const gchar * format_name,
*video_codec_list = mp4_video_list;
*audio_codec_list = mp4_audio_list;
} else if (!strcmp (format_name, "mpeg")) {
- static enum CodecID mpeg_video_list[] = { AV_CODEC_ID_MPEG1VIDEO,
+ static enum AVCodecID mpeg_video_list[] = { AV_CODEC_ID_MPEG1VIDEO,
AV_CODEC_ID_MPEG2VIDEO,
AV_CODEC_ID_H264,
AV_CODEC_ID_NONE
};
- static enum CodecID mpeg_audio_list[] = { AV_CODEC_ID_MP1,
+ static enum AVCodecID mpeg_audio_list[] = { AV_CODEC_ID_MP1,
AV_CODEC_ID_MP2,
AV_CODEC_ID_MP3,
AV_CODEC_ID_NONE
@@ -3216,10 +3201,10 @@ gst_ffmpeg_formatid_get_codecids (const gchar * format_name,
*video_codec_list = mpeg_video_list;
*audio_codec_list = mpeg_audio_list;
} else if (!strcmp (format_name, "dvd")) {
- static enum CodecID mpeg_video_list[] = { AV_CODEC_ID_MPEG2VIDEO,
+ static enum AVCodecID mpeg_video_list[] = { AV_CODEC_ID_MPEG2VIDEO,
AV_CODEC_ID_NONE
};
- static enum CodecID mpeg_audio_list[] = { AV_CODEC_ID_MP2,
+ static enum AVCodecID mpeg_audio_list[] = { AV_CODEC_ID_MP2,
AV_CODEC_ID_AC3,
AV_CODEC_ID_DTS,
AV_CODEC_ID_PCM_S16BE,
@@ -3229,12 +3214,12 @@ gst_ffmpeg_formatid_get_codecids (const gchar * format_name,
*video_codec_list = mpeg_video_list;
*audio_codec_list = mpeg_audio_list;
} else if (!strcmp (format_name, "mpegts")) {
- static enum CodecID mpegts_video_list[] = { AV_CODEC_ID_MPEG1VIDEO,
+ static enum AVCodecID mpegts_video_list[] = { AV_CODEC_ID_MPEG1VIDEO,
AV_CODEC_ID_MPEG2VIDEO,
AV_CODEC_ID_H264,
AV_CODEC_ID_NONE
};
- static enum CodecID mpegts_audio_list[] = { AV_CODEC_ID_MP2,
+ static enum AVCodecID mpegts_audio_list[] = { AV_CODEC_ID_MP2,
AV_CODEC_ID_MP3,
AV_CODEC_ID_AC3,
AV_CODEC_ID_DTS,
@@ -3245,28 +3230,28 @@ gst_ffmpeg_formatid_get_codecids (const gchar * format_name,
*video_codec_list = mpegts_video_list;
*audio_codec_list = mpegts_audio_list;
} else if (!strcmp (format_name, "vob")) {
- static enum CodecID vob_video_list[] =
+ static enum AVCodecID vob_video_list[] =
{ AV_CODEC_ID_MPEG2VIDEO, AV_CODEC_ID_NONE };
- static enum CodecID vob_audio_list[] = { AV_CODEC_ID_MP2, AV_CODEC_ID_AC3,
+ static enum AVCodecID vob_audio_list[] = { AV_CODEC_ID_MP2, AV_CODEC_ID_AC3,
AV_CODEC_ID_DTS, AV_CODEC_ID_NONE
};
*video_codec_list = vob_video_list;
*audio_codec_list = vob_audio_list;
} else if (!strcmp (format_name, "flv")) {
- static enum CodecID flv_video_list[] =
+ static enum AVCodecID flv_video_list[] =
{ AV_CODEC_ID_FLV1, AV_CODEC_ID_NONE };
- static enum CodecID flv_audio_list[] =
+ static enum AVCodecID flv_audio_list[] =
{ AV_CODEC_ID_MP3, AV_CODEC_ID_NONE };
*video_codec_list = flv_video_list;
*audio_codec_list = flv_audio_list;
} else if (!strcmp (format_name, "asf")) {
- static enum CodecID asf_video_list[] =
+ static enum AVCodecID asf_video_list[] =
{ AV_CODEC_ID_WMV1, AV_CODEC_ID_WMV2, AV_CODEC_ID_MSMPEG4V3,
AV_CODEC_ID_NONE
};
- static enum CodecID asf_audio_list[] =
+ static enum AVCodecID asf_audio_list[] =
{ AV_CODEC_ID_WMAV1, AV_CODEC_ID_WMAV2, AV_CODEC_ID_MP3,
AV_CODEC_ID_NONE
};
@@ -3274,22 +3259,22 @@ gst_ffmpeg_formatid_get_codecids (const gchar * format_name,
*video_codec_list = asf_video_list;
*audio_codec_list = asf_audio_list;
} else if (!strcmp (format_name, "dv")) {
- static enum CodecID dv_video_list[] =
+ static enum AVCodecID dv_video_list[] =
{ AV_CODEC_ID_DVVIDEO, AV_CODEC_ID_NONE };
- static enum CodecID dv_audio_list[] =
+ static enum AVCodecID dv_audio_list[] =
{ AV_CODEC_ID_PCM_S16LE, AV_CODEC_ID_NONE };
*video_codec_list = dv_video_list;
*audio_codec_list = dv_audio_list;
} else if (!strcmp (format_name, "mov")) {
- static enum CodecID mov_video_list[] = {
+ static enum AVCodecID mov_video_list[] = {
AV_CODEC_ID_SVQ1, AV_CODEC_ID_SVQ3, AV_CODEC_ID_MPEG4,
AV_CODEC_ID_H263, AV_CODEC_ID_H263P,
AV_CODEC_ID_H264, AV_CODEC_ID_DVVIDEO,
AV_CODEC_ID_MJPEG,
AV_CODEC_ID_NONE
};
- static enum CodecID mov_audio_list[] = {
+ static enum AVCodecID mov_audio_list[] = {
AV_CODEC_ID_PCM_MULAW, AV_CODEC_ID_PCM_ALAW, AV_CODEC_ID_ADPCM_IMA_QT,
AV_CODEC_ID_MACE3, AV_CODEC_ID_MACE6, AV_CODEC_ID_AAC,
AV_CODEC_ID_AMR_NB, AV_CODEC_ID_AMR_WB,
@@ -3300,11 +3285,11 @@ gst_ffmpeg_formatid_get_codecids (const gchar * format_name,
*video_codec_list = mov_video_list;
*audio_codec_list = mov_audio_list;
} else if ((!strcmp (format_name, "3gp") || !strcmp (format_name, "3g2"))) {
- static enum CodecID tgp_video_list[] = {
+ static enum AVCodecID tgp_video_list[] = {
AV_CODEC_ID_MPEG4, AV_CODEC_ID_H263, AV_CODEC_ID_H263P, AV_CODEC_ID_H264,
AV_CODEC_ID_NONE
};
- static enum CodecID tgp_audio_list[] = {
+ static enum AVCodecID tgp_audio_list[] = {
AV_CODEC_ID_AMR_NB, AV_CODEC_ID_AMR_WB,
AV_CODEC_ID_AAC,
AV_CODEC_ID_NONE
@@ -3313,20 +3298,20 @@ gst_ffmpeg_formatid_get_codecids (const gchar * format_name,
*video_codec_list = tgp_video_list;
*audio_codec_list = tgp_audio_list;
} else if (!strcmp (format_name, "mmf")) {
- static enum CodecID mmf_audio_list[] = {
+ static enum AVCodecID mmf_audio_list[] = {
AV_CODEC_ID_ADPCM_YAMAHA, AV_CODEC_ID_NONE
};
*video_codec_list = NULL;
*audio_codec_list = mmf_audio_list;
} else if (!strcmp (format_name, "amr")) {
- static enum CodecID amr_audio_list[] = {
+ static enum AVCodecID amr_audio_list[] = {
AV_CODEC_ID_AMR_NB, AV_CODEC_ID_AMR_WB,
AV_CODEC_ID_NONE
};
*video_codec_list = NULL;
*audio_codec_list = amr_audio_list;
} else if (!strcmp (format_name, "gif")) {
- static enum CodecID gif_image_list[] = {
+ static enum AVCodecID gif_image_list[] = {
AV_CODEC_ID_RAWVIDEO, AV_CODEC_ID_NONE
};
*video_codec_list = gif_image_list;
@@ -3339,11 +3324,11 @@ gst_ffmpeg_formatid_get_codecids (const gchar * format_name,
*video_codec_list = tmp_vlist;
*audio_codec_list = tmp_alist;
} else if ((!strcmp (format_name, "pva"))) {
- static enum CodecID tgp_video_list[] = {
+ static enum AVCodecID tgp_video_list[] = {
AV_CODEC_ID_MPEG2VIDEO,
AV_CODEC_ID_NONE
};
- static enum CodecID tgp_audio_list[] = {
+ static enum AVCodecID tgp_audio_list[] = {
AV_CODEC_ID_MP2,
AV_CODEC_ID_NONE
};
@@ -3365,10 +3350,10 @@ gst_ffmpeg_formatid_get_codecids (const gchar * format_name,
* optional extra info
*/
-enum CodecID
+enum AVCodecID
gst_ffmpeg_caps_to_codecid (const GstCaps * caps, AVCodecContext * context)
{
- enum CodecID id = AV_CODEC_ID_NONE;
+ enum AVCodecID id = AV_CODEC_ID_NONE;
const gchar *mimetype;
const GstStructure *structure;
gboolean video = FALSE, audio = FALSE; /* we want to be sure! */
diff --git a/ext/libav/gstavcodecmap.h b/ext/libav/gstavcodecmap.h
index f392f96..40f46c3 100644
--- a/ext/libav/gstavcodecmap.h
+++ b/ext/libav/gstavcodecmap.h
@@ -73,7 +73,7 @@ gst_ffmpeg_compliance_get_type (void);
*/
GstCaps *
-gst_ffmpeg_codecid_to_caps (enum CodecID codec_id,
+gst_ffmpeg_codecid_to_caps (enum AVCodecID codec_id,
AVCodecContext *context,
gboolean encode);
@@ -84,12 +84,12 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id,
GstCaps *
gst_ffmpeg_codectype_to_audio_caps (AVCodecContext *context,
- enum CodecID codec_id,
+ enum AVCodecID codec_id,
gboolean encode,
AVCodec *codec);
GstCaps *
gst_ffmpeg_codectype_to_video_caps (AVCodecContext *context,
- enum CodecID codec_id,
+ enum AVCodecID codec_id,
gboolean encode,
AVCodec *codec);
@@ -99,7 +99,7 @@ gst_ffmpeg_codectype_to_video_caps (AVCodecContext *context,
* context and a codecID.
*/
-enum CodecID
+enum AVCodecID
gst_ffmpeg_caps_to_codecid (const GstCaps *caps,
AVCodecContext *context);
@@ -109,7 +109,7 @@ gst_ffmpeg_caps_to_codecid (const GstCaps *caps,
*/
void
-gst_ffmpeg_caps_with_codecid (enum CodecID codec_id,
+gst_ffmpeg_caps_with_codecid (enum AVCodecID codec_id,
enum AVMediaType codec_type,
const GstCaps *caps,
AVCodecContext *context);
@@ -155,8 +155,8 @@ gst_ffmpeg_formatid_to_caps (const gchar *format_name);
gboolean
gst_ffmpeg_formatid_get_codecids (const gchar *format_name,
- enum CodecID ** video_codec_list,
- enum CodecID ** audio_codec_list,
+ enum AVCodecID ** video_codec_list,
+ enum AVCodecID ** audio_codec_list,
AVOutputFormat * plugin);
diff --git a/ext/libav/gstavmux.c b/ext/libav/gstavmux.c
index e15931c..6538e84 100644
--- a/ext/libav/gstavmux.c
+++ b/ext/libav/gstavmux.c
@@ -120,7 +120,7 @@ static void gst_ffmpegmux_set_property (GObject * object, guint prop_id,
static void gst_ffmpegmux_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec);
-static GstCaps *gst_ffmpegmux_get_id_caps (enum CodecID *id_list);
+static GstCaps *gst_ffmpegmux_get_id_caps (enum AVCodecID *id_list);
static void gst_ffmpeg_mux_simple_caps_set_int_list (GstCaps * caps,
const gchar * field, guint num, const gint * values);
@@ -193,7 +193,7 @@ gst_ffmpegmux_base_init (gpointer g_class)
GstPadTemplate *videosinktempl, *audiosinktempl, *srctempl;
AVOutputFormat *in_plugin;
GstCaps *srccaps, *audiosinkcaps, *videosinkcaps;
- enum CodecID *video_ids = NULL, *audio_ids = NULL;
+ enum AVCodecID *video_ids = NULL, *audio_ids = NULL;
gchar *longname, *description;
const char *replacement;
gboolean is_formatter;
@@ -819,7 +819,7 @@ gst_ffmpegmux_change_state (GstElement * element, GstStateChange transition)
}
static GstCaps *
-gst_ffmpegmux_get_id_caps (enum CodecID *id_list)
+gst_ffmpegmux_get_id_caps (enum AVCodecID *id_list)
{
GstCaps *caps, *t;
gint i;
diff --git a/ext/libav/gstavutils.c b/ext/libav/gstavutils.c
index 403a6b6..ad4ac3c 100644
--- a/ext/libav/gstavutils.c
+++ b/ext/libav/gstavutils.c
@@ -32,7 +32,7 @@
#include <libavutil/mem.h>
G_CONST_RETURN gchar *
-gst_ffmpeg_get_codecid_longname (enum CodecID codec_id)
+gst_ffmpeg_get_codecid_longname (enum AVCodecID codec_id)
{
AVCodec *codec;
/* Let's use what ffmpeg can provide us */
diff --git a/ext/libav/gstavutils.h b/ext/libav/gstavutils.h
index 97415eb..886d902 100644
--- a/ext/libav/gstavutils.h
+++ b/ext/libav/gstavutils.h
@@ -86,7 +86,7 @@ int
gst_ffmpeg_auto_max_threads(void);
G_CONST_RETURN gchar *
-gst_ffmpeg_get_codecid_longname (enum CodecID codec_id);
+gst_ffmpeg_get_codecid_longname (enum AVCodecID codec_id);
gint
av_smp_format_depth(enum AVSampleFormat smp_fmt);