Commits (37)
=== release 1.2.4 ===
2014-04-18 Sebastian Dröge <slomo@coaxion.net>
* configure.ac:
releasing 1.2.4
2014-04-15 21:32:07 +0200 Mark Nauwelaerts <mnauw@users.sourceforge.net>
* ext/libav/gstavviddec.c:
* ext/libav/gstavviddec.h:
avviddec: guard against invalid libav opaque
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=727779
2014-04-14 09:59:17 +0100 Tim-Philipp Müller <tim@centricular.com>
* gst-libs/ext/libav:
libav: update to v9.12
2014-02-23 11:40:14 +0100 Mark Nauwelaerts <mnauw@users.sourceforge.net>
* ext/libav/gstavvidenc.c:
avvidenc: make all properties work again
... as previously broken due to additional compliance property
(see 13ffed87b1597fa60ccee293f71c3993ec59d1b2).
=== release 1.2.3 ===
2014-02-08 12:58:28 +0100 Sebastian Dröge <sebastian@centricular.com>
* ChangeLog:
* configure.ac:
* gst-libav.doap:
Release 1.2.3
2014-02-04 18:17:32 +0200 Dmitry Melnichenko <dmitry.m@samsung.com>
* ext/libav/gstavmux.c:
avmux: Fix invalid address passing to av_opt_set_int()
2014-01-21 22:58:42 +1100 Tim 'mithro' Ansell <mithro@mithis.com>
* ext/libav/gstavmux.c:
avmux: Force DV audio input format to 48kHz, 2 channels
libavformat only supports muxing 16bit, 48kHz stereo into DV containers.
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=722672
2014-02-04 16:12:59 +0100 Sebastian Dröge <sebastian@centricular.com>
* gst-libs/ext/libav:
libav: Update to v9.11 bugfix release
2014-01-15 09:02:33 +0000 Vincent Penquerc'h <vincent.penquerch@collabora.co.uk>
* ext/libav/gstavauddec.c:
* ext/libav/gstavaudenc.c:
* ext/libav/gstavcfg.c:
* ext/libav/gstavdeinterlace.c:
* ext/libav/gstavviddec.c:
* ext/libav/gstavvidenc.c:
gst-libav: fix context leaks
A AVCodecContext needs cleaning up before being freed.
Go through all of the allocations/setups to ensure none of them
can leak a context or its contents.
2014-01-11 19:19:24 +0000 Tim-Philipp Müller <tim@centricular.com>
* ext/libav/gstavviddec.c:
Revert "avviddec: release buffers when not direct rendering"
This reverts commit fcf09aff3272a12b1f91168a856637f146ced113.
This broke the build. In theory the problem might occur with
libav 9 too, but it seems in practice it doesn't, unless you
link against ffmpeg 2.x, but then you're on your own anyway.
2014-01-10 17:18:53 +0100 Wim Taymans <wtaymans@redhat.com>
* ext/libav/gstavviddec.c:
avviddec: release buffers when not direct rendering
New libav will not call the release_buffer callback anymore when
avcodec_default_get_buffer() is called from get_buffer. Releasing of the
memory in a picture should now be done by registering a callback to the
avbuffer objects in the picture. There is some compatibility code to
wrap the memory we provide in get_buffer in avbuffer with a callback to
release_buffer but that is not done when avcodec_default_get_buffer()
is called.
Work around this by adding a dummy avbuffer object to the picture that
will release the frame.
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=721077
2014-01-03 15:58:26 +0000 Tim-Philipp Müller <tim@centricular.com>
* ext/libav/gstavcodecmap.c:
avcodecmap: fix regression with wmv3 video in WMVA format
The VC-1 decoder should handle that. Before avdec_wmv3 handled
it, but then we added format=WMV3 to its sink pad template
caps, at which point nothing handled WMVA any longer.
2013-12-27 12:06:28 +0100 Sebastian Dröge <sebastian@centricular.com>
* configure.ac:
configure.ac: Remove warning when building against a system version of libav
Nowadays libav has proper releases and API/ABI guarantees.
We're not living in last decade.
=== release 1.2.2 ===
2013-12-26 17:55:41 +0100 Sebastian Dröge <sebastian@centricular.com>
* ChangeLog:
* configure.ac:
* gst-libav.doap:
Release 1.2.2
2013-12-07 11:35:09 +0100 Mark Nauwelaerts <mnauw@users.sourceforge.net>
* ext/libav/gstavviddec.c:
avviddec: improve buffer handling and semantics
... so as to focus on providing *a* buffer rather than one (too) tied
to a frame, in particular allowing multiple allocations related to a frame.
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=697806
2013-11-26 20:57:37 +0100 Mark Nauwelaerts <mnauw@users.sourceforge.net>
* ext/libav/gstavviddec.c:
avviddec: discard unused input frames
... to avoid these piling up in list of pending frames.
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=693772
2013-11-26 20:55:43 +0100 Mark Nauwelaerts <mnauw@users.sourceforge.net>
* ext/libav/gstavviddec.c:
avviddec: really release frame at proper time
... by also removing it from the pending list of frames,
where it may still be in if it has never been submitted to _finish.
This could happen if is a decode-only frame, or in skipped decoding
situation, ...
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=693772
2013-12-07 12:10:13 +0100 Mark Nauwelaerts <mnauw@users.sourceforge.net>
* ext/libav/gstavvidenc.c:
avvidenc: plug input_state leak
2013-12-02 20:21:34 +0100 Mark Nauwelaerts <mnauw@users.sourceforge.net>
* ext/libav/gstavviddec.c:
avviddec: only use upstream framerate if really specified
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=704161
2013-10-26 09:34:30 +0100 Tim-Philipp Müller <tim@centricular.com>
* ext/libav/gstavaudenc.c:
avaudenc: post better error message if experimental codecs don't work
2013-10-26 09:09:28 +0100 Tim-Philipp Müller <tim@centricular.com>
* ext/libav/gstavcodecmap.c:
codecmap: use TRUE for boolean fields in caps
2013-10-14 14:50:57 -0600 Greg Rutz <greg@gsr-tek.com>
* ext/libav/gstavaudenc.c:
* ext/libav/gstavaudenc.h:
* ext/libav/gstavcodecmap.c:
* ext/libav/gstavcodecmap.h:
* ext/libav/gstavvidenc.c:
* ext/libav/gstavvidenc.h:
avenc: Add compliance property
Add a new property to GstFFMpegVidEnc and GstFFMpegAudEnc to supply
the "strict compliance" value to AVCodecContext
=== release 1.2.1 ===
2013-11-09 16:02:14 +0100 Sebastian Dröge <sebastian@centricular.com>
* ChangeLog:
* configure.ac:
* gst-libav.doap:
Release 1.2.1
2013-11-04 23:20:17 +0000 Tim-Philipp Müller <tim@centricular.com>
* ext/libav/gstavcodecmap.c:
avaudec: don't put bogus 0 channel-mask on output caps for mono audio
2013-10-15 09:28:08 +0200 Sebastian Dröge <slomo@circular-chaos.org>
* gst-libs/ext/libav:
libav: Update to v9.10
2013-10-02 13:59:04 +0200 Sebastian Dröge <slomo@circular-chaos.org>
* ext/libav/gstavcodecmap.c:
avcodecmap: gst_value_can_intersect() does not do what you would think
Check for uniqueness differently now.
2013-10-02 12:57:36 +0200 Sebastian Dröge <slomo@circular-chaos.org>
* ext/libav/gstavcodecmap.c:
avcodecmap: Only append values to the video/audio format lists if we don't have them already
2013-10-02 12:52:35 +0200 Sebastian Dröge <slomo@circular-chaos.org>
* ext/libav/gstavviddec.c:
avviddec: Reset some more fields in ::stop()
2013-10-02 12:51:40 +0200 Sebastian Dröge <slomo@circular-chaos.org>
* ext/libav/gstavviddec.c:
avviddec: Don't believe we're negotiated if negotiation failed
It can happen that negotiation fails during get_buffer(), but then
we don't retry later and never return NOT_NEGOTIATED upstream...
and instead run into assertions.
2013-10-02 12:45:44 +0200 Sebastian Dröge <slomo@circular-chaos.org>
* ext/libav/gstavauddec.c:
avauddec: Don't believe we're negotiated if negotiation failed
It can happen that negotiation fails during get_buffer(), but then
we don't retry later and never return NOT_NEGOTIATED upstream...
and instead run into assertions.
2013-10-01 22:38:32 +0200 Sebastian Dröge <slomo@circular-chaos.org>
* ext/libav/gstavcodecmap.c:
avenc: Choose 25 fps if we don't have any in the caps
Some encoders require a non-zero framerate to be configured properly
and just choosing something will make them not fail completely at
2013-10-03 15:25:30 +0100 Matthieu Bouron <matthieu.bouron@collabora.com>
* ext/libav/gstavcodecmap.c:
avcodecmap: Make avdec_mjpeg requires a parsed input
Actually avdec_mjpeg does not deal well with incomplete buffers and try
to decode incomplete frames. A parser which will also acts as
an accumulator needs to be inserted before it.
2013-09-23 15:19:51 +0200 Sebastian Dröge <slomo@circular-chaos.org>
* ext/libav/gstavcodecmap.c:
avcodecmap: Fix boolean expression to fix uninitialized usage of variables
2013-09-23 15:08:18 +0200 Sebastian Dröge <slomo@circular-chaos.org>
* configure.ac:
configure: Chose right target-os for iOS
2013-09-24 17:26:35 +0100 Tim-Philipp Müller <tim@centricular.net>
* common:
Automatic update of common submodule
From 6b03ba7 to 7412249
=== release 1.2.0 ===
2013-09-24 Sebastian Dröge <sebastian.droege@collabora.co.uk>
2013-09-24 14:42:30 +0200 Sebastian Dröge <slomo@circular-chaos.org>
* ChangeLog:
* configure.ac:
releasing 1.2.0
* gst-libav.doap:
Release 1.2.0
2013-09-20 16:18:03 +0200 Edward Hervey <edward@collabora.com>
This is GStreamer Libav Plugins 1.2.0
Changes since 1.0:
New API:
• GstContext negotiation / sharing / announcing for sharing a
generic context between elements, e.g. a display handle
• GL texture upload conversion meta for allowing different
buffer types to be converted to an OpenGL texture
• GstCapsFeatures as extension to GstCaps for allowing the
negotiation of specific memory or meta requirements between
• GstMemory flags for contiguous and non-mappable memory
• The stream-start event has optional flags now, e.g. for signalling
sparse streams
• The stream-start even has an optional group-id field now to signal
all streams that should be played together
• Allocators library in gst-plugins-base, currently only with generic
dmabuf memory support
• insertbin library for easier handling of dynamically linked
pipelines (in -bad for now)
• EGL helper library (in -bad for now)
• MPEG-TS data structure library (in -bad for now)
• New GstVideoRegionOfInterestMeta to describe a region of interest on
video frames.
• GstVideoDecoder/Encoder has new ::flush() vfunc to replace the
ill-defined ::reset() vfunc.
• The URI query allows to query the redirected URI now.
Major changes:
• New tool: gst-play-1.0 in gst-plugins-base for basic playback
testing on the command line.
• New plugins:
∘ mssdemux for Microsoft Smooth Streaming
∘ dashdemux for DASH adaptive streaming protocol
∘ bluez for interaction with Bluetooth devices
∘ openjpeg for JPEG2000 decoding and encoding
∘ daala for experimental Daala decoding and encoding
∘ vpx plugin has experimental VP9 decoding and encoding support
∘ webp plugin for WebP decoding (encoding to be added later)
∘ Various others: yadif, srtp, sbc, fluidsynth, midiparse,
mfc, ivtv, accuraterip and audiofxbad
• Moved plugins:
∘ dtmf, vp8rtp, scaletempo and rtpmux plugins are in
gst-plugins-good now
• Video:
∘ Fix handling of interlaced video in converters such as videoscale
and videoconvert (e.g. scale both fields independently)
∘ videoconvert will try harder to minimise quality losses when
conversion is necessary
∘ The experimental GstSurfaceConverter, GstSurfaceMeta and
GstVideoContext APIs from the (confusingly-named)
libgstbasevideo-1.0 library in gst-plugins-bad have now been
removed and been replaced by new APIs in GStreamer Core and
gst-plugins-base (see above). Since that was all that was left in
this library, the entire experimental libgstbasevideo-1.0 library
has been removed from gst-plugins-bad
∘ Chroma subsampling and chroma siting conversion is better handled
in videoconvert and the support for interlaced video was improved.
∘ New pinwheel and spoke patterns in videotestsrc
∘ videomixer can now accept different video formats on its sinkpads
and converts to a common format during mixing
• Audio:
∘ audioconvert will try harder to minimise quality losses when
conversion is necessary
∘ adder now allows muting/unmuting of its input streams, and also
per-input stream volume
∘ pulseaudio elements can switch between devices during playback now
∘ aacparse can convert between ADTS←→RAW
• Platform specific changes:
∘ Caps, events, etc. are now printed in the GStreamer debug logs
with their content instead of just the pointer address even on
non-glibc platforms (e.g. Windows, OSX, Android).
∘ Network elements (UDP/TCP) now work better with platforms,
where IPv6 sockets can't handle IPv4 (e.g. Windows)
∘ Linux/BSD: v4l2 had many improvements and cleanups
• Other changes:
∘ gst-libav now uses libav 9
∘ Static linking of plugins is supported now (also in 1.0.7)
∘ rtspsrc: add support for NetClientClock: when the server suggests a
GstNetTimeProvider in the SDP, set up a GstNetClientClock that
slaves to the remote clock and suggest this clock in provide_clock.
Simplifies synchronized playback of a resource from an RTSP server.
gst-rtsp-server now supports adding this to the SDP and can provide
a network clock
∘ RTP retransmission / NACK support and big RTP jitterbuffer improvements
∘ SRTP and DTLS support
∘ Changes to many elements and core to use the correct sticky event
order and also not lose any important sticky events during flushing
∘ >1000 fixed bug reports, and many other bug fixes and other
improvements everywhere that had no bug report
Things to look out for:
• Single header includes for all libraries, e.g. #include
<gst/video/video.h> - this was needed for some bindings.
• Stricter (correct) caps subset checking in some cases where this was
not correct before. Caps will now always fail to be a compatible
subset of another set of caps if the subset caps are missing some
fields that the superset caps have. This might lead to not-negotiated
errors if caps are incomplete now. However, it also prevents possible
data corruption caused by piping data formatted in an
incompatible/unexpected way into some elements. Check your h264 caps
for stream-format and alignment fields and AAC caps for the
stream-format field. This change will also be included in the next
stable 1.0.8 release.
• Stricter checking for missing events and correct sticky event order
(stream-start, caps, segment) in some places; this is not enabled in
stable releases by default, but you may get warnings when using git
builds, development releases or when compiling with
• x264enc now outputs data in byte-stream by default if downstream has
ANY caps (e.g. appsink without caps set, filesink, udpsink,
tcpserversink etc.)
• The MPEG TS demuxer posts messages contain the PMT, PAT, etc. in a
different format now. This new format uses the data structures from
the new MPEGTS library
• The GstContext API has changed between 1.1.4 and 1.1.90
This is GStreamer Libav Plugins 1.2.4
Release notes for GStreamer libav Plugins 1.2.0
Release notes for GStreamer libav Plugins 1.2.4
The GStreamer team is proud to announce a new feature release
The GStreamer team is proud to announce a new bug-fix release
in the 1.x stable series of the
core of the GStreamer streaming media framework.
......@@ -36,8 +36,9 @@ contains a set of less supported plugins that haven't passed the
There were no bugs fixed in this release
Bugs fixed in this release
* 727779 : avdec_h264, matroskademux: crash while seeking (1.2 regression)
==== Download ====
......@@ -74,7 +75,6 @@ subscribe to the gstreamer-devel list.
Contributors to this release
* Edward Hervey
* Sebastian Dröge
* Mark Nauwelaerts
* Tim-Philipp Müller
\ No newline at end of file
common @ 74122499
Subproject commit 6b03ba716b9861277a435677ad9e31b3e14284e9
Subproject commit 7412249950b9fb00f78feb26277f84233fa4e4b4
......@@ -3,7 +3,7 @@ AC_PREREQ(2.62)
dnl initialize autoconf
dnl when going to/from release please set the nano (fourth number) right !
dnl releases only do Wall, cvs and prerelease does Werror too
AC_INIT(GStreamer libav, 1.2.0,
AC_INIT(GStreamer libav, 1.2.4,
......@@ -42,11 +42,11 @@ GST_API_VERSION=1.0
AS_LIBTOOL(GST, 200, 0, 200)
AS_LIBTOOL(GST, 204, 0, 204)
dnl *** required versions of GStreamer stuff ***
......@@ -257,39 +257,7 @@ if test "x$with_system_libav" = "xyes"; then
AC_DEFINE([LIBAV_SOURCE], ["system install"], [Describes where the Libav libraries come from.])
AC_MSG_NOTICE([Using system-installed libav code])
WARNING: you have chosen to build gst-libav against a random
external version of Libav instead of building it against the tested
internal Libav snapshot that is included with gst-libav.
This is a very bad idea. So bad in fact that words cannot express
just how bad it is. Suffice to say that it is BAD.
The GStreamer developers cannot and will not support a gst-libav
built this way. Any bug reports that indicate there is an external
version of Libav involved will be closed immediately without further
The reason such a setup can't be supported is that the Libav API
and ABI is in constant flux, yet there aren't any official releases
of the Libav library to develop against. This makes it impossible
to guarantee that gst-libav will work reliably, or even compile,
with a randomly picked version Libav. Even if gst-libav compiles
and superficially appears to work fine against your chosen external
Libav version, that might just not be the case on other systems, or
even the same system at a later time, or when using decoders,
encoders, demuxers or muxers that have not been tested.
Please do not create or distribute binary packages of gst-Libav
that link against an external libav. Thank you!
dnl No, this is not too extreme, we want people to see and read the above
sleep 15
AC_MSG_NOTICE([Using local Libav snapshot])
dnl libgstlibav.la: include dirs
......@@ -355,6 +323,9 @@ else
target_os=`echo $host_os | sed 's/-gnu//'`
......@@ -150,9 +150,11 @@ gst_ffmpegauddec_finalize (GObject * object)
GstFFMpegAudDec *ffmpegdec = (GstFFMpegAudDec *) object;
if (ffmpegdec->context != NULL)
if (ffmpegdec->context != NULL) {
gst_ffmpeg_avcodec_close (ffmpegdec->context);
av_free (ffmpegdec->context);
ffmpegdec->context = NULL;
ffmpegdec->context = NULL;
G_OBJECT_CLASS (parent_class)->finalize (object);
......@@ -199,6 +201,7 @@ gst_ffmpegauddec_start (GstAudioDecoder * decoder)
oclass = (GstFFMpegAudDecClass *) (G_OBJECT_GET_CLASS (ffmpegdec));
GST_OBJECT_LOCK (ffmpegdec);
gst_ffmpeg_avcodec_close (ffmpegdec->context);
if (avcodec_get_context_defaults3 (ffmpegdec->context, oclass->in_plugin) < 0) {
GST_DEBUG_OBJECT (ffmpegdec, "Failed to set context defaults");
GST_OBJECT_UNLOCK (ffmpegdec);
......@@ -441,6 +444,7 @@ caps_failed:
("Could not set caps for libav decoder (%s), not fixed?",
memset (&ffmpegdec->info, 0, sizeof (ffmpegdec->info));
return FALSE;
......@@ -52,6 +52,7 @@ enum
/* A number of function prototypes are given so we can refer to them later. */
......@@ -151,6 +152,11 @@ gst_ffmpegaudenc_class_init (GstFFMpegAudEncClass * klass)
g_param_spec_int ("bitrate", "Bit Rate",
"Target Audio Bitrate", 0, G_MAXINT, DEFAULT_AUDIO_BITRATE,
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_COMPLIANCE,
g_param_spec_enum ("compliance", "Compliance",
"Adherence of the encoder to the specifications",
gobject_class->finalize = gst_ffmpegaudenc_finalize;
......@@ -174,6 +180,8 @@ gst_ffmpegaudenc_init (GstFFMpegAudEnc * ffmpegaudenc)
ffmpegaudenc->context = avcodec_alloc_context3 (klass->in_plugin);
ffmpegaudenc->opened = FALSE;
ffmpegaudenc->compliance = FFMPEG_DEFAULT_COMPLIANCE;
gst_audio_encoder_set_drainable (GST_AUDIO_ENCODER (ffmpegaudenc), TRUE);
......@@ -183,6 +191,7 @@ gst_ffmpegaudenc_finalize (GObject * object)
GstFFMpegAudEnc *ffmpegaudenc = (GstFFMpegAudEnc *) object;
/* clean up remaining allocated data */
gst_ffmpeg_avcodec_close (ffmpegaudenc->context);
av_free (ffmpegaudenc->context);
G_OBJECT_CLASS (parent_class)->finalize (object);
......@@ -195,6 +204,7 @@ gst_ffmpegaudenc_start (GstAudioEncoder * encoder)
GstFFMpegAudEncClass *oclass =
(GstFFMpegAudEncClass *) G_OBJECT_GET_CLASS (ffmpegaudenc);
gst_ffmpeg_avcodec_close (ffmpegaudenc->context);
if (avcodec_get_context_defaults3 (ffmpegaudenc->context,
oclass->in_plugin) < 0) {
GST_DEBUG_OBJECT (ffmpegaudenc, "Failed to set context defaults");
......@@ -265,7 +275,7 @@ gst_ffmpegaudenc_set_format (GstAudioEncoder * encoder, GstAudioInfo * info)
/* if we set it in _getcaps we should set it also in _link */
ffmpegaudenc->context->strict_std_compliance = -1;
ffmpegaudenc->context->strict_std_compliance = ffmpegaudenc->compliance;
/* user defined properties */
if (ffmpegaudenc->bitrate > 0) {
......@@ -316,6 +326,16 @@ gst_ffmpegaudenc_set_format (GstAudioEncoder * encoder, GstAudioInfo * info)
if (avcodec_get_context_defaults3 (ffmpegaudenc->context,
oclass->in_plugin) < 0)
GST_DEBUG_OBJECT (ffmpegaudenc, "Failed to set context defaults");
if ((oclass->in_plugin->capabilities & CODEC_CAP_EXPERIMENTAL) &&
ffmpegaudenc->compliance != GST_FFMPEG_EXPERIMENTAL) {
("Codec is experimental, but settings don't allow encoders to "
"produce output of experimental quality"),
("This codec may not create output that is conformant to the specs "
"or of good quality. If you must use it anyway, set the "
"compliance property to experimental"));
return FALSE;
......@@ -641,6 +661,9 @@ gst_ffmpegaudenc_set_property (GObject * object,
ffmpegaudenc->rtp_payload_size = g_value_get_int (value);
ffmpegaudenc->compliance = g_value_get_enum (value);
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
......@@ -665,6 +688,9 @@ gst_ffmpegaudenc_get_property (GObject * object,
g_value_set_int (value, ffmpegaudenc->rtp_payload_size);
g_value_set_enum (value, ffmpegaudenc->compliance);
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
......@@ -42,6 +42,7 @@ struct _GstFFMpegAudEnc
/* cache */
gint bitrate;
gint rtp_payload_size;
gint compliance;
/* other settings are copied over straight,
* include a context here, rather than copy-and-past it from avcodec.h */
......@@ -839,8 +839,10 @@ gst_ffmpeg_cfg_install_property (GstFFMpegVidEncClass * klass, guint base)
if (ctx)
if (ctx) {
gst_ffmpeg_avcodec_close (ctx);
av_free (ctx);
/* returns TRUE if it is a known property for this config system,
......@@ -66,6 +66,28 @@ static const struct
gst_ffmpeg_compliance_get_type (void)
static GType ffmpeg_compliance_type = 0;
static const GEnumValue compliance_types[] = {
{GST_FFMPEG_VERY_STRICT, "Strictly conform to older spec",
{GST_FFMPEG_STRICT, "Strictly conform to current spec", "strict"},
{GST_FFMPEG_NORMAL, "Normal behavior", "normal"},
{GST_FFMPEG_UNOFFICIAL, "Allow unofficial extensions", "unofficial"},
{GST_FFMPEG_EXPERIMENTAL, "Allow nonstandardized experimental things",
if (!ffmpeg_compliance_type) {
ffmpeg_compliance_type =
g_enum_register_static ("GstFFMpegCompliance", compliance_types);
return ffmpeg_compliance_type;
static guint64
gst_ffmpeg_channel_positions_to_layout (GstAudioChannelPosition * pos,
gint channels)
......@@ -159,6 +181,22 @@ gst_ffmpeg_channel_layout_to_gst (guint64 channel_layout, gint channels,
return TRUE;
static gboolean
_gst_value_list_contains (const GValue * list, const GValue * value)
guint i, n;
const GValue *tmp;
n = gst_value_list_get_size (list);
for (i = 0; i < n; i++) {
tmp = gst_value_list_get_value (list, i);
if (gst_value_compare (value, tmp) == GST_VALUE_EQUAL)
return TRUE;
return FALSE;
static void
gst_ffmpeg_video_set_pix_fmts (GstCaps * caps, const enum AVPixelFormat *fmts)
......@@ -191,7 +229,9 @@ gst_ffmpeg_video_set_pix_fmts (GstCaps * caps, const enum AVPixelFormat *fmts)
format = gst_ffmpeg_pixfmt_to_videoformat (*fmts);
g_value_set_string (&v, gst_video_format_to_string (format));
gst_value_list_append_value (&va, &v);
/* Only append values we don't have yet */
if (!_gst_value_list_contains (&va, &v))
gst_value_list_append_value (&va, &v);
......@@ -452,7 +492,9 @@ gst_ffmpeg_audio_set_sample_fmts (GstCaps * caps,
format = gst_ffmpeg_smpfmt_to_audioformat (*fmts);
g_value_set_string (&v, gst_audio_format_to_string (format));
gst_value_list_append_value (&va, &v);
/* Only append values we don't have yet */
if (!_gst_value_list_contains (&va, &v))
gst_value_list_append_value (&va, &v);
......@@ -480,20 +522,18 @@ gst_ff_aud_caps_new (AVCodecContext * context, AVCodec * codec,
/* fixed, non-probing context */
if (context != NULL && context->channels != -1) {
GstAudioChannelPosition pos[64];
guint64 mask;
caps = gst_caps_new_simple (mimetype,
"rate", G_TYPE_INT, context->sample_rate,
"channels", G_TYPE_INT, context->channels, NULL);
if (gst_ffmpeg_channel_layout_to_gst (context->channel_layout,
context->channels, pos)) {
guint64 mask;
if (gst_audio_channel_positions_to_mask (pos, context->channels, FALSE,
&mask)) {
gst_caps_set_simple (caps, "channel-mask", GST_TYPE_BITMASK, mask,
if (context->channels > 1 &&
gst_ffmpeg_channel_layout_to_gst (context->channel_layout,
context->channels, pos) &&
gst_audio_channel_positions_to_mask (pos, context->channels, FALSE,
&mask)) {
gst_caps_set_simple (caps, "channel-mask", GST_TYPE_BITMASK, mask, NULL);
} else if (encode) {
gint maxchannels = 2;
......@@ -913,7 +953,7 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id,
caps =
gst_ff_vid_caps_new (context, NULL, codec_id, encode, "image/jpeg",
......@@ -1398,7 +1438,22 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id,
caps =
gst_ff_vid_caps_new (context, NULL, codec_id, encode, "video/x-wmv",
"wmvversion", G_TYPE_INT, 3, "format", G_TYPE_STRING, "WVC1", NULL);
"wmvversion", G_TYPE_INT, 3, NULL);
if (!context && !encode) {
GValue arr = { 0, };
GValue item = { 0, };
g_value_init (&arr, GST_TYPE_LIST);
g_value_init (&item, G_TYPE_STRING);
g_value_set_string (&item, "WVC1");
gst_value_list_append_value (&arr, &item);
g_value_set_string (&item, "WMVA");
gst_value_list_append_and_take_value (&arr, &item);
gst_caps_set_value (caps, "format", &arr);
g_value_unset (&arr);
} else {
gst_caps_set_simple (caps, "format", G_TYPE_STRING, "WVC1", NULL);
caps =
......@@ -2511,8 +2566,14 @@ gst_ffmpeg_videoinfo_to_context (GstVideoInfo * info, AVCodecContext * context)
context->bits_per_coded_sample = bpp;
context->ticks_per_frame = 1;
context->time_base.den = GST_VIDEO_INFO_FPS_N (info);
context->time_base.num = GST_VIDEO_INFO_FPS_D (info);
if (GST_VIDEO_INFO_FPS_N (info) == 0) {
GST_DEBUG ("Using 25/1 framerate");
context->time_base.den = 25;
context->time_base.num = 1;
} else {
context->time_base.den = GST_VIDEO_INFO_FPS_N (info);
context->time_base.num = GST_VIDEO_INFO_FPS_D (info);
context->sample_aspect_ratio.num = GST_VIDEO_INFO_PAR_N (info);
context->sample_aspect_ratio.den = GST_VIDEO_INFO_PAR_D (info);
......@@ -2850,9 +2911,9 @@ gst_ffmpeg_caps_with_codecid (enum CodecID codec_id,
gint halfpel_flag, thirdpel_flag, low_delay, unknown_svq3_flag;
guint16 flags;
if (gst_structure_get_int (str, "halfpel_flag", &halfpel_flag) ||
gst_structure_get_int (str, "thirdpel_flag", &thirdpel_flag) ||
gst_structure_get_int (str, "low_delay", &low_delay) ||
if (gst_structure_get_int (str, "halfpel_flag", &halfpel_flag) &&
gst_structure_get_int (str, "thirdpel_flag", &thirdpel_flag) &&
gst_structure_get_int (str, "low_delay", &low_delay) &&
gst_structure_get_int (str, "unknown_svq3_flag",
&unknown_svq3_flag)) {
context->extradata = (guint8 *) av_mallocz (0x64);
......@@ -25,6 +25,48 @@
#include <gst/audio/audio.h>
#include <gst/video/video.h>
* GstFFMpegCompliance:
* @GST_FFMPEG_VERY_STRICT: Strictly conform to an older
* more strict version of the spec or reference software
* @GST_FFMPEG_STRICT: Strictly conform to all the things
* in the spec no matter what consequences.
* @GST_FFMPEG_UNOFFICIAL: Allow unofficial extensions
* @GST_FFMPEG_EXPERIMENTAL: Allow nonstandardized
* experimental things.
* This setting instructs libav on how strictly it should follow the
* associated standard.
* From avcodec.h:
* Setting this to STRICT or higher means the encoder and decoder will
* generally do stupid things, whereas setting it to unofficial or lower
* will mean the encoder might produce output that is not supported by all
* spec-compliant decoders. Decoders don't differentiate between normal,
* unofficial and experimental (that is, they always try to decode things
* when they can) unless they are explicitly asked to behave stupidly
* (=strictly conform to the specs)
typedef enum {
} GstFFMpegCompliance;
* _compliance_get_type () Returns an enum type that can be
* used as a property to indicate desired FFMpeg adherence to
* an associated specification
gst_ffmpeg_compliance_get_type (void);
#define GST_TYPE_FFMPEG_COMPLIANCE (gst_ffmpeg_compliance_get_type ())
* _codecid_to_caps () gets the GstCaps that belongs to
* a certain CodecID for a pad with compressed data.
......@@ -209,6 +209,7 @@ gst_ffmpegdeinterlace_sink_setcaps (GstPad * pad, GstCaps * caps)
ctx->pix_fmt = PIX_FMT_NB;
gst_ffmpeg_caps_with_codectype (AVMEDIA_TYPE_VIDEO, caps, ctx);
if (ctx->pix_fmt == PIX_FMT_NB) {
gst_ffmpeg_avcodec_close (ctx);
av_free (ctx);
return FALSE;
......@@ -254,6 +254,10 @@ gst_ffmpegmux_base_init (gpointer g_class)
const gint rates[] = { 44100, 22050, 11025 };
gst_ffmpeg_mux_simple_caps_set_int_list (audiosinkcaps, "rate", 3, rates);
} else if (strcmp (in_plugin->name, "dv") == 0) {
gst_caps_set_simple (audiosinkcaps,
"rate", G_TYPE_INT, 48000, "channels", G_TYPE_INT, 2, NULL);
} else if (strcmp (in_plugin->name, "gif") == 0) {
if (videosinkcaps)
gst_caps_unref (videosinkcaps);
......@@ -474,7 +478,7 @@ gst_ffmpegmux_setcaps (GstPad * pad, GstCaps * caps)
collect_pad = (GstFFMpegMuxPad *) gst_pad_get_element_private (pad);
st = ffmpegmux->context->streams[collect_pad->padnum];
av_opt_set_int (&ffmpegmux->context, "preload", ffmpegmux->preload, 0);
av_opt_set_int (ffmpegmux->context, "preload", ffmpegmux->preload, 0);
ffmpegmux->context->max_delay = ffmpegmux->max_delay;
/* for the format-specific guesses, we'll go to
This diff is collapsed.
......@@ -67,6 +67,8 @@ struct _GstFFMpegVidDec
gboolean is_realvideo;
GstCaps *last_caps;
GSList *opaques;
typedef struct _GstFFMpegVidDecClass GstFFMpegVidDecClass;
......@@ -62,7 +62,8 @@ enum
#define GST_TYPE_ME_METHOD (gst_ffmpegvidenc_me_method_get_type())
......@@ -206,6 +207,12 @@ gst_ffmpegvidenc_class_init (GstFFMpegVidEncClass * klass)
"RTP Payload Size", "Target GOB length", 0, G_MAXINT, 0,
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_COMPLIANCE,
g_param_spec_enum ("compliance", "Compliance",
"Adherence of the encoder to the specifications",
/* register additional properties, possibly dependent on the exact CODEC */
gst_ffmpeg_cfg_install_property (klass, PROP_CFG_BASE);
......@@ -239,6 +246,7 @@ gst_ffmpegvidenc_init (GstFFMpegVidEnc * ffmpegenc)
ffmpegenc->buffer_size = 512 * 1024;
ffmpegenc->gop_size = DEFAULT_VIDEO_GOP_SIZE;
ffmpegenc->rtp_payload_size = 0;
ffmpegenc->compliance = FFMPEG_DEFAULT_COMPLIANCE;
ffmpegenc->lmin = 2;
ffmpegenc->lmax = 31;
......@@ -255,6 +263,7 @@ gst_ffmpegvidenc_finalize (GObject * object)
gst_ffmpeg_cfg_finalize (ffmpegenc);
/* clean up remaining allocated data */
gst_ffmpeg_avcodec_close (ffmpegenc->context);
av_free (ffmpegenc->context);
avcodec_free_frame (&ffmpegenc->picture);
......@@ -301,7 +310,7 @@ gst_ffmpegvidenc_set_format (GstVideoEncoder * encoder,
/* if we set it in _getcaps we should set it also in _link */
ffmpegenc->context->strict_std_compliance = -1;
ffmpegenc->context->strict_std_compliance = ffmpegenc->compliance;
/* user defined properties */
ffmpegenc->context->bit_rate = ffmpegenc->bitrate;
......@@ -761,6 +770,9 @@ gst_ffmpegvidenc_set_property (GObject * object,
ffmpegenc->rtp_payload_size = g_value_get_int (value);
ffmpegenc->compliance = g_value_get_enum (value);
if (!gst_ffmpeg_cfg_set_property (object, value, pspec))
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
......@@ -794,6 +806,9 @@ gst_ffmpegvidenc_get_property (GObject * object,
g_value_set_int (value, ffmpegenc->rtp_payload_size);
g_value_set_enum (value, ffmpegenc->compliance);
if (!gst_ffmpeg_cfg_get_property (object, value, pspec))
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
......@@ -820,6 +835,7 @@ gst_ffmpegvidenc_start (GstVideoEncoder * encoder)
(GstFFMpegVidEncClass *) G_OBJECT_GET_CLASS (ffmpegenc);
/* close old session */
gst_ffmpeg_avcodec_close (ffmpegenc->context);
if (avcodec_get_context_defaults3 (ffmpegenc->context, oclass->in_plugin) < 0) {
GST_DEBUG_OBJECT (ffmpegenc, "Failed to set context defaults");
return FALSE;
......@@ -845,6 +861,10 @@ gst_ffmpegvidenc_stop (GstVideoEncoder * encoder)
g_free (ffmpegenc->working_buf);
ffmpegenc->working_buf = NULL;
if (ffmpegenc->input_state) {
gst_video_codec_state_unref (ffmpegenc->input_state);
ffmpegenc->input_state = NULL;
return TRUE;
......@@ -49,6 +49,7 @@ struct _GstFFMpegVidEnc
gint gop_size;
gint buffer_size;
gint rtp_payload_size;
gint compliance;
guint8 *working_buf;
gsize working_buf_size;
......@@ -32,6 +32,46 @@ colorspace conversion elements.
<file-release rdf:resource="http://gstreamer.freedesktop.org/src/gst-libav/gst-libav-1.2.4.tar.xz" />
<file-release rdf:resource="http://gstreamer.freedesktop.org/src/gst-libav/gst-libav-1.2.3.tar.xz" />
<file-release rdf:resource="http://gstreamer.freedesktop.org/src/gst-libav/gst-libav-1.2.2.tar.xz" />
<file-release rdf:resource="http://gstreamer.freedesktop.org/src/gst-libav/gst-libav-1.2.1.tar.xz" />
libav @ 3ecbd911
Subproject commit 4d073ddac95d789f23c3ee6f7b5348599b39f047
Subproject commit 3ecbd911ff9177097820e5d00401c9bf29e5d167