Re: [FFmpeg-devel] [PATCH] lavf/avisynth: fix compilation, remove bundled headers

2015-03-25 Thread Jan Ehrhardt
Martin Herkt in gmane.comp.video.ffmpeg.devel (Tue, 24 Mar 2015 19:40:33
+0100):
Merge commit 1530732 broke compilation with AviSynth enabled.

I ran into the same problem when cross-compiling for Windows on Ubuntu:

CC  libavformat/avisynth.o
In file included from libavformat/avisynth.c:33:0:
./compat/avisynth/avisynth_c.h: In function 'avs_is_same_colorspace':
./compat/avisynth/avisynth_c.h:363:17: error: implicit declaration of
function 'avs_is_yv12' [-Werror=implicit-function-declaration]
 || (avs_is_yv12(x)  avs_is_yv12(y));
 ^
./compat/avisynth/avisynth_c.h: In function 'avs_get_pitch':
./compat/avisynth/avisynth_c.h:404:9: error: implicit declaration of
function 'avs_get_pitch_p' [-Werror=implicit-function-declaration]
 return avs_get_pitch_p(p, 0);}
 ^
./compat/avisynth/avisynth_c.h: In function 'avs_get_read_ptr':
./compat/avisynth/avisynth_c.h:419:9: error: implicit declaration of
function 'avs_get_read_ptr_p' [-Werror=implicit-function-declaration]
 return avs_get_read_ptr_p(p, 0);}
 ^
./compat/avisynth/avisynth_c.h:419:9: warning: return makes pointer from
integer without a cast
./compat/avisynth/avisynth_c.h: In function 'avs_get_write_ptr':
./compat/avisynth/avisynth_c.h:426:9: error: implicit declaration of
function 'avs_get_write_ptr_p' [-Werror=implicit-function-declaration]
 return avs_get_write_ptr_p(p, 0);}
 ^
./compat/avisynth/avisynth_c.h:426:9: warning: return makes pointer from
integer without a cast
./compat/avisynth/avisynth_c.h: At top level:
./compat/avisynth/avisynth_c.h:780:27: warning: function declaration
isn't a prototype [-Wstrict-prototypes]
 AVSC_INLINE AVS_Library * avs_load_library() {
   ^
In file included from libavformat/avisynth.c:34:0:
./compat/avisynth/avisynth_c_25.h: In function 'avs_get_row_size_p_25':
./compat/avisynth/avisynth_c_25.h:51:31: error: 'AVS_FRAME_ALIGN'
undeclared (first use in this function)
 r = ((p-row_size+AVS_FRAME_ALIGN-1)(~(AVS_FRAME_ALIGN-1))
)1; // Aligned rowsize
   ^
./compat/avisynth/avisynth_c_25.h:51:31: note: each undeclared
identifier is reported only once for each function it appears in
cc1: some warnings being treated as errors
make: *** [libavformat/avisynth.o] Error 1
make: *** Waiting for unfinished jobs

Jan

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


Re: [FFmpeg-devel] [PATCH] HDMV PGS subtitles-Ticket #2622

2015-03-25 Thread Niklesh Lalwani
Apologies. I'll do that.
I am relatively new to git, and hence wasn't able to send as you had asked.

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


Re: [FFmpeg-devel] [PATCH] Build scripts for WinRT

2015-03-25 Thread Simon Ferquel
Please avoid top-posting on this list, thanks.


Sorry about that, I'm not really used to mailing lists


On 24.03.2015, at 22:14, Simon Ferquel simon.ferq...@hotmail.fr wrote:
 Axtually I don't know the meaning of enable thumb (it was in the ffmpef 
 winrt compilation guide I followed).
It generates smaller but somewhat slower code.
IMHO unless instruction cache misses are a major issue (and even then) it 
doesn't make sense unless you optimize the code for size in general - which 
you clearly are not doing.
Admittedly I do not know if anyone benchmarked it lately.
Btw. do you know anything concerning armv8 support? Would be good to get 
testing of that early on as well (though of course not possible before 
official support, but with even the low-end making the transition on Android I 
would expect support for it soonish).


About enable-thumb, I'll give a try without (won't be able to test it on 
Windows, only have a phone arm device for now).
About armv8, there is actually a ./lib/arm64 in the windows 10 dev kit, but no 
public compiler for this atm. I'll keep you posted if I get any news on that 
(and would be glad to help target this architecture on Windows 10).


 I also found some strange linking issues when building with 
 disable-optimizations and / or as static libs. So, I'll resubmit the patch 
 when these issues are fixed.


I'm giving some more tries, but I am close to having a fully functionnal build, 
with both win81/wp81 target and win10 preview. New patch soon.


 
 De : Reimar Döffingermailto:reimar.doeffin...@gmx.de
 Envoyé : ‎24/‎03/‎2015 21:56
 À : FFmpeg development discussions and 
 patchesmailto:ffmpeg-devel@ffmpeg.org
 Objet : Re: [FFmpeg-devel] [PATCH] Build scripts for WinRT
 
 On Tue, Mar 24, 2015 at 08:07:28AM +, Simon Ferquel wrote:
 I have needed libavformat/libavcodec for a drone piloting app project 
 targetting (among others) the Windows modern platform (Win81 modern, 
 Windows Phone, and Xbox one in a near future).
 
 To make it easier to generate static libs for all the combinations of os 
 (win81/wp81), architecture (armv7, x86, x64) and C runtime configurations 
 (debug CRT DLL or release CRT DLL), I wrote some bash scripts automating 
 the setup of the environment variables needed for msvc, as well as the 
 different flags to pass to the compiler to generate valid libraries for the 
 modern windows app platform.
 
 This patch adds a bldwinrt folder with only bash scripts in it. They must 
 be run in the msys2 environment and have been tested on Windows 8.1 64bit.
 
 One question: You are aware that --enable-thumb is not the default on
 purpose/for good reasons?
 I wonder why you are using it.
​
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] Disabled mipsdspr1 under 74kc cpu and disabled all mips hardware acceleration by default.

2015-03-25 Thread Nedeljko Babic
From: Shivraj Patil shivraj.pa...@imgtec.com

---
 configure | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/configure b/configure
index 4827a4d..1a08347 100755
--- a/configure
+++ b/configure
@@ -3839,6 +3839,12 @@ elif enabled mips; then
 ;;
 74kc)
 disable mipsfpu
+disable mipsdspr1
+;;

DSP rev 1 should not be disabled for this architecture.
74kc architecture is backward compatible and it supports both dsp rev 2
and dsp rev1.

+*)
+disable mipsfpu
+disable mipsdspr1
+disable mipsdspr2
 ;;
 esac

The options for mips were created in a similar way as for all the other 
supported architectures:
All optimizations are enabled by default and for every group of optimizations 
there is a switch to disable it.

That means that the * case cannot be used as above.
If all the optimizations are disabled for * case, than that would mean that 
all optimizations will be disabled for any architecture that is not in the case 
list even if that architecture supports some (or all) of it.

Even worse, there would not be a way to enable any optimization for those 
architectures as there is no appropriate enable option.

For example, 74Kf architecture is basically the same as 74Kc with addition 
of FPU and it is not in the case list.
With * case like this all optimizations would be disabled for 74Kf although 
it supports all of them.

 
-- 
2.3.2

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


Re: [FFmpeg-devel] [PATCH 5/5] doc: Escape all backslashes needed to be escaped

2015-03-25 Thread Stefano Sabatini
On date Sunday 2015-03-22 20:47:20 -0700, Timothy Gu encoded:
 No, I do not want to do this, but a user requested it…
 
 I think it is time for us to switch to a better documentation format.
 
 Fixes #3867.
 ---
  doc/developer.texi |  4 ++--
  doc/encoders.texi  |  4 ++--
  doc/faq.texi   |  8 
  doc/ffmpeg.texi|  4 ++--
  doc/filters.texi   | 60 
 +++---
  doc/indevs.texi|  2 +-
  doc/metadata.texi  |  6 +++---
  doc/muxers.texi| 38 +-
  doc/protocols.texi |  2 +-
  doc/utils.texi |  8 
  10 files changed, 68 insertions(+), 68 deletions(-)

From texinfo docs:

14.1.4 Inserting '\' with '@backslashchar{}'


Ordinarily, a backslash '\' is a normal character in Texinfo that can be
simply typed in your input where you need it.  The result is to typeset
the backslash from the typewriter font.

  However, Texinfo uses the backslash as a special character in one
restricted context: to delimit formal arguments in the bodies of
user-defined macros (*note Defining Macros::).

  Due to the vagaries of macro argument parsing, it is more reliable to
pass an alphabetic command that produces a backslash instead of using a
literal \.  Hence '@backslashchar{}'.  Here is an example macro call:

 @mymac{One argument@backslashchar{} with a backslash}

  Texinfo documents may also use \ as a command character inside '@math'
(*note Inserting Math::).  In this case, '@\' or '\backslash' produces a
math backslash (from the math symbol font), while '@backslashchar{}'
produces a typewriter backslash as usual.

  Although '@backslashchar{}' can be used nearly anywhere, there is no
need for it except in these unusual cases.

...

So I'm not sure there is this requirement, especially if we're using \
within @example. 

[...]
-- 
FFmpeg = Free  Frightening Meaningful Puritan Exciting Geek
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] lavfi: add inverse telecine filter

2015-03-25 Thread Himangi Saraogi
This is an exact inverse of the telecine filter unlike previously existing
pullup and fieldmatch ones.

Tested on few samples generated using the telecine filter. Documentation is
yet to be added. Added an additional parameter start_frame to allow using
the filter for a stream that was cut. Pts handling now uses the input pts, if
parameter ts_mode is set to 1. Not sure if this fixes the AV_desync though. 

---
 Changelog   |   2 +-
 libavfilter/Makefile|   1 +
 libavfilter/allfilters.c|   1 +
 libavfilter/vf_detelecine.c | 339 
 4 files changed, 342 insertions(+), 1 deletion(-)
 create mode 100644 libavfilter/vf_detelecine.c

diff --git a/Changelog b/Changelog
index 4950330..8733203 100644
--- a/Changelog
+++ b/Changelog
@@ -7,7 +7,7 @@ version next:
 - DTS lossless extension (XLL) decoding (not lossless, disabled by default)
 - showwavespic filter
 - libdcadec wrapper
-
+- Detelecine filter
 
 version 2.6:
 - nvenc encoder
diff --git a/libavfilter/Makefile b/libavfilter/Makefile
index 2cde029..73e7adf 100644
--- a/libavfilter/Makefile
+++ b/libavfilter/Makefile
@@ -112,6 +112,7 @@ OBJS-$(CONFIG_DECIMATE_FILTER)   += 
vf_decimate.o
 OBJS-$(CONFIG_DEJUDDER_FILTER)   += vf_dejudder.o
 OBJS-$(CONFIG_DELOGO_FILTER) += vf_delogo.o
 OBJS-$(CONFIG_DESHAKE_FILTER)+= vf_deshake.o
+OBJS-$(CONFIG_DETELECINE_FILTER) += vf_detelecine.o
 OBJS-$(CONFIG_DRAWBOX_FILTER)+= vf_drawbox.o
 OBJS-$(CONFIG_DRAWGRID_FILTER)   += vf_drawbox.o
 OBJS-$(CONFIG_DRAWTEXT_FILTER)   += vf_drawtext.o
diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c
index 0288082..6bc01c5 100644
--- a/libavfilter/allfilters.c
+++ b/libavfilter/allfilters.c
@@ -128,6 +128,7 @@ void avfilter_register_all(void)
 REGISTER_FILTER(DEJUDDER,   dejudder,   vf);
 REGISTER_FILTER(DELOGO, delogo, vf);
 REGISTER_FILTER(DESHAKE,deshake,vf);
+REGISTER_FILTER(DETELECINE, detelecine, vf);
 REGISTER_FILTER(DRAWBOX,drawbox,vf);
 REGISTER_FILTER(DRAWGRID,   drawgrid,   vf);
 REGISTER_FILTER(DRAWTEXT,   drawtext,   vf);
diff --git a/libavfilter/vf_detelecine.c b/libavfilter/vf_detelecine.c
new file mode 100644
index 000..cb4ac0e
--- /dev/null
+++ b/libavfilter/vf_detelecine.c
@@ -0,0 +1,339 @@
+/*
+ * Copyright (c) 2015 Himangi Saraogi himangi...@gmail.com
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * @file detelecine filter.
+ */
+
+
+#include libavutil/avstring.h
+#include libavutil/imgutils.h
+#include libavutil/opt.h
+#include libavutil/pixdesc.h
+#include avfilter.h
+#include formats.h
+#include internal.h
+#include video.h
+
+typedef struct {
+const AVClass *class;
+int first_field;
+char *pattern;
+int start_frame;
+int ts_mode;
+unsigned int pattern_pos;
+unsigned int nskip_fields;
+
+AVRational pts;
+int occupied;
+
+int nb_planes;
+int planeheight[4];
+int stride[4];
+
+AVFrame *frame;
+AVFrame *temp;
+} DetelecineContext;
+
+#define OFFSET(x) offsetof(DetelecineContext, x)
+#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
+
+static const AVOption detelecine_options[] = {
+{first_field, select first field, OFFSET(first_field), 
AV_OPT_TYPE_INT,   {.i64=0}, 0, 1, FLAGS, field},
+{top,select top field first,0, AV_OPT_TYPE_CONST, 
{.i64=0}, 0, 0, FLAGS, field},
+{t,  select top field first,0, AV_OPT_TYPE_CONST, 
{.i64=0}, 0, 0, FLAGS, field},
+{bottom, select bottom field first, 0, AV_OPT_TYPE_CONST, 
{.i64=1}, 0, 0, FLAGS, field},
+{b,  select bottom field first, 0, AV_OPT_TYPE_CONST, 
{.i64=1}, 0, 0, FLAGS, field},
+{pattern, pattern that describe for how many fields a frame is to be 
displayed, OFFSET(pattern), AV_OPT_TYPE_STRING, {.str=23}, 0, 0, FLAGS},
+{start_frame, position of first frame with respect to the pattern if 
stream is cut, OFFSET(start_frame), AV_OPT_TYPE_INT, {.i64=0}, 0, 13, FLAGS},
+{ts_mode, set to choose timestamp handling as being with 

[FFmpeg-devel] [PATCH] avcodec/j2kenc: Initialize variable to silence compiler warnings

2015-03-25 Thread Himangi Saraogi
---
 libavcodec/j2kenc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/j2kenc.c b/libavcodec/j2kenc.c
index ddb0b68..a795e03 100644
--- a/libavcodec/j2kenc.c
+++ b/libavcodec/j2kenc.c
@@ -430,7 +430,7 @@ static void init_quantization(Jpeg2000EncoderContext *s)
 int nbands, lev = codsty-nreslevels - reslevelno - 1;
 nbands = reslevelno ? 3 : 1;
 for (bandno = 0; bandno  nbands; bandno++, gbandno++){
-int expn, mant;
+int expn, mant = 0;
 
 if (codsty-transform == FF_DWT97_INT){
 int bandpos = bandno + (reslevelno0),
-- 
1.9.1

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


Re: [FFmpeg-devel] [PATCH] lavfi: add inverse telecine filter

2015-03-25 Thread Michael Niedermayer
On Wed, Mar 25, 2015 at 03:38:18PM +0530, Himangi Saraogi wrote:
 This is an exact inverse of the telecine filter unlike previously existing
 pullup and fieldmatch ones.
 
 Tested on few samples generated using the telecine filter. Documentation is
 yet to be added. Added an additional parameter start_frame to allow using
 the filter for a stream that was cut. Pts handling now uses the input pts, if
 parameter ts_mode is set to 1. Not sure if this fixes the AV_desync though. 

it appears to fix it in some cases but the code is not correct

for example:
./ffmpeg -i matrixbench_mpeg2.mpg -vf telecine,detelecine test.mpg

fills the screen with error messages now


[...]

 +if (s-ts_mode)
 +outlink-current_pts = inlink-current_pts;


[...]

 +frame-pts = outlink-current_pts + outlink-frame_count * 
 av_q2d(av_inv_q(av_mul_q(outlink-frame_rate, outlink-time_base)));

iam not sure why you use AVFilterLink-current_pts, thats not the
correct field and not used by any other filter.

The inpicref-pts value from the first call represents the start time
this start time must be maintained and should still be on the
corresponding first frame that is output

similarly the telecine filter gets this wrong too and has to be fixed
as well for -vf telecine,detelecine to work. So you will have to
submit 2 patches, one fixing telecine as what telecine
does currently cannot be inverted as it looses the start time


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

Democracy is the form of government in which you can choose your dictator


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/j2kenc: Initialize variable to silence compiler warnings

2015-03-25 Thread Michael Niedermayer
On Wed, Mar 25, 2015 at 07:02:16PM +0530, Himangi Saraogi wrote:
 ---
  libavcodec/j2kenc.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

applied

thanks

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

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


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


Re: [FFmpeg-devel] [PATCH] lavf/avisynth: fix compilation, remove bundled headers

2015-03-25 Thread Roger Pack
On 3/25/15, Michael Niedermayer michae...@gmx.at wrote:
 On Tue, Mar 24, 2015 at 07:40:33PM +0100, Martin Herkt wrote:
 Merge commit 1530732 broke compilation with AviSynth enabled.

 There's really no reason to keep outdated, incompatible copies of
 these headers in the FFmpeg source tree. No one should be using
 AviSynth 2.5 either.
 ---
  compat/avisynth/avisynth_c.h   | 880
 -
  compat/avisynth/avisynth_c_25.h|  68 --
  compat/avisynth/avxsynth_c.h   | 728
 -
  .../windowsPorts/basicDataTypeConversions.h|  85 --
  compat/avisynth/windowsPorts/windows2linux.h   |  77 --
  doc/general.texi   |  23 +-
  libavformat/avisynth.c |  27 +-
  7 files changed, 35 insertions(+), 1853 deletions(-)
  delete mode 100644 compat/avisynth/avisynth_c.h
  delete mode 100644 compat/avisynth/avisynth_c_25.h
  delete mode 100644 compat/avisynth/avxsynth_c.h
  delete mode 100644
 compat/avisynth/windowsPorts/basicDataTypeConversions.h
  delete mode 100644 compat/avisynth/windowsPorts/windows2linux.h

 Stephen Hutchinson has replaced the outdated headers while this was
 stuck in the mailman que

Mine still doesn't build [at least cross compile, but I assume native]
with the same errors reported in this thread...

CC  libavformat/avisynth.o
In file included from libavformat/avisynth.c:33:0:
./compat/avisynth/avisynth_c.h: In function 'avs_is_same_colorspace':
./compat/avisynth/avisynth_c.h:363:17: error: implicit declaration of
function 'avs_is_yv12' [-Werror=implicit-function-declaration]
 || (avs_is_yv12(x)  avs_is_yv12(y));
...
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] libavcodec/exr.c : A new exr lossy compression technique B44 is added

2015-03-25 Thread Michael Niedermayer
On Tue, Mar 24, 2015 at 04:07:01PM +0530, greeshma wrote:
 The patch is made and FATE tests are done.It accepted, will submit with the
 copyrights  and signature.The code is written based on openEXR algorithm of
 B44 lossy compression and modified according to the FFmpeg code.
 
 
 From 9670e283f38b71c06457c976f3f2040c8d38bbd9 Mon Sep 17 00:00:00 2001
 From: greeshmab greeshmabalaba...@gmail.com
 Date: Tue, 24 Mar 2015 12:36:21 +0530
 Subject: [PATCH] A new exr lossy compression technique B44 is added
 
 ---
  libavcodec/exr.c | 121
 +++
  1 file changed, 121 insertions(+)
 
 diff --git a/libavcodec/exr.c b/libavcodec/exr.c
 index 6251fb7..b7114be 100644
 --- a/libavcodec/exr.c
 +++ b/libavcodec/exr.c
 @@ -770,6 +770,124 @@ static int piz_uncompress(EXRContext *s, const
 uint8_t *src, int ssize,
  return 0;
  }
 
 +
 +static void B44_unpack14 ( GetByteContext *gb, uint16_t out[16]){
 +uint16_t shift;
 +const uint8_t *r = gb-buffer;
 +av_assert0(r[2] != 0xfc);
 +out[0] = (r[0]  8) | r[1];
 +shift = (r[2]  2);
 +out[ 1] = out[ 0] + ((r[ 5]  2)  shift);
 +out[ 2] = out[ 1] + ((r[ 8]  2)  shift);
 +out[ 3] = out[ 2] + ((r[11]  2)  shift);
 +out[ 4] = out[ 0] + (((r[ 2]  4) | (r[ 3]  4))  shift);
 +out[ 5] = out[ 4] + (((r[ 5]  4) | (r[ 6]  4))  shift);
 +out[ 6] = out[ 5] + (((r[ 8]  4) | (r[ 9]  4))  shift);
 +out[ 7] = out[ 6] + (((r[11]  4) | (r[12]  4))  shift);
 +out[ 8] = out[ 4] + (((r[ 3]  2) | (r[ 4]  6))  shift);
 +out[ 9] = out[ 8] + (((r[ 6]  2) | (r[ 7]  6))  shift);
 +out[10] = out[ 9] + (((r[ 9]  2) | (r[10]  6))  shift);
 +out[11] = out[10] + (((r[12]  2) | (r[13]  6))  shift);
 +out[12] = out[ 8] + (r[ 4]   shift);
 +out[13] = out[12] + (r[ 7]   shift);
 +out[14] = out[13] + (r[10]   shift);
 +out[15] = out[14] + (r[13]   shift);
 +for (int i = 0; i  16; ++i) {  //if any out value exceeds
 16bits
 +if (out[i]  0x8000)

the patch is corrupted by linebreaks, please make sure you attach
the patch if you do not use git send-email -1

also, if the code is based on some other implementtaton this should
be mentioned in the commit message, you can edit the last commit
message with git commit --amend

also it may be needed to add a copyright statement if code has been
used from elsewhere

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] lavf/avisynth: fix compilation, remove bundled headers

2015-03-25 Thread Michael Niedermayer
On Wed, Mar 25, 2015 at 09:58:15AM -0600, Roger Pack wrote:
 On 3/25/15, Michael Niedermayer michae...@gmx.at wrote:
  On Tue, Mar 24, 2015 at 07:40:33PM +0100, Martin Herkt wrote:
  Merge commit 1530732 broke compilation with AviSynth enabled.
 
  There's really no reason to keep outdated, incompatible copies of
  these headers in the FFmpeg source tree. No one should be using
  AviSynth 2.5 either.
  ---
   compat/avisynth/avisynth_c.h   | 880
  -
   compat/avisynth/avisynth_c_25.h|  68 --
   compat/avisynth/avxsynth_c.h   | 728
  -
   .../windowsPorts/basicDataTypeConversions.h|  85 --
   compat/avisynth/windowsPorts/windows2linux.h   |  77 --
   doc/general.texi   |  23 +-
   libavformat/avisynth.c |  27 +-
   7 files changed, 35 insertions(+), 1853 deletions(-)
   delete mode 100644 compat/avisynth/avisynth_c.h
   delete mode 100644 compat/avisynth/avisynth_c_25.h
   delete mode 100644 compat/avisynth/avxsynth_c.h
   delete mode 100644
  compat/avisynth/windowsPorts/basicDataTypeConversions.h
   delete mode 100644 compat/avisynth/windowsPorts/windows2linux.h
 
  Stephen Hutchinson has replaced the outdated headers while this was
  stuck in the mailman que
 
 Mine still doesn't build [at least cross compile, but I assume native]
 with the same errors reported in this thread...
 
 CClibavformat/avisynth.o
 In file included from libavformat/avisynth.c:33:0:
 ./compat/avisynth/avisynth_c.h: In function 'avs_is_same_colorspace':
 ./compat/avisynth/avisynth_c.h:363:17: error: implicit declaration of
 function 'avs_is_yv12' [-Werror=implicit-function-declaration]
  || (avs_is_yv12(x)  avs_is_yv12(y));

ive applied patch 4 from the patchset too, does that fix it ?
if not please check the remaining 2 patches, i had not applied them
as they remove 2.5 support and i wanted to wait first to see if
someone posts a solution that keeps 2.5 support but if not ill apply
them too or if they are needed for build on non 2.5

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

DNS cache poisoning attacks, popular search engine, Google internet authority
dont be evil, please


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/avisynth: fix compilation, remove bundled headers

2015-03-25 Thread Stephen Hutchinson
On Wed, Mar 25, 2015 at 12:49 PM, Michael Niedermayer michae...@gmx.at wrote:
 ive applied patch 4 from the patchset too, does that fix it ?
 if not please check the remaining 2 patches, i had not applied them
 as they remove 2.5 support and i wanted to wait first to see if
 someone posts a solution that keeps 2.5 support but if not ill apply
 them too or if they are needed for build on non 2.5


Even if manages to build, the changes from AVSC_INLINE to
AVSC_API for those functions in the header will cause 2.5 to crash
if someone tries using it.  Reimplemented versions of those
functions would have to be added to the compat header (and as
I mentioned on the mail for the 2.5 drop patch, it'd require
navigating potential license potholes, and for 2.5 it just really isn't
worth it).

The ideal solution per patch #4 would be to figure out why the exact
same headers trip -Werror=implicit-function-declaration in FFmpeg
while they don't in Libav.  Somehow I doubt it's only because of
Libav's use of check_header in the --enable-avisynth configure check.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avfilter/vf_telecine: Add ts_mode option for using the first input timestamp

2015-03-25 Thread Carl Eugen Hoyos
Himangi Saraogi himangi774 at gmail.com writes:

 +{ts_mode, set to choose timestamp handling as 
 being with respect to the input, OFFSET(ts_mode),

Isn't the new behaviour that you implemented a bug fix?
I believe this option is not necessary, just change the 
behaviour. Or do I miss a usecase?

Thank you, Carl Eugen

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


Re: [FFmpeg-devel] [PATCH] avfilter/vf_telecine: Add ts_mode option for using the first input timestamp

2015-03-25 Thread Paul B Mahol
Dana 25. 3. 2015. 19:07 osoba Himangi Saraogi himangi...@gmail.com
napisala je:

 ---
  libavfilter/vf_telecine.c | 12 +++-
  1 file changed, 11 insertions(+), 1 deletion(-)

 diff --git a/libavfilter/vf_telecine.c b/libavfilter/vf_telecine.c
 index a0f28d4..aaad2b5 100644
 --- a/libavfilter/vf_telecine.c
 +++ b/libavfilter/vf_telecine.c
 @@ -38,6 +38,8 @@ typedef struct {
  int first_field;
  char *pattern;
  unsigned int pattern_pos;
 +int ts_mode;
 +int64_t start_time;

  AVRational pts;
  double ts_unit;
 @@ -62,6 +64,7 @@ static const AVOption telecine_options[] = {
  {bottom, select bottom field first, 0,
AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, FLAGS, field},
  {b,  select bottom field first, 0,
AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, FLAGS, field},
  {pattern, pattern that describe for how many fields a frame is to
be displayed, OFFSET(pattern), AV_OPT_TYPE_STRING, {.str=23}, 0, 0,
FLAGS},
 +{ts_mode, set to choose timestamp handling as being with respect
to the input, OFFSET(ts_mode), AV_OPT_TYPE_INT, {.i64=0}, 0, 1, FLAGS},
  {NULL}

Why ts_mode is not by default 1?

  };

 @@ -89,6 +92,10 @@ static av_cold int init(AVFilterContext *ctx)
  s-pts.den += *p - '0';
  }

 +s-start_time = 0;
 +if (s-ts_mode)
 + s-start_time = -1;
 +
  s-out_cnt = (max + 1) / 2;
  av_log(ctx, AV_LOG_INFO, Telecine pattern %s yields up to %d frames
per frame, pts advance factor: %d/%d\n,
 s-pattern, s-out_cnt, s-pts.num, s-pts.den);
 @@ -173,6 +180,9 @@ static int filter_frame(AVFilterLink *inlink, AVFrame
*inpicref)
  TelecineContext *s = ctx-priv;
  int i, len, ret = 0, nout = 0;

 +if (s-start_time  0)
 +s-start_time = inpicref-pts;
 +
  len = s-pattern[s-pattern_pos] - '0';

  s-pattern_pos++;
 @@ -235,7 +245,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame
*inpicref)
  return AVERROR(ENOMEM);
  }

 -frame-pts = outlink-frame_count * s-ts_unit;
 +frame-pts = s-start_time + outlink-frame_count * s-ts_unit;
  ret = ff_filter_frame(outlink, frame);
  }
  av_frame_free(inpicref);
 --
 1.9.1

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


[FFmpeg-devel] [PATCH] avfilter/vf_telecine: Fix AV desync by using the first input timestamp

2015-03-25 Thread Himangi Saraogi
---
 libavfilter/vf_telecine.c | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/libavfilter/vf_telecine.c b/libavfilter/vf_telecine.c
index a0f28d4..4b46ac4 100644
--- a/libavfilter/vf_telecine.c
+++ b/libavfilter/vf_telecine.c
@@ -38,6 +38,7 @@ typedef struct {
 int first_field;
 char *pattern;
 unsigned int pattern_pos;
+int64_t start_time;
 
 AVRational pts;
 double ts_unit;
@@ -89,6 +90,8 @@ static av_cold int init(AVFilterContext *ctx)
 s-pts.den += *p - '0';
 }
 
+s-start_time = -1;
+
 s-out_cnt = (max + 1) / 2;
 av_log(ctx, AV_LOG_INFO, Telecine pattern %s yields up to %d frames per 
frame, pts advance factor: %d/%d\n,
s-pattern, s-out_cnt, s-pts.num, s-pts.den);
@@ -173,6 +176,9 @@ static int filter_frame(AVFilterLink *inlink, AVFrame 
*inpicref)
 TelecineContext *s = ctx-priv;
 int i, len, ret = 0, nout = 0;
 
+if (s-start_time  0)
+s-start_time = inpicref-pts;
+
 len = s-pattern[s-pattern_pos] - '0';
 
 s-pattern_pos++;
@@ -235,7 +241,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame 
*inpicref)
 return AVERROR(ENOMEM);
 }
 
