[FFmpeg-devel] [PATCH 1/2] mem: Order function prototypes semantically

2016-07-31 Thread Timothy Gu
---
 libavutil/mem.h | 198 
 1 file changed, 99 insertions(+), 99 deletions(-)

diff --git a/libavutil/mem.h b/libavutil/mem.h
index 2f53b47..145ac91 100644
--- a/libavutil/mem.h
+++ b/libavutil/mem.h
@@ -83,6 +83,16 @@
 void *av_malloc(size_t size) av_malloc_attrib av_alloc_size(1);
 
 /**
+ * Allocate a block of size bytes with alignment suitable for all
+ * memory accesses (including vectors if available on the CPU) and
+ * zero all the bytes of the block.
+ * @param size Size in bytes for the memory block to be allocated.
+ * @return Pointer to the allocated block, NULL if it cannot be allocated.
+ * @see av_malloc()
+ */
+void *av_mallocz(size_t size) av_malloc_attrib av_alloc_size(1);
+
+/**
  * Allocate a block of size * nmemb bytes with av_malloc().
  * @param nmemb Number of elements
  * @param size Size of the single element
@@ -98,6 +108,34 @@ av_alloc_size(1, 2) static inline void 
*av_malloc_array(size_t nmemb, size_t siz
 }
 
 /**
+ * Allocate a block of size * nmemb bytes with av_mallocz().
+ * @param nmemb Number of elements
+ * @param size Size of the single element
+ * @return Pointer to the allocated block, NULL if the block cannot
+ * be allocated.
+ * @see av_mallocz()
+ * @see av_malloc_array()
+ */
+av_alloc_size(1, 2) static inline void *av_mallocz_array(size_t nmemb, size_t 
size)
+{
+if (!size || nmemb >= INT_MAX / size)
+return NULL;
+return av_mallocz(nmemb * size);
+}
+
+/**
+ * Allocate a block of nmemb * size bytes with alignment suitable for all
+ * memory accesses (including vectors if available on the CPU) and
+ * zero all the bytes of the block.
+ * The allocation will fail if nmemb * size is greater than or equal
+ * to INT_MAX.
+ * @param nmemb
+ * @param size
+ * @return Pointer to the allocated block, NULL if it cannot be allocated.
+ */
+void *av_calloc(size_t nmemb, size_t size) av_malloc_attrib;
+
+/**
  * Allocate or reallocate a block of memory.
  * If ptr is NULL and size > 0, allocate a new block. If
  * size is zero, free the memory block pointed to by ptr.
@@ -119,16 +157,6 @@ void *av_realloc(void *ptr, size_t size) av_alloc_size(2);
 
 /**
  * Allocate or reallocate a block of memory.
- * This function does the same thing as av_realloc, except:
- * - It takes two arguments and checks the result of the multiplication for
- *   integer overflow.
- * - It frees the input block in case of failure, thus avoiding the memory
- *   leak with the classic "buf = realloc(buf); if (!buf) return -1;".
- */
-void *av_realloc_f(void *ptr, size_t nelem, size_t elsize);
-
-/**
- * Allocate or reallocate a block of memory.
  * If *ptr is NULL and size > 0, allocate a new block. If
  * size is zero, free the memory block pointed to by ptr.
  * @param   ptr Pointer to a pointer to a memory block already allocated
@@ -148,6 +176,16 @@ av_warn_unused_result
 int av_reallocp(void *ptr, size_t size);
 
 /**
+ * Allocate or reallocate a block of memory.
+ * This function does the same thing as av_realloc, except:
+ * - It takes two arguments and checks the result of the multiplication for
+ *   integer overflow.
+ * - It frees the input block in case of failure, thus avoiding the memory
+ *   leak with the classic "buf = realloc(buf); if (!buf) return -1;".
+ */
+void *av_realloc_f(void *ptr, size_t nelem, size_t elsize);
+
+/**
  * Allocate or reallocate an array.
  * If ptr is NULL and nmemb > 0, allocate a new block. If
  * nmemb is zero, free the memory block pointed to by ptr.
@@ -186,6 +224,42 @@ av_alloc_size(2, 3) void *av_realloc_array(void *ptr, 
size_t nmemb, size_t size)
 av_alloc_size(2, 3) int av_reallocp_array(void *ptr, size_t nmemb, size_t 
size);
 
 /**
+ * Reallocate the given block if it is not large enough, otherwise do nothing.
+ *
+ * @see av_realloc
+ */
+void *av_fast_realloc(void *ptr, unsigned int *size, size_t min_size);
+
+/**
+ * Allocate a buffer, reusing the given one if large enough.
+ *
+ * Contrary to av_fast_realloc the current buffer contents might not be
+ * preserved and on error the old buffer is freed, thus no special
+ * handling to avoid memleaks is necessary.
+ *
+ * @param ptr pointer to pointer to already allocated buffer, overwritten with 
pointer to new buffer
+ * @param size size of the buffer *ptr points to
+ * @param min_size minimum size of *ptr buffer after returning, *ptr will be 
NULL and
+ * *size 0 if an error occurred.
+ */
+void av_fast_malloc(void *ptr, unsigned int *size, size_t min_size);
+
+/**
+ * Allocate a buffer, reusing the given one if large enough.
+ *
+ * All newly allocated space is initially cleared
+ * Contrary to av_fast_realloc the current buffer contents might not be
+ * preserved and on error the old buffer is freed, thus no special
+ * handling to avoid memleaks is necessary.
+ *
+ * @param ptr pointer to pointer to already allocated buffer, overwritten with 
pointer to new buffer
+ * @param size size of the buffer 

[FFmpeg-devel] [PATCH 2/2] mem: Extend and edit Doxygen

2016-07-31 Thread Timothy Gu
---
 libavutil/mem.h | 539 ++--
 1 file changed, 406 insertions(+), 133 deletions(-)

diff --git a/libavutil/mem.h b/libavutil/mem.h
index 145ac91..675b11c 100644
--- a/libavutil/mem.h
+++ b/libavutil/mem.h
@@ -20,7 +20,8 @@
 
 /**
  * @file
- * memory handling functions
+ * @ingroup lavu_mem
+ * Memory handling functions
  */
 
 #ifndef AVUTIL_MEM_H
@@ -35,9 +36,58 @@
 
 /**
  * @addtogroup lavu_mem
+ * Utilities for manipulating memory.
+ *
+ * In modern processor architectures, misaligned memory sometimes incurs a
+ * performance penalty in execution. The x86 architecture, for example, has
+ * many vector instructions that will crash on misaligned memory. For a
+ * computing-intensive project like FFmpeg, using aligned memory is even more
+ * crucial for a high level of performance.
+ *
+ * However, there is not a universal C API for allocating and declaring aligned
+ * memory. Different operating systems, architectures, and compilers have very
+ * different defaults and behavior for memory alignment. Hence, this component
+ * of @ref libavutil is created to make dealing with memory consistently
+ * possible on all platforms.
+ *
+ * @{
+ *
+ * @defgroup lavu_mem_macros Alignment Macros
+ * Helper macros for declaring aligned variables.
  * @{
  */
 
+/**
+ * @def DECLARE_ALIGNED(n,t,v)
+ * Declare a variable that is aligned in the memory.
+ *
+ * @code{.c}
+ * DECLARE_ALIGNED(16, uint16_t, aligned_int) = 42;
+ * DECLARE_ALIGNED(32, uint8_t, aligned_array)[128];
+ *
+ * // The default-alignment equivalent would be
+ * uint16_t aligned_int = 42;
+ * uint8_t aligned_array[128];
+ * @endcode
+ *
+ * @param n Minimum alignment in bytes
+ * @param t Type of the variable (or array element)
+ * @param v Name of the variable
+ */
+
+/**
+ * @def DECLARE_ASM_CONST(n,t,v)
+ * Declare a static constant aligned variable appropriate for use in inline
+ * assembly code.
+ *
+ * @code{.c}
+ * DECLARE_ASM_CONST(16, uint64_t, pw_08) = UINT64_C(0x0008000800080008);
+ * @endcode
+ *
+ * @param n Minimum alignment in bytes
+ * @param t Type of the variable (or array element)
+ * @param v Name of the variable
+ */
 
 #if defined(__INTEL_COMPILER) && __INTEL_COMPILER < 1110 || defined(__SUNPRO_C)
 #define DECLARE_ALIGNED(n,t,v)  t __attribute__ ((aligned (n))) v
@@ -60,12 +110,47 @@
 #define DECLARE_ASM_CONST(n,t,v)static const t v
 #endif
 
+/**
+ * @}
+ */
+
+/**
+ * @defgroup lavu_mem_attrs Function Attributes
+ * Function attributes applicable to memory handling functions.
+ *
+ * These function attributes can help compilers emit more useful warnings, or
+ * generate better optimized code.
+ * @{
+ */
+
+/**
+ * @def av_malloc_attrib
+ * Function attribute denoting a malloc-like function.
+ *
+ * @see https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-g_t_0040code_007bmalloc_007d-function-attribute-3251;>Function
 attribute `malloc` in GCC's documentation
+ */
+
 #if AV_GCC_VERSION_AT_LEAST(3,1)
 #define av_malloc_attrib __attribute__((__malloc__))
 #else
 #define av_malloc_attrib
 #endif
 
+/**
+ * @def av_alloc_size(...)
+ * Function attribute used on a function that allocates memory, whose size is
+ * given by the specified parameter(s).
+ *
+ * @code{.c}
+ * void *av_malloc(size_t size) av_alloc_size(1);
+ * void *av_calloc(size_t nmemb, size_t size) av_alloc_size(1, 2);
+ * @endcode
+ *
+ * @param ... One or two parameter indexes, separated by a comma
+ *
+ * @see https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-g_t_0040code_007balloc_005fsize_007d-function-attribute-3220;>Function
 attribute `alloc_size` in GCC's documentation
+ */
+
 #if AV_GCC_VERSION_AT_LEAST(4,3)
 #define av_alloc_size(...) __attribute__((alloc_size(__VA_ARGS__)))
 #else
@@ -73,31 +158,51 @@
 #endif
 
 /**
- * Allocate a block of size bytes with alignment suitable for all
- * memory accesses (including vectors if available on the CPU).
- * @param size Size in bytes for the memory block to be allocated.
- * @return Pointer to the allocated block, NULL if the block cannot
- * be allocated.
+ * @}
+ */
+
+/**
+ * @defgroup lavu_mem_funcs Heap Management
+ * Functions responsible for allocating, freeing, and copying aligned memory.
+ *
+ * All memory allocation functions have a built-in upper limit of `INT_MAX`
+ * bytes. This may be changed with av_max_alloc(), although exercise extreme
+ * caution when doing so.
+ *
+ * @{
+ */
+
+/**
+ * Allocate a memory block with alignment suitable for all memory accesses
+ * (including vectors if available on the CPU).
+ *
+ * @param size Size in bytes for the memory block to be allocated
+ * @return Pointer to the allocated block, or `NULL` if the block cannot
+ * be allocated
  * @see av_mallocz()
  */
 void *av_malloc(size_t size) av_malloc_attrib av_alloc_size(1);
 
 /**
- * Allocate a block of size bytes with alignment suitable for all
- * memory accesses (including 

[FFmpeg-devel] [PATCH] x86/ttadsp: add ff_ttafilter_process_enc_{ssse3, sse4}

2016-07-31 Thread James Almer
Signed-off-by: James Almer 
---
 libavcodec/Makefile  |  2 +-
 libavcodec/ttadsp.c  | 41 -
 libavcodec/ttadsp.h  |  3 +++
 libavcodec/ttaenc.c  | 38 ++
 libavcodec/x86/Makefile  |  2 ++
 libavcodec/x86/ttadsp.asm| 24 
 libavcodec/x86/ttadsp_init.c | 25 +++--
 7 files changed, 83 insertions(+), 52 deletions(-)

diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index 33ac2b3..4355c13 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -552,7 +552,7 @@ OBJS-$(CONFIG_TRUESPEECH_DECODER)  += truespeech.o
 OBJS-$(CONFIG_TSCC_DECODER)+= tscc.o msrledec.o
 OBJS-$(CONFIG_TSCC2_DECODER)   += tscc2.o
 OBJS-$(CONFIG_TTA_DECODER) += tta.o ttadata.o ttadsp.o
-OBJS-$(CONFIG_TTA_ENCODER) += ttaenc.o ttadata.o
+OBJS-$(CONFIG_TTA_ENCODER) += ttaenc.o ttadata.o ttadsp.o
 OBJS-$(CONFIG_TWINVQ_DECODER)  += twinvqdec.o twinvq.o
 OBJS-$(CONFIG_TXD_DECODER) += txd.o
 OBJS-$(CONFIG_ULTI_DECODER)+= ulti.o
diff --git a/libavcodec/ttadsp.c b/libavcodec/ttadsp.c
index 30b7ab9..32a87b2 100644
--- a/libavcodec/ttadsp.c
+++ b/libavcodec/ttadsp.c
@@ -18,9 +18,10 @@
 
 #include "ttadsp.h"
 
-static void ttafilter_process_dec_c(int32_t *qm, int32_t *dx, int32_t *dl,
-int32_t *error, int32_t *in, int32_t shift,
-int32_t round) {
+static inline void ttafilter_process(int32_t *qm, int32_t *dx, int32_t *dl,
+ int32_t *error, int32_t *in, int32_t 
shift,
+ int32_t round, int enc)
+{
 if (*error < 0) {
 qm[0] -= dx[0]; qm[1] -= dx[1]; qm[2] -= dx[2]; qm[3] -= dx[3];
 qm[4] -= dx[4]; qm[5] -= dx[5]; qm[6] -= dx[6]; qm[7] -= dx[7];
@@ -40,17 +41,47 @@ static void ttafilter_process_dec_c(int32_t *qm, int32_t 
*dx, int32_t *dl,
 dx[6] = ((dl[6] >> 30) | 2) & ~1;
 dx[7] = ((dl[7] >> 30) | 4) & ~3;
 
-*error = *in;
-*in += (round >> shift);
+if (!enc) {
+*error = *in;
+*in += (round >> shift);
+}
 
 dl[4] = -dl[5]; dl[5] = -dl[6];
 dl[6] = *in - dl[7]; dl[7] = *in;
 dl[5] += dl[6]; dl[4] += dl[5];
+
+if (enc) {
+*in -= (round >> shift);
+*error = *in;
+}
+}
+
+#if CONFIG_TTA_DECODER
+static void ttafilter_process_dec_c(int32_t *qm, int32_t *dx, int32_t *dl,
+int32_t *error, int32_t *in, int32_t shift,
+int32_t round)
+{
+ttafilter_process(qm, dx, dl, error, in, shift, round, 0);
+}
+#endif
+
+#if CONFIG_TTA_ENCODER
+static void ttafilter_process_enc_c(int32_t *qm, int32_t *dx, int32_t *dl,
+int32_t *error, int32_t *in, int32_t shift,
+int32_t round)
+{
+ttafilter_process(qm, dx, dl, error, in, shift, round, 1);
 }
+#endif
 
 av_cold void ff_ttadsp_init(TTADSPContext *c)
 {
+#if CONFIG_TTA_DECODER
 c->ttafilter_process_dec = ttafilter_process_dec_c;
+#endif
+#if CONFIG_TTA_ENCODER
+c->ttafilter_process_enc = ttafilter_process_enc_c;
+#endif
 
 if (ARCH_X86)
 ff_ttadsp_init_x86(c);
diff --git a/libavcodec/ttadsp.h b/libavcodec/ttadsp.h
index 56930f1..df73998 100644
--- a/libavcodec/ttadsp.h
+++ b/libavcodec/ttadsp.h
@@ -26,6 +26,9 @@ typedef struct TTADSPContext {
 void (*ttafilter_process_dec)(int32_t *qm, int32_t *dx, int32_t *dl,
   int32_t *error, int32_t *in, int32_t shift,
   int32_t round);
+void (*ttafilter_process_enc)(int32_t *qm, int32_t *dx, int32_t *dl,
+  int32_t *error, int32_t *in, int32_t shift,
+  int32_t round);
 } TTADSPContext;
 
 void ff_ttadsp_init(TTADSPContext *c);
diff --git a/libavcodec/ttaenc.c b/libavcodec/ttaenc.c
index 2f1c8db..5ccf98b 100644
--- a/libavcodec/ttaenc.c
+++ b/libavcodec/ttaenc.c
@@ -20,6 +20,7 @@
 
 #define BITSTREAM_WRITER_LE
 #include "ttadata.h"
+#include "ttadsp.h"
 #include "avcodec.h"
 #include "put_bits.h"
 #include "internal.h"
@@ -29,6 +30,7 @@ typedef struct TTAEncContext {
 const AVCRC *crc_table;
 int bps;
 TTAChannel *ch_ctx;
+TTADSPContext dsp;
 } TTAEncContext;
 
 static av_cold int tta_encode_init(AVCodecContext *avctx)
@@ -57,38 +59,9 @@ static av_cold int tta_encode_init(AVCodecContext *avctx)
 if (!s->ch_ctx)
 return AVERROR(ENOMEM);
 
-return 0;
-}
-
-static inline void ttafilter_process(TTAFilter *c, int32_t *in)
-{
-register int32_t *dl = c->dl, *qm = c->qm, *dx = c->dx, sum = c->round;
-
-if (c->error < 0) {
-qm[0] -= dx[0]; qm[1] -= dx[1]; qm[2] -= dx[2]; qm[3] -= dx[3];
-qm[4] -= dx[4]; qm[5] -= dx[5]; qm[6] -= 

[FFmpeg-devel] [PATCH 2/2] avformat/teeproto: Support parsing protocol options

2016-07-31 Thread Michael Niedermayer
Signed-off-by: Michael Niedermayer 
---
 libavformat/Makefile   |2 +-
 libavformat/teeproto.c |   19 ++-
 2 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/libavformat/Makefile b/libavformat/Makefile
index 783b96a..ac0c2ca 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -568,7 +568,7 @@ OBJS-$(CONFIG_RTP_PROTOCOL)  += rtpproto.o
 OBJS-$(CONFIG_SCTP_PROTOCOL) += sctp.o
 OBJS-$(CONFIG_SRTP_PROTOCOL) += srtpproto.o srtp.o
 OBJS-$(CONFIG_SUBFILE_PROTOCOL)  += subfile.o
-OBJS-$(CONFIG_TEE_PROTOCOL)  += teeproto.o
+OBJS-$(CONFIG_TEE_PROTOCOL)  += teeproto.o tee_common.o
 OBJS-$(CONFIG_TCP_PROTOCOL)  += tcp.o
 OBJS-$(CONFIG_TLS_GNUTLS_PROTOCOL)   += tls_gnutls.o tls.o
 OBJS-$(CONFIG_TLS_OPENSSL_PROTOCOL)  += tls_openssl.o tls.o
diff --git a/libavformat/teeproto.c b/libavformat/teeproto.c
index 12d5423..e22fba2 100644
--- a/libavformat/teeproto.c
+++ b/libavformat/teeproto.c
@@ -23,6 +23,7 @@
 #include "libavutil/opt.h"
 #include "avformat.h"
 #include "avio_internal.h"
+#include "tee_common.h"
 
 typedef struct ChildContext {
 URLContext *url_context;
@@ -89,9 +90,11 @@ static int tee_open(URLContext *h, const char *filename, int 
flags)
 return AVERROR(ENOSYS);
 
 while (*filename) {
-char *child_name = av_get_token(, child_delim);
+char *child_string = av_get_token(, child_delim);
+char *child_name = NULL;
 void *tmp;
-if (!child_name) {
+AVDictionary *options = NULL;
+if (!child_string) {
 ret = AVERROR(ENOMEM);
 goto fail;
 }
@@ -99,16 +102,22 @@ static int tee_open(URLContext *h, const char *filename, 
int flags)
 tmp = av_realloc_array(c->child, c->child_count + 1, 
sizeof(*c->child));
 if (!tmp) {
 ret = AVERROR(ENOMEM);
-goto fail;
+goto loop_fail;
 }
 c->child = tmp;
 memset(>child[c->child_count], 0, sizeof(c->child[c->child_count]));
 
+ret = ff_tee_parse_slave_options(h, child_string, , 
_name);
+if (ret < 0)
+goto loop_fail;
+
 ret = ffurl_open_whitelist(>child[c->child_count].url_context, 
child_name, flags,
-   >interrupt_callback, /*AVDictionary 
**options*/NULL,
+   >interrupt_callback, ,
h->protocol_whitelist, 
h->protocol_blacklist,
h);
-av_free(child_name);
+loop_fail:
+av_freep(_string);
+av_dict_free();
 if (ret < 0)
 goto fail;
 c->child_count++;
