Commit 37062fde authored by Ronald S. Bultje's avatar Ronald S. Bultje

ext/ffmpeg/gstffmpegcodecmap.c: Add AMR mimetypes (since those are recognized in ffmpeg).

Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_caps_to_codecid):
Add AMR mimetypes (since those are recognized in ffmpeg).
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_frame),
(gst_ffmpegdec_register):
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_register):
Register law codecs too, add time debug. Use ANY for template caps
since we don't necessarily have available decoders for recognized
formats.
parent 97df4afd
2005-01-28 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_caps_to_codecid):
Add AMR mimetypes (since those are recognized in ffmpeg).
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_frame),
(gst_ffmpegdec_register):
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_register):
Register law codecs too, add time debug. Use ANY for template caps
since we don't necessarily have available decoders for recognized
formats.
2005-01-27 Ronald S. Bultje <rbultje@ronald.bitfreak.net> 2005-01-27 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* ext/ffmpeg/gstffmpeg.c: (plugin_init): * ext/ffmpeg/gstffmpeg.c: (plugin_init):
......
...@@ -631,10 +631,11 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id, ...@@ -631,10 +631,11 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id,
break; break;
case CODEC_ID_AMR_NB: case CODEC_ID_AMR_NB:
caps = GST_FF_AUD_CAPS_NEW ("audio/x-amr-nb", NULL);
break;
case CODEC_ID_AMR_WB: case CODEC_ID_AMR_WB:
/* what's this? ffmpeg uses external libs here that we don't include caps = GST_FF_AUD_CAPS_NEW ("audio/x-amr-wb", NULL);
* so there's no point in defining those. Still, I want to know what
* it actually is... */
break; break;
case CODEC_ID_RA_144: case CODEC_ID_RA_144:
...@@ -1710,6 +1711,12 @@ gst_ffmpeg_caps_to_codecid (const GstCaps * caps, AVCodecContext * context) ...@@ -1710,6 +1711,12 @@ gst_ffmpeg_caps_to_codecid (const GstCaps * caps, AVCodecContext * context)
break; break;
} }
} }
} else if (!strcmp (mimetype, "audio/x-amrnb")) {
audio = TRUE;
id = CODEC_ID_AMR_NB;
} else if (!strcmp (mimetype, "audio/x-amrwb")) {
id = CODEC_ID_AMR_WB;
audio = TRUE;
} else if (!strncmp (mimetype, "audio/x-gst_ff-", 15) || } else if (!strncmp (mimetype, "audio/x-gst_ff-", 15) ||
!strncmp (mimetype, "video/x-gst_ff-", 15)) { !strncmp (mimetype, "video/x-gst_ff-", 15)) {
gchar ext[16]; gchar ext[16];
......
...@@ -660,7 +660,8 @@ gst_ffmpegdec_frame (GstFFMpegDec * ffmpegdec, ...@@ -660,7 +660,8 @@ gst_ffmpegdec_frame (GstFFMpegDec * ffmpegdec,
} }
if (have_data) { if (have_data) {
GST_DEBUG_OBJECT (ffmpegdec, "Decoded data, now pushing"); GST_DEBUG_OBJECT (ffmpegdec, "Decoded data, now pushing (%"
GST_TIME_FORMAT ")", GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (outbuf)));
if (!gst_ffmpegdec_negotiate (ffmpegdec)) { if (!gst_ffmpegdec_negotiate (ffmpegdec)) {
gst_buffer_unref (outbuf); gst_buffer_unref (outbuf);
...@@ -881,7 +882,7 @@ gst_ffmpegdec_register (GstPlugin * plugin) ...@@ -881,7 +882,7 @@ gst_ffmpegdec_register (GstPlugin * plugin)
/* no quasi-codecs, please */ /* no quasi-codecs, please */
if (in_plugin->id == CODEC_ID_RAWVIDEO || if (in_plugin->id == CODEC_ID_RAWVIDEO ||
(in_plugin->id >= CODEC_ID_PCM_S16LE && (in_plugin->id >= CODEC_ID_PCM_S16LE &&
in_plugin->id <= CODEC_ID_PCM_ALAW)) { in_plugin->id <= CODEC_ID_PCM_U8)) {
goto next; goto next;
} }
...@@ -896,7 +897,7 @@ gst_ffmpegdec_register (GstPlugin * plugin) ...@@ -896,7 +897,7 @@ gst_ffmpegdec_register (GstPlugin * plugin)
/* first make sure we've got a supported type */ /* first make sure we've got a supported type */
sinkcaps = gst_ffmpeg_codecid_to_caps (in_plugin->id, NULL, FALSE); sinkcaps = gst_ffmpeg_codecid_to_caps (in_plugin->id, NULL, FALSE);
srccaps = gst_ffmpeg_codectype_to_caps (in_plugin->type, NULL); srccaps = gst_caps_from_string ("video/x-raw-rgb; video/x-raw-yuv");
if (!sinkcaps || !srccaps) { if (!sinkcaps || !srccaps) {
if (sinkcaps) gst_caps_free (sinkcaps); if (sinkcaps) gst_caps_free (sinkcaps);
if (srccaps) gst_caps_free (srccaps); if (srccaps) gst_caps_free (srccaps);
......
...@@ -745,26 +745,8 @@ gst_ffmpegdemux_register (GstPlugin * plugin) ...@@ -745,26 +745,8 @@ gst_ffmpegdemux_register (GstPlugin * plugin)
/* This is a bit ugly, but we just take all formats /* This is a bit ugly, but we just take all formats
* for the pad template. We'll get an exact match * for the pad template. We'll get an exact match
* when we open the stream */ * when we open the stream */
audiosrccaps = gst_caps_new_empty (); audiosrccaps = gst_caps_new_any ();
videosrccaps = gst_caps_new_empty (); videosrccaps = gst_caps_new_any ();
for (in_codec = first_avcodec; in_codec != NULL; in_codec = in_codec->next) {
GstCaps *temp = gst_ffmpeg_codecid_to_caps (in_codec->id, NULL, TRUE);
if (!temp) {
continue;
}
switch (in_codec->type) {
case CODEC_TYPE_VIDEO:
gst_caps_append (videosrccaps, temp);
break;
case CODEC_TYPE_AUDIO:
gst_caps_append (audiosrccaps, temp);
break;
default:
gst_caps_free (temp);
break;
}
}
/* construct the type */ /* construct the type */
type_name = g_strdup_printf ("ffdemux_%s", name); type_name = g_strdup_printf ("ffdemux_%s", name);
......
...@@ -708,7 +708,7 @@ gst_ffmpegenc_register (GstPlugin * plugin) ...@@ -708,7 +708,7 @@ gst_ffmpegenc_register (GstPlugin * plugin)
/* first make sure we've got a supported type */ /* first make sure we've got a supported type */
srccaps = gst_ffmpeg_codecid_to_caps (in_plugin->id, NULL, TRUE); srccaps = gst_ffmpeg_codecid_to_caps (in_plugin->id, NULL, TRUE);
sinkcaps = gst_ffmpeg_codectype_to_caps (in_plugin->type, NULL); sinkcaps = gst_caps_from_string ("video/x-raw-rgb; video/x-raw-yuv");
if (!sinkcaps || !srccaps) if (!sinkcaps || !srccaps)
goto next; goto next;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment