[FFmpeg-cvslog] lavfi: split frame_count between input and output.

2016-11-13 Thread Nicolas George
ffmpeg | branch: master | Nicolas George  | Tue Aug 30 
15:28:41 2016 +0200| [183ce55b0de0a597b838d08bbac67f54c27ed42f] | committer: 
Nicolas George

lavfi: split frame_count between input and output.

AVFilterLink.frame_count is supposed to count the number of frames
that were passed on the link, but with min_samples, that number is
not always the same for the source and destination filters.
With the addition of a FIFO on the link, the difference will become
more significant.

Split the variable in two: frame_count_in counts the number of
frames that entered the link, frame_count_out counts the number
of frames that were sent to the destination filter.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=183ce55b0de0a597b838d08bbac67f54c27ed42f
---

 libavfilter/af_ashowinfo.c   |  2 +-
 libavfilter/af_volume.c  |  2 +-
 libavfilter/asrc_sine.c  |  2 +-
 libavfilter/avf_showfreqs.c  |  4 ++--
 libavfilter/avfilter.c   |  5 +++--
 libavfilter/avfilter.h   |  2 +-
 libavfilter/f_loop.c |  2 +-
 libavfilter/f_metadata.c |  4 ++--
 libavfilter/f_select.c   |  2 +-
 libavfilter/f_streamselect.c |  2 +-
 libavfilter/vf_bbox.c|  2 +-
 libavfilter/vf_blackdetect.c |  2 +-
 libavfilter/vf_blend.c   |  2 +-
 libavfilter/vf_crop.c|  2 +-
 libavfilter/vf_decimate.c|  2 +-
 libavfilter/vf_detelecine.c  |  2 +-
 libavfilter/vf_drawtext.c|  4 ++--
 libavfilter/vf_eq.c  |  2 +-
 libavfilter/vf_fade.c|  8 
 libavfilter/vf_fieldhint.c   | 14 +++---
 libavfilter/vf_fieldmatch.c  |  6 +++---
 libavfilter/vf_framestep.c   |  2 +-
 libavfilter/vf_geq.c |  2 +-
 libavfilter/vf_hue.c |  2 +-
 libavfilter/vf_overlay.c |  2 +-
 libavfilter/vf_paletteuse.c  |  2 +-
 libavfilter/vf_perspective.c |  4 ++--
 libavfilter/vf_rotate.c  |  2 +-
 libavfilter/vf_showinfo.c|  2 +-
 libavfilter/vf_swaprect.c|  2 +-
 libavfilter/vf_telecine.c|  2 +-
 libavfilter/vf_tinterlace.c  |  4 ++--
 libavfilter/vf_vignette.c|  2 +-
 libavfilter/vf_zoompan.c |  6 +++---
 libavfilter/vsrc_mptestsrc.c |  2 +-
 35 files changed, 55 insertions(+), 54 deletions(-)

diff --git a/libavfilter/af_ashowinfo.c b/libavfilter/af_ashowinfo.c
index ca33add..ba600cb 100644
--- a/libavfilter/af_ashowinfo.c
+++ b/libavfilter/af_ashowinfo.c
@@ -206,7 +206,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
"n:%"PRId64" pts:%s pts_time:%s pos:%"PRId64" "
"fmt:%s channels:%d chlayout:%s rate:%d nb_samples:%d "
"checksum:%08"PRIX32" ",
-   inlink->frame_count,
+   inlink->frame_count_out,
av_ts2str(buf->pts), av_ts2timestr(buf->pts, &inlink->time_base),
av_frame_get_pkt_pos(buf),
av_get_sample_fmt_name(buf->format), av_frame_get_channels(buf), 
chlayout_str,
diff --git a/libavfilter/af_volume.c b/libavfilter/af_volume.c
index 4d6b916..6813403 100644
--- a/libavfilter/af_volume.c
+++ b/libavfilter/af_volume.c
@@ -393,7 +393,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
 }
 vol->var_values[VAR_PTS] = TS2D(buf->pts);
 vol->var_values[VAR_T  ] = TS2T(buf->pts, inlink->time_base);
-vol->var_values[VAR_N  ] = inlink->frame_count;
+vol->var_values[VAR_N  ] = inlink->frame_count_out;
 
 pos = av_frame_get_pkt_pos(buf);
 vol->var_values[VAR_POS] = pos == -1 ? NAN : pos;
diff --git a/libavfilter/asrc_sine.c b/libavfilter/asrc_sine.c
index 2a2f3c3..ff77526 100644
--- a/libavfilter/asrc_sine.c
+++ b/libavfilter/asrc_sine.c
@@ -219,7 +219,7 @@ static int request_frame(AVFilterLink *outlink)
 SineContext *sine = outlink->src->priv;
 AVFrame *frame;
 double values[VAR_VARS_NB] = {
-[VAR_N]   = outlink->frame_count,
+[VAR_N]   = outlink->frame_count_in,
 [VAR_PTS] = sine->pts,
 [VAR_T]   = sine->pts * av_q2d(outlink->time_base),
 [VAR_TB]  = av_q2d(outlink->time_base),
diff --git a/libavfilter/avf_showfreqs.c b/libavfilter/avf_showfreqs.c
index e2a923b..21735ed 100644
--- a/libavfilter/avf_showfreqs.c
+++ b/libavfilter/avf_showfreqs.c
@@ -326,12 +326,12 @@ static inline void plot_freq(ShowFreqsContext *s, int ch,
 
 switch (s->avg) {
 case 0:
-y = s->avg_data[ch][f] = !outlink->frame_count ? y : FFMIN(avg, y);
+y = s->avg_data[ch][f] = !outlink->frame_count_in ? y : FFMIN(avg, y);
 break;
 case 1:
 break;
 default:
-s->avg_data[ch][f] = avg + y * (y - avg) / (FFMIN(outlink->frame_count 
+ 1, s->avg) * y);
+s->avg_data[ch][f] = avg + y * (y - avg) / 
(FFMIN(outlink->frame_count_in + 1, s->avg) * y);
 y = s->avg_data[ch][f];
 break;
 }
diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index 1d469c3..662f933 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -1120,7 +1120,7 @@ static int ff_filter_frame_framed(AVFilterLink *link, 
AVFrame *frame)

[FFmpeg-cvslog] fate/colorkey: disable audio stream.

2016-11-13 Thread Nicolas George
ffmpeg | branch: master | Nicolas George  | Tue Aug 30 
20:12:20 2016 +0200| [22aa649c13b452f11353958a51f073f5fbc3bcaa] | committer: 
Nicolas George

fate/colorkey: disable audio stream.

The test is not supposed to cover audio.
Also, using -vframes along with an audio stream depends on
the exact order the frames are processed by filters, it is
too much constraint to guarantee.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=22aa649c13b452f11353958a51f073f5fbc3bcaa
---

 tests/fate/ffmpeg.mak |  2 +-
 tests/ref/fate/ffmpeg-filter_colorkey | 10 --
 2 files changed, 1 insertion(+), 11 deletions(-)

diff --git a/tests/fate/ffmpeg.mak b/tests/fate/ffmpeg.mak
index 244f63d..e35427d 100644
--- a/tests/fate/ffmpeg.mak
+++ b/tests/fate/ffmpeg.mak
@@ -20,7 +20,7 @@ fate-ffmpeg-filter_complex: CMD = framecrc -filter_complex 
color=d=1:r=5 -fflags
 
 FATE_SAMPLES_FFMPEG-$(CONFIG_COLORKEY_FILTER) += fate-ffmpeg-filter_colorkey
 fate-ffmpeg-filter_colorkey: tests/data/filtergraphs/colorkey
-fate-ffmpeg-filter_colorkey: CMD = framecrc -idct simple -fflags +bitexact 
-flags +bitexact  -sws_flags +accurate_rnd+bitexact -i 
$(TARGET_SAMPLES)/cavs/cavs.mpg -fflags +bitexact -flags +bitexact -sws_flags 
+accurate_rnd+bitexact -i $(TARGET_SAMPLES)/lena.pnm -filter_complex_script 
$(TARGET_PATH)/tests/data/filtergraphs/colorkey -sws_flags 
+accurate_rnd+bitexact -fflags +bitexact -flags +bitexact -qscale 2 -vframes 10
+fate-ffmpeg-filter_colorkey: CMD = framecrc -idct simple -fflags +bitexact 
-flags +bitexact  -sws_flags +accurate_rnd+bitexact -i 
$(TARGET_SAMPLES)/cavs/cavs.mpg -fflags +bitexact -flags +bitexact -sws_flags 
+accurate_rnd+bitexact -i $(TARGET_SAMPLES)/lena.pnm -an -filter_complex_script 
$(TARGET_PATH)/tests/data/filtergraphs/colorkey -sws_flags 
+accurate_rnd+bitexact -fflags +bitexact -flags +bitexact -qscale 2 -vframes 10
 
 FATE_FFMPEG-$(CONFIG_COLOR_FILTER) += fate-ffmpeg-lavfi
 fate-ffmpeg-lavfi: CMD = framecrc -lavfi color=d=1:r=5 -fflags +bitexact
diff --git a/tests/ref/fate/ffmpeg-filter_colorkey 
b/tests/ref/fate/ffmpeg-filter_colorkey
index 1f96f2d..effc13b 100644
--- a/tests/ref/fate/ffmpeg-filter_colorkey
+++ b/tests/ref/fate/ffmpeg-filter_colorkey
@@ -3,18 +3,8 @@
 #codec_id 0: rawvideo
 #dimensions 0: 720x576
 #sar 0: 0/1
-#tb 1: 1/48000
-#media_type 1: audio
-#codec_id 1: pcm_s16le
-#sample_rate 1: 48000
-#channel_layout 1: 3
-#channel_layout_name 1: stereo
 0,  0,  0,1,   622080, 0x4e30accb
-1,  0,  0, 1152, 4608, 0x
-1,   1152,   1152, 1152, 4608, 0xbca29063
 0,  1,  1,1,   622080, 0x7d941c14
-1,   2304,   2304, 1152, 4608, 0x6e70df10
-1,   3456,   3456, 1152, 4608, 0x95e6a535
 0,  2,  2,1,   622080, 0xf7451c5b
 0,  3,  3,1,   622080, 0xb2c74319
 0,  4,  4,1,   622080, 0xc9b80b79

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] avformat: Add Pro-MPEG CoP #3-R2 FEC protocol

2016-11-13 Thread Vlad Tarca
ffmpeg | branch: master | Vlad Tarca  | Thu Jun  2 
16:28:13 2016 +0200| [2bd83ef26acf93fc818b1b75a5406dbfb196f6a4] | committer: 
Michael Niedermayer

avformat: Add Pro-MPEG CoP #3-R2 FEC protocol

Pro-MPEG Code of Practice #3 release 2 forward error correction for rtp_mpegts 
streams

Signed-off-by: Vlad Tarca 
Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2bd83ef26acf93fc818b1b75a5406dbfb196f6a4
---

 Changelog   |   1 +
 doc/general.texi|   1 +
 doc/protocols.texi  |  35 
 libavformat/Makefile|   1 +
 libavformat/prompeg.c   | 481 
 libavformat/protocols.c |   1 +
 libavformat/rtpproto.c  |  61 +-
 7 files changed, 578 insertions(+), 3 deletions(-)

diff --git a/Changelog b/Changelog
index 5c7fe8b..8456022 100644
--- a/Changelog
+++ b/Changelog
@@ -4,6 +4,7 @@ releases are sorted from youngest to oldest.
 version :
 - CrystalHD decoder moved to new decode API
 - add internal ebur128 library, remove external libebur128 dependency
+- Pro-MPEG CoP #3-R2 FEC protocol
 
 version 3.2:
 - libopenmpt demuxer
diff --git a/doc/general.texi b/doc/general.texi
index f08c3cd..56b9e4d 100644
--- a/doc/general.texi
+++ b/doc/general.texi
@@ -1137,6 +1137,7 @@ performance on systems without hardware floating point 
support).
 @item MMSH @tab X
 @item MMST @tab X
 @item pipe @tab X
+@item Pro-MPEG FEC @tab X
 @item RTMP @tab X
 @item RTMPE@tab X
 @item RTMPS@tab X
diff --git a/doc/protocols.texi b/doc/protocols.texi
index 00e182e..e887b75 100644
--- a/doc/protocols.texi
+++ b/doc/protocols.texi
@@ -515,6 +515,41 @@ time, which is valuable if data transmission is slow.
 Note that some formats (typically MOV), require the output protocol to
 be seekable, so they will fail with the pipe output protocol.
 
+@section prompeg
+
+Pro-MPEG Code of Practice #3 Release 2 FEC protocol.
+
+The Pro-MPEG CoP#3 FEC is a 2D parity-check forward error correction mechanism
+for MPEG-2 Transport Streams sent over RTP.
+
+This protocol must be used in conjunction with the @code{rtp_mpegts} muxer and
+the @code{rtp} protocol.
+
+The required syntax is:
+@example
+-f rtp_mpegts -fec prompeg=@var{option}=@var{val}... 
rtp://@var{hostname}:@var{port}
+@end example
+
+The destination UDP ports are @code{port + 2} for the column FEC stream
+and @code{port + 4} for the row FEC stream.
+
+This protocol accepts the following options:
+@table @option
+
+@item l=@var{n}
+The number of columns (4-20, LxD <= 100)
+
+@item d=@var{n}
+The number of rows (4-20, LxD <= 100)
+
+@end table
+
+Example usage:
+
+@example
+-f rtp_mpegts -fec prompeg=l=8:d=4 rtp://@var{hostname}:@var{port}
+@end example
+
 @section rtmp
 
 Real-Time Messaging Protocol.
diff --git a/libavformat/Makefile b/libavformat/Makefile
index c9defe7..e6bfc42 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -558,6 +558,7 @@ OBJS-$(CONFIG_MD5_PROTOCOL)  += md5proto.o
 OBJS-$(CONFIG_MMSH_PROTOCOL) += mmsh.o mms.o asf.o
 OBJS-$(CONFIG_MMST_PROTOCOL) += mmst.o mms.o asf.o
 OBJS-$(CONFIG_PIPE_PROTOCOL) += file.o
+OBJS-$(CONFIG_PROMPEG_PROTOCOL)  += prompeg.o
 OBJS-$(CONFIG_RTMP_PROTOCOL) += rtmpproto.o rtmppkt.o
 OBJS-$(CONFIG_RTMPE_PROTOCOL)+= rtmpproto.o rtmppkt.o
 OBJS-$(CONFIG_RTMPS_PROTOCOL)+= rtmpproto.o rtmppkt.o
diff --git a/libavformat/prompeg.c b/libavformat/prompeg.c
new file mode 100644
index 000..cc1baa4
--- /dev/null
+++ b/libavformat/prompeg.c
@@ -0,0 +1,481 @@
+/*
+ * Pro-MPEG Code of Practice #3 Release 2 FEC
+ * Copyright (c) 2016 Mobibase, France (http://www.mobibase.com)
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * @file
+ * Pro-MPEG Code of Practice #3 Release 2 FEC protocol
+ * @author Vlad Tarca 
+ */
+
+/*
+ * Reminder:
+
+ [RFC 2733] FEC Packet Structure
+
+   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+   | RTP Header|
+   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+   | FEC Header|
+   +-+-+-+-+-+-+-+-

[FFmpeg-cvslog] configure: use check_lib2 for cuda and cuvid

2016-11-13 Thread Hendrik Leppkes
ffmpeg | branch: master | Hendrik Leppkes  | Sat Nov 12 
01:37:57 2016 +0100| [0539ff0e1b2f4e388bf4de16d00846ed5cebe811] | committer: 
Hendrik Leppkes

configure: use check_lib2 for cuda and cuvid

Fixes building for Windows x86 with MSVC using the link libraries distributed 
with the CUDA SDK.

check_lib2 is required here because it includes the header to get the full 
signature of the
function, including the stdcall calling convention and all of its arguments, 
which enables
the linker to determine the fully qualified object name and resolve it through 
the import
library, since the CUDA SDK libraries do not include un-qualified aliases.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0539ff0e1b2f4e388bf4de16d00846ed5cebe811
---

 configure | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index be7e925..c00c591 100755
--- a/configure
+++ b/configure
@@ -5659,10 +5659,10 @@ fi
 enabled avfoundation_indev && { check_header_objcc AVFoundation/AVFoundation.h 
|| disable avfoundation_indev; }
 enabled avfoundation_indev && { check_lib2 CoreGraphics/CoreGraphics.h 
CGGetActiveDisplayList -framework CoreGraphics ||
 check_lib2 
ApplicationServices/ApplicationServices.h CGGetActiveDisplayList -framework 
ApplicationServices; }
-enabled cuda  && { check_lib cuda.h cuInit -lcuda ||
+enabled cuda  && { check_lib2 cuda.h cuInit -lcuda ||
die "ERROR: CUDA not found"; }
 enabled cuvid && { add_cflags -I$source_path;
-   check_lib "compat/cuda/cuviddec.h" 
cuvidCreateDecoder -lnvcuvid ||
+   check_lib2 "compat/cuda/cuviddec.h" 
cuvidCreateDecoder -lnvcuvid ||
die "ERROR: CUVID not found"; } &&
  { enabled cuda ||
die "ERROR: CUVID requires CUDA"; }

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] vp9_mc_template: limit assert to SCALED == 0

2016-11-13 Thread Andreas Cadhalpun
ffmpeg | branch: master | Andreas Cadhalpun  
| Sat Nov 12 23:45:52 2016 +0100| [7112b56a3413b68261e3db0314343e26c75be83b] | 
committer: Andreas Cadhalpun

vp9_mc_template: limit assert to SCALED == 0

The handling of the other block sizes was limited to 'SCALED == 0' in
commit dc96c0f9fc96bf4167633befc074394062793322, so this assert should
be disabled, too, as it can now be triggered.

Reviewed-by: Ronald S. Bultje 
Signed-off-by: Andreas Cadhalpun 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7112b56a3413b68261e3db0314343e26c75be83b
---

 libavcodec/vp9_mc_template.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/vp9_mc_template.c b/libavcodec/vp9_mc_template.c
index 38d9a6d..e7f226c 100644
--- a/libavcodec/vp9_mc_template.c
+++ b/libavcodec/vp9_mc_template.c
@@ -205,7 +205,9 @@ static void FN(inter_pred)(AVCodecContext *ctx)
 } else
 #endif
 {
+#if SCALED == 0
 av_assert2(b->bs == BS_4x4);
+#endif
 
 // FIXME if two horizontally adjacent blocks have the same MV,
 // do a w8 instead of a w4 call

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] avconv: decouple configuring filtergraphs and setting output parameters

2016-11-13 Thread Anton Khirnov
ffmpeg | branch: master | Anton Khirnov  | Mon May 23 
14:09:08 2016 +0200| [50722b4f0cbc5940e9e6e21d113888436cc89ff5] | committer: 
Anton Khirnov

avconv: decouple configuring filtergraphs and setting output parameters

Currently, a filtergraph will pull in the output constraints from its
corresponding decoder context, which breaks proper layering. Instead,
explicitly send the constaints on the output parameters to the
filtergraph.

This is similar to what is done for filtergraph inputs in
30ab4c51a180610d9f1720c75518d763515c0d9f

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=50722b4f0cbc5940e9e6e21d113888436cc89ff5
---

 avconv.c|  3 +++
 avconv.h| 12 +++
 avconv_filter.c | 50 +-
 avconv_opt.c| 62 +
 4 files changed, 109 insertions(+), 18 deletions(-)

diff --git a/avconv.c b/avconv.c
index 9344a3e..101166b 100644
--- a/avconv.c
+++ b/avconv.c
@@ -154,6 +154,9 @@ static void avconv_cleanup(int ret)
 av_freep(&fg->inputs);
 for (j = 0; j < fg->nb_outputs; j++) {
 av_freep(&fg->outputs[j]->name);
+av_freep(&fg->outputs[j]->formats);
+av_freep(&fg->outputs[j]->channel_layouts);
+av_freep(&fg->outputs[j]->sample_rates);
 av_freep(&fg->outputs[j]);
 }
 av_freep(&fg->outputs);
diff --git a/avconv.h b/avconv.h
index e201b92..03e851d 100644
--- a/avconv.h
+++ b/avconv.h
@@ -221,6 +221,18 @@ typedef struct OutputFilter {
 /* temporary storage until stream maps are processed */
 AVFilterInOut   *out_tmp;
 enum AVMediaType type;
+
+/* desired output stream properties */
+int width, height;
+AVRational frame_rate;
+int format;
+int sample_rate;
+uint64_t channel_layout;
+
+// those are only set if no format is specified and the encoder gives us 
multiple options
+int *formats;
+uint64_t *channel_layouts;
+int *sample_rates;
 } OutputFilter;
 
 typedef struct FilterGraph {
diff --git a/avconv_filter.c b/avconv_filter.c
index 2332f99..44f3d07 100644
--- a/avconv_filter.c
+++ b/avconv_filter.c
@@ -38,13 +38,13 @@
 
 /* Define a function for building a string containing a list of
  * allowed formats. */
-#define DEF_CHOOSE_FORMAT(type, var, supported_list, none, get_name)   
\
-static char *choose_ ## var ## s(OutputStream *ost)
\
+#define DEF_CHOOSE_FORMAT(suffix, type, var, supported_list, none, get_name)   
\
+static char *choose_ ## suffix (OutputFilter *ofilter) 
\
 {  
\
-if (ost->enc_ctx->var != none) {   
\
-get_name(ost->enc_ctx->var);   
\
+if (ofilter->var != none) {
\
+get_name(ofilter->var);
\
 return av_strdup(name);
\
-} else if (ost->enc && ost->enc->supported_list) { 
\
+} else if (ofilter->supported_list) {  
\
 const type *p; 
\
 AVIOContext *s = NULL; 
\
 uint8_t *ret;  
\
@@ -53,7 +53,7 @@ static char *choose_ ## var ## s(OutputStream *ost)   
 \
 if (avio_open_dyn_buf(&s) < 0) 
\
 exit(1);   
\

\
-for (p = ost->enc->supported_list; *p != none; p++) {  
\
+for (p = ofilter->supported_list; *p != none; p++) {   
\
 get_name(*p);  
\
 avio_printf(s, "%s|", name);   
\
 }  
\
@@ -64,16 +64,16 @@ static char *choose_ ## var ## s(OutputStream *ost) 
   \
 return NULL;   
\
 }
 
-DEF_CHOOSE_FORMAT(enum AVPixelFormat, pix_fmt, pix_fmts, AV_PIX_FMT_NONE,
+DEF_CHOOSE_FORMAT(pix_fmts, enum AVPixelFormat, format, formats, 
AV_PIX_FMT_NONE,
   GET_PIX_FMT_NAME)
 
-DEF_CHOOSE_FORMAT(enum AVSampleFormat, sample_fmt, sample_fmts,
+DEF_CHOOSE_FORMAT(sample_fmts, enum AVSampleFormat, format, formats,
   AV_SAMPLE_FMT_NONE, GET_SAMPLE_FMT_NAME)
 
-DEF_CHOOSE_FORMAT(int, sample_rate, supported_samplerates, 0,
+DEF_CHOOSE_FORMAT(samp

[FFmpeg-cvslog] ffmpeg_filter: fix hwaccel transcoding

2016-11-13 Thread Hendrik Leppkes
ffmpeg | branch: master | Hendrik Leppkes  | Fri Nov 11 
14:47:49 2016 +0100| [ca7cdffb70c5fcf04c442c53600c3beb1ba01417] | committer: 
Hendrik Leppkes

ffmpeg_filter: fix hwaccel transcoding

Based on a patch by Yogender Gupta 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ca7cdffb70c5fcf04c442c53600c3beb1ba01417
---

 ffmpeg_filter.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/ffmpeg_filter.c b/ffmpeg_filter.c
index 2a9be64..a54d1f2 100644
--- a/ffmpeg_filter.c
+++ b/ffmpeg_filter.c
@@ -1142,8 +1142,9 @@ int ifilter_parameters_from_decoder(InputFilter *ifilter, 
const AVCodecContext *
 ifilter->channels= avctx->channels;
 ifilter->channel_layout  = avctx->channel_layout;
 
-if (avctx->hw_frames_ctx) {
-ifilter->hw_frames_ctx = av_buffer_ref(avctx->hw_frames_ctx);
+if (ifilter->ist && ifilter->ist->hw_frames_ctx) {
+ifilter->format = ifilter->ist->resample_pix_fmt;
+ifilter->hw_frames_ctx = av_buffer_ref(ifilter->ist->hw_frames_ctx);
 if (!ifilter->hw_frames_ctx)
 return AVERROR(ENOMEM);
 }

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] avconv: factor out initializing stream parameters for encoding

2016-11-13 Thread Anton Khirnov
ffmpeg | branch: master | Anton Khirnov  | Mon May 23 
09:37:10 2016 +0200| [ba7397baef796ca3991fe1c921bc91054407c48b] | committer: 
Anton Khirnov

avconv: factor out initializing stream parameters for encoding

Setting the filter input parameters is moved to init_input_stream(),
so that it is done before the decoder is opened, potentially overwriting
the information from avformat_find_stream_info() with less accurate
data.

This commit temporarily disables QSV transcoding with hw frames. The
functionality will be re-added in the following commits.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ba7397baef796ca3991fe1c921bc91054407c48b
---

 avconv.c | 296 +++
 1 file changed, 144 insertions(+), 152 deletions(-)

diff --git a/avconv.c b/avconv.c
index 4e19813..9344a3e 100644
--- a/avconv.c
+++ b/avconv.c
@@ -1616,8 +1616,17 @@ static int get_buffer(AVCodecContext *s, AVFrame *frame, 
int flags)
 
 static int init_input_stream(int ist_index, char *error, int error_len)
 {
-int ret;
+int i, ret;
 InputStream *ist = input_streams[ist_index];
+
+for (i = 0; i < ist->nb_filters; i++) {
+ret = ifilter_parameters_from_decoder(ist->filters[i], ist->dec_ctx);
+if (ret < 0) {
+av_log(NULL, AV_LOG_FATAL, "Error initializing filter input\n");
+return ret;
+}
+}
+
 if (ist->decoding_needed) {
 AVCodec *codec = ist->dec;
 if (!codec) {
@@ -1872,6 +1881,136 @@ static int init_output_stream_streamcopy(OutputStream 
*ost)
 return 0;
 }
 
+static void set_encoder_id(OutputFile *of, OutputStream *ost)
+{
+AVDictionaryEntry *e;
+
+uint8_t *encoder_string;
+int encoder_string_len;
+int format_flags = 0;
+
+e = av_dict_get(of->opts, "fflags", NULL, 0);
+if (e) {
+const AVOption *o = av_opt_find(of->ctx, "fflags", NULL, 0, 0);
+if (!o)
+return;
+av_opt_eval_flags(of->ctx, o, e->value, &format_flags);
+}
+
+encoder_string_len = sizeof(LIBAVCODEC_IDENT) + strlen(ost->enc->name) + 2;
+encoder_string = av_mallocz(encoder_string_len);
+if (!encoder_string)
+exit_program(1);
+
+if (!(format_flags & AVFMT_FLAG_BITEXACT))
+av_strlcpy(encoder_string, LIBAVCODEC_IDENT " ", encoder_string_len);
+av_strlcat(encoder_string, ost->enc->name, encoder_string_len);
+av_dict_set(&ost->st->metadata, "encoder",  encoder_string,
+AV_DICT_DONT_STRDUP_VAL | AV_DICT_DONT_OVERWRITE);
+}
+
+static void parse_forced_key_frames(char *kf, OutputStream *ost,
+AVCodecContext *avctx)
+{
+char *p;
+int n = 1, i;
+int64_t t;
+
+for (p = kf; *p; p++)
+if (*p == ',')
+n++;
+ost->forced_kf_count = n;
+ost->forced_kf_pts   = av_malloc(sizeof(*ost->forced_kf_pts) * n);
+if (!ost->forced_kf_pts) {
+av_log(NULL, AV_LOG_FATAL, "Could not allocate forced key frames 
array.\n");
+exit_program(1);
+}
+
+p = kf;
+for (i = 0; i < n; i++) {
+char *next = strchr(p, ',');
+
+if (next)
+*next++ = 0;
+
+t = parse_time_or_die("force_key_frames", p, 1);
+ost->forced_kf_pts[i] = av_rescale_q(t, AV_TIME_BASE_Q, 
avctx->time_base);
+
+p = next;
+}
+}
+
+static int init_output_stream_encode(OutputStream *ost)
+{
+InputStream *ist = get_input_stream(ost);
+AVCodecContext *enc_ctx = ost->enc_ctx;
+AVCodecContext *dec_ctx = NULL;
+
+set_encoder_id(output_files[ost->file_index], ost);
+
+if (ist) {
+ost->st->disposition = ist->st->disposition;
+
+dec_ctx = ist->dec_ctx;
+
+enc_ctx->bits_per_raw_sample= dec_ctx->bits_per_raw_sample;
+enc_ctx->chroma_sample_location = dec_ctx->chroma_sample_location;
+}
+
+if ((enc_ctx->codec_type == AVMEDIA_TYPE_VIDEO ||
+ enc_ctx->codec_type == AVMEDIA_TYPE_AUDIO) &&
+ filtergraph_is_simple(ost->filter->graph)) {
+FilterGraph *fg = ost->filter->graph;
+
+if (configure_filtergraph(fg)) {
+av_log(NULL, AV_LOG_FATAL, "Error opening filters!\n");
+exit_program(1);
+}
+}
+
+switch (enc_ctx->codec_type) {
+case AVMEDIA_TYPE_AUDIO:
+enc_ctx->sample_fmt = ost->filter->filter->inputs[0]->format;
+enc_ctx->sample_rate= ost->filter->filter->inputs[0]->sample_rate;
+enc_ctx->channel_layout = 
ost->filter->filter->inputs[0]->channel_layout;
+enc_ctx->channels   = 
av_get_channel_layout_nb_channels(enc_ctx->channel_layout);
+enc_ctx->time_base  = (AVRational){ 1, enc_ctx->sample_rate };
+break;
+case AVMEDIA_TYPE_VIDEO:
+enc_ctx->time_base = ost->filter->filter->inputs[0]->time_base;
+
+enc_ctx->width  = ost->filter->filter->inputs[0]->w;
+enc_ctx->height = ost->filter->filter->inputs[0]->h;
+  

[FFmpeg-cvslog] avconv: pass the hwaccel frames context to the decoder

2016-11-13 Thread Anton Khirnov
ffmpeg | branch: master | Anton Khirnov  | Fri May 27 
12:54:48 2016 +0200| [232399e3ee219d16d0e0d482c9f31a26202d4993] | committer: 
Anton Khirnov

avconv: pass the hwaccel frames context to the decoder

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=232399e3ee219d16d0e0d482c9f31a26202d4993
---

 avconv.c | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/avconv.c b/avconv.c
index 65eabbd..4eae015 100644
--- a/avconv.c
+++ b/avconv.c
@@ -1616,6 +1616,13 @@ static enum AVPixelFormat get_format(AVCodecContext *s, 
const enum AVPixelFormat
 }
 continue;
 }
+
+if (ist->hw_frames_ctx) {
+s->hw_frames_ctx = av_buffer_ref(ist->hw_frames_ctx);
+if (!s->hw_frames_ctx)
+return AV_PIX_FMT_NONE;
+}
+
 ist->active_hwaccel_id = hwaccel->id;
 ist->hwaccel_pix_fmt   = *p;
 break;

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] Merge commit '232399e3ee219d16d0e0d482c9f31a26202d4993'

2016-11-13 Thread Hendrik Leppkes
ffmpeg | branch: master | Hendrik Leppkes  | Sun Nov 13 
17:25:23 2016 +0100| [4945343606ec3a2d94c0ac5891c685997f6b43e9] | committer: 
Hendrik Leppkes

Merge commit '232399e3ee219d16d0e0d482c9f31a26202d4993'

* commit '232399e3ee219d16d0e0d482c9f31a26202d4993':
  avconv: pass the hwaccel frames context to the decoder

Merged-by: Hendrik Leppkes 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4945343606ec3a2d94c0ac5891c685997f6b43e9
---



___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] Merge commit '3e265ca58f0505470186dce300ab66a6eac3978e'

2016-11-13 Thread Hendrik Leppkes
ffmpeg | branch: master | Hendrik Leppkes  | Sun Nov 13 
17:23:57 2016 +0100| [f761d4967053352f9b95ac2bc2505ea06d25a2a0] | committer: 
Hendrik Leppkes

Merge commit '3e265ca58f0505470186dce300ab66a6eac3978e'

* commit '3e265ca58f0505470186dce300ab66a6eac3978e':
  avconv: do packet ts rescaling in write_packet()

This commit is a noop since it doesn't apply cleanly due to differences
in the dataflow between avconv and ffmpeg, and thus fixing this in the
scope of a merge is unfeasible.

Merged-by: Hendrik Leppkes 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f761d4967053352f9b95ac2bc2505ea06d25a2a0
---



___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] avconv: do packet ts rescaling in write_packet()

2016-11-13 Thread Anton Khirnov
ffmpeg | branch: master | Anton Khirnov  | Fri May 27 
12:04:29 2016 +0200| [3e265ca58f0505470186dce300ab66a6eac3978e] | committer: 
Anton Khirnov

avconv: do packet ts rescaling in write_packet()

This will be useful in the following commit, after which the muxer
timebase is not always available when encoding.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3e265ca58f0505470186dce300ab66a6eac3978e
---

 avconv.c | 23 ---
 avconv.h |  2 ++
 2 files changed, 14 insertions(+), 11 deletions(-)

diff --git a/avconv.c b/avconv.c
index 101166b..8913d85 100644
--- a/avconv.c
+++ b/avconv.c
@@ -314,7 +314,7 @@ static void write_packet(OutputFile *of, AVPacket *pkt, 
OutputStream *ost)
 
 if (ost->frame_rate.num) {
 pkt->duration = av_rescale_q(1, av_inv_q(ost->frame_rate),
- ost->st->time_base);
+ ost->mux_timebase);
 }
 }
 
@@ -341,6 +341,8 @@ static void write_packet(OutputFile *of, AVPacket *pkt, 
OutputStream *ost)
 ost->packets_written++;
 
 pkt->stream_index = ost->index;
+av_packet_rescale_ts(pkt, ost->mux_timebase, ost->st->time_base);
+
 ret = av_interleaved_write_frame(s, pkt);
 if (ret < 0) {
 print_error("av_interleaved_write_frame()", ret);
@@ -433,7 +435,6 @@ static void do_audio_out(OutputFile *of, OutputStream *ost,
 if (ret < 0)
 goto error;
 
-av_packet_rescale_ts(&pkt, enc->time_base, ost->st->time_base);
 output_packet(of, &pkt, ost);
 }
 
@@ -499,7 +500,7 @@ static void do_subtitle_out(OutputFile *of,
 av_init_packet(&pkt);
 pkt.data = subtitle_out;
 pkt.size = subtitle_out_size;
-pkt.pts  = av_rescale_q(sub->pts, AV_TIME_BASE_Q, ost->st->time_base);
+pkt.pts  = av_rescale_q(sub->pts, AV_TIME_BASE_Q, ost->mux_timebase);
 if (enc->codec_id == AV_CODEC_ID_DVB_SUBTITLE) {
 /* XXX: the pts correction is handled here. Maybe handling
it in the codec would be better */
@@ -584,7 +585,6 @@ static void do_video_out(OutputFile *of,
 if (ret < 0)
 goto error;
 
-av_packet_rescale_ts(&pkt, enc->time_base, ost->st->time_base);
 output_packet(of, &pkt, ost);
 *frame_size = pkt.size;
 
@@ -975,7 +975,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
 vid = 1;
 }
 /* compute min output value */
-pts = (double)ost->last_mux_dts * av_q2d(ost->st->time_base);
+pts = (double)ost->last_mux_dts * av_q2d(ost->mux_timebase);
 if ((pts < ti1) && (pts > 0))
 ti1 = pts;
 }
@@ -1054,7 +1054,6 @@ static void flush_encoders(void)
 stop_encoding = 1;
 break;
 }
-av_packet_rescale_ts(&pkt, enc->time_base, ost->st->time_base);
 output_packet(of, &pkt, ost);
 }
 
@@ -1086,7 +1085,7 @@ static void do_streamcopy(InputStream *ist, OutputStream 
*ost, const AVPacket *p
 OutputFile *of = output_files[ost->file_index];
 InputFile   *f = input_files [ist->file_index];
 int64_t start_time = (of->start_time == AV_NOPTS_VALUE) ? 0 : 
of->start_time;
-int64_t ost_tb_start_time = av_rescale_q(start_time, AV_TIME_BASE_Q, 
ost->st->time_base);
+int64_t ost_tb_start_time = av_rescale_q(start_time, AV_TIME_BASE_Q, 
ost->mux_timebase);
 AVPacket opkt;
 
 av_init_packet(&opkt);
@@ -1116,17 +1115,17 @@ static void do_streamcopy(InputStream *ist, 
OutputStream *ost, const AVPacket *p
 ost->sync_opts++;
 
 if (pkt->pts != AV_NOPTS_VALUE)
-opkt.pts = av_rescale_q(pkt->pts, ist->st->time_base, 
ost->st->time_base) - ost_tb_start_time;
+opkt.pts = av_rescale_q(pkt->pts, ist->st->time_base, 
ost->mux_timebase) - ost_tb_start_time;
 else
 opkt.pts = AV_NOPTS_VALUE;
 
 if (pkt->dts == AV_NOPTS_VALUE)
-opkt.dts = av_rescale_q(ist->last_dts, AV_TIME_BASE_Q, 
ost->st->time_base);
+opkt.dts = av_rescale_q(ist->last_dts, AV_TIME_BASE_Q, 
ost->mux_timebase);
 else
-opkt.dts = av_rescale_q(pkt->dts, ist->st->time_base, 
ost->st->time_base);
+opkt.dts = av_rescale_q(pkt->dts, ist->st->time_base, 
ost->mux_timebase);
 opkt.dts -= ost_tb_start_time;
 
-opkt.duration = av_rescale_q(pkt->duration, ist->st->time_base, 
ost->st->time_base);
+opkt.duration = av_rescale_q(pkt->duration, ist->st->time_base, 
ost->mux_timebase);
 opkt.flags= pkt->flags;
 
 // FIXME remove the following 2 lines they shall be replaced by the 
bitstream filters
@@ -2110,6 +2109,8 @@ static int init_output_stream(OutputStream *ost, char 
*error, int error_len)
 if (ret < 0)
 return ret;
 
+ost->mux_timebase = ost->st->time_base;
+
 ost->initialized = 1;
 
 ret = check_init_output_file(output_files[ost->file_index], 
ost->file_index);
diff --git a/avconv.h b/avc

[FFmpeg-cvslog] Merge commit 'a3a0230a9870b9018dc7415ae5872784d524cfe5'

2016-11-13 Thread Hendrik Leppkes
ffmpeg | branch: master | Hendrik Leppkes  | Sun Nov 13 
17:25:05 2016 +0100| [7c282d0c758dc5e9593312da1c191cdf76de0303] | committer: 
Hendrik Leppkes

Merge commit 'a3a0230a9870b9018dc7415ae5872784d524cfe5'

* commit 'a3a0230a9870b9018dc7415ae5872784d524cfe5':
  avconv: init filtergraphs only after we have a frame on each input

This commit is a noop since it doesn't apply cleanly due to differences
in the dataflow between avconv and ffmpeg, and thus fixing this in the
scope of a merge is unfeasible.

Merged-by: Hendrik Leppkes 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7c282d0c758dc5e9593312da1c191cdf76de0303
---



___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] avconv: init filtergraphs only after we have a frame on each input

2016-11-13 Thread Anton Khirnov
ffmpeg | branch: master | Anton Khirnov  | Fri May 27 
12:14:33 2016 +0200| [a3a0230a9870b9018dc7415ae5872784d524cfe5] | committer: 
Anton Khirnov

avconv: init filtergraphs only after we have a frame on each input

This makes sure the actual stream parameters are used, which is
important mainly for hardware decoding+filtering cases, which would
previously require various weird workarounds to handle the fact that a
fake software graph has to be constructed, but never used.
This should also improve behaviour in rare cases where
avformat_find_stream_info() does not provide accurate information.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a3a0230a9870b9018dc7415ae5872784d524cfe5
---

 avconv.c| 245 
 avconv.h|  11 +--
 avconv_filter.c |  33 ++--
 avconv_opt.c|  44 --
 avconv_qsv.c|   1 -
 5 files changed, 134 insertions(+), 200 deletions(-)

diff --git a/avconv.c b/avconv.c
index 8913d85..65eabbd 100644
--- a/avconv.c
+++ b/avconv.c
@@ -147,6 +147,13 @@ static void avconv_cleanup(int ret)
 FilterGraph *fg = filtergraphs[i];
 avfilter_graph_free(&fg->graph);
 for (j = 0; j < fg->nb_inputs; j++) {
+while (av_fifo_size(fg->inputs[j]->frame_queue)) {
+AVFrame *frame;
+av_fifo_generic_read(fg->inputs[j]->frame_queue, &frame,
+ sizeof(frame), NULL);
+av_frame_free(&frame);
+}
+av_fifo_free(fg->inputs[j]->frame_queue);
 av_buffer_unref(&fg->inputs[j]->hw_frames_ctx);
 av_freep(&fg->inputs[j]->name);
 av_freep(&fg->inputs[j]);
@@ -656,6 +663,8 @@ FF_ENABLE_DEPRECATION_WARNINGS
 }
 }
 
+static int init_output_stream(OutputStream *ost, char *error, int error_len);
+
 /*
  * Read one frame for lavfi output for ost and encode it.
  */
@@ -670,6 +679,16 @@ static int poll_filter(OutputStream *ost)
 }
 filtered_frame = ost->filtered_frame;
 
+if (!ost->initialized) {
+char error[1024];
+ret = init_output_stream(ost, error, sizeof(error));
+if (ret < 0) {
+av_log(NULL, AV_LOG_ERROR, "Error initializing output stream %d:%d 
-- %s\n",
+   ost->file_index, ost->index, error);
+exit_program(1);
+}
+}
+
 if (ost->enc->type == AVMEDIA_TYPE_AUDIO &&
 !(ost->enc->capabilities & AV_CODEC_CAP_VARIABLE_FRAME_SIZE))
 ret = av_buffersink_get_samples(ost->filter->filter, filtered_frame,
@@ -745,7 +764,8 @@ static int poll_filters(void)
 for (i = 0; i < nb_output_streams; i++) {
 int64_t pts = output_streams[i]->sync_opts;
 
-if (!output_streams[i]->filter || output_streams[i]->finished)
+if (!output_streams[i]->filter || output_streams[i]->finished ||
+!output_streams[i]->filter->graph->graph)
 continue;
 
 pts = av_rescale_q(pts, output_streams[i]->enc_ctx->time_base,
@@ -1150,6 +1170,89 @@ static void do_streamcopy(InputStream *ist, OutputStream 
*ost, const AVPacket *p
 output_packet(of, &opkt, ost);
 }
 
+static int ifilter_send_frame(InputFilter *ifilter, AVFrame *frame)
+{
+FilterGraph *fg = ifilter->graph;
+int need_reinit, ret, i;
+
+/* determine if the parameters for this input changed */
+need_reinit = ifilter->format != frame->format;
+if (!!ifilter->hw_frames_ctx != !!frame->hw_frames_ctx ||
+(ifilter->hw_frames_ctx && ifilter->hw_frames_ctx->data != 
frame->hw_frames_ctx->data))
+need_reinit = 1;
+
+switch (ifilter->ist->st->codecpar->codec_type) {
+case AVMEDIA_TYPE_AUDIO:
+need_reinit |= ifilter->sample_rate!= frame->sample_rate ||
+   ifilter->channel_layout != frame->channel_layout;
+break;
+case AVMEDIA_TYPE_VIDEO:
+need_reinit |= ifilter->width  != frame->width ||
+   ifilter->height != frame->height;
+break;
+}
+
+if (need_reinit) {
+ret = ifilter_parameters_from_frame(ifilter, frame);
+if (ret < 0)
+return ret;
+}
+
+/* (re)init the graph if possible, otherwise buffer the frame and return */
+if (need_reinit || !fg->graph) {
+for (i = 0; i < fg->nb_inputs; i++) {
+if (fg->inputs[i]->format < 0) {
+AVFrame *tmp = av_frame_clone(frame);
+if (!tmp)
+return AVERROR(ENOMEM);
+av_frame_unref(frame);
+
+if (!av_fifo_space(ifilter->frame_queue)) {
+ret = av_fifo_realloc2(ifilter->frame_queue, 2 * 
av_fifo_size(ifilter->frame_queue));
+if (ret < 0)
+return ret;
+}
+av_fifo_generic_write(ifilter->frame_queue, &tmp, sizeof(tmp), 
NULL);
+return 0;
+}
+

[FFmpeg-cvslog] Merge commit '02c2761973dfc886e94a60a9c7d6d30c296d5b8c'

2016-11-13 Thread Hendrik Leppkes
ffmpeg | branch: master | Hendrik Leppkes  | Sun Nov 13 
17:26:53 2016 +0100| [93cd6dd488593116359c78395deef8414dfca799] | committer: 
Hendrik Leppkes

Merge commit '02c2761973dfc886e94a60a9c7d6d30c296d5b8c'

* commit '02c2761973dfc886e94a60a9c7d6d30c296d5b8c':
  avconv_qsv: use the device creation API

Not merged, our ffmpeg hwaccel infra is not quite the same as avconvs.

Merged-by: Hendrik Leppkes 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=93cd6dd488593116359c78395deef8414dfca799
---



___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] doc: update merge status for recent additions and skipped merges

2016-11-13 Thread Hendrik Leppkes
ffmpeg | branch: master | Hendrik Leppkes  | Sun Nov 13 
17:29:01 2016 +0100| [53e116eeeb1bdd579c1aa43b14b49dc6cb7b6d6e] | committer: 
Hendrik Leppkes

doc: update merge status for recent additions and skipped merges

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=53e116eeeb1bdd579c1aa43b14b49dc6cb7b6d6e
---

 doc/libav-merge.txt | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/doc/libav-merge.txt b/doc/libav-merge.txt
index 962a98b..f5a5b29 100644
--- a/doc/libav-merge.txt
+++ b/doc/libav-merge.txt
@@ -88,7 +88,8 @@ Stuff that didn't reach the codebase:
 -
 
 - HEVC DSP and x86 MC SIMD improvements from Libav (see 
https://ffmpeg.org/pipermail/ffmpeg-devel/2015-December/184777.html)
-- QSV HWContext integration (04b17ff and 130e1f1), QSV scaling filter (62c58c5)
+- QSV scaling filter (62c58c5)
+- ffmpeg.c filter init decoupling (3e265ca & a3a0230)
 
 Collateral damage that needs work locally:
 --

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] avconv_qsv: use the device creation API

2016-11-13 Thread Anton Khirnov
ffmpeg | branch: master | Anton Khirnov  | Sun May 22 
09:40:46 2016 +0200| [02c2761973dfc886e94a60a9c7d6d30c296d5b8c] | committer: 
Anton Khirnov

avconv_qsv: use the device creation API

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=02c2761973dfc886e94a60a9c7d6d30c296d5b8c
---

 avconv_qsv.c | 247 +--
 1 file changed, 38 insertions(+), 209 deletions(-)

diff --git a/avconv_qsv.c b/avconv_qsv.c
index ab1d9f8..8272f17 100644
--- a/avconv_qsv.c
+++ b/avconv_qsv.c
@@ -20,248 +20,77 @@
 #include 
 
 #include "libavutil/dict.h"
+#include "libavutil/hwcontext.h"
+#include "libavutil/hwcontext_qsv.h"
 #include "libavutil/mem.h"
 #include "libavutil/opt.h"
 #include "libavcodec/qsv.h"
 
 #include "avconv.h"
 
-typedef struct QSVContext {
-OutputStream *ost;
-
-mfxSession session;
-
-mfxExtOpaqueSurfaceAlloc opaque_alloc;
-AVBufferRef *opaque_surfaces_buf;
-
-uint8_t   *surface_used;
-mfxFrameSurface1 **surface_ptrs;
-int nb_surfaces;
-
-mfxExtBuffer *ext_buffers[1];
-} QSVContext;
-
-static void buffer_release(void *opaque, uint8_t *data)
-{
-*(uint8_t*)opaque = 0;
-}
-
 static int qsv_get_buffer(AVCodecContext *s, AVFrame *frame, int flags)
 {
 InputStream *ist = s->opaque;
-QSVContext  *qsv = ist->hwaccel_ctx;
-int i;
 
-for (i = 0; i < qsv->nb_surfaces; i++) {
-if (qsv->surface_used[i])
-continue;
-
-frame->buf[0] = av_buffer_create((uint8_t*)qsv->surface_ptrs[i], 
sizeof(*qsv->surface_ptrs[i]),
- buffer_release, 
&qsv->surface_used[i], 0);
-if (!frame->buf[0])
-return AVERROR(ENOMEM);
-frame->data[3]   = (uint8_t*)qsv->surface_ptrs[i];
-qsv->surface_used[i] = 1;
-return 0;
-}
-
-return AVERROR(ENOMEM);
-}
-
-static int init_opaque_surf(QSVContext *qsv)
-{
-AVQSVContext *hwctx_enc = qsv->ost->enc_ctx->hwaccel_context;
-mfxFrameSurface1 *surfaces;
-int i;
-
-qsv->nb_surfaces = hwctx_enc->nb_opaque_surfaces;
-
-qsv->opaque_surfaces_buf = av_buffer_ref(hwctx_enc->opaque_surfaces);
-qsv->surface_ptrs= av_mallocz_array(qsv->nb_surfaces, 
sizeof(*qsv->surface_ptrs));
-qsv->surface_used= av_mallocz_array(qsv->nb_surfaces, 
sizeof(*qsv->surface_used));
-if (!qsv->opaque_surfaces_buf || !qsv->surface_ptrs || !qsv->surface_used)
-return AVERROR(ENOMEM);
-
-surfaces = (mfxFrameSurface1*)qsv->opaque_surfaces_buf->data;
-for (i = 0; i < qsv->nb_surfaces; i++)
-qsv->surface_ptrs[i] = surfaces + i;
-
-qsv->opaque_alloc.Out.Surfaces   = qsv->surface_ptrs;
-qsv->opaque_alloc.Out.NumSurface = qsv->nb_surfaces;
-qsv->opaque_alloc.Out.Type   = hwctx_enc->opaque_alloc_type;
-
-qsv->opaque_alloc.Header.BufferId = MFX_EXTBUFF_OPAQUE_SURFACE_ALLOCATION;
-qsv->opaque_alloc.Header.BufferSz = sizeof(qsv->opaque_alloc);
-qsv->ext_buffers[0]   = (mfxExtBuffer*)&qsv->opaque_alloc;
-
-return 0;
+return av_hwframe_get_buffer(ist->hw_frames_ctx, frame, 0);
 }
 
 static void qsv_uninit(AVCodecContext *s)
 {
 InputStream *ist = s->opaque;
-QSVContext  *qsv = ist->hwaccel_ctx;
-
-av_freep(&qsv->ost->enc_ctx->hwaccel_context);
-av_freep(&s->hwaccel_context);
-
-av_buffer_unref(&qsv->opaque_surfaces_buf);
-av_freep(&qsv->surface_used);
-av_freep(&qsv->surface_ptrs);
-
-av_freep(&qsv);
+av_buffer_unref(&ist->hw_frames_ctx);
 }
 
-int qsv_init(AVCodecContext *s)
+static int qsv_device_init(InputStream *ist)
 {
-InputStream *ist = s->opaque;
-QSVContext  *qsv = ist->hwaccel_ctx;
-AVQSVContext *hwctx_dec;
-int ret;
+int err;
 
-if (!qsv) {
-av_log(NULL, AV_LOG_ERROR, "QSV transcoding is not initialized. "
-   "-hwaccel qsv should only be used for one-to-one QSV 
transcoding "
-   "with no filters.\n");
-return AVERROR_BUG;
+err = av_hwdevice_ctx_create(&hw_device_ctx, AV_HWDEVICE_TYPE_QSV,
+ ist->hwaccel_device, NULL, 0);
+if (err < 0) {
+av_log(NULL, AV_LOG_ERROR, "Error creating a QSV device\n");
+return err;
 }
 
-ret = init_opaque_surf(qsv);
-if (ret < 0)
-return ret;
-
-hwctx_dec = av_qsv_alloc_context();
-if (!hwctx_dec)
-return AVERROR(ENOMEM);
-
-hwctx_dec->session= qsv->session;
-hwctx_dec->iopattern  = MFX_IOPATTERN_OUT_OPAQUE_MEMORY;
-hwctx_dec->ext_buffers= qsv->ext_buffers;
-hwctx_dec->nb_ext_buffers = FF_ARRAY_ELEMS(qsv->ext_buffers);
-
-av_freep(&s->hwaccel_context);
-s->hwaccel_context = hwctx_dec;
-
-ist->hwaccel_get_buffer = qsv_get_buffer;
-ist->hwaccel_uninit = qsv_uninit;
-
 return 0;
 }
 
-static mfxIMPL choose_implementation(const InputStream *ist)
+int qsv_init(AVCodecContext *s)
 {
-static const struc

[FFmpeg-cvslog] libavcodec: fix constness in clobber test avcodec_open2() wrappers

2016-11-13 Thread Clément Bœsch
ffmpeg | branch: master | Clément Bœsch  | Sat Jun 25 13:41:13 
2016 +0200| [4a081f224e12f4227ae966bcbdd5384f22121ecf] | committer: Martin 
Storsjö

libavcodec: fix constness in clobber test avcodec_open2() wrappers

Signed-off-by: Martin Storsjö 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4a081f224e12f4227ae966bcbdd5384f22121ecf
---

 libavcodec/aarch64/neontest.c | 2 +-
 libavcodec/arm/neontest.c | 2 +-
 libavcodec/x86/w64xmmtest.c   | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavcodec/aarch64/neontest.c b/libavcodec/aarch64/neontest.c
index 0414829..137c8e6 100644
--- a/libavcodec/aarch64/neontest.c
+++ b/libavcodec/aarch64/neontest.c
@@ -23,7 +23,7 @@
 #include "libavutil/aarch64/neontest.h"
 
 wrap(avcodec_open2(AVCodecContext *avctx,
-   AVCodec *codec,
+   const AVCodec *codec,
AVDictionary **options))
 {
 testneonclobbers(avcodec_open2, avctx, codec, options);
diff --git a/libavcodec/arm/neontest.c b/libavcodec/arm/neontest.c
index b77bcd7..692576e 100644
--- a/libavcodec/arm/neontest.c
+++ b/libavcodec/arm/neontest.c
@@ -23,7 +23,7 @@
 #include "libavutil/arm/neontest.h"
 
 wrap(avcodec_open2(AVCodecContext *avctx,
-   AVCodec *codec,
+   const AVCodec *codec,
AVDictionary **options))
 {
 testneonclobbers(avcodec_open2, avctx, codec, options);
diff --git a/libavcodec/x86/w64xmmtest.c b/libavcodec/x86/w64xmmtest.c
index 2f064ca..400dc4d 100644
--- a/libavcodec/x86/w64xmmtest.c
+++ b/libavcodec/x86/w64xmmtest.c
@@ -23,7 +23,7 @@
 #include "libavutil/x86/w64xmmtest.h"
 
 wrap(avcodec_open2(AVCodecContext *avctx,
-   AVCodec *codec,
+   const AVCodec *codec,
AVDictionary **options))
 {
 testxmmclobbers(avcodec_open2, avctx, codec, options);

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] Merge commit '4a081f224e12f4227ae966bcbdd5384f22121ecf'

2016-11-13 Thread Hendrik Leppkes
ffmpeg | branch: master | Hendrik Leppkes  | Sun Nov 13 
17:30:33 2016 +0100| [db854c6c4a6ca0d0b29a688a930d4afedf060417] | committer: 
Hendrik Leppkes

Merge commit '4a081f224e12f4227ae966bcbdd5384f22121ecf'

* commit '4a081f224e12f4227ae966bcbdd5384f22121ecf':
  libavcodec: fix constness in clobber test avcodec_open2() wrappers

Merged-by: Hendrik Leppkes 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=db854c6c4a6ca0d0b29a688a930d4afedf060417
---

 libavcodec/x86/w64xmmtest.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/x86/w64xmmtest.c b/libavcodec/x86/w64xmmtest.c
index 7d4a663..987fa51 100644
--- a/libavcodec/x86/w64xmmtest.c
+++ b/libavcodec/x86/w64xmmtest.c
@@ -23,7 +23,7 @@
 #include "libavutil/x86/w64xmmtest.h"
 
 wrap(avcodec_open2(AVCodecContext *avctx,
-   AVCodec *codec,
+   const AVCodec *codec,
AVDictionary **options))
 {
 testxmmclobbers(avcodec_open2, avctx, codec, options);


==


___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] Merge commit 'bd31c61cf94d01dbe1051cf65874e7b2c0ac5454'

2016-11-13 Thread Hendrik Leppkes
ffmpeg | branch: master | Hendrik Leppkes  | Sun Nov 13 
17:33:31 2016 +0100| [c17563c5d3c974a69709ebae0171534763b3051c] | committer: 
Hendrik Leppkes

Merge commit 'bd31c61cf94d01dbe1051cf65874e7b2c0ac5454'

* commit 'bd31c61cf94d01dbe1051cf65874e7b2c0ac5454':
  avconv: Remove hw_device_ctx output filter reinit hack

Noop, since our hwaccel infrastructure still requires this.

Merged-by: Hendrik Leppkes 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c17563c5d3c974a69709ebae0171534763b3051c
---



___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] avconv: Remove hw_device_ctx output filter reinit hack

2016-11-13 Thread Mark Thompson
ffmpeg | branch: master | Mark Thompson  | Thu Jun 23 01:40:04 
2016 +0100| [bd31c61cf94d01dbe1051cf65874e7b2c0ac5454] | committer: Mark 
Thompson

avconv: Remove hw_device_ctx output filter reinit hack

Not needed any more because we no longer have any useful case which
will reinitialise with hardware frames here.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=bd31c61cf94d01dbe1051cf65874e7b2c0ac5454
---

 avconv_filter.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/avconv_filter.c b/avconv_filter.c
index 9c983c0..f7ce76f 100644
--- a/avconv_filter.c
+++ b/avconv_filter.c
@@ -317,7 +317,7 @@ static int configure_output_video_filter(FilterGraph *fg, 
OutputFilter *ofilter,
 if (ret < 0)
 return ret;
 
-if (!hw_device_ctx && (ofilter->width || ofilter->height)) {
+if (ofilter->width || ofilter->height) {
 char args[255];
 AVFilterContext *filter;
 

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] vaapi_encode: Maintain a pool of bitstream output buffers

2016-11-13 Thread Mark Thompson
ffmpeg | branch: master | Mark Thompson  | Sun Jun  5 17:18:04 
2016 +0100| [8a62d2c28fbacd1ae20c35887a1eecba2be14371] | committer: Mark 
Thompson

vaapi_encode: Maintain a pool of bitstream output buffers

Previously we would allocate a new one for every frame.  This instead
maintains an AVBufferPool of them to use as-needed.

Also makes the maximum size of an output buffer adapt to the frame
size - the fixed upper bound was a bit too easy to hit when encoding
large pictures at high quality.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8a62d2c28fbacd1ae20c35887a1eecba2be14371
---

 libavcodec/vaapi_encode.c | 90 +--
 libavcodec/vaapi_encode.h |  4 ++-
 2 files changed, 75 insertions(+), 19 deletions(-)

diff --git a/libavcodec/vaapi_encode.c b/libavcodec/vaapi_encode.c
index c3f4e44..7d56145 100644
--- a/libavcodec/vaapi_encode.c
+++ b/libavcodec/vaapi_encode.c
@@ -178,16 +178,12 @@ static int vaapi_encode_issue(AVCodecContext *avctx,
 pic->recon_surface = (VASurfaceID)(uintptr_t)pic->recon_image->data[3];
 av_log(avctx, AV_LOG_DEBUG, "Recon surface is %#x.\n", pic->recon_surface);
 
-vas = vaCreateBuffer(ctx->hwctx->display, ctx->va_context,
- VAEncCodedBufferType,
- MAX_OUTPUT_BUFFER_SIZE, 1, 0,
- &pic->output_buffer);
-if (vas != VA_STATUS_SUCCESS) {
-av_log(avctx, AV_LOG_ERROR, "Failed to create bitstream "
-   "output buffer: %d (%s).\n", vas, vaErrorStr(vas));
+pic->output_buffer_ref = av_buffer_pool_get(ctx->output_buffer_pool);
+if (!pic->output_buffer_ref) {
 err = AVERROR(ENOMEM);
 goto fail;
 }
+pic->output_buffer = (VABufferID)(uintptr_t)pic->output_buffer_ref->data;
 av_log(avctx, AV_LOG_DEBUG, "Output buffer is %#x.\n",
pic->output_buffer);
 
@@ -438,7 +434,7 @@ static int vaapi_encode_output(AVCodecContext *avctx,
 
 err = av_new_packet(pkt, buf->size);
 if (err < 0)
-goto fail;
+goto fail_mapped;
 
 memcpy(pkt->data, buf->buf, buf->size);
 }
@@ -456,35 +452,32 @@ static int vaapi_encode_output(AVCodecContext *avctx,
 goto fail;
 }
 
-vaDestroyBuffer(ctx->hwctx->display, pic->output_buffer);
+av_buffer_unref(&pic->output_buffer_ref);
 pic->output_buffer = VA_INVALID_ID;
 
 av_log(avctx, AV_LOG_DEBUG, "Output read for pic %"PRId64"/%"PRId64".\n",
pic->display_order, pic->encode_order);
 return 0;
 
+fail_mapped:
+vaUnmapBuffer(ctx->hwctx->display, pic->output_buffer);
 fail:
-if (pic->output_buffer != VA_INVALID_ID) {
-vaUnmapBuffer(ctx->hwctx->display, pic->output_buffer);
-vaDestroyBuffer(ctx->hwctx->display, pic->output_buffer);
-pic->output_buffer = VA_INVALID_ID;
-}
+av_buffer_unref(&pic->output_buffer_ref);
+pic->output_buffer = VA_INVALID_ID;
 return err;
 }
 
 static int vaapi_encode_discard(AVCodecContext *avctx,
 VAAPIEncodePicture *pic)
 {
-VAAPIEncodeContext *ctx = avctx->priv_data;
-
 vaapi_encode_wait(avctx, pic);
 
-if (pic->output_buffer != VA_INVALID_ID) {
+if (pic->output_buffer_ref) {
 av_log(avctx, AV_LOG_DEBUG, "Discard output for pic "
"%"PRId64"/%"PRId64".\n",
pic->display_order, pic->encode_order);
 
-vaDestroyBuffer(ctx->hwctx->display, pic->output_buffer);
+av_buffer_unref(&pic->output_buffer_ref);
 pic->output_buffer = VA_INVALID_ID;
 }
 
@@ -1025,6 +1018,57 @@ fail:
 return err;
 }
 
+static void vaapi_encode_free_output_buffer(void *opaque,
+uint8_t *data)
+{
+AVCodecContext   *avctx = opaque;
+VAAPIEncodeContext *ctx = avctx->priv_data;
+VABufferID buffer_id;
+
+buffer_id = (VABufferID)(uintptr_t)data;
+
+vaDestroyBuffer(ctx->hwctx->display, buffer_id);
+
+av_log(avctx, AV_LOG_DEBUG, "Freed output buffer %#x\n", buffer_id);
+}
+
+static AVBufferRef *vaapi_encode_alloc_output_buffer(void *opaque,
+ int size)
+{
+AVCodecContext   *avctx = opaque;
+VAAPIEncodeContext *ctx = avctx->priv_data;
+VABufferID buffer_id;
+VAStatus vas;
+AVBufferRef *ref;
+
+// The output buffer size is fixed, so it needs to be large enough
+// to hold the largest possible compressed frame.  We assume here
+// that the uncompressed frame plus some header data is an upper
+// bound on that.
+vas = vaCreateBuffer(ctx->hwctx->display, ctx->va_context,
+ VAEncCodedBufferType,
+ 3 * ctx->aligned_width * ctx->aligned_height +
+ (1 << 16), 1, 0, &buffer_id);
+if (vas != VA_STATUS_SUCCESS) {
+av_log(avctx, AV_LOG_ERROR, "Failed to create bitstream "
+   "output buffer: %d (%s

[FFmpeg-cvslog] Merge commit '8a62d2c28fbacd1ae20c35887a1eecba2be14371'

2016-11-13 Thread Hendrik Leppkes
ffmpeg | branch: master | Hendrik Leppkes  | Sun Nov 13 
17:38:40 2016 +0100| [724a71dced1c211fc64105ec9f1fb99d79f6ff35] | committer: 
Hendrik Leppkes

Merge commit '8a62d2c28fbacd1ae20c35887a1eecba2be14371'

* commit '8a62d2c28fbacd1ae20c35887a1eecba2be14371':
  vaapi_encode: Maintain a pool of bitstream output buffers

Merged-by: Hendrik Leppkes 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=724a71dced1c211fc64105ec9f1fb99d79f6ff35
---

 libavcodec/vaapi_encode.c | 90 +--
 libavcodec/vaapi_encode.h |  4 ++-
 2 files changed, 75 insertions(+), 19 deletions(-)

diff --git a/libavcodec/vaapi_encode.c b/libavcodec/vaapi_encode.c
index 21a8656..f8d848b 100644
--- a/libavcodec/vaapi_encode.c
+++ b/libavcodec/vaapi_encode.c
@@ -178,16 +178,12 @@ static int vaapi_encode_issue(AVCodecContext *avctx,
 pic->recon_surface = (VASurfaceID)(uintptr_t)pic->recon_image->data[3];
 av_log(avctx, AV_LOG_DEBUG, "Recon surface is %#x.\n", pic->recon_surface);
 
-vas = vaCreateBuffer(ctx->hwctx->display, ctx->va_context,
- VAEncCodedBufferType,
- MAX_OUTPUT_BUFFER_SIZE, 1, 0,
- &pic->output_buffer);
-if (vas != VA_STATUS_SUCCESS) {
-av_log(avctx, AV_LOG_ERROR, "Failed to create bitstream "
-   "output buffer: %d (%s).\n", vas, vaErrorStr(vas));
+pic->output_buffer_ref = av_buffer_pool_get(ctx->output_buffer_pool);
+if (!pic->output_buffer_ref) {
 err = AVERROR(ENOMEM);
 goto fail;
 }
+pic->output_buffer = (VABufferID)(uintptr_t)pic->output_buffer_ref->data;
 av_log(avctx, AV_LOG_DEBUG, "Output buffer is %#x.\n",
pic->output_buffer);
 
@@ -438,7 +434,7 @@ static int vaapi_encode_output(AVCodecContext *avctx,
 
 err = av_new_packet(pkt, buf->size);
 if (err < 0)
-goto fail;
+goto fail_mapped;
 
 memcpy(pkt->data, buf->buf, buf->size);
 }
@@ -456,35 +452,32 @@ static int vaapi_encode_output(AVCodecContext *avctx,
 goto fail;
 }
 
-vaDestroyBuffer(ctx->hwctx->display, pic->output_buffer);
+av_buffer_unref(&pic->output_buffer_ref);
 pic->output_buffer = VA_INVALID_ID;
 
 av_log(avctx, AV_LOG_DEBUG, "Output read for pic %"PRId64"/%"PRId64".\n",
pic->display_order, pic->encode_order);
 return 0;
 
+fail_mapped:
+vaUnmapBuffer(ctx->hwctx->display, pic->output_buffer);
 fail:
-if (pic->output_buffer != VA_INVALID_ID) {
-vaUnmapBuffer(ctx->hwctx->display, pic->output_buffer);
-vaDestroyBuffer(ctx->hwctx->display, pic->output_buffer);
-pic->output_buffer = VA_INVALID_ID;
-}
+av_buffer_unref(&pic->output_buffer_ref);
+pic->output_buffer = VA_INVALID_ID;
 return err;
 }
 
 static int vaapi_encode_discard(AVCodecContext *avctx,
 VAAPIEncodePicture *pic)
 {
-VAAPIEncodeContext *ctx = avctx->priv_data;
-
 vaapi_encode_wait(avctx, pic);
 
-if (pic->output_buffer != VA_INVALID_ID) {
+if (pic->output_buffer_ref) {
 av_log(avctx, AV_LOG_DEBUG, "Discard output for pic "
"%"PRId64"/%"PRId64".\n",
pic->display_order, pic->encode_order);
 
-vaDestroyBuffer(ctx->hwctx->display, pic->output_buffer);
+av_buffer_unref(&pic->output_buffer_ref);
 pic->output_buffer = VA_INVALID_ID;
 }
 
@@ -1025,6 +1018,57 @@ fail:
 return err;
 }
 
+static void vaapi_encode_free_output_buffer(void *opaque,
+uint8_t *data)
+{
+AVCodecContext   *avctx = opaque;
+VAAPIEncodeContext *ctx = avctx->priv_data;
+VABufferID buffer_id;
+
+buffer_id = (VABufferID)(uintptr_t)data;
+
+vaDestroyBuffer(ctx->hwctx->display, buffer_id);
+
+av_log(avctx, AV_LOG_DEBUG, "Freed output buffer %#x\n", buffer_id);
+}
+
+static AVBufferRef *vaapi_encode_alloc_output_buffer(void *opaque,
+ int size)
+{
+AVCodecContext   *avctx = opaque;
+VAAPIEncodeContext *ctx = avctx->priv_data;
+VABufferID buffer_id;
+VAStatus vas;
+AVBufferRef *ref;
+
+// The output buffer size is fixed, so it needs to be large enough
+// to hold the largest possible compressed frame.  We assume here
+// that the uncompressed frame plus some header data is an upper
+// bound on that.
+vas = vaCreateBuffer(ctx->hwctx->display, ctx->va_context,
+ VAEncCodedBufferType,
+ 3 * ctx->aligned_width * ctx->aligned_height +
+ (1 << 16), 1, 0, &buffer_id);
+if (vas != VA_STATUS_SUCCESS) {
+av_log(avctx, AV_LOG_ERROR, "Failed to create bitstream "
+   "output buffer: %d (%s).\n", vas, vaErrorStr(vas));
+return NULL;
+}
+
+av_log(avctx, AV_LOG_DEBUG, "Allocated output buffer %#x\n", buffer_id);
+
+r

[FFmpeg-cvslog] pixdesc: Add aliases to SMPTE color properties

2016-11-13 Thread Vittorio Giovara
ffmpeg | branch: master | Vittorio Giovara  | Tue 
Jun 21 10:22:57 2016 -0400| [f172e22d6aed0bff36e975bafb0183b6779f9444] | 
committer: Vittorio Giovara

pixdesc: Add aliases to SMPTE color properties

Drop ST from names and symbols, it does not add anything distinctive or
descriptive.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f172e22d6aed0bff36e975bafb0183b6779f9444
---

 libavcodec/options_table.h | 9 ++---
 libavcodec/version.h   | 2 +-
 libavutil/pixdesc.c| 6 +++---
 libavutil/pixfmt.h | 9 ++---
 libavutil/version.h| 2 +-
 5 files changed, 17 insertions(+), 11 deletions(-)

diff --git a/libavcodec/options_table.h b/libavcodec/options_table.h
index beebe18..6f7fb96 100644
--- a/libavcodec/options_table.h
+++ b/libavcodec/options_table.h
@@ -435,9 +435,10 @@ static const AVOption avcodec_options[] = {
 {"smpte240m",   "SMPTE 240 M", 0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_PRI_SMPTE240M },   INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
 {"film","Film",0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_PRI_FILM }, 
   INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
 {"bt2020",  "BT.2020", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_PRI_BT2020 
},  INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
-{"smptest428_1", "SMPTE ST 428-1", 0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_PRI_SMPTEST428_1 }, INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
+{"smpte428","SMPTE 428-1", 0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_PRI_SMPTE428 },   INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
 {"smpte431","SMPTE 431-2", 0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_PRI_SMPTE431 },INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
 {"smpte432","SMPTE 422-1", 0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_PRI_SMPTE432 },INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
+{"smptest428_1", "SMPTE 428-1", 0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_PRI_SMPTE428 },   INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
 {"color_trc", "color transfer characteristics", OFFSET(color_trc), 
AV_OPT_TYPE_INT, {.i64 = AVCOL_TRC_UNSPECIFIED }, 1, AVCOL_TRC_NB-1, V|E|D, 
"color_trc_type"},
 {"bt709","BT.709",   0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_BT709 },INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
 {"unspecified",  "Unspecified",  0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_UNSPECIFIED },  INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
@@ -453,9 +454,11 @@ static const AVOption avcodec_options[] = {
 {"iec61966_2_1", "IEC 61966-2-1",0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_IEC61966_2_1 }, INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
 {"bt2020_10bit", "BT.2020 - 10 bit", 0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_BT2020_10 },INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
 {"bt2020_12bit", "BT.2020 - 12 bit", 0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_BT2020_12 },INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
-{"smptest2084",  "SMPTE ST 2084",0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_SMPTEST2084 },  INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
-{"smptest428_1", "SMPTE ST 428-1",   0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_SMPTEST428_1 }, INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
+{"smpte2084","SMPTE 2084",   0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_SMPTE2084 },INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
+{"smpte428", "SMPTE 428-1",  0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_SMPTE428 }, INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
 {"arib-std-b67", "ARIB STD-B67", 0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_ARIB_STD_B67 }, INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
+{"smptest2084",  "SMPTE 2084",   0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_SMPTE2084 },INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
+{"smptest428_1", "SMPTE 428-1",  0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_SMPTE428 }, INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
 {"colorspace", "color space", OFFSET(colorspace), AV_OPT_TYPE_INT, {.i64 = 
AVCOL_SPC_UNSPECIFIED }, 0, AVCOL_SPC_NB-1, V|E|D, "colorspace_type"},
 {"rgb", "RGB", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_SPC_RGB },  
   INT_MIN, INT_MAX, V|E|D, "colorspace_type"},
 {"bt709",   "BT.709",  0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_SPC_BT709 
},   INT_MIN, INT_MAX, V|E|D, "colorspace_type"},
diff --git a/libavcodec/version.h b/libavcodec/version.h
index 3b154f8..6cc7793 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -29,7 +29,7 @@
 
 #define LIBAVCODEC_VERSION_MAJOR 57
 #define LIBAVCODEC_VERSION_MINOR 24
-#define LIBAVCODEC_VERSION_MICRO  0
+#define LIBAVCODEC_VERSION_MICRO  1
 
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \
diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c
index 4e52067..f43f2a8 100644
--- a/libavutil/pixdesc.c
+++ b/libavutil/pixdesc.c
@@ -1612,7 +1612,7 @@ static const char *color_primaries_names[] = {
 [AVCOL_PRI_SMPTE240M] = "smpte240m"

[FFmpeg-cvslog] Merge commit 'f172e22d6aed0bff36e975bafb0183b6779f9444'

2016-11-13 Thread Hendrik Leppkes
ffmpeg | branch: master | Hendrik Leppkes  | Sun Nov 13 
18:32:07 2016 +0100| [2d7cf6f72ba20479109799e4cc9169b95e1b643d] | committer: 
Hendrik Leppkes

Merge commit 'f172e22d6aed0bff36e975bafb0183b6779f9444'

* commit 'f172e22d6aed0bff36e975bafb0183b6779f9444':
  pixdesc: Add aliases to SMPTE color properties

Merged-by: Hendrik Leppkes 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2d7cf6f72ba20479109799e4cc9169b95e1b643d
---

 libavcodec/options_table.h | 8 +---
 libavcodec/version.h   | 2 +-
 libavutil/pixdesc.c| 6 +++---
 libavutil/pixfmt.h | 9 ++---
 libavutil/version.h| 2 +-
 5 files changed, 16 insertions(+), 11 deletions(-)

diff --git a/libavcodec/options_table.h b/libavcodec/options_table.h
index 4323ae9..e0f16e3 100644
--- a/libavcodec/options_table.h
+++ b/libavcodec/options_table.h
@@ -460,7 +460,8 @@ static const AVOption avcodec_options[] = {
 {"smpte240m",   "SMPTE 240 M",0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_PRI_SMPTE240M },INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
 {"film","Film",   0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_PRI_FILM 
}, INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
 {"bt2020",  "BT.2020",0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_PRI_BT2020 },   INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
-{"smpte428_1",  "SMPTE ST 428-1", 0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_PRI_SMPTEST428_1 }, INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
+{"smpte428","SMPTE 428-1",0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_PRI_SMPTE428 }, INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
+{"smpte428_1",  "SMPTE 428-1",0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_PRI_SMPTE428 }, INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
 {"smpte431","SMPTE 431-2",0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_PRI_SMPTE431 }, INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
 {"smpte432","SMPTE 422-1",0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_PRI_SMPTE432 }, INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
 {"color_trc", "color transfer characteristics", OFFSET(color_trc), 
AV_OPT_TYPE_INT, {.i64 = AVCOL_TRC_UNSPECIFIED }, 1, AVCOL_TRC_NB-1, V|E|D, 
"color_trc_type"},
@@ -478,8 +479,9 @@ static const AVOption avcodec_options[] = {
 {"iec61966_2_1", "IEC 61966-2-1",0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_IEC61966_2_1 }, INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
 {"bt2020_10bit", "BT.2020 - 10 bit", 0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_BT2020_10 },INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
 {"bt2020_12bit", "BT.2020 - 12 bit", 0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_BT2020_12 },INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
-{"smpte2084","SMPTE ST 2084",0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_SMPTEST2084 },  INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
-{"smpte428_1",   "SMPTE ST 428-1",   0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_SMPTEST428_1 }, INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
+{"smpte2084","SMPTE 2084",   0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_SMPTE2084 },INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
+{"smpte428", "SMPTE 428-1",  0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_SMPTE428 }, INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
+{"smpte428_1",   "SMPTE 428-1",  0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_SMPTE428 }, INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
 {"arib-std-b67", "ARIB STD-B67", 0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_ARIB_STD_B67 }, INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
 {"colorspace", "color space", OFFSET(colorspace), AV_OPT_TYPE_INT, {.i64 = 
AVCOL_SPC_UNSPECIFIED }, 0, AVCOL_SPC_NB-1, V|E|D, "colorspace_type"},
 {"rgb", "RGB", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_SPC_RGB },  
   INT_MIN, INT_MAX, V|E|D, "colorspace_type"},
diff --git a/libavcodec/version.h b/libavcodec/version.h
index 9799cfe..e05c310 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -29,7 +29,7 @@
 
 #define LIBAVCODEC_VERSION_MAJOR  57
 #define LIBAVCODEC_VERSION_MINOR  66
-#define LIBAVCODEC_VERSION_MICRO 101
+#define LIBAVCODEC_VERSION_MICRO 102
 
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \
diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c
index f104091..0114037 100644
--- a/libavutil/pixdesc.c
+++ b/libavutil/pixdesc.c
@@ -2135,7 +2135,7 @@ static const char *color_primaries_names[AVCOL_PRI_NB] = {
 [AVCOL_PRI_SMPTE240M] = "smpte240m",
 [AVCOL_PRI_FILM] = "film",
 [AVCOL_PRI_BT2020] = "bt2020",
-[AVCOL_PRI_SMPTEST428_1] = "smpte428-1",
+[AVCOL_PRI_SMPTE428] = "smpte428",
 [AVCOL_PRI_SMPTE431] = "smpte431",
 [AVCOL_PRI_SMPTE432] = "smpte432",
 };
@@ -2157,8 +2157,8 @@ static const char *color_transfer_names[] = {
 [AVCOL_TRC_IEC61966_2_1] = "iec61966-2-1",
 [AVCOL_TRC_BT2020_10] = "bt2020-10",
 [AVCOL_TRC_BT2020_12] = "bt2020-20",
-[AVCOL_TRC_

[FFmpeg-cvslog] pixdesc: Fix AVCOL_TRC_BT2020_12 name

2016-11-13 Thread Vittorio Giovara
ffmpeg | branch: master | Vittorio Giovara  | Tue 
Jun 21 10:22:58 2016 -0400| [444a36269f853844369af0a9836507e5a2780323] | 
committer: Vittorio Giovara

pixdesc: Fix AVCOL_TRC_BT2020_12 name

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=444a36269f853844369af0a9836507e5a2780323
---

 libavutil/pixdesc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c
index f43f2a8..6d9e38d 100644
--- a/libavutil/pixdesc.c
+++ b/libavutil/pixdesc.c
@@ -1633,7 +1633,7 @@ static const char *color_transfer_names[] = {
 [AVCOL_TRC_BT1361_ECG] = "bt1361e",
 [AVCOL_TRC_IEC61966_2_1] = "iec61966-2-1",
 [AVCOL_TRC_BT2020_10] = "bt2020-10",
-[AVCOL_TRC_BT2020_12] = "bt2020-20",
+[AVCOL_TRC_BT2020_12] = "bt2020-12",
 [AVCOL_TRC_SMPTE2084] = "smpte2084",
 [AVCOL_TRC_SMPTE428] = "smpte428",
 [AVCOL_TRC_ARIB_STD_B67] = "arib-std-b67",

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] Merge commit '444a36269f853844369af0a9836507e5a2780323'

2016-11-13 Thread Hendrik Leppkes
ffmpeg | branch: master | Hendrik Leppkes  | Sun Nov 13 
18:38:16 2016 +0100| [411ecb0be66415c74e4bc8ad26e450d5362d2f5c] | committer: 
Hendrik Leppkes

Merge commit '444a36269f853844369af0a9836507e5a2780323'

* commit '444a36269f853844369af0a9836507e5a2780323':
  pixdesc: Fix AVCOL_TRC_BT2020_12 name

Merged-by: Hendrik Leppkes 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=411ecb0be66415c74e4bc8ad26e450d5362d2f5c
---

 libavutil/pixdesc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c
index 0114037..73474be 100644
--- a/libavutil/pixdesc.c
+++ b/libavutil/pixdesc.c
@@ -2156,7 +2156,7 @@ static const char *color_transfer_names[] = {
 [AVCOL_TRC_BT1361_ECG] = "bt1361e",
 [AVCOL_TRC_IEC61966_2_1] = "iec61966-2-1",
 [AVCOL_TRC_BT2020_10] = "bt2020-10",
-[AVCOL_TRC_BT2020_12] = "bt2020-20",
+[AVCOL_TRC_BT2020_12] = "bt2020-12",
 [AVCOL_TRC_SMPTE2084] = "smpte2084",
 [AVCOL_TRC_SMPTE428] = "smpte428",
 [AVCOL_TRC_ARIB_STD_B67] = "arib-std-b67",


==


___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] ffmpeg_qsv: Fix hwaccel transcoding

2016-11-13 Thread Mark Thompson
ffmpeg | branch: master | Mark Thompson  | Sun Nov 13 15:37:52 
2016 +| [03cef34aa2e2ab3681d290e7c5a6634f4058] | committer: Mark 
Thompson

ffmpeg_qsv: Fix hwaccel transcoding

Set up the encoder with a hardware context which will match the one
the decoder will use when it starts later.

Includes 02c2761973dfc886e94a60a9c7d6d30c296d5b8c, with additional
hackery to get around a3a0230a9870b9018dc7415ae5872784d524cfe5 being
skipped.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=03cef34aa2e2ab3681d290e7c5a6634f4058
---

 ffmpeg_qsv.c | 227 ++-
 1 file changed, 69 insertions(+), 158 deletions(-)

diff --git a/ffmpeg_qsv.c b/ffmpeg_qsv.c
index acc54dd..68ff5bd 100644
--- a/ffmpeg_qsv.c
+++ b/ffmpeg_qsv.c
@@ -20,127 +20,74 @@
 #include 
 
 #include "libavutil/dict.h"
+#include "libavutil/hwcontext.h"
+#include "libavutil/hwcontext_qsv.h"
 #include "libavutil/mem.h"
 #include "libavutil/opt.h"
 #include "libavcodec/qsv.h"
 
 #include "ffmpeg.h"
 
-typedef struct QSVContext {
-OutputStream *ost;
-
-mfxSession session;
-
-mfxExtOpaqueSurfaceAlloc opaque_alloc;
-AVBufferRef *opaque_surfaces_buf;
-
-uint8_t   *surface_used;
-mfxFrameSurface1 **surface_ptrs;
-int nb_surfaces;
-
-mfxExtBuffer *ext_buffers[1];
-} QSVContext;
-
-static void buffer_release(void *opaque, uint8_t *data)
-{
-*(uint8_t*)opaque = 0;
-}
-
 static int qsv_get_buffer(AVCodecContext *s, AVFrame *frame, int flags)
 {
 InputStream *ist = s->opaque;
-QSVContext  *qsv = ist->hwaccel_ctx;
-int i;
-
-for (i = 0; i < qsv->nb_surfaces; i++) {
-if (qsv->surface_used[i])
-continue;
-
-frame->buf[0] = av_buffer_create((uint8_t*)qsv->surface_ptrs[i], 
sizeof(*qsv->surface_ptrs[i]),
- buffer_release, 
&qsv->surface_used[i], 0);
-if (!frame->buf[0])
-return AVERROR(ENOMEM);
-frame->data[3]   = (uint8_t*)qsv->surface_ptrs[i];
-qsv->surface_used[i] = 1;
-return 0;
-}
-
-return AVERROR(ENOMEM);
-}
-
-static int init_opaque_surf(QSVContext *qsv)
-{
-AVQSVContext *hwctx_enc = qsv->ost->enc_ctx->hwaccel_context;
-mfxFrameSurface1 *surfaces;
-int i;
-
-qsv->nb_surfaces = hwctx_enc->nb_opaque_surfaces;
-
-qsv->opaque_surfaces_buf = av_buffer_ref(hwctx_enc->opaque_surfaces);
-qsv->surface_ptrs= av_mallocz_array(qsv->nb_surfaces, 
sizeof(*qsv->surface_ptrs));
-qsv->surface_used= av_mallocz_array(qsv->nb_surfaces, 
sizeof(*qsv->surface_used));
-if (!qsv->opaque_surfaces_buf || !qsv->surface_ptrs || !qsv->surface_used)
-return AVERROR(ENOMEM);
-
-surfaces = (mfxFrameSurface1*)qsv->opaque_surfaces_buf->data;
-for (i = 0; i < qsv->nb_surfaces; i++)
-qsv->surface_ptrs[i] = surfaces + i;
-
-qsv->opaque_alloc.Out.Surfaces   = qsv->surface_ptrs;
-qsv->opaque_alloc.Out.NumSurface = qsv->nb_surfaces;
-qsv->opaque_alloc.Out.Type   = hwctx_enc->opaque_alloc_type;
-
-qsv->opaque_alloc.Header.BufferId = MFX_EXTBUFF_OPAQUE_SURFACE_ALLOCATION;
-qsv->opaque_alloc.Header.BufferSz = sizeof(qsv->opaque_alloc);
-qsv->ext_buffers[0]   = (mfxExtBuffer*)&qsv->opaque_alloc;
 
-return 0;
+return av_hwframe_get_buffer(ist->hw_frames_ctx, frame, 0);
 }
 
 static void qsv_uninit(AVCodecContext *s)
 {
 InputStream *ist = s->opaque;
-QSVContext  *qsv = ist->hwaccel_ctx;
+av_buffer_unref(&ist->hw_frames_ctx);
+}
 
-av_freep(&qsv->ost->enc_ctx->hwaccel_context);
-av_freep(&s->hwaccel_context);
+static int qsv_device_init(InputStream *ist)
+{
+int err;
 
-av_buffer_unref(&qsv->opaque_surfaces_buf);
-av_freep(&qsv->surface_used);
-av_freep(&qsv->surface_ptrs);
+err = av_hwdevice_ctx_create(&hw_device_ctx, AV_HWDEVICE_TYPE_QSV,
+ ist->hwaccel_device, NULL, 0);
+if (err < 0) {
+av_log(NULL, AV_LOG_ERROR, "Error creating a QSV device\n");
+return err;
+}
 
-av_freep(&qsv);
+return 0;
 }
 
 int qsv_init(AVCodecContext *s)
 {
 InputStream *ist = s->opaque;
-QSVContext  *qsv = ist->hwaccel_ctx;
-AVQSVContext *hwctx_dec;
+AVHWFramesContext *frames_ctx;
+AVQSVFramesContext *frames_hwctx;
 int ret;
 
-if (!qsv) {
-av_log(NULL, AV_LOG_ERROR, "QSV transcoding is not initialized. "
-   "-hwaccel qsv should only be used for one-to-one QSV 
transcoding "
-   "with no filters.\n");
-return AVERROR_BUG;
+if (!hw_device_ctx) {
+ret = qsv_device_init(ist);
+if (ret < 0)
+return ret;
 }
 
-ret = init_opaque_surf(qsv);
-if (ret < 0)
-return ret;
-
-hwctx_dec = av_qsv_alloc_context();
-if (!hwctx_dec)
+av_buffer_unref(&ist->hw_frames_ctx);
+ist->hw_frames_ctx = av_hwframe_ctx_alloc(hw_device_ctx);
+ 

[FFmpeg-cvslog] filmstripdec: correctly check image dimensions

2016-11-13 Thread Andreas Cadhalpun
ffmpeg | branch: master | Andreas Cadhalpun  
| Sun Nov 13 18:22:12 2016 +0100| [25012c56448a48487cdc9699465e640871dbcd60] | 
committer: Andreas Cadhalpun

filmstripdec: correctly check image dimensions

This prevents a division by zero in read_packet.

Reviewed-by: Paul B Mahol 
Signed-off-by: Andreas Cadhalpun 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=25012c56448a48487cdc9699465e640871dbcd60
---

 libavformat/filmstripdec.c | 7 +++
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/libavformat/filmstripdec.c b/libavformat/filmstripdec.c
index 414e276..0aeb594 100644
--- a/libavformat/filmstripdec.c
+++ b/libavformat/filmstripdec.c
@@ -25,6 +25,7 @@
  */
 
 #include "libavutil/intreadwrite.h"
+#include "libavutil/imgutils.h"
 #include "avformat.h"
 #include "internal.h"
 
@@ -68,10 +69,8 @@ static int read_header(AVFormatContext *s)
 st->codecpar->height = avio_rb16(pb);
 film->leading = avio_rb16(pb);
 
-if (st->codecpar->width * 4LL * st->codecpar->height >= INT_MAX) {
-av_log(s, AV_LOG_ERROR, "dimensions too large\n");
-return AVERROR_PATCHWELCOME;
-}
+if (av_image_check_size(st->codecpar->width, st->codecpar->height, 0, s) < 
0)
+return AVERROR_INVALIDDATA;
 
 avpriv_set_pts_info(st, 64, 1, avio_rb16(pb));
 

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] hwcontext_vaapi: Add driver quirks to the hwdevice

2016-11-13 Thread Mark Thompson
ffmpeg | branch: master | Mark Thompson  | Sun Jun 12 17:20:25 
2016 +0100| [a8d51bb42474b1641f45b5b3815864ea323a3e59] | committer: Mark 
Thompson

hwcontext_vaapi: Add driver quirks to the hwdevice

The driver being used is detected inside av_hwdevice_ctx_init() and
the quirks field then set from a table of known device.  If this
behaviour is unwanted, the user can also set the quirks field
manually.

Also adds the Intel i965 driver quirk (it does not destroy parameter
buffers used in a call to vaRenderPicture()) and detects that driver
to set it.

(cherry picked from commit 4926fa9a4aa03f3b751f52e900b9efb87fea0591)

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a8d51bb42474b1641f45b5b3815864ea323a3e59
---

 doc/APIchanges  |  4 
 libavutil/hwcontext_vaapi.c | 39 +++
 libavutil/hwcontext_vaapi.h | 22 ++
 libavutil/version.h |  2 +-
 4 files changed, 66 insertions(+), 1 deletion(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index eb8e235..e2daed3 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -15,6 +15,10 @@ libavutil: 2015-08-28
 
 API changes, most recent first:
 
+2016-xx-xx - xxx - lavu 55.38.100 - hwcontext_vaapi.h
+  Add driver quirks field to VAAPI-specific hwdevice and enum with
+  members AV_VAAPI_DRIVER_QUIRK_* to represent its values.
+
 2016-11-10 - xxx - lavu 55.36.100 - pixfmt.h
   Add AV_PIX_FMT_GRAY12(LE/BE).
 
diff --git a/libavutil/hwcontext_vaapi.c b/libavutil/hwcontext_vaapi.c
index cfa25bc..9546550 100644
--- a/libavutil/hwcontext_vaapi.c
+++ b/libavutil/hwcontext_vaapi.c
@@ -265,12 +265,25 @@ fail:
 return err;
 }
 
+static const struct {
+const char *friendly_name;
+const char *match_string;
+unsigned int quirks;
+} vaapi_driver_quirks_table[] = {
+{
+"Intel i965 (Quick Sync)",
+"i965",
+AV_VAAPI_DRIVER_QUIRK_RENDER_PARAM_BUFFERS,
+},
+};
+
 static int vaapi_device_init(AVHWDeviceContext *hwdev)
 {
 VAAPIDeviceContext *ctx = hwdev->internal->priv;
 AVVAAPIDeviceContext *hwctx = hwdev->hwctx;
 VAImageFormat *image_list = NULL;
 VAStatus vas;
+const char *vendor_string;
 int err, i, image_count;
 enum AVPixelFormat pix_fmt;
 unsigned int fourcc;
@@ -312,6 +325,32 @@ static int vaapi_device_init(AVHWDeviceContext *hwdev)
 }
 }
 
+if (hwctx->driver_quirks & AV_VAAPI_DRIVER_QUIRK_USER_SET) {
+av_log(hwdev, AV_LOG_VERBOSE, "Not detecting driver: "
+   "quirks set by user.\n");
+} else {
+// Detect the driver in use and set quirk flags if necessary.
+vendor_string = vaQueryVendorString(hwctx->display);
+hwctx->driver_quirks = 0;
+if (vendor_string) {
+for (i = 0; i < FF_ARRAY_ELEMS(vaapi_driver_quirks_table); i++) {
+if (strstr(vendor_string,
+   vaapi_driver_quirks_table[i].match_string)) {
+av_log(hwdev, AV_LOG_VERBOSE, "Matched \"%s\" as known "
+   "driver \"%s\".\n", vendor_string,
+   vaapi_driver_quirks_table[i].friendly_name);
+hwctx->driver_quirks |=
+vaapi_driver_quirks_table[i].quirks;
+break;
+}
+}
+if (!(i < FF_ARRAY_ELEMS(vaapi_driver_quirks_table))) {
+av_log(hwdev, AV_LOG_VERBOSE, "Unknown driver \"%s\", "
+   "assuming standard behaviour.\n", vendor_string);
+}
+}
+}
+
 av_free(image_list);
 return 0;
 fail:
diff --git a/libavutil/hwcontext_vaapi.h b/libavutil/hwcontext_vaapi.h
index 7fd1a36..8bd8031 100644
--- a/libavutil/hwcontext_vaapi.h
+++ b/libavutil/hwcontext_vaapi.h
@@ -33,6 +33,20 @@
  * with the data pointer set to a VASurfaceID.
  */
 
+enum {
+/**
+ * The quirks field has been set by the user and should not be detected
+ * automatically by av_hwdevice_ctx_init().
+ */
+AV_VAAPI_DRIVER_QUIRK_USER_SET = (1 << 0),
+/**
+ * The driver does not destroy parameter buffers when they are used by
+ * vaRenderPicture().  Additional code will be required to destroy them
+ * separately afterwards.
+ */
+AV_VAAPI_DRIVER_QUIRK_RENDER_PARAM_BUFFERS = (1 << 1),
+};
+
 /**
  * VAAPI connection details.
  *
@@ -43,6 +57,14 @@ typedef struct AVVAAPIDeviceContext {
  * The VADisplay handle, to be filled by the user.
  */
 VADisplay display;
+/**
+ * Driver quirks to apply - this is filled by av_hwdevice_ctx_init(),
+ * with reference to a table of known drivers, unless the
+ * AV_VAAPI_DRIVER_QUIRK_USER_SET bit is already present.  The user
+ * may need to refer to this field when performing any later
+ * operations using VAAPI with the same VADisplay.
+ */
+unsigned int driver_quirks;
 } AVVAAPIDeviceContext;
 
 /**
diff --git a/libavutil/version.h

[FFmpeg-cvslog] vaapi_encode: Respect driver quirks around buffer destruction

2016-11-13 Thread Mark Thompson
ffmpeg | branch: master | Mark Thompson  | Sun Jun 12 17:28:28 
2016 +0100| [2dee500f4cbf64c547a37046e95141b84c85ee55] | committer: Mark 
Thompson

vaapi_encode: Respect driver quirks around buffer destruction

No longer leaks memory when used with a driver with the "render does
not destroy param buffers" quirk (i.e. Intel i965).

(cherry picked from commit 221ffca6314ed3ba9d38464ea50cd85251c04e74)
Fixes ticket #5871.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2dee500f4cbf64c547a37046e95141b84c85ee55
---

 libavcodec/vaapi_encode.c | 22 +-
 1 file changed, 21 insertions(+), 1 deletion(-)

diff --git a/libavcodec/vaapi_encode.c b/libavcodec/vaapi_encode.c
index f8d848b..4a92506 100644
--- a/libavcodec/vaapi_encode.c
+++ b/libavcodec/vaapi_encode.c
@@ -385,7 +385,27 @@ static int vaapi_encode_issue(AVCodecContext *avctx,
 av_log(avctx, AV_LOG_ERROR, "Failed to end picture encode issue: "
"%d (%s).\n", vas, vaErrorStr(vas));
 err = AVERROR(EIO);
-goto fail_at_end;
+// vaRenderPicture() has been called here, so we should not destroy
+// the parameter buffers unless separate destruction is required.
+if (ctx->hwctx->driver_quirks &
+AV_VAAPI_DRIVER_QUIRK_RENDER_PARAM_BUFFERS)
+goto fail;
+else
+goto fail_at_end;
+}
+
+if (ctx->hwctx->driver_quirks &
+AV_VAAPI_DRIVER_QUIRK_RENDER_PARAM_BUFFERS) {
+for (i = 0; i < pic->nb_param_buffers; i++) {
+vas = vaDestroyBuffer(ctx->hwctx->display,
+  pic->param_buffers[i]);
+if (vas != VA_STATUS_SUCCESS) {
+av_log(avctx, AV_LOG_ERROR, "Failed to destroy "
+   "param buffer %#x: %d (%s).\n",
+   pic->param_buffers[i], vas, vaErrorStr(vas));
+// And ignore.
+}
+}
 }
 
 pic->encode_issued = 1;

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] hwcontext_vaapi: Try the first render node as the default DRM device

2016-11-13 Thread Mark Thompson
ffmpeg | branch: master | Mark Thompson  | Thu Jul 28 23:28:30 
2016 +0100| [8d47d8407569aade0c0d564600919349789dc38b] | committer: Mark 
Thompson

hwcontext_vaapi: Try the first render node as the default DRM device

If no string argument is supplied when av_hwdevice_ctx_create() is
called to create a VAAPI device, we currently only try the default
X11 display (that is, $DISPLAY) to find a device, and will therefore
fail in the absence of an X server to connect to.  Change the logic
to also look for a device via the first DRM render node (that is,
"/dev/dri/renderD128"), which is probably the right thing to use in
most simple configurations which only have one DRM device.

(cherry picked from commit 121f34d5f0c8d7d376829a467590fbbe4c228f4f)

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8d47d8407569aade0c0d564600919349789dc38b
---

 libavutil/hwcontext_vaapi.c | 13 -
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/libavutil/hwcontext_vaapi.c b/libavutil/hwcontext_vaapi.c
index 9546550..06836a7 100644
--- a/libavutil/hwcontext_vaapi.c
+++ b/libavutil/hwcontext_vaapi.c
@@ -914,22 +914,25 @@ static int vaapi_device_create(AVHWDeviceContext *ctx, 
const char *device,
 #endif
 
 #if HAVE_VAAPI_DRM
-if (!display && device) {
+if (!display) {
 // Try to open the device as a DRM path.
-priv->drm_fd = open(device, O_RDWR);
+// Default to using the first render node if the user did not
+// supply a path.
+const char *path = device ? device : "/dev/dri/renderD128";
+priv->drm_fd = open(path, O_RDWR);
 if (priv->drm_fd < 0) {
 av_log(ctx, AV_LOG_VERBOSE, "Cannot open DRM device %s.\n",
-   device);
+   path);
 } else {
 display = vaGetDisplayDRM(priv->drm_fd);
 if (!display) {
 av_log(ctx, AV_LOG_ERROR, "Cannot open a VA display "
-   "from DRM device %s.\n", device);
+   "from DRM device %s.\n", path);
 return AVERROR_UNKNOWN;
 }
 
 av_log(ctx, AV_LOG_VERBOSE, "Opened VA display via "
-   "DRM device %s.\n", device);
+   "DRM device %s.\n", path);
 }
 }
 #endif

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] vf_scale_vaapi: Respect driver quirks around buffer destruction

2016-11-13 Thread Mark Thompson
ffmpeg | branch: master | Mark Thompson  | Sun Jun 26 22:35:49 
2016 +0100| [1a359e53418ff15b1c9b1e03c05b160f01e1ce0f] | committer: Mark 
Thompson

vf_scale_vaapi: Respect driver quirks around buffer destruction

(cherry picked from commit 582d4211e00015b68626f77ce4af53161e2b1713)

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1a359e53418ff15b1c9b1e03c05b160f01e1ce0f
---

 libavfilter/vf_scale_vaapi.c | 15 ---
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/libavfilter/vf_scale_vaapi.c b/libavfilter/vf_scale_vaapi.c
index 8dd5acf..d1cb246 100644
--- a/libavfilter/vf_scale_vaapi.c
+++ b/libavfilter/vf_scale_vaapi.c
@@ -342,13 +342,14 @@ static int scale_vaapi_filter_frame(AVFilterLink *inlink, 
AVFrame *input_frame)
 goto fail_after_render;
 }
 
-// This doesn't get freed automatically for some reason.
-vas = vaDestroyBuffer(ctx->hwctx->display, params_id);
-if (vas != VA_STATUS_SUCCESS) {
-av_log(ctx, AV_LOG_ERROR, "Failed to free parameter buffer: "
-   "%d (%s).\n", vas, vaErrorStr(vas));
-err = AVERROR(EIO);
-goto fail;
+if (ctx->hwctx->driver_quirks &
+AV_VAAPI_DRIVER_QUIRK_RENDER_PARAM_BUFFERS) {
+vas = vaDestroyBuffer(ctx->hwctx->display, params_id);
+if (vas != VA_STATUS_SUCCESS) {
+av_log(ctx, AV_LOG_ERROR, "Failed to free parameter buffer: "
+   "%d (%s).\n", vas, vaErrorStr(vas));
+// And ignore.
+}
 }
 
 av_frame_copy_props(output_frame, input_frame);

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] hwcontext_vaapi: add a quirk for the missing MemoryType attribute

2016-11-13 Thread Anton Khirnov
ffmpeg | branch: master | Anton Khirnov  | Fri Sep 30 
21:21:46 2016 +0200| [775a8477b74bb2fa95ca2b13c08f3fd8d6c617b6] | committer: 
Mark Thompson

hwcontext_vaapi: add a quirk for the missing MemoryType attribute

The Intel binary iHD driver does not support the
VASurfaceAttribMemoryType, so surface allocation will fail when using
it.

(cherry picked from commit 2124711b950b03c582a119c75f52a87acc32d6ec)

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=775a8477b74bb2fa95ca2b13c08f3fd8d6c617b6
---

 doc/APIchanges  | 3 +++
 libavutil/hwcontext_vaapi.c | 8 +++-
 libavutil/hwcontext_vaapi.h | 6 ++
 libavutil/version.h | 2 +-
 4 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index e2daed3..3089c82 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -15,6 +15,9 @@ libavutil: 2015-08-28
 
 API changes, most recent first:
 
+2016-xx-xx - xxx - lavu 55.39.100 - hwcontext_vaapi.h
+  Add AV_VAAPI_DRIVER_QUIRK_ATTRIB_MEMTYPE.
+
 2016-xx-xx - xxx - lavu 55.38.100 - hwcontext_vaapi.h
   Add driver quirks field to VAAPI-specific hwdevice and enum with
   members AV_VAAPI_DRIVER_QUIRK_* to represent its values.
diff --git a/libavutil/hwcontext_vaapi.c b/libavutil/hwcontext_vaapi.c
index 06836a7..605e465 100644
--- a/libavutil/hwcontext_vaapi.c
+++ b/libavutil/hwcontext_vaapi.c
@@ -275,6 +275,11 @@ static const struct {
 "i965",
 AV_VAAPI_DRIVER_QUIRK_RENDER_PARAM_BUFFERS,
 },
+{
+"Intel iHD",
+"ubit",
+AV_VAAPI_DRIVER_QUIRK_ATTRIB_MEMTYPE,
+},
 };
 
 static int vaapi_device_init(AVHWDeviceContext *hwdev)
@@ -449,7 +454,8 @@ static int vaapi_frames_init(AVHWFramesContext *hwfc)
 }
 
 if (!hwfc->pool) {
-int need_memory_type = 1, need_pixel_format = 1;
+int need_memory_type = !(hwctx->driver_quirks & 
AV_VAAPI_DRIVER_QUIRK_ATTRIB_MEMTYPE);
+int need_pixel_format = 1;
 for (i = 0; i < avfc->nb_attributes; i++) {
 if (ctx->attributes[i].type == VASurfaceAttribMemoryType)
 need_memory_type  = 0;
diff --git a/libavutil/hwcontext_vaapi.h b/libavutil/hwcontext_vaapi.h
index 8bd8031..da1d4fe 100644
--- a/libavutil/hwcontext_vaapi.h
+++ b/libavutil/hwcontext_vaapi.h
@@ -45,6 +45,12 @@ enum {
  * separately afterwards.
  */
 AV_VAAPI_DRIVER_QUIRK_RENDER_PARAM_BUFFERS = (1 << 1),
+
+/**
+ * The driver does not support the VASurfaceAttribMemoryType attribute,
+ * so the surface allocation code will not try to use it.
+ */
+AV_VAAPI_DRIVER_QUIRK_ATTRIB_MEMTYPE = (1 << 2),
 };
 
 /**
diff --git a/libavutil/version.h b/libavutil/version.h
index 81c5181..6d68051 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -79,7 +79,7 @@
  */
 
 #define LIBAVUTIL_VERSION_MAJOR  55
-#define LIBAVUTIL_VERSION_MINOR  38
+#define LIBAVUTIL_VERSION_MINOR  39
 #define LIBAVUTIL_VERSION_MICRO 100
 
 #define LIBAVUTIL_VERSION_INT   AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] options_table: Add aliases for color properties

2016-11-13 Thread Vittorio Giovara
ffmpeg | branch: master | Vittorio Giovara  | Tue 
Jun 21 10:22:59 2016 -0400| [7a745f014f528d1001394ae4d2f4ed1a20bf7fa2] | 
committer: Vittorio Giovara

options_table: Add aliases for color properties

All option names now match the ones provided by the av_color_*_name().

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7a745f014f528d1001394ae4d2f4ed1a20bf7fa2
---

 libavcodec/options_table.h | 32 
 libavcodec/version.h   |  2 +-
 2 files changed, 25 insertions(+), 9 deletions(-)

diff --git a/libavcodec/options_table.h b/libavcodec/options_table.h
index 6f7fb96..5090806 100644
--- a/libavcodec/options_table.h
+++ b/libavcodec/options_table.h
@@ -428,7 +428,7 @@ static const AVOption avcodec_options[] = {
 {"ticks_per_frame", NULL, OFFSET(ticks_per_frame), AV_OPT_TYPE_INT, {.i64 = 1 
}, 1, INT_MAX, A|V|E|D},
 {"color_primaries", "color primaries", OFFSET(color_primaries), 
AV_OPT_TYPE_INT, {.i64 = AVCOL_PRI_UNSPECIFIED }, 1, AVCOL_PRI_NB-1, V|E|D, 
"color_primaries_type"},
 {"bt709",   "BT.709",  0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_PRI_BT709 
},   INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
-{"unspecified", "Unspecified", 0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_PRI_UNSPECIFIED }, INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
+{"unknown", "Unspecified", 0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_PRI_UNSPECIFIED }, INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
 {"bt470m",  "BT.470 M",0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_PRI_BT470M 
},  INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
 {"bt470bg", "BT.470 BG",   0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_PRI_BT470BG 
}, INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
 {"smpte170m",   "SMPTE 170 M", 0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_PRI_SMPTE170M },   INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
@@ -438,15 +438,27 @@ static const AVOption avcodec_options[] = {
 {"smpte428","SMPTE 428-1", 0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_PRI_SMPTE428 },   INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
 {"smpte431","SMPTE 431-2", 0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_PRI_SMPTE431 },INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
 {"smpte432","SMPTE 422-1", 0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_PRI_SMPTE432 },INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
+{"unspecified", "Unspecified", 0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_PRI_UNSPECIFIED }, INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
 {"smptest428_1", "SMPTE 428-1", 0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_PRI_SMPTE428 },   INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
 {"color_trc", "color transfer characteristics", OFFSET(color_trc), 
AV_OPT_TYPE_INT, {.i64 = AVCOL_TRC_UNSPECIFIED }, 1, AVCOL_TRC_NB-1, V|E|D, 
"color_trc_type"},
 {"bt709","BT.709",   0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_BT709 },INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
-{"unspecified",  "Unspecified",  0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_UNSPECIFIED },  INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
+{"unknown",  "Unspecified",  0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_UNSPECIFIED },  INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
 {"gamma22",  "BT.470 M", 0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_GAMMA22 },  INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
 {"gamma28",  "BT.470 BG",0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_GAMMA28 },  INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
 {"smpte170m","SMPTE 170 M",  0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_SMPTE170M },INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
 {"smpte240m","SMPTE 240 M",  0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_SMPTE240M },INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
 {"linear",   "Linear",   0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_LINEAR },   INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
+{"log100",   "Log",  0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_LOG },  INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
+{"log316",   "Log square root",  0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_LOG_SQRT }, INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
+{"iec61966-2-4", "IEC 61966-2-4",0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_IEC61966_2_4 }, INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
+{"bt1361e",  "BT.1361",  0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_BT1361_ECG },   INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
+{"iec61966-2-1", "IEC 61966-2-1",0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_IEC61966_2_1 }, INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
+{"bt2020-10","BT.2020 - 10 bit", 0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_BT2020_10 },INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
+{"bt2020-12","BT.2020 - 12 bit", 0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_BT2020_12 },INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
+{"smpte2084","SMPTE 2084",   0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_SMPTE2084 },INT_MIN, INT_MAX, V|E|D, "color_tr

[FFmpeg-cvslog] Merge commit '7a745f014f528d1001394ae4d2f4ed1a20bf7fa2'

2016-11-13 Thread Hendrik Leppkes
ffmpeg | branch: master | Hendrik Leppkes  | Sun Nov 13 
22:29:04 2016 +0100| [bd0db4a32d85d027da4d4dc00490c20048090312] | committer: 
Hendrik Leppkes

Merge commit '7a745f014f528d1001394ae4d2f4ed1a20bf7fa2'

* commit '7a745f014f528d1001394ae4d2f4ed1a20bf7fa2':
  options_table: Add aliases for color properties

Merged-by: Hendrik Leppkes 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=bd0db4a32d85d027da4d4dc00490c20048090312
---

 libavcodec/options_table.h | 32 
 libavcodec/version.h   |  2 +-
 2 files changed, 25 insertions(+), 9 deletions(-)

diff --git a/libavcodec/options_table.h b/libavcodec/options_table.h
index e0f16e3..e5cc7bf 100644
--- a/libavcodec/options_table.h
+++ b/libavcodec/options_table.h
@@ -453,7 +453,7 @@ static const AVOption avcodec_options[] = {
 {"ticks_per_frame", NULL, OFFSET(ticks_per_frame), AV_OPT_TYPE_INT, {.i64 = 1 
}, 1, INT_MAX, A|V|E|D},
 {"color_primaries", "color primaries", OFFSET(color_primaries), 
AV_OPT_TYPE_INT, {.i64 = AVCOL_PRI_UNSPECIFIED }, 1, AVCOL_PRI_NB-1, V|E|D, 
"color_primaries_type"},
 {"bt709",   "BT.709", 0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_PRI_BT709 },INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
-{"unspecified", "Unspecified",0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_PRI_UNSPECIFIED },  INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
+{"unknown", "Unspecified",0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_PRI_UNSPECIFIED },  INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
 {"bt470m",  "BT.470 M",   0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_PRI_BT470M },   INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
 {"bt470bg", "BT.470 BG",  0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_PRI_BT470BG },  INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
 {"smpte170m",   "SMPTE 170 M",0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_PRI_SMPTE170M },INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
@@ -464,14 +464,26 @@ static const AVOption avcodec_options[] = {
 {"smpte428_1",  "SMPTE 428-1",0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_PRI_SMPTE428 }, INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
 {"smpte431","SMPTE 431-2",0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_PRI_SMPTE431 }, INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
 {"smpte432","SMPTE 422-1",0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_PRI_SMPTE432 }, INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
+{"unspecified", "Unspecified",0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_PRI_UNSPECIFIED },  INT_MIN, INT_MAX, V|E|D, "color_primaries_type"},
 {"color_trc", "color transfer characteristics", OFFSET(color_trc), 
AV_OPT_TYPE_INT, {.i64 = AVCOL_TRC_UNSPECIFIED }, 1, AVCOL_TRC_NB-1, V|E|D, 
"color_trc_type"},
 {"bt709","BT.709",   0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_BT709 },INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
-{"unspecified",  "Unspecified",  0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_UNSPECIFIED },  INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
+{"unknown",  "Unspecified",  0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_UNSPECIFIED },  INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
 {"gamma22",  "BT.470 M", 0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_GAMMA22 },  INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
 {"gamma28",  "BT.470 BG",0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_GAMMA28 },  INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
 {"smpte170m","SMPTE 170 M",  0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_SMPTE170M },INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
 {"smpte240m","SMPTE 240 M",  0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_SMPTE240M },INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
 {"linear",   "Linear",   0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_LINEAR },   INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
+{"log100",   "Log",  0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_LOG },  INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
+{"log316",   "Log square root",  0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_LOG_SQRT }, INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
+{"iec61966-2-4", "IEC 61966-2-4",0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_IEC61966_2_4 }, INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
+{"bt1361e",  "BT.1361",  0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_BT1361_ECG },   INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
+{"iec61966-2-1", "IEC 61966-2-1",0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_IEC61966_2_1 }, INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
+{"bt2020-10","BT.2020 - 10 bit", 0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_BT2020_10 },INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
+{"bt2020-12","BT.2020 - 12 bit", 0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_BT2020_12 },INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
+{"smpte2084","SMPTE 2084",   0, AV_OPT_TYPE_CONST, {.i64 = 
AVCOL_TRC_SMPTE2084 },INT_MIN, INT_MAX, V|E|D, "color_trc_type"},
+{"smpte428", "S

[FFmpeg-cvslog] avconv: restructure sending EOF to filters

2016-11-13 Thread Anton Khirnov
ffmpeg | branch: master | Anton Khirnov  | Mon Jun 27 
19:03:42 2016 +0200| [94ebf5565849e4dc036d2ca43979571ed3736457] | committer: 
Anton Khirnov

avconv: restructure sending EOF to filters

Be more careful when an input stream encounters EOF when its filtergraph
has not been configured yet. The current code would immediately mark the
corresponding output streams as finished, while there may still be
buffered frames waiting for frames to appear on other filtergraph
inputs.

This should fix the random FATE failures for complex filtergraph tests
after a3a0230a9870b9018dc7415ae5872784d524cfe5

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=94ebf5565849e4dc036d2ca43979571ed3736457
---

 avconv.c| 43 ---
 avconv.h|  2 ++
 avconv_filter.c |  9 +
 3 files changed, 43 insertions(+), 11 deletions(-)

diff --git a/avconv.c b/avconv.c
index 778de65..a05894f 100644
--- a/avconv.c
+++ b/avconv.c
@@ -1242,6 +1242,34 @@ static int ifilter_send_frame(InputFilter *ifilter, 
AVFrame *frame)
 return 0;
 }
 
+static int ifilter_send_eof(InputFilter *ifilter)
+{
+int i, j, ret;
+
+ifilter->eof = 1;
+
+if (ifilter->filter) {
+ret = av_buffersrc_add_frame(ifilter->filter, NULL);
+if (ret < 0)
+return ret;
+} else {
+// the filtergraph was never configured
+FilterGraph *fg = ifilter->graph;
+for (i = 0; i < fg->nb_inputs; i++)
+if (!fg->inputs[i]->eof)
+break;
+if (i == fg->nb_inputs) {
+// All the input streams have finished without the filtergraph
+// ever being configured.
+// Mark the output streams as finished.
+for (j = 0; j < fg->nb_outputs; j++)
+finish_output_stream(fg->outputs[j]->ost);
+}
+}
+
+return 0;
+}
+
 // This does not quite work like avcodec_decode_audio4/avcodec_decode_video2.
 // There is the following difference: if you got a frame, you must call
 // it again with pkt=NULL. pkt==NULL is treated differently from pkt.size==0
@@ -1415,18 +1443,11 @@ static int transcode_subtitles(InputStream *ist, 
AVPacket *pkt, int *got_output)
 
 static int send_filter_eof(InputStream *ist)
 {
-int i, j, ret;
+int i, ret;
 for (i = 0; i < ist->nb_filters; i++) {
-if (ist->filters[i]->filter) {
-ret = av_buffersrc_add_frame(ist->filters[i]->filter, NULL);
-if (ret < 0)
-return ret;
-} else {
-// the filtergraph was never configured
-FilterGraph *fg = ist->filters[i]->graph;
-for (j = 0; j < fg->nb_outputs; j++)
-finish_output_stream(fg->outputs[j]->ost);
-}
+ret = ifilter_send_eof(ist->filters[i]);
+if (ret < 0)
+return ret;
 }
 return 0;
 }
diff --git a/avconv.h b/avconv.h
index 5d365a0..cffe114 100644
--- a/avconv.h
+++ b/avconv.h
@@ -212,6 +212,8 @@ typedef struct InputFilter {
 uint64_t channel_layout;
 
 AVBufferRef *hw_frames_ctx;
+
+int eof;
 } InputFilter;
 
 typedef struct OutputFilter {
diff --git a/avconv_filter.c b/avconv_filter.c
index 1acbd88..96277f8 100644
--- a/avconv_filter.c
+++ b/avconv_filter.c
@@ -780,6 +780,15 @@ int configure_filtergraph(FilterGraph *fg)
 }
 }
 
+/* send the EOFs for the finished inputs */
+for (i = 0; i < fg->nb_inputs; i++) {
+if (fg->inputs[i]->eof) {
+ret = av_buffersrc_add_frame(fg->inputs[i]->filter, NULL);
+if (ret < 0)
+return ret;
+}
+}
+
 return 0;
 }
 

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] Merge commit '94ebf5565849e4dc036d2ca43979571ed3736457'

2016-11-13 Thread Hendrik Leppkes
ffmpeg | branch: master | Hendrik Leppkes  | Sun Nov 13 
22:33:05 2016 +0100| [cd47bd835a1fe942c2935a8b5ba12b7132347f1c] | committer: 
Hendrik Leppkes

Merge commit '94ebf5565849e4dc036d2ca43979571ed3736457'

* commit '94ebf5565849e4dc036d2ca43979571ed3736457':
  avconv: restructure sending EOF to filters

Noop, as its a fixup to a previously skipped commit

Merged-by: Hendrik Leppkes 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=cd47bd835a1fe942c2935a8b5ba12b7132347f1c
---



___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] doc/libav-merge: add skipped fixup commits to the list of missing changes

2016-11-13 Thread Hendrik Leppkes
ffmpeg | branch: master | Hendrik Leppkes  | Sun Nov 13 
22:34:01 2016 +0100| [e3d9bd7102beaeef8fe3520abe908e5bc0ec6df1] | committer: 
Hendrik Leppkes

doc/libav-merge: add skipped fixup commits to the list of missing changes

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e3d9bd7102beaeef8fe3520abe908e5bc0ec6df1
---

 doc/libav-merge.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/libav-merge.txt b/doc/libav-merge.txt
index f5a5b29..a0dea54 100644
--- a/doc/libav-merge.txt
+++ b/doc/libav-merge.txt
@@ -89,7 +89,7 @@ Stuff that didn't reach the codebase:
 
 - HEVC DSP and x86 MC SIMD improvements from Libav (see 
https://ffmpeg.org/pipermail/ffmpeg-devel/2015-December/184777.html)
 - QSV scaling filter (62c58c5)
-- ffmpeg.c filter init decoupling (3e265ca & a3a0230)
+- ffmpeg.c filter init decoupling (3e265ca,a3a0230,d2e56cf,94ebf55)
 
 Collateral damage that needs work locally:
 --

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] avconv: move flushing the queued frames to configure_filtergraph()

2016-11-13 Thread Anton Khirnov
ffmpeg | branch: master | Anton Khirnov  | Mon Jun 27 
18:59:23 2016 +0200| [d2e56cf753a6c462041dee897d9d0c90f349988c] | committer: 
Anton Khirnov

avconv: move flushing the queued frames to configure_filtergraph()

This is a more appropriate place for it, and will also be useful in the
following commit.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d2e56cf753a6c462041dee897d9d0c90f349988c
---

 avconv.c| 11 ---
 avconv_filter.c | 11 +++
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/avconv.c b/avconv.c
index 4eae015..778de65 100644
--- a/avconv.c
+++ b/avconv.c
@@ -1231,17 +1231,6 @@ static int ifilter_send_frame(InputFilter *ifilter, 
AVFrame *frame)
 av_log(NULL, AV_LOG_ERROR, "Error reinitializing filters!\n");
 return ret;
 }
-
-for (i = 0; i < fg->nb_inputs; i++) {
-while (av_fifo_size(fg->inputs[i]->frame_queue)) {
-AVFrame *tmp;
-av_fifo_generic_read(fg->inputs[i]->frame_queue, &tmp, 
sizeof(tmp), NULL);
-ret = av_buffersrc_add_frame(fg->inputs[i]->filter, tmp);
-av_frame_free(&tmp);
-if (ret < 0)
-return ret;
-}
-}
 }
 
 ret = av_buffersrc_add_frame(ifilter->filter, frame);
diff --git a/avconv_filter.c b/avconv_filter.c
index f7ce76f..1acbd88 100644
--- a/avconv_filter.c
+++ b/avconv_filter.c
@@ -769,6 +769,17 @@ int configure_filtergraph(FilterGraph *fg)
 ofilter->channel_layout = link->channel_layout;
 }
 
+for (i = 0; i < fg->nb_inputs; i++) {
+while (av_fifo_size(fg->inputs[i]->frame_queue)) {
+AVFrame *tmp;
+av_fifo_generic_read(fg->inputs[i]->frame_queue, &tmp, 
sizeof(tmp), NULL);
+ret = av_buffersrc_add_frame(fg->inputs[i]->filter, tmp);
+av_frame_free(&tmp);
+if (ret < 0)
+return ret;
+}
+}
+
 return 0;
 }
 

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] Merge commit 'd2e56cf753a6c462041dee897d9d0c90f349988c'

2016-11-13 Thread Hendrik Leppkes
ffmpeg | branch: master | Hendrik Leppkes  | Sun Nov 13 
22:32:48 2016 +0100| [07dcef9bc7a614084f4afe39de678884a36cabf1] | committer: 
Hendrik Leppkes

Merge commit 'd2e56cf753a6c462041dee897d9d0c90f349988c'

* commit 'd2e56cf753a6c462041dee897d9d0c90f349988c':
  avconv: move flushing the queued frames to configure_filtergraph()

Noop, as its a fixup to a previously skipped commit

Merged-by: Hendrik Leppkes 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=07dcef9bc7a614084f4afe39de678884a36cabf1
---



___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] Merge commit 'c3f113d58488df7594a489bdbb993a69ad47063c'

2016-11-13 Thread Hendrik Leppkes
ffmpeg | branch: master | Hendrik Leppkes  | Sun Nov 13 
22:35:57 2016 +0100| [1f8e1c209db2ec098edd7880a4ac88864615d674] | committer: 
Hendrik Leppkes

Merge commit 'c3f113d58488df7594a489bdbb993a69ad47063c'

* commit 'c3f113d58488df7594a489bdbb993a69ad47063c':
  vf_hwdownload: allocate the destination frame for the pool size

Merged-by: Hendrik Leppkes 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1f8e1c209db2ec098edd7880a4ac88864615d674
---

 libavfilter/vf_hwdownload.c | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/libavfilter/vf_hwdownload.c b/libavfilter/vf_hwdownload.c
index 1e8d819..f3138f3 100644
--- a/libavfilter/vf_hwdownload.c
+++ b/libavfilter/vf_hwdownload.c
@@ -142,7 +142,8 @@ static int hwdownload_filter_frame(AVFilterLink *link, 
AVFrame *input)
 goto fail;
 }
 
-output = ff_get_video_buffer(outlink, outlink->w, outlink->h);
+output = ff_get_video_buffer(outlink, ctx->hwframes->width,
+ ctx->hwframes->height);
 if (!output) {
 err = AVERROR(ENOMEM);
 goto fail;
@@ -154,6 +155,9 @@ static int hwdownload_filter_frame(AVFilterLink *link, 
AVFrame *input)
 goto fail;
 }
 
+output->width  = outlink->w;
+output->height = outlink->h;
+
 err = av_frame_copy_props(output, input);
 if (err < 0)
 goto fail;


==


___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] Merge commit 'f62bb216ac4cfbbff16108c6bac35a0282532972'

2016-11-13 Thread Hendrik Leppkes
ffmpeg | branch: master | Hendrik Leppkes  | Sun Nov 13 
22:36:18 2016 +0100| [3aa7b0a27326bd312ef790d9149f6b5efff97311] | committer: 
Hendrik Leppkes

Merge commit 'f62bb216ac4cfbbff16108c6bac35a0282532972'

* commit 'f62bb216ac4cfbbff16108c6bac35a0282532972':
  hwcontext_vaapi: allow transfers to/from any size of sw frame

Merged-by: Hendrik Leppkes 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3aa7b0a27326bd312ef790d9149f6b5efff97311
---

 libavutil/hwcontext_vaapi.c | 12 
 1 file changed, 12 insertions(+)

diff --git a/libavutil/hwcontext_vaapi.c b/libavutil/hwcontext_vaapi.c
index 605e465..6176bdc 100644
--- a/libavutil/hwcontext_vaapi.c
+++ b/libavutil/hwcontext_vaapi.c
@@ -817,6 +817,9 @@ static int vaapi_transfer_data_from(AVHWFramesContext *hwfc,
 AVFrame *map;
 int err;
 
+if (dst->width > hwfc->width || dst->height > hwfc->height)
+return AVERROR(EINVAL);
+
 map = av_frame_alloc();
 if (!map)
 return AVERROR(ENOMEM);
@@ -826,6 +829,9 @@ static int vaapi_transfer_data_from(AVHWFramesContext *hwfc,
 if (err)
 goto fail;
 
+map->width  = dst->width;
+map->height = dst->height;
+
 err = av_frame_copy(dst, map);
 if (err)
 goto fail;
@@ -842,6 +848,9 @@ static int vaapi_transfer_data_to(AVHWFramesContext *hwfc,
 AVFrame *map;
 int err;
 
+if (src->width > hwfc->width || src->height > hwfc->height)
+return AVERROR(EINVAL);
+
 map = av_frame_alloc();
 if (!map)
 return AVERROR(ENOMEM);
@@ -851,6 +860,9 @@ static int vaapi_transfer_data_to(AVHWFramesContext *hwfc,
 if (err)
 goto fail;
 
+map->width  = src->width;
+map->height = src->height;
+
 err = av_frame_copy(map, src);
 if (err)
 goto fail;


==


___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] Merge commit 'fdfe01365d579189d9a55b3741dba2ac46eb1df8'

2016-11-13 Thread Hendrik Leppkes
ffmpeg | branch: master | Hendrik Leppkes  | Sun Nov 13 
22:35:49 2016 +0100| [7071924cf2308c04a4ae53dd4a2c2070bf031a56] | committer: 
Hendrik Leppkes

Merge commit 'fdfe01365d579189d9a55b3741dba2ac46eb1df8'

* commit 'fdfe01365d579189d9a55b3741dba2ac46eb1df8':
  hwcontext: allocate the destination frame for the pool size

Merged-by: Hendrik Leppkes 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7071924cf2308c04a4ae53dd4a2c2070bf031a56
---

 libavutil/hwcontext.c | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/libavutil/hwcontext.c b/libavutil/hwcontext.c
index be1d73e..615f1f7 100644
--- a/libavutil/hwcontext.c
+++ b/libavutil/hwcontext.c
@@ -321,6 +321,7 @@ int av_hwframe_transfer_get_formats(AVBufferRef 
*hwframe_ref,
 
 static int transfer_data_alloc(AVFrame *dst, const AVFrame *src, int flags)
 {
+AVHWFramesContext *ctx = (AVHWFramesContext*)src->hw_frames_ctx->data;
 AVFrame *frame_tmp;
 int ret = 0;
 
@@ -343,8 +344,8 @@ static int transfer_data_alloc(AVFrame *dst, const AVFrame 
*src, int flags)
 frame_tmp->format = formats[0];
 av_freep(&formats);
 }
-frame_tmp->width  = src->width;
-frame_tmp->height = src->height;
+frame_tmp->width  = ctx->width;
+frame_tmp->height = ctx->height;
 
 ret = av_frame_get_buffer(frame_tmp, 32);
 if (ret < 0)
@@ -354,6 +355,9 @@ static int transfer_data_alloc(AVFrame *dst, const AVFrame 
*src, int flags)
 if (ret < 0)
 goto fail;
 
+frame_tmp->width  = src->width;
+frame_tmp->height = src->height;
+
 av_frame_move_ref(dst, frame_tmp);
 
 fail:


==


___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] vf_hwdownload: allocate the destination frame for the pool size

2016-11-13 Thread Anton Khirnov
ffmpeg | branch: master | Anton Khirnov  | Fri Apr 15 
10:44:02 2016 +0200| [c3f113d58488df7594a489bdbb993a69ad47063c] | committer: 
Anton Khirnov

vf_hwdownload: allocate the destination frame for the pool size

The reasoning is the same as for the previous commit.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c3f113d58488df7594a489bdbb993a69ad47063c
---

 libavfilter/vf_hwdownload.c | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/libavfilter/vf_hwdownload.c b/libavfilter/vf_hwdownload.c
index 4ba465b..42925b8 100644
--- a/libavfilter/vf_hwdownload.c
+++ b/libavfilter/vf_hwdownload.c
@@ -140,7 +140,8 @@ static int hwdownload_filter_frame(AVFilterLink *link, 
AVFrame *input)
 goto fail;
 }
 
-output = ff_get_video_buffer(outlink, outlink->w, outlink->h);
+output = ff_get_video_buffer(outlink, ctx->hwframes->width,
+ ctx->hwframes->height);
 if (!output) {
 err = AVERROR(ENOMEM);
 goto fail;
@@ -152,6 +153,9 @@ static int hwdownload_filter_frame(AVFilterLink *link, 
AVFrame *input)
 goto fail;
 }
 
+output->width  = outlink->w;
+output->height = outlink->h;
+
 err = av_frame_copy_props(output, input);
 if (err < 0)
 goto fail;

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] hwcontext_vaapi: allow transfers to/from any size of sw frame

2016-11-13 Thread Mark Thompson
ffmpeg | branch: master | Mark Thompson  | Fri Apr 15 10:58:51 
2016 +0100| [f62bb216ac4cfbbff16108c6bac35a0282532972] | committer: Anton 
Khirnov

hwcontext_vaapi: allow transfers to/from any size of sw frame

The hw frame used as reference has an attached size but it need not
match the actual size of the surface, so enforcing that the sw frame
used in copying matches its size exactly is not useful.

Signed-off-by: Anton Khirnov 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f62bb216ac4cfbbff16108c6bac35a0282532972
---

 libavutil/hwcontext_vaapi.c | 12 
 1 file changed, 12 insertions(+)

diff --git a/libavutil/hwcontext_vaapi.c b/libavutil/hwcontext_vaapi.c
index 1bdc4cb..ee5ce5d 100644
--- a/libavutil/hwcontext_vaapi.c
+++ b/libavutil/hwcontext_vaapi.c
@@ -770,6 +770,9 @@ static int vaapi_transfer_data_from(AVHWFramesContext *hwfc,
 AVFrame *map;
 int err;
 
+if (dst->width > hwfc->width || dst->height > hwfc->height)
+return AVERROR(EINVAL);
+
 map = av_frame_alloc();
 if (!map)
 return AVERROR(ENOMEM);
@@ -779,6 +782,9 @@ static int vaapi_transfer_data_from(AVHWFramesContext *hwfc,
 if (err)
 goto fail;
 
+map->width  = dst->width;
+map->height = dst->height;
+
 err = av_frame_copy(dst, map);
 if (err)
 goto fail;
@@ -795,6 +801,9 @@ static int vaapi_transfer_data_to(AVHWFramesContext *hwfc,
 AVFrame *map;
 int err;
 
+if (src->width > hwfc->width || src->height > hwfc->height)
+return AVERROR(EINVAL);
+
 map = av_frame_alloc();
 if (!map)
 return AVERROR(ENOMEM);
@@ -804,6 +813,9 @@ static int vaapi_transfer_data_to(AVHWFramesContext *hwfc,
 if (err)
 goto fail;
 
+map->width  = src->width;
+map->height = src->height;
+
 err = av_frame_copy(map, src);
 if (err)
 goto fail;

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] hwcontext: allocate the destination frame for the pool size

2016-11-13 Thread Anton Khirnov
ffmpeg | branch: master | Anton Khirnov  | Fri Apr 15 
10:44:02 2016 +0200| [fdfe01365d579189d9a55b3741dba2ac46eb1df8] | committer: 
Anton Khirnov

hwcontext: allocate the destination frame for the pool size

The source frame may be cropped, so that its dimensions are smaller than
the pool dimensions. The transfer_data API requires the allocated size
of the destination frame to be the same as the pool size.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=fdfe01365d579189d9a55b3741dba2ac46eb1df8
---

 libavutil/hwcontext.c | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/libavutil/hwcontext.c b/libavutil/hwcontext.c
index 96b316a..b47ef44 100644
--- a/libavutil/hwcontext.c
+++ b/libavutil/hwcontext.c
@@ -321,6 +321,7 @@ int av_hwframe_transfer_get_formats(AVBufferRef 
*hwframe_ref,
 
 static int transfer_data_alloc(AVFrame *dst, const AVFrame *src, int flags)
 {
+AVHWFramesContext *ctx = (AVHWFramesContext*)src->hw_frames_ctx->data;
 AVFrame *frame_tmp;
 int ret = 0;
 
@@ -343,8 +344,8 @@ static int transfer_data_alloc(AVFrame *dst, const AVFrame 
*src, int flags)
 frame_tmp->format = formats[0];
 av_freep(&formats);
 }
-frame_tmp->width  = src->width;
-frame_tmp->height = src->height;
+frame_tmp->width  = ctx->width;
+frame_tmp->height = ctx->height;
 
 ret = av_frame_get_buffer(frame_tmp, 32);
 if (ret < 0)
@@ -354,6 +355,9 @@ static int transfer_data_alloc(AVFrame *dst, const AVFrame 
*src, int flags)
 if (ret < 0)
 goto fail;
 
+frame_tmp->width  = src->width;
+frame_tmp->height = src->height;
+
 av_frame_move_ref(dst, frame_tmp);
 
 fail:

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] hwcontext: clarify the behaviour of transfer_data() for cropped frames

2016-11-13 Thread Anton Khirnov
ffmpeg | branch: master | Anton Khirnov  | Sat Jun 25 
14:48:47 2016 +0200| [5fcae3b3f93fd02b3d1e009b9d9b17410fca9498] | committer: 
Anton Khirnov

hwcontext: clarify the behaviour of transfer_data() for cropped frames

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5fcae3b3f93fd02b3d1e009b9d9b17410fca9498
---

 libavutil/hwcontext.h | 8 
 1 file changed, 8 insertions(+)

diff --git a/libavutil/hwcontext.h b/libavutil/hwcontext.h
index f15cf7c..0b12fe2 100644
--- a/libavutil/hwcontext.h
+++ b/libavutil/hwcontext.h
@@ -318,6 +318,14 @@ int av_hwframe_get_buffer(AVBufferRef *hwframe_ctx, 
AVFrame *frame, int flags);
  * If dst->format is set, then this format will be used, otherwise (when
  * dst->format is AV_PIX_FMT_NONE) the first acceptable format will be chosen.
  *
+ * The two frames must have matching allocated dimensions (i.e. equal to
+ * AVHWFramesContext.width/height), since not all device types support
+ * transferring a sub-rectangle of the whole surface. The display dimensions
+ * (i.e. AVFrame.width/height) may be smaller than the allocated dimensions, 
but
+ * also have to be equal for both frames. When the display dimensions are
+ * smaller than the allocated dimensions, the content of the padding in the
+ * destination frame is unspecified.
+ *
  * @param dst the destination frame. dst is not touched on failure.
  * @param src the source frame.
  * @param flags currently unused, should be set to zero

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] Merge commit '5fcae3b3f93fd02b3d1e009b9d9b17410fca9498'

2016-11-13 Thread Hendrik Leppkes
ffmpeg | branch: master | Hendrik Leppkes  | Sun Nov 13 
22:35:04 2016 +0100| [72c38dd66e528f4d70c103c5cfc4ebc25a21cc62] | committer: 
Hendrik Leppkes

Merge commit '5fcae3b3f93fd02b3d1e009b9d9b17410fca9498'

* commit '5fcae3b3f93fd02b3d1e009b9d9b17410fca9498':
  hwcontext: clarify the behaviour of transfer_data() for cropped frames

Merged-by: Hendrik Leppkes 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=72c38dd66e528f4d70c103c5cfc4ebc25a21cc62
---

 libavutil/hwcontext.h | 8 
 1 file changed, 8 insertions(+)

diff --git a/libavutil/hwcontext.h b/libavutil/hwcontext.h
index 5e2af09..785da09 100644
--- a/libavutil/hwcontext.h
+++ b/libavutil/hwcontext.h
@@ -318,6 +318,14 @@ int av_hwframe_get_buffer(AVBufferRef *hwframe_ctx, 
AVFrame *frame, int flags);
  * If dst->format is set, then this format will be used, otherwise (when
  * dst->format is AV_PIX_FMT_NONE) the first acceptable format will be chosen.
  *
+ * The two frames must have matching allocated dimensions (i.e. equal to
+ * AVHWFramesContext.width/height), since not all device types support
+ * transferring a sub-rectangle of the whole surface. The display dimensions
+ * (i.e. AVFrame.width/height) may be smaller than the allocated dimensions, 
but
+ * also have to be equal for both frames. When the display dimensions are
+ * smaller than the allocated dimensions, the content of the padding in the
+ * destination frame is unspecified.
+ *
  * @param dst the destination frame. dst is not touched on failure.
  * @param src the source frame.
  * @param flags currently unused, should be set to zero


==


___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] qsvdec_hevc: fix a variable name

2016-11-13 Thread Anton Khirnov
ffmpeg | branch: master | Anton Khirnov  | Wed Jun 22 
12:00:48 2016 +0200| [c67594a2c7fd4381e6d44246b18487c7e6b75f02] | committer: 
Anton Khirnov

qsvdec_hevc: fix a variable name

hevcenc -> hevcdec, this is a _decoder_ plugin.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c67594a2c7fd4381e6d44246b18487c7e6b75f02
---

 libavcodec/qsvdec_h2645.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/qsvdec_h2645.c b/libavcodec/qsvdec_h2645.c
index 134b5a6..ba57aeb 100644
--- a/libavcodec/qsvdec_h2645.c
+++ b/libavcodec/qsvdec_h2645.c
@@ -88,7 +88,7 @@ static av_cold int qsv_decode_init(AVCodecContext *avctx)
 int ret;
 
 if (avctx->codec_id == AV_CODEC_ID_HEVC && s->load_plugin != 
LOAD_PLUGIN_NONE) {
-static const char *uid_hevcenc_sw = "15dd936825ad475ea34e35f3f54217a6";
+static const char *uid_hevcdec_sw = "15dd936825ad475ea34e35f3f54217a6";
 
 if (s->qsv.load_plugins[0]) {
 av_log(avctx, AV_LOG_WARNING,
@@ -96,7 +96,7 @@ static av_cold int qsv_decode_init(AVCodecContext *avctx)
"The load_plugin value will be ignored.\n");
 } else {
 av_freep(&s->qsv.load_plugins);
-s->qsv.load_plugins = av_strdup(uid_hevcenc_sw);
+s->qsv.load_plugins = av_strdup(uid_hevcdec_sw);
 if (!s->qsv.load_plugins)
 return AVERROR(ENOMEM);
 }

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] qsvdec_hevc: add the UID of the HEVC HW decoder plugin

2016-11-13 Thread Anton Khirnov
ffmpeg | branch: master | Anton Khirnov  | Wed Jun 22 
12:03:22 2016 +0200| [eccfb9778ae939764d17457f34338d140832d9e1] | committer: 
Anton Khirnov

qsvdec_hevc: add the UID of the HEVC HW decoder plugin

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=eccfb9778ae939764d17457f34338d140832d9e1
---

 libavcodec/qsvdec_h2645.c | 11 +--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/libavcodec/qsvdec_h2645.c b/libavcodec/qsvdec_h2645.c
index ba57aeb..4bc1cd3 100644
--- a/libavcodec/qsvdec_h2645.c
+++ b/libavcodec/qsvdec_h2645.c
@@ -40,6 +40,7 @@
 enum LoadPlugin {
 LOAD_PLUGIN_NONE,
 LOAD_PLUGIN_HEVC_SW,
+LOAD_PLUGIN_HEVC_HW,
 };
 
 typedef struct QSVH2645Context {
@@ -89,6 +90,7 @@ static av_cold int qsv_decode_init(AVCodecContext *avctx)
 
 if (avctx->codec_id == AV_CODEC_ID_HEVC && s->load_plugin != 
LOAD_PLUGIN_NONE) {
 static const char *uid_hevcdec_sw = "15dd936825ad475ea34e35f3f54217a6";
+static const char *uid_hevcdec_hw = "33a61c0b4c27454ca8d85dde757c6f8e";
 
 if (s->qsv.load_plugins[0]) {
 av_log(avctx, AV_LOG_WARNING,
@@ -96,7 +98,11 @@ static av_cold int qsv_decode_init(AVCodecContext *avctx)
"The load_plugin value will be ignored.\n");
 } else {
 av_freep(&s->qsv.load_plugins);
-s->qsv.load_plugins = av_strdup(uid_hevcdec_sw);
+
+if (s->load_plugin == LOAD_PLUGIN_HEVC_SW)
+s->qsv.load_plugins = av_strdup(uid_hevcdec_sw);
+else
+s->qsv.load_plugins = av_strdup(uid_hevcdec_hw);
 if (!s->qsv.load_plugins)
 return AVERROR(ENOMEM);
 }
@@ -233,9 +239,10 @@ AVHWAccel ff_hevc_qsv_hwaccel = {
 static const AVOption hevc_options[] = {
 { "async_depth", "Internal parallelization depth, the higher the value the 
higher the latency.", OFFSET(qsv.async_depth), AV_OPT_TYPE_INT, { .i64 = 
ASYNC_DEPTH_DEFAULT }, 0, INT_MAX, VD },
 
-{ "load_plugin", "A user plugin to load in an internal session", 
OFFSET(load_plugin), AV_OPT_TYPE_INT, { .i64 = LOAD_PLUGIN_HEVC_SW }, 
LOAD_PLUGIN_NONE, LOAD_PLUGIN_HEVC_SW, VD, "load_plugin" },
+{ "load_plugin", "A user plugin to load in an internal session", 
OFFSET(load_plugin), AV_OPT_TYPE_INT, { .i64 = LOAD_PLUGIN_HEVC_SW }, 
LOAD_PLUGIN_NONE, LOAD_PLUGIN_HEVC_HW, VD, "load_plugin" },
 { "none", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = LOAD_PLUGIN_NONE },
0, 0, VD, "load_plugin" },
 { "hevc_sw",  NULL, 0, AV_OPT_TYPE_CONST, { .i64 = LOAD_PLUGIN_HEVC_SW }, 
0, 0, VD, "load_plugin" },
+{ "hevc_hw",  NULL, 0, AV_OPT_TYPE_CONST, { .i64 = LOAD_PLUGIN_HEVC_HW }, 
0, 0, VD, "load_plugin" },
 
 { "load_plugins", "A :-separate list of hexadecimal plugin UIDs to load in 
an internal session",
 OFFSET(qsv.load_plugins), AV_OPT_TYPE_STRING, { .str = "" }, 0, 0, VD 
},

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] Merge commit 'c67594a2c7fd4381e6d44246b18487c7e6b75f02'

2016-11-13 Thread Hendrik Leppkes
ffmpeg | branch: master | Hendrik Leppkes  | Sun Nov 13 
22:38:29 2016 +0100| [a478ae39388bbe534889f7007f1d4b769224343e] | committer: 
Hendrik Leppkes

Merge commit 'c67594a2c7fd4381e6d44246b18487c7e6b75f02'

* commit 'c67594a2c7fd4381e6d44246b18487c7e6b75f02':
  qsvdec_hevc: fix a variable name

Merged-by: Hendrik Leppkes 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a478ae39388bbe534889f7007f1d4b769224343e
---



___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] Merge commit 'eccfb9778ae939764d17457f34338d140832d9e1'

2016-11-13 Thread Hendrik Leppkes
ffmpeg | branch: master | Hendrik Leppkes  | Sun Nov 13 
22:38:45 2016 +0100| [fb40daa7f3b86b66b15973d33f4269461b1e1ffd] | committer: 
Hendrik Leppkes

Merge commit 'eccfb9778ae939764d17457f34338d140832d9e1'

* commit 'eccfb9778ae939764d17457f34338d140832d9e1':
  qsvdec_hevc: add the UID of the HEVC HW decoder plugin

Merged-by: Hendrik Leppkes 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=fb40daa7f3b86b66b15973d33f4269461b1e1ffd
---



___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] movenc: Apply offsets on timestamps when peeking into interleaving queues

2016-11-13 Thread Martin Storsjö
ffmpeg | branch: master | Martin Storsjö  | Fri Jun 24 
23:38:54 2016 +0300| [785c25443b56adb6dbbb78d68cccbd9bd4a42e05] | committer: 
Martin Storsjö

movenc: Apply offsets on timestamps when peeking into interleaving queues

Signed-off-by: Martin Storsjö 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=785c25443b56adb6dbbb78d68cccbd9bd4a42e05
---

 libavformat/internal.h | 11 ++-
 libavformat/movenc.c   | 12 ++--
 libavformat/mux.c  | 22 ++
 3 files changed, 30 insertions(+), 15 deletions(-)

diff --git a/libavformat/internal.h b/libavformat/internal.h
index bbdfd2f..de55af5 100644
--- a/libavformat/internal.h
+++ b/libavformat/internal.h
@@ -443,12 +443,13 @@ void ff_format_io_close(AVFormatContext *s, AVIOContext 
**pb);
 
 /**
  * Find the next packet in the interleaving queue for the given stream.
- * The packet is not removed from the interleaving queue, but only
- * a pointer to it is returned.
+ * The pkt parameter is filled in with the queued packet, including
+ * references to the data (which the caller is not allowed to keep or
+ * modify).
  *
- * @return a pointer to the next packet, or NULL if no packet is queued
- * for this stream.
+ * @return 0 if a packet was found, a negative value if no packet was found
  */
-const AVPacket *ff_interleaved_peek(AVFormatContext *s, int stream);
+int ff_interleaved_peek(AVFormatContext *s, int stream,
+AVPacket *pkt, int add_offset);
 
 #endif /* AVFORMAT_INTERNAL_H */
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index aadfa06..393442c 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -3262,13 +3262,13 @@ static int mov_flush_fragment(AVFormatContext *s, int 
force)
 for (i = 0; i < s->nb_streams; i++) {
 MOVTrack *track = &mov->tracks[i];
 if (!track->end_reliable) {
-const AVPacket *next = ff_interleaved_peek(s, i);
-if (next) {
-track->track_duration = next->dts - track->start_dts;
-if (next->pts != AV_NOPTS_VALUE)
-track->end_pts = next->pts;
+AVPacket pkt;
+if (!ff_interleaved_peek(s, i, &pkt, 1)) {
+track->track_duration = pkt.dts - track->start_dts;
+if (pkt.pts != AV_NOPTS_VALUE)
+track->end_pts = pkt.pts;
 else
-track->end_pts = next->dts;
+track->end_pts = pkt.dts;
 }
 }
 }
diff --git a/libavformat/mux.c b/libavformat/mux.c
index c41c477..37c4541 100644
--- a/libavformat/mux.c
+++ b/libavformat/mux.c
@@ -357,6 +357,8 @@ FF_ENABLE_DEPRECATION_WARNINGS
 static int write_packet(AVFormatContext *s, AVPacket *pkt)
 {
 int ret;
+// If the timestamp offsetting below is adjusted, adjust
+// ff_interleaved_peek similarly.
 if (s->avoid_negative_ts > 0) {
 AVRational time_base = s->streams[pkt->stream_index]->time_base;
 int64_t offset = 0;
@@ -614,15 +616,27 @@ int ff_interleave_packet_per_dts(AVFormatContext *s, 
AVPacket *out,
 }
 }
 
-const AVPacket *ff_interleaved_peek(AVFormatContext *s, int stream)
+int ff_interleaved_peek(AVFormatContext *s, int stream,
+AVPacket *pkt, int add_offset)
 {
 AVPacketList *pktl = s->internal->packet_buffer;
 while (pktl) {
-if (pktl->pkt.stream_index == stream)
-return &pktl->pkt;
+if (pktl->pkt.stream_index == stream) {
+*pkt = pktl->pkt;
+if (add_offset && s->internal->offset != AV_NOPTS_VALUE) {
+int64_t offset = av_rescale_q(s->internal->offset,
+  s->internal->offset_timebase,
+  s->streams[stream]->time_base);
+if (pkt->dts != AV_NOPTS_VALUE)
+pkt->dts += offset;
+if (pkt->pts != AV_NOPTS_VALUE)
+pkt->pts += offset;
+}
+return 0;
+}
 pktl = pktl->next;
 }
-return NULL;
+return AVERROR(ENOENT);
 }
 
 /**

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] Merge commit '785c25443b56adb6dbbb78d68cccbd9bd4a42e05'

2016-11-13 Thread Hendrik Leppkes
ffmpeg | branch: master | Hendrik Leppkes  | Sun Nov 13 
22:55:34 2016 +0100| [8fad4b4e251bb21f8871fa829b593454528aff24] | committer: 
Hendrik Leppkes

Merge commit '785c25443b56adb6dbbb78d68cccbd9bd4a42e05'

* commit '785c25443b56adb6dbbb78d68cccbd9bd4a42e05':
  movenc: Apply offsets on timestamps when peeking into interleaving queues

Merged-by: Hendrik Leppkes 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8fad4b4e251bb21f8871fa829b593454528aff24
---

 libavformat/internal.h | 13 ++---
 libavformat/movenc.c   | 14 ++
 libavformat/mux.c  | 29 +++--
 3 files changed, 31 insertions(+), 25 deletions(-)

diff --git a/libavformat/internal.h b/libavformat/internal.h
index da64c64..9d614fb 100644
--- a/libavformat/internal.h
+++ b/libavformat/internal.h
@@ -657,14 +657,13 @@ int ff_bprint_to_codecpar_extradata(AVCodecParameters 
*par, struct AVBPrint *buf
 
 /**
  * Find the next packet in the interleaving queue for the given stream.
- * The packet is not removed from the interleaving queue, but only
- * a pointer to it is returned.
+ * The pkt parameter is filled in with the queued packet, including
+ * references to the data (which the caller is not allowed to keep or
+ * modify).
  *
- * @param ts_offset the ts difference between packet in the queue and the 
muxer.
- *
- * @return a pointer to the next packet, or NULL if no packet is queued
- * for this stream.
+ * @return 0 if a packet was found, a negative value if no packet was found
  */
-const AVPacket *ff_interleaved_peek(AVFormatContext *s, int stream, int64_t 
*ts_offset);
+int ff_interleaved_peek(AVFormatContext *s, int stream,
+AVPacket *pkt, int add_offset);
 
 #endif /* AVFORMAT_INTERNAL_H */
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index efa050e..7a726c6 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -4484,15 +4484,13 @@ static int mov_flush_fragment(AVFormatContext *s, int 
force)
 for (i = 0; i < s->nb_streams; i++) {
 MOVTrack *track = &mov->tracks[i];
 if (!track->end_reliable) {
-int64_t ts_offset;
-const AVPacket *next = ff_interleaved_peek(s, i, &ts_offset);
-if (next) {
-track->track_duration = next->dts - track->start_dts + 
ts_offset;
-if (next->pts != AV_NOPTS_VALUE)
-track->end_pts = next->pts;
+AVPacket pkt;
+if (!ff_interleaved_peek(s, i, &pkt, 1)) {
+track->track_duration = pkt.dts - track->start_dts;
+if (pkt.pts != AV_NOPTS_VALUE)
+track->end_pts = pkt.pts;
 else
-track->end_pts = next->dts;
-track->end_pts += ts_offset;
+track->end_pts = pkt.dts;
 }
 }
 }
diff --git a/libavformat/mux.c b/libavformat/mux.c
index 77823a4..4d47ddc 100644
--- a/libavformat/mux.c
+++ b/libavformat/mux.c
@@ -692,6 +692,8 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt)
 pts_backup = pkt->pts;
 dts_backup = pkt->dts;
 
+// If the timestamp offsetting below is adjusted, adjust
+// ff_interleaved_peek similarly.
 if (s->output_ts_offset) {
 AVStream *st = s->streams[pkt->stream_index];
 int64_t offset = av_rescale_q(s->output_ts_offset, AV_TIME_BASE_Q, 
st->time_base);
@@ -1180,23 +1182,30 @@ int ff_interleave_packet_per_dts(AVFormatContext *s, 
AVPacket *out,
 }
 }
 
-const AVPacket *ff_interleaved_peek(AVFormatContext *s, int stream, int64_t 
*ts_offset)
+int ff_interleaved_peek(AVFormatContext *s, int stream,
+AVPacket *pkt, int add_offset)
 {
 AVPacketList *pktl = s->internal->packet_buffer;
 while (pktl) {
 if (pktl->pkt.stream_index == stream) {
-AVPacket *pkt = &pktl->pkt;
-AVStream *st = s->streams[pkt->stream_index];
-*ts_offset = st->mux_ts_offset;
-
-if (s->output_ts_offset)
-*ts_offset += av_rescale_q(s->output_ts_offset, 
AV_TIME_BASE_Q, st->time_base);
-
-return pkt;
+*pkt = pktl->pkt;
+if (add_offset) {
+AVStream *st = s->streams[pkt->stream_index];
+int64_t offset = st->mux_ts_offset;
+
+if (s->output_ts_offset)
+offset += av_rescale_q(s->output_ts_offset, 
AV_TIME_BASE_Q, st->time_base);
+
+if (pkt->dts != AV_NOPTS_VALUE)
+pkt->dts += offset;
+if (pkt->pts != AV_NOPTS_VALUE)
+pkt->pts += offset;
+}
+return 0;
 }
 pktl = pktl->next;
 }
-return NULL;
+return AVERROR(ENOENT);
 }
 
 /**


==

diff --cc libavformat/internal.h
index da64c64,de55af5..9d614fb
--- a/libavformat/internal.h
+++ b/libavf

[FFmpeg-cvslog] Merge commit '82b7525173f20702a8cbc26ebedbf4b69b8fecec'

2016-11-13 Thread Hendrik Leppkes
ffmpeg | branch: master | Hendrik Leppkes  | Sun Nov 13 
22:59:35 2016 +0100| [b2554e61e0ba264638ff8b4926d8f3304727cdaf] | committer: 
Hendrik Leppkes

Merge commit '82b7525173f20702a8cbc26ebedbf4b69b8fecec'

* commit '82b7525173f20702a8cbc26ebedbf4b69b8fecec':
  Add an OpenH264 decoder wrapper

This commit is a noop, see c5d326f551b0312ff581bf1df35b21d956e01523

Merged-by: Hendrik Leppkes 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b2554e61e0ba264638ff8b4926d8f3304727cdaf
---



___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] Add an OpenH264 decoder wrapper

2016-11-13 Thread Martin Storsjö
ffmpeg | branch: master | Martin Storsjö  | Fri Jun 24 
00:58:17 2016 +0300| [82b7525173f20702a8cbc26ebedbf4b69b8fecec] | committer: 
Martin Storsjö

Add an OpenH264 decoder wrapper

While it is less featureful (and slower) than the built-in H264
decoder, one could potentially want to use it to take advantage
of the cisco patent license offer.

Signed-off-by: Martin Storsjö 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=82b7525173f20702a8cbc26ebedbf4b69b8fecec
---

 Changelog   |   1 +
 configure   |   2 +
 doc/general.texi|   9 +-
 libavcodec/Makefile |   3 +-
 libavcodec/allcodecs.c  |   2 +-
 libavcodec/libopenh264.c|  62 +++
 libavcodec/libopenh264.h|  39 +++
 libavcodec/libopenh264dec.c | 245 
 libavcodec/libopenh264enc.c |  48 ++---
 libavcodec/version.h|   4 +-
 10 files changed, 369 insertions(+), 46 deletions(-)

diff --git a/Changelog b/Changelog
index 764cb3a..b21f447 100644
--- a/Changelog
+++ b/Changelog
@@ -60,6 +60,7 @@ version :
 - MagicYUV decoder
 - Duck TrueMotion 2.0 Real Time decoder
 - Intel QSV video scaling filter
+- OpenH264 decoder wrapper
 
 
 version 11:
diff --git a/configure b/configure
index 1a58a4c..015bd61 100755
--- a/configure
+++ b/configure
@@ -2235,6 +2235,8 @@ libopencore_amrnb_decoder_deps="libopencore_amrnb"
 libopencore_amrnb_encoder_deps="libopencore_amrnb"
 libopencore_amrnb_encoder_select="audio_frame_queue"
 libopencore_amrwb_decoder_deps="libopencore_amrwb"
+libopenh264_decoder_deps="libopenh264"
+libopenh264_decoder_select="h264_mp4toannexb_bsf"
 libopenh264_encoder_deps="libopenh264"
 libopenjpeg_decoder_deps="libopenjpeg"
 libopenjpeg_encoder_deps="libopenjpeg"
diff --git a/doc/general.texi b/doc/general.texi
index 0590c23..ea56bef 100644
--- a/doc/general.texi
+++ b/doc/general.texi
@@ -97,12 +97,19 @@ enable it.
 
 @section OpenH264
 
-Libav can make use of the OpenH264 library for H.264 encoding.
+Libav can make use of the OpenH264 library for H.264 encoding and decoding.
 
 Go to @url{http://www.openh264.org/} and follow the instructions for
 installing the library. Then pass @code{--enable-libopenh264} to configure to
 enable it.
 
+For decoding, this library is much more limited than the built-in decoder
+in libavcodec; currently, this library lacks support for decoding B-frames
+and some other main/high profile features. (It currently only supports
+constrained baseline profile and CABAC.) Using it is mostly useful for
+testing and for taking advantage of Cisco's patent portfolio license
+(@url{http://www.openh264.org/BINARY_LICENSE.txt}).
+
 @section x264
 
 Libav can make use of the x264 library for H.264 encoding.
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index 622e100..c969609 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -678,7 +678,8 @@ OBJS-$(CONFIG_LIBMP3LAME_ENCODER) += libmp3lame.o 
mpegaudiodecheader.o
 OBJS-$(CONFIG_LIBOPENCORE_AMRNB_DECODER)  += libopencore-amr.o
 OBJS-$(CONFIG_LIBOPENCORE_AMRNB_ENCODER)  += libopencore-amr.o
 OBJS-$(CONFIG_LIBOPENCORE_AMRWB_DECODER)  += libopencore-amr.o
-OBJS-$(CONFIG_LIBOPENH264_ENCODER)+= libopenh264enc.o
+OBJS-$(CONFIG_LIBOPENH264_DECODER)+= libopenh264dec.o libopenh264.o
+OBJS-$(CONFIG_LIBOPENH264_ENCODER)+= libopenh264enc.o libopenh264.o
 OBJS-$(CONFIG_LIBOPENJPEG_DECODER)+= libopenjpegdec.o
 OBJS-$(CONFIG_LIBOPENJPEG_ENCODER)+= libopenjpegenc.o
 OBJS-$(CONFIG_LIBOPUS_DECODER)+= libopusdec.o libopus.o \
diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
index 6fa1617..e259de2 100644
--- a/libavcodec/allcodecs.c
+++ b/libavcodec/allcodecs.c
@@ -488,7 +488,7 @@ void avcodec_register_all(void)
 
 /* external libraries, that shouldn't be used by default if one of the
  * above is available */
-REGISTER_ENCODER(LIBOPENH264,   libopenh264);
+REGISTER_ENCDEC (LIBOPENH264,   libopenh264);
 REGISTER_ENCODER(H264_NVENC,h264_nvenc);
 REGISTER_ENCODER(H264_OMX,  h264_omx);
 REGISTER_ENCODER(H264_QSV,  h264_qsv);
diff --git a/libavcodec/libopenh264.c b/libavcodec/libopenh264.c
new file mode 100644
index 000..6252cfd
--- /dev/null
+++ b/libavcodec/libopenh264.c
@@ -0,0 +1,62 @@
+/*
+ * OpenH264 shared utils
+ * Copyright (C) 2014 Martin Storsjo
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You shoul

[FFmpeg-cvslog] checkasm: h264dsp: Initialize the padding area

2016-11-13 Thread Martin Storsjö
ffmpeg | branch: master | Martin Storsjö  | Mon Jun 27 
22:22:21 2016 +0300| [e57de6faa1e796099091c9af947d4755edacccaf] | committer: 
Martin Storsjö

checkasm: h264dsp: Initialize the padding area

This fixes valgrind warnings about conditional jumps based on
uninitialized data (even though the uninitialized data only ever
was compared with a direct copy of the same uninitialized data).

Signed-off-by: Martin Storsjö 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e57de6faa1e796099091c9af947d4755edacccaf
---

 tests/checkasm/h264dsp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/checkasm/h264dsp.c b/tests/checkasm/h264dsp.c
index 082c3d4..c3065d2 100644
--- a/tests/checkasm/h264dsp.c
+++ b/tests/checkasm/h264dsp.c
@@ -36,7 +36,7 @@ static const uint32_t pixel_mask[3] = { 0x, 
0x01ff01ff, 0x03ff03ff };
 do { \
 uint32_t mask = pixel_mask[bit_depth - 8];   \
 for (y = 0; y < sz; y++) {   \
-for (x = 0; x < sz * SIZEOF_PIXEL; x += 4) { \
+for (x = 0; x < PIXEL_STRIDE; x += 4) {  \
 AV_WN32A(src + y * PIXEL_STRIDE + x, rnd() & mask);  \
 AV_WN32A(dst + y * PIXEL_STRIDE + x, rnd() & mask);  \
 }\

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] Merge commit 'e57de6faa1e796099091c9af947d4755edacccaf'

2016-11-13 Thread Hendrik Leppkes
ffmpeg | branch: master | Hendrik Leppkes  | Sun Nov 13 
23:00:07 2016 +0100| [af8b174711f3afff7d495ac00fe5bf9be98d3b70] | committer: 
Hendrik Leppkes

Merge commit 'e57de6faa1e796099091c9af947d4755edacccaf'

* commit 'e57de6faa1e796099091c9af947d4755edacccaf':
  checkasm: h264dsp: Initialize the padding area

Merged-by: Hendrik Leppkes 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=af8b174711f3afff7d495ac00fe5bf9be98d3b70
---



___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] Merge commit 'e48746deec48e9ff195841bc3266b4e153a878cd'

2016-11-13 Thread Hendrik Leppkes
ffmpeg | branch: master | Hendrik Leppkes  | Sun Nov 13 
23:02:39 2016 +0100| [f75035b06f4b287443fa9275f76183ace39c2d45] | committer: 
Hendrik Leppkes

Merge commit 'e48746deec48e9ff195841bc3266b4e153a878cd'

* commit 'e48746deec48e9ff195841bc3266b4e153a878cd':
  checkasm: h264dsp: Move the x and y variables into the randomize_buffer macro

Merged-by: Hendrik Leppkes 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f75035b06f4b287443fa9275f76183ace39c2d45
---

 tests/checkasm/h264dsp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/checkasm/h264dsp.c b/tests/checkasm/h264dsp.c
index 2c2603b..9454237 100644
--- a/tests/checkasm/h264dsp.c
+++ b/tests/checkasm/h264dsp.c
@@ -34,6 +34,7 @@ static const uint32_t pixel_mask[3] = { 0x, 
0x01ff01ff, 0x03ff03ff };
 
 #define randomize_buffers()  \
 do { \
+int x, y;\
 uint32_t mask = pixel_mask[bit_depth - 8];   \
 for (y = 0; y < sz; y++) {   \
 for (x = 0; x < PIXEL_STRIDE; x += 4) {  \
@@ -178,8 +179,7 @@ static void check_idct(void)
 LOCAL_ALIGNED_16(int16_t, subcoef0, [8 * 8 * 2]);
 LOCAL_ALIGNED_16(int16_t, subcoef1, [8 * 8 * 2]);
 H264DSPContext h;
-int bit_depth, sz, align;
-int x, y, dc;
+int bit_depth, sz, align, dc;
 declare_func_emms(AV_CPU_FLAG_MMX, void, uint8_t *dst, int16_t *block, int 
stride);
 
 for (bit_depth = 8; bit_depth <= 10; bit_depth++) {


==


___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] checkasm: h264dsp: Move the x and y variables into the randomize_buffer macro

2016-11-13 Thread Martin Storsjö
ffmpeg | branch: master | Martin Storsjö  | Mon Jun 27 
22:24:15 2016 +0300| [e48746deec48e9ff195841bc3266b4e153a878cd] | committer: 
Martin Storsjö

checkasm: h264dsp: Move the x and y variables into the randomize_buffer macro

This avoids the risk of accidentally clobbering such variables outside
of the macro if the same variables are used there.

Signed-off-by: Martin Storsjö 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e48746deec48e9ff195841bc3266b4e153a878cd
---

 tests/checkasm/h264dsp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/checkasm/h264dsp.c b/tests/checkasm/h264dsp.c
index c3065d2..c9ddd52 100644
--- a/tests/checkasm/h264dsp.c
+++ b/tests/checkasm/h264dsp.c
@@ -34,6 +34,7 @@ static const uint32_t pixel_mask[3] = { 0x, 
0x01ff01ff, 0x03ff03ff };
 
 #define randomize_buffers()  \
 do { \
+int x, y;\
 uint32_t mask = pixel_mask[bit_depth - 8];   \
 for (y = 0; y < sz; y++) {   \
 for (x = 0; x < PIXEL_STRIDE; x += 4) {  \
@@ -178,8 +179,7 @@ static void check_idct(void)
 LOCAL_ALIGNED_16(int16_t, subcoef0, [8 * 8 * 2]);
 LOCAL_ALIGNED_16(int16_t, subcoef1, [8 * 8 * 2]);
 H264DSPContext h;
-int bit_depth, sz, align;
-int x, y, dc;
+int bit_depth, sz, align, dc;
 declare_func_emms(AV_CPU_FLAG_MMX, void, uint8_t *dst, int16_t *block, int 
stride);
 
 for (bit_depth = 8; bit_depth <= 10; bit_depth++) {

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] lavc/dpx: Support GRAY12 colourspace.

2016-11-13 Thread Carl Eugen Hoyos
ffmpeg | branch: master | Carl Eugen Hoyos  | Thu Nov 10 
23:04:46 2016 +0100| [b1367f7e5e6717cbd0ac658f74479b927c1945e3] | committer: 
Carl Eugen Hoyos

lavc/dpx: Support GRAY12 colourspace.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b1367f7e5e6717cbd0ac658f74479b927c1945e3
---

 libavcodec/dpx.c | 12 
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/libavcodec/dpx.c b/libavcodec/dpx.c
index e4dd1b0..1aa2cbd 100644
--- a/libavcodec/dpx.c
+++ b/libavcodec/dpx.c
@@ -243,6 +243,10 @@ static int decode_frame(AVCodecContext *avctx,
 case 6080:
 avctx->pix_fmt = AV_PIX_FMT_GRAY8;
 break;
+case 6121:
+case 6120:
+avctx->pix_fmt = AV_PIX_FMT_GRAY12;
+break;
 case 50081:
 case 50080:
 avctx->pix_fmt = AV_PIX_FMT_RGB24;
@@ -345,12 +349,12 @@ static int decode_frame(AVCodecContext *avctx,
 (uint16_t*)ptr[2],
 (uint16_t*)ptr[3]};
 for (y = 0; y < avctx->width; y++) {
-*dst[2] = read16(&buf, endian) >> 4;
-dst[2]++;
+if (elements >= 3)
+*dst[2]++ = read16(&buf, endian) >> 4;
 *dst[0] = read16(&buf, endian) >> 4;
 dst[0]++;
-*dst[1] = read16(&buf, endian) >> 4;
-dst[1]++;
+if (elements >= 2)
+*dst[1]++ = read16(&buf, endian) >> 4;
 if (elements == 4)
 *dst[3]++ = read16(&buf, endian) >> 4;
 }

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] doc/ffmpeg: add documentation for the disposition option

2016-11-13 Thread Simon Thelen
ffmpeg | branch: master | Simon Thelen  | Fri Nov 11 
01:27:12 2016 +0100| [cd5da01daab7813f8215b1215cfe4cfcdc7a1ab4] | committer: 
Michael Niedermayer

doc/ffmpeg: add documentation for the disposition option

Signed-off-by: Simon Thelen 
Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=cd5da01daab7813f8215b1215cfe4cfcdc7a1ab4
---

 doc/ffmpeg.texi | 34 ++
 1 file changed, 34 insertions(+)

diff --git a/doc/ffmpeg.texi b/doc/ffmpeg.texi
index fd8a0c1..4b159fd 100644
--- a/doc/ffmpeg.texi
+++ b/doc/ffmpeg.texi
@@ -357,6 +357,40 @@ To set the language of the first audio stream:
 ffmpeg -i INPUT -metadata:s:a:0 language=eng OUTPUT
 @end example
 
+@item -disposition[:stream_specifier] @var{value} (@emph{output,per-stream})
+Sets the disposition for a stream.
+
+This option overrides the disposition copied from the input stream. It is also
+possible to delete the disposition by setting it to 0.
+
+The following dispositions are recognized:
+@table @option
+@item default
+@item dub
+@item original
+@item comment
+@item lyrics
+@item karaoke
+@item forced
+@item hearing_impaired
+@item visual_impaired
+@item clean_effects
+@item captions
+@item descriptions
+@item metadata
+@end table
+
+For example, to make the second audio stream the default stream:
+@example
+ffmpeg -i in.mkv -disposition:a:1 default out.mkv
+@end example
+
+To make the second subtitle stream the default stream and remove the default
+disposition from the first subtitle stream:
+@example
+ffmpeg -i INPUT -disposition:s:0 0 -disposition:s:1 default OUTPUT
+@end example
+
 @item -program 
[title=@var{title}:][program_num=@var{program_num}:]st=@var{stream}[:st=@var{stream}...]
 (@emph{output})
 
 Creates a program with the specified @var{title}, @var{program_num} and adds 
the specified

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] lavfi/ebur128: use ff_ prefix

2016-11-13 Thread Kyle Swanson
ffmpeg | branch: master | Kyle Swanson  | Sun Nov 13 19:11:07 2016 
-0600| [83b6b434fffc2749b3012fa3608d90939faddbb8] | committer: Kyle Swanson

lavfi/ebur128: use ff_ prefix

Signed-off-by: Kyle Swanson 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=83b6b434fffc2749b3012fa3608d90939faddbb8
---

 libavfilter/ebur128.h | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/libavfilter/ebur128.h b/libavfilter/ebur128.h
index c39c80d..b94cd24 100644
--- a/libavfilter/ebur128.h
+++ b/libavfilter/ebur128.h
@@ -81,15 +81,15 @@ enum channel {
  *  modes that suit your needs, as performance will be better.
  */
 enum mode {
-  /** can call ebur128_loudness_momentary */
+  /** can call ff_ebur128_loudness_momentary */
 FF_EBUR128_MODE_M = (1 << 0),
-  /** can call ebur128_loudness_shortterm */
+  /** can call ff_ebur128_loudness_shortterm */
 FF_EBUR128_MODE_S = (1 << 1) | FF_EBUR128_MODE_M,
-  /** can call ebur128_loudness_global_* and ebur128_relative_threshold */
+  /** can call ff_ebur128_loudness_global_* and ff_ebur128_relative_threshold 
*/
 FF_EBUR128_MODE_I = (1 << 2) | FF_EBUR128_MODE_M,
-  /** can call ebur128_loudness_range */
+  /** can call ff_ebur128_loudness_range */
 FF_EBUR128_MODE_LRA = (1 << 3) | FF_EBUR128_MODE_S,
-  /** can call ebur128_sample_peak */
+  /** can call ff_ebur128_sample_peak */
 FF_EBUR128_MODE_SAMPLE_PEAK = (1 << 4) | FF_EBUR128_MODE_M,
 };
 

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] lavc/audiotoolboxdec: fix OSX SDK detection

2016-11-13 Thread Dmitry Kalinkin
ffmpeg | branch: master | Dmitry Kalinkin  | Tue Sep 
 6 07:11:17 2016 +0300| [dc23e359ef708b6e2c5fecd4b3c019bab85d102d] | committer: 
Michael Niedermayer

lavc/audiotoolboxdec: fix OSX SDK detection

__MAC_10_11 can be present in updated revision of an older SDK so it
can't reliably detect availability of kAudioFormatEnhancedAC3 constant.

Fixes: b4daa2c40f ('lavc/audiotoolboxdec: add eac3 decoder')
Cc: Rodger Combs 
Signed-off-by: Dmitry Kalinkin 
Previous version reviewed by: Rodger Combs 
Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=dc23e359ef708b6e2c5fecd4b3c019bab85d102d
---

 libavcodec/audiotoolboxdec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/audiotoolboxdec.c b/libavcodec/audiotoolboxdec.c
index 3066d47..04a9be9 100644
--- a/libavcodec/audiotoolboxdec.c
+++ b/libavcodec/audiotoolboxdec.c
@@ -32,7 +32,7 @@
 #include "libavutil/opt.h"
 #include "libavutil/log.h"
 
-#ifndef __MAC_10_11
+#if __MAC_OS_X_VERSION_MIN_REQUIRED < 101100
 #define kAudioFormatEnhancedAC3 'ec-3'
 #endif
 

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] lavf/mux: don't warn about missing timestamps on attached pictures

2016-11-13 Thread Rodger Combs
ffmpeg | branch: master | Rodger Combs  | Sat Nov 12 
18:01:52 2016 -0600| [f8e3ebde56e8f6ad88fc747d6cf29819c4bb0026] | committer: 
Rodger Combs

lavf/mux: don't warn about missing timestamps on attached pictures

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f8e3ebde56e8f6ad88fc747d6cf29819c4bb0026
---

 libavformat/mux.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavformat/mux.c b/libavformat/mux.c
index 4d47ddc..e500531 100644
--- a/libavformat/mux.c
+++ b/libavformat/mux.c
@@ -575,6 +575,7 @@ static int compute_muxer_pkt_fields(AVFormatContext *s, 
AVStream *st, AVPacket *
 
 if (!s->internal->missing_ts_warning &&
 !(s->oformat->flags & AVFMT_NOTIMESTAMPS) &&
+(!(st->disposition & AV_DISPOSITION_ATTACHED_PIC) || (st->disposition 
& AV_DISPOSITION_TIMED_THUMBNAILS)) &&
 (pkt->pts == AV_NOPTS_VALUE || pkt->dts == AV_NOPTS_VALUE)) {
 av_log(s, AV_LOG_WARNING,
"Timestamps are unset in a packet for stream %d. "

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog