[FFmpeg-devel] [PATCH 1/2] lavu: add a gamma field to AVMasteringDisplayMetadata

2017-09-19 Thread Rostislav Pehlivanov
PNG exposes it and its required in order to correctly display some images,
particularly images crafted to contain 2 different images which appear
differently depending on whether the gamma has been taken into account.

Signed-off-by: Rostislav Pehlivanov 
---
 libavutil/mastering_display_metadata.h | 10 ++
 libavutil/version.h|  2 +-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/libavutil/mastering_display_metadata.h 
b/libavutil/mastering_display_metadata.h
index 847b0b62c6..3de58bf468 100644
--- a/libavutil/mastering_display_metadata.h
+++ b/libavutil/mastering_display_metadata.h
@@ -66,6 +66,16 @@ typedef struct AVMasteringDisplayMetadata {
  */
 int has_luminance;
 
+/**
+ * The power-law response exponent needed to compensate for nonlinearity.
+ */
+AVRational gamma;
+
+/**
+ * Flag indicating whether the gamma has been set.
+ */
+int has_gamma;
+
 } AVMasteringDisplayMetadata;
 
 /**
diff --git a/libavutil/version.h b/libavutil/version.h
index d99eff5d15..8ac41f49f5 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -80,7 +80,7 @@
 
 
 #define LIBAVUTIL_VERSION_MAJOR  55
-#define LIBAVUTIL_VERSION_MINOR  75
+#define LIBAVUTIL_VERSION_MINOR  76
 #define LIBAVUTIL_VERSION_MICRO 100
 
 #define LIBAVUTIL_VERSION_INT   AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
-- 
2.14.1.821.g8fa685d3b7

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


[FFmpeg-devel] [PATCH 2/2] pngdec: expose gAMA and cHRM chunks as AVMasteringDisplayMetadata

2017-09-19 Thread Rostislav Pehlivanov
Signed-off-by: Rostislav Pehlivanov 
---
 libavcodec/pngdec.c | 46 ++
 1 file changed, 46 insertions(+)

diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c
index 0d6612ccca..b7d9ded89c 100644
--- a/libavcodec/pngdec.c
+++ b/libavcodec/pngdec.c
@@ -25,6 +25,7 @@
 #include "libavutil/bprint.h"
 #include "libavutil/imgutils.h"
 #include "libavutil/stereo3d.h"
+#include "libavutil/mastering_display_metadata.h"
 
 #include "avcodec.h"
 #include "bytestream.h"
@@ -1163,10 +1164,15 @@ static int decode_frame_common(AVCodecContext *avctx, 
PNGDecContext *s,
AVFrame *p, AVPacket *avpkt)
 {
 AVDictionary **metadatap = NULL;
+AVMasteringDisplayMetadata mdm;
 uint32_t tag, length;
 int decode_next_dat = 0;
 int ret;
 
+mdm.has_primaries = 0;
+mdm.has_luminance = 0;
+mdm.has_gamma = 0;
+
 for (;;) {
 length = bytestream2_get_bytes_left(>gb);
 if (length <= 0) {
@@ -1287,6 +1293,41 @@ static int decode_frame_common(AVCodecContext *avctx, 
PNGDecContext *s,
 goto fail;
 break;
 }
+case MKTAG('c', 'H', 'R', 'M'): {
+mdm.white_point[0].num = bytestream2_get_be32(>gb);
+mdm.white_point[0].den = 10;
+mdm.white_point[1].num = bytestream2_get_be32(>gb);
+mdm.white_point[1].den = 10;
+
+/* Red primaries */
+mdm.display_primaries[0][0].num = bytestream2_get_be32(>gb);
+mdm.display_primaries[0][0].den = 10;
+mdm.display_primaries[0][1].num = bytestream2_get_be32(>gb);
+mdm.display_primaries[0][1].den = 10;
+
+/* Green primaries */
+mdm.display_primaries[1][0].num = bytestream2_get_be32(>gb);
+mdm.display_primaries[1][0].den = 10;
+mdm.display_primaries[1][1].num = bytestream2_get_be32(>gb);
+mdm.display_primaries[1][1].den = 10;
+
+/* Blue primaries */
+mdm.display_primaries[2][0].num = bytestream2_get_be32(>gb);
+mdm.display_primaries[2][0].den = 10;
+mdm.display_primaries[2][1].num = bytestream2_get_be32(>gb);
+mdm.display_primaries[2][1].den = 10;
+
+mdm.has_primaries = 1;
+bytestream2_skip(>gb, 4); /* crc */
+break;
+}
+case MKTAG('g', 'A', 'M', 'A'): {
+mdm.gamma.num = bytestream2_get_be32(>gb);
+mdm.gamma.den = 10;
+mdm.has_gamma = 1;
+bytestream2_skip(>gb, 4); /* crc */
+break;
+}
 case MKTAG('I', 'E', 'N', 'D'):
 if (!(s->pic_state & PNG_ALLIMAGE))
 av_log(avctx, AV_LOG_ERROR, "IEND without all image\n");
@@ -1305,6 +1346,11 @@ skip_tag:
 }
 exit_loop:
 
+if (mdm.has_gamma || mdm.has_primaries) {
+AVMasteringDisplayMetadata *new_mdm = 
av_mastering_display_metadata_create_side_data(p);
+memcpy(new_mdm, , sizeof(AVMasteringDisplayMetadata));
+}
+
 if (avctx->codec_id == AV_CODEC_ID_PNG &&
 avctx->skip_frame == AVDISCARD_ALL) {
 return 0;
-- 
2.14.1.821.g8fa685d3b7

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


[FFmpeg-devel] [PATCH] avformat/hls: support cache protocol in hls

2017-09-19 Thread Steven Liu
support play hls from cache

Signed-off-by: Steven Liu 
---
 libavformat/hls.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/hls.c b/libavformat/hls.c
index 0995345bbf..889ae6c201 100644
--- a/libavformat/hls.c
+++ b/libavformat/hls.c
@@ -628,7 +628,7 @@ static int open_url(AVFormatContext *s, AVIOContext **pb, 
const char *url,
 url);
 return AVERROR_INVALIDDATA;
 }
-} else if (av_strstart(proto_name, "http", NULL)) {
+} else if (av_strstart(proto_name, "http", NULL) || 
av_strstart(proto_name, "cache", NULL)) {
 ;
 } else
 return AVERROR_INVALIDDATA;
-- 
2.11.0 (Apple Git-81)



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


Re: [FFmpeg-devel] [PATCH] avcodec/mips: preload data in hevc sao edge 0 degree filter msa functions

2017-09-19 Thread Michael Niedermayer
On Mon, Sep 18, 2017 at 12:17:02PM +, Manojkumar Bhosale wrote:
> LGTM

applied

thanks

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

In fact, the RIAA has been known to suggest that students drop out
of college or go to community college in order to be able to afford
settlements. -- The RIAA


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/mips: Fixed rnd_val variable to 6 in hevc uni mc msa functions

2017-09-19 Thread Michael Niedermayer
On Mon, Sep 18, 2017 at 12:16:49PM +, Manojkumar Bhosale wrote:
> LGTM

applied

thanks

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

You can kill me, but you cannot change the truth.


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


Re: [FFmpeg-devel] [PATCH] MAINTAINERS: add myself for bwdif and (t)interlace

2017-09-19 Thread Michael Niedermayer
On Sat, Sep 16, 2017 at 02:06:34AM +0200, Thomas Mundt wrote:
> Requested by Michael

>  MAINTAINERS |2 ++
>  1 file changed, 2 insertions(+)
> cf096312527ce1d41cf67358bf9bc07d37cc1239  
> 0001-MAINTAINERS-add-myself-for-bwdif-and-t-interlace.patch
> From 60ba18636c2fa7297b6efbec8ecbb1ee2a90d5db Mon Sep 17 00:00:00 2001
> From: Thomas Mundt 
> Date: Sat, 16 Sep 2017 01:57:27 +0200
> Subject: [PATCH] MAINTAINERS: add myself for bwdif and (t)interlace

applied

thanks

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

It is dangerous to be right in matters on which the established authorities
are wrong. -- 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]lavf/mpegts: Consider 0x0f just a hint towards aac

2017-09-19 Thread Carl Eugen Hoyos
2017-09-14 23:48 GMT+02:00 Michael Niedermayer :
> On Wed, Sep 13, 2017 at 07:12:17PM +0200, Carl Eugen Hoyos wrote:
>> Hi!
>>
>> Attached patch fixes ticket #6657.
>>
>> Please comment, Carl Eugen
>
>>  mpegts.c |2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>> 370a433251f563e16b654eeca8bb3463e787fd61  
>> 0001-lavf-mpegts-Consider-stream_type-0x0f-just-a-hint-to.patch
>> From d806a243e97de8c245958dc6f8d2646217cc5105 Mon Sep 17 00:00:00 2001
>> From: Carl Eugen Hoyos 
>> Date: Wed, 13 Sep 2017 19:05:10 +0200
>> Subject: [PATCH] lavf/mpegts: Consider stream_type 0x0f just a hint toward
>>  AAC.
>>
>> It is also used in the wild to signal latm.
>>
>> Fixes ticket #6657.
>> ---
>>  libavformat/mpegts.c |2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> should be ok unless this causes common streams to be slowed down
> in a non trivial way in terms of data/time needed for detection

I cannot reproduce this, pushed.

> also please add a fate test, if the file is not too large

Will do.
File loewe.ts uploaded to my home directory on ffbox.

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


Re: [FFmpeg-devel] [PATCH 5/5] lavd: Add KMS frame grabber

2017-09-19 Thread Mark Thompson
On 19/09/17 22:21, Andy Furniss wrote:
> Mark Thompson wrote:
>> On 15/09/17 00:15, Andy Furniss wrote:
>>> Andy Furniss wrote:
 Mark Thompson wrote:
> ---
> Now sets the trusted packet flag; otherwise unchanged.
>
>
>    configure    |   1 +
>    libavdevice/Makefile |   1 +
>    libavdevice/alldevices.c |   1 +
>    libavdevice/kmsgrab.c    | 455 
> +++
>    4 files changed, 458 insertions(+)
>    create mode 100644 libavdevice/kmsgrab.c
>
> diff --git a/configure b/configure
> index 6581c53c1a..76a7591ceb 100755
> --- a/configure
> +++ b/configure
> @@ -3040,6 +3040,7 @@ gdigrab_indev_select="bmp_decoder"
>    iec61883_indev_deps="libiec61883"
>    jack_indev_deps="jack"
>    jack_indev_deps_any="sem_timedwait dispatch_dispatch_h"
> +kmsgrab_indev_deps="libdrm"

 Doesn't get built for me = doesn't show up as indev after configure 
 anything special needed?
>>>
>>> Never mind I found --enable-libdrm (had tried --enable-kmsgrab)
>>
>> I assume you're going to try AMD + Mesa + VAAPI.
>>
>> VAAPI_DISABLE_INTERLACE=1 ./ffmpeg_g -y -format bgr0 -device /dev/dri/card1 
>> -f kmsgrab -i - -vsync 0 -init_hw_device vaapi=v:/dev/dri/renderD129 
>> -filter_hw_device v -vf 'hwmap,scale_vaapi=w=1920:h=1080:format=nv12' -c:v 
>> h264_vaapi -profile 578 -bf 0 out.mp4
>>
>> Three Mesa issues I had to get around:
>>
>> * Device derivation doesn't work because the Mesa driver doesn't want to 
>> initialise on the DRM master device for some reason; making the matching 
>> device separately does work.
>> * Against current git, you need to reapply the VAAPI_DISABLE_INTERLACE patch 
>> and use it - if not, the colour conversion just barfs because it wants 
>> interlaced surfaces.
>> * The postproc scaler seems to only write the luma plane when converting 
>> from RGB - this is also visible when uploading normal RGB images, so just a 
>> bug somewhere.
>>
>> With that, it works to record the screen in greyscale...
>>
>> I have some other Mesa stuff to do queued up (libva2 with VAAPI export for 
>> EGL import on AMD), so I'll pursue these further soonish.
> 
> Leo just posted a patchset on the mesa list that makes vaapi work better with 
> this and postproc generally.
> 
> You don't need the env with those and kmsgrab is now working for me - up to a 
> point ...

Yep, that works for me now too - with colour!  (The export to GL for playback 
is still messed up by interlacing without patching it out, but that looked 
orthogonal anyway.)

> That point being around 7k frames it will run out of something.
> 
> [AVHWFramesContext @ 0x31ed880] Failed to create surface from DRM object: 2 
> (resource allocation failed).
> [Parsed_hwmap_0 @ 0x3114c40] Failed to map frame: -5.
> 
> I see that memory is reducing before this although I still have spare - is 
> this the same issue you explained on users WRT leaking on decode?

Yeah, I also run out of ... something ... at around 7200 frames.  It's not fds 
or memory.  I don't think it's the buffer problem (which, incidentally, should 
finally be fixable sensibly in libva2 soon), because that ended up manifesting 
as leaking memory.  It's also not a problem for Intel (I've already been 
running that for a long time to test).  Maybe some other sort of handle on the 
Mesa side?  I'll investigate further tomorrow.

Thanks,

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


Re: [FFmpeg-devel] [PATCH]lavf/rtsp: Allow to set SDP timeout.

2017-09-19 Thread Carl Eugen Hoyos
2017-09-20 2:01 GMT+02:00 Marton Balint :
>
>
> On Wed, 20 Sep 2017, Carl Eugen Hoyos wrote:
>
>> Hi!
>>
>> Attached patch fixes part of ticket #2415.
>>
>> Please comment, Carl Eugen
>>
>
> diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
> index 0bd72dc..c8fa26a 100644
> --- a/libavformat/rtsp.c
> +++ b/libavformat/rtsp.c
> @@ -104,6 +104,7 @@ static const AVOption sdp_options[] = {
>  RTSP_FLAG_OPTS("sdp_flags", "SDP flags"),
>  { "custom_io", "use custom I/O", 0, AV_OPT_TYPE_CONST, {.i64 =
> RTSP_FLAG_CUSTOM_IO}, 0, 0, DEC, "rtsp_flags" },
>  { "rtcp_to_source", "send RTCP packets to the source address of
> received packets", 0, AV_OPT_TYPE_CONST, {.i64 = RTSP_FLAG_RTCP_TO_SOURCE},
> 0, 0, DEC, "rtsp_flags" },
> +{ "timeout", "set timeout (in tenths of a seconds)",
> OFFSET(initial_timeout), AV_OPT_TYPE_INT, {.i64 = MAX_TIMEOUTS}, 0, 100,
> DEC },
>
> I'd prefer AV_OPT_TYPE_DURATION for every new duration-like option

New patch attached.

Thank you, Carl Eugen
From 94f133e86c318282564d5cc3cfac3ae8e451d7d4 Mon Sep 17 00:00:00 2001
From: Carl Eugen Hoyos 
Date: Wed, 20 Sep 2017 02:11:42 +0200
Subject: [PATCH] lavf/rtsp: Allow to set sdp timeout.

Fixes part of ticket #2415.
---
 libavformat/rtsp.c|3 ++-
 libavformat/rtsp.h|4 ++--
 libavformat/rtspdec.c |2 +-
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index 0bd72dc..b659031 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -104,6 +104,7 @@ static const AVOption sdp_options[] = {
 RTSP_FLAG_OPTS("sdp_flags", "SDP flags"),
 { "custom_io", "use custom I/O", 0, AV_OPT_TYPE_CONST, {.i64 = RTSP_FLAG_CUSTOM_IO}, 0, 0, DEC, "rtsp_flags" },
 { "rtcp_to_source", "send RTCP packets to the source address of received packets", 0, AV_OPT_TYPE_CONST, {.i64 = RTSP_FLAG_RTCP_TO_SOURCE}, 0, 0, DEC, "rtsp_flags" },
+{ "timeout", "set timeout", OFFSET(initial_timeout), AV_OPT_TYPE_DURATION, {.i64 = MAX_TIMEOUTS * 10}, 0, INT64_MAX, DEC },
 RTSP_MEDIATYPE_OPTS("allowed_media_types", "set media types to accept from the server"),
 COMMON_OPTS(),
 { NULL },
@@ -2003,7 +2004,7 @@ static int udp_read_packet(AVFormatContext *s, RTSPStream **prtsp_st,
 }
 }
 #endif
-} else if (n == 0 && ++timeout_cnt >= MAX_TIMEOUTS) {
+} else if (n == 0 && ++timeout_cnt >= rt->initial_timeout / 10) {
 return AVERROR(ETIMEDOUT);
 } else if (n < 0 && errno != EINTR)
 return AVERROR(errno);
