Merge branch 'master' into 0.11

Conflicts:
	configure.ac
This commit is contained in:
Wim Taymans 2011-02-28 12:12:51 +01:00
commit 73f2667ff2
13 changed files with 145 additions and 27 deletions

2
common

@ -1 +1 @@
Subproject commit 011bcc8a0fc7f798ee874a7ba899123fb2470e22
Subproject commit 1de7f6ab2d4bc1af69f06079cf0f4e2cbbfdc178

View file

@ -261,8 +261,9 @@ else
AC_MSG_NOTICE([Using ffmpeg revision $FFMPEG_REVISION])
dnl libgstffmpeg.la: include dirs
FFMPEG_CFLAGS="-I \$(top_srcdir)/gst-libs/ext/ffmpeg/libavformat \
-I \$(top_srcdir)/gst-libs/ext/ffmpeg/libavutil \
FFMPEG_CFLAGS="-I \$(top_srcdir)/gst-libs/ext/ffmpeg/libavutil \
-I \$(top_srcdir)/gst-libs/ext/ffmpeg/libavcore \
-I \$(top_srcdir)/gst-libs/ext/ffmpeg/libavformat \
-I \$(top_srcdir)/gst-libs/ext/ffmpeg/libavcodec \
-I \$(top_srcdir)/gst-libs/ext/ffmpeg \
-I \$(top_builddir)/gst-libs/ext/ffmpeg \
@ -271,7 +272,8 @@ else
dnl libgstffmpeg.la: libs to statically link to
FFMPEG_LIBS="\$(top_builddir)/gst-libs/ext/ffmpeg/libavformat/libavformat.a \
\$(top_builddir)/gst-libs/ext/ffmpeg/libavcodec/libavcodec.a \
\$(top_builddir)/gst-libs/ext/ffmpeg/libavutil/libavutil.a"
\$(top_builddir)/gst-libs/ext/ffmpeg/libavutil/libavutil.a \
\$(top_builddir)/gst-libs/ext/ffmpeg/libavcore/libavcore.a"
dnl
POSTPROC_CFLAGS="-I \$(top_srcdir)/gst-libs/ext/ffmpeg/libpostproc \
-I \$(top_srcdir)/gst-libs/ext/ffmpeg/libavutil \

View file

