diff --git a/ext/ffmpeg/gstffmpegcodecmap.c b/ext/ffmpeg/gstffmpegcodecmap.c index 23776e571e..7fb3f41ae7 100644 --- a/ext/ffmpeg/gstffmpegcodecmap.c +++ b/ext/ffmpeg/gstffmpegcodecmap.c @@ -758,7 +758,8 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id, break; case CODEC_ID_RAWVIDEO: - caps = gst_ffmpeg_codectype_to_caps (CODEC_TYPE_VIDEO, context, codec_id, + caps = + gst_ffmpeg_codectype_to_caps (AVMEDIA_TYPE_VIDEO, context, codec_id, encode); break; @@ -1601,12 +1602,12 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id, GST_LOG ("Could not create stream format caps for %s", codec->name); switch (codec->type) { - case CODEC_TYPE_VIDEO: + case AVMEDIA_TYPE_VIDEO: mime = g_strdup_printf ("video/x-gst_ff-%s", codec->name); caps = gst_ff_vid_caps_new (context, codec_id, mime, NULL); g_free (mime); break; - case CODEC_TYPE_AUDIO: + case AVMEDIA_TYPE_AUDIO: mime = g_strdup_printf ("audio/x-gst_ff-%s", codec->name); caps = gst_ff_aud_caps_new (context, codec_id, mime, NULL); if (context) @@ -1933,21 +1934,21 @@ gst_ffmpeg_codectype_to_video_caps (AVCodecContext * context, * to a GstCaps. If the context is ommitted, no fixed values * for video/audio size will be included in the GstCaps * - * CodecType is primarily meant for uncompressed data GstCaps! + * AVMediaType is primarily meant for uncompressed data GstCaps! */ GstCaps * -gst_ffmpeg_codectype_to_caps (enum CodecType codec_type, +gst_ffmpeg_codectype_to_caps (enum AVMediaType codec_type, AVCodecContext * context, enum CodecID codec_id, gboolean encode) { GstCaps *caps; switch (codec_type) { - case CODEC_TYPE_VIDEO: + case AVMEDIA_TYPE_VIDEO: caps = gst_ffmpeg_codectype_to_video_caps (context, codec_id, encode, NULL); break; - case CODEC_TYPE_AUDIO: + case AVMEDIA_TYPE_AUDIO: caps = gst_ffmpeg_codectype_to_audio_caps (context, codec_id, encode, NULL); break; @@ -2156,22 +2157,22 @@ gst_ffmpeg_caps_to_pixfmt (const GstCaps * caps, * AVCodecContext. If the context is ommitted, no fixed values * for video/audio size will be included in the context * - * CodecType is primarily meant for uncompressed data GstCaps! + * AVMediaType is primarily meant for uncompressed data GstCaps! */ void -gst_ffmpeg_caps_with_codectype (enum CodecType type, +gst_ffmpeg_caps_with_codectype (enum AVMediaType type, const GstCaps * caps, AVCodecContext * context) { if (context == NULL) return; switch (type) { - case CODEC_TYPE_VIDEO: + case AVMEDIA_TYPE_VIDEO: gst_ffmpeg_caps_to_pixfmt (caps, context, TRUE); break; - case CODEC_TYPE_AUDIO: + case AVMEDIA_TYPE_AUDIO: gst_ffmpeg_caps_to_smpfmt (caps, context, TRUE); break; @@ -2278,7 +2279,7 @@ full_copy: void gst_ffmpeg_caps_with_codecid (enum CodecID codec_id, - enum CodecType codec_type, const GstCaps * caps, AVCodecContext * context) + enum AVMediaType codec_type, const GstCaps * caps, AVCodecContext * context) { GstStructure *str; const GValue *value; @@ -2517,11 +2518,11 @@ gst_ffmpeg_caps_with_codecid (enum CodecID codec_id, /* common properties (width, height, fps) */ switch (codec_type) { - case CODEC_TYPE_VIDEO: + case AVMEDIA_TYPE_VIDEO: gst_ffmpeg_caps_to_pixfmt (caps, context, codec_id == CODEC_ID_RAWVIDEO); gst_ffmpeg_get_palette (caps, context); break; - case CODEC_TYPE_AUDIO: + case AVMEDIA_TYPE_AUDIO: gst_ffmpeg_caps_to_smpfmt (caps, context, FALSE); break; default: @@ -3370,11 +3371,11 @@ gst_ffmpeg_caps_to_codecid (const GstCaps * caps, AVCodecContext * context) if (context != NULL) { if (video == TRUE) { - context->codec_type = CODEC_TYPE_VIDEO; + context->codec_type = AVMEDIA_TYPE_VIDEO; } else if (audio == TRUE) { - context->codec_type = CODEC_TYPE_AUDIO; + context->codec_type = AVMEDIA_TYPE_AUDIO; } else { - context->codec_type = CODEC_TYPE_UNKNOWN; + context->codec_type = AVMEDIA_TYPE_UNKNOWN; } context->codec_id = id; gst_ffmpeg_caps_with_codecid (id, context->codec_type, caps, context); diff --git a/ext/ffmpeg/gstffmpegcodecmap.h b/ext/ffmpeg/gstffmpegcodecmap.h index 769466d8b5..d3d617016a 100644 --- a/ext/ffmpeg/gstffmpegcodecmap.h +++ b/ext/ffmpeg/gstffmpegcodecmap.h @@ -41,11 +41,11 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id, /* * _codectype_to_caps () gets the GstCaps that belongs to - * a certain CodecType for a pad with uncompressed data. + * a certain AVMediaType for a pad with uncompressed data. */ GstCaps * -gst_ffmpeg_codectype_to_caps (enum CodecType codec_type, +gst_ffmpeg_codectype_to_caps (enum AVMediaType codec_type, AVCodecContext *context, enum CodecID codec_id, gboolean encode); @@ -77,7 +77,7 @@ gst_ffmpeg_caps_to_codecid (const GstCaps *caps, void gst_ffmpeg_caps_with_codecid (enum CodecID codec_id, - enum CodecType codec_type, + enum AVMediaType codec_type, const GstCaps *caps, AVCodecContext *context); @@ -87,7 +87,7 @@ gst_ffmpeg_caps_with_codecid (enum CodecID codec_id, */ void -gst_ffmpeg_caps_with_codectype (enum CodecType type, +gst_ffmpeg_caps_with_codectype (enum AVMediaType type, const GstCaps *caps, AVCodecContext *context); diff --git a/ext/ffmpeg/gstffmpegdec.c b/ext/ffmpeg/gstffmpegdec.c index 32ed3568f7..49f6f5b937 100644 --- a/ext/ffmpeg/gstffmpegdec.c +++ b/ext/ffmpeg/gstffmpegdec.c @@ -303,7 +303,7 @@ gst_ffmpegdec_base_init (GstFFMpegDecClass * klass) /* construct the element details struct */ longname = g_strdup_printf ("FFmpeg %s decoder", in_plugin->long_name); classification = g_strdup_printf ("Codec/Decoder/%s", - (in_plugin->type == CODEC_TYPE_VIDEO) ? "Video" : "Audio"); + (in_plugin->type == AVMEDIA_TYPE_VIDEO) ? "Video" : "Audio"); description = g_strdup_printf ("FFmpeg %s decoder", in_plugin->name); gst_element_class_set_details_simple (element_class, longname, classification, description, @@ -320,7 +320,7 @@ gst_ffmpegdec_base_init (GstFFMpegDecClass * klass) GST_DEBUG ("Couldn't get sink caps for decoder '%s'", in_plugin->name); sinkcaps = gst_caps_from_string ("unknown/unknown"); } - if (in_plugin->type == CODEC_TYPE_VIDEO) { + if (in_plugin->type == AVMEDIA_TYPE_VIDEO) { srccaps = gst_caps_from_string ("video/x-raw-rgb; video/x-raw-yuv"); } else { srccaps = gst_ffmpeg_codectype_to_audio_caps (NULL, @@ -357,7 +357,7 @@ gst_ffmpegdec_class_init (GstFFMpegDecClass * klass) gobject_class->set_property = gst_ffmpegdec_set_property; gobject_class->get_property = gst_ffmpegdec_get_property; - if (klass->in_plugin->type == CODEC_TYPE_VIDEO) { + if (klass->in_plugin->type == AVMEDIA_TYPE_VIDEO) { g_object_class_install_property (gobject_class, PROP_SKIPFRAME, g_param_spec_enum ("skip-frame", "Skip frames", "Which types of frames to skip during decoding", @@ -671,7 +671,7 @@ gst_ffmpegdec_open (GstFFMpegDec * ffmpegdec) } switch (oclass->in_plugin->type) { - case CODEC_TYPE_VIDEO: + case AVMEDIA_TYPE_VIDEO: ffmpegdec->format.video.width = 0; ffmpegdec->format.video.height = 0; ffmpegdec->format.video.clip_width = -1; @@ -679,7 +679,7 @@ gst_ffmpegdec_open (GstFFMpegDec * ffmpegdec) ffmpegdec->format.video.pix_fmt = PIX_FMT_NB; ffmpegdec->format.video.interlaced = FALSE; break; - case CODEC_TYPE_AUDIO: + case AVMEDIA_TYPE_AUDIO: ffmpegdec->format.audio.samplerate = 0; ffmpegdec->format.audio.channels = 0; ffmpegdec->format.audio.depth = 0; @@ -1001,9 +1001,9 @@ gst_ffmpegdec_get_buffer (AVCodecContext * context, AVFrame * picture) } switch (context->codec_type) { - case CODEC_TYPE_VIDEO: + case AVMEDIA_TYPE_VIDEO: /* some ffmpeg video plugins don't see the point in setting codec_type ... */ - case CODEC_TYPE_UNKNOWN: + case AVMEDIA_TYPE_UNKNOWN: { GstFlowReturn ret; gint clip_width, clip_height; @@ -1041,7 +1041,7 @@ gst_ffmpegdec_get_buffer (AVCodecContext * context, AVFrame * picture) GST_BUFFER_DATA (buf), context->pix_fmt, width, height); break; } - case CODEC_TYPE_AUDIO: + case AVMEDIA_TYPE_AUDIO: default: GST_ERROR_OBJECT (ffmpegdec, "_get_buffer() should never get called for non-video buffers !"); @@ -1191,7 +1191,7 @@ gst_ffmpegdec_negotiate (GstFFMpegDec * ffmpegdec, gboolean force) oclass = (GstFFMpegDecClass *) (G_OBJECT_GET_CLASS (ffmpegdec)); switch (oclass->in_plugin->type) { - case CODEC_TYPE_VIDEO: + case AVMEDIA_TYPE_VIDEO: if (!force && ffmpegdec->format.video.width == ffmpegdec->context->width && ffmpegdec->format.video.height == ffmpegdec->context->height && ffmpegdec->format.video.fps_n == ffmpegdec->format.video.old_fps_n @@ -1221,7 +1221,7 @@ gst_ffmpegdec_negotiate (GstFFMpegDec * ffmpegdec, gboolean force) ffmpegdec->format.video.par_d = ffmpegdec->context->sample_aspect_ratio.den; break; - case CODEC_TYPE_AUDIO: + case AVMEDIA_TYPE_AUDIO: { gint depth = av_smp_format_depth (ffmpegdec->context->sample_fmt); if (!force && ffmpegdec->format.audio.samplerate == @@ -1250,7 +1250,7 @@ gst_ffmpegdec_negotiate (GstFFMpegDec * ffmpegdec, gboolean force) goto no_caps; switch (oclass->in_plugin->type) { - case CODEC_TYPE_VIDEO: + case AVMEDIA_TYPE_VIDEO: { gint width, height; gboolean interlaced; @@ -1280,7 +1280,7 @@ gst_ffmpegdec_negotiate (GstFFMpegDec * ffmpegdec, gboolean force) gst_caps_get_structure (caps, 0)); break; } - case CODEC_TYPE_AUDIO: + case AVMEDIA_TYPE_AUDIO: { break; } @@ -2189,12 +2189,12 @@ gst_ffmpegdec_frame (GstFFMpegDec * ffmpegdec, oclass = (GstFFMpegDecClass *) (G_OBJECT_GET_CLASS (ffmpegdec)); switch (oclass->in_plugin->type) { - case CODEC_TYPE_VIDEO: + case AVMEDIA_TYPE_VIDEO: len = gst_ffmpegdec_video_frame (ffmpegdec, data, size, dec_info, &outbuf, ret); break; - case CODEC_TYPE_AUDIO: + case AVMEDIA_TYPE_AUDIO: len = gst_ffmpegdec_audio_frame (ffmpegdec, oclass->in_plugin, data, size, dec_info, &outbuf, ret); @@ -2490,7 +2490,7 @@ gst_ffmpegdec_chain (GstPad * pad, GstBuffer * inbuf) if (G_UNLIKELY (ffmpegdec->waiting_for_key)) { GST_DEBUG_OBJECT (ffmpegdec, "waiting for keyframe"); if (GST_BUFFER_FLAG_IS_SET (inbuf, GST_BUFFER_FLAG_DELTA_UNIT) && - oclass->in_plugin->type != CODEC_TYPE_AUDIO) + oclass->in_plugin->type != AVMEDIA_TYPE_AUDIO) goto skip_keyframe; GST_DEBUG_OBJECT (ffmpegdec, "got keyframe"); diff --git a/ext/ffmpeg/gstffmpegdeinterlace.c b/ext/ffmpeg/gstffmpegdeinterlace.c index bf87d4539f..cd049284d9 100644 --- a/ext/ffmpeg/gstffmpegdeinterlace.c +++ b/ext/ffmpeg/gstffmpegdeinterlace.c @@ -124,7 +124,7 @@ gst_ffmpegdeinterlace_sink_setcaps (GstPad * pad, GstCaps * caps) ctx->width = deinterlace->width; ctx->height = deinterlace->height; ctx->pix_fmt = PIX_FMT_NB; - gst_ffmpeg_caps_with_codectype (CODEC_TYPE_VIDEO, caps, ctx); + gst_ffmpeg_caps_with_codectype (AVMEDIA_TYPE_VIDEO, caps, ctx); if (ctx->pix_fmt == PIX_FMT_NB) { av_free (ctx); return FALSE; diff --git a/ext/ffmpeg/gstffmpegdemux.c b/ext/ffmpeg/gstffmpegdemux.c index 353c2985be..2a9833b35e 100644 --- a/ext/ffmpeg/gstffmpegdemux.c +++ b/ext/ffmpeg/gstffmpegdemux.c @@ -867,7 +867,7 @@ gst_ffmpegdemux_src_convert (GstPad * pad, return FALSE; avstream = stream->avstream; - if (avstream->codec->codec_type != CODEC_TYPE_VIDEO) + if (avstream->codec->codec_type != AVMEDIA_TYPE_VIDEO) return FALSE; switch (src_fmt) { @@ -977,11 +977,11 @@ gst_ffmpegdemux_get_stream (GstFFMpegDemux * demux, AVStream * avstream) stream->tags = NULL; switch (ctx->codec_type) { - case CODEC_TYPE_VIDEO: + case AVMEDIA_TYPE_VIDEO: templ = oclass->videosrctempl; num = demux->videopads++; break; - case CODEC_TYPE_AUDIO: + case AVMEDIA_TYPE_AUDIO: templ = oclass->audiosrctempl; num = demux->audiopads++; break; @@ -1041,7 +1041,7 @@ gst_ffmpegdemux_get_stream (GstFFMpegDemux * demux, AVStream * avstream) stream->tags = gst_tag_list_new (); gst_tag_list_add (stream->tags, GST_TAG_MERGE_REPLACE, - (ctx->codec_type == CODEC_TYPE_VIDEO) ? + (ctx->codec_type == AVMEDIA_TYPE_VIDEO) ? GST_TAG_VIDEO_CODEC : GST_TAG_AUDIO_CODEC, codec, NULL); } @@ -1389,7 +1389,7 @@ gst_ffmpegdemux_loop (GstFFMpegDemux * demux) /* prepare to push packet to peer */ srcpad = stream->pad; - rawvideo = (avstream->codec->codec_type == CODEC_TYPE_VIDEO && + rawvideo = (avstream->codec->codec_type == AVMEDIA_TYPE_VIDEO && avstream->codec->codec_id == CODEC_ID_RAWVIDEO); if (rawvideo) diff --git a/ext/ffmpeg/gstffmpegenc.c b/ext/ffmpeg/gstffmpegenc.c index f2afb2e0b6..2e49b5a426 100644 --- a/ext/ffmpeg/gstffmpegenc.c +++ b/ext/ffmpeg/gstffmpegenc.c @@ -136,7 +136,7 @@ gst_ffmpegenc_base_init (GstFFMpegEncClass * klass) /* construct the element details struct */ longname = g_strdup_printf ("FFmpeg %s encoder", in_plugin->long_name); classification = g_strdup_printf ("Codec/Encoder/%s", - (in_plugin->type == CODEC_TYPE_VIDEO) ? "Video" : "Audio"); + (in_plugin->type == AVMEDIA_TYPE_VIDEO) ? "Video" : "Audio"); description = g_strdup_printf ("FFmpeg %s encoder", in_plugin->name); gst_element_class_set_details_simple (element_class, longname, classification, description, @@ -151,7 +151,7 @@ gst_ffmpegenc_base_init (GstFFMpegEncClass * klass) srccaps = gst_caps_new_simple ("unknown/unknown", NULL); } - if (in_plugin->type == CODEC_TYPE_VIDEO) { + if (in_plugin->type == AVMEDIA_TYPE_VIDEO) { sinkcaps = gst_caps_from_string ("video/x-raw-rgb; video/x-raw-yuv; video/x-raw-gray"); } else { @@ -193,7 +193,7 @@ gst_ffmpegenc_class_init (GstFFMpegEncClass * klass) gobject_class->set_property = gst_ffmpegenc_set_property; gobject_class->get_property = gst_ffmpegenc_get_property; - if (klass->in_plugin->type == CODEC_TYPE_VIDEO) { + if (klass->in_plugin->type == AVMEDIA_TYPE_VIDEO) { g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_BIT_RATE, g_param_spec_ulong ("bitrate", "Bit Rate", "Target Video Bitrate", 0, G_MAXULONG, DEFAULT_VIDEO_BITRATE, @@ -222,7 +222,7 @@ gst_ffmpegenc_class_init (GstFFMpegEncClass * klass) /* register additional properties, possibly dependent on the exact CODEC */ gst_ffmpeg_cfg_install_property (klass, ARG_CFG_BASE); - } else if (klass->in_plugin->type == CODEC_TYPE_AUDIO) { + } else if (klass->in_plugin->type == AVMEDIA_TYPE_AUDIO) { g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_BIT_RATE, g_param_spec_ulong ("bitrate", "Bit Rate", "Target Audio Bitrate", 0, G_MAXULONG, DEFAULT_AUDIO_BITRATE, @@ -255,7 +255,7 @@ gst_ffmpegenc_init (GstFFMpegEnc * ffmpegenc) ffmpegenc->file = NULL; ffmpegenc->delay = g_queue_new (); - if (oclass->in_plugin->type == CODEC_TYPE_VIDEO) { + if (oclass->in_plugin->type == AVMEDIA_TYPE_VIDEO) { gst_pad_set_chain_function (ffmpegenc->sinkpad, gst_ffmpegenc_chain_video); /* so we know when to flush the buffers on EOS */ gst_pad_set_event_function (ffmpegenc->sinkpad, gst_ffmpegenc_event_video); @@ -272,7 +272,7 @@ gst_ffmpegenc_init (GstFFMpegEnc * ffmpegenc) ffmpegenc->max_key_interval = 0; gst_ffmpeg_cfg_set_defaults (ffmpegenc); - } else if (oclass->in_plugin->type == CODEC_TYPE_AUDIO) { + } else if (oclass->in_plugin->type == AVMEDIA_TYPE_AUDIO) { gst_pad_set_chain_function (ffmpegenc->sinkpad, gst_ffmpegenc_chain_audio); ffmpegenc->bitrate = DEFAULT_AUDIO_BITRATE; @@ -385,7 +385,7 @@ gst_ffmpegenc_getcaps (GstPad * pad) GST_DEBUG_OBJECT (ffmpegenc, "getting caps"); /* audio needs no special care */ - if (oclass->in_plugin->type == CODEC_TYPE_AUDIO) { + if (oclass->in_plugin->type == AVMEDIA_TYPE_AUDIO) { caps = gst_caps_copy (gst_pad_get_pad_template_caps (pad)); GST_DEBUG_OBJECT (ffmpegenc, "audio caps, return template %" GST_PTR_FORMAT, @@ -672,7 +672,7 @@ gst_ffmpegenc_setcaps (GstPad * pad, GstCaps * caps) /* we may have failed mapping caps to a pixfmt, * and quite some codecs do not make up their own mind about that * in any case, _NONE can never work out later on */ - if (oclass->in_plugin->type == CODEC_TYPE_VIDEO && pix_fmt == PIX_FMT_NONE) { + if (oclass->in_plugin->type == AVMEDIA_TYPE_VIDEO && pix_fmt == PIX_FMT_NONE) { GST_DEBUG_OBJECT (ffmpegenc, "ffenc_%s: Failed to determine input format", oclass->in_plugin->name); return FALSE; @@ -1313,8 +1313,8 @@ gst_ffmpegenc_register (GstPlugin * plugin) gchar *type_name; /* Skip non-AV codecs */ - if (in_plugin->type != CODEC_TYPE_AUDIO && - in_plugin->type != CODEC_TYPE_VIDEO) + if (in_plugin->type != AVMEDIA_TYPE_AUDIO && + in_plugin->type != AVMEDIA_TYPE_VIDEO) goto next; /* no quasi codecs, please */ diff --git a/ext/ffmpeg/gstffmpegmux.c b/ext/ffmpeg/gstffmpegmux.c index 91138f0a6f..86d8c00462 100644 --- a/ext/ffmpeg/gstffmpegmux.c +++ b/ext/ffmpeg/gstffmpegmux.c @@ -412,7 +412,7 @@ gst_ffmpegmux_request_new_pad (GstElement * element, gchar *padname; GstPad *pad; AVStream *st; - enum CodecType type; + enum AVMediaType type; gint bitrate = 0, framesize = 0; g_return_val_if_fail (templ != NULL, NULL); @@ -422,12 +422,12 @@ gst_ffmpegmux_request_new_pad (GstElement * element, /* figure out a name that *we* like */ if (templ == gst_element_class_get_pad_template (klass, "video_%d")) { padname = g_strdup_printf ("video_%d", ffmpegmux->videopads++); - type = CODEC_TYPE_VIDEO; + type = AVMEDIA_TYPE_VIDEO; bitrate = 64 * 1024; framesize = 1152; } else if (templ == gst_element_class_get_pad_template (klass, "audio_%d")) { padname = g_strdup_printf ("audio_%d", ffmpegmux->audiopads++); - type = CODEC_TYPE_AUDIO; + type = AVMEDIA_TYPE_AUDIO; bitrate = 285 * 1024; } else { g_warning ("ffmux: unknown pad template!"); @@ -560,12 +560,12 @@ gst_ffmpegmux_collected (GstCollectPads * pads, gpointer user_data) if (st->codec->codec_id == CODEC_ID_NONE) { GST_ELEMENT_ERROR (ffmpegmux, CORE, NEGOTIATION, (NULL), ("no caps set on stream %d (%s)", collect_pad->padnum, - (st->codec->codec_type == CODEC_TYPE_VIDEO) ? + (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) ? "video" : "audio")); return GST_FLOW_ERROR; } /* set framerate for audio */ - if (st->codec->codec_type == CODEC_TYPE_AUDIO) { + if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) { switch (st->codec->codec_id) { case CODEC_ID_PCM_S16LE: case CODEC_ID_PCM_S16BE: