summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian.droege@collabora.co.uk>2012-01-10 11:35:55 +0100
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2012-01-10 11:35:55 +0100
commitbde3117e727fa2dacac7cc422dba6cff06ebe651 (patch)
tree9d1fdb2e45980ac9dcc0bd47d212544a55d69c5e
parentad53e32665ab1f6a34bfec7a54fbb0d1e1d5d4ac (diff)
parentb9ff7da938cbe4759bca08621c4c5ffc7599383b (diff)
Merge branch 'master' into 0.11
Conflicts: configure.ac ext/ffmpeg/gstffmpegcodecmap.c ext/ffmpeg/gstffmpegdec.c ext/ffmpeg/gstffmpegdeinterlace.c ext/ffmpeg/gstffmpegmux.c ext/libswscale/gstffmpegscale.c
-rw-r--r--ext/ffmpeg/gstffmpegaudioresample.c6
-rw-r--r--ext/ffmpeg/gstffmpegdec.c64
-rw-r--r--ext/ffmpeg/gstffmpegmux.c39
-rw-r--r--ext/ffmpeg/gstffmpegscale.c6
-rw-r--r--ext/libpostproc/gstpostproc.c8
m---------gst-libs/ext/libav0
6 files changed, 67 insertions, 56 deletions
diff --git a/ext/ffmpeg/gstffmpegaudioresample.c b/ext/ffmpeg/gstffmpegaudioresample.c
index 838c078..fa165c2 100644
--- a/ext/ffmpeg/gstffmpegaudioresample.c
+++ b/ext/ffmpeg/gstffmpegaudioresample.c
@@ -107,10 +107,8 @@ gst_ffmpegaudioresample_base_init (gpointer g_class)
{
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
- gst_element_class_add_pad_template (element_class,
- gst_static_pad_template_get (&src_factory));
- gst_element_class_add_pad_template (element_class,
- gst_static_pad_template_get (&sink_factory));
+ gst_element_class_add_static_pad_template (element_class, &src_factory);
+ gst_element_class_add_static_pad_template (element_class, &sink_factory);
gst_element_class_set_details_simple (element_class,
"FFMPEG Audio resampling element", "Filter/Converter/Audio",
"Converts audio from one samplerate to another",
diff --git a/ext/ffmpeg/gstffmpegdec.c b/ext/ffmpeg/gstffmpegdec.c
index 522f3bb..f370e7f 100644
--- a/ext/ffmpeg/gstffmpegdec.c
+++ b/ext/ffmpeg/gstffmpegdec.c
@@ -475,27 +475,44 @@ gst_ffmpegdec_finalize (GObject * object)
static gboolean
gst_ffmpegdec_src_query (GstPad * pad, GstObject * parent, GstQuery * query)
{
- gboolean res;
-
- /* just forward to peer */
- res = gst_pad_query_default (pad, parent, query);
-#if 0
- {
- GstFormat bfmt;
-
- bfmt = GST_FORMAT_BYTES;
+ GstFFMpegDec *ffmpegdec;
+ gboolean res = FALSE;
- /* ok, do bitrate calc... */
- if ((type != GST_QUERY_POSITION && type != GST_QUERY_TOTAL) ||
- *fmt != GST_FORMAT_TIME || ffmpegdec->context->bit_rate == 0 ||
- !gst_pad_query (peer, type, &bfmt, value))
- return FALSE;
+ ffmpegdec = (GstFFMpegDec *) parent;
- if (ffmpegdec->pcache && type == GST_QUERY_POSITION)
- *value -= GST_BUFFER_SIZE (ffmpegdec->pcache);
- *value *= GST_SECOND / ffmpegdec->context->bit_rate;
+ switch (GST_QUERY_TYPE (query)) {
+ case GST_QUERY_LATENCY:
+ {
+ GST_DEBUG_OBJECT (ffmpegdec, "latency query %d",
+ ffmpegdec->context->has_b_frames);
+ if ((res = gst_pad_peer_query (ffmpegdec->sinkpad, query))) {
+ if (ffmpegdec->context->has_b_frames) {
+ gboolean live;
+ GstClockTime min_lat, max_lat, our_lat;
+
+ gst_query_parse_latency (query, &live, &min_lat, &max_lat);
+ if (ffmpegdec->format.video.fps_n > 0)
+ our_lat =
+ gst_util_uint64_scale_int (ffmpegdec->context->has_b_frames *
+ GST_SECOND, ffmpegdec->format.video.fps_d,
+ ffmpegdec->format.video.fps_n);
+ else
+ our_lat =
+ gst_util_uint64_scale_int (ffmpegdec->context->has_b_frames *
+ GST_SECOND, 1, 25);
+ if (min_lat != -1)
+ min_lat += our_lat;
+ if (max_lat != -1)
+ max_lat += our_lat;
+ gst_query_set_latency (query, live, min_lat, max_lat);
+ }
+ }
+ }
+ break;
+ default:
+ res = gst_pad_query_default (pad, query);
+ break;
}
-#endif
return res;
}
@@ -1634,6 +1651,9 @@ check_keyframe (GstFFMpegDec * ffmpegdec)
if (!ffmpegdec->has_b_frames && ffmpegdec->picture->pict_type == FF_B_TYPE) {
GST_DEBUG_OBJECT (ffmpegdec, "we have B frames");
ffmpegdec->has_b_frames = TRUE;
+ /* Emit latency message to recalculate it */
+ gst_element_post_message (GST_ELEMENT_CAST (ffmpegdec),
+ gst_message_new_latency (GST_OBJECT_CAST (ffmpegdec)));
}
is_itype = (ffmpegdec->picture->pict_type == FF_I_TYPE);
@@ -3173,14 +3193,6 @@ gst_ffmpegdec_register (GstPlugin * plugin)
case CODEC_ID_MP3:
rank = GST_RANK_NONE;
break;
- /* TEMPORARILY DISABLING AC3/EAC3/DTS for 0.10.12 release
- * due to downmixing failure.
- * See Bug #608892 for more details */
- case CODEC_ID_EAC3:
- case CODEC_ID_AC3:
- case CODEC_ID_DTS:
- rank = GST_RANK_NONE;
- break;
default:
rank = GST_RANK_MARGINAL;
break;
diff --git a/ext/ffmpeg/gstffmpegmux.c b/ext/ffmpeg/gstffmpegmux.c
index 1d4efb9..025a03c 100644
--- a/ext/ffmpeg/gstffmpegmux.c
+++ b/ext/ffmpeg/gstffmpegmux.c
@@ -29,7 +29,7 @@
#endif
#include <gst/gst.h>
-#include <gst/base/gstcollectpads.h>
+#include <gst/base/gstcollectpads2.h>
#include "gstffmpeg.h"
#include "gstffmpegcodecmap.h"
@@ -40,7 +40,7 @@ typedef struct _GstFFMpegMuxPad GstFFMpegMuxPad;
struct _GstFFMpegMuxPad
{
- GstCollectData collect; /* we extend the CollectData */
+ GstCollectData2 collect; /* we extend the CollectData2 */
gint padnum;
};
@@ -49,7 +49,7 @@ struct _GstFFMpegMux
{
GstElement element;
- GstCollectPads *collect;
+ GstCollectPads2 *collect;
/* We need to keep track of our pads, so we do so here. */
GstPad *srcpad;
@@ -114,7 +114,7 @@ static void gst_ffmpegmux_finalize (GObject * object);
static gboolean gst_ffmpegmux_setcaps (GstPad * pad, GstCaps * caps);
static GstPad *gst_ffmpegmux_request_new_pad (GstElement * element,
GstPadTemplate * templ, const gchar * name, const GstCaps * caps);
-static GstFlowReturn gst_ffmpegmux_collected (GstCollectPads * pads,
+static GstFlowReturn gst_ffmpegmux_collected (GstCollectPads2 * pads,
gpointer user_data);
static gboolean gst_ffmpegmux_sink_event (GstPad * pad, GstObject * parent,
@@ -272,17 +272,20 @@ gst_ffmpegmux_base_init (gpointer g_class)
/* pad templates */
srctempl = gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS, srccaps);
gst_element_class_add_pad_template (element_class, srctempl);
+ gst_object_unref (srctempl);
if (audiosinkcaps) {
audiosinktempl = gst_pad_template_new ("audio_%u",
GST_PAD_SINK, GST_PAD_REQUEST, audiosinkcaps);
gst_element_class_add_pad_template (element_class, audiosinktempl);
+ gst_object_unref (audiosinktempl);
}
if (videosinkcaps) {
videosinktempl = gst_pad_template_new ("video_%u",
GST_PAD_SINK, GST_PAD_REQUEST, videosinkcaps);
gst_element_class_add_pad_template (element_class, videosinktempl);
+ gst_object_unref (videosinktempl);
}
beach:
@@ -329,9 +332,9 @@ gst_ffmpegmux_init (GstFFMpegMux * ffmpegmux, GstFFMpegMuxClass * g_class)
gst_pad_set_caps (ffmpegmux->srcpad, gst_pad_template_get_caps (templ));
gst_element_add_pad (GST_ELEMENT (ffmpegmux), ffmpegmux->srcpad);
- ffmpegmux->collect = gst_collect_pads_new ();
- gst_collect_pads_set_function (ffmpegmux->collect,
- (GstCollectPadsFunction) gst_ffmpegmux_collected, ffmpegmux);
+ ffmpegmux->collect = gst_collect_pads2_new ();
+ gst_collect_pads2_set_function (ffmpegmux->collect,
+ (GstCollectPads2Function) gst_ffmpegmux_collected, ffmpegmux);
ffmpegmux->context = g_new0 (AVFormatContext, 1);
ffmpegmux->context->oformat = oclass->in_plugin;
@@ -437,8 +440,8 @@ gst_ffmpegmux_request_new_pad (GstElement * element,
/* create pad */
pad = gst_pad_new_from_template (templ, padname);
collect_pad = (GstFFMpegMuxPad *)
- gst_collect_pads_add_pad (ffmpegmux->collect, pad,
- sizeof (GstFFMpegMuxPad), NULL);
+ gst_collect_pads2_add_pad (ffmpegmux->collect, pad,
+ sizeof (GstFFMpegMuxPad));
collect_pad->padnum = ffmpegmux->context->nb_streams;
/* small hack to put our own event pad function and chain up to collect pad */
@@ -543,7 +546,7 @@ beach:
}
static GstFlowReturn
-gst_ffmpegmux_collected (GstCollectPads * pads, gpointer user_data)
+gst_ffmpegmux_collected (GstCollectPads2 * pads, gpointer user_data)
{
GstFFMpegMux *ffmpegmux = (GstFFMpegMux *) user_data;
GSList *collected;
@@ -592,8 +595,8 @@ gst_ffmpegmux_collected (GstCollectPads * pads, gpointer user_data)
/* FIXME : This doesn't work for RAW AUDIO...
* in fact I'm wondering if it even works for any kind of audio... */
- buffer = gst_collect_pads_peek (ffmpegmux->collect,
- (GstCollectData *) collect_pad);
+ buffer = gst_collect_pads2_peek (ffmpegmux->collect,
+ (GstCollectData2 *) collect_pad);
if (buffer) {
st->codec->frame_size =
st->codec->sample_rate *
@@ -686,8 +689,8 @@ gst_ffmpegmux_collected (GstCollectPads * pads, gpointer user_data)
for (collected = ffmpegmux->collect->data; collected;
collected = g_slist_next (collected)) {
GstFFMpegMuxPad *collect_pad = (GstFFMpegMuxPad *) collected->data;
- GstBuffer *buffer = gst_collect_pads_peek (ffmpegmux->collect,
- (GstCollectData *) collect_pad);
+ GstBuffer *buffer = gst_collect_pads2_peek (ffmpegmux->collect,
+ (GstCollectData2 *) collect_pad);
/* if there's no buffer, just continue */
if (buffer == NULL) {
@@ -724,8 +727,8 @@ gst_ffmpegmux_collected (GstCollectPads * pads, gpointer user_data)
gsize size;
/* push out current buffer */
- buf = gst_collect_pads_pop (ffmpegmux->collect,
- (GstCollectData *) best_pad);
+ buf = gst_collect_pads2_pop (ffmpegmux->collect,
+ (GstCollectData2 *) best_pad);
ffmpegmux->context->streams[best_pad->padnum]->codec->frame_number++;
@@ -802,12 +805,12 @@ gst_ffmpegmux_change_state (GstElement * element, GstStateChange transition)
case GST_STATE_CHANGE_NULL_TO_READY:
break;
case GST_STATE_CHANGE_READY_TO_PAUSED:
- gst_collect_pads_start (ffmpegmux->collect);
+ gst_collect_pads2_start (ffmpegmux->collect);
break;
case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
break;
case GST_STATE_CHANGE_PAUSED_TO_READY:
- gst_collect_pads_stop (ffmpegmux->collect);
+ gst_collect_pads2_stop (ffmpegmux->collect);
break;
default:
break;
diff --git a/ext/ffmpeg/gstffmpegscale.c b/ext/ffmpeg/gstffmpegscale.c
index a8678ae..ac5c7e1 100644
--- a/ext/ffmpeg/gstffmpegscale.c
+++ b/ext/ffmpeg/gstffmpegscale.c
@@ -103,10 +103,8 @@ gst_ffmpegscale_base_init (gpointer g_class)
{
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
- gst_element_class_add_pad_template (element_class,
- gst_static_pad_template_get (&src_factory));
- gst_element_class_add_pad_template (element_class,
- gst_static_pad_template_get (&sink_factory));
+ gst_element_class_add_static_pad_template (element_class, &src_factory);
+ gst_element_class_add_static_pad_template (element_class, &sink_factory);
gst_element_class_set_details_simple (element_class, "FFMPEG Scale element",
"Filter/Converter/Video/Scaler",
"Converts video from one resolution to another",
diff --git a/ext/libpostproc/gstpostproc.c b/ext/libpostproc/gstpostproc.c
index aa05a9f..7278a7d 100644
--- a/ext/libpostproc/gstpostproc.c
+++ b/ext/libpostproc/gstpostproc.c
@@ -371,10 +371,10 @@ gst_post_proc_base_init (GstPostProcClass * klass)
g_free (longname);
g_free (description);
- gst_element_class_add_pad_template (element_class,
- gst_static_pad_template_get (&gst_post_proc_src_template));
- gst_element_class_add_pad_template (element_class,
- gst_static_pad_template_get (&gst_post_proc_sink_template));
+ gst_element_class_add_static_pad_template (element_class,
+ &gst_post_proc_src_template);
+ gst_element_class_add_static_pad_template (element_class,
+ &gst_post_proc_sink_template);
klass->filterid = ppidx;
}
diff --git a/gst-libs/ext/libav b/gst-libs/ext/libav
-Subproject 85afbb1d00d58812df5d634e946b2fcf653bcd8
+Subproject 0b8b3387a977dcdb6fb9e53bcc9966d34b2e4ce