Re: [FFmpeg-devel] [PATCH 4/7] avformat/hlsenc: do not regenerate the playlist for each segment

2014-07-30 Thread Nicolas Martyanoff
On 2014-07-29 15:59, Michael Niedermayer wrote:
 On Fri, Jul 18, 2014 at 10:57:44AM +0200, Nicolas Martyanoff wrote:
  Since we need all segments to find out the target duration, we can only
  generate the playlist after writing all segments.
  
  There is no need to rewrite the segment list every time we create a new
  segment file.
 
 doesnt this break playing back hls while its still written ?

I believe you are right, I did not thing about the case where a client is
reading the playlist while it is being written.

However I am not sure about the way avio_* functions work. Depending on the
way buffering is done, how does one guarantee that at a time T, the playlist
is a valid HLS playlist ?

The hlsenc muxer uses avio_open2(), a bunch of avio_printf() then
avio_closep(). I have no idea whether a part of the file is readable by other
processed before the call to avio_closep().


-- 
Nicolas Martyanoff
http://wandrian.net
khae...@gmail.com
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 2/4] lavfi/buffersrc: add add av_buffersrc_close().

2014-07-30 Thread Nicolas George
Le duodi 12 thermidor, an CCXXII, wm4 a écrit :
The libavfilter API
 for EOF is ok,

No, it is not.

   So if you're not actually fixing anything

I am.

 What wrong result?

See my first answer when you started this bikeshedding.

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] ffmpeg_filter: refuse to configure input without a decoder.

2014-07-30 Thread Carl Eugen Hoyos
Michael Niedermayer michaelni at gmx.at writes:

 LGTM

Ping.

Please add a comment about ticket #3779 to the commit message.

Carl Eugen

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


[FFmpeg-devel] [PATCH] ffprobe: print some basic information about avframe side data

2014-07-30 Thread Michael Niedermayer
Signed-off-by: Michael Niedermayer michae...@gmx.at
---
 doc/ffprobe.xsd |   11 +++
 ffprobe.c   |   21 -
 2 files changed, 31 insertions(+), 1 deletion(-)

diff --git a/doc/ffprobe.xsd b/doc/ffprobe.xsd
index 9ef9ecb..e0e9179 100644
--- a/doc/ffprobe.xsd
+++ b/doc/ffprobe.xsd
@@ -55,6 +55,7 @@
 xsd:complexType name=frameType
   xsd:sequence
 xsd:element name=tag type=ffprobe:tagType minOccurs=0 
maxOccurs=unbounded/
+xsd:element name=sidedata_list 
type=ffprobe:frameSideDataListType   minOccurs=0 maxOccurs=1 /
   /xsd:sequence
 
   xsd:attribute name=media_typetype=xsd:string use=required/
@@ -91,6 +92,16 @@
   xsd:attribute name=repeat_picttype=xsd:int   /
 /xsd:complexType
 
+xsd:complexType name=frameSideDataListType
+xsd:sequence
+xsd:element name=sidedata type=ffprobe:frameSideDataType 
minOccurs=1 maxOccurs=unbounded/
+/xsd:sequence
+/xsd:complexType
+xsd:complexType name=frameSideDataType
+xsd:attribute name=side_data_type  type=xsd:string/
+xsd:attribute name=side_data_size  type=xsd:int   /
+/xsd:complexType
+
 xsd:complexType name=subtitleType
   xsd:attribute name=media_type type=xsd:string 
fixed=subtitle use=required/
   xsd:attribute name=ptstype=xsd:long /