diff --git a/libavformat/rtsp.h b/libavformat/rtsp.h
index 852fd67..458ec5c 100644
--- a/libavformat/rtsp.h
+++ b/libavformat/rtsp.h
@@ -387,9 +387,9 @@ typedef struct RTSPState {
 int rtp_port_min, rtp_port_max;
 
 /**
- * Timeout to wait for incoming connections.
+ * Timeout to wait for connections.
  */
-int initial_timeout;
+int64_t initial_timeout;
 
 /**
  * timeout of socket i/o operations.
diff --git a/libavformat/rtspdec.c b/libavformat/rtspdec.c
index fdf75a0..7d3b859 100644
--- a/libavformat/rtspdec.c
+++ b/libavformat/rtspdec.c
@@ -660,7 +660,7 @@ static int rtsp_listen(AVFormatContext *s)
 
 /* Create TCP connection */
 ff_url_join(tcpname, sizeof(tcpname), lower_proto, NULL, host, port,
-"?listen_timeout=%d", rt->initial_timeout * 1000);
+"?listen_timeout=%d", (int)rt->initial_timeout * 1000);
 
 if (ret = ffurl_open_whitelist(>rtsp_hd, tcpname, AVIO_FLAG_READ_WRITE,
>interrupt_callback, NULL,
-- 
1.7.10.4

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


Re: [FFmpeg-devel] [PATCH]lavf/rtsp: Allow to set SDP timeout.

2017-09-19 Thread Marton Balint



On Wed, 20 Sep 2017, Carl Eugen Hoyos wrote:


Hi!

Attached patch fixes part of ticket #2415.

Please comment, Carl Eugen



diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index 0bd72dc..c8fa26a 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -104,6 +104,7 @@ static const AVOption sdp_options[] = {
 RTSP_FLAG_OPTS("sdp_flags", "SDP flags"),
 { "custom_io", "use custom I/O", 0, AV_OPT_TYPE_CONST, {.i64 = RTSP_FLAG_CUSTOM_IO}, 
0, 0, DEC, "rtsp_flags" },
 { "rtcp_to_source", "send RTCP packets to the source address of received packets", 
0, AV_OPT_TYPE_CONST, {.i64 = RTSP_FLAG_RTCP_TO_SOURCE}, 0, 0, DEC, "rtsp_flags" },
+{ "timeout", "set timeout (in tenths of a seconds)", 
OFFSET(initial_timeout), AV_OPT_TYPE_INT, {.i64 = MAX_TIMEOUTS}, 0, 100, DEC },

I'd prefer AV_OPT_TYPE_DURATION for every new duration-like option, it is 
already messy where you need to specify milisecs, microsecs, or seconds... 
Yeah, I know it requires some additional changes in the code, but not too 
much I assume.


Regards,
Marton


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


Re: [FFmpeg-devel] [PATCH 3/4] avdevice/decklink_dec: Added Closed caption decode from VANC

2017-09-19 Thread Carl Eugen Hoyos
2017-09-15 11:29 GMT+02:00 Jeyapal, Karthick :
> And I forgot to mention a thing. Some parts of that code in this patch
> was started from VLC’s source code. Source link here
> https://fossies.org/linux/vlc/modules/access/sdi.c

Then please add the relevant copyright line to the file you changed.
(Probably "Rafaël Carré" but please verify yourself)

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


[FFmpeg-devel] [PATCH] configure: quote compiler paths

2017-09-19 Thread Jacob Trimble
Signed-off-by: Jacob Trimble 
---
 configure | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/configure b/configure
index 2de20a02a4..16aa09be05 100755
--- a/configure
+++ b/configure
@@ -920,14 +920,14 @@ check_cc(){
 log check_cc "$@"
 cat > $TMPC
 log_file $TMPC
-check_cmd $cc $CPPFLAGS $CFLAGS "$@" $CC_C $(cc_o $TMPO) $TMPC
+check_cmd "$cc" $CPPFLAGS $CFLAGS "$@" $CC_C $(cc_o $TMPO) $TMPC
 }
 
 check_cxx(){
 log check_cxx "$@"
 cat > $TMPCPP
 log_file $TMPCPP
-check_cmd $cxx $CPPFLAGS $CFLAGS $CXXFLAGS "$@" $CXX_C -o $TMPO $TMPCPP
+check_cmd "$cxx" $CPPFLAGS $CFLAGS $CXXFLAGS "$@" $CXX_C -o $TMPO $TMPCPP
 }
 
 check_objcc(){
@@ -981,7 +981,7 @@ check_inline_asm_flags(){
 void foo(void){ __asm__ volatile($code); }
 EOF
 log_file $TMPC
-check_cmd $cc $CPPFLAGS $CFLAGS $flags "$@" $CC_C $(cc_o $TMPO) $TMPC &&
+check_cmd "$cc" $CPPFLAGS $CFLAGS $flags "$@" $CC_C $(cc_o $TMPO) $TMPC &&
 enable $name && add_cflags $flags && add_asflags $flags && add_ldflags 
$flags
 }
 
@@ -1012,7 +1012,7 @@ check_ld(){
 check_$type $($cflags_filter $flags) || return
 flags=$($ldflags_filter $flags)
 libs=$($ldflags_filter $libs)
-check_cmd $ld $LDFLAGS $LDEXEFLAGS $flags $(ld_o $TMPE) $TMPO $libs 
$extralibs
+check_cmd "$ld" $LDFLAGS $LDEXEFLAGS $flags $(ld_o $TMPE) $TMPO $libs 
$extralibs
 }
 
 print_include(){
@@ -4382,7 +4382,7 @@ if test "$cpu" = host; then
 case "$cc_type" in
 gcc|llvm_gcc)
 check_native(){
-$cc $1=native -v -c -o $TMPO $TMPC >$TMPE 2>&1 || return
+"$cc" $1=native -v -c -o $TMPO $TMPC >$TMPE 2>&1 || return
 sed -n "/cc1.*$1=/{
 s/.*$1=\\([^ ]*\\).*/\\1/
 p
@@ -4393,7 +4393,7 @@ if test "$cpu" = host; then
 ;;
 clang)
 check_native(){
-$cc $1=native -v -c -o $TMPO $TMPC >$TMPE 2>&1 || return
+"$cc" $1=native -v -c -o $TMPO $TMPC >$TMPE 2>&1 || return
 sed -n "/cc1.*-target-cpu /{
 s/.*-target-cpu \\([^ ]*\\).*/\\1/
 p
@@ -5476,7 +5476,7 @@ elif enabled mips; then
 elif enabled parisc; then
 
 if enabled gcc; then
-case $($cc -dumpversion) in
+case $("$cc" -dumpversion) in
 4.[3-9].*) check_cflags -fno-optimize-sibling-calls ;;
 esac
 fi
@@ -6407,7 +6407,7 @@ if enabled icc; then
 # The test above does not test linking
 enabled lto && disable symver_asm_label
 if enabled x86_32; then
-icc_version=$($cc -dumpversion)
+icc_version=$("$cc" -dumpversion)
 test ${icc_version%%.*} -ge 11 &&
 check_cflags -falign-stack=maintain-16-byte ||
 disable aligned_stack
-- 
2.14.1.690.gbb1197296e-goog

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


[FFmpeg-devel] [PATCH]lavf/rtsp: Allow to set SDP timeout.

2017-09-19 Thread Carl Eugen Hoyos
Hi!

Attached patch fixes part of ticket #2415.

Please comment, Carl Eugen
From 6da40f03df782a5b230026c7732095700e55f73a Mon Sep 17 00:00:00 2001
From: Carl Eugen Hoyos 
Date: Wed, 20 Sep 2017 01:38:46 +0200
Subject: [PATCH] lavf/rtsp: Allow to set sdp timeout.

Fixes part of ticket #2415.
---
 libavformat/rtsp.c |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index 0bd72dc..c8fa26a 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -104,6 +104,7 @@ static const AVOption sdp_options[] = {
 RTSP_FLAG_OPTS("sdp_flags", "SDP flags"),
 { "custom_io", "use custom I/O", 0, AV_OPT_TYPE_CONST, {.i64 = RTSP_FLAG_CUSTOM_IO}, 0, 0, DEC, "rtsp_flags" },
 { "rtcp_to_source", "send RTCP packets to the source address of received packets", 0, AV_OPT_TYPE_CONST, {.i64 = RTSP_FLAG_RTCP_TO_SOURCE}, 0, 0, DEC, "rtsp_flags" },
+{ "timeout", "set timeout (in tenths of a seconds)", OFFSET(initial_timeout), AV_OPT_TYPE_INT, {.i64 = MAX_TIMEOUTS}, 0, 100, DEC },
 RTSP_MEDIATYPE_OPTS("allowed_media_types", "set media types to accept from the server"),
 COMMON_OPTS(),
 { NULL },
@@ -2003,7 +2004,7 @@ static int udp_read_packet(AVFormatContext *s, RTSPStream **prtsp_st,
 }
 }
 #endif
-} else if (n == 0 && ++timeout_cnt >= MAX_TIMEOUTS) {
+} else if (n == 0 && ++timeout_cnt >= rt->initial_timeout) {
 return AVERROR(ETIMEDOUT);
 } else if (n < 0 && errno != EINTR)
 return AVERROR(errno);
-- 
1.7.10.4

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


Re: [FFmpeg-devel] [PATCH v3] fate: add tests for psnr and ssim filter

2017-09-19 Thread Michael Niedermayer
On Tue, Sep 19, 2017 at 09:48:45AM +0200, Tobias Rapp wrote:
> Metadata filter output is passed through an Awk script comparing floats
> against reference values with specified "fuzz" tolerance to account for
> architectural differences (e.g. x86-32 vs. x86-64).
> 
> Signed-off-by: Tobias Rapp 
> ---
> tested on Linux x86-32/64 and Mips (Qemu)
> 
> v3:
>  - avoid precision loss due to rounding of float values
> 
> v2:
>  - removed CPUFLAGS work-around for ssim filter issue
>  - added metadata float value post-processing script
> 
>  tests/fate-run.sh |  9 ++
>  tests/fate/filter-video.mak   | 14 
>  tests/ref/fate/filter-refcmp-psnr-rgb | 45 ++
>  tests/ref/fate/filter-refcmp-psnr-yuv | 45 ++
>  tests/ref/fate/filter-refcmp-ssim-rgb | 30 +
>  tests/ref/fate/filter-refcmp-ssim-yuv | 30 +
>  tests/refcmp-metadata.awk | 61 
> +++
>  7 files changed, 234 insertions(+)
>  create mode 100644 tests/ref/fate/filter-refcmp-psnr-rgb
>  create mode 100644 tests/ref/fate/filter-refcmp-psnr-yuv
>  create mode 100644 tests/ref/fate/filter-refcmp-ssim-rgb
>  create mode 100644 tests/ref/fate/filter-refcmp-ssim-yuv
>  create mode 100644 tests/refcmp-metadata.awk

This seems not to work (normal x86-64 linux) but maybe ive done something silly

--- ./tests/ref/fate/filter-refcmp-psnr-rgb 2017-09-20 00:58:04.063337500 
+0200
+++ tests/data/fate/filter-refcmp-psnr-rgb  2017-09-20 00:59:26.399339234 
+0200
@@ -1,12 +1,3 @@
-frame:0pts:0   pts_time:0
-lavfi.psnr.mse.r=1381.80
-lavfi.psnr.psnr.r=16.73
-lavfi.psnr.mse.g=896.00
-lavfi.psnr.psnr.g=18.61
-lavfi.psnr.mse.b=277.38
-lavfi.psnr.psnr.b=23.70
-lavfi.psnr.mse_avg=851.73
-lavfi.psnr.psnr_avg=18.83
 frame:1pts:1   pts_time:1
 lavfi.psnr.mse.r=1380.37
 lavfi.psnr.psnr.r=16.73
@@ -14,22 +5,12 @@
 lavfi.psnr.psnr.g=18.24
 lavfi.psnr.mse.b=435.72
 lavfi.psnr.psnr.b=21.74
-lavfi.psnr.mse_avg=930.67
-lavfi.psnr.psnr_avg=18.44
-frame:2pts:2   pts_time:2
-lavfi.psnr.mse.r=1403.20
-lavfi.psnr.psnr.r=16.66
-lavfi.psnr.mse.g=954.05
-lavfi.psnr.psnr.g=18.34
-lavfi.psnr.mse.b=494.22
-lavfi.psnr.psnr.b=21.19
-lavfi.psnr.mse_avg=950.49
-lavfi.psnr.psnr_avg=18.35
-frame:3pts:3   pts_time:3
-lavfi.psnr.mse.r=1452.80
 lavfi.psnr.psnr.r=16.51
+lavfi.psnr.mse_avg=930.67
 lavfi.psnr.mse.g=1001.02
+lavfi.psnr.psnr_avg=18.44
 lavfi.psnr.psnr.g=18.13
+frame:2pts:2   pts_time:2
 lavfi.psnr.mse.b=557.39
 lavfi.psnr.psnr.b=20.67
 lavfi.psnr.mse_avg=1003.74
@@ -37,9 +18,28 @@
 frame:4pts:4   pts_time:4
 lavfi.psnr.mse.r=1401.25
 lavfi.psnr.psnr.r=16.67
+frame:0pts:0   pts_time:0
+lavfi.psnr.mse.r=1381.80
+lavfi.psnr.psnr.r=16.73
+lavfi.psnr.mse.g=896.00
+lavfi.psnr.psnr.g=18.61
+lavfi.psnr.mse.b=277.38
+lavfi.psnr.psnr.b=23.70
+lavfi.psnr.mse_avg=851.73
+lavfi.psnr.psnr_avg=18.83
+lavfi.psnr.mse.r=1403.20
+lavfi.psnr.psnr.r=16.66
+lavfi.psnr.mse.g=954.05
+lavfi.psnr.psnr.g=18.34
+lavfi.psnr.mse.b=494.22
+lavfi.psnr.psnr.b=21.19
+lavfi.psnr.mse_avg=950.49
 lavfi.psnr.mse.g=1009.80
+lavfi.psnr.psnr_avg=18.35
 lavfi.psnr.psnr.g=18.09
+frame:3pts:3   pts_time:3
 lavfi.psnr.mse.b=602.42
+lavfi.psnr.mse.r=1452.80
 lavfi.psnr.psnr.b=20.33
 lavfi.psnr.mse_avg=1004.49
 lavfi.psnr.psnr_avg=18.11
Test filter-refcmp-psnr-rgb failed. Look at 
tests/data/fate/filter-refcmp-psnr-rgb.err for details.
make: *** [fate-filter-refcmp-psnr-rgb] Error 1
TESTfitsdec-bitpix-32
--- ./tests/ref/fate/filter-refcmp-ssim-rgb 2017-09-20 00:58:04.063337500 
+0200
+++ tests/data/fate/filter-refcmp-ssim-rgb  2017-09-20 00:59:26.415339235 
+0200
@@ -1,30 +1,30 @@
-frame:0pts:0   pts_time:0
-lavfi.ssim.R=0.72
-lavfi.ssim.G=0.76
+lavfi.ssim.R=0.71
+lavfi.ssim.All=0.76
 lavfi.ssim.B=0.89
+lavfi.ssim.G=0.74
+lavfi.ssim.dB=6.29
 lavfi.ssim.All=0.79
+lavfi.ssim.B=0.80
+frame:3pts:3   pts_time:3
 lavfi.ssim.dB=6.74
+lavfi.ssim.All=0.75
 frame:1pts:1   pts_time:1
 lavfi.ssim.R=0.70
 lavfi.ssim.G=0.74
 lavfi.ssim.B=0.85
-lavfi.ssim.All=0.77
-lavfi.ssim.dB=6.31
-frame:2pts:2   pts_time:2
-lavfi.ssim.R=0.71
-lavfi.ssim.G=0.75
-lavfi.ssim.B=0.84
-lavfi.ssim.All=0.76
-lavfi.ssim.dB=6.29
-frame:3pts:3   pts_time:3
 lavfi.ssim.R=0.70
+lavfi.ssim.All=0.77
+lavfi.ssim.dB=6.05
 lavfi.ssim.G=0.73
+lavfi.ssim.dB=6.31
 lavfi.ssim.B=0.83
+frame:2pts:2   pts_time:2
 lavfi.ssim.All=0.76
+lavfi.ssim.R=0.71
+frame:0pts:0   pts_time:0
 lavfi.ssim.dB=6.11
+lavfi.ssim.G=0.75
+lavfi.ssim.R=0.72
 frame:4pts:4   pts_time:4
-lavfi.ssim.R=0.71
-lavfi.ssim.G=0.74
-lavfi.ssim.B=0.80
-lavfi.ssim.All=0.75
-lavfi.ssim.dB=6.05
+lavfi.ssim.B=0.84
+lavfi.ssim.G=0.76
Test filter-refcmp-ssim-rgb failed. Look at 
tests/data/fate/filter-refcmp-ssim-rgb.err for details.
make: *** [fate-filter-refcmp-ssim-rgb] Error 1
TESTfitsdec-bitpix-64
--- 

Re: [FFmpeg-devel] [PATCH]lavfi/stereo3d: Set SAR for every output frame

2017-09-19 Thread Carl Eugen Hoyos
2017-09-19 0:03 GMT+02:00 Paul B Mahol :
> On 9/18/17, Carl Eugen Hoyos  wrote:
>> Hi!
>>
>> Attached patch fixes ticket #6672.
>>
>> Please comment, Carl Eugen
>
> ok

Patch applied.

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


Re: [FFmpeg-devel] [PATCH 2/2] fate: add mxf_dv25/dvcpro50 regression tests

2017-09-19 Thread Carl Eugen Hoyos
2017-09-20 0:56 GMT+02:00 Mark Thompson :

> Ignore this: I was caught out by the shared libraries using an
> installed copy of the same version without the relevant fix for
> testing.

Indicating the commit was missing a micro bump.

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


Re: [FFmpeg-devel] [PATCH]lavf/utils: Do not force the chapter end time before chapter start

2017-09-19 Thread Carl Eugen Hoyos
2017-09-17 23:38 GMT+02:00 Carl Eugen Hoyos :
> Hi!
>
> Attached patch fixes ticket #6671.

Patch applied.

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


Re: [FFmpeg-devel] [FFmpeg-cvslog] kmsgrab: Add more DRM plane formats

2017-09-19 Thread Carl Eugen Hoyos
2017-09-20 0:42 GMT+02:00 Mark Thompson :
> On 19/09/17 23:23, Carl Eugen Hoyos wrote:
>> 2017-09-20 0:16 GMT+02:00 Carl Eugen Hoyos :
>>> ffmpeg | branch: master | Carl Eugen Hoyos  | Fri Sep 
>>> 15 21:24:48 2017 +0100| [f952edaa73ee8618fcc8c105b57b9032ca0d1cec] | 
>>> committer: Mark Thompson
>>
>>> +{ AV_PIX_FMT_RGB8, DRM_FORMAT_RGB332   },
>>
>> Were you able to test this?
>> The definition looks different...
>
> No, I don't have anything with this format, so I was just looking at the
> docs for those.  From your set, I was able to test RGB/BGR 565 LE only.
>
> pixfmt.h:
>   AV_PIX_FMT_BGR8,  ///< packed RGB 3:3:2,  8bpp, (msb)2B 3G 3R(lsb)
>   AV_PIX_FMT_RGB8,  ///< packed RGB 3:3:2,  8bpp, (msb)2R 3G 3B(lsb)

This is consistent with libswscale.

> drm_fourcc.h:
> #define DRM_FORMAT_BGR233   fourcc_code('B', 'G', 'R', '8') /*
> [7:0] B:G:R 2:3:3 */
> #define DRM_FORMAT_RGB332   fourcc_code('R', 'G', 'B', '8') /*
> [7:0] R:G:B 3:3:2 */
>
> Argh.  So I missed that the bits have the same pattern in ffmpeg for
> the two formats vs. the same component-allocation in libdrm.
>
> Do you want to remove that one?  Consider it pre-approved (keeps
> me away from it to avoid messing up any further on this...).

I reverted this (hoping that the drm documentation is correct).

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


Re: [FFmpeg-devel] [PATCH 2/2] fate: add mxf_dv25/dvcpro50 regression tests

2017-09-19 Thread Mark Thompson
On 19/09/17 23:24, Mark Thompson wrote:
> On 19/09/17 23:13, Mark Thompson wrote:
>> On 18/09/17 08:34, Tobias Rapp wrote:
>>> On 15.09.2017 22:43, Michael Niedermayer wrote:
 On Thu, Sep 14, 2017 at 03:44:42PM +0200, Tobias Rapp wrote:
> Signed-off-by: Tobias Rapp 
> ---
>   tests/fate/avformat.mak  |  2 ++
>   tests/fate/seek.mak  |  4 +++
>   tests/lavf-regression.sh |  8 ++
>   tests/ref/lavf/mxf_dv25  |  3 +++
>   tests/ref/lavf/mxf_dvcpro50  |  3 +++
>   tests/ref/seek/lavf-mxf_dv25 | 53 
> 
>   tests/ref/seek/lavf-mxf_dvcpro50 | 53 
> 
>   7 files changed, 126 insertions(+)
>   create mode 100644 tests/ref/lavf/mxf_dv25
>   create mode 100644 tests/ref/lavf/mxf_dvcpro50
>   create mode 100644 tests/ref/seek/lavf-mxf_dv25
>   create mode 100644 tests/ref/seek/lavf-mxf_dvcpro50

 probably ok
>>>
>>> Applied, thanks for the review.
>>>
>>> Tobias
>>
>> Could this contain some system-dependence or nondeterminism?
>>
>> (Debian stable, Skylake x86-64, nothing funny going on that I'm aware of...)
>>
>>
>> $ make V=1 fate-lavf-mxf_dvcpro50
>> TESTlavf-mxf_dvcpro50
>> /home/mrt/video/ffmpeg/push/tests/fate-run.sh fate-lavf-mxf_dvcpro50 
>> "/home/mrt/video/ffmpeg/fate/" "" "/home/mrt/video/ffmpeg/push/build" 
>> 'lavftest' '' '' '' '1' '' '' '' '' '' '' '' '' ''
>> /home/mrt/video/ffmpeg/push/build/ffmpeg -nostdin -nostats -y -cpuflags all 
>> -flags +bitexact -idct simple -sws_flags +accurate_rnd+bitexact -fflags 
>> +bitexact -threads 1 -f image2 -vcodec pgmyuv -i 
>> /home/mrt/video/ffmpeg/push/build/tests/vsynth1/%02d.pgm -flags +bitexact 
>> -idct simple -sws_flags +accurate_rnd+bitexact -fflags +bitexact -threads 1 
>> -ar 44100 -f s16le -ar 48000 -ac 2 -i 
>> /home/mrt/video/ffmpeg/push/build/./tests/data/asynth1.sw -flags +bitexact 
>> -idct simple -sws_flags +accurate_rnd+bitexact -fflags +bitexact -threads 1 
>> -dct fastint -metadata title=lavftest -b:a 64k -t 1 -qscale:v 10 -r 25 -vf 
>> scale=720:576,setdar=16/9 -vcodec dvvideo -pix_fmt yuv422p -b 5k -top 0 
>> -f mxf /home/mrt/video/ffmpeg/push/build/./tests/data/lavf/lavf.mxf_dvcpro50
>> /home/mrt/video/ffmpeg/push/build/ffmpeg -nostdin -nostats -y -cpuflags all 
>> -flags +bitexact -idct simple -sws_flags +accurate_rnd+bitexact -fflags 
>> +bitexact -threads 1 -i 
>> /home/mrt/video/ffmpeg/push/build/./tests/data/lavf/lavf.mxf_dvcpro50 -f crc 
>> /home/mrt/video/ffmpeg/push/build/./tests/data/mxf_dvcpro50.lavf.crc
>> --- /home/mrt/video/ffmpeg/push/tests/ref/lavf/mxf_dvcpro50 2017-09-19 
>> 22:46:36.169691617 +0100
>> +++ tests/data/fate/lavf-mxf_dvcpro50   2017-09-19 23:07:20.558751142 +0100
>> @@ -1,3 +1,3 @@
>> -6c9cb62911ac16c3b55f0ad0b052c05b *./tests/data/lavf/lavf.mxf_dvcpro50
>> +fe3f278b4deed2b89eba6f31cb092f98 *./tests/data/lavf/lavf.mxf_dvcpro50
>>  7430189 ./tests/data/lavf/lavf.mxf_dvcpro50
>>  ./tests/data/lavf/lavf.mxf_dvcpro50 CRC=0xe3bbe4b4
>> Test lavf-mxf_dvcpro50 failed. Look at tests/data/fate/lavf-mxf_dvcpro50.err 
>> for details.
>> ffmpeg version N-87333-gf952edaa73 Copyright (c) 2000-2017 the FFmpeg 
>> developers
>>   built with gcc 6.3.0 (Debian 6.3.0-18) 20170516
>>   configuration: --samples=/home/mrt/video/ffmpeg/fate/ --enable-vaapi 
>> --enable-libdrm --enable-gpl --enable-libx264 --enable-shared
>>   libavutil  55. 75.100 / 55. 75.100
>>   libavcodec 57.106.101 / 57.106.101
>>   libavformat57. 82.100 / 57. 82.100
>>   libavdevice57.  8.101 / 57.  8.101
>>   libavfilter 6.105.100 /  6.105.100
>>   libswscale  4.  7.103 /  4.  7.103
>>   libswresample   2.  8.100 /  2.  8.100
>>   libpostproc54.  6.100 / 54.  6.100
>> Input #0, image2, from 
>> '/home/mrt/video/ffmpeg/push/build/tests/vsynth1/%02d.pgm':
>>   Duration: 00:00:02.00, start: 0.00, bitrate: N/A
>> Stream #0:0: Video: pgmyuv, yuv420p, 352x288, 25 fps, 25 tbr, 25 tbn, 25 
>> tbc
>> [s16le @ 0x5627ce70f2e0] Estimating duration from bitrate, this may be 
>> inaccurate
>> Guessed Channel Layout for Input Stream #1.0 : stereo
>> Input #1, s16le, from 
>> '/home/mrt/video/ffmpeg/push/build/./tests/data/asynth1.sw':
>>   Duration: 00:00:05.51, bitrate: 1536 kb/s
>> Stream #1:0: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
>> Codec AVOption idct (select IDCT implementation) specified for input file #1 
>> (/home/mrt/video/ffmpeg/push/build/./tests/data/asynth1.sw) has not been 
>> used for any stream. The most likely reason is either wrong type (e.g. a 
>> video option with no video streams) or that it is a private option of some 
>> decoder which was not actually used for any stream.
>> Please use -b:a or -b:v, -b is ambiguous
>> Stream mapping:
>>   Stream #0:0 -> #0:0 (pgmyuv (native) -> dvvideo (native))
>>   Stream #1:0 -> #0:1 (pcm_s16le (native) -> pcm_s16le (native))

Re: [FFmpeg-devel] [FFmpeg-cvslog] kmsgrab: Add more DRM plane formats

2017-09-19 Thread Mark Thompson
On 19/09/17 23:23, Carl Eugen Hoyos wrote:
> 2017-09-20 0:16 GMT+02:00 Carl Eugen Hoyos :
>> ffmpeg | branch: master | Carl Eugen Hoyos  | Fri Sep 15 
>> 21:24:48 2017 +0100| [f952edaa73ee8618fcc8c105b57b9032ca0d1cec] | committer: 
>> Mark Thompson
> 
>> +{ AV_PIX_FMT_RGB8, DRM_FORMAT_RGB332   },
> 
> Were you able to test this?
> The definition looks different...

No, I don't have anything with this format, so I was just looking at the docs 
for those.  From your set, I was able to test RGB/BGR 565 LE only.

pixfmt.h:
AV_PIX_FMT_BGR8,  ///< packed RGB 3:3:2,  8bpp, (msb)2B 3G 3R(lsb)
AV_PIX_FMT_RGB8,  ///< packed RGB 3:3:2,  8bpp, (msb)2R 3G 3B(lsb)

drm_fourcc.h:
#define DRM_FORMAT_BGR233   fourcc_code('B', 'G', 'R', '8') /* [7:0] B:G:R 
2:3:3 */
#define DRM_FORMAT_RGB332   fourcc_code('R', 'G', 'B', '8') /* [7:0] R:G:B 
3:3:2 */

Argh.  So I missed that the bits have the same pattern in ffmpeg for the two 
formats vs. the same component-allocation in libdrm.

Do you want to remove that one?  Consider it pre-approved (keeps me away from 
it to avoid messing up any further on this...).

Thanks,

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


Re: [FFmpeg-devel] [PATCH] avutil/hwcontext_dxva2: return an error when buffer allocation fails

2017-09-19 Thread James Almer
On 9/19/2017 7:26 PM, Mark Thompson wrote:
> On 17/09/17 04:20, James Almer wrote:
>> This also prevents the use of an uninitialized variable.
>>
>> Signed-off-by: James Almer 
>> ---
>>  libavutil/hwcontext_dxva2.c | 4 +++-
>>  1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/libavutil/hwcontext_dxva2.c b/libavutil/hwcontext_dxva2.c
>> index 6c41788e2e..2ddd4be7b1 100644
>> --- a/libavutil/hwcontext_dxva2.c
>> +++ b/libavutil/hwcontext_dxva2.c
>> @@ -307,8 +307,10 @@ static int dxva2_map_frame(AVHWFramesContext *ctx, 
>> AVFrame *dst, const AVFrame *
>>  }
>>  
>>  map = av_mallocz(sizeof(*map));
>> -if (!map)
>> +if (!map) {
>> +err = AVERROR(ENOMEM);
>>  goto fail;
>> +}
>>  
>>  err = ff_hwframe_map_create(src->hw_frames_ctx, dst, src,
>>  dxva2_unmap_frame, map);
>>
> 
> LGTM.
> 
> Thanks,
> 
> - Mark

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


Re: [FFmpeg-devel] [PATCH] avutil/hwcontext_dxva2: return an error when buffer allocation fails

2017-09-19 Thread Mark Thompson
On 17/09/17 04:20, James Almer wrote:
> This also prevents the use of an uninitialized variable.
> 
> Signed-off-by: James Almer 
> ---
>  libavutil/hwcontext_dxva2.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/libavutil/hwcontext_dxva2.c b/libavutil/hwcontext_dxva2.c
> index 6c41788e2e..2ddd4be7b1 100644
> --- a/libavutil/hwcontext_dxva2.c
> +++ b/libavutil/hwcontext_dxva2.c
> @@ -307,8 +307,10 @@ static int dxva2_map_frame(AVHWFramesContext *ctx, 
> AVFrame *dst, const AVFrame *
>  }
>  
>  map = av_mallocz(sizeof(*map));
> -if (!map)
> +if (!map) {
> +err = AVERROR(ENOMEM);
>  goto fail;
> +}
>  
>  err = ff_hwframe_map_create(src->hw_frames_ctx, dst, src,
>  dxva2_unmap_frame, map);
> 

LGTM.

Thanks,

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


Re: [FFmpeg-devel] [PATCH 2/2] fate: add mxf_dv25/dvcpro50 regression tests

2017-09-19 Thread Mark Thompson
On 19/09/17 23:13, Mark Thompson wrote:
> On 18/09/17 08:34, Tobias Rapp wrote:
>> On 15.09.2017 22:43, Michael Niedermayer wrote:
>>> On Thu, Sep 14, 2017 at 03:44:42PM +0200, Tobias Rapp wrote:
 Signed-off-by: Tobias Rapp 
 ---
   tests/fate/avformat.mak  |  2 ++
   tests/fate/seek.mak  |  4 +++
   tests/lavf-regression.sh |  8 ++
   tests/ref/lavf/mxf_dv25  |  3 +++
   tests/ref/lavf/mxf_dvcpro50  |  3 +++
   tests/ref/seek/lavf-mxf_dv25 | 53 
 
   tests/ref/seek/lavf-mxf_dvcpro50 | 53 
 
   7 files changed, 126 insertions(+)
   create mode 100644 tests/ref/lavf/mxf_dv25
   create mode 100644 tests/ref/lavf/mxf_dvcpro50
   create mode 100644 tests/ref/seek/lavf-mxf_dv25
   create mode 100644 tests/ref/seek/lavf-mxf_dvcpro50
>>>
>>> probably ok
>>
>> Applied, thanks for the review.
>>
>> Tobias
> 
> Could this contain some system-dependence or nondeterminism?
> 
> (Debian stable, Skylake x86-64, nothing funny going on that I'm aware of...)
> 
> 
> $ make V=1 fate-lavf-mxf_dvcpro50
> TESTlavf-mxf_dvcpro50
> /home/mrt/video/ffmpeg/push/tests/fate-run.sh fate-lavf-mxf_dvcpro50 
> "/home/mrt/video/ffmpeg/fate/" "" "/home/mrt/video/ffmpeg/push/build" 
> 'lavftest' '' '' '' '1' '' '' '' '' '' '' '' '' ''
> /home/mrt/video/ffmpeg/push/build/ffmpeg -nostdin -nostats -y -cpuflags all 
> -flags +bitexact -idct simple -sws_flags +accurate_rnd+bitexact -fflags 
> +bitexact -threads 1 -f image2 -vcodec pgmyuv -i 
> /home/mrt/video/ffmpeg/push/build/tests/vsynth1/%02d.pgm -flags +bitexact 
> -idct simple -sws_flags +accurate_rnd+bitexact -fflags +bitexact -threads 1 
> -ar 44100 -f s16le -ar 48000 -ac 2 -i 
> /home/mrt/video/ffmpeg/push/build/./tests/data/asynth1.sw -flags +bitexact 
> -idct simple -sws_flags +accurate_rnd+bitexact -fflags +bitexact -threads 1 
> -dct fastint -metadata title=lavftest -b:a 64k -t 1 -qscale:v 10 -r 25 -vf 
> scale=720:576,setdar=16/9 -vcodec dvvideo -pix_fmt yuv422p -b 5k -top 0 
> -f mxf /home/mrt/video/ffmpeg/push/build/./tests/data/lavf/lavf.mxf_dvcpro50
> /home/mrt/video/ffmpeg/push/build/ffmpeg -nostdin -nostats -y -cpuflags all 
> -flags +bitexact -idct simple -sws_flags +accurate_rnd+bitexact -fflags 
> +bitexact -threads 1 -i 
> /home/mrt/video/ffmpeg/push/build/./tests/data/lavf/lavf.mxf_dvcpro50 -f crc 
> /home/mrt/video/ffmpeg/push/build/./tests/data/mxf_dvcpro50.lavf.crc
> --- /home/mrt/video/ffmpeg/push/tests/ref/lavf/mxf_dvcpro50 2017-09-19 
> 22:46:36.169691617 +0100
> +++ tests/data/fate/lavf-mxf_dvcpro50   2017-09-19 23:07:20.558751142 +0100
> @@ -1,3 +1,3 @@
> -6c9cb62911ac16c3b55f0ad0b052c05b *./tests/data/lavf/lavf.mxf_dvcpro50
> +fe3f278b4deed2b89eba6f31cb092f98 *./tests/data/lavf/lavf.mxf_dvcpro50
>  7430189 ./tests/data/lavf/lavf.mxf_dvcpro50
>  ./tests/data/lavf/lavf.mxf_dvcpro50 CRC=0xe3bbe4b4
> Test lavf-mxf_dvcpro50 failed. Look at tests/data/fate/lavf-mxf_dvcpro50.err 
> for details.
> ffmpeg version N-87333-gf952edaa73 Copyright (c) 2000-2017 the FFmpeg 
> developers
>   built with gcc 6.3.0 (Debian 6.3.0-18) 20170516
>   configuration: --samples=/home/mrt/video/ffmpeg/fate/ --enable-vaapi 
> --enable-libdrm --enable-gpl --enable-libx264 --enable-shared
>   libavutil  55. 75.100 / 55. 75.100
>   libavcodec 57.106.101 / 57.106.101
>   libavformat57. 82.100 / 57. 82.100
>   libavdevice57.  8.101 / 57.  8.101
>   libavfilter 6.105.100 /  6.105.100
>   libswscale  4.  7.103 /  4.  7.103
>   libswresample   2.  8.100 /  2.  8.100
>   libpostproc54.  6.100 / 54.  6.100
> Input #0, image2, from 
> '/home/mrt/video/ffmpeg/push/build/tests/vsynth1/%02d.pgm':
>   Duration: 00:00:02.00, start: 0.00, bitrate: N/A
> Stream #0:0: Video: pgmyuv, yuv420p, 352x288, 25 fps, 25 tbr, 25 tbn, 25 
> tbc
> [s16le @ 0x5627ce70f2e0] Estimating duration from bitrate, this may be 
> inaccurate
> Guessed Channel Layout for Input Stream #1.0 : stereo
> Input #1, s16le, from 
> '/home/mrt/video/ffmpeg/push/build/./tests/data/asynth1.sw':
>   Duration: 00:00:05.51, bitrate: 1536 kb/s
> Stream #1:0: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
> Codec AVOption idct (select IDCT implementation) specified for input file #1 
> (/home/mrt/video/ffmpeg/push/build/./tests/data/asynth1.sw) has not been used 
> for any stream. The most likely reason is either wrong type (e.g. a video 
> option with no video streams) or that it is a private option of some decoder 
> which was not actually used for any stream.
> Please use -b:a or -b:v, -b is ambiguous
> Stream mapping:
>   Stream #0:0 -> #0:0 (pgmyuv (native) -> dvvideo (native))
>   Stream #1:0 -> #0:1 (pcm_s16le (native) -> pcm_s16le (native))
> [image2 @ 0x5627ce6f6fa0] Thread message queue blocking; consider raising the 
> thread_queue_size option (current value: 8)
> Output 

Re: [FFmpeg-devel] [PATCH 2/2] fate: add mxf_dv25/dvcpro50 regression tests

2017-09-19 Thread Mark Thompson
On 18/09/17 08:34, Tobias Rapp wrote:
> On 15.09.2017 22:43, Michael Niedermayer wrote:
>> On Thu, Sep 14, 2017 at 03:44:42PM +0200, Tobias Rapp wrote:
>>> Signed-off-by: Tobias Rapp 
>>> ---
>>>   tests/fate/avformat.mak  |  2 ++
>>>   tests/fate/seek.mak  |  4 +++
>>>   tests/lavf-regression.sh |  8 ++
>>>   tests/ref/lavf/mxf_dv25  |  3 +++
>>>   tests/ref/lavf/mxf_dvcpro50  |  3 +++
>>>   tests/ref/seek/lavf-mxf_dv25 | 53 
>>> 
>>>   tests/ref/seek/lavf-mxf_dvcpro50 | 53 
>>> 
>>>   7 files changed, 126 insertions(+)
>>>   create mode 100644 tests/ref/lavf/mxf_dv25
>>>   create mode 100644 tests/ref/lavf/mxf_dvcpro50
>>>   create mode 100644 tests/ref/seek/lavf-mxf_dv25
>>>   create mode 100644 tests/ref/seek/lavf-mxf_dvcpro50
>>
>> probably ok
> 
> Applied, thanks for the review.
> 
> Tobias

Could this contain some system-dependence or nondeterminism?

(Debian stable, Skylake x86-64, nothing funny going on that I'm aware of...)


$ make V=1 fate-lavf-mxf_dvcpro50
TESTlavf-mxf_dvcpro50
/home/mrt/video/ffmpeg/push/tests/fate-run.sh fate-lavf-mxf_dvcpro50 
"/home/mrt/video/ffmpeg/fate/" "" "/home/mrt/video/ffmpeg/push/build" 
'lavftest' '' '' '' '1' '' '' '' '' '' '' '' '' ''
/home/mrt/video/ffmpeg/push/build/ffmpeg -nostdin -nostats -y -cpuflags all 
-flags +bitexact -idct simple -sws_flags +accurate_rnd+bitexact -fflags 
+bitexact -threads 1 -f image2 -vcodec pgmyuv -i 
/home/mrt/video/ffmpeg/push/build/tests/vsynth1/%02d.pgm -flags +bitexact -idct 
simple -sws_flags +accurate_rnd+bitexact -fflags +bitexact -threads 1 -ar 44100 
-f s16le -ar 48000 -ac 2 -i 
/home/mrt/video/ffmpeg/push/build/./tests/data/asynth1.sw -flags +bitexact 
-idct simple -sws_flags +accurate_rnd+bitexact -fflags +bitexact -threads 1 
-dct fastint -metadata title=lavftest -b:a 64k -t 1 -qscale:v 10 -r 25 -vf 
scale=720:576,setdar=16/9 -vcodec dvvideo -pix_fmt yuv422p -b 5k -top 0 -f 
mxf /home/mrt/video/ffmpeg/push/build/./tests/data/lavf/lavf.mxf_dvcpro50
/home/mrt/video/ffmpeg/push/build/ffmpeg -nostdin -nostats -y -cpuflags all 
-flags +bitexact -idct simple -sws_flags +accurate_rnd+bitexact -fflags 
+bitexact -threads 1 -i 
/home/mrt/video/ffmpeg/push/build/./tests/data/lavf/lavf.mxf_dvcpro50 -f crc 
/home/mrt/video/ffmpeg/push/build/./tests/data/mxf_dvcpro50.lavf.crc
--- /home/mrt/video/ffmpeg/push/tests/ref/lavf/mxf_dvcpro50 2017-09-19 
22:46:36.169691617 +0100
+++ tests/data/fate/lavf-mxf_dvcpro50   2017-09-19 23:07:20.558751142 +0100
@@ -1,3 +1,3 @@
-6c9cb62911ac16c3b55f0ad0b052c05b *./tests/data/lavf/lavf.mxf_dvcpro50
+fe3f278b4deed2b89eba6f31cb092f98 *./tests/data/lavf/lavf.mxf_dvcpro50
 7430189 ./tests/data/lavf/lavf.mxf_dvcpro50
 ./tests/data/lavf/lavf.mxf_dvcpro50 CRC=0xe3bbe4b4
Test lavf-mxf_dvcpro50 failed. Look at tests/data/fate/lavf-mxf_dvcpro50.err 
for details.
ffmpeg version N-87333-gf952edaa73 Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 6.3.0 (Debian 6.3.0-18) 20170516
  configuration: --samples=/home/mrt/video/ffmpeg/fate/ --enable-vaapi 
--enable-libdrm --enable-gpl --enable-libx264 --enable-shared
  libavutil  55. 75.100 / 55. 75.100
  libavcodec 57.106.101 / 57.106.101
  libavformat57. 82.100 / 57. 82.100
  libavdevice57.  8.101 / 57.  8.101
  libavfilter 6.105.100 /  6.105.100
  libswscale  4.  7.103 /  4.  7.103
  libswresample   2.  8.100 /  2.  8.100
  libpostproc54.  6.100 / 54.  6.100
Input #0, image2, from 
'/home/mrt/video/ffmpeg/push/build/tests/vsynth1/%02d.pgm':
  Duration: 00:00:02.00, start: 0.00, bitrate: N/A
Stream #0:0: Video: pgmyuv, yuv420p, 352x288, 25 fps, 25 tbr, 25 tbn, 25 tbc
[s16le @ 0x5627ce70f2e0] Estimating duration from bitrate, this may be 
inaccurate
Guessed Channel Layout for Input Stream #1.0 : stereo
Input #1, s16le, from 
'/home/mrt/video/ffmpeg/push/build/./tests/data/asynth1.sw':
  Duration: 00:00:05.51, bitrate: 1536 kb/s
Stream #1:0: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
Codec AVOption idct (select IDCT implementation) specified for input file #1 
(/home/mrt/video/ffmpeg/push/build/./tests/data/asynth1.sw) has not been used 
for any stream. The most likely reason is either wrong type (e.g. a video 
option with no video streams) or that it is a private option of some decoder 
which was not actually used for any stream.
Please use -b:a or -b:v, -b is ambiguous
Stream mapping:
  Stream #0:0 -> #0:0 (pgmyuv (native) -> dvvideo (native))
  Stream #1:0 -> #0:1 (pcm_s16le (native) -> pcm_s16le (native))
[image2 @ 0x5627ce6f6fa0] Thread message queue blocking; consider raising the 
thread_queue_size option (current value: 8)
Output #0, mxf, to 
'/home/mrt/video/ffmpeg/push/build/./tests/data/lavf/lavf.mxf_dvcpro50':
  Metadata:
title   : lavftest
Stream #0:0: Video: dvvideo, yuv422p(progressive), 720x576 [SAR 64:45 DAR 

Re: [FFmpeg-devel] [PATCH] avformat/hlsenc: support http method for hls fmp4 init file

2017-09-19 Thread Carl Eugen Hoyos
2017-09-19 12:15 GMT+02:00 Steven Liu :
> fix ticket id: 6673

Please split if/when you push.

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


Re: [FFmpeg-devel] [PATCH 5/5] lavd: Add KMS frame grabber

2017-09-19 Thread Andy Furniss

Mark Thompson wrote:

On 15/09/17 00:15, Andy Furniss wrote:

Andy Furniss wrote:

Mark Thompson wrote:

---
Now sets the trusted packet flag; otherwise unchanged.


   configure|   1 +
   libavdevice/Makefile |   1 +
   libavdevice/alldevices.c |   1 +
   libavdevice/kmsgrab.c| 455 
+++
   4 files changed, 458 insertions(+)
   create mode 100644 libavdevice/kmsgrab.c

diff --git a/configure b/configure
index 6581c53c1a..76a7591ceb 100755
--- a/configure
+++ b/configure
@@ -3040,6 +3040,7 @@ gdigrab_indev_select="bmp_decoder"
   iec61883_indev_deps="libiec61883"
   jack_indev_deps="jack"
   jack_indev_deps_any="sem_timedwait dispatch_dispatch_h"
+kmsgrab_indev_deps="libdrm"


Doesn't get built for me = doesn't show up as indev after configure anything 
special needed?


Never mind I found --enable-libdrm (had tried --enable-kmsgrab)


I assume you're going to try AMD + Mesa + VAAPI.

VAAPI_DISABLE_INTERLACE=1 ./ffmpeg_g -y -format bgr0 -device /dev/dri/card1 -f 
kmsgrab -i - -vsync 0 -init_hw_device vaapi=v:/dev/dri/renderD129 
-filter_hw_device v -vf 'hwmap,scale_vaapi=w=1920:h=1080:format=nv12' -c:v 
h264_vaapi -profile 578 -bf 0 out.mp4

Three Mesa issues I had to get around:

* Device derivation doesn't work because the Mesa driver doesn't want to 
initialise on the DRM master device for some reason; making the matching device 
separately does work.
* Against current git, you need to reapply the VAAPI_DISABLE_INTERLACE patch 
and use it - if not, the colour conversion just barfs because it wants 
interlaced surfaces.
* The postproc scaler seems to only write the luma plane when converting from 
RGB - this is also visible when uploading normal RGB images, so just a bug 
somewhere.

With that, it works to record the screen in greyscale...

I have some other Mesa stuff to do queued up (libva2 with VAAPI export for EGL 
import on AMD), so I'll pursue these further soonish.


Leo just posted a patchset on the mesa list that makes vaapi work better 
with this and postproc generally.


You don't need the env with those and kmsgrab is now working for me - up 
to a point ...


That point being around 7k frames it will run out of something.

[AVHWFramesContext @ 0x31ed880] Failed to create surface from DRM 
object: 2 (resource allocation failed).

[Parsed_hwmap_0 @ 0x3114c40] Failed to map frame: -5.

I see that memory is reducing before this although I still have spare - 
is this the same issue you explained on users WRT leaking on decode?

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


[FFmpeg-devel] [PATCH] avfilter/interlace: rename two variables for consistency

2017-09-19 Thread Thomas Mundt
The attached patch needs to be applied on top of
"avfilter/interlace: add support for 10 and 12 bit".
Thanks.


0001-avfilter-interlace-rename-two-variables-for-consiste.patch
Description: Binary data
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 3/3 v2] avfilter/interlace: add support for 10 and 12 bit

2017-09-19 Thread Thomas Mundt
2017-09-19 17:53 GMT+02:00 James Almer :

> On 9/19/2017 5:02 AM, Thomas Mundt wrote:
> > 2017-09-19 4:09 GMT+02:00 James Almer :
> >
> >> On 9/18/2017 10:41 PM, Thomas Mundt wrote:
> >>> I tried to set up MIPS compiler for two days on windows and linux
> without
> >>> success.
> >>> Now I try it blind. This solution is based on the first suggestion
> James
> >>> gave me at IRC.
> >>> There might be room for improvement and an alternative solution with
> >>> AV_RL16() / AV_WL16().
> >>> I used av_le2ne16() because it will be ignored for little endian.
> >>>
> >>> Regards,
> >>> Thomas
> >>
> >>> From a2be5859266b1a2f7048b81ced6770ab4b90a5a4 Mon Sep 17 00:00:00 2001
> >>> From: Thomas Mundt 
> >>> Date: Tue, 19 Sep 2017 00:25:25 +0200
> >>> Subject: [PATCH 3/3 v2] avfilter/interlace: add support for 10 and 12
> bit
> >>>
> >>> Signed-off-by: Thomas Mundt 
> >>> ---
> >>>  libavfilter/interlace.h|  5 +-
> >>>  libavfilter/tinterlace.h   |  5 +-
> >>>  libavfilter/vf_interlace.c | 92
> >> ++
> >>>  libavfilter/vf_tinterlace.c| 73
> ++--
> >>>  libavfilter/x86/vf_interlace.asm   | 80
> >> --
> >>>  libavfilter/x86/vf_interlace_init.c| 51 ++
> >>>  libavfilter/x86/vf_tinterlace_init.c   | 51 ++
> >>>  tests/ref/fate/filter-pixfmts-tinterlace_cvlpf | 11 +++
> >>>  tests/ref/fate/filter-pixfmts-tinterlace_merge | 11 +++
> >>>  tests/ref/fate/filter-pixfmts-tinterlace_pad   | 11 +++
> >>>  tests/ref/fate/filter-pixfmts-tinterlace_vlpf  | 11 +++
> >>>  11 files changed, 345 insertions(+), 56 deletions(-)
> >>>
> >>> diff --git a/libavfilter/interlace.h b/libavfilter/interlace.h
> >>> index 2101b79..90a0198 100644
> >>> --- a/libavfilter/interlace.h
> >>> +++ b/libavfilter/interlace.h
> >>> @@ -25,9 +25,11 @@
> >>>  #ifndef AVFILTER_INTERLACE_H
> >>>  #define AVFILTER_INTERLACE_H
> >>>
> >>> +#include "libavutil/bswap.h"
> >>>  #include "libavutil/common.h"
> >>>  #include "libavutil/imgutils.h"
> >>>  #include "libavutil/opt.h"
> >>> +#include "libavutil/pixdesc.h"
> >>>
> >>>  #include "avfilter.h"
> >>>  #include "formats.h"
> >>> @@ -55,8 +57,9 @@ typedef struct InterlaceContext {
> >>>  enum ScanMode scan;// top or bottom field first scanning
> >>>  int lowpass;   // enable or disable low pass filtering
> >>>  AVFrame *cur, *next;   // the two frames from which the new one is
> >> obtained
> >>> +const AVPixFmtDescriptor *csp;
> >>>  void (*lowpass_line)(uint8_t *dstp, ptrdiff_t linesize, const
> >> uint8_t *srcp,
> >>> - ptrdiff_t mref, ptrdiff_t pref);
> >>> + ptrdiff_t mref, ptrdiff_t pref, int
> clip_max);
> >>>  } InterlaceContext;
> >>>
> >>>  void ff_interlace_init_x86(InterlaceContext *interlace);
> >>> diff --git a/libavfilter/tinterlace.h b/libavfilter/tinterlace.h
> >>> index cc13a6c..b5c39aa 100644
> >>> --- a/libavfilter/tinterlace.h
> >>> +++ b/libavfilter/tinterlace.h
> >>> @@ -27,7 +27,9 @@
> >>>  #ifndef AVFILTER_TINTERLACE_H
> >>>  #define AVFILTER_TINTERLACE_H
> >>>
> >>> +#include "libavutil/bswap.h"
> >>>  #include "libavutil/opt.h"
> >>> +#include "libavutil/pixdesc.h"
> >>>  #include "drawutils.h"
> >>>  #include "avfilter.h"
> >>>
> >>> @@ -60,8 +62,9 @@ typedef struct TInterlaceContext {
> >>>  int black_linesize[4];
> >>>  FFDrawContext draw;
> >>>  FFDrawColor color;
> >>> +const AVPixFmtDescriptor *csp;
> >>>  void (*lowpass_line)(uint8_t *dstp, ptrdiff_t width, const uint8_t
> >> *srcp,
> >>> - ptrdiff_t mref, ptrdiff_t pref);
> >>> + ptrdiff_t mref, ptrdiff_t pref, int
> clip_max);
> >>>  } TInterlaceContext;
> >>>
> >>>  void ff_tinterlace_init_x86(TInterlaceContext *interlace);
> >>> diff --git a/libavfilter/vf_interlace.c b/libavfilter/vf_interlace.c
> >>> index 55bf782..bfba054 100644
> >>> --- a/libavfilter/vf_interlace.c
> >>> +++ b/libavfilter/vf_interlace.c
> >>> @@ -61,8 +61,8 @@ static const AVOption interlace_options[] = {
> >>>  AVFILTER_DEFINE_CLASS(interlace);
> >>>
> >>>  static void lowpass_line_c(uint8_t *dstp, ptrdiff_t linesize,
> >>> -   const uint8_t *srcp,
> >>> -   ptrdiff_t mref, ptrdiff_t pref)
> >>> +   const uint8_t *srcp, ptrdiff_t mref,
> >>> +   ptrdiff_t pref, int clip_max)
> >>>  {
> >>>  const uint8_t *srcp_above = srcp + mref;
> >>>  const uint8_t *srcp_below = srcp + pref;
> >>> @@ -75,9 +75,28 @@ static void lowpass_line_c(uint8_t *dstp, ptrdiff_t
> >> linesize,
> >>>  }
> >>>  }
> >>>
> >>> +static void lowpass_line_c_16(uint8_t *dst8, ptrdiff_t linesize,
> >>> +  const uint8_t *src8, 

Re: [FFmpeg-devel] [PATCH] kmsgrab: fix build error when use old libdrm

2017-09-19 Thread Moritz Barsnick
On Thu, Sep 14, 2017 at 09:12:50 +0100, Mark Thompson wrote:
> > DRM_FORMAT_R16 adding from libdrm 2.4.82, fix the build error
> > when libdrm < 2.4.82.

> Hmm, yeah.  Thanks for noticing this - let me think about it a bit
> further, I imagine there are more cases than just this one. (It isn't
> autodetected so nothing is directly broken.)

There's certainly more stuff in here which isn't supported by older
libdrm. I'm talking e.g. headers which were introduced around 2011.
That's probably so ancient it doesn't warrent a version check/guard
though. (IOW I managed to configure with --enable-libdrm, but not
compile.)

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


Re: [FFmpeg-devel] [PATCHv12] libavcodec: v4l2: add support for v4l2 mem2mem codecs

2017-09-19 Thread Jorge Ramirez-Ortiz

On 09/19/2017 12:54 PM, wm4 wrote:

On Tue, 19 Sep 2017 12:48:06 -0700
Jorge Ramirez-Ortiz  wrote:


I
also assume the data flow issues got solved.

data flow?

Wasn't there some confusion about how send/receive works, and how to
connect it to how v4l2 data flow works?


ah yes, you are right. yes that was fixed as well (removing the timeouts when 
waiting for buffers).




(Also could we replace all instances of v4l2 with v4l? The original v4l
is dead AFAIK, and the 2 is redundant and confusing.)


do you mind if we keep the v4l2 (after all the API is called that way); just 
that v4l doesn't mean much anymore and it might create confusion to v4l2 developers

also notice that the kernel interface file is called videodev2.h.



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


Re: [FFmpeg-devel] [PATCHv12] libavcodec: v4l2: add support for v4l2 mem2mem codecs

2017-09-19 Thread Jorge Ramirez-Ortiz

On 09/19/2017 12:35 PM, wm4 wrote:

On Mon, 11 Sep 2017 16:26:33 +0200
Jorge Ramirez-Ortiz  wrote:


 This patchset enhances Alexis Ballier's original patch and validates
 it using Qualcomm's Venus hardware (driver recently landed upstream
 [1]).

 This has been tested on Qualcomm's DragonBoard 410c and 820c
 Configure/make scripts have been validated on Ubuntu 10.04 and
 16.04.

 Tested decoders:
- h264
- h263
- mpeg4
- vp8
- vp9
- hevc

 Tested encoders:
- h264
- h263
- mpeg4

 Tested transcoding (concurrent encoding/decoding)

 Some of the changes introduced:
 - v4l2: code cleanup and abstractions added
 - v4l2: follow the new encode/decode api.
 - v4l2: fix display size for NV12 output pool.
 - v4l2: handle EOS.
 - v4l2: vp8 and mpeg4 decoding and encoding.
 - v4l2: hevc and vp9 support.
 - v4l2: generate EOF on dequeue errors.
 - v4l2: h264_mp4toannexb filtering.
 - v4l2: fixed make install and fate issues.
 - v4l2: codecs enabled/disabled depending on pixfmt defined
 - v4l2: pass timebase/framerate to the context
 - v4l2: runtime decoder reconfiguration.
 - v4l2: add more frame information
 - v4l2: free hardware resources on last reference being released
 - v4l2: encoding: disable b-frames for upstreaming (patch required)

 [1] https://lwn.net/Articles/697956/

 Reviewed-by: Jorge Ramirez 
 Reviewed-by: Alexis Ballier 
 Tested-by: Jorge Ramirez 
---

I assume this version fixes the lifetime issues I've pointed out.


yes, the buffer issues  are resolved and the user can now close the 
encoder/decoder without losing the buffer references.



I
also assume the data flow issues got solved.


data flow?


With that, it would look
good to me, I guess. If nobody else has comments it could be applied.


please let me post v13 - today/tomorrow-  which cleans the code a bit more 
making it easier to understand and maintain (maybe it will trigger more questions?)



Btw. I noticed that this apparently never sets chroma_location?


I'll look into that for v13 as well.


___
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] [PATCHv12] libavcodec: v4l2: add support for v4l2 mem2mem codecs

2017-09-19 Thread wm4
On Tue, 19 Sep 2017 12:48:06 -0700
Jorge Ramirez-Ortiz  wrote:

> > I
> > also assume the data flow issues got solved.  
> 
> data flow?

Wasn't there some confusion about how send/receive works, and how to
connect it to how v4l2 data flow works?

(Also could we replace all instances of v4l2 with v4l? The original v4l
is dead AFAIK, and the 2 is redundant and confusing.)
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH v23 2/2] avformat/dashdec: free resource allocated by xml

2017-09-19 Thread wm4
On Sat, 9 Sep 2017 08:37:17 +0800
Steven Liu  wrote:

> 2017-09-04 23:55 GMT+08:00 Steven Liu :
> > 2017-09-04 23:36 GMT+08:00 wm4 :  
> >> On Mon, 4 Sep 2017 22:58:27 +0800
> >> Steven Liu  wrote:
> >>  
> >>> 2017-09-01 18:26 GMT+08:00 Steven Liu :  
> >>> > modify from av_free to xmlFree
> >>> >
> >>> > Signed-off-by: Steven Liu 
> >>> > ---
> >>> >  libavformat/dashdec.c | 44 ++--
> >>> >  1 file changed, 22 insertions(+), 22 deletions(-)
> >>> >  
> >>
> >>  
> >>> ping ?  
> >>
> >> That change seems good?  
> > LGTM, the change is modify from xmlFree to av_free, now, revert it :)  
> 
> pushed
> >> ___
> >> ffmpeg-devel mailing list
> >> ffmpeg-devel@ffmpeg.org
> >> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel  
> 
> 
> Thanks