-frame-pts = outlink-frame_count * s-ts_unit;
+frame-pts = s-start_time + outlink-frame_count * s-ts_unit;
 ret = ff_filter_frame(outlink, frame);
 }
 av_frame_free(inpicref);
-- 
1.9.1

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


Re: [FFmpeg-devel] [PATCH 2/4] avisynth: drop support of AviSynth 2.5

2015-03-25 Thread Michael Niedermayer
On Tue, Mar 24, 2015 at 03:23:30PM -0400, Stephen Hutchinson wrote:
 If the user attempts to use AviSynth 2.5, an error message will
 now tell them they need to upgrade.
 ---
  compat/avisynth/avisynth_c_25.h | 68 
 -
  libavformat/avisynth.c  | 23 +-
  2 files changed, 15 insertions(+), 76 deletions(-)
  delete mode 100644 compat/avisynth/avisynth_c_25.h

applied

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

I know you won't believe me, but the highest form of Human Excellence is
to question oneself and others. -- Socrates


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


Re: [FFmpeg-devel] [PATCH] avfilter/vf_telecine: Add ts_mode option for using the first input timestamp

2015-03-25 Thread Himangi Saraogi
On 26 March 2015 at 00:06, Carl Eugen Hoyos ceho...@ag.or.at wrote:

 Himangi Saraogi himangi774 at gmail.com writes:

  +{ts_mode, set to choose timestamp handling as
  being with respect to the input, OFFSET(ts_mode),

 Isn't the new behaviour that you implemented a bug fix?
 I believe this option is not necessary, just change the
 behaviour. Or do I miss a usecase?


Micheal suggested adding the option. I would like his opinion here.



 Thank you, Carl Eugen

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

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


Re: [FFmpeg-devel] [PATCH] lavf/avisynth: fix compilation, remove bundled headers

2015-03-25 Thread Michael Niedermayer
On Wed, Mar 25, 2015 at 01:59:18PM -0400, Stephen Hutchinson wrote:
 On Wed, Mar 25, 2015 at 12:49 PM, Michael Niedermayer michae...@gmx.at 
 wrote:
  ive applied patch 4 from the patchset too, does that fix it ?
  if not please check the remaining 2 patches, i had not applied them
  as they remove 2.5 support and i wanted to wait first to see if
  someone posts a solution that keeps 2.5 support but if not ill apply
  them too or if they are needed for build on non 2.5
 
 
 Even if manages to build, the changes from AVSC_INLINE to
 AVSC_API for those functions in the header will cause 2.5 to crash
 if someone tries using it.  Reimplemented versions of those
 functions would have to be added to the compat header (and as
 I mentioned on the mail for the 2.5 drop patch, it'd require
 navigating potential license potholes, and for 2.5 it just really isn't
 worth it).

applied the patches


 
 The ideal solution per patch #4 would be to figure out why the exact
 same headers trip -Werror=implicit-function-declaration in FFmpeg
 while they don't in Libav.  Somehow I doubt it's only because of
 Libav's use of check_header in the --enable-avisynth configure check.

If i had to guess, i would say its because some compilers have an
exception for headers in some directories so that warnings in them
dont trigger build failures. IIUC this is needed due to the high
quality of some system headers, which otherwise would prevent the use
of some -Werror= options entirely

If thats correct then theres a problem in the headers in either case

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

Democracy is the form of government in which you can choose your dictator


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


Re: [FFmpeg-devel] [PATCH 3/4] doc: remove the reference to supporting AviSynth 2.5

2015-03-25 Thread Michael Niedermayer
On Tue, Mar 24, 2015 at 03:23:31PM -0400, Stephen Hutchinson wrote:
 ---
  doc/general.texi | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

applied

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


[FFmpeg-devel] [PATCH] lavfi: add inverse telecine filter

2015-03-25 Thread Himangi Saraogi
This is an exact inverse of the telecine filter. All parameters passed are same
as those to the telecine filter, except for an additional parameter
start_frame to allow using the filter for a stream that was cut.

---
Tested on samples generated using the telecine filter.

 Changelog   |   2 +-
 libavfilter/Makefile|   1 +
 libavfilter/allfilters.c|   1 +
 libavfilter/vf_detelecine.c | 343 
 4 files changed, 346 insertions(+), 1 deletion(-)
 create mode 100644 libavfilter/vf_detelecine.c

diff --git a/Changelog b/Changelog
index b0d0414..3054b2e 100644
--- a/Changelog
+++ b/Changelog
@@ -9,7 +9,7 @@ version next:
 - libdcadec wrapper
 - Drop support for nvenc API before 5.0
 - nvenc H265 encoder
-
+- Detelecine filter
 
 version 2.6:
 - nvenc encoder
diff --git a/libavfilter/Makefile b/libavfilter/Makefile
index 2cde029..73e7adf 100644
--- a/libavfilter/Makefile
+++ b/libavfilter/Makefile
@@ -112,6 +112,7 @@ OBJS-$(CONFIG_DECIMATE_FILTER)   += 
vf_decimate.o
 OBJS-$(CONFIG_DEJUDDER_FILTER)   += vf_dejudder.o
 OBJS-$(CONFIG_DELOGO_FILTER) += vf_delogo.o
 OBJS-$(CONFIG_DESHAKE_FILTER)+= vf_deshake.o
+OBJS-$(CONFIG_DETELECINE_FILTER) += vf_detelecine.o
 OBJS-$(CONFIG_DRAWBOX_FILTER)+= vf_drawbox.o
 OBJS-$(CONFIG_DRAWGRID_FILTER)   += vf_drawbox.o
 OBJS-$(CONFIG_DRAWTEXT_FILTER)   += vf_drawtext.o
diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c
index 0288082..6bc01c5 100644
--- a/libavfilter/allfilters.c
+++ b/libavfilter/allfilters.c
@@ -128,6 +128,7 @@ void avfilter_register_all(void)
 REGISTER_FILTER(DEJUDDER,   dejudder,   vf);
 REGISTER_FILTER(DELOGO, delogo, vf);
 REGISTER_FILTER(DESHAKE,deshake,vf);
+REGISTER_FILTER(DETELECINE, detelecine, vf);
 REGISTER_FILTER(DRAWBOX,drawbox,vf);
 REGISTER_FILTER(DRAWGRID,   drawgrid,   vf);
 REGISTER_FILTER(DRAWTEXT,   drawtext,   vf);
diff --git a/libavfilter/vf_detelecine.c b/libavfilter/vf_detelecine.c
new file mode 100644
index 000..f0c5c6a
--- /dev/null
+++ b/libavfilter/vf_detelecine.c
@@ -0,0 +1,343 @@
+/*
+ * Copyright (c) 2015 Himangi Saraogi himangi...@gmail.com
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * @file detelecine filter.
+ */
+
+
+#include libavutil/avstring.h
+#include libavutil/imgutils.h
+#include libavutil/opt.h
+#include libavutil/pixdesc.h
+#include avfilter.h
+#include formats.h
+#include internal.h
+#include video.h
+
+typedef struct {
+const AVClass *class;
+int first_field;
+char *pattern;
+int start_frame;
+unsigned int pattern_pos;
+unsigned int nskip_fields;
+int64_t start_time;
+
+AVRational pts;
+double ts_unit;
+int occupied;
+
+int nb_planes;
+int planeheight[4];
+int stride[4];
+
+AVFrame *frame;
+AVFrame *temp;
+} DetelecineContext;
+
+#define OFFSET(x) offsetof(DetelecineContext, x)
+#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
+
+static const AVOption detelecine_options[] = {
+{first_field, select first field, OFFSET(first_field), 
AV_OPT_TYPE_INT,   {.i64=0}, 0, 1, FLAGS, field},
+{top,select top field first,0, 
AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, FLAGS, field},
+{t,  select top field first,0, 
AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, FLAGS, field},
+{bottom, select bottom field first, 0, 
AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, FLAGS, field},
+{b,  select bottom field first, 0, 
AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, FLAGS, field},
+{pattern, pattern that describe for how many fields a frame is to be 
displayed, OFFSET(pattern), AV_OPT_TYPE_STRING, {.str=23}, 0, 0, FLAGS},
+{start_frame, position of first frame with respect to the pattern if 
stream is cut, OFFSET(start_frame), AV_OPT_TYPE_INT, {.i64=0}, 0, 13, FLAGS},
+{NULL}
+};
+
+AVFILTER_DEFINE_CLASS(detelecine);
+
+static av_cold int init(AVFilterContext *ctx)
+{
+DetelecineContext *s = ctx-priv;
+const char *p;
+int max = 0;
+
+if 

Re: [FFmpeg-devel] [PATCH] avfilter/vf_telecine: Fix AV desync by using the first input timestamp

2015-03-25 Thread Michael Niedermayer
On Thu, Mar 26, 2015 at 01:16:16AM +0530, Himangi Saraogi wrote:
 ---
  libavfilter/vf_telecine.c | 8 +++-
  1 file changed, 7 insertions(+), 1 deletion(-)
 
 diff --git a/libavfilter/vf_telecine.c b/libavfilter/vf_telecine.c
 index a0f28d4..4b46ac4 100644
 --- a/libavfilter/vf_telecine.c
 +++ b/libavfilter/vf_telecine.c
 @@ -38,6 +38,7 @@ typedef struct {
  int first_field;
  char *pattern;
  unsigned int pattern_pos;
 +int64_t start_time;
  
  AVRational pts;
  double ts_unit;
 @@ -89,6 +90,8 @@ static av_cold int init(AVFilterContext *ctx)
  s-pts.den += *p - '0';
  }
  
 +s-start_time = -1;

should be AV_NOPTS_VALUE
timestaps can be negative so -1 could occur as a normal start time

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

During times of universal deceit, telling the truth becomes a
revolutionary act. -- George Orwell


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


[FFmpeg-devel] [PATCH] avfilter/vf_telecine: Fix AV desync by using the first input timestamp

2015-03-25 Thread Himangi Saraogi
---
 libavfilter/vf_telecine.c | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/libavfilter/vf_telecine.c b/libavfilter/vf_telecine.c
index a0f28d4..9789f37 100644
--- a/libavfilter/vf_telecine.c
+++ b/libavfilter/vf_telecine.c
@@ -38,6 +38,7 @@ typedef struct {
 int first_field;
 char *pattern;
 unsigned int pattern_pos;
+int64_t start_time;
 
 AVRational pts;
 double ts_unit;
@@ -89,6 +90,8 @@ static av_cold int init(AVFilterContext *ctx)
 s-pts.den += *p - '0';
 }
 
+s-start_time = AV_NOPTS_VALUE;
+
 s-out_cnt = (max + 1) / 2;
 av_log(ctx, AV_LOG_INFO, Telecine pattern %s yields up to %d frames per 
frame, pts advance factor: %d/%d\n,
s-pattern, s-out_cnt, s-pts.num, s-pts.den);
@@ -173,6 +176,9 @@ static int filter_frame(AVFilterLink *inlink, AVFrame 
*inpicref)
 TelecineContext *s = ctx-priv;
 int i, len, ret = 0, nout = 0;
 
+if (s-start_time == AV_NOPTS_VALUE)
+s-start_time = inpicref-pts;
+
 len = s-pattern[s-pattern_pos] - '0';
 
 s-pattern_pos++;
@@ -235,7 +241,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame 
*inpicref)
 return AVERROR(ENOMEM);
 }
 
-frame-pts = outlink-frame_count * s-ts_unit;
+frame-pts = s-start_time + outlink-frame_count * s-ts_unit;
 ret = ff_filter_frame(outlink, frame);
 }
 av_frame_free(inpicref);
-- 
1.9.1

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


Re: [FFmpeg-devel] [PATCH] avfilter/vf_telecine: Fix AV desync by using the first input timestamp

2015-03-25 Thread Carl Eugen Hoyos
Himangi Saraogi himangi774 at gmail.com writes:

 -frame-pts = outlink-frame_count * s-ts_unit;
 +frame-pts = s-start_time + outlink-frame_count * s-ts_unit;

I believe this should be:
 frame-pts = s-start_time != AV_NOPTS_VALUE ? s-start_time : 0 +
  outlink-frame_count * s-ts_unit;

possibly with a different formatting...

Carl Eugen

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


Re: [FFmpeg-devel] [PATCH] avcodec/nvenc: Add support for H.265 encoding

2015-03-25 Thread Philip Langdale
On Wed, 25 Mar 2015 21:52:54 + (UTC)
Ali KIZIL aliki...@gmail.com wrote:

 
 The update broken the general usage:
 
 ./ffmpeg -loglevel info -re -i /root/bunny.mp4 -vcodec nvenc -preset
 hp -fflags +genpts -vb 24000k -minrate 24000k -maxrate 24000k
 -bufsize 48000k -muxrate 26000k -cbr 1 -2pass 0 -r 50 -g 100 -pix_fmt
 yuv420p - acodec aac -strict -2 -ac 2 -ar 48000 -ab 256k
 -flush_packets 0 - packetsize 188 -y -f mpegts out.ts
 
 ./ffmpeg -loglevel info -re -i /root/bunny.mp4 -vcodec nvenc_h265 -
 preset hp -fflags +genpts -vb 24000k -minrate 24000k -maxrate 24000k -
 bufsize 48000k -muxrate 26000k -cbr 1 -2pass 0 -r 50 -g 100 -pix_fmt 
 yuv420p -acodec aac -strict -2 -ac 2 -ar 48000 -ab 256k
 -flush_packets 0 -packetsize 188 -y -f mpegts out.ts
 
 FFmpeg stucks, does not work for both. 
 
 Before with nvenc work working fine with above commands. It looks
 like - g parameter, -muxrate, -flush_packtes stuck FFmpeg with this
 update. 
 
 Below line works:
 
 ./ffmpeg -loglevel verbose -i /root/bunny.mp4 -vcodec nvenc_h265
 -preset hp -r 50  -y -f mpegts out.ts

Yes - it's because I tried to share the class instance between the two
encoders, which doesn't work. I'm about to push a fix. Thanks for the
heads up.

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


Re: [FFmpeg-devel] [PATCH] avcodec/nvenc: Add support for H.265 encoding

2015-03-25 Thread Ali KIZIL
Philip Langdale philipl at overt.org writes:

 
 On Tue, 24 Mar 2015 09:54:13 +0100
 Timo Rothenpieler timo at rothenpieler.org wrote:
 
  Yes, I did exactly that in my implementation:
  
  https://github.com/BtbN/FFmpeg/commits/nvenc
  
  The code i wrote there is completely untested(Except that h264 still 
  works), because i don't have any compatible hardware, so the one you 
  tested is clearly the one that should be prefered.
  
  Dropping SDK 5 support is fine with me, as long as it's not
  backported to 2.6. The primary gain from supporting the old SDK is
  that it works with much older nvidia driver versions.
  
  I'll submit the patch that drops the old API support, so you can
  rebase your patch on top of it.
  
  Looks good to merge otherwise.
  
 
 I've taken your logic to check the SM version - I had been
 wondering how old hardware should be detected and excluded.
 
 I've also noticed that the profile handling code is completely broken 
