[Pkg-gstreamer-commits] [gst-libav1.0] 01/03: Imported Upstream version 1.4.2
Sebastian Dröge
slomo at moszumanska.debian.org
Fri Sep 19 12:19:10 UTC 2014
This is an automated email from the git hooks/post-receive script.
slomo pushed a commit to branch master
in repository gst-libav1.0.
commit 610d75e4da9625badcd7b779f8cd6bed1f1ca6a9
Author: Sebastian Dröge <sebastian at centricular.com>
Date: Fri Sep 19 14:48:43 2014 +0300
Imported Upstream version 1.4.2
---
ChangeLog | 39 ++++++++++++-
Makefile.in | 4 +-
NEWS | 2 +-
configure | 34 +++++------
configure.ac | 4 +-
.../html/gst-libav-plugins-plugin-libav.html | 2 +-
docs/plugins/html/index.html | 2 +-
docs/plugins/inspect/plugin-libav.xml | 2 +-
ext/libav/gstavviddec.c | 7 +--
gst-libav.doap | 10 ++++
gst-libav.spec | 2 +-
gst-libs/ext/libav/Changelog | 14 +++++
gst-libs/ext/libav/LICENSE | 1 +
gst-libs/ext/libav/RELEASE | 2 +-
gst-libs/ext/libav/avconv_opt.c | 8 ++-
gst-libs/ext/libav/doc/avconv.texi | 6 +-
gst-libs/ext/libav/libavcodec/mpegvideo_enc.c | 4 +-
gst-libs/ext/libav/libavcodec/proresenc.c | 68 ++++++++++++++++++----
gst-libs/ext/libav/libavdevice/pulse.c | 5 ++
gst-libs/ext/libav/libavfilter/setpts.c | 17 +++---
gst-libs/ext/libav/libavformat/mpegenc.c | 2 +-
21 files changed, 175 insertions(+), 60 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 4fdb8d3..96179e7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,9 +1,44 @@
+=== release 1.4.2 ===
+
+2014-09-19 Sebastian Dröge <slomo at coaxion.net>
+
+ * configure.ac:
+ releasing 1.4.2
+
+2014-09-11 19:37:33 -0400 IBM Thinklab <oblong at wall-center.(none)>
+
+ * ext/libav/gstavviddec.c:
+ avviddec: drain frames until libav doesn't have more data
+ We use have_data (that comes from libav), instead of only trying 10 times,
+ to know if there are more frames available. The old code was machine
+ dependant as different amount of frames could be decoded by different
+ type of (more powerful) machines, and 10 times was not always sufficient.
+ https://bugzilla.gnome.org/show_bug.cgi?id=736515
+
+2014-08-08 20:04:20 +1000 Jan Schmidt <jan at centricular.com>
+
+ * ext/libav/gstavviddec.c:
+ avviddec: After draining frames, flush the libav decoder
+ Makes sure that there's really nothing stale left in the decoder
+ after draining.
+ https://bugzilla.gnome.org/show_bug.cgi?id=734661
+
+2014-09-12 16:27:50 +0300 Sebastian Dröge <sebastian at centricular.com>
+
+ * gst-libs/ext/libav:
+ libav: Update to v10.5
+
=== release 1.4.1 ===
-2014-08-27 Sebastian Dröge <slomo at coaxion.net>
+2014-08-27 15:05:00 +0300 Sebastian Dröge <sebastian at centricular.com>
+ * ChangeLog:
+ * NEWS:
+ * RELEASE:
* configure.ac:
- releasing 1.4.1
+ * docs/plugins/inspect/plugin-libav.xml:
+ * gst-libav.doap:
+ Release 1.4.1
2014-08-27 12:38:35 +0300 Sebastian Dröge <sebastian at centricular.com>
diff --git a/Makefile.in b/Makefile.in
index 63e110c..3aebc2c 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -95,8 +95,8 @@ DIST_COMMON = $(top_srcdir)/common/win32.mak \
ChangeLog $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
$(top_srcdir)/configure $(am__configure_deps) \
$(srcdir)/config.h.in $(srcdir)/gst-libav.spec.in COPYING \
- COPYING.LIB TODO compile config.guess config.sub install-sh \
- missing ltmain.sh
+ COPYING.LIB TODO compile config.guess config.sub depcomp \
+ install-sh missing ltmain.sh
subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/common/m4/as-ac-expand.m4 \
diff --git a/NEWS b/NEWS
index b999404..d8d1a36 100644
--- a/NEWS
+++ b/NEWS
@@ -1,2 +1,2 @@
-This is GStreamer Libav Plugins 1.4.1
+This is GStreamer Libav Plugins 1.4.2
diff --git a/configure b/configure
index 89daaf4..3f72e19 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for GStreamer libav 1.4.1.
+# Generated by GNU Autoconf 2.69 for GStreamer libav 1.4.2.
#
# Report bugs to <http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer>.
#
@@ -591,8 +591,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='GStreamer libav'
PACKAGE_TARNAME='gst-libav'
-PACKAGE_VERSION='1.4.1'
-PACKAGE_STRING='GStreamer libav 1.4.1'
+PACKAGE_VERSION='1.4.2'
+PACKAGE_STRING='GStreamer libav 1.4.2'
PACKAGE_BUGREPORT='http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer'
PACKAGE_URL=''
@@ -1495,7 +1495,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures GStreamer libav 1.4.1 to adapt to many kinds of systems.
+\`configure' configures GStreamer libav 1.4.2 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1566,7 +1566,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of GStreamer libav 1.4.1:";;
+ short | recursive ) echo "Configuration of GStreamer libav 1.4.2:";;
esac
cat <<\_ACEOF
@@ -1734,7 +1734,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-GStreamer libav configure 1.4.1
+GStreamer libav configure 1.4.2
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2149,7 +2149,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by GStreamer libav $as_me 1.4.1, which was
+It was created by GStreamer libav $as_me 1.4.2, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -3127,7 +3127,7 @@ fi
# Define the identity of the package.
PACKAGE='gst-libav'
- VERSION='1.4.1'
+ VERSION='1.4.2'
cat >>confdefs.h <<_ACEOF
@@ -3338,9 +3338,9 @@ fi
- PACKAGE_VERSION_MAJOR=$(echo 1.4.1 | cut -d'.' -f1)
- PACKAGE_VERSION_MINOR=$(echo 1.4.1 | cut -d'.' -f2)
- PACKAGE_VERSION_MICRO=$(echo 1.4.1 | cut -d'.' -f3)
+ PACKAGE_VERSION_MAJOR=$(echo 1.4.2 | cut -d'.' -f1)
+ PACKAGE_VERSION_MINOR=$(echo 1.4.2 | cut -d'.' -f2)
+ PACKAGE_VERSION_MICRO=$(echo 1.4.2 | cut -d'.' -f3)
@@ -3351,7 +3351,7 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking nano version" >&5
$as_echo_n "checking nano version... " >&6; }
- NANO=$(echo 1.4.1 | cut -d'.' -f4)
+ NANO=$(echo 1.4.2 | cut -d'.' -f4)
if test x"$NANO" = x || test "x$NANO" = "x0" ; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: 0 (release)" >&5
@@ -8003,10 +8003,10 @@ fi
done
- GST_CURRENT=401
+ GST_CURRENT=402
GST_REVISION=0
- GST_AGE=401
- GST_LIBVERSION=401:0:401
+ GST_AGE=402
+ GST_LIBVERSION=402:0:402
@@ -17461,7 +17461,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by GStreamer libav $as_me 1.4.1, which was
+This file was extended by GStreamer libav $as_me 1.4.2, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -17527,7 +17527,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-GStreamer libav config.status 1.4.1
+GStreamer libav config.status 1.4.2
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
diff --git a/configure.ac b/configure.ac
index de73639..d3b6413 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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.4.1,
+AC_INIT(GStreamer libav, 1.4.2,
http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer,
gst-libav)
@@ -42,7 +42,7 @@ GST_API_VERSION=1.0
AC_SUBST(GST_API_VERSION)
AG_GST_LIBTOOL_PREPARE
-AS_LIBTOOL(GST, 401, 0, 401)
+AS_LIBTOOL(GST, 402, 0, 402)
dnl *** required versions of GStreamer stuff ***
GST_REQ=1.4.0
diff --git a/docs/plugins/html/gst-libav-plugins-plugin-libav.html b/docs/plugins/html/gst-libav-plugins-plugin-libav.html
index eea2240..867c31c 100644
--- a/docs/plugins/html/gst-libav-plugins-plugin-libav.html
+++ b/docs/plugins/html/gst-libav-plugins-plugin-libav.html
@@ -42,7 +42,7 @@
</tr>
<tr>
<td><p><span class="term">version</span></p></td>
-<td>1.4.1</td>
+<td>1.4.2</td>
</tr>
<tr>
<td><p><span class="term">run-time license</span></p></td>
diff --git a/docs/plugins/html/index.html b/docs/plugins/html/index.html
index 7b5474e..df33208 100644
--- a/docs/plugins/html/index.html
+++ b/docs/plugins/html/index.html
@@ -15,7 +15,7 @@
<div>
<div><table class="navigation" id="top" width="100%" cellpadding="2" cellspacing="0"><tr><th valign="middle"><p class="title">GStreamer libav 1.0 Plugins Reference Manual</p></th></tr></table></div>
<div><p class="releaseinfo">
- for GStreamer libav Plugins 1.0 (1.4.1)
+ for GStreamer libav Plugins 1.0 (1.4.2)
The latest version of this documentation can be found on-line at
<a class="ulink" href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-ffmpeg-plugins/html/" target="_top">http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-ffmpeg-plugins/html/</a>.
</p></div>
diff --git a/docs/plugins/inspect/plugin-libav.xml b/docs/plugins/inspect/plugin-libav.xml
index 3e3dc8e..7bb99f8 100644
--- a/docs/plugins/inspect/plugin-libav.xml
+++ b/docs/plugins/inspect/plugin-libav.xml
@@ -3,7 +3,7 @@
<description>All libav codecs and formats (local snapshot)</description>
<filename>../../ext/libav/.libs/libgstlibav.so</filename>
<basename>libgstlibav.so</basename>
- <version>1.4.1</version>
+ <version>1.4.2</version>
<license>GPL</license>
<source>gst-libav</source>
<package>libav</package>
diff --git a/ext/libav/gstavviddec.c b/ext/libav/gstavviddec.c
index 3db0be1..a9645f2 100644
--- a/ext/libav/gstavviddec.c
+++ b/ext/libav/gstavviddec.c
@@ -1438,7 +1438,7 @@ gst_ffmpegviddec_drain (GstFFMpegVidDec * ffmpegdec)
oclass = (GstFFMpegVidDecClass *) (G_OBJECT_GET_CLASS (ffmpegdec));
if (oclass->in_plugin->capabilities & CODEC_CAP_DELAY) {
- gint have_data, len, try = 0;
+ gint have_data, len;
GST_LOG_OBJECT (ffmpegdec,
"codec has delay capabilities, calling until ffmpeg has drained everything");
@@ -1448,9 +1448,8 @@ gst_ffmpegviddec_drain (GstFFMpegVidDec * ffmpegdec)
len = gst_ffmpegviddec_frame (ffmpegdec, NULL, 0, &have_data, NULL, &ret);
- if (len < 0 || have_data == 0)
- break;
- } while (try++ < 10);
+ } while (len >= 0 && have_data == 1);
+ avcodec_flush_buffers (ffmpegdec->context);
}
}
diff --git a/gst-libav.doap b/gst-libav.doap
index b9c8f3d..61ea77c 100644
--- a/gst-libav.doap
+++ b/gst-libav.doap
@@ -34,6 +34,16 @@ colorspace conversion elements.
<release>
<Version>
+ <revision>1.4.2</revision>
+ <branch>1.4</branch>
+ <name></name>
+ <created>2014-09-19</created>
+ <file-release rdf:resource="http://gstreamer.freedesktop.org/src/gst-libav/gst-libav-1.4.2.tar.xz" />
+ </Version>
+ </release>
+
+ <release>
+ <Version>
<revision>1.4.1</revision>
<branch>1.4</branch>
<name></name>
diff --git a/gst-libav.spec b/gst-libav.spec
index 77a7521..f27905e 100644
--- a/gst-libav.spec
+++ b/gst-libav.spec
@@ -4,7 +4,7 @@
%define gst_majorminor 1.0
Name: %{gstreamer}-libav
-Version: 1.4.1
+Version: 1.4.2
Release: 1
Summary: GStreamer Streaming-media framework plug-in using libav (FFmpeg).
Group: Libraries/Multimedia
diff --git a/gst-libs/ext/libav/Changelog b/gst-libs/ext/libav/Changelog
index ed1292b..7ab3964 100644
--- a/gst-libs/ext/libav/Changelog
+++ b/gst-libs/ext/libav/Changelog
@@ -1,6 +1,20 @@
Entries are sorted chronologically from oldest to youngest within each release,
releases are sorted from youngest to oldest.
+version 10.5:
+- proresenc: Remove unneeded parameters from encode_alpha_plane()
+- proresenc: Report buffer overflow
+- proresenc: Realloc if buffer is too small
+- proresenc: Properly account for alpha plane
+- setpts: Add missing inttypes.h #include for PRId64
+- mpegvideo: Use the current_picture pts
+- mpegenc: limit the maximum muxrate
+- avconv: fix the muxrate values for -target
+- avconv: fix parsing the AVOptions for -target
+- pulse: Add a wallclock option to be compatible with other other captures
+- license: Mention that vf_interlace is GPL, not LGPL
+- doc: Fix syntax and logical errors in avconv stream combination example
+
version 10.4:
- mpegts: Do not try to write a PMT larger than SECTION_SIZE (CVE-2014-2263)
- mpegts: Define the section length with a constant
diff --git a/gst-libs/ext/libav/LICENSE b/gst-libs/ext/libav/LICENSE
index 20d82c3..05521a4 100644
--- a/gst-libs/ext/libav/LICENSE
+++ b/gst-libs/ext/libav/LICENSE
@@ -21,6 +21,7 @@ Specifically, the GPL parts of Libav are
- vf_cropdetect.c
- vf_delogo.c
- vf_hqdn3d.c
+ - vf_interlace.c
Should you, for whatever reason, prefer to use version 3 of the (L)GPL, then
the configure parameter --enable-version3 will activate this licensing option
diff --git a/gst-libs/ext/libav/RELEASE b/gst-libs/ext/libav/RELEASE
index 1be519c..9a62de2 100644
--- a/gst-libs/ext/libav/RELEASE
+++ b/gst-libs/ext/libav/RELEASE
@@ -1 +1 @@
-10.4
+10.5
diff --git a/gst-libs/ext/libav/avconv_opt.c b/gst-libs/ext/libav/avconv_opt.c
index 73d283a..8ffdde9 100644
--- a/gst-libs/ext/libav/avconv_opt.c
+++ b/gst-libs/ext/libav/avconv_opt.c
@@ -1772,7 +1772,7 @@ static int opt_target(void *optctx, const char *opt, const char *arg)
parse_option(o, "ac", "2", options);
opt_default(NULL, "packetsize", "2324");
- opt_default(NULL, "muxrate", "1411200"); // 2352 * 75 * 8;
+ opt_default(NULL, "muxrate", "3528"); // 2352 * 75 / 50;
/* We have to offset the PTS, so that it is consistent with the SCR.
SCR starts at 36000, but the first two packs contain only padding
@@ -1818,7 +1818,7 @@ static int opt_target(void *optctx, const char *opt, const char *arg)
opt_default(NULL, "bufsize", "1835008"); // 224*1024*8;
opt_default(NULL, "packetsize", "2048"); // from www.mpucoder.com: DVD sectors contain 2048 bytes of data, this is also the size of one pack.
- opt_default(NULL, "muxrate", "10080000"); // from mplex project: data_rate = 1260000. mux_rate = data_rate * 8
+ opt_default(NULL, "muxrate", "25200"); // from mplex project: data_rate = 1260000. mux_rate = data_rate / 50
opt_default(NULL, "b:a", "448000");
parse_option(o, "ar", "48000", options);
@@ -1839,6 +1839,10 @@ static int opt_target(void *optctx, const char *opt, const char *arg)
av_log(NULL, AV_LOG_ERROR, "Unknown target: %s\n", arg);
return AVERROR(EINVAL);
}
+
+ av_dict_copy(&o->g->codec_opts, codec_opts, 0);
+ av_dict_copy(&o->g->format_opts, format_opts, 0);
+
return 0;
}
diff --git a/gst-libs/ext/libav/doc/avconv.texi b/gst-libs/ext/libav/doc/avconv.texi
index 7ef415f..cb0f331 100644
--- a/gst-libs/ext/libav/doc/avconv.texi
+++ b/gst-libs/ext/libav/doc/avconv.texi
@@ -1097,11 +1097,11 @@ only formats accepting a normal integer are suitable.
You can put many streams of the same type in the output:
@example
-avconv -i test1.avi -i test2.avi -map 0.3 -map 0.2 -map 0.1 -map 0.0 -c copy test12.nut
+avconv -i test1.avi -i test2.avi -map 1:1 -map 1:0 -map 0:1 -map 0:0 -c copy -y test12.nut
@end example
-The resulting output file @file{test12.avi} will contain first four streams from
-the input file in reverse order.
+The resulting output file @file{test12.nut} will contain the first four streams
+from the input files in reverse order.
@item
To force CBR video output:
diff --git a/gst-libs/ext/libav/libavcodec/mpegvideo_enc.c b/gst-libs/ext/libav/libavcodec/mpegvideo_enc.c
index 091bee3..dcc399f 100644
--- a/gst-libs/ext/libav/libavcodec/mpegvideo_enc.c
+++ b/gst-libs/ext/libav/libavcodec/mpegvideo_enc.c
@@ -1663,12 +1663,12 @@ vbv_retry:
avctx->frame_bits = s->frame_bits;
pkt->pts = s->current_picture.f.pts;
- if (!s->low_delay) {
+ if (!s->low_delay && s->pict_type != AV_PICTURE_TYPE_B) {
if (!s->current_picture.f.coded_picture_number)
pkt->dts = pkt->pts - s->dts_delta;
else
pkt->dts = s->reordered_pts;
- s->reordered_pts = s->input_picture[0]->f.pts;
+ s->reordered_pts = pkt->pts;
} else
pkt->dts = pkt->pts;
if (s->current_picture.f.key_frame)
diff --git a/gst-libs/ext/libav/libavcodec/proresenc.c b/gst-libs/ext/libav/libavcodec/proresenc.c
index 7e9ce54..a43612c 100644
--- a/gst-libs/ext/libav/libavcodec/proresenc.c
+++ b/gst-libs/ext/libav/libavcodec/proresenc.c
@@ -205,6 +205,7 @@ typedef struct ProresContext {
int bits_per_mb;
int force_quant;
int alpha_bits;
+ int warn;
char *vendor;
int quant_sel;
@@ -467,7 +468,6 @@ static void put_alpha_run(PutBitContext *pb, int run)
// todo alpha quantisation for high quants
static int encode_alpha_plane(ProresContext *ctx, PutBitContext *pb,
- const uint16_t *src, int linesize,
int mbs_per_slice, uint16_t *blocks,
int quant)
{
@@ -562,11 +562,15 @@ static int encode_slice(AVCodecContext *avctx, const AVFrame *pic,
get_alpha_data(ctx, src, linesize, xp, yp,
pwidth, avctx->height / ctx->pictures_per_frame,
ctx->blocks[0], mbs_per_slice, ctx->alpha_bits);
- sizes[i] = encode_alpha_plane(ctx, pb, src, linesize,
- mbs_per_slice, ctx->blocks[0],
- quant);
+ sizes[i] = encode_alpha_plane(ctx, pb, mbs_per_slice,
+ ctx->blocks[0], quant);
}
total_size += sizes[i];
+ if (put_bits_left(pb) < 0) {
+ av_log(avctx, AV_LOG_ERROR,
+ "Underestimated required buffer size.\n");
+ return AVERROR_BUG;
+ }
}
return total_size;
}
@@ -930,16 +934,16 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
int sizes[4] = { 0 };
int slice_hdr_size = 2 + 2 * (ctx->num_planes - 1);
int frame_size, picture_size, slice_size;
- int pkt_size, ret;
+ int pkt_size, ret, max_slice_size = 0;
uint8_t frame_flags;
*avctx->coded_frame = *pic;
avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
avctx->coded_frame->key_frame = 1;
- pkt_size = ctx->frame_size_upper_bound + FF_MIN_BUFFER_SIZE;
+ pkt_size = ctx->frame_size_upper_bound;
- if ((ret = ff_alloc_packet(pkt, pkt_size)) < 0) {
+ if ((ret = ff_alloc_packet(pkt, pkt_size + FF_MIN_BUFFER_SIZE)) < 0) {
av_log(avctx, AV_LOG_ERROR, "Error getting output packet.\n");
return ret;
}
@@ -1017,8 +1021,44 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
bytestream_put_byte(&buf, slice_hdr_size << 3);
slice_hdr = buf;
buf += slice_hdr_size - 1;
+ if (pkt_size <= buf - orig_buf + 2 * max_slice_size) {
+ uint8_t *start = pkt->data;
+ // Recompute new size according to max_slice_size
+ // and deduce delta
+ int delta = 200 + ctx->pictures_per_frame *
+ ctx->slices_per_picture * max_slice_size -
+ pkt_size;
+
+ delta = FFMAX(delta, 2 * max_slice_size);
+ ctx->frame_size_upper_bound += delta;
+
+ if (!ctx->warn) {
+ avpriv_request_sample(avctx,
+ "Packet too small: is %i,"
+ " needs %i (slice: %i). "
+ "Correct allocation",
+ pkt_size, delta, max_slice_size);
+ ctx->warn = 1;
+ }
+
+ ret = av_grow_packet(pkt, delta);
+ if (ret < 0)
+ return ret;
+
+ pkt_size += delta;
+ // restore pointers
+ orig_buf = pkt->data + (orig_buf - start);
+ buf = pkt->data + (buf - start);
+ picture_size_pos = pkt->data + (picture_size_pos - start);
+ slice_sizes = pkt->data + (slice_sizes - start);
+ slice_hdr = pkt->data + (slice_hdr - start);
+ tmp = pkt->data + (tmp - start);
+ }
init_put_bits(&pb, buf, (pkt_size - (buf - orig_buf)) * 8);
- encode_slice(avctx, pic, &pb, sizes, x, y, q, mbs_per_slice);
+ ret = encode_slice(avctx, pic, &pb, sizes, x, y, q,
+ mbs_per_slice);
+ if (ret < 0)
+ return ret;
bytestream_put_byte(&slice_hdr, q);
slice_size = slice_hdr_size + sizes[ctx->num_planes - 1];
@@ -1028,6 +1068,8 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
}
bytestream_put_be16(&slice_sizes, slice_size);
buf += slice_size - slice_hdr_size;
+ if (max_slice_size < slice_size)
+ max_slice_size = slice_size;
}
}
@@ -1189,8 +1231,6 @@ static av_cold int encode_init(AVCodecContext *avctx)
ctx->bits_per_mb = ls * 8;
if (ctx->chroma_factor == CFACTOR_Y444)
ctx->bits_per_mb += ls * 4;
- if (ctx->num_planes == 4)
- ctx->bits_per_mb += ls * 4;
}
ctx->frame_size_upper_bound = ctx->pictures_per_frame *
@@ -1199,6 +1239,14 @@ static av_cold int encode_init(AVCodecContext *avctx)
(mps * ctx->bits_per_mb) / 8)
+ 200;
+ if (ctx->alpha_bits) {
+ // The alpha plane is run-coded and might exceed the bit budget.
+ ctx->frame_size_upper_bound += ctx->pictures_per_frame *
+ ctx->slices_per_picture *
+ /* num pixels per slice */ (ctx->mbs_per_slice * 256 *
+ /* bits per pixel */ (1 + ctx->alpha_bits + 1) + 7 >> 3);
+ }
+
avctx->codec_tag = ctx->profile_info->tag;
av_log(avctx, AV_LOG_DEBUG,
diff --git a/gst-libs/ext/libav/libavdevice/pulse.c b/gst-libs/ext/libav/libavdevice/pulse.c
index a8e710d..2136ee3 100644
--- a/gst-libs/ext/libav/libavdevice/pulse.c
+++ b/gst-libs/ext/libav/libavdevice/pulse.c
@@ -31,6 +31,7 @@
#include "libavformat/avformat.h"
#include "libavformat/internal.h"
+#include "libavutil/time.h"
#include "libavutil/opt.h"
#define DEFAULT_CODEC_ID AV_NE(AV_CODEC_ID_PCM_S16BE, AV_CODEC_ID_PCM_S16LE)
@@ -47,6 +48,7 @@ typedef struct PulseData {
pa_simple *s;
int64_t pts;
int64_t frame_duration;
+ int wallclock;
} PulseData;
static pa_sample_format_t codec_id_to_pulse_format(int codec_id) {
@@ -141,6 +143,8 @@ static int pulse_read_packet(AVFormatContext *s, AVPacket *pkt)
if (pd->pts == AV_NOPTS_VALUE) {
pd->pts = -latency;
+ if (pd->wallclock)
+ pd->pts += av_gettime();
}
pkt->pts = pd->pts;
@@ -168,6 +172,7 @@ static const AVOption options[] = {
{ "channels", "number of audio channels", OFFSET(channels), AV_OPT_TYPE_INT, {.i64 = 2}, 1, INT_MAX, D },
{ "frame_size", "number of bytes per frame", OFFSET(frame_size), AV_OPT_TYPE_INT, {.i64 = 1024}, 1, INT_MAX, D },
{ "fragment_size", "buffering size, affects latency and cpu usage", OFFSET(fragment_size), AV_OPT_TYPE_INT, {.i64 = -1}, -1, INT_MAX, D },
+ { "wallclock", "set the initial pts using the current time", OFFSET(wallclock), AV_OPT_TYPE_INT, {.i64 = 1}, -1, 1, D },
{ NULL },
};
diff --git a/gst-libs/ext/libav/libavfilter/setpts.c b/gst-libs/ext/libav/libavfilter/setpts.c
index be190c0..926fbf7 100644
--- a/gst-libs/ext/libav/libavfilter/setpts.c
+++ b/gst-libs/ext/libav/libavfilter/setpts.c
@@ -24,6 +24,8 @@
* video presentation timestamp (PTS) modification filter
*/
+#include <inttypes.h>
+
#include "libavutil/eval.h"
#include "libavutil/internal.h"
#include "libavutil/mathematics.h"
@@ -141,15 +143,12 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
d = av_expr_eval(setpts->expr, setpts->var_values, NULL);
frame->pts = D2TS(d);
-#ifdef DEBUG
- av_log(inlink->dst, AV_LOG_DEBUG,
- "n:%"PRId64" interlaced:%d pts:%"PRId64" t:%f -> pts:%"PRId64" t:%f\n",
- (int64_t)setpts->var_values[VAR_N],
- (int)setpts->var_values[VAR_INTERLACED],
- in_pts, in_pts * av_q2d(inlink->time_base),
- frame->pts, frame->pts * av_q2d(inlink->time_base));
-#endif
-
+ av_dlog(inlink->dst,
+ "n:%"PRId64" interlaced:%d pts:%"PRId64" t:%f -> pts:%"PRId64" t:%f\n",
+ (int64_t)setpts->var_values[VAR_N],
+ (int)setpts->var_values[VAR_INTERLACED],
+ in_pts, in_pts * av_q2d(inlink->time_base),
+ frame->pts, frame->pts * av_q2d(inlink->time_base));
if (inlink->type == AVMEDIA_TYPE_VIDEO) {
setpts->var_values[VAR_N] += 1.0;
diff --git a/gst-libs/ext/libav/libavformat/mpegenc.c b/gst-libs/ext/libav/libavformat/mpegenc.c
index 13d5b03..fe0ad67 100644
--- a/gst-libs/ext/libav/libavformat/mpegenc.c
+++ b/gst-libs/ext/libav/libavformat/mpegenc.c
@@ -1135,7 +1135,7 @@ static int mpeg_mux_end(AVFormatContext *ctx)
#define OFFSET(x) offsetof(MpegMuxContext, x)
#define E AV_OPT_FLAG_ENCODING_PARAM
static const AVOption options[] = {
- { "muxrate", NULL, OFFSET(mux_rate), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, E },
+ { "muxrate", NULL, OFFSET(mux_rate), AV_OPT_TYPE_INT, {.i64 = 0}, 0, (1 << 22) - 1, E },
{ "preload", "Initial demux-decode delay in microseconds.", OFFSET(preload), AV_OPT_TYPE_INT, {.i64 = 500000}, 0, INT_MAX, E},
{ NULL },
};
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-gstreamer/gst-libav1.0.git
More information about the Pkg-gstreamer-commits
mailing list