diff --git a/ffprobe.c b/ffprobe.c
index 1329466..c9fc79d 100644
--- a/ffprobe.c
+++ b/ffprobe.c
@@ -123,6 +123,8 @@ typedef enum {
 SECTION_ID_FRAME,
 SECTION_ID_FRAMES,
 SECTION_ID_FRAME_TAGS,
+SECTION_ID_FRAME_SIDEDATA_LIST,
+SECTION_ID_FRAME_SIDEDATA,
 SECTION_ID_LIBRARY_VERSION,
 SECTION_ID_LIBRARY_VERSIONS,
 SECTION_ID_PACKET,
@@ -152,8 +154,10 @@ static struct section sections[] = {
 [SECTION_ID_FORMAT] = { SECTION_ID_FORMAT, format, 0, { 
SECTION_ID_FORMAT_TAGS, -1 } },
 [SECTION_ID_FORMAT_TAGS] ={ SECTION_ID_FORMAT_TAGS, tags, 
SECTION_FLAG_HAS_VARIABLE_FIELDS, { -1 }, .element_name = tag, .unique_name = 
format_tags },
 [SECTION_ID_FRAMES] = { SECTION_ID_FRAMES, frames, 
SECTION_FLAG_IS_ARRAY, { SECTION_ID_FRAME, SECTION_ID_SUBTITLE, -1 } },
-[SECTION_ID_FRAME] =  { SECTION_ID_FRAME, frame, 0, { 
SECTION_ID_FRAME_TAGS, -1 } },
+[SECTION_ID_FRAME] =  { SECTION_ID_FRAME, frame, 0, { 
SECTION_ID_FRAME_TAGS, SECTION_ID_FRAME_SIDEDATA_LIST, -1 } },
 [SECTION_ID_FRAME_TAGS] = { SECTION_ID_FRAME_TAGS, tags, 
SECTION_FLAG_HAS_VARIABLE_FIELDS, { -1 }, .element_name = tag, .unique_name = 
frame_tags },
+[SECTION_ID_FRAME_SIDEDATA_LIST] ={ SECTION_ID_FRAME_SIDEDATA_LIST, 
sidedata_list, SECTION_FLAG_IS_ARRAY, { SECTION_ID_FRAME_SIDEDATA, -1 } },
+[SECTION_ID_FRAME_SIDEDATA] = { SECTION_ID_FRAME_SIDEDATA, sidedata, 
0, { -1 } },
 [SECTION_ID_LIBRARY_VERSIONS] =   { SECTION_ID_LIBRARY_VERSIONS, 
library_versions, SECTION_FLAG_IS_ARRAY, { SECTION_ID_LIBRARY_VERSION, -1 } },
 [SECTION_ID_LIBRARY_VERSION] ={ SECTION_ID_LIBRARY_VERSION, 
library_version, 0, { -1 } },
 [SECTION_ID_PACKETS] ={ SECTION_ID_PACKETS, packets, 
SECTION_FLAG_IS_ARRAY, { SECTION_ID_PACKET, -1} },
@@ -1722,6 +1726,7 @@ static void show_frame(WriterContext *w, AVFrame *frame, 
AVStream *stream,
 {
 AVBPrint pbuf;
 const char *s;
+int i;
 
 av_bprint_init(pbuf, 1, AV_BPRINT_SIZE_UNLIMITED);
 
@@ -1784,6 +1789,20 @@ static void show_frame(WriterContext *w, AVFrame *frame, 
AVStream *stream,
 }
 if (do_show_frame_tags)
 show_tags(w, av_frame_get_metadata(frame), SECTION_ID_FRAME_TAGS);
+if (frame-nb_side_data) {
+writer_print_section_header(w, SECTION_ID_FRAME_SIDEDATA_LIST);
+for (i = 0; i  frame-nb_side_data; i++) {
+AVFrameSideData *sd = frame-side_data[i];
+const char *name;
+
+writer_print_section_header(w, SECTION_ID_FRAME_SIDEDATA);
+name = av_frame_side_data_name(sd-type);
+print_str(side_data_type, name ? name : unknown);
+print_int(side_data_size, sd-size);
+writer_print_section_footer(w);
+}
+writer_print_section_footer(w);
+}
 
 writer_print_section_footer(w);
 
-- 
1.7.9.5

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


[FFmpeg-devel] [PATCH] x86: hevc: adding transform_add

2014-07-30 Thread Pierre Edouard Lepere
Hi,

Here's a patch adding ASM transform_add functions for HEVC.

Regards,
Pierre-Edouard Leperecommit 1db36e2f5bae3a34d1a5db4520234b52afb51bbb
Author: plepere pierre-edouard.lep...@insa-rennes.fr
Date:   Wed Jul 30 10:31:49 2014 +0200

adding ASM transform_add functions for HEVC

diff --git a/libavcodec/x86/Makefile b/libavcodec/x86/Makefile
index 7469293..658ad5e 100644
--- a/libavcodec/x86/Makefile
+++ b/libavcodec/x86/Makefile
@@ -117,7 +117,8 @@ YASM-OBJS-$(CONFIG_AAC_DECODER)+= x86/sbrdsp.o
 YASM-OBJS-$(CONFIG_DCA_DECODER)+= x86/dcadsp.o
 YASM-OBJS-$(CONFIG_HEVC_DECODER)   += x86/hevc_mc.o \
   x86/hevc_deblock.o\
-  x86/hevc_idct.o
+  x86/hevc_idct.o   \
+  x86/hevc_res_add.o
 YASM-OBJS-$(CONFIG_PNG_DECODER)+= x86/pngdsp.o
 YASM-OBJS-$(CONFIG_PRORES_DECODER) += x86/proresdsp.o
 YASM-OBJS-$(CONFIG_PRORES_LGPL_DECODER) += x86/proresdsp.o
diff --git a/libavcodec/x86/hevc_res_add.asm b/libavcodec/x86/hevc_res_add.asm
new file mode 100644
index 000..bc550ef
--- /dev/null
+++ b/libavcodec/x86/hevc_res_add.asm
@@ -0,0 +1,454 @@
+; /*
+; * Provide intrinsics for transform_add functions for HEVC decoding
+; * Copyright (c) 2014 Pierre-Edouard LEPERE
+; *
+; * 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/x86/x86util.asm
+
+SECTION_RODATA
+max_pixels_10:  times 16  dw ((1  10)-1)
+tr_add_10:  times 4 dd ((1  14-10) + 1)
+
+
+SECTION .text
+
+;the tr_add macros and functions were largely inspired by x264 project's code in the h264_idct.asm file
+%macro TR_ADD_INIT_MMX 2
+mova  m2, [r1]
+mova  m4, [r1+8]
+pxor  m3, m3
+psubw m3, m2
+packuswb  m2, m2
+packuswb  m3, m3
+pxor  m5, m5
+psubw m5, m4
+packuswb  m4, m4
+packuswb  m5, m5
+%endmacro
+
+%macro TR_ADD_OP_MMX 4
+%1m0, [%2 ]
+%1m1, [%2+%3  ]
+paddusb   m0, m2
+paddusb   m1, m4
+psubusb   m0, m3
+psubusb   m1, m5
+%1 [%2 ], m0
+%1 [%2+%3  ], m1
+%endmacro
+
+%macro TR_ADD_INIT_SSE_8 2
+movu  m4, [r1]
+movu  m6, [r1+16]
+movu  m8, [r1+32]
+movu m10, [r1+48]
+lea   %1, [%2*3]
+pxor  m5, m5
+psubw m5, m4
+packuswb  m4, m4
+packuswb  m5, m5
+pxor  m7, m7
+psubw m7, m6
+packuswb  m6, m6
+packuswb  m7, m7
+pxor  m9, m9
+psubw m9, m8
+packuswb  m8, m8
+packuswb  m9, m9
+pxor m11, m11
+psubwm11, m10
+packuswb m10, m10
+packuswb m11, m11
+%endmacro
+
+%macro TR_ADD_INIT_SSE_16 2
+lea   %1, [%2*3]
+movu  m4, [r1]
+movu  m6, [r1+16]
+pxor  m5, m5
+psubw m7, m5, m6
+psubw m5, m4
+packuswb  m4, m6
+packuswb  m5, m7
+
+movu  m6, [r1+32]
+movu  m8, [r1+48]
+pxor  m7, m7
+psubw m9, m7, m8
+psubw m7, m6
+packuswb  m6, m8
+packuswb  m7, m9
+
+movu  m8, [r1+64]
+movu m10, [r1+80]
+pxor  m9, m9
+psubwm11, m9, m10
+psubw m9, m8
+packuswb  m8, m10
+packuswb  m9, m11
+
+movu m10, [r1+96]
+movu m12, [r1+112]
+pxor m11, m11
+psubwm13, m11, m12
+psubwm11, m10
+packuswb m10, m12
+packuswb m11, m13
+%endmacro
+
+%macro TR_ADD_OP_SSE 4
+%1m0, [%2 ]
+%1m1, [%2+%3  ]
+%1m2, [%2+%3*2]
+%1m3, [%2+%4  ]
+paddusb   

Re: [FFmpeg-devel] [PATCH] x86: hevc: adding transform_add

2014-07-30 Thread Ronald S. Bultje
Hi!

On Wed, Jul 30, 2014 at 9:33 AM, Pierre Edouard Lepere 
pierre-edouard.lep...@insa-rennes.fr wrote:

 Here's a patch adding ASM transform_add functions for HEVC.


Yay! I'll try to review soon. Do you have rough performance metrics? I know
it's faster :-p but it's nice to document by how much.

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


Re: [FFmpeg-devel] [PATCH 1/2] avutil/frame: add av_frame_side_data_name()

2014-07-30 Thread Michael Niedermayer
On Wed, Jul 30, 2014 at 02:18:47AM +0200, Michael Niedermayer wrote:
 Signed-off-by: Michael Niedermayer michae...@gmx.at
 ---
  libavutil/frame.c |   14 ++
  libavutil/frame.h |5 +
  2 files changed, 19 insertions(+)

patch applied with APIChages  version bump

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

If a bugfix only changes things apparently unrelated to the bug with no
further explanation, that is a good sign that the bugfix is wrong.


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


Re: [FFmpeg-devel] [PATCH] ffprobe: print some basic information about avframe side data

2014-07-30 Thread Michael Niedermayer
On Wed, Jul 30, 2014 at 05:21:15PM +0200, Stefano Sabatini wrote:
 On date Wednesday 2014-07-30 15:21:06 +0200, Michael Niedermayer encoded:
  Signed-off-by: Michael Niedermayer michae...@gmx.at
  ---
   doc/ffprobe.xsd |   11 +++
   ffprobe.c   |   21 -
   2 files changed, 31 insertions(+), 1 deletion(-)
  
  diff --git a/doc/ffprobe.xsd b/doc/ffprobe.xsd
  index 9ef9ecb..e0e9179 100644
  --- a/doc/ffprobe.xsd
  +++ b/doc/ffprobe.xsd
  @@ -55,6 +55,7 @@
   xsd:complexType name=frameType
 xsd:sequence
   xsd:element name=tag type=ffprobe:tagType minOccurs=0 
  maxOccurs=unbounded/
  +xsd:element name=sidedata_list 
  type=ffprobe:frameSideDataListType   minOccurs=0 maxOccurs=1 /
 /xsd:sequence
   
 xsd:attribute name=media_typetype=xsd:string 
  use=required/
  @@ -91,6 +92,16 @@
 xsd:attribute name=repeat_picttype=xsd:int   /
   /xsd:complexType
   
  +xsd:complexType name=frameSideDataListType
  +xsd:sequence
  +xsd:element name=sidedata type=ffprobe:frameSideDataType 
  minOccurs=1 maxOccurs=unbounded/
 
 I'd say side_data for consistency
 
  +/xsd:sequence
  +/xsd:complexType
  +xsd:complexType name=frameSideDataType
  +xsd:attribute name=side_data_type  
  type=xsd:string/
  +xsd:attribute name=side_data_size  type=xsd:int   
  /
  +/xsd:complexType
  +
   xsd:complexType name=subtitleType
 xsd:attribute name=media_type type=xsd:string 
  fixed=subtitle use=required/
 xsd:attribute name=ptstype=xsd:long /
  diff --git a/ffprobe.c b/ffprobe.c
  index 1329466..c9fc79d 100644
  --- a/ffprobe.c
  +++ b/ffprobe.c
  @@ -123,6 +123,8 @@ typedef enum {
   SECTION_ID_FRAME,
   SECTION_ID_FRAMES,
   SECTION_ID_FRAME_TAGS,
 
  +SECTION_ID_FRAME_SIDEDATA_LIST,
  +SECTION_ID_FRAME_SIDEDATA,
 
 same here SIDE_DATA*
 
   SECTION_ID_LIBRARY_VERSION,
   SECTION_ID_LIBRARY_VERSIONS,
   SECTION_ID_PACKET,
  @@ -152,8 +154,10 @@ static struct section sections[] = {
   [SECTION_ID_FORMAT] = { SECTION_ID_FORMAT, format, 0, { 
  SECTION_ID_FORMAT_TAGS, -1 } },
   [SECTION_ID_FORMAT_TAGS] ={ SECTION_ID_FORMAT_TAGS, tags, 
  SECTION_FLAG_HAS_VARIABLE_FIELDS, { -1 }, .element_name = tag, 
  .unique_name = format_tags },
   [SECTION_ID_FRAMES] = { SECTION_ID_FRAMES, frames, 
  SECTION_FLAG_IS_ARRAY, { SECTION_ID_FRAME, SECTION_ID_SUBTITLE, -1 } },
  -[SECTION_ID_FRAME] =  { SECTION_ID_FRAME, frame, 0, { 
  SECTION_ID_FRAME_TAGS, -1 } },
  +[SECTION_ID_FRAME] =  { SECTION_ID_FRAME, frame, 0, { 
  SECTION_ID_FRAME_TAGS, SECTION_ID_FRAME_SIDEDATA_LIST, -1 } },
   [SECTION_ID_FRAME_TAGS] = { SECTION_ID_FRAME_TAGS, tags, 
  SECTION_FLAG_HAS_VARIABLE_FIELDS, { -1 }, .element_name = tag, 
  .unique_name = frame_tags },
  +[SECTION_ID_FRAME_SIDEDATA_LIST] ={ SECTION_ID_FRAME_SIDEDATA_LIST, 
  sidedata_list, SECTION_FLAG_IS_ARRAY, { SECTION_ID_FRAME_SIDEDATA, -1 } },
  +[SECTION_ID_FRAME_SIDEDATA] = { SECTION_ID_FRAME_SIDEDATA, 
  sidedata, 0, { -1 } },
   [SECTION_ID_LIBRARY_VERSIONS] =   { SECTION_ID_LIBRARY_VERSIONS, 
  library_versions, SECTION_FLAG_IS_ARRAY, { SECTION_ID_LIBRARY_VERSION, -1 
  } },
   [SECTION_ID_LIBRARY_VERSION] ={ SECTION_ID_LIBRARY_VERSION, 
  library_version, 0, { -1 } },
   [SECTION_ID_PACKETS] ={ SECTION_ID_PACKETS, packets, 
  SECTION_FLAG_IS_ARRAY, { SECTION_ID_PACKET, -1} },
  @@ -1722,6 +1726,7 @@ static void show_frame(WriterContext *w, AVFrame 
  *frame, AVStream *stream,
   {
   AVBPrint pbuf;
   const char *s;
  +int i;
   
   av_bprint_init(pbuf, 1, AV_BPRINT_SIZE_UNLIMITED);
   
  @@ -1784,6 +1789,20 @@ static void show_frame(WriterContext *w, AVFrame 
  *frame, AVStream *stream,
   }
   if (do_show_frame_tags)
   show_tags(w, av_frame_get_metadata(frame), SECTION_ID_FRAME_TAGS);
  +if (frame-nb_side_data) {
  +writer_print_section_header(w, SECTION_ID_FRAME_SIDEDATA_LIST);
  +for (i = 0; i  frame-nb_side_data; i++) {
  +AVFrameSideData *sd = frame-side_data[i];
  +const char *name;
  +
  +writer_print_section_header(w, SECTION_ID_FRAME_SIDEDATA);
  +name = av_frame_side_data_name(sd-type);
  +print_str(side_data_type, name ? name : unknown);
  +print_int(side_data_size, sd-size);
  +writer_print_section_footer(w);
  +}
  +writer_print_section_footer(w);
  +}
   
   writer_print_section_footer(w);
 
 LGTM otherwise, thanks.

sidedatas renamed

applied

thanks

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

Into a blind darkness they enter who follow after the Ignorance,
they as if into a greater darkness enter who 

[FFmpeg-devel] [PATCH 1/4] dict.c: minor simplification.

2014-07-30 Thread Reimar Döffinger
Signed-off-by: Reimar Döffinger reimar.doeffin...@gmx.de
---
 libavutil/dict.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/libavutil/dict.c b/libavutil/dict.c
index 358958c..aea8910 100644
--- a/libavutil/dict.c
+++ b/libavutil/dict.c
@@ -90,10 +90,9 @@ int av_dict_set(AVDictionary **pm, const char *key, const 
char *value,
 } else {
 AVDictionaryEntry *tmp = av_realloc(m-elems,
 (m-count + 1) * 
sizeof(*m-elems));
-if (tmp)
-m-elems = tmp;
-else
+if (!tmp)
 return AVERROR(ENOMEM);
+m-elems = tmp;
 }
 if (value) {
 if (flags  AV_DICT_DONT_STRDUP_KEY)
-- 
2.0.1

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


[FFmpeg-devel] [PATCH 2/4] dict.c: Add av_dict_set_int helper function.

2014-07-30 Thread Reimar Döffinger
This allows getting rid of the many, slightly differing, implementations
of basically the same thing.

Signed-off-by: Reimar Döffinger reimar.doeffin...@gmx.de
---
 doc/APIchanges   |  3 +++
 ffmpeg_opt.c | 12 +++-
 ffplay.c |  2 +-
 libavfilter/vf_bbox.c|  4 +---
 libavfilter/vf_cropdetect.c  |  4 +---
 libavformat/cinedec.c|  4 +---
 libavformat/ftp.c| 10 --
 libavformat/hls.c| 17 -
 libavformat/id3v1.c  |  4 +---
 libavformat/matroskadec.c| 31 +++
 libavformat/mlvdec.c | 16 
 libavformat/mov.c| 14 +++---
 libavformat/mxfdec.c |  8 ++--
 libavformat/smoothstreamingenc.c |  4 +---
 libavformat/vqf.c|  6 +-
 libavutil/dict.c |  8 
 libavutil/dict.h |  8 
 libavutil/version.h  |  2 +-
 18 files changed, 54 insertions(+), 103 deletions(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index 5a0989d..84d46d1 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -15,6 +15,9 @@ libavutil: 2012-10-22
 
 API changes, most recent first:
 
+2014-xx-xx - xxx - lavu 52.95.100 - dict.h
+  Add av_dict_set_int helper function.
+
 2014-07-30 - xxx - lavu 52.94.100 - frame.h
   Add av_frame_side_data_name()
 
diff --git a/ffmpeg_opt.c b/ffmpeg_opt.c
index 2adefc5..4ff9f0a 100644
--- a/ffmpeg_opt.c
+++ b/ffmpeg_opt.c
@@ -785,7 +785,6 @@ static int open_input_file(OptionsContext *o, const char 
*filename)
 AVInputFormat *file_iformat = NULL;
 int err, i, ret;
 int64_t timestamp;
-uint8_t buf[128];
 AVDictionary **opts;
 AVDictionary *unused_opts = NULL;
 AVDictionaryEntry *e = NULL;
@@ -814,8 +813,7 @@ static int open_input_file(OptionsContext *o, const char 
*filename)
 exit_program(1);
 }
 if (o-nb_audio_sample_rate) {
-snprintf(buf, sizeof(buf), %d, 
o-audio_sample_rate[o-nb_audio_sample_rate - 1].u.i);
-av_dict_set(o-g-format_opts, sample_rate, buf, 0);
+av_dict_set_int(o-g-format_opts, sample_rate, 
o-audio_sample_rate[o-nb_audio_sample_rate - 1].u.i, 0);
 }
 if (o-nb_audio_channels) {
 /* because we set audio_channels based on both the ac and
@@ -824,9 +822,7 @@ static int open_input_file(OptionsContext *o, const char 
*filename)
 if (file_iformat  file_iformat-priv_class 
 av_opt_find(file_iformat-priv_class, channels, NULL, 0,
 AV_OPT_SEARCH_FAKE_OBJ)) {
-snprintf(buf, sizeof(buf), %d,
- o-audio_channels[o-nb_audio_channels - 1].u.i);
-av_dict_set(o-g-format_opts, channels, buf, 0);
+av_dict_set_int(o-g-format_opts, channels, 
o-audio_channels[o-nb_audio_channels - 1].u.i, 0);
 }
 }
 if (o-nb_frame_rates) {
@@ -2038,9 +2034,7 @@ loop_end:
 assert_file_overwrite(filename);
 
 if (o-mux_preload) {
-uint8_t buf[64];
-snprintf(buf, sizeof(buf), %d, (int)(o-mux_preload*AV_TIME_BASE));
-av_dict_set(of-opts, preload, buf, 0);
+av_dict_set_int(of-opts, preload, o-mux_preload*AV_TIME_BASE, 0);
 }
 oc-max_delay = (int)(o-mux_max_delay * AV_TIME_BASE);
 
diff --git a/ffplay.c b/ffplay.c
index af0e199..173a2e4 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -2582,7 +2582,7 @@ static int stream_component_open(VideoState *is, int 
stream_index)
 if (!av_dict_get(opts, threads, NULL, 0))
 av_dict_set(opts, threads, auto, 0);
 if (stream_lowres)
-av_dict_set(opts, lowres, av_asprintf(%d, stream_lowres), 
AV_DICT_DONT_STRDUP_VAL);
+av_dict_set_int(opts, lowres, stream_lowres, 0);
 if (avctx-codec_type == AVMEDIA_TYPE_VIDEO || avctx-codec_type == 
AVMEDIA_TYPE_AUDIO)
 av_dict_set(opts, refcounted_frames, 1, 0);
 if (avcodec_open2(avctx, codec, opts)  0)
diff --git a/libavfilter/vf_bbox.c b/libavfilter/vf_bbox.c
index 6c6aab1..1e6feff 100644
--- a/libavfilter/vf_bbox.c
+++ b/libavfilter/vf_bbox.c
@@ -61,8 +61,7 @@ static int query_formats(AVFilterContext *ctx)
 }
 
 #define SET_META(key, value) \
-snprintf(buf, sizeof(buf), %d, value);  \
-av_dict_set(metadata, key, buf, 0);
+av_dict_set_int(metadata, key, value, 0);
 
 static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
 {
@@ -70,7 +69,6 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
 BBoxContext *bbox = ctx-priv;
 FFBoundingBox box;
 int has_bbox, w, h;
-char buf[32];
 
 has_bbox =
 ff_calculate_bounding_box(box,
diff --git a/libavfilter/vf_cropdetect.c b/libavfilter/vf_cropdetect.c
index ed8e7a8..f85a0bb 100644
--- a/libavfilter/vf_cropdetect.c
+++ b/libavfilter/vf_cropdetect.c
@@ -113,8 +113,7 @@ static int config_input(AVFilterLink *inlink)
 }
 
 #define SET_META(key, value) 

Re: [FFmpeg-devel] [PATCH 1/3] dict.c: Free non-strduped av_dict_set arguments on error.

2014-07-30 Thread Reimar Döffinger
On Tue, Jul 29, 2014 at 10:13:39PM +0200, Michael Niedermayer wrote:
 On Tue, Jul 29, 2014 at 09:26:48PM +0200, Reimar Döffinger wrote:
  Unfortunately this was not explicitly documented and thus
  might be very risky.
  But basically all uses I saw in FFmpeg had a memleak in these
  cases.
  
  Signed-off-by: Reimar Döffinger reimar.doeffin...@gmx.de
  ---
   libavutil/dict.c | 9 +++--
   libavutil/dict.h | 2 ++
   2 files changed, 9 insertions(+), 2 deletions(-)
 
 doesnt apply
 
 Applying: dict.c: Free non-strduped av_dict_set arguments on error.
 fatal: sha1 information is lacking or useless (libavutil/dict.c).
 Repository lacks necessary blobs to fall back on 3-way merge.
 Cannot fall back to three-way merge.
 Patch failed at 0001 dict.c: Free non-strduped av_dict_set arguments on error.

Sorry, I messed this up at some point.
Resent, with the missing patch which was the real reason for all this,
and with order changed to make a bit more sense.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] doc: add very basic libcdio documentation

2014-07-30 Thread Gerion Entrup
---
 doc/indevs.texi | 15 +++
 1 file changed, 15 insertions(+)

diff --git a/doc/indevs.texi b/doc/indevs.texi
index 4ca12ff..e0e7e67 100644
--- a/doc/indevs.texi
+++ b/doc/indevs.texi
@@ -483,6 +483,21 @@ ffplay -f lavfi 
movie=test.avi[out0];amovie=test.wav[out1]
 
 @end itemize
 
+@section libcdio
+
+Audio-CD input device based on cdio.
+
+To enable this input device during configuration you need libcdio
+installed on your system.
+
+This device allows playing and grabbing from an Audio-CD.
+
+For example to copy with @command{ffmpeg} the entire Audio-CD in /dev/sr0,
+you may run the command:
+@example
+ffmpeg -f libcdio -i /dev/sr0 cd.wav
+@end example
+
 @section libdc1394
 
 IIDC1394 input device, based on libdc1394 and libraw1394.
-- 
1.8.5.5

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


Re: [FFmpeg-devel] [PATCH 2/4] dict.c: Add av_dict_set_int helper function.

2014-07-30 Thread Reimar Döffinger
On Wed, Jul 30, 2014 at 08:38:06PM +0200, Reimar Döffinger wrote:
 This allows getting rid of the many, slightly differing, implementations
 of basically the same thing.

This one really can need a few extra eyes.
It's likely I missed a few places, and there's a risk I messed up one
or the other place where I did the replacement.
Still, the massive number of places this is useful IMHO speaks strongly
for doing something like this, and I suspect the situation looks
similar in some of the programs using FFmpeg...
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 2/4] lavfi/buffersrc: add add av_buffersrc_close().

2014-07-30 Thread Derek Buitenhuis
On 7/30/2014 6:10 PM, Nicolas George wrote:
 This is tiring. Everyone knows it already and it has been explained numerous
 times.

Yeah, why should you have to explain the reason for a change in
a review of that change? How silly. I should just divine the reason
why. I guess we don't count as everyone.

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


Re: [FFmpeg-devel] [PATCH 2/4] dict.c: Add av_dict_set_int helper function.

2014-07-30 Thread wm4
On Wed, 30 Jul 2014 20:38:06 +0200
Reimar Döffinger reimar.doeffin...@gmx.de wrote:

 This allows getting rid of the many, slightly differing, implementations
 of basically the same thing.
 
 Signed-off-by: Reimar Döffinger reimar.doeffin...@gmx.de
 ---
  doc/APIchanges   |  3 +++
  ffmpeg_opt.c | 12 +++-
  ffplay.c |  2 +-
  libavfilter/vf_bbox.c|  4 +---
  libavfilter/vf_cropdetect.c  |  4 +---
  libavformat/cinedec.c|  4 +---
  libavformat/ftp.c| 10 --
  libavformat/hls.c| 17 -
  libavformat/id3v1.c  |  4 +---
  libavformat/matroskadec.c| 31 +++
  libavformat/mlvdec.c | 16 
  libavformat/mov.c| 14 +++---
  libavformat/mxfdec.c |  8 ++--
  libavformat/smoothstreamingenc.c |  4 +---
  libavformat/vqf.c|  6 +-
  libavutil/dict.c |  8 
  libavutil/dict.h |  8 
  libavutil/version.h  |  2 +-
  18 files changed, 54 insertions(+), 103 deletions(-)
 
 diff --git a/doc/APIchanges b/doc/APIchanges
 index 5a0989d..84d46d1 100644
 --- a/doc/APIchanges
 +++ b/doc/APIchanges
 @@ -15,6 +15,9 @@ libavutil: 2012-10-22
  
  API changes, most recent first:
  
 +2014-xx-xx - xxx - lavu 52.95.100 - dict.h
 +  Add av_dict_set_int helper function.
 +
  2014-07-30 - xxx - lavu 52.94.100 - frame.h
Add av_frame_side_data_name()
  
 diff --git a/ffmpeg_opt.c b/ffmpeg_opt.c
 index 2adefc5..4ff9f0a 100644
 --- a/ffmpeg_opt.c
 +++ b/ffmpeg_opt.c
 @@ -785,7 +785,6 @@ static int open_input_file(OptionsContext *o, const char 
 *filename)
  AVInputFormat *file_iformat = NULL;
  int err, i, ret;
  int64_t timestamp;
 -uint8_t buf[128];
  AVDictionary **opts;
  AVDictionary *unused_opts = NULL;
  AVDictionaryEntry *e = NULL;
 @@ -814,8 +813,7 @@ static int open_input_file(OptionsContext *o, const char 
 *filename)
  exit_program(1);
  }
  if (o-nb_audio_sample_rate) {
 -snprintf(buf, sizeof(buf), %d, 
 o-audio_sample_rate[o-nb_audio_sample_rate - 1].u.i);
 -av_dict_set(o-g-format_opts, sample_rate, buf, 0);
 +av_dict_set_int(o-g-format_opts, sample_rate, 
 o-audio_sample_rate[o-nb_audio_sample_rate - 1].u.i, 0);
  }
  if (o-nb_audio_channels) {
  /* because we set audio_channels based on both the ac and
 @@ -824,9 +822,7 @@ static int open_input_file(OptionsContext *o, const char 
 *filename)
  if (file_iformat  file_iformat-priv_class 
  av_opt_find(file_iformat-priv_class, channels, NULL, 0,
  AV_OPT_SEARCH_FAKE_OBJ)) {
 -snprintf(buf, sizeof(buf), %d,
 - o-audio_channels[o-nb_audio_channels - 1].u.i);
 -av_dict_set(o-g-format_opts, channels, buf, 0);
 +av_dict_set_int(o-g-format_opts, channels, 
 o-audio_channels[o-nb_audio_channels - 1].u.i, 0);
  }
  }
  if (o-nb_frame_rates) {
 @@ -2038,9 +2034,7 @@ loop_end:
  assert_file_overwrite(filename);
  
  if (o-mux_preload) {
 -uint8_t buf[64];
 -snprintf(buf, sizeof(buf), %d, (int)(o-mux_preload*AV_TIME_BASE));
 -av_dict_set(of-opts, preload, buf, 0);
 +av_dict_set_int(of-opts, preload, o-mux_preload*AV_TIME_BASE, 
 0);
  }
  oc-max_delay = (int)(o-mux_max_delay * AV_TIME_BASE);
  
 diff --git a/ffplay.c b/ffplay.c
 index af0e199..173a2e4 100644
 --- a/ffplay.c
 +++ b/ffplay.c
 @@ -2582,7 +2582,7 @@ static int stream_component_open(VideoState *is, int 
 stream_index)
  if (!av_dict_get(opts, threads, NULL, 0))
  av_dict_set(opts, threads, auto, 0);
  if (stream_lowres)
 -av_dict_set(opts, lowres, av_asprintf(%d, stream_lowres), 
 AV_DICT_DONT_STRDUP_VAL);
 +av_dict_set_int(opts, lowres, stream_lowres, 0);
  if (avctx-codec_type == AVMEDIA_TYPE_VIDEO || avctx-codec_type == 
 AVMEDIA_TYPE_AUDIO)
  av_dict_set(opts, refcounted_frames, 1, 0);
  if (avcodec_open2(avctx, codec, opts)  0)
 diff --git a/libavfilter/vf_bbox.c b/libavfilter/vf_bbox.c
 index 6c6aab1..1e6feff 100644
 --- a/libavfilter/vf_bbox.c
 +++ b/libavfilter/vf_bbox.c
 @@ -61,8 +61,7 @@ static int query_formats(AVFilterContext *ctx)
  }
  
  #define SET_META(key, value) \
 -snprintf(buf, sizeof(buf), %d, value);  \
 -av_dict_set(metadata, key, buf, 0);
 +av_dict_set_int(metadata, key, value, 0);
  
  static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
  {
 @@ -70,7 +69,6 @@ static int filter_frame(AVFilterLink *inlink, AVFrame 
 *frame)
  BBoxContext *bbox = ctx-priv;
  FFBoundingBox box;
  int has_bbox, w, h;
 -char buf[32];
  
  has_bbox =
  ff_calculate_bounding_box(box,
 diff --git a/libavfilter/vf_cropdetect.c 

Re: [FFmpeg-devel] [PATCH] x86: hevc: adding transform_add

2014-07-30 Thread James Almer
On 30/07/14 10:33 AM, Pierre Edouard Lepere wrote:

 +%macro TR_ADD_INIT_SSE_8 2
 +movu  m4, [r1]
 +movu  m6, [r1+16]
 +movu  m8, [r1+32]
 +movu m10, [r1+48]

You can use mova here, and probably in every other movu as well.

 +lea   %1, [%2*3]
 +pxor  m5, m5
 +psubw m5, m4
 +packuswb  m4, m4
 +packuswb  m5, m5
 +pxor  m7, m7
 +psubw m7, m6
 +packuswb  m6, m6
 +packuswb  m7, m7
 +pxor  m9, m9
 +psubw m9, m8
 +packuswb  m8, m8
 +packuswb  m9, m9
 +pxor m11, m11
 +psubwm11, m10
 +packuswb m10, m10
 +packuswb m11, m11
 +%endmacro
 
 +%macro TR_ADD_OP_SSE 4
 +%1m0, [%2 ]
 +%1m1, [%2+%3  ]
 +%1m2, [%2+%3*2]
 +%1m3, [%2+%4  ]
 +paddusb   m0, m4
 +paddusb   m1, m6
 +paddusb   m2, m8
 +paddusb   m3, m10
 +psubusb   m0, m5
 +psubusb   m1, m7
 +psubusb   m2, m9
 +psubusb   m3, m11
 +%1 [%2 ], m0
 +%1 [%2+%3  ], m1
 +%1 [%2+2*%3], m2
 +%1 [%2+%4  ], m3
 +%endmacro

You can use packuswb to pack two regs into one, like you did in 
TR_ADD_INIT_SSE_16.
Then you simply use movq+movhps to load and store data, like so:

%macro TR_ADD_INIT_SSE_8 2
mova  m4, [r1]
mova  m6, [r1+16]
mova  m0, [r1+32]
mova  m2, [r1+48]
lea   %1, [%2*3]
pxor  m5, m5
psubw m5, m4
pxor  m7, m7
psubw m7, m6
pxor  m1, m1
psubw m1, m0
packuswb  m4, m0
packuswb  m5, m1
pxor  m3, m3
psubw m3, m2
packuswb  m6, m2
packuswb  m7, m3
%endmacro

%macro TR_ADD_OP_SSE 4
movqm0, [%2 ]
movqm1, [%2+%3  ]
movhps  m0, [%2+%3*2]
movhps  m1, [%2+%4  ]
paddusb m0, m4
paddusb m1, m6
psubusb m0, m5
psubusb m1, m7
movq [%2 ], m0
movq [%2+%3  ], m1
movhps   [%2+2*%3], m0
movhps   [%2+%4  ], m1
%endmacro

This not only reduced the instruction count, but also made it use 8 xmm 
regs instead of 12.
Reordering the instructions might prevent some dependencies as well.
The TR_ADD_OP_SSE macro as edited above will not work for 
hevc_transform_add16_8 anymore, so you will have to duplicate it.

Haven't looked at hevc_transform_add16_8, but I'm sure it can be done 
with less than 14 xmm registers.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] x86: hevc: adding transform_add

2014-07-30 Thread Ronald S. Bultje
Hi,

On Wed, Jul 30, 2014 at 5:04 PM, James Almer jamr...@gmail.com wrote:

 On 30/07/14 10:33 AM, Pierre Edouard Lepere wrote:

  +%macro TR_ADD_INIT_SSE_8 2
  +movu  m4, [r1]
  +movu  m6, [r1+16]
  +movu  m8, [r1+32]
  +movu m10, [r1+48]

 You can use mova here, and probably in every other movu as well.

  +lea   %1, [%2*3]
  +pxor  m5, m5
  +psubw m5, m4
  +packuswb  m4, m4
  +packuswb  m5, m5
  +pxor  m7, m7
  +psubw m7, m6
  +packuswb  m6, m6
  +packuswb  m7, m7
  +pxor  m9, m9
  +psubw m9, m8
  +packuswb  m8, m8
  +packuswb  m9, m9
  +pxor m11, m11
  +psubwm11, m10
  +packuswb m10, m10
  +packuswb m11, m11
  +%endmacro
 
  +%macro TR_ADD_OP_SSE 4
  +%1m0, [%2 ]
  +%1m1, [%2+%3  ]
  +%1m2, [%2+%3*2]
  +%1m3, [%2+%4  ]
  +paddusb   m0, m4
  +paddusb   m1, m6
  +paddusb   m2, m8
  +paddusb   m3, m10
  +psubusb   m0, m5
  +psubusb   m1, m7
  +psubusb   m2, m9
  +psubusb   m3, m11
  +%1 [%2 ], m0
  +%1 [%2+%3  ], m1
  +%1 [%2+2*%3], m2
  +%1 [%2+%4  ], m3
  +%endmacro

 You can use packuswb to pack two regs into one, like you did in
 TR_ADD_INIT_SSE_16.
 Then you simply use movq+movhps to load and store data, like so:

 %macro TR_ADD_INIT_SSE_8 2
 mova  m4, [r1]
 mova  m6, [r1+16]
 mova  m0, [r1+32]
 mova  m2, [r1+48]
 lea   %1, [%2*3]
 pxor  m5, m5
 psubw m5, m4
 pxor  m7, m7
 psubw m7, m6
 pxor  m1, m1
 psubw m1, m0
 packuswb  m4, m0
 packuswb  m5, m1
 pxor  m3, m3
 psubw m3, m2
 packuswb  m6, m2
 packuswb  m7, m3
 %endmacro

 %macro TR_ADD_OP_SSE 4
 movqm0, [%2 ]
 movqm1, [%2+%3  ]
 movhps  m0, [%2+%3*2]
 movhps  m1, [%2+%4  ]
 paddusb m0, m4
 paddusb m1, m6
 psubusb m0, m5
 psubusb m1, m7
 movq [%2 ], m0
 movq [%2+%3  ], m1
 movhps   [%2+2*%3], m0
 movhps   [%2+%4  ], m1
 %endmacro


Why all these memory round-trips?

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


Re: [FFmpeg-devel] [PATCH 2/4] dict.c: Add av_dict_set_int helper function.

2014-07-30 Thread Lukasz Marek

On 30.07.2014 23:16, Lukasz Marek wrote:



+int av_dict_set_int(AVDictionary **pm, const char *key, int64_t value,
+int flags)
+{
+char valuestr[22];
+snprintf(valuestr, sizeof(valuestr), %PRId64, value);
+return av_dict_set_int(pm, key, valuestr, flags);
+}


I guess it's infinite recurrence. ffplay crashes when ftp:// source with
-timeout option is provided.


Of course I meant recursion.


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


[FFmpeg-devel] [PATCH 1/4] lavfi: add filter metaframes infrastructure.

2014-07-30 Thread Nicolas George
Metaframes are frames without data, identified by a negative
format code, used to carry special conditions.
They are sent only to filter that declare supporting them.
The only metaframe for now is EOF; this mechanism augments
the current mechanism based on request_frame() returning
AVERROR_EOF, with the advantage that the EOF metaframe carries
a timestamp.
The metaframes are a purely internal API and do not leak to
the application.

Signed-off-by: Nicolas George geo...@nsup.org
---
 libavfilter/avfilter.c | 73 +-
 libavfilter/internal.h | 34 +++
 2 files changed, 100 insertions(+), 7 deletions(-)


Changed the name to metaframes.
Allocate the frame with the classic method.


diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index 7b11467..7894173 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -346,15 +346,16 @@ int ff_request_frame(AVFilterLink *link)
 ret = link-srcpad-request_frame(link);
 else if (link-src-inputs[0])
 ret = ff_request_frame(link-src-inputs[0]);
-if (ret == AVERROR_EOF  link-partial_buf) {
-AVFrame *pbuf = link-partial_buf;
-link-partial_buf = NULL;
-ret = ff_filter_frame_framed(link, pbuf);
-}
 if (ret  0) {
+if (!link-frame_requested) {
+av_assert0(ret == AVERROR_EOF);
+ret = 0;
+}
 link-frame_requested = 0;
-if (ret == AVERROR_EOF)
-link-closed = 1;
+if (ret == AVERROR_EOF) {
+ret = ff_filter_link_close(link, AV_NOPTS_VALUE);
+return ret  0 ? ret : AVERROR_EOF;
+}
 } else {
 av_assert0(!link-frame_requested ||
link-flags  FF_LINK_FLAG_REQUEST_LOOP);
@@ -1132,10 +1133,52 @@ static int ff_filter_frame_needs_framing(AVFilterLink 
*link, AVFrame *frame)
 return ret;
 }
 
+static int ff_filter_metaframe(AVFilterLink *link, AVFrame *frame)
+{
+AVFrame *pbuf = link-partial_buf;
+int ret;
+
+if (pbuf) {
+link-partial_buf = NULL;
+if ((ret = ff_filter_frame_framed(link, pbuf))  0)
+return ret;
+}
+
+if ((link-dst-filter-flags  FF_FILTER_FLAG_SUPPORT_METAFRAMES)) {
+ret = link-dstpad-filter_frame ?
+  link-dstpad-filter_frame(link, frame) :
+  default_filter_frame(link, frame);
+if (ret  0)
+return ret;
+}
+
+switch (frame-format) {
+
+case FF_METAFRAME_EOF:
+link-closed = 1;
+break;
+
+case 0:
+case FF_METAFRAME_NOP:
+/* Not implemented yet because not used either for now.
+   Caveat: if the same metaframe is forwarded to the next filter
+   and the next filter changes the type, the type change must not be
+   taken into account for the first link. */
+
+default:
+av_assert0(!reached);
+}
+
+return ret;
+}
+
 int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
 {
 FF_TPRINTF_START(NULL, filter_frame); ff_tlog_link(NULL, link, 1); 
ff_tlog(NULL,  ); ff_tlog_ref(NULL, frame, 1);
 
+if (frame-format  -1)
+return ff_filter_metaframe(link, frame);
+
 /* Consistency checks */
 if (link-type == AVMEDIA_TYPE_VIDEO) {
 if (strcmp(link-dst-filter-name, scale)) {
@@ -1162,6 +1205,22 @@ int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
 }
 }
 
+int ff_filter_link_close(AVFilterLink *link, int64_t pts)
+{
+AVFrame *frame;
+int ret;
+
+if (link-closed)
+return 0;
+if (!(frame = av_frame_alloc()))
+return AVERROR(ENOMEM);
+frame-format = FF_METAFRAME_EOF;
+frame-pts = pts;
+ret = ff_filter_frame(link, frame);
+av_frame_free(frame);
+return ret;
+}
+
 const AVClass *avfilter_get_class(void)
 {
 return avfilter_class;
diff --git a/libavfilter/internal.h b/libavfilter/internal.h
index 308b115..fbe603a 100644
--- a/libavfilter/internal.h
+++ b/libavfilter/internal.h
@@ -374,4 +374,38 @@ AVFilterContext *ff_filter_alloc(const AVFilter *filter, 
const char *inst_name);
  */
 void ff_filter_graph_remove_filter(AVFilterGraph *graph, AVFilterContext 
*filter);
 
+/**
+ * The filter can accept metaframes.
+ * Metaframes are AVFrame structures with a negative format field.
+ * The framework will take default actions based on the metaframe type.
+ * The destination filter is allowed to reset the type to inhibit the
+ * default actions.
+ */
+#define FF_FILTER_FLAG_SUPPORT_METAFRAMES (1  24)
+
+/**
+ * Types of metaframes that can be passer to a filter.
+ */
+enum {
+/**
+ * Do not do anything.
+ * Can be used by the destination filter to inhibit default handling.
+ */
+FF_METAFRAME_NOP = -1,
+
+/**
+ * The input has reached EOF.
+ * The pts field holds the timestamp of the end of the stream,
+ * therefore allowing 

[FFmpeg-devel] [PATCH 3/4] ffmpeg: use av_buffersrc_close().

2014-07-30 Thread Nicolas George
Signed-off-by: Nicolas George geo...@nsup.org
---
 ffmpeg.c | 14 --
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/ffmpeg.c b/ffmpeg.c
index 1c1a559..3ac6620 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -1741,12 +1741,9 @@ static int decode_audio(InputStream *ist, AVPacket *pkt, 
int *got_output)
 
 if (!*got_output || ret  0) {
 if (!pkt-size) {
+int64_t pts = av_rescale_q(ist-next_pts, AV_TIME_BASE_Q, 
ist-st-time_base);
 for (i = 0; i  ist-nb_filters; i++)
-#if 1
-av_buffersrc_add_ref(ist-filters[i]-filter, NULL, 0);
-#else
-av_buffersrc_add_frame(ist-filters[i]-filter, NULL);
-#endif
+av_buffersrc_close(ist-filters[i]-filter, pts, 0);
 }
 return ret;
 }
@@ -1894,12 +1891,9 @@ static int decode_video(InputStream *ist, AVPacket *pkt, 
int *got_output)
 
 if (!*got_output || ret  0) {
 if (!pkt-size) {
+int64_t pts = av_rescale_q(ist-next_pts, AV_TIME_BASE_Q, 
ist-st-time_base);
 for (i = 0; i  ist-nb_filters; i++)
-#if 1
-av_buffersrc_add_ref(ist-filters[i]-filter, NULL, 0);
-#else
-av_buffersrc_add_frame(ist-filters[i]-filter, NULL);
-#endif
+av_buffersrc_close(ist-filters[i]-filter, pts, 0);
 }
 return ret;
 }
-- 
2.0.1

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


Re: [FFmpeg-devel] FFmpeg OPW

2014-07-30 Thread Lou Logan
On Mon, 28 Jul 2014 17:46:33 -0400, Reynaldo H. Verdejo Pinochet wrote:

 Once posted, it would be great if you can set aside 2 minutes to
 tweet/blogpost/whatever about it so it gets noticed. We need all the
 $ help we can get.

I mentioned this at https://twitter.com/FFmpeg

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


Re: [FFmpeg-devel] [PATCH 1/4] dict.c: minor simplification.

2014-07-30 Thread Michael Niedermayer
On Wed, Jul 30, 2014 at 08:38:05PM +0200, Reimar Döffinger wrote:
 Signed-off-by: Reimar Döffinger reimar.doeffin...@gmx.de
 ---
  libavutil/dict.c | 5 ++---
  1 file changed, 2 insertions(+), 3 deletions(-)

LGTM

[...]
-- 
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