[FFmpeg-devel] [PATCH] avcodec/utils: only warn when passed invalid lowres value

2016-08-04 Thread Aman Gupta
From: Aman Gupta 

This makes it easier to use the lowres option when dealing with input
files in different codecs. If the codec doesn't support lowres=1 for
instance, it will throw a warning and use lowres=0 instead of erroring
out completely.
---
 libavcodec/utils.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index f7adb52..783f62c 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -1389,10 +1389,9 @@ int attribute_align_arg avcodec_open2(AVCodecContext 
*avctx, const AVCodec *code
 avctx->thread_count = 1;
 
 if (avctx->codec->max_lowres < avctx->lowres || avctx->lowres < 0) {
-av_log(avctx, AV_LOG_ERROR, "The maximum value for lowres supported by 
the decoder is %d\n",
+av_log(avctx, AV_LOG_WARNING, "The maximum value for lowres supported 
by the decoder is %d\n",
avctx->codec->max_lowres);
-ret = AVERROR(EINVAL);
-goto free_and_end;
+avctx->lowres = avctx->codec->max_lowres;
 }
 
 #if FF_API_VISMV
-- 
2.8.1

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


Re: [FFmpeg-devel] [PATCH] Avoid sending packets to network when multicast ttl is 0 in udp

2016-08-04 Thread Michael Niedermayer
On Fri, Aug 05, 2016 at 01:20:12AM +0430, Omid Ghaffarinia wrote:
> Thanks for your comment, actually 'code move' is necessary to make the
> code compile because it is needed to use udp_set_url in
> udp_set_multicast_ttl and the code is moved to make it possible.
> I can make it in two separate patches if needed, first to move
> udp_set_multicast_ttl without any further changes and then do the
> rest, but first patch would be redundant and does not actually fix
> anything.

yes, it results in more readable commits, also gives any interrested
developer a last chance to comment on this patch

thx

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Republics decline into democracies and democracies degenerate into
despotisms. -- Aristotle


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 3/3] avformat/img2enc: Use AV_FRAME_FILENAME_FLAGS_MULTIPLE, support tee:

2016-08-04 Thread Michael Niedermayer
On Wed, Aug 03, 2016 at 08:55:23PM +0200, Michael Niedermayer wrote:
> Signed-off-by: Michael Niedermayer 
> ---
>  libavformat/img2enc.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)

applied


[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The bravest are surely those who have the clearest vision
of what is before them, glory and danger alike, and yet
notwithstanding go out to meet it. -- Thucydides


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 2/3] avformat/hlsenc: Use AV_FRAME_FILENAME_FLAGS_MULTIPLE, support tee:

2016-08-04 Thread Michael Niedermayer
On Wed, Aug 03, 2016 at 08:55:22PM +0200, Michael Niedermayer wrote:
> Signed-off-by: Michael Niedermayer 
> ---
>  libavformat/hlsenc.c | 10 ++
>  1 file changed, 6 insertions(+), 4 deletions(-)

applied

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Awnsering whenever a program halts or runs forever is
On a turing machine, in general impossible (turings halting problem).
On any real computer, always possible as a real computer has a finite number
of states N, and will either halt in less than N cycles or never halt.


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 1/3] avformat: Add av_get_frame_filename2() and AV_FRAME_FILENAME_FLAGS_MULTIPLE

2016-08-04 Thread Michael Niedermayer
On Wed, Aug 03, 2016 at 08:55:21PM +0200, Michael Niedermayer wrote:
> This will be used to allow writing file sequences using the tee output onto
> multiple places in parallel
> 
> Signed-off-by: Michael Niedermayer 
> ---
>  libavformat/avformat.h | 7 +++
>  libavformat/utils.c| 9 +++--
>  2 files changed, 14 insertions(+), 2 deletions(-)

applied

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

No snowflake in an avalanche ever feels responsible. -- Voltaire


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] Avoid sending packets to network when multicast ttl is 0 in udp

2016-08-04 Thread Omid Ghaffarinia
Thanks for your comment, actually 'code move' is necessary to make the
code compile because it is needed to use udp_set_url in
udp_set_multicast_ttl and the code is moved to make it possible.
I can make it in two separate patches if needed, first to move
udp_set_multicast_ttl without any further changes and then do the
rest, but first patch would be redundant and does not actually fix
anything.

On Wed, Aug 3, 2016 at 10:04 PM, Michael Niedermayer
 wrote:
> On Wed, Aug 03, 2016 at 12:29:17PM +0430, Omid Ghaffarinia wrote:
>> Does it still fail?
>
> no failure
>
> i would prefer if the code move would be in a seperate
> patch though. Its harder to review for developers as is
>
> thx
>
> [...]
> --
> Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> While the State exists there can be no freedom; when there is freedom there
> will be no State. -- Vladimir Lenin
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 1/2] decklink: fix: set fps on video stream v2

2016-08-04 Thread Michael Niedermayer
On Sun, Jul 10, 2016 at 01:02:36PM +0200, Matthias Hunstock wrote:
> From: atze 


This doesnt list your full name is that intended ?

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Those who would give up essential Liberty, to purchase a little
temporary Safety, deserve neither Liberty nor Safety -- Benjamin Franklin


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avcodec/vdpau: clean up vdpau_internal.h

2016-08-04 Thread James Almer
On 8/4/2016 4:32 AM, Carl Eugen Hoyos wrote:
> 2016-08-03 6:30 GMT+02:00 James Almer :
>> Also don't include it on files that don't need it.
>>
>> This reduces differences with libav
>>
>> Signed-off-by: James Almer 
>> ---
>> Untested with VDPAU enabled.
> 
> The patch is probably ok if it does not brake compilation with
> VDPAU enabled or disabled.
> 
> Carl Eugen

Pushed, thanks.

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


Re: [FFmpeg-devel] [PATCH] avformat: add a TTA Muxer