-- 
1.7.9.5

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


[FFmpeg-devel] [PATCH 1/2] avformat/tee: Factor parse_slave_options() out

2016-07-31 Thread Michael Niedermayer
Signed-off-by: Michael Niedermayer 
---
 libavformat/Makefile |2 +-
 libavformat/tee.c|   44 ++
 libavformat/tee_common.c |   68 ++
 libavformat/tee_common.h |   31 +
 4 files changed, 102 insertions(+), 43 deletions(-)
 create mode 100644 libavformat/tee_common.c
 create mode 100644 libavformat/tee_common.h

diff --git a/libavformat/Makefile b/libavformat/Makefile
index 4966347..783b96a 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -463,7 +463,7 @@ OBJS-$(CONFIG_SWF_DEMUXER)   += swfdec.o swf.o
 OBJS-$(CONFIG_SWF_MUXER) += swfenc.o swf.o
 OBJS-$(CONFIG_TAK_DEMUXER)   += takdec.o apetag.o img2.o rawdec.o
 OBJS-$(CONFIG_TEDCAPTIONS_DEMUXER)   += tedcaptionsdec.o subtitles.o
-OBJS-$(CONFIG_TEE_MUXER) += tee.o
+OBJS-$(CONFIG_TEE_MUXER) += tee.o tee_common.o
 OBJS-$(CONFIG_THP_DEMUXER)   += thp.o
 OBJS-$(CONFIG_THREEDOSTR_DEMUXER)+= 3dostr.o
 OBJS-$(CONFIG_TIERTEXSEQ_DEMUXER)+= tiertexseq.o
diff --git a/libavformat/tee.c b/libavformat/tee.c
index b4158e1..5689ca3 100644
--- a/libavformat/tee.c
+++ b/libavformat/tee.c
@@ -26,6 +26,7 @@
 #include "internal.h"
 #include "avformat.h"
 #include "avio_internal.h"