-
 you can't set a profile using -profile:v - it appears we're handling
 this in an incorrect way - but I'm not sure what correct is. libx264
 has its own profile option which appears to be necessary but then I
 don't understand what sets avctx-profile.
 
 Anyway, that's a separate problem we can solve independently of h.265.
 
 Thanks!
 
 --phil
 

The update broken the general usage:

./ffmpeg -loglevel info -re -i /root/bunny.mp4 -vcodec nvenc -preset hp 
-fflags +genpts -vb 24000k -minrate 24000k -maxrate 24000k -bufsize 
48000k -muxrate 26000k -cbr 1 -2pass 0 -r 50 -g 100 -pix_fmt yuv420p -
acodec aac -strict -2 -ac 2 -ar 48000 -ab 256k -flush_packets 0 -
packetsize 188 -y -f mpegts out.ts

./ffmpeg -loglevel info -re -i /root/bunny.mp4 -vcodec nvenc_h265 -
preset hp -fflags +genpts -vb 24000k -minrate 24000k -maxrate 24000k -
bufsize 48000k -muxrate 26000k -cbr 1 -2pass 0 -r 50 -g 100 -pix_fmt 
yuv420p -acodec aac -strict -2 -ac 2 -ar 48000 -ab 256k -flush_packets 0 
-packetsize 188 -y -f mpegts out.ts

FFmpeg stucks, does not work for both. 

Before with nvenc work working fine with above commands. It looks like -
g parameter, -muxrate, -flush_packtes stuck FFmpeg with this update. 

Below line works:

./ffmpeg -loglevel verbose -i /root/bunny.mp4 -vcodec nvenc_h265 -preset 
hp -r 50  -y -f mpegts out.ts




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


[FFmpeg-devel] Default dynamic range compression on AC3

2015-03-25 Thread Wiebe Cazemier
Hi,

What started as a question at the Kodi (XMBC) forum ([1]) on how to turn off 
Dolby Digital (AC3) dynamic range compression, turned into a patch and then a 
discussion on Github [2] about the default value for the AC3 dynamic range 
compression.

Kodi, using ffmpeg, didn't set the 'drc_scale' option to avcodec, resulting in 
the DRC meta data embedded in AC3 streams being applied, to arrive at a 
compressed output. On virtually every hardware and software decoder I've seen, 
DRC has been on by default (currently trying to write a patch to VLC, having 
the same issue). This has led me to the hypothesis that this is why people 
think DTS and AAC sound better than AC3. It does for most people, but it 
doesn't have to. AC3 is given an unfair disadvantage because as far as I know, 
it's the only codec with this meta data embedded and for some reason, 
developers/manufacturers have chosen to enable it by default, even in high-end 
receivers. 

See this [2] particular post with recordings and waveform screenshots of the 
difference with DRC on and off.

So I was wondering if the default of 1 for drc_scale was chosen purposefully or 
not. I feel very strongly that it should be 0 by default, because I don't see 
why streams with AC3 (as opposed to DTS, AAC, PCM, whatever) as audio should be 
treated differently if the user didn't ask for it. 

Regards,

Wiebe


[1] http://forum.kodi.tv/showthread.php?tid=219228
[2] https://github.com/xbmc/xbmc/pull/6820
[3] http://forum.kodi.tv/showthread.php?tid=219228pid=1958799#pid1958799
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avcodec/nvenc: Add support for H.265 encoding

2015-03-25 Thread Michael Niedermayer
On Mon, Mar 23, 2015 at 09:41:25PM -0700, Philip Langdale wrote:
 Sufficiently new nvenc hardware (GM20x or later) has support for H.265
 encoding. This works the same as the H.264 encoder except the
 codec parameters are different.
 
 Due to the fact that common codec parameters are not shareable, there's
 quite a bit of conditional logic you'd wish we could do without, but
 such is life.
 
 Note that this feature requires the 5.0 SDK or newer to compile. I'm not
 sure what we gain from supporting the older SDKs, so I'm inclined to
 make this unconditional and remove the  5 support that currently exists.
 
 Signed-off-by: Philip Langdale phil...@overt.org

theres a comment on github about this:
see:
https://github.com/FFmpeg/FFmpeg/commit/21175d8586d368f5f0b2ed0edda22f8f1c108330#commitcomment-10400533

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

The worst form of inequality is to try to make unequal things equal.
-- Aristotle


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


[FFmpeg-devel] [PATCH] avfilter/vf_telecine: Fix AV desync by using the first input timestamp

2015-03-25 Thread Himangi Saraogi
---
 libavfilter/vf_telecine.c | 9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/libavfilter/vf_telecine.c b/libavfilter/vf_telecine.c
index a0f28d4..c75395a 100644
--- a/libavfilter/vf_telecine.c
+++ b/libavfilter/vf_telecine.c
@@ -38,6 +38,7 @@ typedef struct {
 int first_field;
 char *pattern;
 unsigned int pattern_pos;
+int64_t start_time;
 
 AVRational pts;
 double ts_unit;
@@ -89,6 +90,8 @@ static av_cold int init(AVFilterContext *ctx)
 s-pts.den += *p - '0';
 }
 
+s-start_time = AV_NOPTS_VALUE;
+
 s-out_cnt = (max + 1) / 2;
 av_log(ctx, AV_LOG_INFO, Telecine pattern %s yields up to %d frames per 
frame, pts advance factor: %d/%d\n,
s-pattern, s-out_cnt, s-pts.num, s-pts.den);
@@ -173,6 +176,9 @@ static int filter_frame(AVFilterLink *inlink, AVFrame 
*inpicref)
 TelecineContext *s = ctx-priv;
 int i, len, ret = 0, nout = 0;
 
+if (s-start_time == AV_NOPTS_VALUE)
+s-start_time = inpicref-pts;
+
 len = s-pattern[s-pattern_pos] - '0';
 
 s-pattern_pos++;
@@ -235,7 +241,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame 
*inpicref)
 return AVERROR(ENOMEM);
 }
 
-frame-pts = outlink-frame_count * s-ts_unit;
+frame-pts = ((s-start_time == AV_NOPTS_VALUE) ? 0 : s-start_time) +
+ outlink-frame_count * s-ts_unit;
 ret = ff_filter_frame(outlink, frame);
 }
 av_frame_free(inpicref);
-- 
1.9.1

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


[FFmpeg-devel] [PATCH] lavfi: add inverse telecine filter

2015-03-25 Thread Himangi Saraogi
This is an exact inverse of the telecine filter. All parameters passed are same
as those to the telecine filter, except for an additional parameter
start_frame to allow using the filter for a stream that was cut.

---
Tested on samples generated using the telecine filter.

 Changelog   |   2 +-
 libavfilter/Makefile|   1 +
 libavfilter/allfilters.c|   1 +
 libavfilter/vf_detelecine.c | 344 
 4 files changed, 347 insertions(+), 1 deletion(-)
 create mode 100644 libavfilter/vf_detelecine.c

diff --git a/Changelog b/Changelog
index b0d0414..3054b2e 100644
--- a/Changelog
+++ b/Changelog
@@ -9,7 +9,7 @@ version next:
 - libdcadec wrapper
 - Drop support for nvenc API before 5.0
 - nvenc H265 encoder
-
+- Detelecine filter
 
 version 2.6:
 - nvenc encoder
diff --git a/libavfilter/Makefile b/libavfilter/Makefile
index 2cde029..73e7adf 100644
--- a/libavfilter/Makefile
+++ b/libavfilter/Makefile
@@ -112,6 +112,7 @@ OBJS-$(CONFIG_DECIMATE_FILTER)   += 
vf_decimate.o
 OBJS-$(CONFIG_DEJUDDER_FILTER)   += vf_dejudder.o
 OBJS-$(CONFIG_DELOGO_FILTER) += vf_delogo.o
 OBJS-$(CONFIG_DESHAKE_FILTER)+= vf_deshake.o
+OBJS-$(CONFIG_DETELECINE_FILTER) += vf_detelecine.o
 OBJS-$(CONFIG_DRAWBOX_FILTER)+= vf_drawbox.o
 OBJS-$(CONFIG_DRAWGRID_FILTER)   += vf_drawbox.o
 OBJS-$(CONFIG_DRAWTEXT_FILTER)   += vf_drawtext.o
diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c
index 0288082..6bc01c5 100644
--- a/libavfilter/allfilters.c
+++ b/libavfilter/allfilters.c
@@ -128,6 +128,7 @@ void avfilter_register_all(void)
 REGISTER_FILTER(DEJUDDER,   dejudder,   vf);
 REGISTER_FILTER(DELOGO, delogo, vf);
 REGISTER_FILTER(DESHAKE,deshake,vf);
+REGISTER_FILTER(DETELECINE, detelecine, vf);
 REGISTER_FILTER(DRAWBOX,drawbox,vf);
 REGISTER_FILTER(DRAWGRID,   drawgrid,   vf);
 REGISTER_FILTER(DRAWTEXT,   drawtext,   vf);