2016-08-04 Thread James Almer
On 8/4/2016 3:38 PM, Michael Niedermayer wrote:
> On Sun, Jul 31, 2016 at 01:03:45PM -0300, James Almer wrote:
>> Signed-off-by: James Almer 
> [...]
>> +#include "apetag.h"
>> +#include "avformat.h"
>> +#include "avio_internal.h"
>> +#include "internal.h"
>> +
>> +typedef struct TTAMuxContext {
>> +AVIOContext *seek_table;
>> +AVIOContext *data;
>> +uint32_t nb_samples;
>> +int frame_size;
>> +int last_frame;
>> +} TTAMuxContext;
>> +
>> +static int tta_write_header(AVFormatContext *s)
>> +{
>> +TTAMuxContext *tta = s->priv_data;
>> +AVCodecParameters *par = s->streams[0]->codecpar;
>> +int ret;
>> +
>> +if (s->nb_streams > 1) {
> 
> should be == 1, the code would not work with 0 streams

Fixed.

> 
> 
>> +av_log(s, AV_LOG_ERROR, "Only one stream is supported\n");
>> +return AVERROR(EINVAL);
>> +}
>> +if (par->codec_id != AV_CODEC_ID_TTA) {
>> +av_log(s, AV_LOG_ERROR, "Unsupported codec\n");
>> +return AVERROR(EINVAL);
>> +}
>> +if (par->extradata && par->extradata_size < 22) {
>> +av_log(s, AV_LOG_ERROR, "Invalid TTA extradata\n");
>> +return AVERROR_INVALIDDATA;
>> +}
>> +
>> +if ((ret = avio_open_dyn_buf(>seek_table)) < 0)
>> +return ret;
>> +if ((ret = avio_open_dyn_buf(>data)) < 0) {
>> +ffio_free_dyn_buf(>seek_table);
>> +return ret;
>> +}
>> +
>> +/* Ignore most extradata information if present. It can be innacurate
>> +   if for example remuxing from Matroska */
>> +ffio_init_checksum(s->pb, ff_crcEDB88320_update, UINT32_MAX);
>> +ffio_init_checksum(tta->seek_table, ff_crcEDB88320_update, UINT32_MAX);
>> +avio_write(s->pb, "TTA1", 4);
>> +avio_wl16(s->pb, par->extradata ? AV_RL16(par->extradata + 4) : 1);
>> +avio_wl16(s->pb, par->channels);
>> +avio_wl16(s->pb, par->bits_per_raw_sample);
>> +avio_wl32(s->pb, par->sample_rate);
> 
>> +tta->frame_size = par->sample_rate * 256 / 245;
> 
> should use 64bit to avoid overflow

Added a check to make sure sample_rate is a sane value.

> 
> 
> [...]
>> diff --git a/tests/ref/acodec/tta b/tests/ref/acodec/tta
>> index 0f60345..8e183f9 100644
>> --- a/tests/ref/acodec/tta
>> +++ b/tests/ref/acodec/tta
>> @@ -1,4 +1,4 @@
>> -6c260836d7a32e4bd714453a3546c0d5 *tests/data/fate/acodec-tta.matroska
>> -331148 tests/data/fate/acodec-tta.matroska
>> +847d065f082ac94825728b5f1af853eb *tests/data/fate/acodec-tta.tta
>> +330583 tests/data/fate/acodec-tta.tta
>>  95e54b261530a1bcf6de6fe3b21dc5f6 *tests/data/fate/acodec-tta.out.wav
>>  stddev:0.00 PSNR:999.99 MAXDIFF:0 bytes:  1058400/  1058400
>> diff --git a/tests/ref/lavf/mka b/tests/ref/lavf/mka
>> new file mode 100644
>> index 000..962b254
>> --- /dev/null
>> +++ b/tests/ref/lavf/mka
>> @@ -0,0 +1,3 @@
>> +b2e3746787b885d0191a1a26f3faa58f *./tests/data/lavf/lavf.mka
>> +43654 ./tests/data/lavf/lavf.mka
>> +./tests/data/lavf/lavf.mka CRC=0x3a1da17e
>> diff --git a/tests/ref/lavf/tta b/tests/ref/lavf/tta
>> new file mode 100644
>> index 000..745e8d2
>> --- /dev/null
>> +++ b/tests/ref/lavf/tta
>> @@ -0,0 +1,3 @@
>> +f2721d06704ac43d89fdd25835b43598 *./tests/data/lavf/lavf.tta
>> +43200 ./tests/data/lavf/lavf.tta
>> +./tests/data/lavf/lavf.tta CRC=0x3a1da17e
> 
> fate tests
> Tested-by: Michael on x86 32 / 64, mingw 32/64, mips , arm
> Reviewed-by: Michael

Pushed, thanks.

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


Re: [FFmpeg-devel] [PATCH] avformat: add a TTA Muxer

2016-08-04 Thread Michael Niedermayer
On Sun, Jul 31, 2016 at 01:03:45PM -0300, James Almer wrote:
> Signed-off-by: James Almer 
[...]
> +#include "apetag.h"
> +#include "avformat.h"
> +#include "avio_internal.h"
> +#include "internal.h"
> +
> +typedef struct TTAMuxContext {
> +AVIOContext *seek_table;
> +AVIOContext *data;
> +uint32_t nb_samples;
> +int frame_size;
> +int last_frame;
> +} TTAMuxContext;
> +
> +static int tta_write_header(AVFormatContext *s)
> +{
> +TTAMuxContext *tta = s->priv_data;
> +AVCodecParameters *par = s->streams[0]->codecpar;
> +int ret;
> +
> +if (s->nb_streams > 1) {

should be == 1, the code would not work with 0 streams


> +av_log(s, AV_LOG_ERROR, "Only one stream is supported\n");
> +return AVERROR(EINVAL);
> +}
> +if (par->codec_id != AV_CODEC_ID_TTA) {
> +av_log(s, AV_LOG_ERROR, "Unsupported codec\n");
> +return AVERROR(EINVAL);
> +}
> +if (par->extradata && par->extradata_size < 22) {
> +av_log(s, AV_LOG_ERROR, "Invalid TTA extradata\n");
> +return AVERROR_INVALIDDATA;
> +}
> +
> +if ((ret = avio_open_dyn_buf(>seek_table)) < 0)
> +return ret;
> +if ((ret = avio_open_dyn_buf(>data)) < 0) {
> +ffio_free_dyn_buf(>seek_table);
> +return ret;
> +}
> +
> +/* Ignore most extradata information if present. It can be innacurate
> +   if for example remuxing from Matroska */
> +ffio_init_checksum(s->pb, ff_crcEDB88320_update, UINT32_MAX);
> +ffio_init_checksum(tta->seek_table, ff_crcEDB88320_update, UINT32_MAX);
> +avio_write(s->pb, "TTA1", 4);
> +avio_wl16(s->pb, par->extradata ? AV_RL16(par->extradata + 4) : 1);
> +avio_wl16(s->pb, par->channels);
> +avio_wl16(s->pb, par->bits_per_raw_sample);
> +avio_wl32(s->pb, par->sample_rate);

> +tta->frame_size = par->sample_rate * 256 / 245;

should use 64bit to avoid overflow


[...]
> diff --git a/tests/ref/acodec/tta b/tests/ref/acodec/tta
> index 0f60345..8e183f9 100644
> --- a/tests/ref/acodec/tta
> +++ b/tests/ref/acodec/tta
> @@ -1,4 +1,4 @@
> -6c260836d7a32e4bd714453a3546c0d5 *tests/data/fate/acodec-tta.matroska
> -331148 tests/data/fate/acodec-tta.matroska
> +847d065f082ac94825728b5f1af853eb *tests/data/fate/acodec-tta.tta
> +330583 tests/data/fate/acodec-tta.tta
>  95e54b261530a1bcf6de6fe3b21dc5f6 *tests/data/fate/acodec-tta.out.wav
>  stddev:0.00 PSNR:999.99 MAXDIFF:0 bytes:  1058400/  1058400
> diff --git a/tests/ref/lavf/mka b/tests/ref/lavf/mka
> new file mode 100644
> index 000..962b254
> --- /dev/null
> +++ b/tests/ref/lavf/mka
> @@ -0,0 +1,3 @@
> +b2e3746787b885d0191a1a26f3faa58f *./tests/data/lavf/lavf.mka
> +43654 ./tests/data/lavf/lavf.mka
> +./tests/data/lavf/lavf.mka CRC=0x3a1da17e
> diff --git a/tests/ref/lavf/tta b/tests/ref/lavf/tta
> new file mode 100644
> index 000..745e8d2
> --- /dev/null
> +++ b/tests/ref/lavf/tta
> @@ -0,0 +1,3 @@
> +f2721d06704ac43d89fdd25835b43598 *./tests/data/lavf/lavf.tta
> +43200 ./tests/data/lavf/lavf.tta
> +./tests/data/lavf/lavf.tta CRC=0x3a1da17e

fate tests
Tested-by: Michael on x86 32 / 64, mingw 32/64, mips , arm
Reviewed-by: Michael

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Freedom in capitalist society always remains about the same as it was in
ancient Greek republics: Freedom for slave owners. -- Vladimir Lenin


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] libavcodec : add psd image file decoder

2016-08-04 Thread Martin Vignali
>
> I think you should fail probe with less than 26 bytes
> or are there smaller files that can be valid ?
>
>
> Fix

>
> this is not based on git master
>

New patch in attach

Martin
From 7af7660813e2abe7174d12fef80f9198ee612192 Mon Sep 17 00:00:00 2001
From: Martin Vignali 
Date: Thu, 4 Aug 2016 16:58:17 +0200
Subject: [PATCH 1/2] libavformat : add Photoshop PSD file.

---
 libavformat/Makefile |  1 +
 libavformat/allformats.c |  1 +
 libavformat/img2dec.c| 34 ++
 3 files changed, 36 insertions(+)

diff --git a/libavformat/Makefile b/libavformat/Makefile
index e2cb474..413d6a1 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -234,6 +234,7 @@ OBJS-$(CONFIG_IMAGE_PGM_PIPE_DEMUXER) += img2dec.o img2.o
 OBJS-$(CONFIG_IMAGE_PICTOR_PIPE_DEMUXER)  += img2dec.o img2.o
 OBJS-$(CONFIG_IMAGE_PNG_PIPE_DEMUXER) += img2dec.o img2.o
 OBJS-$(CONFIG_IMAGE_PPM_PIPE_DEMUXER) += img2dec.o img2.o
+OBJS-$(CONFIG_IMAGE_PSD_PIPE_DEMUXER) += img2dec.o img2.o
 OBJS-$(CONFIG_IMAGE_QDRAW_PIPE_DEMUXER)   += img2dec.o img2.o
 OBJS-$(CONFIG_IMAGE_SGI_PIPE_DEMUXER) += img2dec.o img2.o
 OBJS-$(CONFIG_IMAGE_SUNRAST_PIPE_DEMUXER) += img2dec.o img2.o
diff --git a/libavformat/allformats.c b/libavformat/allformats.c
index 10c9bcc..5289e67 100644
--- a/libavformat/allformats.c
+++ b/libavformat/allformats.c
@@ -365,6 +365,7 @@ void av_register_all(void)
 REGISTER_DEMUXER (IMAGE_PICTOR_PIPE, image_pictor_pipe);
 REGISTER_DEMUXER (IMAGE_PNG_PIPE,image_png_pipe);
 REGISTER_DEMUXER (IMAGE_PPM_PIPE,image_ppm_pipe);
+REGISTER_DEMUXER (IMAGE_PSD_PIPE,image_psd_pipe);
 REGISTER_DEMUXER (IMAGE_QDRAW_PIPE,  image_qdraw_pipe);
 REGISTER_DEMUXER (IMAGE_SGI_PIPE,image_sgi_pipe);
 REGISTER_DEMUXER (IMAGE_SUNRAST_PIPE,image_sunrast_pipe);
diff --git a/libavformat/img2dec.c b/libavformat/img2dec.c
index bac0114..e06ae6f 100644
--- a/libavformat/img2dec.c
+++ b/libavformat/img2dec.c
@@ -821,6 +821,39 @@ static int png_probe(AVProbeData *p)
 return 0;
 }
 