+#include "tee_common.h"
 
 typedef enum {
 ON_SLAVE_FAILURE_ABORT  = 1,
@@ -54,9 +55,6 @@ typedef struct TeeContext {
 } TeeContext;
 
 static const char *const slave_delim = "|";
-static const char *const slave_opt_open  = "[";
-static const char *const slave_opt_close = "]";
-static const char *const slave_opt_delim = ":]"; /* must have the close too */
 static const char *const slave_bsfs_spec_sep = "/";
 static const char *const slave_select_sep = ",";
 
@@ -66,44 +64,6 @@ static const AVClass tee_muxer_class = {
 .version= LIBAVUTIL_VERSION_INT,
 };
 
-static int parse_slave_options(void *log, char *slave,
-   AVDictionary **options, char **filename)
-{
-const char *p;
-char *key, *val;
-int ret;
-
-if (!strspn(slave, slave_opt_open)) {
-*filename = slave;
-return 0;
-}
-p = slave + 1;
-if (strspn(p, slave_opt_close)) {
-*filename = (char *)p + 1;
-return 0;
-}
-while (1) {
-ret = av_opt_get_key_value(, "=", slave_opt_delim, 0, , );
-if (ret < 0) {
-av_log(log, AV_LOG_ERROR, "No option found near \"%s\"\n", p);
-goto fail;
-}
-ret = av_dict_set(options, key, val,
-  AV_DICT_DONT_STRDUP_KEY | AV_DICT_DONT_STRDUP_VAL);
-if (ret < 0)
-goto fail;
-if (strspn(p, slave_opt_close))
-break;
-p++;
-}
-*filename = (char *)p + 1;
-return 0;
-
-fail:
-av_dict_free(options);
-return ret;
-}
-
 /**
  * Parse list of bitstream filters and add them to the list of filters
  * pointed to by bsfs.
@@ -217,7 +177,7 @@ static int open_slave(AVFormatContext *avf, char *slave, 
TeeSlave *tee_slave)
 int fullret;
 char *subselect = NULL, *next_subselect = NULL, *first_subselect = NULL, 
*tmp_select = NULL;
 
-if ((ret = parse_slave_options(avf, slave, , )) < 0)
+if ((ret = ff_tee_parse_slave_options(avf, slave, , )) < 
0)
 return ret;
 
 #define STEAL_OPTION(option, field) do {\
diff --git a/libavformat/tee_common.c b/libavformat/tee_common.c
new file mode 100644
index 000..70c06d2
--- /dev/null
+++ b/libavformat/tee_common.c
@@ -0,0 +1,68 @@
+/*
+ * Tee common code
+ * Copyright (c) 2012 Nicolas George
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with FFmpeg; if not, write to the Free Software * Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "libavutil/avutil.h"
+#include "libavutil/avstring.h"
+#include "libavutil/opt.h"
+
+#include "tee_common.h"
+
+static const char *const slave_opt_open  = "[";
+static const char *const slave_opt_close = "]";
+static const char *const slave_opt_delim = ":]"; /* must have the close too */
+
+int ff_tee_parse_slave_options(void *log, char *slave,
+   AVDictionary **options, char **filename)
+{
+const char *p;
+char *key, *val;
+int ret;
+
+if 

[FFmpeg-devel] next Outreachy & GSoC ideas braindump [RFC]

2016-07-31 Thread Michael Niedermayer
Hi all

you have a great idea for a Outreachy task or a GSoC task ?
Or something you always wanted to do but never had the time and
it would fit in the time for GSoC/Outreachy ?
Or some feature you always wanted which would fit as a task?
Also keep in mind Outreachy is more flexible and not limited to
coding tasks !
reply and dump it here below:

thanks

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Many things microsoft did are stupid, but not doing something just because
microsoft did it is even more stupid. If everything ms did were stupid they
would be bankrupt already.


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


Re: [FFmpeg-devel] Outreachy 2016 december

2016-07-31 Thread Mayank Agarwal
Hi,

I want to contribute to Outreachy this time.It can be in any form be it
admin,testing,development,etc
I can easily devote 2,3 hrs per day for this task.It can be more also
depending on some task

Regards
Mayank

On Thu, Jul 7, 2016 at 2:55 AM, Michael Niedermayer 
wrote:

> Hi all
>
> The next Outreachy round starts soon
> FFmpeg has till august 22 IIUC (https://www.gnome.org/outreachy/)
> to express interrest to participate.
>
> We need an admin and backup admins.
> They need to create the wiki page(s) for this round, and make sure
> the pages are in shape by the time applicants start pouring in.
> make sure applicants questions (like "[FFmpeg-devel] need guidance")
> get awnsered
> recruite mentors,
> secure funding (as in confirming with the community and stefano that
> SPI/FFIS funding can be used for one slot or find another sponsor)
> contact the Outreachy admins and express that FFmpeg wants to
> participate, ...
> Reply to any questions the outreachy admins have
> Make sure that during the project nothing goes wrong like a mentor
> disappearing and if something goes wrong deal with it
>
>
> --
> Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> If you drop bombs on a foreign country and kill a hundred thousand
> innocent people, expect your government to call the consequence
> "unprovoked inhuman terrorist attacks" and use it to justify dropping
> more bombs and killing more people. The technology changed, the idea is
> old.
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] Change bitrate on-the-fly

2016-07-31 Thread Llorx
Hi,

About 1 or 2 years ago I had written an addition for ffmpeg to change the
video bitrate while ffmpeg is running. The way I've done it is by listening
to a UDP socket for an int32, and each time a 4 byte packet enters, changes
the bitrate, taking effect instantly. Works like a charm, and the UDP way
fits my needings without problems. I needed it because currently I have a
business that requires streaming video in some difficult and
bandwith-changing environments, so I have a thrid party program than
launchs ffmpeg and analyzes the packets sent to detect bandwidth
alterations, changing the bitrate accordingly.

Now I would like to share it with the community, as I had some messages
from some users telling me to release it (As I posted a question about this
on Stack Overflow).

I know that the UDP thing is a bit hackish, so I would like to ask you,
ffmpeg masters, how do you consider that this can be applied in a more
"professional" way. I thought that instead of listening to a UDP socket
(configurable at launch time with a parameter), I can use named pipes,
memory mapped files or simply process signaling. The last method is only
available on Unix with SA_SIGINFO. Windows can't handle such signal
behaviour.

What do you think is the best option?
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] libavformat/matroskadec: Add test for seeking with codec delay.

2016-07-31 Thread Chris Cunningham
Thanks Michael. Do you mean to also apply the patch to add the test? Maybe
you're waiting for further review.

On Thu, Jul 28, 2016 at 9:48 AM, Michael Niedermayer  wrote:

> On Wed, Jul 27, 2016 at 06:35:50PM -0700, Chris Cunningham wrote:
> > The file to upload to fate-suite can be found here:
> >
> https://storage.googleapis.com/chcunningham-chrome-shared/codec_delay_opus.mkv
>
> uploaded
>
> thx
>
> [...]
> --
> Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> Those who are best at talking, realize last or never when they are wrong.
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] libavcodec/mmaldec.c: add interlaced_frame and format struct to AVFrame for deinterlacing]

2016-07-31 Thread Mark Thompson
On 31/07/16 18:09, Jens Ziller wrote:
> Am Sonntag, den 31.07.2016, 16:33 +0100 schrieb Mark Thompson:
>> Try the test stream h264/reinit-large_420_8-to-small_420_8.h264 in
>> FATE?
> I don't test it. I tested with MPEG2 and H264 DVB-S streams. Where can
> I find this test stream?


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


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

2016-07-31 Thread James Almer
On 7/31/2016 1:36 PM, Nicolas George wrote:
> Le quartidi 14 thermidor, an CCXXIV, James Almer a écrit :
>> Signed-off-by: James Almer 
>> ---
>>  Changelog   |   1 +
>>  doc/general.texi|   2 +-
>>  libavformat/Makefile|   1 +
>>  libavformat/allformats.c|   2 +-
> 
>>  libavformat/avio_internal.h |   2 +
>>  libavformat/aviobuf.c   |   6 ++
> 
> Maybe put that part in a separate first patch?

Sure, done locally.

> 
> 
>> +unsigned long ff_crcEDB88320_update(unsigned long checksum, const uint8_t 
>> *buf,
>> +unsigned int len);
> 
> I know the surrounding code is already using it, but long is absolutely not
> the correct type here.

AVIOContext is public API. I can't change the update_checksum function
pointer and checksum field to use for example uint32_t just like that.
If anything not until the next major bump, for ABI reasons.

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

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


Re: [FFmpeg-devel] [PATCH] avformat/matroskadec: return AVERROR(EIO) rather than AVERROR_EOF on parse error