diff --git a/libavfilter/vf_detelecine.c b/libavfilter/vf_detelecine.c
new file mode 100644
index 000..88796b0
--- /dev/null
+++ b/libavfilter/vf_detelecine.c
@@ -0,0 +1,344 @@
+/*
+ * Copyright (c) 2015 Himangi Saraogi himangi...@gmail.com
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * @file detelecine filter.
+ */
+
+
+#include libavutil/avstring.h
+#include libavutil/imgutils.h
+#include libavutil/opt.h
+#include libavutil/pixdesc.h
+#include avfilter.h
+#include formats.h
+#include internal.h
+#include video.h
+
+typedef struct {
+const AVClass *class;
+int first_field;
+char *pattern;
+int start_frame;
+unsigned int pattern_pos;
+unsigned int nskip_fields;
+int64_t start_time;
+
+AVRational pts;
+double ts_unit;
+int occupied;
+
+int nb_planes;
+int planeheight[4];
+int stride[4];
+
+AVFrame *frame;
+AVFrame *temp;
+} DetelecineContext;
+
+#define OFFSET(x) offsetof(DetelecineContext, x)
+#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
+
+static const AVOption detelecine_options[] = {
+{first_field, select first field, OFFSET(first_field), 
AV_OPT_TYPE_INT,   {.i64=0}, 0, 1, FLAGS, field},
+{top,select top field first,0, 
AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, FLAGS, field},
+{t,  select top field first,0, 
AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, FLAGS, field},
+{bottom, select bottom field first, 0, 
AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, FLAGS, field},
+{b,  select bottom field first, 0, 
AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, FLAGS, field},
+{pattern, pattern that describe for how many fields a frame is to be 
displayed, OFFSET(pattern), AV_OPT_TYPE_STRING, {.str=23}, 0, 0, FLAGS},
+{start_frame, position of first frame with respect to the pattern if 
stream is cut, OFFSET(start_frame), AV_OPT_TYPE_INT, {.i64=0}, 0, 13, FLAGS},
+{NULL}
+};
+
+AVFILTER_DEFINE_CLASS(detelecine);
+
+static av_cold int init(AVFilterContext *ctx)
+{
+DetelecineContext *s = ctx-priv;
+const char *p;
+int max = 0;
+
+if 

[FFmpeg-devel] [PATCH 0/4] [GSoC] Browsing content on the server qualification task (2nd iteration)

2015-03-25 Thread Mariusz Szczepańczyk
Hi,

this set of patches contains my second take on qualification task for Browsing 
content on the server project. Specifically, it adds directory listing api 
originally written by Lukasz Marek with a couple of fixes responding to the 
submitted remarks and my implementation of samba protocol. I left out commits 
with other protocols as they are not part of the qualification task.


Differences from the first iteration:

* Changed AVIODirEntry.type's type from enum AVIODirEntryType to int.

* Changed types of some other fields of AVIODirEntry to int64_t so they can be 
assigned an unknown value (-1) + added documentation on unknown values.

* Added ff_alloc_dir_entry for allocating AVIODirEntry with default (unknown) 
values.

* Documented lifetime of AVIODirEntry.

* Added new struct AVIODirContext and changed api so functions take this 
instead of void as arguments:

 int avio_open_dir(AVIODirContext **s, const char *url, AVDictionary **options);
 int avio_read_dir(AVIODirContext *s, AVIODirEntry **next);
 int avio_close_dir(AVIODirContext **s);

* Added missing tests results of av_append_path_component() to 
tests/ref/fate/avstring.

* Clarified documentation in a couple of places.

* Introduced several cosmetic changes.

Regards,
Mariusz


Lukasz Marek (3):
  lavf: add directory listing API
  doc/examples: add directory listing example
  lavu/avstring: add av_append_path_component() funcion

Mariusz Szczepańczyk (1):
  lavf/libsmbclient: implement directory listing callbacks

 .gitignore   |   1 +
 configure|   2 +
 doc/Makefile |   1 +
 doc/examples/Makefile|   3 +-
 doc/examples/avio_list_dir.c | 105 +++
 libavformat/avio.c   |  74 ++
 libavformat/avio.h   |  84 +-
 libavformat/libsmbclient.c   |  93 ++
 libavformat/url.c|  16 +++
 libavformat/url.h|  10 +
 libavutil/avstring.c |  43 ++
 libavutil/avstring.h |  10 +
 tests/ref/fate/avstring  |   9 
 13 files changed, 449 insertions(+), 2 deletions(-)
 create mode 100644 doc/examples/avio_list_dir.c

-- 
2.3.3

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


[FFmpeg-devel] [PATCH 4/4] lavf/libsmbclient: implement directory listing callbacks

2015-03-25 Thread Mariusz Szczepańczyk
---
 libavformat/libsmbclient.c | 93 ++
 1 file changed, 93 insertions(+)

diff --git a/libavformat/libsmbclient.c b/libavformat/libsmbclient.c
index 8290d75..b800a31 100644
--- a/libavformat/libsmbclient.c
+++ b/libavformat/libsmbclient.c
@@ -28,6 +28,7 @@
 typedef struct {
 const AVClass *class;
 SMBCCTX *ctx;
+int dh;
 int fd;
 int64_t filesize;
 int trunc;
@@ -182,6 +183,95 @@ static int libsmbc_write(URLContext *h, const unsigned 
char *buf, int size)
 return bytes_written;
 }
 
+static int libsmbc_open_dir(URLContext *h)
+{
+LIBSMBContext *libsmbc = h-priv_data;
+int ret;
+
+if ((ret = libsmbc_connect(h))  0)
+goto fail;
+
+if ((libsmbc-dh = smbc_opendir(h-filename))  0) {
+ret = AVERROR(errno);
+av_log(h, AV_LOG_ERROR, Error opening dir: %s\n, strerror(errno));
+goto fail;
+}
+
+return 0;
+
+  fail:
+libsmbc_close(h);
+return ret;
+}
+
+static int libsmbc_read_dir(URLContext *h, AVIODirEntry **next)
+{
+LIBSMBContext *libsmbc = h-priv_data;
+AVIODirEntry *entry;
+struct smbc_dirent *dirent = NULL;
+char *url = NULL;
+
+*next = entry = ff_alloc_dir_entry();
+if (!entry)
+return AVERROR(ENOMEM);
+
+do {
+dirent = smbc_readdir(libsmbc-dh);
+if (!dirent) {
+av_freep(next);
+return 0;
+}
+} while (!strcmp(dirent-name, .) || !strcmp(dirent-name, ..));
+
+entry-name = av_strdup(dirent-name);
+if (!entry-name) {
+av_freep(next);
+return AVERROR(ENOMEM);
+}
+
+url = av_append_path_component(h-filename, dirent-name);
+if (url) {
+struct stat st;
+if (!smbc_stat(url, st)) {
+entry-group_id = st.st_gid;
+entry-user_id = st.st_uid;
+entry-size = st.st_size;
+entry-filemode = st.st_mode  0777;
+entry-modification_timestamp = INT64_C(100) * st.st_mtime;
+entry-access_timestamp =  INT64_C(100) * st.st_atime;
+entry-status_change_timestamp = INT64_C(100) * st.st_ctime;
+}
+av_free(url);
+}
+
+switch (dirent-smbc_type) {
+case SMBC_DIR:
+entry-type = AVIO_ENTRY_DIRECTORY;
+break;
+case SMBC_FILE:
+entry-type = AVIO_ENTRY_FILE;
+break;
+default:
+/* TODO: Find out what other types stand for and their correct
+ * mappings. Probably some of them should be skipped. */
+entry-type = AVIO_ENTRY_UNKNOWN;
+break;
+}
+
+return 0;
+}
+
+static int libsmbc_close_dir(URLContext *h)
+{
+LIBSMBContext *libsmbc = h-priv_data;
+if (libsmbc-dh = 0) {
+smbc_closedir(libsmbc-dh);
+libsmbc-dh = -1;
+}
+libsmbc_close(h);
+return 0;
+}
+
 #define OFFSET(x) offsetof(LIBSMBContext, x)
 #define D AV_OPT_FLAG_DECODING_PARAM
 #define E AV_OPT_FLAG_ENCODING_PARAM
@@ -206,6 +296,9 @@ URLProtocol ff_libsmbclient_protocol = {
 .url_write   = libsmbc_write,
 .url_seek= libsmbc_seek,
 .url_close   = libsmbc_close,
+.url_open_dir= libsmbc_open_dir,
+.url_read_dir= libsmbc_read_dir,
+.url_close_dir   = libsmbc_close_dir,
 .priv_data_size  = sizeof(LIBSMBContext),
 .priv_data_class = libsmbclient_context_class,
 .flags   = URL_PROTOCOL_FLAG_NETWORK,
-- 
2.3.3

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


[FFmpeg-devel] [PATCH 3/4] lavu/avstring: add av_append_path_component() funcion

2015-03-25 Thread Mariusz Szczepańczyk
From: Lukasz Marek lukasz.m.lu...@gmail.com

Convinient function to build paths.
---
 libavutil/avstring.c| 43 +++
 libavutil/avstring.h| 10 ++
 tests/ref/fate/avstring |  9 +
 3 files changed, 62 insertions(+)

diff --git a/libavutil/avstring.c b/libavutil/avstring.c
index 25c65b4..f105aa7 100644
--- a/libavutil/avstring.c
+++ b/libavutil/avstring.c
@@ -269,6 +269,35 @@ const char *av_dirname(char *path)
 return path;
 }
 
+char *av_append_path_component(const char *path, const char *component)
+{
+size_t p_len, c_len;
+char *fullpath;
+
+if (!path)
+return component ? av_strdup(component) : NULL;
+if (!component)
+return av_strdup(path);
+
+p_len = strlen(path);
+c_len = strlen(component);
+fullpath = malloc(p_len + c_len + 2);
+if (fullpath) {
+if (p_len) {
+strcpy(fullpath, path);
+if (c_len) {
+if (fullpath[p_len - 1] != '/'  component[0] != '/')
+fullpath[p_len++] = '/';
+else if (fullpath[p_len - 1] == '/'  component[0] == '/')
+p_len--;
+}
+}
+strcpy(fullpath[p_len], component);
+fullpath[p_len + c_len] = 0;
+}
+return fullpath;
+}
+
 int av_escape(char **dst, const char *src, const char *special_chars,
   enum AVEscapeMode mode, int flags)
 {
@@ -427,6 +456,7 @@ int av_match_list(const char *name, const char *list, char 
separator)
 int main(void)
 {
 int i;
+char *fullpath;
 static const char * const strings[] = {
 '',
 ,
@@ -467,6 +497,19 @@ int main(void)
 av_free(q);
 }
 
+printf(Testing av_append_path_component()\n);
+#define TEST_APPEND_PATH_COMPONENT(path, component, expected) \
+fullpath = av_append_path_component((path), (component)); \
+printf(%s = %s\n, fullpath, expected); \
+av_free(fullpath);
+TEST_APPEND_PATH_COMPONENT(NULL, NULL, (null))
+TEST_APPEND_PATH_COMPONENT(path, NULL, path);
+TEST_APPEND_PATH_COMPONENT(NULL, comp, comp);
+TEST_APPEND_PATH_COMPONENT(path, comp, path/comp);
+TEST_APPEND_PATH_COMPONENT(path/, comp, path/comp);
+TEST_APPEND_PATH_COMPONENT(path, /comp, path/comp);
+TEST_APPEND_PATH_COMPONENT(path/, /comp, path/comp);
+TEST_APPEND_PATH_COMPONENT(path/path2/, /comp/comp2, 
path/path2/comp/comp2);
 return 0;
 }
 
diff --git a/libavutil/avstring.h b/libavutil/avstring.h
index ffb7aa6..466edaf 100644
--- a/libavutil/avstring.h
+++ b/libavutil/avstring.h
@@ -276,6 +276,16 @@ const char *av_dirname(char *path);
  */
 int av_match_name(const char *name, const char *names);
 
+/**
+ * Append path component to the existing path.
+ * Path separator '/' is placed between when needed.
+ * Resulting string have to be freed with av_free().
+ * @param path  base path
+ * @param component component to be appended
+ * @return new path or NULL on error.
+ */
+char *av_append_path_component(const char *path, const char *component);
+
 enum AVEscapeMode {
 AV_ESCAPE_MODE_AUTO,  /// Use auto-selected escaping mode.
 AV_ESCAPE_MODE_BACKSLASH, /// Use backslash escaping.
diff --git a/tests/ref/fate/avstring b/tests/ref/fate/avstring
index bc231e8..1ca9be5 100644
--- a/tests/ref/fate/avstring
+++ b/tests/ref/fate/avstring
@@ -25,3 +25,12 @@ Testing av_get_token()
 |'foo : \ \  '   : blahblah| - |foo : \ \  | + |: blahblah|
 |'\fo\o:': blahblah| - |\fo\o:| + |: blahblah|
 |\'fo\o\:':  foo  '  :blahblah| - |'foo::  foo  | + |:blahblah|
+Testing av_append_path_component()
+(null) = (null)
+path = path
+comp = comp
+path/comp = path/comp
+path/comp = path/comp
+path/comp = path/comp
+path/comp = path/comp
+path/path2/comp/comp2 = path/path2/comp/comp2
-- 
2.3.3

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


[FFmpeg-devel] [PATCH 1/4] lavf: add directory listing API

2015-03-25 Thread Mariusz Szczepańczyk
From: Lukasz Marek lukasz.m.lu...@gmail.com

API allows protocol implementations to provide API that
allows to list directory content.
API is similar to POSIX opendir/readdir/closedir.
---
 libavformat/avio.c | 74 +++
 libavformat/avio.h | 84 +-
 libavformat/url.c  | 16 +++
 libavformat/url.h  | 10 +++
 4 files changed, 183 insertions(+), 1 deletion(-)

diff --git a/libavformat/avio.c b/libavformat/avio.c
index 4896782..51419cc 100644
--- a/libavformat/avio.c
+++ b/libavformat/avio.c
@@ -23,6 +23,7 @@
 #include libavutil/dict.h
 #include libavutil/opt.h
 #include libavutil/time.h
+#include libavutil/avassert.h
 #include os_support.h
 #include avformat.h
 #if CONFIG_NETWORK
@@ -418,6 +419,79 @@ int avio_check(const char *url, int flags)
 return ret;
 }
 
+int avio_open_dir(AVIODirContext **s, const char *url, AVDictionary **options)
+{
+URLContext *h = NULL;
+AVIODirContext *ctx = NULL;
+int ret;
+av_assert0(s);
+
+ctx = av_mallocz(sizeof(*ctx));
+if (!ctx) {
+ret = AVERROR(ENOMEM);
+goto fail;
+}
+
+if ((ret = ffurl_alloc(h, url, AVIO_FLAG_READ, NULL))  0)
+goto fail;
+
+if (h-prot-url_open_dir  h-prot-url_read_dir  
h-prot-url_close_dir) {
+if (options  h-prot-priv_data_class 
+(ret = av_opt_set_dict(h-priv_data, options))  0)
+goto fail;
+ret = h-prot-url_open_dir(h);
+} else
+ret = AVERROR(ENOSYS);
+if (ret  0)
+goto fail;
+
+ctx-url_context = h;
+*s = ctx;
+return 0;
+
+  fail:
+av_free(ctx);
+*s = NULL;
+ffurl_close(h);
+return ret;
+}
+
+int avio_read_dir(AVIODirContext *s, AVIODirEntry **next)
+{
+URLContext *h;
+int ret;
+
+if (!s || !s-url_context)
+return EINVAL;
+h = s-url_context;
+if ((ret = h-prot-url_read_dir(h, next))  0)
+avio_free_directory_entry(next);
+return ret;
+}
+
+int avio_close_dir(AVIODirContext **s)
+{
+URLContext *h;
+
+av_assert0(s);
+if (!(*s) || !(*s)-url_context)
+return EINVAL;
+h = (*s)-url_context;
+h-prot-url_close_dir(h);
+ffurl_close(h);
+av_freep(s);
+*s = NULL;
+return 0;
+}
+
+void avio_free_directory_entry(AVIODirEntry **entry)
+{
+if (!entry || !*entry)
+return;
+av_free((*entry)-name);
+av_freep(entry);
+}
+
 int64_t ffurl_size(URLContext *h)
 {
 int64_t pos, size;
diff --git a/libavformat/avio.h b/libavformat/avio.h
index 8fc7e27..bbd482a 100644
--- a/libavformat/avio.h
+++ b/libavformat/avio.h
@@ -34,7 +34,6 @@
 
 #include libavformat/version.h
 
-
 #define AVIO_SEEKABLE_NORMAL 0x0001 /** Seeking works like for a local file */
 
 /**
@@ -54,6 +53,47 @@ typedef struct AVIOInterruptCB {
 } AVIOInterruptCB;
 
 /**
+ * Directory entry types.
+ */
+enum AVIODirEntryType {
+AVIO_ENTRY_UNKNOWN,
+AVIO_ENTRY_BLOCK_DEVICE,
+AVIO_ENTRY_CHARACTER_DEVICE,
+AVIO_ENTRY_DIRECTORY,
+AVIO_ENTRY_NAMED_PIPE,
+AVIO_ENTRY_SYMBOLIC_LINK,
+AVIO_ENTRY_SOCKET,
+AVIO_ENTRY_FILE
+};
+
+/**
+ * Describes single entry of the directory.
+ *
+ * Only name and type fields are guaranteed be set.
+ * Rest of fields are protocol or/and platform dependent and might be unknown.
+ */
+typedef struct AVIODirEntry {
+char *name;   /** Filename */
+int type; /** Type of the entry */
+int utf8; /** Set to 1 when name is encoded 
with UTF-8, 0 otherwise.
+   Name can be encoded with UTF-8 
eventhough 0 is set. */
+int64_t size; /** File size in bytes, -1 if 
unknown. */
+int64_t modification_timestamp;   /** Time of last modification in 
microseconds since unix
+   epoch, -1 if unknown. */
+int64_t access_timestamp; /** Time of last access in 
microseconds since unix epoch,
+   -1 if unknown. */
+int64_t status_change_timestamp;  /** Time of last status change in 
microseconds since unix
+   epoch, -1 if unknown. */
+int64_t user_id;  /** User ID of owner, -1 if 
unknown. */
+int64_t group_id; /** Group ID of owner, -1 if 
unknown. */
+int64_t filemode; /** Unix file mode, -1 if unknown. 
*/
+} AVIODirEntry;
+
+typedef struct AVIODirContext {
+struct URLContext *url_context;
+} AVIODirContext;
+
+/**
  * Bytestream IO Context.
  * New fields can be added to the end with minor version bumps.
  * Removal, reordering and changes to existing fields require a major
@@ -181,6 +221,48 @@ const char *avio_find_protocol_name(const char *url);
 int avio_check(const char *url, int flags);
 
 /**
+ * Open directory for 

[FFmpeg-devel] [PATCH 2/4] doc/examples: add directory listing example

2015-03-25 Thread Mariusz Szczepańczyk
From: Lukasz Marek lukasz.m.lu...@gmail.com

---
 .gitignore   |   1 +
 configure|   2 +
 doc/Makefile |   1 +
 doc/examples/Makefile|   3 +-
 doc/examples/avio_list_dir.c | 105 +++
 5 files changed, 111 insertions(+), 1 deletion(-)
 create mode 100644 doc/examples/avio_list_dir.c

diff --git a/.gitignore b/.gitignore
index d2088e5..71d4d64 100644
--- a/.gitignore
+++ b/.gitignore
@@ -36,6 +36,7 @@
 /doc/avoptions_codec.texi
 /doc/avoptions_format.texi
 /doc/doxy/html/
+/doc/examples/avio_list_dir
 /doc/examples/avio_reading
 /doc/examples/decoding_encoding
 /doc/examples/demuxing_decoding
diff --git a/configure b/configure
index a96bfb7..cd84d2b 100755
--- a/configure
+++ b/configure
@@ -1321,6 +1321,7 @@ COMPONENT_LIST=
 
 EXAMPLE_LIST=
 avio_reading_example
+avio_list_dir_example
 decoding_encoding_example
 demuxing_decoding_example
 extract_mvs_example
@@ -2653,6 +2654,7 @@ zoompan_filter_deps=swscale
 
 # examples
 avio_reading=avformat avcodec avutil
+avio_list_dir=avformat avutil
 avcodec_example_deps=avcodec avutil
 decoding_encoding_example_deps=avcodec avformat avutil
 demuxing_decoding_example_deps=avcodec avformat avutil
diff --git a/doc/Makefile b/doc/Makefile
index 697142f..4573531 100644
--- a/doc/Makefile
+++ b/doc/Makefile
@@ -36,6 +36,7 @@ DOCS-$(CONFIG_MANPAGES)  += $(MANPAGES)
 DOCS-$(CONFIG_TXTPAGES)  += $(TXTPAGES)
 DOCS = $(DOCS-yes)
 
+DOC_EXAMPLES-$(CONFIG_AVIO_LIST_DIR_EXAMPLE) += avio_list_dir
 DOC_EXAMPLES-$(CONFIG_AVIO_READING_EXAMPLE)  += avio_reading
 DOC_EXAMPLES-$(CONFIG_AVCODEC_EXAMPLE)   += avcodec
 DOC_EXAMPLES-$(CONFIG_DECODING_ENCODING_EXAMPLE) += decoding_encoding
diff --git a/doc/examples/Makefile b/doc/examples/Makefile
index 9f03f04..9699f11 100644
--- a/doc/examples/Makefile
+++ b/doc/examples/Makefile
@@ -11,7 +11,8 @@ CFLAGS += -Wall -g
 CFLAGS := $(shell pkg-config --cflags $(FFMPEG_LIBS)) $(CFLAGS)
 LDLIBS := $(shell pkg-config --libs $(FFMPEG_LIBS)) $(LDLIBS)
 
-EXAMPLES=   avio_reading   \
+EXAMPLES=   avio_list_dir  \
+avio_reading   \
 decoding_encoding  \
 demuxing_decoding  \
 extract_mvs\
diff --git a/doc/examples/avio_list_dir.c b/doc/examples/avio_list_dir.c
new file mode 100644
index 000..d0e8598
--- /dev/null
+++ b/doc/examples/avio_list_dir.c
@@ -0,0 +1,105 @@
+/*
+ * Copyright (c) 2014 Lukasz Marek
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the Software), to 
deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+#include libavcodec/avcodec.h
+#include libavformat/avformat.h
+#include libavformat/avio.h
+
+static const char *type_string(int type)
+{
+switch (type) {
+case AVIO_ENTRY_DIRECTORY:
+return DIR;
+case AVIO_ENTRY_FILE:
+return FILE;
+case AVIO_ENTRY_BLOCK_DEVICE:
+return BLOCK DEVICE;
+case AVIO_ENTRY_CHARACTER_DEVICE:
+return CHARACTER DEVICE;
+case AVIO_ENTRY_NAMED_PIPE:
+return PIPE;
+case AVIO_ENTRY_SYMBOLIC_LINK:
+return LINK;
+case AVIO_ENTRY_SOCKET:
+return SOCKET;
+case AVIO_ENTRY_UNKNOWN:
+default:
+break;
+}
+return UNKNOWN;
+}
+
+int main(int argc, char *argv[])
+{
+const char *input_dir = NULL;
+AVIODirEntry *entry = NULL;
+AVIODirContext *ctx = NULL;
+int ret;
+char filemode[4];
+
+av_log_set_level(AV_LOG_DEBUG);
+
+if (argc != 2) {
+fprintf(stderr, usage: %s input_dir\n
+API example program to show how to list files in directory 
+accessed through AVIOContext.\n, argv[0]);
+return 1;
+}
+input_dir = argv[1];
+
+/* register codecs and formats and other lavf/lavc components*/
+av_register_all();
+
+if ((ret = avio_open_dir(ctx, 

Re: [FFmpeg-devel] [PATCH] doc: add a few note for sponsorship candidates.

2015-03-25 Thread Lou Logan
On Wed, 25 Mar 2015 11:10:36 +0100, Nicolas George wrote:

 From fca492987eef197aa91a92c2ebe37ac3ff0acc58 Mon Sep 17 00:00:00 2001
 From: Nicolas George geo...@nsup.org
 Date: Thu, 19 Mar 2015 21:51:19 +0100
 Subject: [PATCH] doc: add a few note for sponsorship candidates.

 +As for FFmpeg, there is not much to do: choose a proposed project that you 
 want to
 +do, select a qualification task for that project that is not already taken
 +by someone else, announce your chosen qualification task on the ffmpeg-devel
 +mailing list, then start coding..


Nit: s/../.

But I wouldn't waste time on that nit unless other changes are going to
be made.

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


Re: [FFmpeg-devel] [PATCH] lavf/avisynth: fix compilation, remove bundled headers

2015-03-25 Thread Michael Niedermayer
On Tue, Mar 24, 2015 at 07:40:33PM +0100, Martin Herkt wrote:
 Merge commit 1530732 broke compilation with AviSynth enabled.
 
 There's really no reason to keep outdated, incompatible copies of
 these headers in the FFmpeg source tree. No one should be using
 AviSynth 2.5 either.
 ---
  compat/avisynth/avisynth_c.h   | 880 
 -
  compat/avisynth/avisynth_c_25.h|  68 --
  compat/avisynth/avxsynth_c.h   | 728 -
  .../windowsPorts/basicDataTypeConversions.h|  85 --
  compat/avisynth/windowsPorts/windows2linux.h   |  77 --
  doc/general.texi   |  23 +-
  libavformat/avisynth.c |  27 +-
  7 files changed, 35 insertions(+), 1853 deletions(-)
  delete mode 100644 compat/avisynth/avisynth_c.h
  delete mode 100644 compat/avisynth/avisynth_c_25.h
  delete mode 100644 compat/avisynth/avxsynth_c.h
  delete mode 100644 compat/avisynth/windowsPorts/basicDataTypeConversions.h
  delete mode 100644 compat/avisynth/windowsPorts/windows2linux.h

Stephen Hutchinson has replaced the outdated headers while this was
stuck in the mailman que

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The real ebay dictionary, page 3
Rare item - Common item with rare defect or maybe just a lie
Professional - 'Toy' made in china, not functional except as doorstop
Experts will know - The seller hopes you are not an expert


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


[FFmpeg-devel] [PATCH] avuti/cpu: add missing check for mmxext to av_force_cpu_flags

2015-03-25 Thread James Almer
Signed-off-by: James Almer jamr...@gmail.com
---
 libavutil/cpu.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavutil/cpu.c b/libavutil/cpu.c
index 53c1227..1617464 100644
--- a/libavutil/cpu.c
+++ b/libavutil/cpu.c
@@ -49,6 +49,7 @@ static int flags, checked;
 void av_force_cpu_flags(int arg){
 if (   (arg  ( AV_CPU_FLAG_3DNOW|
 AV_CPU_FLAG_3DNOWEXT |
+AV_CPU_FLAG_MMXEXT   |
 AV_CPU_FLAG_SSE  |
 AV_CPU_FLAG_SSE2 |
 AV_CPU_FLAG_SSE2SLOW |
-- 
2.3.4

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


Re: [FFmpeg-devel] [PATCH 2/2] libavformat/mxfenc: add support for muxing mxf opatom audio

2015-03-25 Thread Mark Reid
On Mar 24, 2015 7:05 AM, Tomas Härdin tomas.har...@codemill.se wrote:

 On Sat, 2015-03-21 at 16:45 -0700, Mark Reid wrote:
  ---
   libavformat/mxfenc.c | 100
++-
   1 file changed, 83 insertions(+), 17 deletions(-)

 Looks fine as far as I can tell. My only nitpick is that it might be
 better to call timecode rate EditRate or edit rate instead, since
 that is MXF parlance. Perhaps a bit bikeshed-y though. Does anyone else
 have any preference?


I was going to originally go with audio_edit_rate, I think its in line with
the mxf terminology too. So I'll submit a new patch changing it.

 An aside: would it ever make sense to use EditRate different from fps,
 to force a certain rate? Something tells me there's a video filter or
 something to do that already, so perhaps not an issue.

 /Tomas


It might, but I'm not sure, I think avid mxf might use 30fps timecode on
24fps footage if using pulldown or vice versa. I'll take a look. In which
case, even this audio case, maybe the edit_rate of the timecode should be
export as metadata so a decoding application could know what it is?
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avfilter/vf_telecine: Fix AV desync by using the first input timestamp

2015-03-25 Thread Michael Niedermayer
On Thu, Mar 26, 2015 at 04:35:28AM +0530, Himangi Saraogi wrote:
 ---
  libavfilter/vf_telecine.c | 9 -
  1 file changed, 8 insertions(+), 1 deletion(-)

applied

thanks

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

The real ebay dictionary, page 3
Rare item - Common item with rare defect or maybe just a lie
Professional - 'Toy' made in china, not functional except as doorstop
Experts will know - The seller hopes you are not an expert


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] lavu/frame: move av_frame_copy_props() up in the file.

2015-03-25 Thread Michael Niedermayer
On Mon, Mar 23, 2015 at 11:11:18AM -0400, Ronald S. Bultje wrote:
 Preparation for following patch.
 ---
  libavutil/frame.c | 140 
 +++---
  1 file changed, 70 insertions(+), 70 deletions(-)

applied

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 2/2] avutil: make AVFrameSideData buffers ref-counted.

2015-03-25 Thread Michael Niedermayer
On Mon, Mar 23, 2015 at 11:11:19AM -0400, Ronald S. Bultje wrote:
 ---
  libavutil/frame.c | 53 ++---
  libavutil/frame.h |  1 +
  2 files changed, 39 insertions(+), 15 deletions(-)

applied

maybe someone should benchmark this for speed per size and
add a copy case where/if its faster

thanks

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

it is not once nor twice but times without number that the same ideas make
their appearance in the world. -- Aristotle


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


Re: [FFmpeg-devel] [GSoC] Proof-of-concept HTTP Server

2015-03-25 Thread Stephan Holljes
I hope this time the patch is formatted correctly. I also attached it
in case it is corrupted again.
I changed the indentation of the code and used ffurl_open() instead of
creating my own listening socket.

I am still having some trouble with the Content-Type header. I would
guess creating functions like http_write_header() as the counterpart
for http_read_header() would be the most appropriate approach?


---
 libavformat/http.c | 33 -
 1 file changed, 32 insertions(+), 1 deletion(-)

diff --git a/libavformat/http.c b/libavformat/http.c
index da3c9be..472d8dd 100644
--- a/libavformat/http.c
+++ b/libavformat/http.c
@@ -96,6 +96,8 @@ typedef struct HTTPContext {
 int send_expect_100;
 char *method;
 int reconnect;
+int listen;
+int header_sent;
 } HTTPContext;

 #define OFFSET(x) offsetof(HTTPContext, x)
@@ -127,6 +129,7 @@ static const AVOption options[] = {
 { end_offset, try to limit the request to bytes preceding this
offset, OFFSET(end_off), AV_OPT_TYPE_INT64, { .i64 = 0 }, 0,
INT64_MAX, D },
 { method, Override the HTTP method, OFFSET(method),
AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, E },
 { reconnect, auto reconnect after disconnect before EOF,
OFFSET(reconnect), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, D },
+{ listen, listen on HTTP, OFFSET(listen), AV_OPT_TYPE_INT, {
.i64 = 0 }, 0, 1, D },
 { NULL }
 };

@@ -300,7 +303,9 @@ static int http_open(URLContext *h, const char
*uri, int flags,
  AVDictionary **options)
 {
 HTTPContext *s = h-priv_data;
-int ret;
+int port, ret = 0;
+char hostname[1024];
+char lower_url[100];

 if( s-seekable == 1 )
 h-is_streamed = 0;
@@ -321,6 +326,20 @@ static int http_open(URLContext *h, const char
*uri, int flags,
No trailing CRLF found in HTTP header.\n);
 }

+if (s-listen) {
+av_url_split(NULL, 0, NULL, 0, hostname, sizeof(hostname), port,
+ NULL, 0, uri);
+ff_url_join(lower_url, sizeof(lower_url), tcp, NULL, hostname, port,
+NULL);
+av_dict_set(options, listen, 1, AV_DICT_APPEND);
+ret = ffurl_open(s-hd, lower_url, AVIO_FLAG_READ_WRITE,
+   h-interrupt_callback, options);
+if (ret  0) {
+return ret;
+}
+
+return ret;
+}
 ret = http_open_cnx(h, options);
 if (ret  0)
 av_dict_free(s-chained_options);
@@ -1100,10 +1119,22 @@ static int http_read(URLContext *h, uint8_t
*buf, int size)
 static int http_write(URLContext *h, const uint8_t *buf, int size)
 {
 char temp[11] = ;  /* 32-bit hex + CRLF + nul */
+char header[] = HTTP 200 OK\r\nContent-Type:
application/octet-stream\r\n\r\n;
 int ret;
 char crlf[] = \r\n;
 HTTPContext *s = h-priv_data;
+if (s-listen) {
+if (!s-header_sent) {
+ret = ffurl_write(s-hd, header, strlen(header));
+if (ret  0) {
+return ff_neterrno();
+}
+s-header_sent = 1;
+}

+ret = ffurl_write(s-hd, buf, size);
+return ret  0 ? ff_neterrno() : ret;
+}
 if (!s-chunked_post) {
 /* non-chunked data is sent without any special encoding */
 return ffurl_write(s-hd, buf, size);
-- 
2.3.3

On Sun, Mar 22, 2015 at 10:33 AM, Nicolas George geo...@nsup.org wrote:
 Le primidi 1er germinal, an CCXXIII, Stephan Holljes a écrit :
 Please comment.

 As Michael pointed out, the patch was mangled at sending. That happens with
 mail user agent that rely on rich text editor and do not let users control
 the formatting finely. Using git send-email or attaching the file will solve
 the problem. They also include authorship and date information.


 Regards,
 Stephan Holljes

 ---
  libavformat/http.c |  113
 ++--
  1 file changed, 83 insertions(+), 30 deletions(-)

 diff --git a/libavformat/http.c b/libavformat/http.c
 index da3c9be..d61e4e2 100644
 --- a/libavformat/http.c
 +++ b/libavformat/http.c
 @@ -96,8 +96,12 @@ typedef struct HTTPContext {
  int send_expect_100;
  char *method;
  int reconnect;
 +int listen;
 +int fd;
 +int header_sent;
  } HTTPContext;

 +
  #define OFFSET(x) offsetof(HTTPContext, x)
  #define D AV_OPT_FLAG_DECODING_PARAM
  #define E AV_OPT_FLAG_ENCODING_PARAM
 @@ -127,6 +131,7 @@ static const AVOption options[] = {
  { end_offset, try to limit the request to bytes preceding this
 offset, OFFSET(end_off), AV_OPT_TYPE_INT64, { .i64 = 0 }, 0, INT64_MAX, D
 },
  { method, Override the HTTP method, OFFSET(method),
 AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, E },
  { reconnect, auto reconnect after disconnect before EOF,
 OFFSET(reconnect), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, D },
 +{ listen, listen on HTTP, OFFSET(listen), AV_OPT_TYPE_INT, { .i64
 = 0 }, 0, 1, D },
  { NULL }
  };

 @@ -299,8 +304,10 @@ int ff_http_averror(int 

Re: [FFmpeg-devel] [PATCH] lavfi: add inverse telecine filter

2015-03-25 Thread Carl Eugen Hoyos
Himangi Saraogi himangi774 at gmail.com writes:

 +++ b/Changelog

  - libdcadec wrapper
  - Drop support for nvenc API before 5.0
  - nvenc H265 encoder
 -
 +- Detelecine filter

Please do not add the empty line.

Add a short documentation that emphasizes that the 
new filter only works with a predefined pattern 
and that the pattern option is the same as for the 
telecine filter.

Thank you, Carl Eugen

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