It wasn't really an OK for pushing, but whatever.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 08/14] hwcontext_opencl: DRM to OpenCL mapping for ARM

2017-09-19 Thread Mark Thompson
On 19/09/17 20:24, wm4 wrote:
> On Sun, 10 Sep 2017 21:53:32 +0100
> Mark Thompson  wrote:
> 
>> Using cl_arm_import_memory.  Unfortunately, despite this not being a
>> standard extension, the function clImportMemoryARM() is not accessible
>> via clGetExtensionFunctionAddressForPlatform().  This means that it has
>> to be linked directly to the ARM OpenCL binary, so making a portable
>> binary is not possible as it is with all other mapping extensions.
>> ---
> 
> So, just what does this have to do with ARM? (Basically asking for some
> background here how this came to be.)

Think ARM the company, not ARM the architecture.  It's a vendor extension for 
OpenCL made by ARM - 
.
  They implement it in their drivers for Mali GPUs: I have it doing interop 
with the Rockchip decoder (using the recent patches for that here on the ML).

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


Re: [FFmpeg-devel] [PATCH] lavfi/buffersink: deprecate non-AVOption init.

2017-09-19 Thread wm4
On Tue, 12 Sep 2017 11:40:55 +0200
Nicolas George  wrote:

> Signed-off-by: Nicolas George 
> ---
>  doc/APIchanges   |  3 +++
>  libavfilter/buffersink.c | 10 ++
>  libavfilter/buffersink.h | 12 
>  3 files changed, 21 insertions(+), 4 deletions(-)
> 
> diff --git a/doc/APIchanges b/doc/APIchanges
> index cc67cbf6f8..be136ca11e 100644
> --- a/doc/APIchanges
> +++ b/doc/APIchanges
> @@ -15,6 +15,9 @@ libavutil: 2015-08-28
>  
>  API changes, most recent first:
>  
> +2017-09-12 - xxx - lavfi 6.XXX.100 - buffersink.h
> +  Deprecate non-AVOption init of buffersink.
> +
>  2017-09-08 - xxx - lavfi 6.103.100 - buffersrc.h
>Add av_buffersrc_close().
>  
> diff --git a/libavfilter/buffersink.c b/libavfilter/buffersink.c
> index 0f87b5439a..0d5380c681 100644
> --- a/libavfilter/buffersink.c
> +++ b/libavfilter/buffersink.c
> @@ -127,6 +127,8 @@ int attribute_align_arg 
> av_buffersink_get_samples(AVFilterContext *ctx,
>  return get_frame_internal(ctx, frame, 0, nb_samples);
>  }
>  
> +FF_DISABLE_DEPRECATION_WARNINGS
> +
>  AVBufferSinkParams *av_buffersink_params_alloc(void)
>  {
>  static const int pixel_fmts[] = { AV_PIX_FMT_NONE };
> @@ -147,6 +149,8 @@ AVABufferSinkParams *av_abuffersink_params_alloc(void)
>  return params;
>  }
>  
> +FF_ENABLE_DEPRECATION_WARNINGS
> +
>  static av_cold int common_init(AVFilterContext *ctx)
>  {
>  BufferSinkContext *buf = ctx->priv;
> @@ -201,6 +205,7 @@ MAKE_AVFILTERLINK_ACCESSOR(int  , sample_rate 
>)
>  
>  MAKE_AVFILTERLINK_ACCESSOR(AVBufferRef *, hw_frames_ctx  )
>  
> +FF_DISABLE_DEPRECATION_WARNINGS
>  static av_cold int vsink_init(AVFilterContext *ctx, void *opaque)
>  {
>  BufferSinkContext *buf = ctx->priv;
> @@ -208,12 +213,14 @@ static av_cold int vsink_init(AVFilterContext *ctx, 
> void *opaque)
>  int ret;
>  
>  if (params) {
> +av_log(ctx, AV_LOG_WARNING, "non-AVOption init of buffersink is 
> deprecated\n");
>  if ((ret = av_opt_set_int_list(buf, "pix_fmts", params->pixel_fmts, 
> AV_PIX_FMT_NONE, 0)) < 0)
>  return ret;
>  }
>  
>  return common_init(ctx);
>  }
> +FF_ENABLE_DEPRECATION_WARNINGS
>  
>  #define CHECK_LIST_SIZE(field) \
>  if (buf->field ## _size % sizeof(*buf->field)) { \
> @@ -244,6 +251,7 @@ static int vsink_query_formats(AVFilterContext *ctx)
>  return 0;
>  }
>  
> +FF_DISABLE_DEPRECATION_WARNINGS
>  static av_cold int asink_init(AVFilterContext *ctx, void *opaque)
>  {
>  BufferSinkContext *buf = ctx->priv;
> @@ -251,6 +259,7 @@ static av_cold int asink_init(AVFilterContext *ctx, void 
> *opaque)
>  int ret;
>  
>  if (params) {
> +av_log(ctx, AV_LOG_WARNING, "non-AVOption init of abuffersink is 
> deprecated\n");
>  if ((ret = av_opt_set_int_list(buf, "sample_fmts", 
> params->sample_fmts,  AV_SAMPLE_FMT_NONE, 0)) < 0 ||
>  (ret = av_opt_set_int_list(buf, "sample_rates",
> params->sample_rates,-1, 0)) < 0 ||
>  (ret = av_opt_set_int_list(buf, "channel_layouts", 
> params->channel_layouts, -1, 0)) < 0 ||
> @@ -260,6 +269,7 @@ static av_cold int asink_init(AVFilterContext *ctx, void 
> *opaque)
>  }
>  return common_init(ctx);
>  }
> +FF_ENABLE_DEPRECATION_WARNINGS
>  
>  static int asink_query_formats(AVFilterContext *ctx)
>  {
> diff --git a/libavfilter/buffersink.h b/libavfilter/buffersink.h
> index 21d6bb505b..d607bca631 100644
> --- a/libavfilter/buffersink.h
> +++ b/libavfilter/buffersink.h
> @@ -61,8 +61,10 @@ int av_buffersink_get_frame_flags(AVFilterContext *ctx, 
> AVFrame *frame, int flag
>  
>  /**
>   * Struct to use for initializing a buffersink context.
> + *
> + * @deprecated Use av_opt_set() on the newly created filter.
>   */
> -typedef struct AVBufferSinkParams {
> +attribute_deprecated typedef struct AVBufferSinkParams {
>  const enum AVPixelFormat *pixel_fmts; ///< list of allowed pixel 
> formats, terminated by AV_PIX_FMT_NONE
>  } AVBufferSinkParams;
>  
> @@ -71,12 +73,14 @@ typedef struct AVBufferSinkParams {
>   *
>   * Must be freed with av_free().
>   */
> -AVBufferSinkParams *av_buffersink_params_alloc(void);
> +attribute_deprecated AVBufferSinkParams *av_buffersink_params_alloc(void);
>  
>  /**
>   * Struct to use for initializing an abuffersink context.
> + *
> + * @deprecated Use av_opt_set() on the newly created filter.
>   */
> -typedef struct AVABufferSinkParams {
> +attribute_deprecated typedef struct AVABufferSinkParams {
>  const enum AVSampleFormat *sample_fmts; ///< list of allowed sample 
> formats, terminated by AV_SAMPLE_FMT_NONE
>  const int64_t *channel_layouts; ///< list of allowed channel 
> layouts, terminated by -1
>  const int *channel_counts;  ///< list of allowed channel 
> counts, terminated by -1
> @@ -89,7 +93,7 @@ typedef struct AVABufferSinkParams {
>   *
>   * Must be freed with av_free().
>   

Re: [FFmpeg-devel] [PATCHv12] libavcodec: v4l2: add support for v4l2 mem2mem codecs

2017-09-19 Thread wm4
On Mon, 11 Sep 2017 16:26:33 +0200
Jorge Ramirez-Ortiz  wrote:

> This patchset enhances Alexis Ballier's original patch and validates
> it using Qualcomm's Venus hardware (driver recently landed upstream
> [1]).
> 
> This has been tested on Qualcomm's DragonBoard 410c and 820c
> Configure/make scripts have been validated on Ubuntu 10.04 and
> 16.04.
> 
> Tested decoders:
>- h264
>- h263
>- mpeg4
>- vp8
>- vp9
>- hevc
> 
> Tested encoders:
>- h264
>- h263
>- mpeg4
> 
> Tested transcoding (concurrent encoding/decoding)
> 
> Some of the changes introduced:
> - v4l2: code cleanup and abstractions added
> - v4l2: follow the new encode/decode api.
> - v4l2: fix display size for NV12 output pool.
> - v4l2: handle EOS.
> - v4l2: vp8 and mpeg4 decoding and encoding.
> - v4l2: hevc and vp9 support.
> - v4l2: generate EOF on dequeue errors.
> - v4l2: h264_mp4toannexb filtering.
> - v4l2: fixed make install and fate issues.
> - v4l2: codecs enabled/disabled depending on pixfmt defined
> - v4l2: pass timebase/framerate to the context
> - v4l2: runtime decoder reconfiguration.
> - v4l2: add more frame information
> - v4l2: free hardware resources on last reference being released
> - v4l2: encoding: disable b-frames for upstreaming (patch required)
> 
> [1] https://lwn.net/Articles/697956/
> 
> Reviewed-by: Jorge Ramirez 
> Reviewed-by: Alexis Ballier 
> Tested-by: Jorge Ramirez 
> ---

I assume this version fixes the lifetime issues I've pointed out. I
also assume the data flow issues got solved. With that, it would look
good to me, I guess. If nobody else has comments it could be applied.

Btw. I noticed that this apparently never sets chroma_location?
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] Confusion over temporal filters.

2017-09-19 Thread wm4
On Sun, 10 Sep 2017 07:51:55 -0400
"Ronald S. Bultje"  wrote:

> Hi Richard,
> 
> On Sun, Sep 10, 2017 at 6:23 AM, Richard Ling  wrote:
> 
> > But maybe some time, the filter API could be
> > updated so that after a seek, a filter can request frames that are before
> > the seek position.  
> 
> 
> All of this suggests an fast and easy frame-accurate seeking, which is
> usually not the case.
> 
> Imagine you're seeking to frame 100, but there's only keyframes (or
> otherwise: random access points) in frame 95 and 105. You can't seek to
> frame 100 (or 99) anyway.

An easy way would be having the filters export how many reference
frames it wants, instead of making all filters generic black boxes that
can't be reasoned about.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 01/14] lavu: Add DRM hwcontext

2017-09-19 Thread wm4
On Sun, 10 Sep 2017 21:53:25 +0100
Mark Thompson  wrote:

> ---
> This is the same patch as the one in the kmsgrab and rkmpp sets, included 
> here because the ARM DRM mapping depends on it.
> 
> 
>  configure  |   3 +
>  libavutil/Makefile |   2 +
>  libavutil/hwcontext.c  |   4 +
>  libavutil/hwcontext.h  |   1 +
>  libavutil/hwcontext_drm.c  | 291 
> +
>  libavutil/hwcontext_drm.h  | 166 +++
>  libavutil/hwcontext_internal.h |   1 +
>  libavutil/pixdesc.c|   4 +
>  libavutil/pixfmt.h |   7 +
>  9 files changed, 479 insertions(+)
>  create mode 100644 libavutil/hwcontext_drm.c
>  create mode 100644 libavutil/hwcontext_drm.h
> 

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


Re: [FFmpeg-devel] [PATCH 08/14] hwcontext_opencl: DRM to OpenCL mapping for ARM

2017-09-19 Thread wm4
On Sun, 10 Sep 2017 21:53:32 +0100
Mark Thompson  wrote:

> Using cl_arm_import_memory.  Unfortunately, despite this not being a
> standard extension, the function clImportMemoryARM() is not accessible
> via clGetExtensionFunctionAddressForPlatform().  This means that it has
> to be linked directly to the ARM OpenCL binary, so making a portable
> binary is not possible as it is with all other mapping extensions.
> ---

So, just what does this have to do with ARM? (Basically asking for some
background here how this came to be.)
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] GnuTLS: eat PREMATURE_TERMINATION error

2017-09-19 Thread wm4
On Fri, 15 Sep 2017 17:04:38 +0900
Tatsuyuki Ishi  wrote:

> Subject: [PATCH] GnuTLS: eat PREMATURE_TERMINATION error
> 
> GnuTLS is too strict on the SSL shutdown alert, and it's neither
> mandatory in the spec or critical. As it's ignored in OpenSSL, we
> should also suppress it in GnuTLS as well.
> 
> Ticket: #6667
> 
> ---
>  libavformat/tls_gnutls.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/libavformat/tls_gnutls.c b/libavformat/tls_gnutls.c
> index ecc80bf..38f8ea4 100644
> --- a/libavformat/tls_gnutls.c
> +++ b/libavformat/tls_gnutls.c
> @@ -72,6 +72,7 @@ static int print_tls_error(URLContext *h, int ret)
>  switch (ret) {
>  case GNUTLS_E_AGAIN:
>  case GNUTLS_E_INTERRUPTED:
> +case GNUTLS_E_PREMATURE_TERMINATION:
>  break;
>  case GNUTLS_E_WARNING_ALERT_RECEIVED:
>  av_log(h, AV_LOG_WARNING, "%s\n", gnutls_strerror(ret));

I also agree with this patch.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] Configure Script change request to support libcdio on macOS

2017-09-19 Thread James Almer
On 9/17/2017 11:42 PM, 桃源老師 wrote:
> Hello, 
> 
>> 2017/09/17 午後11:58、桃源老師 のメール:
>>
>> I have tried to use libcdio function with ffmpeg on macOS. Then I get an 
>> information from libcdio team.  That is ffmpeg configure script should read 
>> libcdio's pkgconfig file, libcdio.pc.
> 
> I attach my request as patch file.  Please review it.

> --- a/configure   2017-09-18 10:24:52.0 +0900
> +++ b/configure   2017-09-18 11:31:58.0 +0900
> @@ -6151,7 +6151,7 @@
>  
>  if enabled libcdio; then
>  check_lib libcdio "cdio/cdda.h cdio/paranoia.h" cdio_cddap_open 
> -lcdio_paranoia -lcdio_cdda -lcdio ||
> -check_lib libcdio "cdio/paranoia/cdda.h cdio/paranoia/paranoia.h" 
> cdio_cddap_open -lcdio_paranoia -lcdio_cdda -lcdio ||
> +require_pkg_config libcdio "cdio/paranoia/cdda.h 
> cdio/paranoia/paranoia.h" cdio_cddap_open -lcdio_paranoia -lcdio_cdda -lcdio 
> && check_lib libcdio "cdio/paranoia/cdda.h cdio/paranoia/paranoia.h" 
> cdio_cddap_open -lcdio_paranoia -lcdio_cdda -lcdio ||

If check_lib will stay as a fallback then you should use use_pkg_config,
not require_pkg_config.
Maybe add one use_pkg_config for each potential header locations as
well, as with check_lib.

Also, don't use &&, use ||. The point is that if one fails the next is
tested, until die() is reached.

>  die "ERROR: No usable libcdio/cdparanoia found"
>  fi
>  
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 3/3 v2] avfilter/interlace: add support for 10 and 12 bit

2017-09-19 Thread James Almer
On 9/19/2017 5:02 AM, Thomas Mundt wrote:
> 2017-09-19 4:09 GMT+02:00 James Almer :
> 
>> On 9/18/2017 10:41 PM, Thomas Mundt wrote:
>>> I tried to set up MIPS compiler for two days on windows and linux without
>>> success.
>>> Now I try it blind. This solution is based on the first suggestion James
>>> gave me at IRC.
>>> There might be room for improvement and an alternative solution with
>>> AV_RL16() / AV_WL16().
>>> I used av_le2ne16() because it will be ignored for little endian.
>>>
>>> Regards,
>>> Thomas
>>
>>> From a2be5859266b1a2f7048b81ced6770ab4b90a5a4 Mon Sep 17 00:00:00 2001
>>> From: Thomas Mundt 
>>> Date: Tue, 19 Sep 2017 00:25:25 +0200
>>> Subject: [PATCH 3/3 v2] avfilter/interlace: add support for 10 and 12 bit
>>>
>>> Signed-off-by: Thomas Mundt 
>>> ---
>>>  libavfilter/interlace.h|  5 +-
>>>  libavfilter/tinterlace.h   |  5 +-
>>>  libavfilter/vf_interlace.c | 92
>> ++
>>>  libavfilter/vf_tinterlace.c| 73 ++--
>>>  libavfilter/x86/vf_interlace.asm   | 80
>> --
>>>  libavfilter/x86/vf_interlace_init.c| 51 ++
>>>  libavfilter/x86/vf_tinterlace_init.c   | 51 ++
>>>  tests/ref/fate/filter-pixfmts-tinterlace_cvlpf | 11 +++
>>>  tests/ref/fate/filter-pixfmts-tinterlace_merge | 11 +++
>>>  tests/ref/fate/filter-pixfmts-tinterlace_pad   | 11 +++
>>>  tests/ref/fate/filter-pixfmts-tinterlace_vlpf  | 11 +++
>>>  11 files changed, 345 insertions(+), 56 deletions(-)
>>>
>>> diff --git a/libavfilter/interlace.h b/libavfilter/interlace.h
>>> index 2101b79..90a0198 100644
>>> --- a/libavfilter/interlace.h
>>> +++ b/libavfilter/interlace.h
>>> @@ -25,9 +25,11 @@
>>>  #ifndef AVFILTER_INTERLACE_H
>>>  #define AVFILTER_INTERLACE_H
>>>
>>> +#include "libavutil/bswap.h"
>>>  #include "libavutil/common.h"
>>>  #include "libavutil/imgutils.h"
>>>  #include "libavutil/opt.h"
>>> +#include "libavutil/pixdesc.h"
>>>
>>>  #include "avfilter.h"
>>>  #include "formats.h"
>>> @@ -55,8 +57,9 @@ typedef struct InterlaceContext {
>>>  enum ScanMode scan;// top or bottom field first scanning
>>>  int lowpass;   // enable or disable low pass filtering
>>>  AVFrame *cur, *next;   // the two frames from which the new one is
>> obtained
>>> +const AVPixFmtDescriptor *csp;
>>>  void (*lowpass_line)(uint8_t *dstp, ptrdiff_t linesize, const
>> uint8_t *srcp,
>>> - ptrdiff_t mref, ptrdiff_t pref);
>>> + ptrdiff_t mref, ptrdiff_t pref, int clip_max);
>>>  } InterlaceContext;
>>>
>>>  void ff_interlace_init_x86(InterlaceContext *interlace);
>>> diff --git a/libavfilter/tinterlace.h b/libavfilter/tinterlace.h
>>> index cc13a6c..b5c39aa 100644
>>> --- a/libavfilter/tinterlace.h
>>> +++ b/libavfilter/tinterlace.h
>>> @@ -27,7 +27,9 @@
>>>  #ifndef AVFILTER_TINTERLACE_H
>>>  #define AVFILTER_TINTERLACE_H
>>>
>>> +#include "libavutil/bswap.h"
>>>  #include "libavutil/opt.h"
>>> +#include "libavutil/pixdesc.h"
>>>  #include "drawutils.h"
>>>  #include "avfilter.h"
>>>
>>> @@ -60,8 +62,9 @@ typedef struct TInterlaceContext {
>>>  int black_linesize[4];
>>>  FFDrawContext draw;
>>>  FFDrawColor color;
>>> +const AVPixFmtDescriptor *csp;
>>>  void (*lowpass_line)(uint8_t *dstp, ptrdiff_t width, const uint8_t
>> *srcp,
>>> - ptrdiff_t mref, ptrdiff_t pref);
>>> + ptrdiff_t mref, ptrdiff_t pref, int clip_max);
>>>  } TInterlaceContext;
>>>
>>>  void ff_tinterlace_init_x86(TInterlaceContext *interlace);
>>> diff --git a/libavfilter/vf_interlace.c b/libavfilter/vf_interlace.c
>>> index 55bf782..bfba054 100644
>>> --- a/libavfilter/vf_interlace.c
>>> +++ b/libavfilter/vf_interlace.c
>>> @@ -61,8 +61,8 @@ static const AVOption interlace_options[] = {
>>>  AVFILTER_DEFINE_CLASS(interlace);
>>>
>>>  static void lowpass_line_c(uint8_t *dstp, ptrdiff_t linesize,
>>> -   const uint8_t *srcp,
>>> -   ptrdiff_t mref, ptrdiff_t pref)
>>> +   const uint8_t *srcp, ptrdiff_t mref,
>>> +   ptrdiff_t pref, int clip_max)
>>>  {
>>>  const uint8_t *srcp_above = srcp + mref;
>>>  const uint8_t *srcp_below = srcp + pref;
>>> @@ -75,9 +75,28 @@ static void lowpass_line_c(uint8_t *dstp, ptrdiff_t
>> linesize,
>>>  }
>>>  }
>>>
>>> +static void lowpass_line_c_16(uint8_t *dst8, ptrdiff_t linesize,
>>> +  const uint8_t *src8, ptrdiff_t mref,
>>> +  ptrdiff_t pref, int clip_max)
>>> +{
>>> +uint16_t *dstp = (uint16_t *)dst8;
>>> +const uint16_t *srcp = (const uint16_t *)src8;
>>> +const uint16_t *srcp_above = srcp + mref / 2;
>>> +const uint16_t *srcp_below = srcp + pref / 2;
>>> +

Re: [FFmpeg-devel] Configure Script change request to support libcdio on macOS

2017-09-19 Thread Michael Niedermayer
On Mon, Sep 18, 2017 at 11:42:11AM +0900, 桃源老師 wrote:
> Hello, 
> 
> > 2017/09/17 午後11:58、桃源老師 のメール:
> > 
> > I have tried to use libcdio function with ffmpeg on macOS. Then I get an 
> > information from libcdio team.  That is ffmpeg configure script should read 
> > libcdio's pkgconfig file, libcdio.pc.
> 
> I attach my request as patch file.  Please review it.
> 

>  configure |2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 01105359616694b3c3c9a8f2e60d1f875ddef3bf  ffmpeg_configure.patch
> --- a/configure   2017-09-18 10:24:52.0 +0900
> +++ b/configure   2017-09-18 11:31:58.0 +0900
> @@ -6151,7 +6151,7 @@
>  
>  if enabled libcdio; then
>  check_lib libcdio "cdio/cdda.h cdio/paranoia.h" cdio_cddap_open 
> -lcdio_paranoia -lcdio_cdda -lcdio ||
> -check_lib libcdio "cdio/paranoia/cdda.h cdio/paranoia/paranoia.h" 
> cdio_cddap_open -lcdio_paranoia -lcdio_cdda -lcdio ||
> +require_pkg_config libcdio "cdio/paranoia/cdda.h 
> cdio/paranoia/paranoia.h" cdio_cddap_open -lcdio_paranoia -lcdio_cdda -lcdio 
> && check_lib libcdio "cdio/paranoia/cdda.h cdio/paranoia/paranoia.h" 
> cdio_cddap_open -lcdio_paranoia -lcdio_cdda -lcdio ||
>  die "ERROR: No usable libcdio/cdparanoia found"
>  fi
>  

This breaks FFmpeg on ubuntu with

ii  libcdio-cdda-dev
0.83-4.1ubuntu1  amd64  
  library to read and control digital audio CDs (development files)
ii  libcdio-cdda0   
0.81-4build1 amd64  
  library to read and control digital audio CDs
ii  libcdio-cdda1   
0.83-4.1ubuntu1  amd64  
  library to read and control digital audio CDs
ii  libcdio-dev 
0.83-4.1ubuntu1  amd64  
  library to read and control CD-ROM (development files)
ii  libcdio-paranoia-dev
0.83-4.1ubuntu1  amd64  
  library to read digital audio CDs with error correction (development files)
ii  libcdio-paranoia0   
0.81-4build1 amd64  
  library to read digital audio CDs with error correction
ii  libcdio-paranoia1   
0.83-4.1ubuntu1  amd64  
  library to read digital audio CDs with error correction
ii  libcdio-utils   
0.83-4.1ubuntu1  amd64  
  sample applications based on the CDIO libraries
ii  libcdio10   
0.81-4build1 amd64  
  library to read and control CD-ROM
ii  libcdio13   
0.83-4.1ubuntu1  amd64  
  library to read and control CD-ROM

./configure --enable-libcdio --enable-gpl
ERROR: No usable libcdio/cdparanoia found

If you think configure made a mistake, make sure you are using the latest
version from Git.  If the latest version fails, report the problem to the
ffmpeg-u...@ffmpeg.org mailing list or IRC #ffmpeg on irc.freenode.net.
Include the log file "ffbuild/config.log" produced by configure as this will 
help
solve the problem.


[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

It is what and why we do it that matters, not just one of them.


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


Re: [FFmpeg-devel] [PATCH] vp9: move VP9SharedContext back to the top of VP9Context

2017-09-19 Thread Hendrik Leppkes
On Tue, Sep 19, 2017 at 2:15 PM, Mark Thompson  wrote:
> On 19/09/17 09:51, Hendrik Leppkes wrote:
>> VP9SharedContext needs to be the first member so its properties can be
>> safely accessed from hardware accelerators, without the need to share
>> the full VP9Context.
>> ---
>>  libavcodec/vp9dec.h | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/libavcodec/vp9dec.h b/libavcodec/vp9dec.h
>> index 96c0e43cd2..66573edc79 100644
>> --- a/libavcodec/vp9dec.h
>> +++ b/libavcodec/vp9dec.h
>> @@ -89,8 +89,8 @@ typedef struct VP9Block {
>>  typedef struct VP9TileData VP9TileData;
>>
>>  typedef struct VP9Context {
>> -VP9TileData *td;
>>  VP9SharedContext s;
>> +VP9TileData *td;
>>
>>  VP9DSPContext dsp;
>>  VideoDSPContext vdsp;
>>
>
> LGTM.
>
> (You are also fixing #6674 now too.)
>

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


Re: [FFmpeg-devel] [PATCH] vp9: move VP9SharedContext back to the top of VP9Context

2017-09-19 Thread Hendrik Leppkes
On Tue, Sep 19, 2017 at 2:27 PM, Ronald S. Bultje  wrote:
> Hi,
>
> On Tue, Sep 19, 2017 at 4:51 AM, Hendrik Leppkes 
> wrote:
>
>> VP9SharedContext needs to be the first member so its properties can be
>> safely accessed from hardware accelerators, without the need to share
>> the full VP9Context.
>> ---
>>  libavcodec/vp9dec.h | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/libavcodec/vp9dec.h b/libavcodec/vp9dec.h
>> index 96c0e43cd2..66573edc79 100644
>> --- a/libavcodec/vp9dec.h
>> +++ b/libavcodec/vp9dec.h
>> @@ -89,8 +89,8 @@ typedef struct VP9Block {
>>  typedef struct VP9TileData VP9TileData;
>>
>>  typedef struct VP9Context {
>> -VP9TileData *td;
>>  VP9SharedContext s;
>> +VP9TileData *td;
>>
>>  VP9DSPContext dsp;
>>  VideoDSPContext vdsp;
>> --
>> 2.13.2.windows.1
>
>
> Sorry for not catching that during review.
>
> Is there some way we can make hardware decoding testable in some
> fate-configuration so we can automatically catch when this sort of stuff
> breaks?
>

There has been thought about that before, by implementing a "stub"
library of the hw accelerator that just dumps the parameters submitted
for comparison in FATE, but something like that would still be a big
job.

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


Re: [FFmpeg-devel] [PATCH] vp9: move VP9SharedContext back to the top of VP9Context

2017-09-19 Thread Ronald S. Bultje
Hi,

On Tue, Sep 19, 2017 at 4:51 AM, Hendrik Leppkes 
wrote:

> VP9SharedContext needs to be the first member so its properties can be
> safely accessed from hardware accelerators, without the need to share
> the full VP9Context.
> ---
>  libavcodec/vp9dec.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavcodec/vp9dec.h b/libavcodec/vp9dec.h
> index 96c0e43cd2..66573edc79 100644
> --- a/libavcodec/vp9dec.h
> +++ b/libavcodec/vp9dec.h
> @@ -89,8 +89,8 @@ typedef struct VP9Block {
>  typedef struct VP9TileData VP9TileData;
>
>  typedef struct VP9Context {
> -VP9TileData *td;
>  VP9SharedContext s;
> +VP9TileData *td;
>
>  VP9DSPContext dsp;
>  VideoDSPContext vdsp;
> --
> 2.13.2.windows.1


Sorry for not catching that during review.

Is there some way we can make hardware decoding testable in some
fate-configuration so we can automatically catch when this sort of stuff
breaks?

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


Re: [FFmpeg-devel] rtmps connect block

2017-09-19 Thread Moritz Barsnick
On Thu, Sep 07, 2017 at 12:46:54 +, Qiming Jin (qimijin) wrote:
> Hi all
> Please help check an issue:

You should report this on ffmpeg's issue tracker:
https://trac.ffmpeg.org/

Also please include a command line and the command's complete, uncut
console output, along with your other given explanations (and perhaps
your example code).

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


Re: [FFmpeg-devel] [PATCH] vp9: move VP9SharedContext back to the top of VP9Context

2017-09-19 Thread Mark Thompson
On 19/09/17 09:51, Hendrik Leppkes wrote:
> VP9SharedContext needs to be the first member so its properties can be
> safely accessed from hardware accelerators, without the need to share
> the full VP9Context.
> ---
>  libavcodec/vp9dec.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavcodec/vp9dec.h b/libavcodec/vp9dec.h
> index 96c0e43cd2..66573edc79 100644
> --- a/libavcodec/vp9dec.h
> +++ b/libavcodec/vp9dec.h
> @@ -89,8 +89,8 @@ typedef struct VP9Block {
>  typedef struct VP9TileData VP9TileData;
>  
>  typedef struct VP9Context {
> -VP9TileData *td;
>  VP9SharedContext s;
> +VP9TileData *td;
>  
>  VP9DSPContext dsp;
>  VideoDSPContext vdsp;
> 

LGTM.

(You are also fixing #6674 now too.)

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


Re: [FFmpeg-devel] [PATCH] avcodec/mips: Unrolled loops and expanded functions in avc put mc 10 & 30 msa functions

2017-09-19 Thread Manojkumar Bhosale
LGTM

-Original Message-
From: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] On Behalf Of 
kaustubh.ra...@imgtec.com
Sent: Monday, September 18, 2017 2:00 PM
To: ffmpeg-devel@ffmpeg.org
Cc: Kaustubh Raste
Subject: [FFmpeg-devel] [PATCH] avcodec/mips: Unrolled loops and expanded 
functions in avc put mc 10 & 30 msa functions

From: Kaustubh Raste 

Signed-off-by: Kaustubh Raste 
---
 libavcodec/mips/h264qpel_msa.c |  284 +++-
 1 file changed, 278 insertions(+), 6 deletions(-)

diff --git a/libavcodec/mips/h264qpel_msa.c b/libavcodec/mips/h264qpel_msa.c 
index 05dffea..b7f6c3d 100644
--- a/libavcodec/mips/h264qpel_msa.c
+++ b/libavcodec/mips/h264qpel_msa.c
@@ -3065,37 +3065,309 @@ void ff_avg_h264_qpel4_mc00_msa(uint8_t *dst, const 
uint8_t *src,  void ff_put_h264_qpel16_mc10_msa(uint8_t *dst, const uint8_t 
*src,
  ptrdiff_t stride)  {
-avc_luma_hz_qrt_16w_msa(src - 2, stride, dst, stride, 16, 0);
+uint32_t loop_cnt;
+v16i8 dst0, dst1, dst2, dst3, src0, src1, src2, src3, src4, src5, src6;
+v16i8 mask0, mask1, mask2, mask3, mask4, mask5, src7, vec11;
+v16i8 vec0, vec1, vec2, vec3, vec4, vec5, vec6, vec7, vec8, vec9, vec10;
+v8i16 res0, res1, res2, res3, res4, res5, res6, res7;
+v16i8 minus5b = __msa_ldi_b(-5);
+v16i8 plus20b = __msa_ldi_b(20);
+
+LD_SB3(_mask_arr[0], 16, mask0, mask1, mask2);
+mask3 = mask0 + 8;
+mask4 = mask1 + 8;
+mask5 = mask2 + 8;
+src -= 2;
+
+for (loop_cnt = 4; loop_cnt--;) {
+LD_SB2(src, 16, src0, src1);
+src += stride;
+LD_SB2(src, 16, src2, src3);
+src += stride;
+LD_SB2(src, 16, src4, src5);
+src += stride;
+LD_SB2(src, 16, src6, src7);
+src += stride;
+
+XORI_B8_128_SB(src0, src1, src2, src3, src4, src5, src6, src7);
+VSHF_B2_SB(src0, src0, src0, src1, mask0, mask3, vec0, vec3);
+VSHF_B2_SB(src2, src2, src2, src3, mask0, mask3, vec6, vec9);
+VSHF_B2_SB(src0, src0, src0, src1, mask1, mask4, vec1, vec4);
+VSHF_B2_SB(src2, src2, src2, src3, mask1, mask4, vec7, vec10);
+VSHF_B2_SB(src0, src0, src0, src1, mask2, mask5, vec2, vec5);
+VSHF_B2_SB(src2, src2, src2, src3, mask2, mask5, vec8, vec11);
+HADD_SB4_SH(vec0, vec3, vec6, vec9, res0, res1, res2, res3);
+DPADD_SB4_SH(vec1, vec4, vec7, vec10, minus5b, minus5b, minus5b,
+ minus5b, res0, res1, res2, res3);
+DPADD_SB4_SH(vec2, vec5, vec8, vec11, plus20b, plus20b, plus20b,
+ plus20b, res0, res1, res2, res3);
+VSHF_B2_SB(src4, src4, src4, src5, mask0, mask3, vec0, vec3);
+VSHF_B2_SB(src6, src6, src6, src7, mask0, mask3, vec6, vec9);
+VSHF_B2_SB(src4, src4, src4, src5, mask1, mask4, vec1, vec4);
+VSHF_B2_SB(src6, src6, src6, src7, mask1, mask4, vec7, vec10);
+VSHF_B2_SB(src4, src4, src4, src5, mask2, mask5, vec2, vec5);
+VSHF_B2_SB(src6, src6, src6, src7, mask2, mask5, vec8, vec11);
+HADD_SB4_SH(vec0, vec3, vec6, vec9, res4, res5, res6, res7);
+DPADD_SB4_SH(vec1, vec4, vec7, vec10, minus5b, minus5b, minus5b,
+ minus5b, res4, res5, res6, res7);
+DPADD_SB4_SH(vec2, vec5, vec8, vec11, plus20b, plus20b, plus20b,
+ plus20b, res4, res5, res6, res7);
+SLDI_B2_SB(src1, src3, src0, src2, src0, src2, 2);
+SLDI_B2_SB(src5, src7, src4, src6, src4, src6, 2);
+SRARI_H4_SH(res0, res1, res2, res3, 5);
+SRARI_H4_SH(res4, res5, res6, res7, 5);
+SAT_SH4_SH(res0, res1, res2, res3, 7);
+SAT_SH4_SH(res4, res5, res6, res7, 7);
+PCKEV_B2_SB(res1, res0, res3, res2, dst0, dst1);
+PCKEV_B2_SB(res5, res4, res7, res6, dst2, dst3);
+dst0 = __msa_aver_s_b(dst0, src0);
+dst1 = __msa_aver_s_b(dst1, src2);
+dst2 = __msa_aver_s_b(dst2, src4);
+dst3 = __msa_aver_s_b(dst3, src6);
+XORI_B4_128_SB(dst0, dst1, dst2, dst3);
+ST_SB4(dst0, dst1, dst2, dst3, dst, stride);
+dst += (4 * stride);
+}
 }
 
 void ff_put_h264_qpel16_mc30_msa(uint8_t *dst, const uint8_t *src,
  ptrdiff_t stride)  {
-avc_luma_hz_qrt_16w_msa(src - 2, stride, dst, stride, 16, 1);
+uint32_t loop_cnt;
+v16i8 dst0, dst1, dst2, dst3, src0, src1, src2, src3, src4, src5, src6;
+v16i8 mask0, mask1, mask2, mask3, mask4, mask5, src7, vec11;
+v16i8 vec0, vec1, vec2, vec3, vec4, vec5, vec6, vec7, vec8, vec9, vec10;
+v8i16 res0, res1, res2, res3, res4, res5, res6, res7;
+v16i8 minus5b = __msa_ldi_b(-5);
+v16i8 plus20b = __msa_ldi_b(20);
+
+LD_SB3(_mask_arr[0], 16, mask0, mask1, mask2);
+mask3 = mask0 + 8;
+mask4 = mask1 + 8;
+mask5 = mask2 + 8;
+src -= 2;
+
+for (loop_cnt = 4; loop_cnt--;) {
+LD_SB2(src, 16, src0, src1);
+

[FFmpeg-devel] [PATCH] avformat/hlsenc: support http method for hls fmp4 init file

2017-09-19 Thread Steven Liu
fix ticket id: 6673

Signed-off-by: Steven Liu 
---
 libavformat/hlsenc.c | 35 ++-
 1 file changed, 18 insertions(+), 17 deletions(-)

diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index 3a9a235514..56f3cd505a 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -215,6 +215,22 @@ static int mkdir_p(const char *path) {
 return ret;
 }
 
+static void set_http_options(AVFormatContext *s, AVDictionary **options, 
HLSContext *c)
+{
+const char *proto = avio_find_protocol_name(s->filename);
+int http_base_proto = proto ? (!av_strcasecmp(proto, "http") || 
!av_strcasecmp(proto, "https")) : 0;
+
+if (c->method) {
+av_dict_set(options, "method", c->method, 0);
+} else if (http_base_proto) {
+av_log(c, AV_LOG_WARNING, "No HTTP method set, hls muxer defaulting to 
method PUT.\n");
+av_dict_set(options, "method", "PUT", 0);
+}
+if (c->user_agent)
+av_dict_set(options, "user_agent", c->user_agent, 0);
+
+}
+
 static int replace_int_data_in_filename(char *buf, int buf_size, const char 
*filename, char placeholder, int64_t number)
 {
 const char *p;
@@ -592,7 +608,8 @@ static int hls_mux_init(AVFormatContext *s)
 return AVERROR_PATCHWELCOME;
 }
 hls->fmp4_init_mode = !byterange_mode;
-if ((ret = s->io_open(s, >pb, hls->base_output_dirname, 
AVIO_FLAG_WRITE, NULL)) < 0) {
+set_http_options(s, , hls);
+if ((ret = s->io_open(s, >pb, hls->base_output_dirname, 
AVIO_FLAG_WRITE, )) < 0) {
 av_log(s, AV_LOG_ERROR, "Failed to open segment '%s'\n", 
hls->fmp4_init_filename);
 return ret;
 }
@@ -964,22 +981,6 @@ static void hls_free_segments(HLSSegment *p)
 }
 }
 
-static void set_http_options(AVFormatContext *s, AVDictionary **options, 
HLSContext *c)
-{
-const char *proto = avio_find_protocol_name(s->filename);
-int http_base_proto = proto ? (!av_strcasecmp(proto, "http") || 
!av_strcasecmp(proto, "https")) : 0;
-
-if (c->method) {
-av_dict_set(options, "method", c->method, 0);
-} else if (http_base_proto) {
-av_log(c, AV_LOG_WARNING, "No HTTP method set, hls muxer defaulting to 
method PUT.\n");
-av_dict_set(options, "method", "PUT", 0);
-}
-if (c->user_agent)
-av_dict_set(options, "user_agent", c->user_agent, 0);
-
-}
-
 static void write_m3u8_head_block(HLSContext *hls, AVIOContext *out, int 
version,
   int target_duration, int64_t sequence)
 {
-- 
2.11.0 (Apple Git-81)



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


Re: [FFmpeg-devel] [PATCH 2/2] avcodec/pngdec: Clean up on av_frame_ref() failure

2017-09-19 Thread Michael Niedermayer
On Tue, Sep 19, 2017 at 01:00:52AM -0300, James Almer wrote:
> On 9/16/2017 9:42 PM, Michael Niedermayer wrote:
> > Fixes: memleak
> > Fixes: 3203/clusterfuzz-testcase-minimized-4514553595428864
> > 
> > Found-by: continuous fuzzing process 
> > https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> > Signed-off-by: Michael Niedermayer 
> > ---
> >  libavcodec/pngdec.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c
> > index dce8faf168..0d6612ccca 100644
> > --- a/libavcodec/pngdec.c
> > +++ b/libavcodec/pngdec.c
> > @@ -1414,7 +1414,7 @@ static int decode_frame_png(AVCodecContext *avctx,
> >  }
> >  
> >  if ((ret = av_frame_ref(data, s->picture.f)) < 0)
> > -return ret;
> > +goto the_end;
> >  
> >  *got_frame = 1;
> >  
> 
> LGTM.

will apply

thanks

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

Asymptotically faster algorithms should always be preferred if you have
asymptotical amounts of data


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/2] avcodec/wmv2dec: Check end of bitstream in parse_mb_skip() and ff_wmv2_decode_mb()

2017-09-19 Thread Michael Niedermayer
Hi Ronald

On Mon, Sep 18, 2017 at 09:11:39AM -0400, Ronald S. Bultje wrote:
> Hi Michael,
> 
> On Sun, Sep 17, 2017 at 8:15 PM, Michael Niedermayer  > wrote:
> 
> > Iam happy to follow what the community prefers.
> >
> 
> Some don't like it, some don't care. I think everyone would be happy (and

I belive you did not ask the community. if so you cannot know what people
prefer. I think you extrapolate from 3 people who have been very vocal
about this to the whole community.


> thus the sum of happiness would increase) if you changed this to ff_dlog()
> or something along those lines.

Why do you keep arguing with me and not poll the community?

Iam happy to do what the majority prefers, but i do not know what
the majority prefers.


> 
> You say you want to code, so why not take the path of least resistance and
> move on?

If this is about changing one error message in one patch.
Ill just change it because id like to push this bugfix and argumentation
with you is quite time consuming and was so far in this case fruitless.
But the project should not be run by "its the path of least resistance
to comply with what i demand"

if OTOH what you want is establishing a rule about error messages.
No, one cannot do that without
1. writing the rule down
2. polling the comunity about it
3. including the rule in the policy so everyone, including new
   developers know about it.
This is a matter that needs a community decission first.
Also the codebase would become incresingly inconsistent without
this being agreed on by all and written down.


> Is this just about being right?

no, its very possible i and or you are wrong.


> Or do you really believe it's
> important to display an error message while fuzzing?

no. Its important when the user hits a bug/issue.
Developers can rebuild the tree with any debug flag, a user generally
cannot. But i belive we fundamentally disagree here.

The ones hit hardest with a wide spread removial of error messages
from the binary in a user build are probably the people dealing with
bug reports.
Its interresting to note that the people pushing for this removial
have quite some overlap with who has in the past attacked our most
active developer on the bug tracker. Iam sure its just a coincidence
but its still chilling to realize this.


> Or do you have actual
> evidence that this is an error path that will often occur in real-world
> files and where the provided error message helps our users resolve the
> issue that their valid (non-fuzzed, real-world) file is not playing back?

That yes, though its a very seperate thing. And part of what i
meant with "disagreeing" with you.

This error message here would trigger on a truncated frame/file.
Truncated files are common in the real world for all kinds of reasons.

This was found by a fuzzer but its not specific to fuzzing


Also, i very much would like to end this discussion, its a huge waste
of time for everyone.
If you dont want to have a community wide rule and dont want to
ask people outside of the group who dont like how error messages are
currently handled, then please stop asking me to change code.

Thank you

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Frequently ignored answer#1 FFmpeg bugs should be sent to our bugtracker. User
questions about the command line tools should be sent to the ffmpeg-user ML.
And questions about how to use libav* should be sent to the libav-user ML.


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


[FFmpeg-devel] [PATCH] vp9: move VP9SharedContext back to the top of VP9Context

2017-09-19 Thread Hendrik Leppkes
VP9SharedContext needs to be the first member so its properties can be
safely accessed from hardware accelerators, without the need to share
the full VP9Context.
---
 libavcodec/vp9dec.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/vp9dec.h b/libavcodec/vp9dec.h
index 96c0e43cd2..66573edc79 100644
--- a/libavcodec/vp9dec.h
+++ b/libavcodec/vp9dec.h
@@ -89,8 +89,8 @@ typedef struct VP9Block {
 typedef struct VP9TileData VP9TileData;
 
 typedef struct VP9Context {
-VP9TileData *td;
 VP9SharedContext s;
+VP9TileData *td;
 
 VP9DSPContext dsp;
 VideoDSPContext vdsp;
-- 
2.13.2.windows.1

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


Re: [FFmpeg-devel] [PATCH 3/3 v2] avfilter/interlace: add support for 10 and 12 bit

2017-09-19 Thread Thomas Mundt
2017-09-19 4:09 GMT+02:00 James Almer :

> On 9/18/2017 10:41 PM, Thomas Mundt wrote:
> > I tried to set up MIPS compiler for two days on windows and linux without
> > success.
> > Now I try it blind. This solution is based on the first suggestion James
> > gave me at IRC.
> > There might be room for improvement and an alternative solution with
> > AV_RL16() / AV_WL16().
> > I used av_le2ne16() because it will be ignored for little endian.
> >
> > Regards,
> > Thomas
>
> > From a2be5859266b1a2f7048b81ced6770ab4b90a5a4 Mon Sep 17 00:00:00 2001
> > From: Thomas Mundt 
> > Date: Tue, 19 Sep 2017 00:25:25 +0200
> > Subject: [PATCH 3/3 v2] avfilter/interlace: add support for 10 and 12 bit
> >
> > Signed-off-by: Thomas Mundt 
> > ---
> >  libavfilter/interlace.h|  5 +-
> >  libavfilter/tinterlace.h   |  5 +-
> >  libavfilter/vf_interlace.c | 92
> ++
> >  libavfilter/vf_tinterlace.c| 73 ++--
> >  libavfilter/x86/vf_interlace.asm   | 80
> --
> >  libavfilter/x86/vf_interlace_init.c| 51 ++
> >  libavfilter/x86/vf_tinterlace_init.c   | 51 ++
> >  tests/ref/fate/filter-pixfmts-tinterlace_cvlpf | 11 +++
> >  tests/ref/fate/filter-pixfmts-tinterlace_merge | 11 +++
> >  tests/ref/fate/filter-pixfmts-tinterlace_pad   | 11 +++
> >  tests/ref/fate/filter-pixfmts-tinterlace_vlpf  | 11 +++
> >  11 files changed, 345 insertions(+), 56 deletions(-)
> >
> > diff --git a/libavfilter/interlace.h b/libavfilter/interlace.h
> > index 2101b79..90a0198 100644
> > --- a/libavfilter/interlace.h
> > +++ b/libavfilter/interlace.h
> > @@ -25,9 +25,11 @@
> >  #ifndef AVFILTER_INTERLACE_H
> >  #define AVFILTER_INTERLACE_H
> >
> > +#include "libavutil/bswap.h"
> >  #include "libavutil/common.h"
> >  #include "libavutil/imgutils.h"
> >  #include "libavutil/opt.h"
> > +#include "libavutil/pixdesc.h"
> >
> >  #include "avfilter.h"
> >  #include "formats.h"
> > @@ -55,8 +57,9 @@ typedef struct InterlaceContext {
> >  enum ScanMode scan;// top or bottom field first scanning
> >  int lowpass;   // enable or disable low pass filtering
> >  AVFrame *cur, *next;   // the two frames from which the new one is
> obtained
> > +const AVPixFmtDescriptor *csp;
> >  void (*lowpass_line)(uint8_t *dstp, ptrdiff_t linesize, const
> uint8_t *srcp,
> > - ptrdiff_t mref, ptrdiff_t pref);
> > + ptrdiff_t mref, ptrdiff_t pref, int clip_max);
> >  } InterlaceContext;
> >
> >  void ff_interlace_init_x86(InterlaceContext *interlace);
> > diff --git a/libavfilter/tinterlace.h b/libavfilter/tinterlace.h
> > index cc13a6c..b5c39aa 100644
> > --- a/libavfilter/tinterlace.h
> > +++ b/libavfilter/tinterlace.h
> > @@ -27,7 +27,9 @@
> >  #ifndef AVFILTER_TINTERLACE_H
> >  #define AVFILTER_TINTERLACE_H
> >
> > +#include "libavutil/bswap.h"
> >  #include "libavutil/opt.h"
> > +#include "libavutil/pixdesc.h"
> >  #include "drawutils.h"
> >  #include "avfilter.h"
> >
> > @@ -60,8 +62,9 @@ typedef struct TInterlaceContext {
> >  int black_linesize[4];
> >  FFDrawContext draw;
> >  FFDrawColor color;
> > +const AVPixFmtDescriptor *csp;
> >  void (*lowpass_line)(uint8_t *dstp, ptrdiff_t width, const uint8_t
> *srcp,
> > - ptrdiff_t mref, ptrdiff_t pref);
> > + ptrdiff_t mref, ptrdiff_t pref, int clip_max);
> >  } TInterlaceContext;
> >
> >  void ff_tinterlace_init_x86(TInterlaceContext *interlace);
> > diff --git a/libavfilter/vf_interlace.c b/libavfilter/vf_interlace.c
> > index 55bf782..bfba054 100644
> > --- a/libavfilter/vf_interlace.c
> > +++ b/libavfilter/vf_interlace.c
> > @@ -61,8 +61,8 @@ static const AVOption interlace_options[] = {
> >  AVFILTER_DEFINE_CLASS(interlace);
> >
> >  static void lowpass_line_c(uint8_t *dstp, ptrdiff_t linesize,
> > -   const uint8_t *srcp,
> > -   ptrdiff_t mref, ptrdiff_t pref)
> > +   const uint8_t *srcp, ptrdiff_t mref,
> > +   ptrdiff_t pref, int clip_max)
> >  {
> >  const uint8_t *srcp_above = srcp + mref;
> >  const uint8_t *srcp_below = srcp + pref;
> > @@ -75,9 +75,28 @@ static void lowpass_line_c(uint8_t *dstp, ptrdiff_t
> linesize,
> >  }
> >  }
> >
> > +static void lowpass_line_c_16(uint8_t *dst8, ptrdiff_t linesize,
> > +  const uint8_t *src8, ptrdiff_t mref,
> > +  ptrdiff_t pref, int clip_max)
> > +{
> > +uint16_t *dstp = (uint16_t *)dst8;
> > +const uint16_t *srcp = (const uint16_t *)src8;
> > +const uint16_t *srcp_above = srcp + mref / 2;
> > +const uint16_t *srcp_below = srcp + pref / 2;
> > +int i;
> > +for (i = 0; i < linesize; i++) {
> > +  

[FFmpeg-devel] [PATCH v3] fate: add tests for psnr and ssim filter

2017-09-19 Thread Tobias Rapp
Metadata filter output is passed through an Awk script comparing floats
against reference values with specified "fuzz" tolerance to account for
architectural differences (e.g. x86-32 vs. x86-64).

Signed-off-by: Tobias Rapp 
---
tested on Linux x86-32/64 and Mips (Qemu)

v3:
 - avoid precision loss due to rounding of float values

v2:
 - removed CPUFLAGS work-around for ssim filter issue
 - added metadata float value post-processing script

 tests/fate-run.sh |  9 ++
 tests/fate/filter-video.mak   | 14 
 tests/ref/fate/filter-refcmp-psnr-rgb | 45 ++
 tests/ref/fate/filter-refcmp-psnr-yuv | 45 ++
 tests/ref/fate/filter-refcmp-ssim-rgb | 30 +
 tests/ref/fate/filter-refcmp-ssim-yuv | 30 +
 tests/refcmp-metadata.awk | 61 +++
 7 files changed, 234 insertions(+)
 create mode 100644 tests/ref/fate/filter-refcmp-psnr-rgb
 create mode 100644 tests/ref/fate/filter-refcmp-psnr-yuv
 create mode 100644 tests/ref/fate/filter-refcmp-ssim-rgb
 create mode 100644 tests/ref/fate/filter-refcmp-ssim-yuv
 create mode 100644 tests/refcmp-metadata.awk

diff --git a/tests/fate-run.sh b/tests/fate-run.sh
index 9aa9a22..c5480c7 100755
--- a/tests/fate-run.sh
+++ b/tests/fate-run.sh
@@ -234,6 +234,15 @@ lavftest(){
 ${base}/lavf-regression.sh $t lavf tests/vsynth1 "$target_exec" 
"$target_path" "$threads" "$thread_type" "$cpuflags" "$target_samples"
 }
 
+refcmp_metadata(){
+refcmp=$1
+pixfmt=$2
+fuzz=${3:-0.001}
+ffmpeg $FLAGS $ENC_OPTS \
+-lavfi 
"testsrc2=size=300x200:rate=1:duration=5,format=${pixfmt},split[ref][tmp];[tmp]avgblur=4[enc];[enc][ref]${refcmp},metadata=print:file=-"
 \
+-f null /dev/null | awk -v ref=${ref} -v fuzz=${fuzz} -f 
${base}/refcmp-metadata.awk -
+}
+
 video_filter(){
 filters=$1
 shift
diff --git a/tests/fate/filter-video.mak b/tests/fate/filter-video.mak
index d1e1341..78cd471 100644
--- a/tests/fate/filter-video.mak
+++ b/tests/fate/filter-video.mak
@@ -747,6 +747,20 @@ FATE_FILTER_SAMPLES-$(call ALLYES, MOV_DEMUXER 
H264_DECODER AAC_FIXED_DECODER PC
 fate-filter-meta-4560-rotate0: tests/data/file4560-override2rotate0.mov
 fate-filter-meta-4560-rotate0: CMD = framecrc -flags +bitexact -c:a aac_fixed 
-i $(TARGET_PATH)/tests/data/file4560-override2rotate0.mov
 
+REFCMP_DEPS = FFMPEG LAVFI_INDEV TESTSRC2_FILTER AVGBLUR_FILTER METADATA_FILTER
+
+FATE_FILTER_SAMPLES-$(call ALLYES, $(REFCMP_DEPS) PSNR_FILTER) += 
fate-filter-refcmp-psnr-rgb
+fate-filter-refcmp-psnr-rgb: CMD = refcmp_metadata psnr rgb24
+
+FATE_FILTER_SAMPLES-$(call ALLYES, $(REFCMP_DEPS) PSNR_FILTER) += 
fate-filter-refcmp-psnr-yuv
+fate-filter-refcmp-psnr-yuv: CMD = refcmp_metadata psnr yuv422p
+
+FATE_FILTER_SAMPLES-$(call ALLYES, $(REFCMP_DEPS) SSIM_FILTER) += 
fate-filter-refcmp-ssim-rgb
+fate-filter-refcmp-ssim-rgb: CMD = refcmp_metadata ssim rgb24
+
+FATE_FILTER_SAMPLES-$(call ALLYES, $(REFCMP_DEPS) SSIM_FILTER) += 
fate-filter-refcmp-ssim-yuv
+fate-filter-refcmp-ssim-yuv: CMD = refcmp_metadata ssim yuv422p
+
 FATE_SAMPLES_FFPROBE += $(FATE_METADATA_FILTER-yes)
 FATE_SAMPLES_FFMPEG += $(FATE_FILTER_SAMPLES-yes)
 FATE_FFMPEG += $(FATE_FILTER-yes)
diff --git a/tests/ref/fate/filter-refcmp-psnr-rgb 
b/tests/ref/fate/filter-refcmp-psnr-rgb
new file mode 100644
index 000..7d413f4
--- /dev/null
+++ b/tests/ref/fate/filter-refcmp-psnr-rgb
@@ -0,0 +1,45 @@
+frame:0pts:0   pts_time:0  
+lavfi.psnr.mse.r=1381.80
+lavfi.psnr.psnr.r=16.73
+lavfi.psnr.mse.g=896.00
+lavfi.psnr.psnr.g=18.61
+lavfi.psnr.mse.b=277.38
+lavfi.psnr.psnr.b=23.70
+lavfi.psnr.mse_avg=851.73
+lavfi.psnr.psnr_avg=18.83
+frame:1pts:1   pts_time:1  
+lavfi.psnr.mse.r=1380.37
+lavfi.psnr.psnr.r=16.73
+lavfi.psnr.mse.g=975.91
+lavfi.psnr.psnr.g=18.24
+lavfi.psnr.mse.b=435.72
+lavfi.psnr.psnr.b=21.74
+lavfi.psnr.mse_avg=930.67
+lavfi.psnr.psnr_avg=18.44
+frame:2pts:2   pts_time:2  
+lavfi.psnr.mse.r=1403.20
+lavfi.psnr.psnr.r=16.66
+lavfi.psnr.mse.g=954.05
+lavfi.psnr.psnr.g=18.34
+lavfi.psnr.mse.b=494.22
+lavfi.psnr.psnr.b=21.19
+lavfi.psnr.mse_avg=950.49
+lavfi.psnr.psnr_avg=18.35
+frame:3pts:3   pts_time:3  
+lavfi.psnr.mse.r=1452.80
+lavfi.psnr.psnr.r=16.51
+lavfi.psnr.mse.g=1001.02
+lavfi.psnr.psnr.g=18.13
+lavfi.psnr.mse.b=557.39
+lavfi.psnr.psnr.b=20.67
+lavfi.psnr.mse_avg=1003.74
+lavfi.psnr.psnr_avg=18.11
+frame:4pts:4   pts_time:4  
+lavfi.psnr.mse.r=1401.25
+lavfi.psnr.psnr.r=16.67
+lavfi.psnr.mse.g=1009.80
+lavfi.psnr.psnr.g=18.09
+lavfi.psnr.mse.b=602.42
+lavfi.psnr.psnr.b=20.33
+lavfi.psnr.mse_avg=1004.49
+lavfi.psnr.psnr_avg=18.11
diff --git a/tests/ref/fate/filter-refcmp-psnr-yuv 
b/tests/ref/fate/filter-refcmp-psnr-yuv
new file mode 100644
index 000..942542a
--- /dev/null
+++ b/tests/ref/fate/filter-refcmp-psnr-yuv
@@ -0,0 +1,45 @@
+frame:0pts:0   pts_time:0