2016-07-31 Thread Nicolas George
Le quartidi 14 thermidor, an CCXXIV, Sophia Wang a écrit :
> Since matroska->done is only set to 1 in matroska_resync(), the choice
> of error is made by checking the return value of matroska_resync()
> rather than checking matroska->done directly on the next
> while-iteration.

This is not what your code do:

> +if (matroska_resync(matroska, pos) < 0)
> +return avio_feof(s->pb) ? AVERROR_EOF : AVERROR(EIO);

It checks the return value of matroska_resync() and then invents a
completely unrelated error code.

What it should do is use the error code from matroska_resync(). As simple as
that.

Regards,

-- 
  Nicolas George


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


Re: [FFmpeg-devel] [PATCH] libavcodec/mmaldec.c: add interlaced_frame and format struct to AVFrame for deinterlacing]

2016-07-31 Thread Jens Ziller
Am Sonntag, den 31.07.2016, 16:33 +0100 schrieb Mark Thompson:
> On 31/07/16 15:51, Jens Ziller wrote:
> > 
> > Am Samstag, den 30.07.2016, 17:30 +0100 schrieb Mark Thompson:
> > > 
> > > Does this also do the right thing if the decoder is reconfigured
> > > with
> > > frames outstanding?  To me (without really knowing the code) it
> > > looks
> > > like it will overwrite the old format (line 702) and therefore
> > > mess
> > > with existing frames, though there are multiple levels of
> > > indirection
> > > so the frame could be holding onto a reference by some route I'm
> > > not
> > > seeing.
> > MMAL_EVENT_FORMAT_CHANGED is set before the first decoded frame
> > give
> > out. I have never seen that this flag is set twice between
> > start/stop
> > decoder.
> Try the test stream h264/reinit-large_420_8-to-small_420_8.h264 in
> FATE?
I don't test it. I tested with MPEG2 and H264 DVB-S streams. Where can
I find this test stream?
> 
> > 
> > > 
> > > Similarly for stopping the decoder - there may be output frames
> > > which
> > > are still valid, and it looks to me like the format structure
> > > will
> > > have disappeared.  (Is there some internal reference via the
> > > MMAL_BUFFER_HEADER_T which solves both of these cases, maybe?  If
> > > so,
> > > it might be clearer if you could use that internal reference to
> > > set
> > > the value rather than going via the decoder.)
> > The struct MMAL_ES_FORMAT_T will copied in the MMAL_PORT_T struct
> > to
> > configure the component. There it lives until the application
> > change
> > anything.
> Hmm, that's not quite what I meant to ask; apologies because the
> question wasn't very clear.
Sorry, english is not my mother language.
> 
> Consider this sequence, where we want to decode a single image and
> then do something with it:
> 
> open decoder
> decode frame
> close decoder
> open 
> give it the frame we got from the decoder
> 
> To me that looks like it will invoke undefined behaviour (segfault or
> read garbage) when trying to access data[2] in the second component,
> because the pointer appears to be to the MMAL_ES_FORMAT_T in the
> MMAL_PORT_T on the decoder which we just destroyed.  If not, where is
> the reference which keeps that pointer valid living?

With MMAL decoder it works:

- configure decoder
- send many frames (in my tests between 5 and 20+) to decoder
- decoder give MMAL_ES_FORMAT_T
- configure decoder output port with given struct <- here we have the
pointer
- decoder send the first decoded frame

The struct lives before the first frame is available. Decode a single
frame is a spezial thing. The MMAL decoder is not made for this. A
local copy from format struct make no sense for me.

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


Re: [FFmpeg-devel] [PATCH] mem: Make function attribute usage consistent

2016-07-31 Thread Timothy Gu
On Sun, Jul 31, 2016 at 4:56 AM Michael Niedermayer 
wrote:

> On Sat, Jul 30, 2016 at 07:13:06PM -0700, Timothy Gu wrote:
> > ---
> >  libavutil/mem.h | 47 +--
> >  1 file changed, 37 insertions(+), 10 deletions(-)
>
> causes
> make fate-lossless-shorten
> to Abort
>

Patch dropped. This might be a GCC issue since I cannot reproduce it on gcc
(Debian 4.9.2-10) 4.9.2.

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


Re: [FFmpeg-devel] [PATCH] avformat/matroskaenc: fix Voids with size < 10

2016-07-31 Thread Michael Niedermayer
On Tue, Jul 26, 2016 at 10:31:29AM -0700, Michael Bradshaw wrote:
> Hi,
> 
> Attached patch fixes the MKV muxer when trying to write Void elements that
> have a size < 10. The current code subtracts 1 from the size, which
> accounts for the element ID byte, but it doesn't account for the additional
> size byte. This causes the Void element to take up 1 more byte than
> intended, which will corrupt the file.
> 
> A simple example to reproduce the issue:
> 
> $ ffmpeg -f lavfi -i testsrc -vframes 1 -reserve_index_space 38 test.webm
> $ mkvinfo test.webm
> [...]
> test.webm: Error in the Matroska file structure at position 479. Resyncing
> to the next level 1 element.
> Resync failed: no valid Matroska level 1 element found.

>  matroskaenc.c |2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 9c3f19e3c98788b5a9a8dda53a981c6bbe73b80a  
> 0001-avformat-matroskaenc-fix-Voids-with-size-10.patch
> From d72405b05feabdf51284588c2734cf97dc66ae8a Mon Sep 17 00:00:00 2001
> From: Michael Bradshaw 
> Date: Tue, 26 Jul 2016 10:18:43 -0700
> Subject: [PATCH] avformat/matroskaenc: fix Voids with size < 10

applied

if you want to create a fate test for this, that is welcome

thx

[...]

-- 
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


[FFmpeg-devel] [PATCH] MAINTAINERS: Add myself for af_hdcd

2016-07-31 Thread Burt P
Signed-off-by: Burt P 
---
 MAINTAINERS | 1 +
 1 file changed, 1 insertion(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 6d4c9f9..932e6fb 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -308,6 +308,7 @@ Filters:
   af_chorus.c   Paul B Mahol
   af_compand.c  Paul B Mahol
   af_firequalizer.c Muhammad Faiz
+  af_hdcd.c Burt P.
   af_ladspa.c   Paul B Mahol
   af_loudnorm.c Kyle Swanson
   af_pan.c  Nicolas George
-- 
2.7.4

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


Re: [FFmpeg-devel] [PATCH] libavcodec/mmaldec.c: add interlaced_frame and format struct to AVFrame for deinterlacing]