+static int psd_probe(AVProbeData *p)
+{
+const uint8_t *b = p->buf;
+int ret = 0;
+uint16_t color_mode;
+
+if (AV_RL32(b) == MKTAG('8','B','P','S')) {
+ret += 1;
+} else {
+return 0;
+}
+
+if ((b[4] == 0) && (b[5] == 1)) {/* version 1 is PSD, version 2 is PSB */
+ret += 1;
+} else {
+return 0;
+}
+
+if ((AV_RL32(b+6) == 0) && (AV_RL16(b+10) == 0))/* reserved must be 0 */
+ret += 1;
+if (p->buf_size < 26)
+return 0;
+
+color_mode = AV_RB16(b+24);
+if ((color_mode <= 9) && (color_mode != 5) && (color_mode != 6))
+ret += 1;
+
+if (ret)
+return AVPROBE_SCORE_EXTENSION + ret;
+
+return 0;
+}
+
 static int sgi_probe(AVProbeData *p)
 {
 const uint8_t *b = p->buf;
@@ -946,6 +979,7 @@ IMAGEAUTO_DEMUXER(pgmyuv,  AV_CODEC_ID_PGMYUV)
 IMAGEAUTO_DEMUXER(pictor,  AV_CODEC_ID_PICTOR)
 IMAGEAUTO_DEMUXER(png, AV_CODEC_ID_PNG)
 IMAGEAUTO_DEMUXER(ppm, AV_CODEC_ID_PPM)
+IMAGEAUTO_DEMUXER(psd, AV_CODEC_ID_PSD)
 IMAGEAUTO_DEMUXER(qdraw,   AV_CODEC_ID_QDRAW)
 IMAGEAUTO_DEMUXER(sgi, AV_CODEC_ID_SGI)
 IMAGEAUTO_DEMUXER(sunrast, AV_CODEC_ID_SUNRAST)
-- 
1.9.3 (Apple Git-50)

From c19f74e5c6456056635252abad80f83bff51292c Mon Sep 17 00:00:00 2001
From: Martin Vignali 
Date: Thu, 4 Aug 2016 16:58:30 +0200
Subject: [PATCH 2/2] libavcodec : add decoder for Photoshop PSD image file.

Decode the Image Data Section (who contain merge picture).
Support RGB/A and Grayscale/A in 8bits and 16 bits by channel.
Support uncompress and rle compression in Image Data Section.
---
 Changelog  |   1 +
 doc/general.texi   |   2 +
 libavcodec/Makefile|   1 +
 libavcodec/allcodecs.c |   1 +
 libavcodec/avcodec.h   |   1 +
 libavcodec/psd.c   | 402 +
 6 files changed, 408 insertions(+)
 create mode 100644 libavcodec/psd.c

diff --git a/Changelog b/Changelog
index 0f9b4cf..750a14b 100644
--- a/Changelog
+++ b/Changelog
@@ -12,6 +12,7 @@ version :
 - 16-bit support in selectivecolor filter
 - OpenH264 decoder wrapper
 - MediaCodec hwaccel
+- PSD Decoder
 
 
 version 3.1:
diff --git a/doc/general.texi b/doc/general.texi
index 6b5975c..6879666 100644
--- a/doc/general.texi
+++ b/doc/general.texi
@@ -584,6 +584,8 @@ following image formats are supported:
 @item PNG  @tab X @tab X
 @item PPM  @tab X @tab X
 @tab Portable PixelMap image
+@item PSD  @tab   @tab X
+@tab Photoshop
 @item PTX  @tab   @tab X
 @tab V.Flash PTX format
 @item SGI  @tab X @tab X
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index b375720..dd07a7b 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -459,6 +459,7 @@ OBJS-$(CONFIG_PRORES_LGPL_DECODER) += proresdec_lgpl.o proresdsp.o proresdat
 

Re: [FFmpeg-devel] [PATCH] avformat: add a TTA Muxer

2016-08-04 Thread James Almer
On 7/31/2016 1:03 PM, James Almer wrote:
> Signed-off-by: James Almer 
> ---
>  Changelog   |   1 +
>  doc/general.texi|   2 +-
>  libavformat/Makefile|   1 +
>  libavformat/allformats.c|   2 +-
>  libavformat/avio_internal.h |   2 +
>  libavformat/aviobuf.c   |   6 ++
>  libavformat/tta.c   |  10 +--
>  libavformat/ttaenc.c| 147 
> 
>  libavformat/version.h   |   2 +-
>  tests/fate/acodec.mak   |   4 +-
>  tests/fate/avformat.mak |   2 +
>  tests/lavf-regression.sh|   8 +++
>  tests/ref/acodec/tta|   4 +-
>  tests/ref/lavf/mka  |   3 +
>  tests/ref/lavf/tta  |   3 +
>  15 files changed, 182 insertions(+), 15 deletions(-)
>  create mode 100644 libavformat/ttaenc.c
>  create mode 100644 tests/ref/lavf/mka
>  create mode 100644 tests/ref/lavf/tta

Ping.

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


Re: [FFmpeg-devel] [PATCH] avcodec: don't include vdpau_compat.h when vdpau is not enabled

2016-08-04 Thread James Almer
On 8/4/2016 4:23 AM, Carl Eugen Hoyos wrote:
> 2016-08-04 1:35 GMT+02:00 James Almer :
>> On 8/3/2016 7:59 PM, Carl Eugen Hoyos wrote:
>>> Hi!
>>>
>>> 2016-08-04 0:33 GMT+02:00 James Almer :
 This removes unnecessary header dependencies.
>>>
>>> Why is this an advantage?
>>
>> h263, vc1 and mpeg decoder were pointlessly pulling the entire set
>> of h264 headers because of it.
> 
> So the advantage is that compilation gets measurably faster
> with your patch?

No, our headers are not the Boost package. i just want to reduce
dependencies so they don't get recompiled every time you modify
any of those 10+ unrelated headers or their dependencies.

> 
> Preprocessor checks instead of conditions have the disadvantage
> that less syntax checking is done in some cases.
> 
> Thank you, Carl Eugen
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 

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


[FFmpeg-devel] [PATCH v2 10/11] avformat/fifo: Add AVFMT_FLAG_NONBLOCK support

2016-08-04 Thread sebechlebskyjan
From: Jan Sebechlebsky 

Add support for nonblocking calls.

Signed-off-by: Jan Sebechlebsky 
---
 Changes from the last version:
 - boolean flags accessed from both threads are ints now
   and are accessed with atomic operations.
 - pthread_tryjoin_np is replaced by flag set before
   fifo_consumer_thread returns

 libavformat/fifo.c | 61 --
 1 file changed, 55 insertions(+), 6 deletions(-)

diff --git a/libavformat/fifo.c b/libavformat/fifo.c
index bd9d934..9b92eab 100644
--- a/libavformat/fifo.c
+++ b/libavformat/fifo.c
@@ -19,12 +19,14 @@
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include "libavutil/atomic.h"
 #include "libavutil/opt.h"
 #include "libavutil/time.h"
 #include "libavutil/threadmessage.h"
 #include "avformat.h"
 #include "internal.h"
 #include "pthread.h"
+#include "url.h"
 
 #define FIFO_DEFAULT_QUEUE_SIZE  60
 #define FIFO_DEFAULT_MAX_RECOVERY_ATTEMPTS   16
@@ -77,6 +79,17 @@ typedef struct FifoContext {
 /* Value > 0 signalizes queue overflow */
 volatile uint8_t overflow_flag;
 
+/* Whether termination was requested by invoking deinit
+ * before the thread was finished. Used only in non-blocking
+ * mode - when AVFMT_FLAG_NONBLOCK is set. */
+volatile int termination_requested;
+
+/* Initially 0, set to 1 immediately before thread function
+ * returns */
+volatile int thread_finished_flag;
+
+/* Original interrupt callback of the underlying muxer. */
+AVIOInterruptCB orig_interrupt_callback;
 } FifoContext;
 
 typedef struct FifoThreadContext {
@@ -110,6 +123,16 @@ typedef struct FifoMessage {
 AVPacket pkt;
 } FifoMessage;
 
+static int fifo_interrupt_callback_wrapper(void *arg)
+{
+FifoContext *ctx = arg;
+
+if (avpriv_atomic_int_get(>termination_requested))
+return 1;
+
+return ff_check_interrupt(>orig_interrupt_callback);
+}
+
 static int fifo_thread_write_header(FifoThreadContext *ctx)
 {
 AVFormatContext *avf = ctx->avf;
@@ -442,12 +465,17 @@ static void *fifo_consumer_thread(void *data)
 
 fifo->write_trailer_ret = fifo_thread_write_trailer(_thread_ctx);
 
+/* This must be only return path from fifo_consumer_thread function,
+ * so the thread_finised_flag is set. */
+avpriv_atomic_int_set(>thread_finished_flag, 1);
 return NULL;
 }
 
 static int fifo_mux_init(AVFormatContext *avf)
 {
 FifoContext *fifo = avf->priv_data;
+AVIOInterruptCB interrupt_cb = {.callback = 
fifo_interrupt_callback_wrapper,
+.opaque = fifo};
 AVFormatContext *avf2;
 int ret = 0, i;
 
@@ -458,7 +486,8 @@ static int fifo_mux_init(AVFormatContext *avf)
 
 fifo->avf = avf2;
 
-avf2->interrupt_callback = avf->interrupt_callback;
+fifo->orig_interrupt_callback = avf->interrupt_callback;
+avf2->interrupt_callback = interrupt_cb;
 avf2->max_delay = avf->max_delay;
 ret = av_dict_copy(>metadata, avf->metadata, 0);
 if (ret < 0)
@@ -543,7 +572,7 @@ static int fifo_write_packet(AVFormatContext *avf, AVPacket 
*pkt)
 {
 FifoContext *fifo = avf->priv_data;
 FifoMessage msg = {.type = pkt ? FIFO_WRITE_PACKET : FIFO_FLUSH_OUTPUT};
-int ret;
+int ret, queue_flags = 0;
 
 if (pkt) {
 av_init_packet();
@@ -552,15 +581,21 @@ static int fifo_write_packet(AVFormatContext *avf, 
AVPacket *pkt)
 return ret;
 }
 
-ret = av_thread_message_queue_send(fifo->queue, ,
-   fifo->drop_pkts_on_overflow ?
-   AV_THREAD_MESSAGE_NONBLOCK : 0);
+if (fifo->drop_pkts_on_overflow || (avf->flags & AVFMT_FLAG_NONBLOCK))
+queue_flags |= AVFMT_FLAG_NONBLOCK;
+
+ret = av_thread_message_queue_send(fifo->queue, , queue_flags);
+
 if (ret == AVERROR(EAGAIN)) {
-uint8_t overflow_set = 0;
+uint8_t overflow_set;
+
+if (avf->flags & AVFMT_FLAG_NONBLOCK)
+return ret;
 
 /* Queue is full, set fifo->overflow_flag to 1
  * to let consumer thread know the queue should
  * be flushed. */
+overflow_set = 0;
 pthread_mutex_lock(>overflow_flag_lock);
 if (!fifo->overflow_flag)
 fifo->overflow_flag = overflow_set = 1;
@@ -588,6 +623,10 @@ static int fifo_write_trailer(AVFormatContext *avf)
 
 av_thread_message_queue_set_err_recv(fifo->queue, AVERROR_EOF);
 
+if ((avf->flags & AVFMT_FLAG_NONBLOCK) &&
+!avpriv_atomic_int_get(>thread_finished_flag))
+   return AVERROR(EAGAIN);
+
 ret = pthread_join( fifo->writer_thread, NULL);
 if (ret < 0) {
 av_log(avf, AV_LOG_ERROR, "pthread join error: %s\n",
@@ -603,6 +642,16 @@ static void fifo_deinit(AVFormatContext *avf)
 {
 FifoContext *fifo = avf->priv_data;
 
+if (avf->flags & AVFMT_FLAG_NONBLOCK) {
+int ret;
+

[FFmpeg-devel] [PATCH v2 06/11] avformat: add avformat_write_abort() function

2016-08-04 Thread sebechlebskyjan
From: Jan Sebechlebsky 

Signed-off-by: Jan Sebechlebsky 
---
 Changes from last version of patch:
 - removed AVFMT_FLAG_NONBLOCK check and modified comment 
   so it states how function behaves with both blocking / non-blocking muxer

 libavformat/avformat.h | 15 +++
 libavformat/mux.c  | 13 +
 2 files changed, 28 insertions(+)

diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index 578f99f..3f6a6eb 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -2512,6 +2512,8 @@ int av_write_uncoded_frame_query(AVFormatContext *s, int 
stream_index);
  *
  * If AVFMT_FLAG_NONBLOCK is set, this call may return AVERROR(EAGAIN)
  * meaning the operation is pending and the call should be repeated.
+ * If caller decides to abort operation (after too many calls have returned
+ * AVERROR(EAGAIN)), it can be done by calling @ref avformat_write_abort().
  *
  * @param s media file handle
  * @return 0 if OK, AVERROR(EAGAIN) in case call should be repeated,
@@ -2520,6 +2522,19 @@ int av_write_uncoded_frame_query(AVFormatContext *s, int 
stream_index);
 int av_write_trailer(AVFormatContext *s);
 
 /**
+ * Abort muxer operation and free private data.
+ * For muxer operating in blocking mode, this is equivalent to calling
+ * av_write_trailer. For muxer operating in non-blocking mode, this will
+ * call deinitialize routine even if there is operation pending
+ * and @ref av_write_trailer() keeps returning AVERROR(EAGAIN).
+ * May only be called after a successful call to avformat_write_header.
+ *
+ * @param s Media file handle
+ * return >= 0 on success, negative AVERROR on error
+ */
+int avformat_write_abort(AVFormatContext *s);
+
+/**
  * Return the output format in the list of registered output formats
  * which best matches the provided parameters, or return NULL if
  * there is no match.
diff --git a/libavformat/mux.c b/libavformat/mux.c
index bc9c98f..a3c1d8a 100644
--- a/libavformat/mux.c
+++ b/libavformat/mux.c
@@ -1267,6 +1267,19 @@ fail:
 return ret;
 }
 
+int avformat_write_abort(AVFormatContext *s)
+{
+int ret;
+
+ret = av_write_trailer(s);
+if (ret == AVERROR(EAGAIN)) {
+deinit_muxer(s);
+ret = 0;
+}
+
+return ret;
+}
+
 int av_get_output_timestamp(struct AVFormatContext *s, int stream,
 int64_t *dts, int64_t *wall)
 {
-- 
1.9.1

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


Re: [FFmpeg-devel] [PATCH 1/2] decklink: fix: set fps on video stream v2

2016-08-04 Thread Matthias Hunstock
Am 10.07.2016 um 13:02 schrieb Matthias Hunstock:

> Provide the stream with the correct fps information when capturing.
> 
> Signed-off-by: Matthias Hunstock 
> ---
>  libavdevice/decklink_dec.cpp | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/libavdevice/decklink_dec.cpp b/libavdevice/decklink_dec.cpp
> index fcb024e..78b14f5 100644
> --- a/libavdevice/decklink_dec.cpp
> +++ b/libavdevice/decklink_dec.cpp
> @@ -571,6 +571,7 @@ av_cold int ff_decklink_read_header(AVFormatContext 
> *avctx)
>  
>  st->time_base.den  = ctx->bmd_tb_den;
>  st->time_base.num  = ctx->bmd_tb_num;
> +av_stream_set_r_frame_rate(st, av_make_q(st->time_base.den, 
> st->time_base.num));
>  
>  if (cctx->v210) {
>  st->codecpar->codec_id= AV_CODEC_ID_V210;
> 



bump



Matthias


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


Re: [FFmpeg-devel] Log level of message "Increasing reorder buffer to ..."

2016-08-04 Thread Robert Krüger
On Thu, Aug 4, 2016 at 1:55 PM, Carl Eugen Hoyos  wrote:

> 2016-08-04 13:50 GMT+02:00 Robert Krüger :
> > the log level of INFO does not seem appropriate for the message
> (h264dec.c,
> > line 531). If it is a condition that shouldn't really happen, it should
> be
>
> It does happen, see at least two related tickets iirc.
>

Yes, of course, I am observing it all the time (see below). This was rather
a (redundant) explanation what my understanding of the purpose of log level
WARNING usually is. Our logs are full of this

>
> > a warning, otherwise it should be debug (especially for library users
> this
> > floods the logs as this seems to happen for many files.
> >
> > Would a patch, setting this to DEBUG be accepted?
>
> I don't think so: It was intentionally increased to allow users to
> understand
> why libavcodec eat a frame.
>

"Eats a frame" means what exactly? Does the decoder then miss a frame? If
so, I haven't observed this and need to check again as that would be
serious. So far, I thought this warning was harmless.

If the library logging is designed for the command line then I can, of
course, always patch locally. Just thought I'd ask to better understand. Do
you remember the related tickets?
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] FFmpeg 3.1.2

2016-08-04 Thread Mark Thompson
On 04/08/16 11:25, Michael Niedermayer wrote:
> ill soon make FFmpeg 3.1.2
> that is if someone wants something backported, do it now!

We should fix  in
ffmpeg - Debian carrying the patch is not helpful.

Nicolas, would you (or someone else?) like to write something to fix it by
correcting the locales?  If not, I think we should apply Carl's patch.

Thanks,

- Mark

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


Re: [FFmpeg-devel] [Libav-user] [PATCH]Fix a crash in vaapi_encode if "." is not the decimal separator

2016-08-04 Thread Michael Niedermayer
On Tue, Aug 02, 2016 at 08:56:46PM +0100, Mark Thompson wrote:
> On 02/08/16 18:39, Nicolas George wrote:
> > Le sextidi 16 thermidor, an CCXXIV, Carl Eugen Hoyos a écrit :
> >> -{ "i_qfactor",  "1.0" },
> >> -{ "i_qoffset",  "0.0" },
> >> -{ "b_qfactor",  "1.2" },
> >> -{ "b_qoffset",  "0.0" },
> >> +{ "i_qfactor",  "1"   },
> >> +{ "i_qoffset",  "0"   },
> >> +{ "b_qfactor",  "6/5" },
> >> +{ "b_qoffset",  "0"   },
> 
> Urgh :(  I did not consider this problem at all when writing the code.

patch does no harm and fixes this, also its easy backportable with
no risk of regressions, thus iam in favor of this patch but iam
not the maintainer of the files

Fixing this the correct way by replacing strtod or package maintainers
patching user apps locale has a much higher chance of regressions.

No question, that the proper solution is fixing the locale so it
is set to a value we support (or us properly supporting other locales
but i think this lacks volunteers and interrest)

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Old school: Use the lowest level language in which you can solve the problem
conveniently.
New school: Use the highest level language in which the latest supercomputer
can solve the problem without the user falling asleep waiting.


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH v5 01/11] avformat: Add fifo pseudo-muxer

2016-08-04 Thread sebechlebskyjan
From: Jan Sebechlebsky 

Signed-off-by: Jan Sebechlebsky 
---
 Changes from the last version of patch:
  - boolean AVOptions are now ints, this was the cause of fate test
segfault reported by Michael

 Changelog|   1 +
 configure|   1 +
 doc/muxers.texi  |  90 +++
 libavformat/Makefile |   1 +
 libavformat/allformats.c |   1 +
 libavformat/fifo.c   | 674 +++
 libavformat/version.h|   2 +-
 7 files changed, 769 insertions(+), 1 deletion(-)
 create mode 100644 libavformat/fifo.c

diff --git a/Changelog b/Changelog
index 0f9b4cf..3f858f1 100644
--- a/Changelog
+++ b/Changelog
@@ -12,6 +12,7 @@ version :
 - 16-bit support in selectivecolor filter
 - OpenH264 decoder wrapper
 - MediaCodec hwaccel
+- fifo muxer
 
 
 version 3.1:
diff --git a/configure b/configure
index 9f5b31f..4651f5f 100755
--- a/configure
+++ b/configure
@@ -2834,6 +2834,7 @@ dv_muxer_select="dvprofile"
 dxa_demuxer_select="riffdec"
 eac3_demuxer_select="ac3_parser"
 f4v_muxer_select="mov_muxer"
+fifo_muxer_deps="pthreads"
 flac_demuxer_select="flac_parser"
 hds_muxer_select="flv_muxer"
 hls_muxer_select="mpegts_muxer"
diff --git a/doc/muxers.texi b/doc/muxers.texi
index 5873269..e2bc290 100644
--- a/doc/muxers.texi
+++ b/doc/muxers.texi
@@ -1436,6 +1436,96 @@ Specify whether to remove all fragments when finished. 
Default 0 (do not remove)
 
 @end table
 
+@section fifo
+
+The fifo pseudo-muxer allows to separate encoding from any other muxer by using
+first-in-first-out queue and running the actual muxer in a separate thread. 
This
+is especially useful in combination with the @ref{tee} muxer and output to
+several destinations with different reliability/writing speed/latency.
+
+The behavior of fifo muxer in case of failure can be configured:
+@itemize @bullet
+
+@item
+output can be transparently restarted with configurable delay between retries
+based on real time or time of the processed stream.
+
+@item
+encoding can be blocked during temporary failure, or continue transparently
+dropping packets in case fifo queue fills up.
+
+@end itemize
+
+@table @option
+
+@item fifo_format
+Specify the format name. Useful if it cannot be guessed from the
+output name suffix.
+
+@item queue_size
+Specify size of the queue (number of packets). Default value is 60.
+
+@item format_opts
+Specify format options for the underlying muxer. Muxer options can be specified
+as a list of @var{key}=@var{value} pairs separated by ':'.
+
+@item drop_pkts_on_overflow @var{bool}
+If set to 1 (true), in case the fifo queue fills up, packets will be dropped
+rather than blocking the encoder. This allows to continue streaming without
+delaying the output, at the cost of ommiting part of the stream. By default
+this option is set to 0 (false), so in such cases the encoder will be blocked
+until the muxer processes some of the packets and none of them is lost.
+
+@item attempt_recovery @var{bool}
+If failure occurs, attempt to recover the output. This is especially useful
+when used with network output, allows to restart streaming transparently.
+By default this option set to 0 (false).
+
+@item max_recovery_attempts
+Sets maximum number of successive unsucessful recovery attempts after which
+the output fails permanently. Unlimited if set to zero. Default value is 16.
+
+@item recovery_wait_time @var{duration}
+Waiting time before the next recovery attempt after previous unsuccessfull
+recovery attempt. Default value is 5 seconds.
+
+s@item recovery_wait_streamtime @var{bool}
+If set to 0 (false), the real time is used when waiting for the recovery
+attempt (i.e. the recovery will be attempted after at least
+recovery_wait_time seconds).
+If set to 1 (true), the time of the processed stream is taken into account
+instead (i.e. the recovery will be attempted after at least recovery_wait_time
+seconds of the stream is omitted).
+By default, this option is set to 0 (false).
+
+@item recover_any_error @var{bool}
+If set to 1 (true), recovery will be attempted regardless of type of the error
+causing the failure. By default this option is set to 0 (false) and in case of
+certain errors the recovery is not attempted even when @ref{attempt_recovery}
+is set to 1.
+
+@item restart_with_keyframe @var{bool}
+Specify whether to wait for the keyframe after recovering from
+queue overflow or failure. This option is set to 0 (false) by default.
+
+@end table
+
+@subsection Examples
+
+@itemize
+
+@item
+Stream something to rtmp server, continue processing the stream at real-time
+rate even in case of temporary failure (network outage) and attempt to recover
+streaming every second indefinitely.
+@example
+ffmpeg -re -i ... -c:v libx264 -c:a mp2 -f fifo -fifo_format flv -map 0:v -map 
0:a
+  -block_on_overflow 0 -attempt_recovery 1 -recovery_wait_time 1
+  -max_recovery_attempts 0 rtmp://example.com/live/stream_name
+@end 

Re: [FFmpeg-devel] Log level of message "Increasing reorder buffer to ..."

2016-08-04 Thread Carl Eugen Hoyos
2016-08-04 13:50 GMT+02:00 Robert Krüger :
> the log level of INFO does not seem appropriate for the message (h264dec.c,
> line 531). If it is a condition that shouldn't really happen, it should be

It does happen, see at least two related tickets iirc.

> a warning, otherwise it should be debug (especially for library users this
> floods the logs as this seems to happen for many files.
>
> Would a patch, setting this to DEBUG be accepted?

I don't think so: It was intentionally increased to allow users to understand
why libavcodec eat a frame.

Carl Eugen
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] Log level of message "Increasing reorder buffer to ..."

2016-08-04 Thread Robert Krüger
Hi,

the log level of INFO does not seem appropriate for the message (h264dec.c,
line 531). If it is a condition that shouldn't really happen, it should be
a warning, otherwise it should be debug (especially for library users this
floods the logs as this seems to happen for many files.

Would a patch, setting this to DEBUG be accepted?

Thanks,

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


Re: [FFmpeg-devel] [PATCH 03/11] avformat/fifo: Add fate test

2016-08-04 Thread Jan Sebechlebsky



On 08/02/2016 10:08 PM, Michael Niedermayer wrote:

On Tue, Aug 02, 2016 at 03:24:14PM +0200, sebechlebsky...@gmail.com wrote:
segfaults  on x86-32


Thanks for testing,
I wrongly used uint8_t for boolean AVOptions instead of int.
I'll send fixed patch soon.

Regards,
Jan
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH v3 1/2] avcodec/bsf: Set EOF flag only in pkt == NULL

2016-08-04 Thread Jan Sebechlebsky

On 07/26/2016 12:40 PM, sebechlebsky...@gmail.com wrote:


From: Jan Sebechlebsky 

Set BSF EOF flag only if pkt == NULL in av_bsf_send_packet().

Signed-off-by: Jan Sebechlebsky 
---
  libavcodec/bsf.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/bsf.c b/libavcodec/bsf.c
index 88b7f29..9b9ada7 100644
--- a/libavcodec/bsf.c
+++ b/libavcodec/bsf.c
@@ -172,7 +172,7 @@ int av_bsf_init(AVBSFContext *ctx)
  
  int av_bsf_send_packet(AVBSFContext *ctx, AVPacket *pkt)

  {
-if (!pkt || !pkt->data) {
+if (!pkt) {
  ctx->internal->eof = 1;
  return 0;
  }

Ping for this and the next patch :)


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


Re: [FFmpeg-devel] [PATCH 06/11] avformat: add av_abort_output() function

2016-08-04 Thread Jan Sebechlebsky



On 08/03/2016 03:15 PM, Nicolas George wrote:

Le sextidi 16 thermidor, an CCXXIV, sebechlebsky...@gmail.com a écrit :

From: Jan Sebechlebsky 

Signed-off-by: Jan Sebechlebsky 
---
  libavformat/avformat.h | 14 ++
  libavformat/mux.c  | 16 
  2 files changed, 30 insertions(+)

diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index 9191c69..9173908 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -2510,6 +2510,8 @@ int av_write_uncoded_frame_query(AVFormatContext *s, int 
stream_index);
   *
   * If AVFMT_FLAG_NONBLOCK is set, this call may return AVERROR(EAGAIN)
   * meaning the operation is pending and the call should be repeated.
+ * If caller decides to abort operation (after too many calls have returned
+ * AVERROR(EAGAIN)), it can be done by calling @ref av_abort_output().
   *
   * @param s media file handle
   * @return 0 if OK, AVERROR(EAGAIN) in case call should be repeated,
@@ -2518,6 +2520,18 @@ int av_write_uncoded_frame_query(AVFormatContext *s, int 
stream_index);
  int av_write_trailer(AVFormatContext *s);
  
  /**

+ * Abort non-blocking muxer operation and free private data.
+ *
+ * May only be called after a successful call to avformat_write_header,
+ * and used only with muxer operating in non-blocking mode 
(AVFMT_FLAG_NONBLOCK)
+ * must be set.
+ *
+ * @param s media file handle
+ * return >= 0 on success, negative AVERROR on error
+ */
+int av_abort_output(AVFormatContext *s);

The other functions are called av_write_something() or
avformat_write_something(): maybe avformat_write_abort()?

I'll change to avformat_write_abort.

Also, it could call avformat_free_context() and set s to NULL, unless there
is some use in reusing the context?
I thought of this function as about an alternative to av_write_trailer - 
so you can replace one call for another and get the same behaviour (from 
the "outside" point of view). But it's not big deal, if you wish I can 
change this.

+
+/**
   * Return the output format in the list of registered output formats
   * which best matches the provided parameters, or return NULL if
   * there is no match.
diff --git a/libavformat/mux.c b/libavformat/mux.c
index bc9c98f..888a9f1 100644
--- a/libavformat/mux.c
+++ b/libavformat/mux.c
@@ -1267,6 +1267,22 @@ fail:
  return ret;
  }
  
+int av_abort_output(AVFormatContext *s)

+{
+int ret;
+
+if (!(s->flags & AVFMT_FLAG_NONBLOCK))
+return AVERROR(EINVAL);

Since the application should be able to know whether the muxer is in
blocking mode, it could be an assert.

But is it really necessary? Applications in blocking mode may want to exit
immediately too.
I think there is no reason for blocking muxer to call this, it shouldn't 
avoid calling av_write_trailer to free resources. But I can leave here 
the av_write_trailer call below and remove the check above, in that case 
this would became just av_write_trailer wrapper for blocking muxer.


Anyway, any of these changes would allow to make the function void.


+
+ret = av_write_trailer(s);
+if (ret == AVERROR(EAGAIN)) {

Is it useful? The application could try and write the trailer itself,
possibly allowing a little more time to finish. And only call
av_abort_output() when it really wants to stop now.
I thought it might be good idea to call write_trailer before actually 
calling deinit. User can still do as many av_write_trailer attempts as 
he wants before, but if he does none (for example decides to abort 
output not because of write_trailer timeout, but because of some other 
error or signal caught before all packets are send to muxer) this will 
at first attempt to finish in a graceful way.
If you're ok with that I would keep that here and I'll remove the 
AVFMT_FLAG_NONBLOCK flag check since then it's safe to call this instead 
of av_write_trailer regardless of whether muxer is operating in 
blocking/nonblocking mode.

+deinit_muxer(s);

There is a subtle pitfall here: if the muxer does not have a deinit function
and av_write_trailer() returned EAGAIN (or was not called like I suggest),
then the resources leak.

Fortunately, we currently do not have any muxer that both supports
non-blocking mode and has a potentially blocking write_trailer(). We can
decide that any future muxer that would must have a deinit() function. In
that case, we can get away with the following steps:

   1. If the muxer has a deinit() method, just call deinit_muxer().

   2. Else, sabotage the context's AVIO stream so that it returns an error
  for all operations and call av_write_trailer().

The "sabotage" part of 2 is not very robust, but I think it is fine enough
for our use case. In fact, I would not object if that detail was left as a
TODO comment.
Maybe a good solution would be to document that nonblocking muxer must 
have deinit function and assert that during initialization in 
avformat_write_header?
I think sabotaging 

[FFmpeg-devel] FFmpeg 3.1.2

2016-08-04 Thread Michael Niedermayer
Hi all

ill soon make FFmpeg 3.1.2
that is if someone wants something backported, do it now!

thx

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The bravest are surely those who have the clearest vision
of what is before them, glory and danger alike, and yet
notwithstanding go out to meet it. -- Thucydides


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avcodec/alsdec: implement floating point decoding

2016-08-04 Thread Thilo Borgmann
> [...]
> I had sent the old patch file by mistake. This is the correct one.

LGTM.

Pushing in a few days if there are no further comments.

-Thilo

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


Re: [FFmpeg-devel] [PATCH] avcodec/vdpau: clean up vdpau_internal.h

2016-08-04 Thread Timothy Gu
On Thu, Aug 4, 2016 at 12:57 AM Carl Eugen Hoyos  wrote:

> 2016-08-03 6:30 GMT+02:00 James Almer :
> > Also don't include it on files that don't need it.
> >
> > This reduces differences with libav
> >
> > Signed-off-by: James Almer 
> > ---
> > Untested with VDPAU enabled.
>
> The patch is probably ok if it does not brake compilation with
> VDPAU enabled or disabled.
>

Tested with VDPAU enabled. Compilation works.

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


Re: [FFmpeg-devel] [PATCH] avcodec/vdpau: clean up vdpau_internal.h

2016-08-04 Thread Carl Eugen Hoyos
2016-08-03 6:30 GMT+02:00 James Almer :
> Also don't include it on files that don't need it.
>
> This reduces differences with libav
>
> Signed-off-by: James Almer 
> ---
> Untested with VDPAU enabled.

The patch is probably ok if it does not brake compilation with
VDPAU enabled or disabled.

Carl Eugen
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] why prebuilt windows ffmpeg use rtmpdump instead of its native rtmp plugin

2016-08-04 Thread Carl Eugen Hoyos
2016-08-04 8:53 GMT+02:00 qw :
> But why does official prebuilt windows ffmpeg use rtmpdump instead of its 
> native rtmp plugin?

I don't think there are "official" windows binaries but feel free to ask Zeranoe
why he does things the way he does them, there is a forum.

Carl Eugen
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avcodec: don't include vdpau_compat.h when vdpau is not enabled

2016-08-04 Thread Carl Eugen Hoyos
2016-08-04 1:35 GMT+02:00 James Almer :
> On 8/3/2016 7:59 PM, Carl Eugen Hoyos wrote:
>> Hi!
>>
>> 2016-08-04 0:33 GMT+02:00 James Almer :
>>> This removes unnecessary header dependencies.
>>
>> Why is this an advantage?
>
> h263, vc1 and mpeg decoder were pointlessly pulling the entire set
> of h264 headers because of it.

So the advantage is that compilation gets measurably faster
with your patch?

Preprocessor checks instead of conditions have the disadvantage
that less syntax checking is done in some cases.

Thank you, Carl Eugen
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] why prebuilt windows ffmpeg use rtmpdump instead of its native rtmp plugin

2016-08-04 Thread qw
Hi,

Previously, I sent email to ask which rtmp plugin is better. The answer is 
ffmpeg's native rtmp plugin is better than rtmpdump.

But why does official prebuilt windows ffmpeg use rtmpdump instead of its 
native rtmp plugin?

Thanks!

Regards

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