@ -943,6 +943,10 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id,
caps = gst_ff_vid_caps_new (context, codec_id, "video/x-vp6-alpha", NULL);
break;
case CODEC_ID_VP8:
caps = gst_ff_vid_caps_new (context, codec_id, "video/x-vp8", NULL);
break;
case CODEC_ID_THEORA:
caps = gst_ff_vid_caps_new (context, codec_id, "video/x-theora", NULL);
break;
@ -1182,6 +1186,19 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id,
caps = gst_ff_vid_caps_new (context, codec_id, "video/x-zmbv", NULL);
break;
case CODEC_ID_LAGARITH:
caps = gst_ff_vid_caps_new (context, codec_id, "video/x-lagarith", NULL);
break;
case CODEC_ID_CSCD:
caps = gst_ff_vid_caps_new (context, codec_id, "video/x-camstudio", NULL);
if (context) {
gst_caps_set_simple (caps,
"depth", G_TYPE_INT, (gint) context->bits_per_coded_sample, NULL);
} else {
gst_caps_set_simple (caps, "depth", GST_TYPE_INT_RANGE, 8, 32, NULL);
}
break;
case CODEC_ID_WS_VQA:
case CODEC_ID_IDCIN:
@ -1201,7 +1218,6 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id,
case CODEC_ID_MP3ADU:
case CODEC_ID_MP3ON4:
case CODEC_ID_WESTWOOD_SND1:
case CODEC_ID_CSCD:
case CODEC_ID_MMVIDEO:
case CODEC_ID_AVS:
case CODEC_ID_CAVS:
@ -1277,6 +1293,14 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id,
caps = gst_ff_aud_caps_new (context, codec_id, "audio/x-alaw", NULL);
break;
case CODEC_ID_ADPCM_G722:
caps = gst_ff_aud_caps_new (context, codec_id, "audio/G722", NULL);
if (context)
gst_caps_set_simple (caps,
"block_align", G_TYPE_INT, context->block_align,
"bitrate", G_TYPE_INT, context->bit_rate, NULL);
break;
case CODEC_ID_ADPCM_G726:
{
/* the G726 decoder can also handle G721 */
@ -1430,6 +1454,14 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id,
caps = gst_ff_aud_caps_new (context, codec_id, "audio/AMR-WB", NULL);
break;
case CODEC_ID_GSM:
caps = gst_ff_aud_caps_new (context, codec_id, "audio/x-gsm", NULL);
break;
case CODEC_ID_GSM_MS:
caps = gst_ff_aud_caps_new (context, codec_id, "audio/ms-gsm", NULL);
break;
case CODEC_ID_NELLYMOSER:
caps =
gst_ff_aud_caps_new (context, codec_id, "audio/x-nellymoser", NULL);
@ -2365,6 +2397,7 @@ gst_ffmpeg_caps_with_codecid (enum CodecID codec_id,
case CODEC_ID_MSRLE:
case CODEC_ID_QTRLE:
case CODEC_ID_TSCC:
case CODEC_ID_CSCD:
case CODEC_ID_APE:
{
gint depth;
@ -3073,6 +3106,9 @@ gst_ffmpeg_caps_to_codecid (const GstCaps * caps, AVCodecContext * context)
} else if (!strcmp (mimetype, "video/x-vp6-alpha")) {
id = CODEC_ID_VP6A;
video = TRUE;
} else if (!strcmp (mimetype, "video/x-vp8")) {
id = CODEC_ID_VP8;
video = TRUE;
} else if (!strcmp (mimetype, "video/x-flash-screen")) {
id = CODEC_ID_FLASHSV;
video = TRUE;

View file

@ -96,7 +96,8 @@ struct _GstFFMpegDec
gboolean has_b_frames;
gboolean reordered_in;
GstClockTime last_in;
GstClockTime next_in;
GstClockTime last_diff;
guint last_frames;
gboolean reordered_out;
GstClockTime last_out;
GstClockTime next_out;
@ -498,7 +499,8 @@ static void
gst_ffmpegdec_reset_ts (GstFFMpegDec * ffmpegdec)
{
ffmpegdec->last_in = GST_CLOCK_TIME_NONE;
ffmpegdec->next_in = GST_CLOCK_TIME_NONE;
ffmpegdec->last_diff = GST_CLOCK_TIME_NONE;
ffmpegdec->last_frames = 0;
ffmpegdec->last_out = GST_CLOCK_TIME_NONE;
ffmpegdec->next_out = GST_CLOCK_TIME_NONE;
ffmpegdec->reordered_in = FALSE;
@ -1292,9 +1294,22 @@ gst_ffmpegdec_negotiate (GstFFMpegDec * ffmpegdec, gboolean force)
/* ERRORS */
no_caps:
{
GST_ELEMENT_ERROR (ffmpegdec, CORE, NEGOTIATION, (NULL),
("could not find caps for codec (%s), unknown type",
oclass->in_plugin->name));
#ifdef HAVE_FFMPEG_UNINSTALLED
/* using internal ffmpeg snapshot */
GST_ELEMENT_ERROR (ffmpegdec, CORE, NEGOTIATION,
("Could not find GStreamer caps mapping for FFmpeg codec '%s'.",
oclass->in_plugin->name), (NULL));
#else
/* using external ffmpeg */
GST_ELEMENT_ERROR (ffmpegdec, CORE, NEGOTIATION,
("Could not find GStreamer caps mapping for FFmpeg codec '%s', and "
"you are using an external libavcodec. This is most likely due to "
"a packaging problem and/or libavcodec having been upgraded to a "
"version that is not compatible with this version of "
"gstreamer-ffmpeg. Make sure your gstreamer-ffmpeg and libavcodec "
"packages come from the same source/repository.",
oclass->in_plugin->name), (NULL));
#endif
return FALSE;
}
caps_failed:
@ -1872,6 +1887,9 @@ gst_ffmpegdec_video_frame (GstFFMpegDec * ffmpegdec,
} else if (GST_CLOCK_TIME_IS_VALID (dec_info->duration)) {
GST_LOG_OBJECT (ffmpegdec, "using in_duration");
out_duration = dec_info->duration;
} else if (GST_CLOCK_TIME_IS_VALID (ffmpegdec->last_diff)) {
GST_LOG_OBJECT (ffmpegdec, "using last-diff");
out_duration = ffmpegdec->last_diff;
} else {
/* if we have an input framerate, use that */
if (ffmpegdec->format.video.fps_n != -1 &&
@ -2281,6 +2299,22 @@ gst_ffmpegdec_drain (GstFFMpegDec * ffmpegdec)
static void
gst_ffmpegdec_flush_pcache (GstFFMpegDec * ffmpegdec)
{
if (ffmpegdec->pctx) {
gint res, size, bsize;
guint8 *data;
guint8 bdata[FF_INPUT_BUFFER_PADDING_SIZE];
bsize = FF_INPUT_BUFFER_PADDING_SIZE;
memset (bdata, 0, bsize);
/* parse some dummy data to work around some ffmpeg weirdness where it keeps
* the previous pts around */
res = av_parser_parse (ffmpegdec->pctx, ffmpegdec->context,
&data, &size, bdata, bsize, -1, -1);
ffmpegdec->pctx->pts = -1;
ffmpegdec->pctx->dts = -1;
}
if (ffmpegdec->pcache) {
gst_buffer_unref (ffmpegdec->pcache);
ffmpegdec->pcache = NULL;
@ -2482,13 +2516,28 @@ gst_ffmpegdec_chain (GstPad * pad, GstBuffer * inbuf)
if (in_timestamp != -1) {
/* check for increasing timestamps if they are jumping backwards, we
* probably are dealing with PTS as timestamps */
if (!ffmpegdec->reordered_in && ffmpegdec->last_in != -1
&& in_timestamp < ffmpegdec->last_in) {
GST_LOG_OBJECT (ffmpegdec, "detected reordered input timestamps");
ffmpegdec->reordered_in = TRUE;
if (!ffmpegdec->reordered_in && ffmpegdec->last_in != -1) {
if (in_timestamp < ffmpegdec->last_in) {
GST_LOG_OBJECT (ffmpegdec, "detected reordered input timestamps");
ffmpegdec->reordered_in = TRUE;
ffmpegdec->last_diff = GST_CLOCK_TIME_NONE;
} else if (in_timestamp > ffmpegdec->last_in) {
GstClockTime diff;
/* keep track of timestamp diff to estimate duration */
diff = in_timestamp - ffmpegdec->last_in;
/* need to scale with amount of frames in the interval */
if (ffmpegdec->last_frames)
diff /= ffmpegdec->last_frames;
GST_LOG_OBJECT (ffmpegdec, "estimated duration %" GST_TIME_FORMAT " %u",
GST_TIME_ARGS (diff), ffmpegdec->last_frames);
ffmpegdec->last_diff = diff;
}
}
ffmpegdec->last_in = in_timestamp;
}
ffmpegdec->last_frames = 0;
GST_LOG_OBJECT (ffmpegdec,
"Received new data of size %u, offset:%" G_GUINT64_FORMAT ", ts:%"
@ -2515,7 +2564,8 @@ gst_ffmpegdec_chain (GstPad * pad, GstBuffer * inbuf)
GST_LOG_OBJECT (ffmpegdec,
"Calling av_parser_parse with offset %" G_GINT64_FORMAT ", ts:%"
GST_TIME_FORMAT, in_offset, GST_TIME_ARGS (in_timestamp));
GST_TIME_FORMAT " size %d", in_offset, GST_TIME_ARGS (in_timestamp),
bsize);
/* feed the parser. We pass the timestamp info so that we can recover all
* info again later */
@ -2523,10 +2573,19 @@ gst_ffmpegdec_chain (GstPad * pad, GstBuffer * inbuf)
&data, &size, bdata, bsize, in_info->idx, in_info->idx);
GST_LOG_OBJECT (ffmpegdec,
"parser returned res %d and size %d", res, size);
"parser returned res %d and size %d, id %" G_GINT64_FORMAT, res, size,
ffmpegdec->pctx->pts);
/* store pts for decoding */
dec_info = gst_ts_info_get (ffmpegdec, ffmpegdec->pctx->pts);
if (ffmpegdec->pctx->pts != -1)
dec_info = gst_ts_info_get (ffmpegdec, ffmpegdec->pctx->pts);
else {
/* ffmpeg sometimes loses track after a flush, help it by feeding a
* valid start time */
ffmpegdec->pctx->pts = in_info->idx;
ffmpegdec->pctx->dts = in_info->idx;
dec_info = in_info;
}
GST_LOG_OBJECT (ffmpegdec, "consuming %d bytes. id %d", size,
dec_info->idx);
@ -2626,6 +2685,7 @@ gst_ffmpegdec_chain (GstPad * pad, GstBuffer * inbuf)
} else {
ffmpegdec->clear_ts = TRUE;
}
ffmpegdec->last_frames++;
GST_LOG_OBJECT (ffmpegdec, "Before (while bsize>0). bsize:%d , bdata:%p",
bsize, bdata);
@ -2889,6 +2949,9 @@ gst_ffmpegdec_register (GstPlugin * plugin)
case CODEC_ID_SIPR:
rank = GST_RANK_SECONDARY;
break;
case CODEC_ID_MP3:
rank = GST_RANK_NONE;
break;
default:
rank = GST_RANK_MARGINAL;
break;

View file

@ -96,7 +96,7 @@ gst_ffmpegdeinterlace_base_init (gpointer g_class)
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&sink_factory));
gst_element_class_set_details_simple (element_class,
"FFMPEG Deinterlace element", "Filter/Converter/Video",
"FFMPEG Deinterlace element", "Filter/Effect/Video/Deinterlace",
"Deinterlace video", "Luca Ognibene <luogni@tin.it>");
}

View file

@ -1896,13 +1896,18 @@ gst_ffmpegdemux_register (GstPlugin * plugin)
goto next;
/* no network demuxers */
if (!strcmp (in_plugin->name, "sdp") || !strcmp (in_plugin->name, "rtsp"))
if (!strcmp (in_plugin->name, "sdp") ||
!strcmp (in_plugin->name, "rtsp") ||
!strcmp (in_plugin->name, "applehttp")
)
goto next;
/* these don't do what one would expect or
* are only partially functional/useful */
if (!strcmp (in_plugin->name, "aac") ||
!strcmp (in_plugin->name, "wv") || !strcmp (in_plugin->name, "ass"))
!strcmp (in_plugin->name, "wv") ||
!strcmp (in_plugin->name, "ass") ||
!strcmp (in_plugin->name, "ffmetadata"))
goto next;
/* Don't use the typefind functions of formats for which we already have
@ -1914,6 +1919,7 @@ gst_ffmpegdemux_register (GstPlugin * plugin)
!strcmp (in_plugin->name, "mpegvideo") ||
!strcmp (in_plugin->name, "mp3") ||
!strcmp (in_plugin->name, "matroska") ||
!strcmp (in_plugin->name, "matroska_webm") ||
!strcmp (in_plugin->name, "mpeg") ||
!strcmp (in_plugin->name, "wav") ||
!strcmp (in_plugin->name, "au") ||

View file

@ -1312,6 +1312,11 @@ gst_ffmpegenc_register (GstPlugin * plugin)
while (in_plugin) {
gchar *type_name;
/* Skip non-AV codecs */
if (in_plugin->type != CODEC_TYPE_AUDIO &&
in_plugin->type != CODEC_TYPE_VIDEO)
goto next;
/* no quasi codecs, please */
if (in_plugin->id == CODEC_ID_RAWVIDEO ||
in_plugin->id == CODEC_ID_V210 ||

View file

@ -903,7 +903,9 @@ gst_ffmpegmux_register (GstPlugin * plugin)
(!strncmp (in_plugin->name, "alaw", 4)) ||
(!strncmp (in_plugin->name, "h26", 3)) ||
(!strncmp (in_plugin->name, "rtp", 3)) ||
(!strncmp (in_plugin->name, "ass", 3))
(!strncmp (in_plugin->name, "ass", 3)) ||
(!strncmp (in_plugin->name, "ffmetadata", 10)) ||
(!strncmp (in_plugin->name, "srt", 3))
) {
GST_LOG ("Ignoring muxer %s", in_plugin->name);
goto next;

View file

@ -154,7 +154,7 @@ gst_ffmpegdata_read (URLContext * h, unsigned char *buf, int size)
}
static int
gst_ffmpegdata_write (URLContext * h, unsigned char *buf, int size)
gst_ffmpegdata_write (URLContext * h, const unsigned char *buf, int size)
{
GstProtocolInfo *info;
GstBuffer *outbuf;

View file

@ -108,7 +108,7 @@ gst_ffmpegscale_base_init (gpointer g_class)
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&sink_factory));
gst_element_class_set_details_simple (element_class, "FFMPEG Scale element",
"Filter/Converter/Video",
"Filter/Converter/Video/Scaler",
"Converts video from one resolution to another",
"Luca Ognibene <luogni@tin.it>");
}