2016-07-31 Thread Mark Thompson
On 31/07/16 15:51, Jens Ziller wrote:
> Am Samstag, den 30.07.2016, 17:30 +0100 schrieb Mark Thompson:
>> Does this also do the right thing if the decoder is reconfigured with
>> frames outstanding?  To me (without really knowing the code) it looks
>> like it will overwrite the old format (line 702) and therefore mess
>> with existing frames, though there are multiple levels of indirection
>> so the frame could be holding onto a reference by some route I'm not
>> seeing.
> MMAL_EVENT_FORMAT_CHANGED is set before the first decoded frame give
> out. I have never seen that this flag is set twice between start/stop
> decoder.

Try the test stream h264/reinit-large_420_8-to-small_420_8.h264 in FATE?

>> Similarly for stopping the decoder - there may be output frames which
>> are still valid, and it looks to me like the format structure will
>> have disappeared.  (Is there some internal reference via the
>> MMAL_BUFFER_HEADER_T which solves both of these cases, maybe?  If so,
>> it might be clearer if you could use that internal reference to set
>> the value rather than going via the decoder.)
> The struct MMAL_ES_FORMAT_T will copied in the MMAL_PORT_T struct to
> configure the component. There it lives until the application change
> anything.

Hmm, that's not quite what I meant to ask; apologies because the question 
wasn't very clear.

Consider this sequence, where we want to decode a single image and then do 
something with it:

open decoder
decode frame
close decoder
open 
give it the frame we got from the decoder

To me that looks like it will invoke undefined behaviour (segfault or read 
garbage) when trying to access data[2] in the second component, because the 
pointer appears to be to the MMAL_ES_FORMAT_T in the MMAL_PORT_T on the decoder 
which we just destroyed.  If not, where is the reference which keeps that 
pointer valid living?

>> Also, will this structure always be available with sufficient
>> lifetime for MMAL frames produced by things other than the
>> decoder?  Your documentation on the pixfmt is phrased such that it is
>> always required - given that it appears to be for a specific use-
>> case, maybe it would be better if it were optional.
> Pixelformat AV_PIX_FMT_MMAL is a MMAL specific format. It makes only
> sense to use it with MMAL components. All MMAL components needs a
> MMAL_ES_FORMAT_T. The MMAL documented and easiest way is to copy the
> struct from decoder to the components.

Right, that makes sense.  Thank you for clarifying :)

- Mark

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


Re: [FFmpeg-devel] [PATCH] libavcodec/mmaldec.c: add interlaced_frame and format struct to AVFrame for deinterlacing]

2016-07-31 Thread Jens Ziller
Am Samstag, den 30.07.2016, 17:30 +0100 schrieb Mark Thompson:
> On 30/07/16 15:50, Jens Ziller wrote:
> > 
> > Am Samstag, den 16.07.2016, 17:27 +0200 schrieb Jens Ziller:
> > > 
> > > Hello Rodger and wm4,
> > > 
> > > for interlaced frames I need AVFrame->interlaced_frame. For
> > > invoke
> > > MMAL
> > > components like deinterlacer and renderer added a pointer data[2]
> > > to
> > > existing MMAL_ES_FORMAT_T. I don't have find a better solution to
> > > give
> > > a pointer to user app. I have added a patch as suggestion. Please
> > > help 
> > > me that I can release my code.
> > > 
> > > regards Jens
> > > 
> > > 
> > >  Weitergeleitete Nachricht 
> > > Von: Michael Niedermayer 
> > > Reply-to: FFmpeg development discussions and patches  > > de...@ffmpeg.org>
> > > An: FFmpeg development discussions and patches  > > eg.o
> > > rg
> > > > 
> > > > 
> > > > 
> > > Betreff: Re: [FFmpeg-devel] [PATCH] libavcodec/mmaldec.c: add
> > > interlaced_frame and format struct to AVFrame for deinterlacing
> > > Datum: Sat, 16 Jul 2016 14:41:50 +0200
> > > 
> > > On Sat, Jul 16, 2016 at 11:08:12AM +0200, Jens Ziller wrote:
> > > > 
> > > > 
> > > > 
> > > > Am Sonntag, den 03.07.2016, 19:36 +0200 schrieb Jens Ziller:
> > > > > 
> > > > > 
> > > > > 
> > > > > Am Sonntag, den 03.07.2016, 18:05 +0200 schrieb Moritz
> > > > > Barsnick:
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > 
> > > > > > On Sun, Jul 03, 2016 at 17:20:41 +0200, Jens Ziller wrote:
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > Am Samstag, den 02.07.2016, 17:54 +0200 schrieb Moritz
> > > > > > > Barsnick:
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > On Sun, Jun 26, 2016 at 17:12:14 +0200, Jens Ziller
> > > > > > > > wrote:
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > +ctx->interlaced_frame =
> > > > > > > > > !(interlace_type.eMode
> > > > > > > > > ==
> > > > > > > > > MMAL_InterlaceProgressive);
> > > > > > > > What's wrong with using the "!=" operator instead?
> > > > > > > "!=" is a comparing. "= !()" assign with a negate. Here
> > > > > > > is "=
> > > > > > > !()"
> > > > > > > needed.
> > > > > > I meant the comparison, not the assignment, so replacing:
> > > > > >   ctx->interlaced_frame = !(interlace_type.eMode ==
> > > > > > MMAL_InterlaceProgressive)
> > > > > > with
> > > > > >   ctx->interlaced_frame = (interlace_type.eMode !=
> > > > > > MMAL_InterlaceProgressive)
> > > > > > 
> > > > > > The former is rather ... convoluted.
> > > > > > (Brackets optional, but probably better for readability.)
> > > > > > 
> > > > > > Moritz
> > > > > Oh, sorry! I'am so blind. Yes, that's not really smart. I
> > > > > changed
> > > > > that.
> > > > > The new patch is attached.
> > > > > 
> > > > > Regards Jens
> > > > > 
> > > > Hello Michael and list,
> > > > 
> > > > this patch was discussed and improved on the ML. What can I
> > > > still
> > > > do
> > > > that my app get interlaced_frame and a pointer to the existing
> > > > 
> > > > MMAL_ES_FORMAT_T from ffmpeg? mmaldec.c have unfortunately no
> > > > maintainer.
> > > But it has authors,
> > > you can ask rodger combs and wm4
> > > 
> > > If they do not reply then please explain why you need this
> > > structure
> > > in data[2]
> > > Also what is the lifetime of this structure and what is the
> > > liftime
> > > of the AVFrame that contains it. Its neccessary that the struct
> > > stays
> > > valid as long as the AVFrame could be
> > > 
> > > [...]
> > > 
> > Hello Michael,
> > 
> > I have ask rodger combs and wm4 two weeks ago, but unfortunately no
> > reply. Please integrate the attached patch.
> > 
> > MMAL_ES_FORMAT_T is needed for invoke the MMAL deinterlacer and
> > renderer in an application.
> > 
> > This struct give the decoder before the first frame gives out.
> > In mmaldec.c line 689 ask the flag MMAL_EVENT_FORMAT_CHANGED and if
> > this flag is set MMAL_ES_FORMAT_T is filled. This struct was
> > cleaned if
> > the decoder was stopped in mmaldec.c line 150. There are no
> > lifetime
> > issue.
> Does this also do the right thing if the decoder is reconfigured with
> frames outstanding?  To me (without really knowing the code) it looks
> like it will overwrite the old format (line 702) and therefore mess
> with existing frames, though there are multiple levels of indirection
> so the frame could be holding onto a reference by some route I'm not
> seeing.
MMAL_EVENT_FORMAT_CHANGED is set before the first decoded frame give
out. I have never seen that this flag is set twice between start/stop
decoder.

> 
> Similarly for stopping the decoder - there may be output frames which
> are still valid, and it looks to me like the format structure will
> have disappeared.  (Is there some internal reference via the
> MMAL_BUFFER_HEADER_T 

Re: [FFmpeg-devel] [PATCH 1/2] build: Make API documentation depend on config.mak

2016-07-31 Thread Michael Niedermayer
On Fri, Jul 29, 2016 at 10:30:37PM -0700, Timothy Gu wrote:
> The Doxygen command is generated from the list of installed headers,
> which may change per configuration (e.g. `--enable-gpl` results in
> libpostproc to be built and installed).
> ---
>  doc/Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

LGTM but please wait with applying so others who know the build
system better have a chance to look at this

thx

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

No human being will ever know the Truth, for even if they happen to say it
by chance, they would not even known they had done so. -- Xenophanes


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


Re: [FFmpeg-devel] [PATCH 2/7] af_hdcd: give cdt expired counter a value for never set

2016-07-31 Thread Michael Niedermayer
On Fri, Jul 29, 2016 at 12:36:17PM -0500, Burt P wrote:
> The counter is now -1 if the code detect timer was never set,
> and 0 if it was set but never expired.
> 
> Signed-off-by: Burt P 
> ---
>  libavfilter/af_hdcd.c | 17 ++---
>  1 file changed, 14 insertions(+), 3 deletions(-)

applied

thx

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

Let us carefully observe those good qualities wherein our enemies excel us
and endeavor to excel them, by avoiding what is faulty, and imitating what
is excellent in them. -- Plutarch


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/7] af_hdcd: fix a minor annoyance

2016-07-31 Thread Michael Niedermayer
On Fri, Jul 29, 2016 at 12:36:16PM -0500, Burt P wrote:
> Signed-off-by: Burt P 
> ---
>  libavfilter/af_hdcd.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

applied

thanks

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

Rewriting code that is poorly written but fully understood is good.
Rewriting code that one doesnt understand is a sign that one is less smart
then the original author, trying to rewrite it will not make it better.


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


Re: [FFmpeg-devel] [PATCH 0/1] af_hdcd: Process stereo channels together, fix #5727

2016-07-31 Thread Michael Niedermayer
On Thu, Jul 28, 2016 at 12:18:01AM -0500, Burt P. wrote:
> > My suggestion is that you send your public key to
> > Michael and commit yourself including adding yourself
> > as maintainer of hdcd.
> 
> I don't know enough about what that would mean. I'm also not
> an expert user of git.

you can be maintainer and leave pushing to someone else if you feel
that you dont know git well enough.

What a maintainer does is "maintain" the code. Like if some other
developer sends a patch, the maintainer should try to review it when
he has time, if theres a bug the maintainer, author, commiter,
reviewer (that is the maintainer and anyone who bears responsibility
for introducing the bug) should try to fix it when they have time,
The maintainer should also get reviewed patched pushed, either
by pushing or pestering someone else to push

you seem the most active and interrested developer for hdcd, so it
would make sense for you to be the maintainer of hdcd

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

Concerning the gods, I have no means of knowing whether they exist or not
or of what sort they may be, because of the obscurity of the subject, and
the brevity of human life -- Protagoras


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


Re: [FFmpeg-devel] [PATCH] mem: Make function attribute usage consistent

2016-07-31 Thread Michael Niedermayer
On Sat, Jul 30, 2016 at 07:13:06PM -0700, Timothy Gu wrote:
> ---
>  libavutil/mem.h | 47 +--
>  1 file changed, 37 insertions(+), 10 deletions(-)

causes
make fate-lossless-shorten
to Abort
--- ./tests/ref/fate/lossless-shorten   2016-07-28 11:52:04.762208148 +0200
+++ tests/data/fate/lossless-shorten2016-07-31 13:51:12.999819376 +0200
@@ -1 +0,0 @@
-da93c50961443b88fce416ae61c8ca8a
Test lossless-shorten failed. Look at tests/data/fate/lossless-shorten.err for 
details.
make: *** [fate-lossless-shorten] Error 134

can you reproduce or should i look into this more ?


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

The real ebay dictionary, page 2
"100% positive feedback" - "All either got their money back or didnt complain"
"Best seller ever, very honest" - "Seller refunded buyer after failed scam"


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


[FFmpeg-devel] patchwork

2016-07-31 Thread Michael Niedermayer
Hi all

raz has setup
https://patchwork.ffmpeg.org
feel free to register and use as you like
if you dont like it you can ignore it, which is the beauty of
patchwork, noone needs to use it.

I think though this has the potential to help us and me to keep track
of patches a bit better than with a MUA

if you have any suggestions for improvment, see any issues or bugs in
it please report!

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

While the State exists there can be no freedom; when there is freedom there
will be no State. -- Vladimir Lenin


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