View file

@ -88,13 +88,13 @@ GST_DEBUG_CATEGORY (ffmpegscale_debug);
GST_VIDEO_CAPS_RGB "; " GST_VIDEO_CAPS_BGR "; " \
GST_VIDEO_CAPS_xRGB "; " GST_VIDEO_CAPS_xBGR "; " \
GST_VIDEO_CAPS_ARGB "; " GST_VIDEO_CAPS_ABGR "; " \
GST_VIDEO_CAPS_YUV ("{ I420, YUY2, Y41B, Y42B }")
GST_VIDEO_CAPS_YUV ("{ I420, YUY2, UYVY, Y41B, Y42B }")
#else
#define VIDEO_CAPS \
GST_VIDEO_CAPS_RGB "; " GST_VIDEO_CAPS_BGR "; " \
GST_VIDEO_CAPS_RGBx "; " GST_VIDEO_CAPS_BGRx "; " \
GST_VIDEO_CAPS_RGBA "; " GST_VIDEO_CAPS_BGRA "; " \
GST_VIDEO_CAPS_YUV ("{ I420, YUY2, Y41B, Y42B }")
GST_VIDEO_CAPS_YUV ("{ I420, YUY2, UYVY, Y41B, Y42B }")
#endif
static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src",
@ -511,6 +511,9 @@ gst_ffmpeg_caps_to_pixfmt (const GstCaps * caps)
case GST_MAKE_FOURCC ('Y', 'U', 'Y', '2'):
pix_fmt = PIX_FMT_YUYV422;
break;
case GST_MAKE_FOURCC ('U', 'Y', 'V', 'Y'):
pix_fmt = PIX_FMT_UYVY422;
break;
case GST_MAKE_FOURCC ('I', '4', '2', '0'):
pix_fmt = PIX_FMT_YUV420P;
break;

View file

@ -1,6 +1,6 @@
FFMPEG_REVISION=23623
FFMPEG_REVISION=26402
FFMPEG_CO_DIR=gst-libs/ext/ffmpeg
FFMPEG_SVN=svn://svn.ffmpeg.org/ffmpeg/branches/0.6
FFMPEG_SVN=svn://svn.ffmpeg.org/ffmpeg/trunk/
# Because ffmpeg trunk checks out libswscale via an svn:externals, checking
# out an old ffmpeg does not check out a corresponding libswscale.
# Keep the swscale checkout manually synchronized, then. Update this

View file

@ -26,6 +26,7 @@ dist-clean:
rm -rf $(TMP_DIST_DIR)
rm -f Makefile
rm -f ffmpeg/.version
rm -f ffmpeg/.config
distclean: dist-clean