Re: [FFmpeg-devel] [RFC]Changelog: Compress slightly

2016-10-01 Thread Carl Eugen Hoyos
2016-09-30 2:13 GMT+02:00 James Almer :

> LGTM otherwise.

Applied with the requested change.

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


Re: [FFmpeg-devel] lurking bugs in the mmx-related assembler code (?)

2016-10-01 Thread Carl Eugen Hoyos
2016-10-01 19:48 GMT+02:00  :
> I do not expect the ffmpeg developers to try to reproduce this.

(Would you mind explaining this sentence to me? I
do not understand it.)

> I expect somebody to look at the code (beginning with the
> MMX assembler in the vp3 decoder), which is a lower
> threshold than building a new libc.

Either you know a lot of things that nobody on this list
knows or you have very little clue about FFmpeg
development.

>> > P.S. an attempt to report via trac did not succeed,
>> > that's why posting to the list
>>
>> What was the issue there?
>
> Let's take one issue at a time [*]

Yes, please tell us one of the issues with trac at
a time (I successfully opened a ticket yesterday).

> I mentioned this only as my effort to follow the
> expected bug reporting route.

The expected route if trac is down (but also if
you don't want to use it) is to send an email to
the user mailing list.

>  ffmpeg -i test.640x480.19seconds.theora.ogg
> -c:v libtheora -y test.out.ogg

Missing console output and backtrace, please do
not use external libraries unless they are necessary
to reproduce the issue.

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


[FFmpeg-devel] [PATCH v2 2/2] doc/developer: add sections for policies

2016-10-01 Thread Josh de Kock
And sort policies into these sections.

Signed-off-by: Josh de Kock 
---
 doc/developer.texi | 95 +++---
 1 file changed, 48 insertions(+), 47 deletions(-)

diff --git a/doc/developer.texi b/doc/developer.texi
index 0075a27..e466d95 100644
--- a/doc/developer.texi
+++ b/doc/developer.texi
@@ -246,8 +246,8 @@ For Emacs, add these roughly equivalent lines to your 
@file{.emacs.d/init.el}:
 
 @section Development Policy
 
-@enumerate
-@item Licenses for patches must be compatible with FFmpeg.
+@subsection Patches/Committing
+@subheading Licenses for patches must be compatible with FFmpeg.
 Contributions should be licensed under the
 @uref{http://www.gnu.org/licenses/lgpl-2.1.html, LGPL 2.1},
 including an "or any later version" clause, or, if you prefer
@@ -260,7 +260,7 @@ preferred.
 If you add a new file, give it a proper license header. Do not copy and
 paste it from a random place, use an existing file as template.
 
-@item You must not commit code which breaks FFmpeg!
+@subheading You must not commit code which breaks FFmpeg!
 This means unfinished code which is enabled and breaks compilation,
 or compiles but does not work/breaks the regression tests. Code which
 is unfinished but disabled may be permitted under-circumstances, like
@@ -268,7 +268,7 @@ missing samples or an implementation with a small subset of 
features.
 Always check the mailing list for any reviewers with issues and test
 FATE before you push.
 
-@item Keep the main commit message short with an extended description below.
+@subheading Keep the main commit message short with an extended description 
below.
 The commit message should have a short first line in the form of
 a @samp{topic: short description} as a header, separated by a newline
 from the body consisting of an explanation of why the change is necessary.
@@ -276,14 +276,14 @@ If the commit fixes a known bug on the bug tracker, the 
commit message
 should include its bug ID. Referring to the issue on the bug tracker does
 not exempt you from writing an excerpt of the bug in the commit message.
 
-@item Testing must be adequate but not excessive.
+@subheading Testing must be adequate but not excessive.
 If it works for you, others, and passes FATE then it should be OK to commit
 it, provided it fits the other committing criteria. You should not worry about
 over-testing things. If your code has problems (portability, triggers
 compiler bugs, unusual environment etc) they will be reported and eventually
 fixed.
 
-@item Do not commit unrelated changes together.
+@subheading Do not commit unrelated changes together.
 They should be split them into self-contained pieces. Also do not forget
 that if part B depends on part A, but A does not depend on B, then A can
 and should be committed first and separate from B. Keeping changes well
@@ -293,21 +293,7 @@ later on.
 Also if you have doubts about splitting or not splitting, do not hesitate to
 ask/discuss it on the developer mailing list.
 
-@item API/ABI breakages and changes should be discussed before they are made.
-Do not change behavior of the programs (renaming options etc) or public
-API or ABI without first discussing it on the ffmpeg-devel mailing list.
-Do not remove widely used functionality or features (redundant code can be 
removed).
-
-@item Ask before you change the build system (configure, etc).
-Do not commit changes to the build system (Makefiles, configure script)
-which change behavior, defaults etc, without asking first. The same
-applies to compiler warning fixes, trivial looking fixes and to code
-maintained by other developers. We usually have a reason for doing things
-the way we do. Send your changes as patches to the ffmpeg-devel mailing
-list, and if the code maintainers say OK, you may commit. This does not
-apply to files you wrote and/or maintain.
-
-@item Cosmetic changes should be kept in separate patches.
+@subheading Cosmetic changes should be kept in separate patches.
 We refuse source indentation and other cosmetic changes if they are mixed
 with functional changes, such commits will be rejected and removed. Every
 developer has his own indentation style, you should not change it. Of course
@@ -321,7 +307,7 @@ NOTE: If you had to put if()@{ .. @} over a large (> 5 
lines) chunk of code,
 then either do NOT change the indentation of the inner part within (do not
 move it to the right)! or do so in a separate commit
 
-@item Commit messages should always be filled out properly.
+@subheading Commit messages should always be filled out properly.
 Always fill out the commit log message. Describe in a few lines what you
 changed and why. You can refer to mailing list postings if you fix a
 particular bug. Comments such as "fixed!" or "Changed it." are unacceptable.
@@ -333,44 +319,39 @@ area changed: Short 1 line description
 details describing what and why and giving references.
 @end example
 
-@item Credit the author of the patch.

[FFmpeg-devel] [PATCH v2 1/2] doc/developer: reword some of the policies

2016-10-01 Thread Josh de Kock
Explicitly state that FATE should pass, and code should work
for all reviewers who tested.

Signed-off-by: Josh de Kock 
---
 doc/developer.texi | 91 ++
 1 file changed, 44 insertions(+), 47 deletions(-)

diff --git a/doc/developer.texi b/doc/developer.texi
index 4d3a7ae..0075a27 100644
--- a/doc/developer.texi
+++ b/doc/developer.texi
@@ -247,7 +247,7 @@ For Emacs, add these roughly equivalent lines to your 
@file{.emacs.d/init.el}:
 @section Development Policy
 
 @enumerate
-@item
+@item Licenses for patches must be compatible with FFmpeg.
 Contributions should be licensed under the
 @uref{http://www.gnu.org/licenses/lgpl-2.1.html, LGPL 2.1},
 including an "or any later version" clause, or, if you prefer
@@ -260,15 +260,15 @@ preferred.
 If you add a new file, give it a proper license header. Do not copy and
 paste it from a random place, use an existing file as template.
 
-@item
-You must not commit code which breaks FFmpeg! (Meaning unfinished but
-enabled code which breaks compilation or compiles but does not work or
-breaks the regression tests)
-You can commit unfinished stuff (for testing etc), but it must be disabled
-(#ifdef etc) by default so it does not interfere with other developers'
-work.
+@item You must not commit code which breaks FFmpeg!
+This means unfinished code which is enabled and breaks compilation,
+or compiles but does not work/breaks the regression tests. Code which
+is unfinished but disabled may be permitted under-circumstances, like
+missing samples or an implementation with a small subset of features.
+Always check the mailing list for any reviewers with issues and test
+FATE before you push.
 
-@item
+@item Keep the main commit message short with an extended description below.
 The commit message should have a short first line in the form of
 a @samp{topic: short description} as a header, separated by a newline
 from the body consisting of an explanation of why the change is necessary.
@@ -276,30 +276,29 @@ If the commit fixes a known bug on the bug tracker, the 
commit message
 should include its bug ID. Referring to the issue on the bug tracker does
 not exempt you from writing an excerpt of the bug in the commit message.
 
-@item
-You do not have to over-test things. If it works for you, and you think it
-should work for others, then commit. If your code has problems
-(portability, triggers compiler bugs, unusual environment etc) they will be
-reported and eventually fixed.
-
-@item
-Do not commit unrelated changes together, split them into self-contained
-pieces. Also do not forget that if part B depends on part A, but A does not
-depend on B, then A can and should be committed first and separate from B.
-Keeping changes well split into self-contained parts makes reviewing and
-understanding them on the commit log mailing list easier. This also helps
-in case of debugging later on.
+@item Testing must be adequate but not excessive.
+If it works for you, others, and passes FATE then it should be OK to commit
+it, provided it fits the other committing criteria. You should not worry about
+over-testing things. If your code has problems (portability, triggers
+compiler bugs, unusual environment etc) they will be reported and eventually
+fixed.
+
+@item Do not commit unrelated changes together.
+They should be split them into self-contained pieces. Also do not forget
+that if part B depends on part A, but A does not depend on B, then A can
+and should be committed first and separate from B. Keeping changes well
+split into self-contained parts makes reviewing and understanding them on
+the commit log mailing list easier. This also helps in case of debugging
+later on.
 Also if you have doubts about splitting or not splitting, do not hesitate to
 ask/discuss it on the developer mailing list.
 
-@item
+@item API/ABI breakages and changes should be discussed before they are made.
 Do not change behavior of the programs (renaming options etc) or public
 API or ABI without first discussing it on the ffmpeg-devel mailing list.
-Do not remove functionality from the code. Just improve!
-
-Note: Redundant code can be removed.
+Do not remove widely used functionality or features (redundant code can be 
removed).
 
-@item
+@item Ask before you change the build system (configure, etc).
 Do not commit changes to the build system (Makefiles, configure script)
 which change behavior, defaults etc, without asking first. The same
 applies to compiler warning fixes, trivial looking fixes and to code
@@ -308,7 +307,7 @@ the way we do. Send your changes as patches to the 
ffmpeg-devel mailing
 list, and if the code maintainers say OK, you may commit. This does not
 apply to files you wrote and/or maintain.
 
-@item
+@item Cosmetic changes should be kept in separate patches.
 We refuse source indentation and other cosmetic changes if they are mixed
 with functional changes, such commits will be rejected and removed. Every
 

Re: [FFmpeg-devel] [PATCH 1/2] doc/developer: reword some of the policies

2016-10-01 Thread Michael Niedermayer
On Sun, Oct 02, 2016 at 12:01:46AM +0100, Josh de Kock wrote:
> Removed allowing for commiting disabled, unfinished code. Code
> should always try be in a working state.

This is sometimes not exactly possible due to the lack of samples
to test code, or lack of access to specific devices to test things
its still usefull to have the best effort
implementation available directly in the source but disabled by
default
possibly with a request for a sample if that is what is missing

Its also useful for collaboration to have work in progres available
in the main master "development" git repository

We also have flags for experimental code like
AV_CODEC_CAP_EXPERIMENTAL
FF_COMPLIANCE_EXPERIMENTAL
...


> Explicitly state that FATE should pass, and code should work
> for all reviewers who tested.
> 
> Signed-off-by: Josh de Kock 
> ---
>  doc/developer.texi | 89 
> ++
>  1 file changed, 42 insertions(+), 47 deletions(-)
> 
> diff --git a/doc/developer.texi b/doc/developer.texi
> index 4d3a7ae..d4344ff 100644
> --- a/doc/developer.texi
> +++ b/doc/developer.texi
> @@ -247,7 +247,7 @@ For Emacs, add these roughly equivalent lines to your 
> @file{.emacs.d/init.el}:
>  @section Development Policy
>  
>  @enumerate
> -@item
> +@item Licenses for patches must be compatible with FFmpeg.
>  Contributions should be licensed under the
>  @uref{http://www.gnu.org/licenses/lgpl-2.1.html, LGPL 2.1},
>  including an "or any later version" clause, or, if you prefer
> @@ -260,15 +260,13 @@ preferred.
>  If you add a new file, give it a proper license header. Do not copy and
>  paste it from a random place, use an existing file as template.
>  
> -@item
> -You must not commit code which breaks FFmpeg! (Meaning unfinished but
> -enabled code which breaks compilation or compiles but does not work or
> -breaks the regression tests)
> -You can commit unfinished stuff (for testing etc), but it must be disabled
> -(#ifdef etc) by default so it does not interfere with other developers'
> -work.
> +@item You must not commit code which breaks FFmpeg!
> +This means unfinished code which is enabled and breaks compilation,
> +compiles but does not work or breaks the regression tests). Always
> +check the mailing list for any reviewers with issues and test FATE
> +before you push.
>  
> -@item
> +@item Keep the main commit message short with an extended description below.
>  The commit message should have a short first line in the form of
>  a @samp{topic: short description} as a header, separated by a newline
>  from the body consisting of an explanation of why the change is necessary.
> @@ -276,30 +274,29 @@ If the commit fixes a known bug on the bug tracker, the 
> commit message
>  should include its bug ID. Referring to the issue on the bug tracker does
>  not exempt you from writing an excerpt of the bug in the commit message.
>  
> -@item
> -You do not have to over-test things. If it works for you, and you think it
> -should work for others, then commit. If your code has problems
> -(portability, triggers compiler bugs, unusual environment etc) they will be
> -reported and eventually fixed.
> -
> -@item
> -Do not commit unrelated changes together, split them into self-contained
> -pieces. Also do not forget that if part B depends on part A, but A does not
> -depend on B, then A can and should be committed first and separate from B.
> -Keeping changes well split into self-contained parts makes reviewing and
> -understanding them on the commit log mailing list easier. This also helps
> -in case of debugging later on.

> +@item Testing must be adequate but not is not required to be excessive.

Thats not a english sentance

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

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


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


Re: [FFmpeg-devel] lurking bugs in the mmx-related assembler code (?)

2016-10-01 Thread Michael Niedermayer
On Sun, Oct 02, 2016 at 01:18:29AM +0200, Henrik Gramner wrote:
> Ensuring that emms is issued before every single libc function call is
> likely problematic.

maybe, maybe not, iam not sure but
calling emms between init/de/reinint and optimized inner loops should
be doable, we generally shouldnt be doing malloc in highly optimized
loops as factorizing allocation out and reusing buffers is likely
a better choice

beyond malloc() what else is there ?

string functions ?
these are in fact not unlikely to use SIMD of some sort
same for memcpy/move()

also there are callbacks like av_log() we should document any
requirements that apply to them or ensure no such requirements exist

exact backtraces of where issues occur would be interesting to better
understand how much code is affected by this


> 
> What if we simply document the requirement that C standard library
> functions are assumed to not modify the x87 FPU state unless
> specifically designated to handle floating-point numbers?

thats like saying that we require undefined behavior to be defined
in a specific way. We can do this but thats like saying we support
only a subset of POSIX platforms and that subset could shrink at
any time if implementations change

I think our first choice should be to comply to specs where its
needed in practice and doable.
when its not useful in practice and a total unreadable mess if done
i would tend suggest to ignore specs. 

If all else fails we could add a emms call behind #if in
av_malloc() and detect affected libcs but thats IMHO a ugly hack
but better than declaring "non support"

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

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


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


Re: [FFmpeg-devel] [PATCH] doc/t2h: add max-width to css.

2016-10-01 Thread Timothy Gu
On Fri, Sep 30, 2016 at 6:28 PM Josh de Kock  wrote:

> Full width text is really difficult to read, this just makes it
> slightly more legible on larger (widescreen) screens.
>
> Signed-off-by: Josh de Kock 
> ---
> See http://screenshotcomparison.com/comparison/186256 for a comparison of
> before/after.
>
>  doc/t2h.init | 2 +-
>  doc/t2h.pm   | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/doc/t2h.init b/doc/t2h.init
> index c41be2e..994e276 100644
> --- a/doc/t2h.init
> +++ b/doc/t2h.init
> @@ -22,7 +22,7 @@ EOT
>  my $TEMPLATE_HEADER2 = $ENV{"FFMPEG_HEADER2"} || <
>
> -
> +
>  EOT
>
>  my $TEMPLATE_FOOTER = $ENV{"FFMPEG_FOOTER"} || < diff --git a/doc/t2h.pm b/doc/t2h.pm
> index 5efb2da..a3b7c6b 100644
> --- a/doc/t2h.pm
> +++ b/doc/t2h.pm
> @@ -174,7 +174,7 @@ EOT
>  
>
>
> -
> +
>
>  EOT
>

Perhaps, using the Bootstrap "container" class would be better as it
provides responsive equivalents for other screen sizes.

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


Re: [FFmpeg-devel] lurking bugs in the mmx-related assembler code (?)

2016-10-01 Thread Henrik Gramner
Ensuring that emms is issued before every single libc function call is
likely problematic.

What if we simply document the requirement that C standard library
functions are assumed to not modify the x87 FPU state unless
specifically designated to handle floating-point numbers?
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] doc/t2h: add max-width to css.

2016-10-01 Thread Josh de Kock

On 01/10/2016 02:28, Josh de Kock wrote:

Full width text is really difficult to read, this just makes it
slightly more legible on larger (widescreen) screens.

Signed-off-by: Josh de Kock 
---
See http://screenshotcomparison.com/comparison/186256 for a comparison of 
before/after.

 doc/t2h.init | 2 +-
 doc/t2h.pm   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/doc/t2h.init b/doc/t2h.init
index c41be2e..994e276 100644
--- a/doc/t2h.init
+++ b/doc/t2h.init
@@ -22,7 +22,7 @@ EOT
 my $TEMPLATE_HEADER2 = $ENV{"FFMPEG_HEADER2"} || <

[FFmpeg-devel] [PATCH 2/2] doc/developer: add sections for policies

2016-10-01 Thread Josh de Kock
And sort policies into these sections.

Signed-off-by: Josh de Kock 
---
 doc/developer.texi | 95 +++---
 1 file changed, 48 insertions(+), 47 deletions(-)

diff --git a/doc/developer.texi b/doc/developer.texi
index d4344ff..b85bf0f 100644
--- a/doc/developer.texi
+++ b/doc/developer.texi
@@ -246,8 +246,8 @@ For Emacs, add these roughly equivalent lines to your 
@file{.emacs.d/init.el}:
 
 @section Development Policy
 
-@enumerate
-@item Licenses for patches must be compatible with FFmpeg.
+@subsection Patches/Committing
+@subheading Licenses for patches must be compatible with FFmpeg.
 Contributions should be licensed under the
 @uref{http://www.gnu.org/licenses/lgpl-2.1.html, LGPL 2.1},
 including an "or any later version" clause, or, if you prefer
@@ -260,13 +260,13 @@ preferred.
 If you add a new file, give it a proper license header. Do not copy and
 paste it from a random place, use an existing file as template.
 
-@item You must not commit code which breaks FFmpeg!
+@subheading You must not commit code which breaks FFmpeg!
 This means unfinished code which is enabled and breaks compilation,
 compiles but does not work or breaks the regression tests). Always
 check the mailing list for any reviewers with issues and test FATE
 before you push.
 
-@item Keep the main commit message short with an extended description below.
+@subheading Keep the main commit message short with an extended description 
below.
 The commit message should have a short first line in the form of
 a @samp{topic: short description} as a header, separated by a newline
 from the body consisting of an explanation of why the change is necessary.
@@ -274,14 +274,14 @@ If the commit fixes a known bug on the bug tracker, the 
commit message
 should include its bug ID. Referring to the issue on the bug tracker does
 not exempt you from writing an excerpt of the bug in the commit message.
 
-@item Testing must be adequate but not is not required to be excessive.
+@subheading Testing must be adequate but not is not required to be excessive.
 If it works for you, others, and passes FATE then it should be OK to commit
 it, provided it fits the other committing criteria. You should not worry about
 over-testing things. If your code has problems (portability, triggers
 compiler bugs, unusual environment etc) they will be reported and eventually
 fixed.
 
-@item Do not commit unrelated changes together.
+@subheading Do not commit unrelated changes together.
 They should be split them into self-contained pieces. Also do not forget
 that if part B depends on part A, but A does not depend on B, then A can
 and should be committed first and separate from B. Keeping changes well
@@ -291,21 +291,7 @@ later on.
 Also if you have doubts about splitting or not splitting, do not hesitate to
 ask/discuss it on the developer mailing list.
 
-@item API/ABI breakages and changes should be discussed before they are made.
-Do not change behavior of the programs (renaming options etc) or public
-API or ABI without first discussing it on the ffmpeg-devel mailing list.
-Do not remove widely used functionality or features (redundant code can be 
removed).
-
-@item Ask before you change the build system (configure, etc).
-Do not commit changes to the build system (Makefiles, configure script)
-which change behavior, defaults etc, without asking first. The same
-applies to compiler warning fixes, trivial looking fixes and to code
-maintained by other developers. We usually have a reason for doing things
-the way we do. Send your changes as patches to the ffmpeg-devel mailing
-list, and if the code maintainers say OK, you may commit. This does not
-apply to files you wrote and/or maintain.
-
-@item Cosmetic changes should be kept in separate patches.
+@subheading Cosmetic changes should be kept in separate patches.
 We refuse source indentation and other cosmetic changes if they are mixed
 with functional changes, such commits will be rejected and removed. Every
 developer has his own indentation style, you should not change it. Of course
@@ -319,7 +305,7 @@ NOTE: If you had to put if()@{ .. @} over a large (> 5 
lines) chunk of code,
 then either do NOT change the indentation of the inner part within (do not
 move it to the right)! or do so in a separate commit
 
-@item Commit messages should always be filled out properly.
+@subheading Commit messages should always be filled out properly.
 Always fill out the commit log message. Describe in a few lines what you
 changed and why. You can refer to mailing list postings if you fix a
 particular bug. Comments such as "fixed!" or "Changed it." are unacceptable.
@@ -331,44 +317,39 @@ area changed: Short 1 line description
 details describing what and why and giving references.
 @end example
 
-@item Credit the author of the patch.
+@subheading Credit the author of the patch.
 Make sure the author of the commit is set correctly. (see git commit --author)
 

[FFmpeg-devel] [PATCH 1/2] doc/developer: reword some of the policies

2016-10-01 Thread Josh de Kock
Removed allowing for commiting disabled, unfinished code. Code
should always try be in a working state.
Explicitly state that FATE should pass, and code should work
for all reviewers who tested.

Signed-off-by: Josh de Kock 
---
 doc/developer.texi | 89 ++
 1 file changed, 42 insertions(+), 47 deletions(-)

diff --git a/doc/developer.texi b/doc/developer.texi
index 4d3a7ae..d4344ff 100644
--- a/doc/developer.texi
+++ b/doc/developer.texi
@@ -247,7 +247,7 @@ For Emacs, add these roughly equivalent lines to your 
@file{.emacs.d/init.el}:
 @section Development Policy
 
 @enumerate
-@item
+@item Licenses for patches must be compatible with FFmpeg.
 Contributions should be licensed under the
 @uref{http://www.gnu.org/licenses/lgpl-2.1.html, LGPL 2.1},
 including an "or any later version" clause, or, if you prefer
@@ -260,15 +260,13 @@ preferred.
 If you add a new file, give it a proper license header. Do not copy and
 paste it from a random place, use an existing file as template.
 
-@item
-You must not commit code which breaks FFmpeg! (Meaning unfinished but
-enabled code which breaks compilation or compiles but does not work or
-breaks the regression tests)
-You can commit unfinished stuff (for testing etc), but it must be disabled
-(#ifdef etc) by default so it does not interfere with other developers'
-work.
+@item You must not commit code which breaks FFmpeg!
+This means unfinished code which is enabled and breaks compilation,
+compiles but does not work or breaks the regression tests). Always
+check the mailing list for any reviewers with issues and test FATE
+before you push.
 
-@item
+@item Keep the main commit message short with an extended description below.
 The commit message should have a short first line in the form of
 a @samp{topic: short description} as a header, separated by a newline
 from the body consisting of an explanation of why the change is necessary.
@@ -276,30 +274,29 @@ If the commit fixes a known bug on the bug tracker, the 
commit message
 should include its bug ID. Referring to the issue on the bug tracker does
 not exempt you from writing an excerpt of the bug in the commit message.
 
-@item
-You do not have to over-test things. If it works for you, and you think it
-should work for others, then commit. If your code has problems
-(portability, triggers compiler bugs, unusual environment etc) they will be
-reported and eventually fixed.
-
-@item
-Do not commit unrelated changes together, split them into self-contained
-pieces. Also do not forget that if part B depends on part A, but A does not
-depend on B, then A can and should be committed first and separate from B.
-Keeping changes well split into self-contained parts makes reviewing and
-understanding them on the commit log mailing list easier. This also helps
-in case of debugging later on.
+@item Testing must be adequate but not is not required to be excessive.
+If it works for you, others, and passes FATE then it should be OK to commit
+it, provided it fits the other committing criteria. You should not worry about
+over-testing things. If your code has problems (portability, triggers
+compiler bugs, unusual environment etc) they will be reported and eventually
+fixed.
+
+@item Do not commit unrelated changes together.
+They should be split them into self-contained pieces. Also do not forget
+that if part B depends on part A, but A does not depend on B, then A can
+and should be committed first and separate from B. Keeping changes well
+split into self-contained parts makes reviewing and understanding them on
+the commit log mailing list easier. This also helps in case of debugging
+later on.
 Also if you have doubts about splitting or not splitting, do not hesitate to
 ask/discuss it on the developer mailing list.
 
-@item
+@item API/ABI breakages and changes should be discussed before they are made.
 Do not change behavior of the programs (renaming options etc) or public
 API or ABI without first discussing it on the ffmpeg-devel mailing list.
-Do not remove functionality from the code. Just improve!
-
-Note: Redundant code can be removed.
+Do not remove widely used functionality or features (redundant code can be 
removed).
 
-@item
+@item Ask before you change the build system (configure, etc).
 Do not commit changes to the build system (Makefiles, configure script)
 which change behavior, defaults etc, without asking first. The same
 applies to compiler warning fixes, trivial looking fixes and to code
@@ -308,7 +305,7 @@ the way we do. Send your changes as patches to the 
ffmpeg-devel mailing
 list, and if the code maintainers say OK, you may commit. This does not
 apply to files you wrote and/or maintain.
 
-@item
+@item Cosmetic changes should be kept in separate patches.
 We refuse source indentation and other cosmetic changes if they are mixed
 with functional changes, such commits will be rejected and removed. Every
 developer has his own 

Re: [FFmpeg-devel] lurking bugs in the mmx-related assembler code (?)

2016-10-01 Thread Ronald S. Bultje
Hi,

On Sat, Oct 1, 2016 at 4:12 PM,  wrote:

> Hello Ronald,
>
> On Sat, Oct 01, 2016 at 03:11:38PM -0400, Ronald S. Bultje wrote:
> > I'm not sure we want to go down the rabbit hole of allowing any code to
> be
> > executed inside frame en/decoding routines. Historically, IIRC, we have
> > disallowed float in user callbacks like request_frame also.
> >
> > Why does musl malloc require float? This is a real question. I can't
> think
> > of any reason why you'd want this.
>
> Taking the question for what it is, I have already answered - because
> it make sence for the C library implementation and functioning.
>
> We are not talking about what you and me "would like inside a standard
> library" but whether we can rely on the specified interfaces. The
> malloc() interface was apparently misunderstood as a promise to never
> do float. There is no such promise.


Can malloc call sleep() then?

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


Re: [FFmpeg-devel] [PATCH v2] doc/developer: improve development policy formatting

2016-10-01 Thread James Almer
On 10/1/2016 7:11 PM, Michael Niedermayer wrote:
> i think rewording and formating should be in seperate patches

Agree. The text itself even mentions it should be done as such.

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


Re: [FFmpeg-devel] [PATCH v2] doc/developer: improve development policy formatting

2016-10-01 Thread Michael Niedermayer
On Sat, Oct 01, 2016 at 08:19:16PM +0100, Josh de Kock wrote:
> This commit also rewords some of the policies for more clarity.

i think rewording and formating should be in seperate patches

and non cosmetic changes to this text really should be easy to
review by everyone as the text affects everyone

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

The real ebay dictionary, page 1
"Used only once"- "Some unspecified defect prevented a second use"
"In good condition" - "Can be repaird by experienced expert"
"As is" - "You wouldnt want it even if you were payed for it, if you knew ..."


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


[FFmpeg-devel] [PATCH] RTSP: pass TLS args for RTSPS

2016-10-01 Thread jayridge
From: Jay Ridgeway 


This patch enables TLS args for RTSPS. This is necessary for client
certificates and cert validation.

Squash changes from feedback into one patch.

---
 libavformat/rtsp.c| 19 ---
 libavformat/rtsp.h|  8 
 libavformat/tls_gnutls.c  |  7 +++
 libavformat/tls_openssl.c |  7 +++
 libavformat/tls_schannel.c|  7 +++
 libavformat/tls_securetransport.c |  7 +++
 6 files changed, 52 insertions(+), 3 deletions(-)

diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index c6292c5..53ecb6c 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -78,6 +78,7 @@
 { "reorder_queue_size", "set number of packets to buffer for handling of 
reordered packets", OFFSET(reordering_queue_size), AV_OPT_TYPE_INT, { .i64 = -1 
}, -1, INT_MAX, DEC }, \
 { "buffer_size","Underlying protocol send/receive buffer size",
  OFFSET(buffer_size),   AV_OPT_TYPE_INT, { .i64 = -1 }, 
-1, INT_MAX, DEC|ENC } \
 
+#define NONNULLSTR(s) (s ? s : "")
 
 const AVOption ff_rtsp_options[] = {
 { "initial_pause",  "do not start playing the stream immediately", 
OFFSET(initial_pause), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, DEC },
@@ -97,6 +98,10 @@ const AVOption ff_rtsp_options[] = {
 { "stimeout", "set timeout (in microseconds) of socket TCP I/O 
operations", OFFSET(stimeout), AV_OPT_TYPE_INT, {.i64 = 0}, INT_MIN, INT_MAX, 
DEC },
 COMMON_OPTS(),
 { "user-agent", "override User-Agent header", OFFSET(user_agent), 
AV_OPT_TYPE_STRING, {.str = LIBAVFORMAT_IDENT}, 0, 0, DEC },
+{ "ca_file", "Certificate Authority database file", OFFSET(ca_file), 
AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC|ENC },
+{ "tls_verify", "verify the peer certificate", OFFSET(verify), 
AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, DEC|ENC},
+{ "cert_file", "certificate file", OFFSET(cert_file), AV_OPT_TYPE_STRING, 
{.str = NULL}, 0, 0, DEC|ENC },
+{ "key_file", "private key file", OFFSET(key_file),  AV_OPT_TYPE_STRING, 
{.str = NULL}, 0, 0, DEC|ENC },
 { NULL },
 };
 
@@ -1812,9 +1817,17 @@ redirect:
 } else {
 int ret;
 /* open the tcp connection */
-ff_url_join(tcpname, sizeof(tcpname), lower_rtsp_proto, NULL,
-host, port,
-"?timeout=%d", rt->stimeout);
+if (strcmp("tls", lower_rtsp_proto) == 0) {
+ff_url_join(tcpname, sizeof(tcpname), lower_rtsp_proto, NULL,
+host, port,
+
"?timeout=%d=%d=%s_file=%s_file=%s",
+rt->stimeout, rt->verify, NONNULLSTR(rt->ca_file),
+NONNULLSTR(rt->cert_file), NONNULLSTR(rt->key_file));
+} else {
+ff_url_join(tcpname, sizeof(tcpname), lower_rtsp_proto, NULL,
+host, port,
+"?timeout=%d", rt->stimeout);
+}
 if ((ret = ffurl_open_whitelist(>rtsp_hd, tcpname, 
AVIO_FLAG_READ_WRITE,
>interrupt_callback, NULL, s->protocol_whitelist, 
s->protocol_blacklist, NULL)) < 0) {
 err = ret;
diff --git a/libavformat/rtsp.h b/libavformat/rtsp.h
index 852fd67..fa872a8 100644
--- a/libavformat/rtsp.h
+++ b/libavformat/rtsp.h
@@ -408,6 +408,14 @@ typedef struct RTSPState {
 
 char default_lang[4];
 int buffer_size;
+
+/** The following are used for RTSPS streams */
+//@{
+char *ca_file;
+int verify;
+char *cert_file;
+char *key_file;
+//@}
 } RTSPState;
 
 #define RTSP_FLAG_FILTER_SRC  0x1/**< Filter incoming UDP packets -
diff --git a/libavformat/tls_gnutls.c b/libavformat/tls_gnutls.c
index 991b36b..ecc80bf 100644
--- a/libavformat/tls_gnutls.c
+++ b/libavformat/tls_gnutls.c
@@ -235,6 +235,12 @@ static int tls_write(URLContext *h, const uint8_t *buf, 
int size)
 return print_tls_error(h, ret);
 }
 
+static int tls_get_file_handle(URLContext *h)
+{
+TLSContext *c = h->priv_data;
+return ffurl_get_file_handle(c->tls_shared.tcp);
+}
+
 static const AVOption options[] = {
 TLS_COMMON_OPTIONS(TLSContext, tls_shared),
 { NULL }
@@ -253,6 +259,7 @@ const URLProtocol ff_tls_gnutls_protocol = {
 .url_read   = tls_read,
 .url_write  = tls_write,
 .url_close  = tls_close,
+.url_get_file_handle = tls_get_file_handle,
 .priv_data_size = sizeof(TLSContext),
 .flags  = URL_PROTOCOL_FLAG_NETWORK,
 .priv_data_class = _class,
diff --git a/libavformat/tls_openssl.c b/libavformat/tls_openssl.c
index 46eb3e6..1455392 100644
--- a/libavformat/tls_openssl.c
+++ b/libavformat/tls_openssl.c
@@ -283,6 +283,12 @@ static int tls_write(URLContext *h, const uint8_t *buf, 
int size)
 return print_tls_error(h, ret);
 }
 
+static int tls_get_file_handle(URLContext *h)
+{
+TLSContext *c = h->priv_data;
+return ffurl_get_file_handle(c->tls_shared.tcp);
+}
+
 static const AVOption 

Re: [FFmpeg-devel] lurking bugs in the mmx-related assembler code (?)

2016-10-01 Thread u-h8zb
Hello Ronald,

On Sat, Oct 01, 2016 at 03:11:38PM -0400, Ronald S. Bultje wrote:
> I'm not sure we want to go down the rabbit hole of allowing any code to be
> executed inside frame en/decoding routines. Historically, IIRC, we have
> disallowed float in user callbacks like request_frame also.
> 
> Why does musl malloc require float? This is a real question. I can't think
> of any reason why you'd want this.

Taking the question for what it is, I have already answered - because
it make sence for the C library implementation and functioning.

We are not talking about what you and me "would like inside a standard
library" but whether we can rely on the specified interfaces. The
malloc() interface was apparently misunderstood as a promise to never
do float. There is no such promise.

If ffmpeg depends on the implementation details behind the abstraction
of the standard C library, then it is not portable. This would be
regrettable.

> Historically, IIRC, we have
> disallowed float in user callbacks like request_frame also.

It is fine to disallow calling any C library routines which can do
floats. Then this by definition implies the majority (all?) of the C
library routines, because the user has no power over its internals.

We can not do anything to this fact, if we do not break the C library
abstraction by postulating implementation details or redefining
the interfaces with extra non-standard contraints.

I would of course instead prefer keeping the assembler code harmless
to the FPU and hope this is not overly expensive.

If this is a real hit against efficiency (frankly, it should not be
_that_ important, mmx is a technology of the past anyway) it might be
worth taking up on the musl mailing list and see what its developers say.

Regards,
Rune

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


Re: [FFmpeg-devel] lurking bugs in the mmx-related assembler code (?)

2016-10-01 Thread wm4
On Sat, 1 Oct 2016 20:27:44 +0200
u-h...@aetey.se wrote:

> If you are curious you may wish to look at its code (it is clean
> and readable).

Would you really call the piece of code that uses float in malloc.c
readable?
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] configure: define posix source on cygwin

2016-10-01 Thread Josh de Kock

On 01/10/2016 20:41, Timo Rothenpieler wrote:

Will push tomorrow if nobody objects.


LGTM, maybe add a note which says that it may have been a cygwin update 
which broke the build.


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


Re: [FFmpeg-devel] [PATCH 1/2] ffplay: use decoder avctx for decoded subtitle width/height

2016-10-01 Thread Josh de Kock

On 01/10/2016 17:17, Marton Balint wrote:

Fixes ticket #5873.

Signed-off-by: Marton Balint 
---
 ffplay.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/ffplay.c b/ffplay.c
index e64909a..a7a6785 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -2224,7 +2224,6 @@ static int video_thread(void *arg)
 static int subtitle_thread(void *arg)
 {
 VideoState *is = arg;
-AVCodecParameters *codecpar = is->subtitle_st->codecpar;
 Frame *sp;
 int got_subtitle;
 double pts;
@@ -2243,8 +2242,8 @@ static int subtitle_thread(void *arg)
 pts = sp->sub.pts / (double)AV_TIME_BASE;
 sp->pts = pts;
 sp->serial = is->subdec.pkt_serial;
-sp->width = codecpar->width;
-sp->height = codecpar->height;
+sp->width = is->subdec.avctx->width;
+sp->height = is->subdec.avctx->height;
 sp->uploaded = 0;

 /* now we can update the picture count */



Feels backwards to go to a avctx from codecpar, but if it fixes 5873 
then it's fine, it can always be changed back again in the future--so LGTM.


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


Re: [FFmpeg-devel] [PATCH] configure: define posix source on cygwin

2016-10-01 Thread Timo Rothenpieler
Will push tomorrow if nobody objects.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 2/2] ffplay: remove unused viddec_width/viddec_height

2016-10-01 Thread Josh de Kock

On 01/10/2016 17:17, Marton Balint wrote:

Signed-off-by: Marton Balint 
---
 ffplay.c | 9 -
 1 file changed, 9 deletions(-)

diff --git a/ffplay.c b/ffplay.c
index a7a6785..6d43191 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -230,9 +230,6 @@ typedef struct VideoState {
 Decoder viddec;
 Decoder subdec;

-int viddec_width;
-int viddec_height;
-
 int audio_stream;

 int av_sync_type;
@@ -1780,9 +1777,6 @@ static int get_video_frame(VideoState *is, AVFrame *frame)

 frame->sample_aspect_ratio = av_guess_sample_aspect_ratio(is->ic, 
is->video_st, frame);

-is->viddec_width  = frame->width;
-is->viddec_height = frame->height;
-
 if (framedrop>0 || (framedrop && get_master_sync_type(is) != 
AV_SYNC_VIDEO_MASTER)) {
 if (frame->pts != AV_NOPTS_VALUE) {
 double diff = dpts - get_master_clock(is);
@@ -2687,9 +2681,6 @@ static int stream_component_open(VideoState *is, int 
stream_index)
 is->video_stream = stream_index;
 is->video_st = ic->streams[stream_index];

-is->viddec_width  = avctx->width;
-is->viddec_height = avctx->height;
-
 decoder_init(>viddec, avctx, >videoq, 
is->continue_read_thread);
 if ((ret = decoder_start(>viddec, video_thread, is)) < 0)
 goto out;



LGTM.

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


Re: [FFmpeg-devel] [PATCH] fate: Add PSP test

2016-10-01 Thread James Almer
On 10/1/2016 4:24 PM, Michael Niedermayer wrote:
> Signed-off-by: Michael Niedermayer 
> ---
>  tests/fate/ffmpeg.mak |   4 +
>  tests/ref/fate/psp| 287 
> ++
>  2 files changed, 291 insertions(+)
>  create mode 100644 tests/ref/fate/psp
> 
> diff --git a/tests/fate/ffmpeg.mak b/tests/fate/ffmpeg.mak
> index eb90090..a0d9f9b 100644
> --- a/tests/fate/ffmpeg.mak
> +++ b/tests/fate/ffmpeg.mak
> @@ -105,5 +105,9 @@ fate-ffmpeg-bsf-remove-e: 
> $(TARGET_SAMPLES)/mpeg2/matrixbench_mpeg2.lq1.mpg
>  fate-ffmpeg-bsf-remove-e: CMD = transcode "mpeg" 
> $(TARGET_SAMPLES)/mpeg2/matrixbench_mpeg2.lq1.mpg\
>avi "-vbsf remove_extra=e" "-codec copy"
>  
> +FATE_SAMPLES_FFMPEG-$(call ALLYES, MOV_DEMUXER MOV_MUXER) += fate-psp

fate-copy-psp or fate-remux-psp would be a better name, i think.
Also, add it to FATE_STREAMCOPY earlier in the file instead.

> +fate-psp: $(TARGET_SAMPLES)/h264/wwwq_cut.mp4
> +fate-psp: CMD = transcode "mov" $(TARGET_SAMPLES)/h264/wwwq_cut.mp4\
> +  psp "-c copy" "-codec copy"
>  
>  FATE_SAMPLES_FFMPEG-yes += $(FATE_STREAMCOPY-yes)

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


[FFmpeg-devel] [PATCH] fate: Add PSP test

2016-10-01 Thread Michael Niedermayer
Signed-off-by: Michael Niedermayer 
---
 tests/fate/ffmpeg.mak |   4 +
 tests/ref/fate/psp| 287 ++
 2 files changed, 291 insertions(+)
 create mode 100644 tests/ref/fate/psp

diff --git a/tests/fate/ffmpeg.mak b/tests/fate/ffmpeg.mak
index eb90090..a0d9f9b 100644
--- a/tests/fate/ffmpeg.mak
+++ b/tests/fate/ffmpeg.mak
@@ -105,5 +105,9 @@ fate-ffmpeg-bsf-remove-e: 
$(TARGET_SAMPLES)/mpeg2/matrixbench_mpeg2.lq1.mpg
 fate-ffmpeg-bsf-remove-e: CMD = transcode "mpeg" 
$(TARGET_SAMPLES)/mpeg2/matrixbench_mpeg2.lq1.mpg\
   avi "-vbsf remove_extra=e" "-codec copy"
 
+FATE_SAMPLES_FFMPEG-$(call ALLYES, MOV_DEMUXER MOV_MUXER) += fate-psp
+fate-psp: $(TARGET_SAMPLES)/h264/wwwq_cut.mp4
+fate-psp: CMD = transcode "mov" $(TARGET_SAMPLES)/h264/wwwq_cut.mp4\
+  psp "-c copy" "-codec copy"
 
 FATE_SAMPLES_FFMPEG-yes += $(FATE_STREAMCOPY-yes)
diff --git a/tests/ref/fate/psp b/tests/ref/fate/psp
new file mode 100644
index 000..df6e532
--- /dev/null
+++ b/tests/ref/fate/psp
@@ -0,0 +1,287 @@
+c4b2503a069fecd2f82704decf285160 *tests/data/fate/psp.psp
+2041379 tests/data/fate/psp.psp
+#extradata 0:   51, 0xaf6d1012
+#extradata 1:2, 0x00b200a1
+#tb 0: 1/9
+#media_type 0: video
+#codec_id 0: h264
+#dimensions 0: 1280x720
+#sar 0: 3/4
+#tb 1: 1/48000
+#media_type 1: audio
+#codec_id 1: aac
+#sample_rate 1: 48000
+#channel_layout 1: 3
+0,  0,  0, 3003,37084, 0x021a0d3f
+1,  0,  0, 1024,   10, 0x0e270398
+1,   1024,   1024, 1025,   10, 0x0f4703b8
+0,   3003,   3003, 3003, 6925, 0x011b3822, F=0x0
+1,   2049,   2049, 1023,  334, 0x2675a55f
+1,   3072,   3072, 1024,  230, 0xae3f7159
+0,   6006,   6006, 3003, 7555, 0x1bca7055, F=0x0
+1,   4096,   4096, 1025,  262, 0x76e98657
+0,   9009,   9009, 3003, 8757, 0x3a20f1d9, F=0x0
+1,   5121,   5121, 1023,  233, 0x262577fd
+1,   6144,   6144, 1024,  233, 0x75ab73c7
+0,  12012,  12012, 3003,13027, 0x40e3644b, F=0x0
+1,   7168,   7168, 1025,  236, 0x701e7571
+0,  15015,  15015, 3003,12987, 0x41133465, F=0x0
+1,   8193,   8193, 1023,  245, 0x09cd77dd
+1,   9216,   9216, 1024,  231, 0xa9cb7094
+0,  18018,  18018, 3003,13987, 0x362d60c8, F=0x0
+1,  10240,  10240, 1025,  245, 0xc99d7a23
+0,  21021,  21021, 3003,13963, 0x9b1124af, F=0x0
+1,  11265,  11265, 1023,  243, 0xbeeb7935
+1,  12288,  12288, 1024,  238, 0xe4bd7cf5
+0,  24024,  24024, 3003,15351, 0xd21aa7af, F=0x0
+1,  13312,  13312, 1025,  238, 0x7e9b75d8
+1,  14337,  14337, 1023,  246, 0x49147fd8
+0,  27027,  27027, 3003,21021, 0x9df020ce, F=0x0
+1,  15360,  15360, 1024,  246, 0x5a317584
+0,  30030,  30030, 3003,14791, 0x8bee8b7d, F=0x0
+1,  16384,  16384, 1025,  231, 0xfcb075e9
+1,  17409,  17409, 1023,  232, 0xf3136bef
+0,  33033,  33033, 3003,11922, 0x0b362d3d, F=0x0
+1,  18432,  18432, 1024,  237, 0xab837892
+0,  36036,  36036, 3003,11239, 0x77fddbf0, F=0x0
+1,  19456,  19456, 1025,  232, 0x317c7568
+1,  20481,  20481, 1023,  234, 0x904a79bc
+0,  39039,  39039, 3003,17621, 0xcb0a52fe, F=0x0
+1,  21504,  21504, 1024,  237, 0x28ec7ac7
+0,  42042,  42042, 3003,10694, 0xc6b4d5fa, F=0x0
+1,  22528,  22528, 1025,  234, 0x1fd2755e
+1,  23553,  23553, 1023,  229, 0xdcaa78d0
+0,  45045,  45045, 3003,45249, 0x6f6421ee
+1,  24576,  24576, 1024,  238, 0xfaf673bc
+1,  25600,  25600, 1025,  236, 0x16867d24
+0,  48048,  48048, 3003,20842, 0x6521c147, F=0x0
+1,  26625,  26625, 1023,  238, 0x6ee87de7
+0,  51051,  51051, 3003,21423, 0x7a01a052, F=0x0
+1,  27648,  27648, 1024,  234, 0xf4ee6df3
+1,  28672,  28672, 1025,  235, 0xe7b8777f
+0,  54054,  54054, 3003,15648, 0x6dfd2f29, F=0x0
+1,  29697,  29697, 1023,  236, 0x8c367282
+0,  57057,  57057, 3003,11961, 0x971439f6, F=0x0
+1,  30720,  30720, 1024,  239, 0x3be87756
+1,  31744,  31744, 1025,  243, 0x1bbb727b
+0,  60060,  60060, 3003,15398, 0x93edd999, F=0x0
+1,  32769,  32769, 1023,  242, 0xb1c7746f
+0,  63063,  63063, 3003,14844, 0x83811831, F=0x0
+1,  33792,  33792, 1024,  237, 0xe1c97add
+1,  34816,  34816, 1025,  235, 0xce716f9a
+0,  66066,  

[FFmpeg-devel] [PATCH v2] doc/developer: improve development policy formatting

2016-10-01 Thread Josh de Kock
This commit also rewords some of the policies for more clarity.

Signed-off-by: Josh de Kock 
---
 doc/developer.texi | 172 +
 1 file changed, 82 insertions(+), 90 deletions(-)

diff --git a/doc/developer.texi b/doc/developer.texi
index 4d3a7ae..b3f5218 100644
--- a/doc/developer.texi
+++ b/doc/developer.texi
@@ -246,8 +246,9 @@ For Emacs, add these roughly equivalent lines to your 
@file{.emacs.d/init.el}:
 
 @section Development Policy
 
-@enumerate
-@item
+@subsection Patches/Committing
+
+@subheading Licenses for patches must be compatible with FFmpeg.
 Contributions should be licensed under the
 @uref{http://www.gnu.org/licenses/lgpl-2.1.html, LGPL 2.1},
 including an "or any later version" clause, or, if you prefer
@@ -260,15 +261,13 @@ preferred.
 If you add a new file, give it a proper license header. Do not copy and
 paste it from a random place, use an existing file as template.
 
-@item
-You must not commit code which breaks FFmpeg! (Meaning unfinished but
-enabled code which breaks compilation or compiles but does not work or
-breaks the regression tests)
-You can commit unfinished stuff (for testing etc), but it must be disabled
-(#ifdef etc) by default so it does not interfere with other developers'
-work.
+@subheading You must not commit code which breaks FFmpeg!
+This means unfinished code which is enabled and breaks compilation,
+compiles but does not work or breaks the regression tests). Always
+check the mailing list for any reviewers with issues and test FATE
+before you push.
 
-@item
+@subheading Keep the main commit message short with an extended description 
below.
 The commit message should have a short first line in the form of
 a @samp{topic: short description} as a header, separated by a newline
 from the body consisting of an explanation of why the change is necessary.
@@ -276,53 +275,7 @@ If the commit fixes a known bug on the bug tracker, the 
commit message
 should include its bug ID. Referring to the issue on the bug tracker does
 not exempt you from writing an excerpt of the bug in the commit message.
 
-@item
-You do not have to over-test things. If it works for you, and you think it
-should work for others, then commit. If your code has problems
-(portability, triggers compiler bugs, unusual environment etc) they will be
-reported and eventually fixed.
-
-@item
-Do not commit unrelated changes together, split them into self-contained
-pieces. Also do not forget that if part B depends on part A, but A does not
-depend on B, then A can and should be committed first and separate from B.
-Keeping changes well split into self-contained parts makes reviewing and
-understanding them on the commit log mailing list easier. This also helps
-in case of debugging later on.
-Also if you have doubts about splitting or not splitting, do not hesitate to
-ask/discuss it on the developer mailing list.
-
-@item
-Do not change behavior of the programs (renaming options etc) or public
-API or ABI without first discussing it on the ffmpeg-devel mailing list.
-Do not remove functionality from the code. Just improve!
-
-Note: Redundant code can be removed.
-
-@item
-Do not commit changes to the build system (Makefiles, configure script)
-which change behavior, defaults etc, without asking first. The same
-applies to compiler warning fixes, trivial looking fixes and to code
-maintained by other developers. We usually have a reason for doing things
-the way we do. Send your changes as patches to the ffmpeg-devel mailing
-list, and if the code maintainers say OK, you may commit. This does not
-apply to files you wrote and/or maintain.
-
-@item
-We refuse source indentation and other cosmetic changes if they are mixed
-with functional changes, such commits will be rejected and removed. Every
-developer has his own indentation style, you should not change it. Of course
-if you (re)write something, you can use your own style, even though we would
-prefer if the indentation throughout FFmpeg was consistent (Many projects
-force a given indentation style - we do not.). If you really need to make
-indentation changes (try to avoid this), separate them strictly from real
-changes.
-
-NOTE: If you had to put if()@{ .. @} over a large (> 5 lines) chunk of code,
-then either do NOT change the indentation of the inner part within (do not
-move it to the right)! or do so in a separate commit
-
-@item
+@subheading Commit messages should always be filled out properly
 Always fill out the commit log message. Describe in a few lines what you
 changed and why. You can refer to mailing list postings if you fix a
 particular bug. Comments such as "fixed!" or "Changed it." are unacceptable.
@@ -334,57 +287,68 @@ area changed: Short 1 line description
 details describing what and why and giving references.
 @end example
 
-@item
+@subheading Do not commit unrelated changes together,
+You should split them into self-contained pieces. Also do not 

Re: [FFmpeg-devel] lurking bugs in the mmx-related assembler code (?)

2016-10-01 Thread Ronald S. Bultje
Hi,

On Sat, Oct 1, 2016 at 2:27 PM,  wrote:

> Hello,
>
> It looks like some general information is due:
>
> Musl libc is a high quality standard C library for Linux
> with emphasis on "quality" and "standard"
>  http://www.musl-libc.org/
>
> On Sat, Oct 01, 2016 at 12:31:05PM -0400, Ronald S. Bultje wrote:
> > > This means when malloc()/free()/... happens to be called internally,
> > > it corrupts the malloc structures, in a non-straightforward ways.
> >
> > That's correct.
> >
> > Why does your malloc implementation use floats?
>
> Not mine, but musl's. I am not involved in musl development.
>
> (The tradition of fixed-point malloc was born while floating point was
> extremely expensive. It is otherwise a "myth" that memory management
> can not have use for floating point operations. Musl malloc() is well
> behaving, efficient and robust.)
>
> If you are curious you may wish to look at its code (it is clean
> and readable).
>
> On Sat, Oct 01, 2016 at 06:38:49PM +0200, Henrik Gramner wrote:
> > On Sat, Oct 1, 2016 at 5:37 PM,   wrote:
> > > musl libc which uses floating point in its malloc() implementation.
> >
> > That's honestly the real "WTF?" here.
>
> I hope the explanation above sheds light on the matter.
>
> > In that case use emms_c() before calling those functions.
>
> Yes, it is probably what ffmpeg should do and this is the point of my
> report. If you mean that I should have submitted a patch, I really
> hope somebody else can do the actual fix(es).


I'm not sure we want to go down the rabbit hole of allowing any code to be
executed inside frame en/decoding routines. Historically, IIRC, we have
disallowed float in user callbacks like request_frame also.

Why does musl malloc require float? This is a real question. I can't think
of any reason why you'd want this.

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


Re: [FFmpeg-devel] [PATCH] lavc: remove libfaac wrapper

2016-10-01 Thread Rostislav Pehlivanov
On 30 September 2016 at 14:16, Rostislav Pehlivanov 
wrote:

>
>
> On 29 September 2016 at 21:54, Josh de Kock  wrote:
>
>> There is really no need for two aac wrappers, we already have
>> libfdk-aac which is better. Not to mention that faac doesn't
>> even support HEv1, or HEv2. It's also under a license which is
>> unusable for distribution, so it would only be useful to people
>> who will compile their own ffmpeg, only use it themselves (which
>> at that point should just use fdk-aac).
>>
>> Signed-off-by: Josh de Kock 
>> ---
>>
>> ffmpeg-devel mailing list
>> ffmpeg-devel@ffmpeg.org
>> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>>
>
>
> Hi,
>
> Thanks for the patch, I'll push it tomorrow.
> Enough discussions have taken place that dealing with the aftermath of
> removing it will actually be easier than continuing the 6 month discussions
> that have been taking place.
> Our decoder is much faster than it (using the -aac_coder fast option) and
> still has much much better quality. Testcases are useless because libfaac
> does nothing right, especially in terms of bitstream compliance. And like
> wm4 mentioned, libfaac has license issues too.
>

Pushed

I'm looking at trac to see what needs a faac sample as a fate test, but if
anyone's bored they're welcome to join me :)
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 2/2] RTSP: use type bool and lower case opt descriptions

2016-10-01 Thread jayridge
From: Jay Ridgeway 

---
 libavformat/rtsp.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index 179a59b..53ecb6c 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -99,9 +99,9 @@ const AVOption ff_rtsp_options[] = {
 COMMON_OPTS(),
 { "user-agent", "override User-Agent header", OFFSET(user_agent), 
AV_OPT_TYPE_STRING, {.str = LIBAVFORMAT_IDENT}, 0, 0, DEC },
 { "ca_file", "Certificate Authority database file", OFFSET(ca_file), 
AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC|ENC },
-{ "tls_verify", "Verify the peer certificate", OFFSET(verify), 
AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, DEC|ENC},
-{ "cert_file", "Certificate file", OFFSET(cert_file), AV_OPT_TYPE_STRING, 
{.str = NULL}, 0, 0, DEC|ENC },
-{ "key_file", "Private key file", OFFSET(key_file),  AV_OPT_TYPE_STRING, 
{.str = NULL}, 0, 0, DEC|ENC },
+{ "tls_verify", "verify the peer certificate", OFFSET(verify), 
AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, DEC|ENC},
+{ "cert_file", "certificate file", OFFSET(cert_file), AV_OPT_TYPE_STRING, 
{.str = NULL}, 0, 0, DEC|ENC },
+{ "key_file", "private key file", OFFSET(key_file),  AV_OPT_TYPE_STRING, 
{.str = NULL}, 0, 0, DEC|ENC },
 { NULL },
 };
 
-- 
2.6.3

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


[FFmpeg-devel] [PATCH 1/2] RTSP: pass TLS args for RTSPS

2016-10-01 Thread jayridge
From: Jay Ridgeway 

rename URISTR to NONNULLSTR
---
 libavformat/rtsp.c| 19 ---
 libavformat/rtsp.h|  8 
 libavformat/tls_gnutls.c  |  7 +++
 libavformat/tls_openssl.c |  7 +++
 libavformat/tls_schannel.c|  7 +++
 libavformat/tls_securetransport.c |  7 +++
 6 files changed, 52 insertions(+), 3 deletions(-)

diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index c6292c5..179a59b 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -78,6 +78,7 @@
 { "reorder_queue_size", "set number of packets to buffer for handling of 
reordered packets", OFFSET(reordering_queue_size), AV_OPT_TYPE_INT, { .i64 = -1 
}, -1, INT_MAX, DEC }, \
 { "buffer_size","Underlying protocol send/receive buffer size",
  OFFSET(buffer_size),   AV_OPT_TYPE_INT, { .i64 = -1 }, 
-1, INT_MAX, DEC|ENC } \
 
+#define NONNULLSTR(s) (s ? s : "")
 
 const AVOption ff_rtsp_options[] = {
 { "initial_pause",  "do not start playing the stream immediately", 
OFFSET(initial_pause), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, DEC },
@@ -97,6 +98,10 @@ const AVOption ff_rtsp_options[] = {
 { "stimeout", "set timeout (in microseconds) of socket TCP I/O 
operations", OFFSET(stimeout), AV_OPT_TYPE_INT, {.i64 = 0}, INT_MIN, INT_MAX, 
DEC },
 COMMON_OPTS(),
 { "user-agent", "override User-Agent header", OFFSET(user_agent), 
AV_OPT_TYPE_STRING, {.str = LIBAVFORMAT_IDENT}, 0, 0, DEC },
+{ "ca_file", "Certificate Authority database file", OFFSET(ca_file), 
AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC|ENC },
+{ "tls_verify", "Verify the peer certificate", OFFSET(verify), 
AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, DEC|ENC},
+{ "cert_file", "Certificate file", OFFSET(cert_file), AV_OPT_TYPE_STRING, 
{.str = NULL}, 0, 0, DEC|ENC },
+{ "key_file", "Private key file", OFFSET(key_file),  AV_OPT_TYPE_STRING, 
{.str = NULL}, 0, 0, DEC|ENC },
 { NULL },
 };
 
@@ -1812,9 +1817,17 @@ redirect:
 } else {
 int ret;
 /* open the tcp connection */
-ff_url_join(tcpname, sizeof(tcpname), lower_rtsp_proto, NULL,
-host, port,
-"?timeout=%d", rt->stimeout);
+if (strcmp("tls", lower_rtsp_proto) == 0) {
+ff_url_join(tcpname, sizeof(tcpname), lower_rtsp_proto, NULL,
+host, port,
+
"?timeout=%d=%d=%s_file=%s_file=%s",
+rt->stimeout, rt->verify, NONNULLSTR(rt->ca_file),
+NONNULLSTR(rt->cert_file), NONNULLSTR(rt->key_file));
+} else {
+ff_url_join(tcpname, sizeof(tcpname), lower_rtsp_proto, NULL,
+host, port,
+"?timeout=%d", rt->stimeout);
+}
 if ((ret = ffurl_open_whitelist(>rtsp_hd, tcpname, 
AVIO_FLAG_READ_WRITE,
>interrupt_callback, NULL, s->protocol_whitelist, 
s->protocol_blacklist, NULL)) < 0) {
 err = ret;
diff --git a/libavformat/rtsp.h b/libavformat/rtsp.h
index 852fd67..fa872a8 100644
--- a/libavformat/rtsp.h
+++ b/libavformat/rtsp.h
@@ -408,6 +408,14 @@ typedef struct RTSPState {
 
 char default_lang[4];
 int buffer_size;
+
+/** The following are used for RTSPS streams */
+//@{
+char *ca_file;
+int verify;
+char *cert_file;
+char *key_file;
+//@}
 } RTSPState;
 
 #define RTSP_FLAG_FILTER_SRC  0x1/**< Filter incoming UDP packets -
diff --git a/libavformat/tls_gnutls.c b/libavformat/tls_gnutls.c
index 991b36b..ecc80bf 100644
--- a/libavformat/tls_gnutls.c
+++ b/libavformat/tls_gnutls.c
@@ -235,6 +235,12 @@ static int tls_write(URLContext *h, const uint8_t *buf, 
int size)
 return print_tls_error(h, ret);
 }
 
+static int tls_get_file_handle(URLContext *h)
+{
+TLSContext *c = h->priv_data;
+return ffurl_get_file_handle(c->tls_shared.tcp);
+}
+
 static const AVOption options[] = {
 TLS_COMMON_OPTIONS(TLSContext, tls_shared),
 { NULL }
@@ -253,6 +259,7 @@ const URLProtocol ff_tls_gnutls_protocol = {
 .url_read   = tls_read,
 .url_write  = tls_write,
 .url_close  = tls_close,
+.url_get_file_handle = tls_get_file_handle,
 .priv_data_size = sizeof(TLSContext),
 .flags  = URL_PROTOCOL_FLAG_NETWORK,
 .priv_data_class = _class,
diff --git a/libavformat/tls_openssl.c b/libavformat/tls_openssl.c
index 46eb3e6..1455392 100644
--- a/libavformat/tls_openssl.c
+++ b/libavformat/tls_openssl.c
@@ -283,6 +283,12 @@ static int tls_write(URLContext *h, const uint8_t *buf, 
int size)
 return print_tls_error(h, ret);
 }
 
+static int tls_get_file_handle(URLContext *h)
+{
+TLSContext *c = h->priv_data;
+return ffurl_get_file_handle(c->tls_shared.tcp);
+}
+
 static const AVOption options[] = {
 TLS_COMMON_OPTIONS(TLSContext, tls_shared),
 { NULL }
@@ -301,6 +307,7 @@ const URLProtocol 

[FFmpeg-devel] [PATCH 0/2] RTSP: pass TLS args to RTSPS

2016-10-01 Thread jayridge
From: Jay Ridgeway 


This patch enables client cert and cert validation for RTSPS.

This is the second submission of this patch. Still learning git send-email.


Jay Ridgeway (2):
  pass TLS args for RTSPS
  RTSPS: use type bool and lower case opt descriptions

 libavformat/rtsp.c| 19 ---
 libavformat/rtsp.h|  8 
 libavformat/tls_gnutls.c  |  7 +++
 libavformat/tls_openssl.c |  7 +++
 libavformat/tls_schannel.c|  7 +++
 libavformat/tls_securetransport.c |  7 +++
 6 files changed, 52 insertions(+), 3 deletions(-)

-- 
2.6.3

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


Re: [FFmpeg-devel] lurking bugs in the mmx-related assembler code (?)

2016-10-01 Thread u-h8zb
Hello,

It looks like some general information is due:

Musl libc is a high quality standard C library for Linux
with emphasis on "quality" and "standard"
 http://www.musl-libc.org/

On Sat, Oct 01, 2016 at 12:31:05PM -0400, Ronald S. Bultje wrote:
> > This means when malloc()/free()/... happens to be called internally,
> > it corrupts the malloc structures, in a non-straightforward ways.
> 
> That's correct.
> 
> Why does your malloc implementation use floats?

Not mine, but musl's. I am not involved in musl development.

(The tradition of fixed-point malloc was born while floating point was
extremely expensive. It is otherwise a "myth" that memory management
can not have use for floating point operations. Musl malloc() is well
behaving, efficient and robust.)

If you are curious you may wish to look at its code (it is clean
and readable).

On Sat, Oct 01, 2016 at 06:38:49PM +0200, Henrik Gramner wrote:
> On Sat, Oct 1, 2016 at 5:37 PM,   wrote:
> > musl libc which uses floating point in its malloc() implementation.
> 
> That's honestly the real "WTF?" here.

I hope the explanation above sheds light on the matter.

> In that case use emms_c() before calling those functions.

Yes, it is probably what ffmpeg should do and this is the point of my
report. If you mean that I should have submitted a patch, I really
hope somebody else can do the actual fix(es).

Regards,
Rune

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


Re: [FFmpeg-devel] [PATCH] libavdevice/lavfi.c: adjust subcc_packet->pts to be in 90 timebase

2016-10-01 Thread Chris Landry
Haven't been able to connect to upload.ffmpeg.org.
Sample file is here:
https://www.dropbox.com/s/38ll6y7wws7zssr/cc_different_video_timebase.mp4?dl=0

Also have not been able to get the fate stuff working. I am not a C
developer and have a lot to learn here.


On Sat, Oct 1, 2016 at 6:27 AM, Michael Niedermayer 
wrote:

> On Fri, Sep 30, 2016 at 11:02:32PM -0400, Chris Landry wrote:
> > From: Chris Landry 
> >
> > When a video stream timebase is not 90k, the cc packet pts is relevant
> to the timebase of the video stream, but later is assumed to be 90k. Adjust
> it here to be 90k so timing is accurate in resulting subs.
> >
> > Signed-off-by: Chris Landry 
> > ---
> >  libavdevice/lavfi.c | 11 ++-
> >  1 file changed, 10 insertions(+), 1 deletion(-)
> >
> > diff --git a/libavdevice/lavfi.c b/libavdevice/lavfi.c
> > index f9b2694..ffe5e0e 100644
> > --- a/libavdevice/lavfi.c
> > +++ b/libavdevice/lavfi.c
> > @@ -58,6 +58,7 @@ typedef struct {
> >  AVFrame *decoded_frame;
> >  int nb_sinks;
> >  AVPacket subcc_packet;
> > +AVRational video_time_base;
> >  } LavfiContext;
> >
> >  static int *create_all_formats(int n)
> > @@ -317,6 +318,8 @@ av_cold static int lavfi_read_header(AVFormatContext
> *avctx)
> >  st->codecpar->codec_type = link->type;
> >  avpriv_set_pts_info(st, 64, link->time_base.num,
> link->time_base.den);
> >  if (link->type == AVMEDIA_TYPE_VIDEO) {
> > +lavfi->video_time_base = link->time_base;
> > +
> >  st->codecpar->codec_id   = AV_CODEC_ID_RAWVIDEO;
> >  st->codecpar->format = link->format;
> >  st->codecpar->width  = link->w;
> > @@ -373,8 +376,14 @@ static int create_subcc_packet(AVFormatContext
> *avctx, AVFrame *frame,
> >  if ((ret = av_new_packet(>subcc_packet, sd->size)) < 0)
> >  return ret;
> >  memcpy(lavfi->subcc_packet.data, sd->data, sd->size);
> > +
> > +AVRational time_base = lavfi->video_time_base;
>
> likely triggers compiler warning
>
>
> > +
> > +double adjust_factor = time_base.den / (9.0 * time_base.num);
>
> floating point is not needed and not ok due to binary non portability
> theres av_rescale*
>
> also this breaks make fate
>
> do you have a testcase that this fixes ?
>
> [...]
> --
> 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
>
> ___
> 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] libavdevice/lavfi.c: adjust subcc_packet->pts to be in 90 timebase

2016-10-01 Thread Chris Landry
From: Chris Landry 

When a video stream timebase is not 90k, the cc packet pts is relevant to the 
timebase of the video stream, but later is assumed to be 90k. Adjust it here to 
be 90k so timing is accurate in resulting subs.

Signed-off-by: Chris Landry 
---
 libavdevice/lavfi.c | 11 ++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/libavdevice/lavfi.c b/libavdevice/lavfi.c
index f9b2694..ffe5e0e 100644
--- a/libavdevice/lavfi.c
+++ b/libavdevice/lavfi.c
@@ -58,6 +58,7 @@ typedef struct {
 AVFrame *decoded_frame;
 int nb_sinks;
 AVPacket subcc_packet;
+AVRational video_time_base;
 } LavfiContext;
 
 static int *create_all_formats(int n)
@@ -317,6 +318,8 @@ av_cold static int lavfi_read_header(AVFormatContext *avctx)
 st->codecpar->codec_type = link->type;
 avpriv_set_pts_info(st, 64, link->time_base.num, link->time_base.den);
 if (link->type == AVMEDIA_TYPE_VIDEO) {
+lavfi->video_time_base = link->time_base;
+
 st->codecpar->codec_id   = AV_CODEC_ID_RAWVIDEO;
 st->codecpar->format = link->format;
 st->codecpar->width  = link->w;
@@ -373,8 +376,14 @@ static int create_subcc_packet(AVFormatContext *avctx, 
AVFrame *frame,
 if ((ret = av_new_packet(>subcc_packet, sd->size)) < 0)
 return ret;
 memcpy(lavfi->subcc_packet.data, sd->data, sd->size);
+
+AVRational time_base = lavfi->video_time_base;
+
+double adjust_factor = time_base.den / (9.0 * time_base.num);
+double pts = frame->pts / adjust_factor;
+
 lavfi->subcc_packet.stream_index = stream_idx;
-lavfi->subcc_packet.pts = frame->pts;
+lavfi->subcc_packet.pts = (int64_t)pts;
 lavfi->subcc_packet.pos = av_frame_get_pkt_pos(frame);
 return 0;
 }
-- 
2.8.2

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


Re: [FFmpeg-devel] [PATCH] libavdevice/lavfi.c: adjust subcc_packet->pts to correct timebase with av_rescale_q

2016-10-01 Thread Chris Landry
Sorry, this was supposed to be submitted in response to my thread on this
one. New to sending email with git.

On Sat, Oct 1, 2016 at 2:04 PM, Chris Landry 
wrote:

> From: Chris Landry 
>
> Should have used av_rescale_q to do the timebase adjustment. Fixed
> compiler warning for variable declaration.
>
> Signed-off-by: Chris Landry 
> ---
>  libavdevice/lavfi.c | 6 ++
>  1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/libavdevice/lavfi.c b/libavdevice/lavfi.c
> index ffe5e0e..89979db 100644
> --- a/libavdevice/lavfi.c
> +++ b/libavdevice/lavfi.c
> @@ -364,6 +364,7 @@ static int create_subcc_packet(AVFormatContext
> *avctx, AVFrame *frame,
>  LavfiContext *lavfi = avctx->priv_data;
>  AVFrameSideData *sd;
>  int stream_idx, i, ret;
> +int64_t pts;
>
>  if ((stream_idx = lavfi->sink_stream_subcc_map[sink_idx]) < 0)
>  return 0;
> @@ -377,10 +378,7 @@ static int create_subcc_packet(AVFormatContext
> *avctx, AVFrame *frame,
>  return ret;
>  memcpy(lavfi->subcc_packet.data, sd->data, sd->size);
>
> -AVRational time_base = lavfi->video_time_base;
> -
> -double adjust_factor = time_base.den / (9.0 * time_base.num);
> -double pts = frame->pts / adjust_factor;
> +pts = av_rescale_q(frame->pts, lavfi->video_time_base,
> (AVRational){1, 9});
>
>  lavfi->subcc_packet.stream_index = stream_idx;
>  lavfi->subcc_packet.pts = (int64_t)pts;
> --
> 2.8.2
>
> ___
> 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] libavdevice/lavfi.c: adjust subcc_packet->pts to correct timebase with av_rescale_q

2016-10-01 Thread Chris Landry
From: Chris Landry 

Should have used av_rescale_q to do the timebase adjustment. Fixed compiler 
warning for variable declaration.

Signed-off-by: Chris Landry 
---
 libavdevice/lavfi.c | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/libavdevice/lavfi.c b/libavdevice/lavfi.c
index ffe5e0e..89979db 100644
--- a/libavdevice/lavfi.c
+++ b/libavdevice/lavfi.c
@@ -364,6 +364,7 @@ static int create_subcc_packet(AVFormatContext *avctx, 
AVFrame *frame,
 LavfiContext *lavfi = avctx->priv_data;
 AVFrameSideData *sd;
 int stream_idx, i, ret;
+int64_t pts;
 
 if ((stream_idx = lavfi->sink_stream_subcc_map[sink_idx]) < 0)
 return 0;
@@ -377,10 +378,7 @@ static int create_subcc_packet(AVFormatContext *avctx, 
AVFrame *frame,
 return ret;
 memcpy(lavfi->subcc_packet.data, sd->data, sd->size);
 
-AVRational time_base = lavfi->video_time_base;
-
-double adjust_factor = time_base.den / (9.0 * time_base.num);
-double pts = frame->pts / adjust_factor;
+pts = av_rescale_q(frame->pts, lavfi->video_time_base, (AVRational){1, 
9});
 
 lavfi->subcc_packet.stream_index = stream_idx;
 lavfi->subcc_packet.pts = (int64_t)pts;
-- 
2.8.2

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


Re: [FFmpeg-devel] [PATCH 2/4] V12 - SCTE-35 extraction from mpegts

2016-10-01 Thread Marton Balint


On Sat, 1 Oct 2016, Carlos Fernandez Sanz wrote:


From: Carlos Fernandez 

Signed-off-by: Carlos Fernandez 
---
libavformat/mpegts.c | 48 +++-
1 file changed, 47 insertions(+), 1 deletion(-)

diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index b31d233..c13d6d8 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -725,6 +725,12 @@ static const StreamType HDMV_types[] = {
{ 0 },
};

+/* SCTE types */
+static const StreamType SCTE_types[] = {
+{ 0x86, AVMEDIA_TYPE_DATA,  AV_CODEC_ID_SCTE_35},
+{ 0 },
+};
+
/* ATSC ? */
static const StreamType MISC_types[] = {
{ 0x81, AVMEDIA_TYPE_AUDIO, AV_CODEC_ID_AC3 },
@@ -872,6 +878,13 @@ static void reset_pes_packet_state(PESContext *pes)
av_buffer_unref(>buffer);
}

+static void new_data_packet(const uint8_t *buffer, int len, AVPacket *pkt)
+{
+av_init_packet(pkt);
+pkt->data = buffer;
+pkt->size = len;
+}
+
static int new_pes_packet(PESContext *pes, AVPacket *pkt)
{
char *sd;
@@ -1590,6 +1603,28 @@ static void m4sl_cb(MpegTSFilter *filter, const uint8_t 
*section,
av_free(mp4_descr[i].dec_config_descr);
}

+static void scte_data_cb(MpegTSFilter *filter, const uint8_t *section,
+int section_len)
+{
+AVProgram *prg = NULL;
+MpegTSContext *ts = filter->u.section_filter.opaque;
+
+int idx = ff_find_stream_index(ts->stream, filter->pid);
+if (idx < 0)
+return;
+
+new_data_packet(section, section_len, ts->pkt);
+ts->pkt->stream_index = idx;
+prg = av_find_program_from_stream(ts->stream, NULL, idx);
+if (prg && prg->pcr_pid != -1 && prg->discard != AVDISCARD_ALL) {
+MpegTSFilter *f = ts->pids[prg->pcr_pid];
+if (f && f->last_pcr != -1)
+ts->pkt->pts = ts->pkt->dts = f->last_pcr/300;
+}
+ts->stop_parse = 1;
+
+}
+
static const uint8_t opus_coupled_stream_cnt[9] = {
1, 0, 1, 1, 2, 2, 2, 3, 3
};
@@ -1868,6 +1903,12 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, 
AVStream *st, int stream_type
return 0;
}

+static int is_pes_stream(int stream_type, uint32_t prog_reg_desc)
+{
+return !(stream_type == 0x13 ||
+(stream_type == 0x86 && prog_reg_desc == AV_RL32("CUEI")) );
+}
+
static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int 
section_len)
{
MpegTSContext *ts = filter->u.section_filter.opaque;
@@ -1975,7 +2016,8 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t 
*section, int section_len
pes->st->id = pes->pid;
}
st = pes->st;
-} else if (stream_type != 0x13) {
+

Empty line.


+} else if (is_pes_stream(stream_type, prog_reg_desc)) {
if (ts->pids[pid])
mpegts_close_filter(ts, ts->pids[pid]); // wrongly added sdt 
filter probably
pes = add_pes_stream(ts, pid, pcr_pid);
@@ -1995,6 +2037,10 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t 
*section, int section_len
goto out;
st->id = pid;
st->codecpar->codec_type = AVMEDIA_TYPE_DATA;
+if (stream_type == 0x86 && prog_reg_desc == AV_RL32("CUEI")) {
+mpegts_find_stream_type(st, stream_type, SCTE_types);
+mpegts_open_section_filter(ts, pid, scte_data_cb, ts, 1);
+}
}
}

--


Otherwise LGTM, thanks.

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


Re: [FFmpeg-devel] lurking bugs in the mmx-related assembler code (?)

2016-10-01 Thread u-h8zb
Hello Moritz,

On Sat, Oct 01, 2016 at 06:13:46PM +0200, Moritz Barsnick wrote:
> On Sat, Oct 01, 2016 at 17:37:50 +0200, u-h...@aetey.se wrote:
> > My troubleshooting 
> [...]
> > behaves erratically on certain combinations
> [...]
> > Most often
> 
> You are a busy troubleshooter, but you fail to describe what you did,
> and what exactly went wrong. No-one will be able to (even try to)
> reproduce if you don't provide details.

I do not expect the ffmpeg developers to try to reproduce this.

I expect somebody to look at the code (beginning with the MMX assembler
in the vp3 decoder), which is a lower threshold than building a new libc.

> > P.S. an attempt to report via trac did not succeed, that's why posting
> > to the list
> 
> What was the issue there?

Let's take one issue at a time [*]
I mentioned this only as my effort to follow the expected bug reporting route.

> When trac finally works, you are asked to provide a command line to
> reproduce this (best something which doesn't use external libraries),

The problem is revealed by the use of a certain libc implementation.
A command line does not help much. It was among others

 ffmpeg -i test.640x480.19seconds.theora.ogg -c:v libtheora -y test.out.ogg

But there are also many other combinations of input and output data
which break. The exact outcome depends on many hardly controllable
variables, both at build time and at run time.

The two crucial details are building ffmpeg with assembler
optimizations and using musl libc. I mentioned those.

Regrettably I did not mention that the target platform is ia32.
My bad.

> and its full console output. In your case, you should also describe how
> you built ffmpeg, as you are using a "special" libc.

Well. for the formal purposes:
 ./configure ; make ; make install
which does not say anything without a detailed (and irrelevant)
description of what my build system looks like.

By the way, if there is something "special" about musl libc, it is the
very high level of code quality and standard compliance. The latter
exposes quite a few hidden bugs in various applications.

> Thanks,
> Moritz

Thanks for paying attention and teaching the bug reporters good manners :)
This is often necessary and useful.

Regards,
Rune

[*] Sorry but I can not contribute to troubleshooting/improvements of
the bug reporting system. Hopefully it works well enough for others.

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


[FFmpeg-devel] [PATCH 0/4] V12 - SCTE-35 support

2016-10-01 Thread Carlos Fernandez Sanz
- Addresses new comments such as like idx value checking and filename checking

Carlos Fernandez (4):
  Adding SCTE-35 CUI codec
  SCTE-35 extraction from mpegts
  SCTE-35 support in hlsenc
  Correct Indentation

 libavcodec/avcodec.h|   2 +
 libavcodec/codec_desc.c |   6 +
 libavformat/Makefile|   2 +-
 libavformat/hlsenc.c| 120 ---
 libavformat/mpegts.c|  48 -
 libavformat/scte_35.c   | 527 
 libavformat/scte_35.h   |  86 
 7 files changed, 764 insertions(+), 27 deletions(-)
 create mode 100644 libavformat/scte_35.c
 create mode 100644 libavformat/scte_35.h

-- 
2.7.4

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


[FFmpeg-devel] [PATCH 4/4] V12 - Correct Indentation

2016-10-01 Thread Carlos Fernandez Sanz
From: Carlos Fernandez 

Signed-off-by: Carlos Fernandez 
---
 libavformat/hlsenc.c | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index a3224ef..1aec53f 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -406,12 +406,12 @@ static int hls_append_segment(struct AVFormatContext *s, 
HLSContext *hls, double
 else
 en->sub_filename[0] = '\0';
 
-en->duration = duration;
-en->pos  = pos;
-en->event= event;
-en->size = size;
+en->duration   = duration;
+en->pos= pos;
+en->event  = event;
+en->size   = size;
 en->start_pts  = start_pts;
-en->next = NULL;
+en->next   = NULL;
 
 if (hls->scte_iface) {
 if (hls->scte_iface->event_state == EVENT_OUT_CONT) {
-- 
2.7.4

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


[FFmpeg-devel] [PATCH 3/4] V12 - SCTE-35 support in hlsenc

2016-10-01 Thread Carlos Fernandez Sanz
From: Carlos Fernandez 

Signed-off-by: Carlos Fernandez 
---
 libavformat/Makefile  |   2 +-
 libavformat/hlsenc.c  | 112 +--
 libavformat/scte_35.c | 527 ++
 libavformat/scte_35.h |  86 
 4 files changed, 705 insertions(+), 22 deletions(-)
 create mode 100644 libavformat/scte_35.c
 create mode 100644 libavformat/scte_35.h

diff --git a/libavformat/Makefile b/libavformat/Makefile
index 5d827d31..9218606 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -205,7 +205,7 @@ OBJS-$(CONFIG_HDS_MUXER) += hdsenc.o
 OBJS-$(CONFIG_HEVC_DEMUXER)  += hevcdec.o rawdec.o
 OBJS-$(CONFIG_HEVC_MUXER)+= rawenc.o
 OBJS-$(CONFIG_HLS_DEMUXER)   += hls.o
-OBJS-$(CONFIG_HLS_MUXER) += hlsenc.o
+OBJS-$(CONFIG_HLS_MUXER) += hlsenc.o scte_35.o
 OBJS-$(CONFIG_HNM_DEMUXER)   += hnm.o
 OBJS-$(CONFIG_ICO_DEMUXER)   += icodec.o
 OBJS-$(CONFIG_ICO_MUXER) += icoenc.o
diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index c161937..a3224ef 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -38,6 +38,7 @@
 #include "avio_internal.h"
 #include "internal.h"
 #include "os_support.h"
+#include "scte_35.h"
 
 #define KEYSIZE 16
 #define LINE_BUFFER_SIZE 1024
@@ -48,6 +49,10 @@ typedef struct HLSSegment {
 double duration; /* in seconds */
 int64_t pos;
 int64_t size;
+struct scte_35_event *event;
+int out;
+int adv_count;
+int64_t start_pts;
 
 char key_uri[LINE_BUFFER_SIZE + 1];
 char iv_string[KEYSIZE*2 + 1];
@@ -92,6 +97,8 @@ typedef struct HLSContext {
 uint32_t flags;// enum HLSFlags
 uint32_t pl_type;  // enum PlaylistType
 char *segment_filename;
+char *adv_filename;
+char *adv_subfilename;
 
 int use_localtime;  ///< flag to expand filename with localtime
 int use_localtime_mkdir;///< flag to mkdir dirname in timebased filename
@@ -108,6 +115,8 @@ typedef struct HLSContext {
 int nb_entries;
 int discontinuity_set;
 
+int adv_count;
+struct scte_35_interface *scte_iface;
 HLSSegment *segments;
 HLSSegment *last_segment;
 HLSSegment *old_segments;
@@ -241,6 +250,8 @@ static int hls_delete_old_segments(HLSContext *hls) {
 av_freep();
 previous_segment = segment;
 segment = previous_segment->next;
+if (hls->scte_iface)
+hls->scte_iface->unref_scte35_event(_segment->event);
 av_free(previous_segment);
 }
 
@@ -360,8 +371,8 @@ static int hls_mux_init(AVFormatContext *s)
 }
 
 /* Create a new segment and append it to the segment list */
-static int hls_append_segment(struct AVFormatContext *s, HLSContext *hls, 
double duration,
-  int64_t pos, int64_t size)
+static int hls_append_segment(struct AVFormatContext *s, HLSContext *hls, 
double duration, int64_t pos,
+  int64_t start_pts, struct scte_35_event *event, 
int64_t size)
 {
 HLSSegment *en = av_malloc(sizeof(*en));
 char *tmp, *p;
@@ -397,9 +408,23 @@ static int hls_append_segment(struct AVFormatContext *s, 
HLSContext *hls, double
 
 en->duration = duration;
 en->pos  = pos;
+en->event= event;
 en->size = size;
+en->start_pts  = start_pts;
 en->next = NULL;
 
+if (hls->scte_iface) {
+if (hls->scte_iface->event_state == EVENT_OUT_CONT) {
+en->adv_count = hls->adv_count;;
+hls->adv_count++;
+en->out = hls->scte_iface->event_state;
+} else {
+hls->adv_count = 0;
+en->out = hls->scte_iface->event_state;
+}
+}
+
+
 if (hls->key_info_file) {
 av_strlcpy(en->key_uri, hls->key_uri, sizeof(en->key_uri));
 av_strlcpy(en->iv_string, hls->iv_string, sizeof(en->iv_string));
@@ -473,7 +498,7 @@ static int parse_playlist(AVFormatContext *s, const char 
*url)
 new_start_pos = avio_tell(hls->avf->pb);
 hls->size = new_start_pos - hls->start_pos;
 av_strlcpy(hls->avf->filename, line, sizeof(line));
-ret = hls_append_segment(s, hls, hls->duration, 
hls->start_pos, hls->size);
+ret = hls_append_segment(s, hls, hls->duration, 
hls->start_pos, 0, NULL, hls->size);
 if (ret < 0)
 goto fail;
 hls->start_pos = new_start_pos;
@@ -603,9 +628,27 @@ static int hls_window(AVFormatContext *s, int last)
 avio_printf(out, "#EXT-X-PROGRAM-DATE-TIME:%s.%03d%s\n", buf0, 
milli, buf1);
 prog_date_time += en->duration;
 }
-if (hls->baseurl)
-avio_printf(out, "%s", hls->baseurl);
-avio_printf(out, "%s\n", en->filename);
+if (hls->scte_iface && (en->event || en->out) ) {
+char 

[FFmpeg-devel] [PATCH 2/4] V12 - SCTE-35 extraction from mpegts

2016-10-01 Thread Carlos Fernandez Sanz
From: Carlos Fernandez 

Signed-off-by: Carlos Fernandez 
---
 libavformat/mpegts.c | 48 +++-
 1 file changed, 47 insertions(+), 1 deletion(-)

diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index b31d233..c13d6d8 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -725,6 +725,12 @@ static const StreamType HDMV_types[] = {
 { 0 },
 };
 
+/* SCTE types */
+static const StreamType SCTE_types[] = {
+{ 0x86, AVMEDIA_TYPE_DATA,  AV_CODEC_ID_SCTE_35},
+{ 0 },
+};
+
 /* ATSC ? */
 static const StreamType MISC_types[] = {
 { 0x81, AVMEDIA_TYPE_AUDIO, AV_CODEC_ID_AC3 },
@@ -872,6 +878,13 @@ static void reset_pes_packet_state(PESContext *pes)
 av_buffer_unref(>buffer);
 }
 
+static void new_data_packet(const uint8_t *buffer, int len, AVPacket *pkt)
+{
+av_init_packet(pkt);
+pkt->data = buffer;
+pkt->size = len;
+}
+
 static int new_pes_packet(PESContext *pes, AVPacket *pkt)
 {
 char *sd;
@@ -1590,6 +1603,28 @@ static void m4sl_cb(MpegTSFilter *filter, const uint8_t 
*section,
 av_free(mp4_descr[i].dec_config_descr);
 }
 
+static void scte_data_cb(MpegTSFilter *filter, const uint8_t *section,
+int section_len)
+{
+AVProgram *prg = NULL;
+MpegTSContext *ts = filter->u.section_filter.opaque;
+
+int idx = ff_find_stream_index(ts->stream, filter->pid);
+if (idx < 0)
+return;
+
+new_data_packet(section, section_len, ts->pkt);
+ts->pkt->stream_index = idx;
+prg = av_find_program_from_stream(ts->stream, NULL, idx);
+if (prg && prg->pcr_pid != -1 && prg->discard != AVDISCARD_ALL) {
+MpegTSFilter *f = ts->pids[prg->pcr_pid];
+if (f && f->last_pcr != -1)
+ts->pkt->pts = ts->pkt->dts = f->last_pcr/300;
+}
+ts->stop_parse = 1;
+
+}
+
 static const uint8_t opus_coupled_stream_cnt[9] = {
 1, 0, 1, 1, 2, 2, 2, 3, 3
 };
@@ -1868,6 +1903,12 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, 
AVStream *st, int stream_type
 return 0;
 }
 
+static int is_pes_stream(int stream_type, uint32_t prog_reg_desc)
+{
+return !(stream_type == 0x13 ||
+(stream_type == 0x86 && prog_reg_desc == AV_RL32("CUEI")) );
+}
+
 static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int 
section_len)
 {
 MpegTSContext *ts = filter->u.section_filter.opaque;
@@ -1975,7 +2016,8 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t 
*section, int section_len
 pes->st->id = pes->pid;
 }
 st = pes->st;
-} else if (stream_type != 0x13) {
+
+} else if (is_pes_stream(stream_type, prog_reg_desc)) {
 if (ts->pids[pid])
 mpegts_close_filter(ts, ts->pids[pid]); // wrongly added sdt 
filter probably
 pes = add_pes_stream(ts, pid, pcr_pid);
@@ -1995,6 +2037,10 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t 
*section, int section_len
 goto out;
 st->id = pid;
 st->codecpar->codec_type = AVMEDIA_TYPE_DATA;
+if (stream_type == 0x86 && prog_reg_desc == AV_RL32("CUEI")) {
+mpegts_find_stream_type(st, stream_type, SCTE_types);
+mpegts_open_section_filter(ts, pid, scte_data_cb, ts, 1);
+}
 }
 }
 
-- 
2.7.4

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


[FFmpeg-devel] [PATCH 1/4] V12 - Adding SCTE-35 CUI codec

2016-10-01 Thread Carlos Fernandez Sanz
From: Carlos Fernandez 

Signed-off-by: Carlos Fernandez 
---
 libavcodec/avcodec.h| 2 ++
 libavcodec/codec_desc.c | 6 ++
 2 files changed, 8 insertions(+)

diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index d72ee07..9064006 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -631,6 +631,8 @@ enum AVCodecID {
 AV_CODEC_ID_FIRST_UNKNOWN = 0x18000,   ///< A dummy ID pointing at 
the start of various fake codecs.
 AV_CODEC_ID_TTF = 0x18000,
 
+AV_CODEC_ID_SCTE_35,/**< Contain no valid time stamp in DTS PTS of 
avpacket, avpacket data contain time stamp
+  in scte-35 format which is relative to DTS/PTS 
of video stream */
 AV_CODEC_ID_BINTEXT= 0x18800,
 AV_CODEC_ID_XBIN,
 AV_CODEC_ID_IDF,
diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c
index 24948ca..2612215 100644
--- a/libavcodec/codec_desc.c
+++ b/libavcodec/codec_desc.c
@@ -2964,6 +2964,12 @@ static const AVCodecDescriptor codec_descriptors[] = {
 .long_name = NULL_IF_CONFIG_SMALL("binary data"),
 .mime_types= MT("application/octet-stream"),
 },
+{
+.id= AV_CODEC_ID_SCTE_35,
+.type  = AVMEDIA_TYPE_DATA,
+.name  = "scte_35",
+.long_name = NULL_IF_CONFIG_SMALL("SCTE 35 Message Queue"),
+},
 
 /* deprecated codec ids */
 };
-- 
2.7.4

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


Re: [FFmpeg-devel] [PATCH] avcodec: add missing xmm/neon clobber test wrappers for the new encode API

2016-10-01 Thread James Almer
On 10/1/2016 1:55 PM, Ronald S. Bultje wrote:
> Hi,
> 
> On Sat, Oct 1, 2016 at 12:25 PM, James Almer  wrote:
> 
>> Signed-off-by: James Almer 
>> ---
>>  configure |  4 
>>  libavcodec/aarch64/neontest.c | 10 ++
>>  libavcodec/arm/neontest.c | 10 ++
>>  libavcodec/x86/w64xmmtest.c   | 10 ++
>>  4 files changed, 34 insertions(+)
> 
> 
> lgtm.
> 
> Ronald

Pushed, thanks.

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


Re: [FFmpeg-devel] [PATCH] avcodec: add missing xmm/neon clobber test wrappers for the new encode API

2016-10-01 Thread Ronald S. Bultje
Hi,

On Sat, Oct 1, 2016 at 12:25 PM, James Almer  wrote:

> Signed-off-by: James Almer 
> ---
>  configure |  4 
>  libavcodec/aarch64/neontest.c | 10 ++
>  libavcodec/arm/neontest.c | 10 ++
>  libavcodec/x86/w64xmmtest.c   | 10 ++
>  4 files changed, 34 insertions(+)


lgtm.

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


Re: [FFmpeg-devel] [PATCH 2/4] V11 - SCTE-35 extraction from mpegts

2016-10-01 Thread Carlos Fernandez Sanz
On Tue, Sep 27, 2016 at 3:13 PM, Marton Balint  wrote:
>
> nothing useful in the header, it might make sense to create a data packet
> only from the buffer _after_ the section_length field, skipping the last
> CRC32 field as well.

I've been looking into this, but it would break some things (like
base64 encoding of complete scte-35 packet) . Plus we'd miss the
table_id which is not parsed in mpets.c.

Next version ready (will submit now) with other things that have been
mentioned here.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] avcodec: add missing xmm/neon clobber test wrappers for the new encode API

2016-10-01 Thread James Almer
Signed-off-by: James Almer 
---
 configure |  4 
 libavcodec/aarch64/neontest.c | 10 ++
 libavcodec/arm/neontest.c | 10 ++
 libavcodec/x86/w64xmmtest.c   | 10 ++
 4 files changed, 34 insertions(+)

diff --git a/configure b/configure
index 74db9b5..5216260 100755
--- a/configure
+++ b/configure
@@ -6079,6 +6079,8 @@ enabled neon_clobber_test &&
   -Wl,--wrap,avcodec_encode_video2  \
   -Wl,--wrap,avcodec_send_packet\
   -Wl,--wrap,avcodec_receive_frame  \
+  -Wl,--wrap,avcodec_send_frame \
+  -Wl,--wrap,avcodec_receive_packet \
   -Wl,--wrap,avcodec_encode_subtitle\
   -Wl,--wrap,swr_convert\
   -Wl,--wrap,avresample_convert ||
@@ -6094,6 +6096,8 @@ enabled xmm_clobber_test &&
   -Wl,--wrap,avcodec_encode_subtitle\
   -Wl,--wrap,avcodec_send_packet\
   -Wl,--wrap,avcodec_receive_frame  \
+  -Wl,--wrap,avcodec_send_frame \
+  -Wl,--wrap,avcodec_receive_packet \
   -Wl,--wrap,swr_convert\
   -Wl,--wrap,avresample_convert \
   -Wl,--wrap,sws_scale ||
diff --git a/libavcodec/aarch64/neontest.c b/libavcodec/aarch64/neontest.c
index 302a322..93f162d 100644
--- a/libavcodec/aarch64/neontest.c
+++ b/libavcodec/aarch64/neontest.c
@@ -87,3 +87,13 @@ wrap(avcodec_receive_frame(AVCodecContext *avctx, AVFrame 
*frame))
 {
 testneonclobbers(avcodec_receive_frame, avctx, frame);
 }
+
+wrap(avcodec_send_frame(AVCodecContext *avctx, const AVFrame *frame))
+{
+testneonclobbers(avcodec_send_frame, avctx, avpkt);
+}
+
+wrap(avcodec_receive_packet(AVCodecContext *avctx, AVPacket *avpkt))
+{
+testneonclobbers(avcodec_receive_packet, avctx, frame);
+}
diff --git a/libavcodec/arm/neontest.c b/libavcodec/arm/neontest.c
index 51d158b..b24120c 100644
--- a/libavcodec/arm/neontest.c
+++ b/libavcodec/arm/neontest.c
@@ -87,3 +87,13 @@ wrap(avcodec_receive_frame(AVCodecContext *avctx, AVFrame 
*frame))
 {
 testneonclobbers(avcodec_receive_frame, avctx, frame);
 }
+
+wrap(avcodec_send_frame(AVCodecContext *avctx, const AVFrame *frame))
+{
+testneonclobbers(avcodec_send_frame, avctx, avpkt);
+}
+
+wrap(avcodec_receive_packet(AVCodecContext *avctx, AVPacket *avpkt))
+{
+testneonclobbers(avcodec_receive_packet, avctx, frame);
+}
diff --git a/libavcodec/x86/w64xmmtest.c b/libavcodec/x86/w64xmmtest.c
index 3d466d2..d76a322 100644
--- a/libavcodec/x86/w64xmmtest.c
+++ b/libavcodec/x86/w64xmmtest.c
@@ -87,3 +87,13 @@ wrap(avcodec_receive_frame(AVCodecContext *avctx, AVFrame 
*frame))
 {
 testxmmclobbers(avcodec_receive_frame, avctx, frame);
 }
+
+wrap(avcodec_send_frame(AVCodecContext *avctx, const AVFrame *frame))
+{
+testxmmclobbers(avcodec_send_frame, avctx, avpkt);
+}
+
+wrap(avcodec_receive_packet(AVCodecContext *avctx, AVPacket *avpkt))
+{
+testxmmclobbers(avcodec_receive_packet, avctx, frame);
+}
-- 
2.9.1

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


Re: [FFmpeg-devel] lurking bugs in the mmx-related assembler code (?)

2016-10-01 Thread Henrik Gramner
On Sat, Oct 1, 2016 at 5:37 PM,   wrote:
> musl libc which uses floating point in its malloc() implementation.

That's honestly the real "WTF?" here.

On Sat, Oct 1, 2016 at 5:56 PM,   wrote:
> On Sat, Oct 01, 2016 at 05:44:13PM +0200, wm4 wrote:
>> AFAIK most MMX code in FFmpeg does not run emms (i.e. keeps the FPU
>> state trashed) until returning to the API user.
>
> This means when malloc()/free()/... happens to be called internally,
> it corrupts the malloc structures, in a non-straightforward ways.

In that case use emms_c() before calling those functions.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] lurking bugs in the mmx-related assembler code (?)

2016-10-01 Thread Ronald S. Bultje
Hi,

On Sat, Oct 1, 2016 at 11:56 AM,  wrote:

> On Sat, Oct 01, 2016 at 05:44:13PM +0200, wm4 wrote:
> > AFAIK most MMX code in FFmpeg does not run emms (i.e. keeps the FPU
> > state trashed) until returning to the API user.
>
> This means when malloc()/free()/... happens to be called internally,
> it corrupts the malloc structures, in a non-straightforward ways.


That's correct.

Why does your malloc implementation use floats?

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


[FFmpeg-devel] [PATCH 2/2] ffplay: remove unused viddec_width/viddec_height

2016-10-01 Thread Marton Balint
Signed-off-by: Marton Balint 
---
 ffplay.c | 9 -
 1 file changed, 9 deletions(-)

diff --git a/ffplay.c b/ffplay.c
index a7a6785..6d43191 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -230,9 +230,6 @@ typedef struct VideoState {
 Decoder viddec;
 Decoder subdec;
 
-int viddec_width;
-int viddec_height;
-
 int audio_stream;
 
 int av_sync_type;
@@ -1780,9 +1777,6 @@ static int get_video_frame(VideoState *is, AVFrame *frame)
 
 frame->sample_aspect_ratio = av_guess_sample_aspect_ratio(is->ic, 
is->video_st, frame);
 
-is->viddec_width  = frame->width;
-is->viddec_height = frame->height;
-
 if (framedrop>0 || (framedrop && get_master_sync_type(is) != 
AV_SYNC_VIDEO_MASTER)) {
 if (frame->pts != AV_NOPTS_VALUE) {
 double diff = dpts - get_master_clock(is);
@@ -2687,9 +2681,6 @@ static int stream_component_open(VideoState *is, int 
stream_index)
 is->video_stream = stream_index;
 is->video_st = ic->streams[stream_index];
 
-is->viddec_width  = avctx->width;
-is->viddec_height = avctx->height;
-
 decoder_init(>viddec, avctx, >videoq, 
is->continue_read_thread);
 if ((ret = decoder_start(>viddec, video_thread, is)) < 0)
 goto out;
-- 
2.6.6

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


[FFmpeg-devel] [PATCH 1/2] ffplay: use decoder avctx for decoded subtitle width/height

2016-10-01 Thread Marton Balint
Fixes ticket #5873.

Signed-off-by: Marton Balint 
---
 ffplay.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/ffplay.c b/ffplay.c
index e64909a..a7a6785 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -2224,7 +2224,6 @@ static int video_thread(void *arg)
 static int subtitle_thread(void *arg)
 {
 VideoState *is = arg;
-AVCodecParameters *codecpar = is->subtitle_st->codecpar;
 Frame *sp;
 int got_subtitle;
 double pts;
@@ -2243,8 +2242,8 @@ static int subtitle_thread(void *arg)
 pts = sp->sub.pts / (double)AV_TIME_BASE;
 sp->pts = pts;
 sp->serial = is->subdec.pkt_serial;
-sp->width = codecpar->width;
-sp->height = codecpar->height;
+sp->width = is->subdec.avctx->width;
+sp->height = is->subdec.avctx->height;
 sp->uploaded = 0;
 
 /* now we can update the picture count */
-- 
2.6.6

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


Re: [FFmpeg-devel] lurking bugs in the mmx-related assembler code (?)

2016-10-01 Thread Moritz Barsnick
On Sat, Oct 01, 2016 at 17:37:50 +0200, u-h...@aetey.se wrote:
> My troubleshooting 
[...]
> behaves erratically on certain combinations
[...]
> Most often

You are a busy troubleshooter, but you fail to describe what you did,
and what exactly went wrong. No-one will be able to (even try to)
reproduce if you don't provide details.

> P.S. an attempt to report via trac did not succeed, that's why posting
> to the list

What was the issue there?

When trac finally works, you are asked to provide a command line to
reproduce this (best something which doesn't use external libraries),
and its full console output. In your case, you should also describe how
you built ffmpeg, as you are using a "special" libc.

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


Re: [FFmpeg-devel] lurking bugs in the mmx-related assembler code (?)

2016-10-01 Thread u-h8zb
On Sat, Oct 01, 2016 at 05:44:13PM +0200, wm4 wrote:
> AFAIK most MMX code in FFmpeg does not run emms (i.e. keeps the FPU
> state trashed) until returning to the API user.

This means when malloc()/free()/... happens to be called internally,
it corrupts the malloc structures, in a non-straightforward ways.

Rune

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


Re: [FFmpeg-devel] lurking bugs in the mmx-related assembler code (?)

2016-10-01 Thread wm4
On Sat, 1 Oct 2016 17:37:50 +0200
u-h...@aetey.se wrote:

> Hello,
> 
> Would someone familiar with the mmx assembler parts of ffmpeg
> look over and check that the fp-state is restored as needed?
> 
> This is crucial with musl libc which uses floating point in its
> malloc() implementation.
> 
> My troubleshooting strongly suggests that it is the mmx code which is
> the culprit of ffmpeg misbehavior (the same issue has been recently
> fixed in libtheora).
> 
> Ffmpeg built against musl behaves erratically on certain combinations of
> inputs and outputs, which may also depend on other settings.
> Most often ffmpeg hangs forever quite early while beginning the conversion
> (at "frame=0 fps" or even before showing this) but sometimes it
> segfaults at that point or while being manually interrupted.
> 
> At least the internal theora decoder is affected but there may be other
> misbehaving decoders or encoders. I think I observed similar breakage with
> other file types than ogg/theora but did not document all the tested
> combinations.
> 
> Affected ffmpeg versions: tested 2.8.8, 3.0.2, 3.1.3, same behaviour,
> also when building with various gcc versions (4.x, 5.x, 6.x).
> 
> Disabling assembler in ffmpeg gets rid of the problem.
> 
> Given patches/fixes I will be glad to test them and report here.
> 
> Regards,
> Rune
> P.S. an attempt to report via trac did not succeed, that's why posting
> to the list

AFAIK most MMX code in FFmpeg does not run emms (i.e. keeps the FPU
state trashed) until returning to the API user.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 2/2] lavfi/metadata: allow deleting all metadata

2016-10-01 Thread Marton Balint

On Sat, 1 Oct 2016, Paul B Mahol wrote:

On 10/1/16, Marton Balint  wrote:

Signed-off-by: Marton Balint 
---
 doc/filters.texi | 5 +++--
 libavfilter/f_metadata.c | 6 --
 2 files changed, 7 insertions(+), 4 deletions(-)



lgtm


Pushed, thanks.

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


Re: [FFmpeg-devel] [PATCH 1/2] lavfi/metadata: fix setting metadata values

2016-10-01 Thread Marton Balint


On Sat, 1 Oct 2016, Paul B Mahol wrote:


On 10/1/16, Marton Balint  wrote:

Signed-off-by: Marton Balint 
---
 libavfilter/f_metadata.c | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)



lgtm


Pushed, thanks.

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


[FFmpeg-devel] lurking bugs in the mmx-related assembler code (?)

2016-10-01 Thread u-h8zb
Hello,

Would someone familiar with the mmx assembler parts of ffmpeg
look over and check that the fp-state is restored as needed?

This is crucial with musl libc which uses floating point in its
malloc() implementation.

My troubleshooting strongly suggests that it is the mmx code which is
the culprit of ffmpeg misbehavior (the same issue has been recently
fixed in libtheora).

Ffmpeg built against musl behaves erratically on certain combinations of
inputs and outputs, which may also depend on other settings.
Most often ffmpeg hangs forever quite early while beginning the conversion
(at "frame=0 fps" or even before showing this) but sometimes it
segfaults at that point or while being manually interrupted.

At least the internal theora decoder is affected but there may be other
misbehaving decoders or encoders. I think I observed similar breakage with
other file types than ogg/theora but did not document all the tested
combinations.

Affected ffmpeg versions: tested 2.8.8, 3.0.2, 3.1.3, same behaviour,
also when building with various gcc versions (4.x, 5.x, 6.x).

Disabling assembler in ffmpeg gets rid of the problem.

Given patches/fixes I will be glad to test them and report here.

Regards,
Rune
P.S. an attempt to report via trac did not succeed, that's why posting
to the list

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


Re: [FFmpeg-devel] [PATCH 2/3] ffmpeg: use new decode API

2016-10-01 Thread wm4
On Fri, 30 Sep 2016 21:48:03 +0200
Michael Niedermayer  wrote:

> On Thu, Sep 29, 2016 at 08:25:18PM +0200, wm4 wrote:
> > This is a bit messy, mainly due to timestamp handling.
> > 
> > decode_video() relied on the fact that it could set dts on a flush/drain
> > packet. This is not possible with the old API, and won't be. (I think
> > doing this was very questionable with the old API. Flush packets should
> > not contain any information; they just cause a FIFO to be emptied.) This
> > is replaced with checking the best_effort_timestamp for AV_NOPTS_VALUE,
> > and using the suggested DTS in the drain case.
> > 
> > The fate-cavs test still fails due to dropping the last frame. This
> > happens because the timestamp of the last frame goes backwards
> > (ffprobe -show_frames shows the same thing). I suspect that this
> > "worked" due to the best effort timestamp logic picking the DTS
> > over the decreasing PTS. Since this logic is in libavcodec (where
> > it probably shouldn't be), this can't be easily fixed. The timestamps
> > of the cavs samples are weird anyway, so I chose not to fix it.
> > 
> > Another strange thing is the timestamp handling in the video path of
> > process_input_packet (after the decode_video() call). It looks like
> > the code to increase next_dts and next_pts should be run every time
> > a frame is decoded - but it's needed even if output is skipped.
> > ---
> >  ffmpeg.c| 178 
> > +---
> >  ffmpeg.h|   3 +
> >  tests/ref/fate/cavs |   1 -
> >  3 files changed, 129 insertions(+), 53 deletions(-)  
> [...]
> 
> > @@ -2101,23 +2129,45 @@ static int decode_audio(InputStream *ist, AVPacket 
> > *pkt, int *got_output)
> >  return err < 0 ? err : ret;
> >  }
> >  
> > -static int decode_video(InputStream *ist, AVPacket *pkt, int *got_output)
> > +static int decode_video(InputStream *ist, AVPacket *pkt, int *got_output, 
> > int eof)
> >  {
> >  AVFrame *decoded_frame, *f;
> >  int i, ret = 0, err = 0, resample_changed;
> >  int64_t best_effort_timestamp;  
> 
> > +int64_t dts = AV_NOPTS_VALUE;  
> [...]
> > -pkt->dts  = av_rescale_q(ist->dts, AV_TIME_BASE_Q, ist->st->time_base);
> > +if (ist->dts != AV_NOPTS_VALUE)
> > +dts = av_rescale_q(ist->dts, AV_TIME_BASE_Q, ist->st->time_base);  
> 
> can be simplified with AV_ROUND_PASS_MINMAX if you like
> 
> [...]
> > diff --git a/ffmpeg.h b/ffmpeg.h
> > index 3ba62a1..1195055 100644
> > --- a/ffmpeg.h
> > +++ b/ffmpeg.h
> > @@ -348,6 +348,9 @@ typedef struct InputStream {
> >  // number of frames/samples retrieved from the decoder
> >  uint64_t frames_decoded;
> >  uint64_t samples_decoded;
> > +
> > +uint64_t *dts_buffer;  
> 
> it makes no difference with the current code but timestamps are signed

Pushed with the type for timestamps adjusted, and the new failing tests
modified as discussed on IRC. Didn't change the NOPTS check above, but
I'm not opposed to it, feel free to push a commit doing that if you
think it's much of an improvement.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] ffmpeg: remove unused and errorneous AVFrame timestamp check

2016-10-01 Thread Hendrik Leppkes
Decoders have previously not used AVFrame.pts, and with the upcoming
deprecation of pkt_pts (in favor of pts), this would lead to an errorneous
interpration of timestamps.
---
 ffmpeg.c | 7 +--
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/ffmpeg.c b/ffmpeg.c
index 9a8e65a..cdbf3d4 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -2058,12 +2058,7 @@ static int decode_audio(InputStream *ist, AVPacket *pkt, 
int *got_output)
 }
 }
 
-/* if the decoder provides a pts, use it instead of the last packet pts.
-   the decoder could be delaying output by a packet or more. */
-if (decoded_frame->pts != AV_NOPTS_VALUE) {
-ist->dts = ist->next_dts = ist->pts = ist->next_pts = 
av_rescale_q(decoded_frame->pts, avctx->time_base, AV_TIME_BASE_Q);
-decoded_frame_tb   = avctx->time_base;
-} else if (decoded_frame->pkt_pts != AV_NOPTS_VALUE) {
+if (decoded_frame->pkt_pts != AV_NOPTS_VALUE) {
 decoded_frame->pts = decoded_frame->pkt_pts;
 decoded_frame_tb   = ist->st->time_base;
 } else if (pkt->pts != AV_NOPTS_VALUE) {
-- 
2.10.0.windows.1

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


Re: [FFmpeg-devel] [PATCH 1/2] lavfi/metadata: fix setting metadata values

2016-10-01 Thread Paul B Mahol
On 10/1/16, Marton Balint  wrote:
> Signed-off-by: Marton Balint 
> ---
>  libavfilter/f_metadata.c | 16 
>  1 file changed, 8 insertions(+), 8 deletions(-)
>

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


Re: [FFmpeg-devel] [PATCH 2/2] lavfi/metadata: allow deleting all metadata

2016-10-01 Thread Paul B Mahol
On 10/1/16, Marton Balint  wrote:
> Signed-off-by: Marton Balint 
> ---
>  doc/filters.texi | 5 +++--
>  libavfilter/f_metadata.c | 6 --
>  2 files changed, 7 insertions(+), 4 deletions(-)
>

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


[FFmpeg-devel] [PATCH 2/2] lavfi/metadata: allow deleting all metadata

2016-10-01 Thread Marton Balint
Signed-off-by: Marton Balint 
---
 doc/filters.texi | 5 +++--
 libavfilter/f_metadata.c | 6 --
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/doc/filters.texi b/doc/filters.texi
index 9d51757..4b2f7bf 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -16059,7 +16059,8 @@ Modify value of already present key.
 
 @item delete
 If @code{value} is set, delete only keys that have such value.
-Otherwise, delete key.
+Otherwise, delete key. If @code{key} is not set, delete all metadata values in
+the frame.
 
 @item print
 Print key and its value if metadata was found. If @code{key} is not set print 
all
@@ -16067,7 +16068,7 @@ metadata values available in frame.
 @end table
 
 @item key
-Set key used with all modes. Must be set for all modes except @code{print}.
+Set key used with all modes. Must be set for all modes except @code{print} and 
@code{delete}.
 
 @item value
 Set metadata value which will be used. This option is mandatory for
diff --git a/libavfilter/f_metadata.c b/libavfilter/f_metadata.c
index 1fe713c..f4a929c 100644
--- a/libavfilter/f_metadata.c
+++ b/libavfilter/f_metadata.c
@@ -194,7 +194,7 @@ static av_cold int init(AVFilterContext *ctx)
 MetadataContext *s = ctx->priv;
 int ret;
 
-if (!s->key && s->mode != METADATA_PRINT) {
+if (!s->key && s->mode != METADATA_PRINT && s->mode != METADATA_DELETE) {
 av_log(ctx, AV_LOG_WARNING, "Metadata key must be set\n");
 return AVERROR(EINVAL);
 }
@@ -328,7 +328,9 @@ static int filter_frame(AVFilterLink *inlink, AVFrame 
*frame)
 return ff_filter_frame(outlink, frame);
 break;
 case METADATA_DELETE:
-if (e && e->value && s->value && s->compare(s, e->value, s->value)) {
+if (!s->key) {
+av_dict_free(metadata);
+} else if (e && e->value && s->value && s->compare(s, e->value, 
s->value)) {
 av_dict_set(metadata, s->key, NULL, 0);
 } else if (e && e->value) {
 av_dict_set(metadata, s->key, NULL, 0);
-- 
2.6.6

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


[FFmpeg-devel] [PATCH 1/2] lavfi/metadata: fix setting metadata values

2016-10-01 Thread Marton Balint
Signed-off-by: Marton Balint 
---
 libavfilter/f_metadata.c | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/libavfilter/f_metadata.c b/libavfilter/f_metadata.c
index 188f0b6..1fe713c 100644
--- a/libavfilter/f_metadata.c
+++ b/libavfilter/f_metadata.c
@@ -280,13 +280,13 @@ static int filter_frame(AVFilterLink *inlink, AVFrame 
*frame)
 AVFilterContext *ctx = inlink->dst;
 AVFilterLink *outlink = ctx->outputs[0];
 MetadataContext *s = ctx->priv;
-AVDictionary *metadata = av_frame_get_metadata(frame);
+AVDictionary **metadata = avpriv_frame_get_metadatap(frame);
 AVDictionaryEntry *e;
 
-if (!metadata)
+if (!*metadata)
 return ff_filter_frame(outlink, frame);
 
-e = av_dict_get(metadata, !s->key ? "" : s->key, NULL,
+e = av_dict_get(*metadata, !s->key ? "" : s->key, NULL,
 !s->key ? AV_DICT_IGNORE_SUFFIX: 0);
 
 switch (s->mode) {
@@ -302,13 +302,13 @@ static int filter_frame(AVFilterLink *inlink, AVFrame 
*frame)
 if (e && e->value) {
 ;
 } else {
-av_dict_set(, s->key, s->value, 0);
+av_dict_set(metadata, s->key, s->value, 0);
 }
 return ff_filter_frame(outlink, frame);
 break;
 case METADATA_MODIFY:
 if (e && e->value) {
-av_dict_set(, s->key, s->value, 0);
+av_dict_set(metadata, s->key, s->value, 0);
 }
 return ff_filter_frame(outlink, frame);
 break;
@@ -317,7 +317,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame 
*frame)
 s->print(ctx, "frame:%-4"PRId64" pts:%-7s pts_time:%-7s\n",
  inlink->frame_count, av_ts2str(frame->pts), 
av_ts2timestr(frame->pts, >time_base));
 s->print(ctx, "%s=%s\n", e->key, e->value);
-while ((e = av_dict_get(metadata, "", e, AV_DICT_IGNORE_SUFFIX)) 
!= NULL) {
+while ((e = av_dict_get(*metadata, "", e, AV_DICT_IGNORE_SUFFIX)) 
!= NULL) {
 s->print(ctx, "%s=%s\n", e->key, e->value);
 }
 } else if (e && e->value && (!s->value || (e->value && s->compare(s, 
e->value, s->value {
@@ -329,9 +329,9 @@ static int filter_frame(AVFilterLink *inlink, AVFrame 
*frame)
 break;
 case METADATA_DELETE:
 if (e && e->value && s->value && s->compare(s, e->value, s->value)) {
-av_dict_set(, s->key, NULL, 0);
+av_dict_set(metadata, s->key, NULL, 0);
 } else if (e && e->value) {
-av_dict_set(, s->key, NULL, 0);
+av_dict_set(metadata, s->key, NULL, 0);
 }
 return ff_filter_frame(outlink, frame);
 break;
-- 
2.6.6

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


[FFmpeg-devel] [PATCH] configure: define posix source on cygwin

2016-10-01 Thread Timo Rothenpieler
Some function definitions are missing without it,
for example sigaction.

Fixes ticket #5868
---
 configure | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configure b/configure
index 74db9b5..ff2cb62 100755
--- a/configure
+++ b/configure
@@ -4806,6 +4806,7 @@ case $target_os in
 objformat="win32"
 enable dos_paths
 enabled shared && ! enabled small && check_cmd $windres --version && 
enable gnu_windres
+add_cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
 ;;
 *-dos|freedos|opendos)
 network_extralibs="-lsocket"
-- 
2.8.3

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


Re: [FFmpeg-devel] [PATCH] doc/developer: improve Development Policy formatting

2016-10-01 Thread Josh de Kock

On 01/10/2016 10:23, Michael Niedermayer wrote:

[...]


-@item
-You do not have to over-test things. If it works for you, and you think it
-should work for others, then commit. If your code has problems
-(portability, triggers compiler bugs, unusual environment etc) they will be
-reported and eventually fixed.


This text disappears



Nice catch, I was going to rewrite this one, seems I missed it somehow. 
will update the patch.


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


Re: [FFmpeg-devel] [PATCH] lavc/mediacodecdec_h2645: fix nalu data_size type

2016-10-01 Thread Matthieu Bouron
On Fri, Sep 30, 2016 at 07:01:09PM +0200, wm4 wrote:
> On Fri, 30 Sep 2016 17:51:42 +0100
> Josh de Kock  wrote:
> 
> > On 30/09/2016 17:34, Matthieu Bouron wrote:
> > > From: Matthieu Bouron 
> > >
> > > ---
> > >  libavcodec/mediacodecdec_h2645.c | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/libavcodec/mediacodecdec_h2645.c 
> > > b/libavcodec/mediacodecdec_h2645.c
> > > index 122be88..9f8110c 100644
> > > --- a/libavcodec/mediacodecdec_h2645.c
> > > +++ b/libavcodec/mediacodecdec_h2645.c
> > > @@ -154,7 +154,7 @@ static int h264_set_extradata(AVCodecContext *avctx, 
> > > FFAMediaFormat *format)
> > >
> > >  if (pps && sps) {
> > >  uint8_t *data = NULL;
> > > -size_t data_size = 0;
> > > +int data_size = 0;
> > >
> > >  if ((ret = h2645_ps_to_nalu(sps->data, sps->data_size, , 
> > > _size)) < 0) {
> > >  goto done;
> > >  
> > 
> > Shouldn't you change h2645_ps_to_nalu()'s size arguments to size_t as well?
> 
> FFmpeg uses int instead of size_t in a LOT of places (including API).
> Might be a little bit too late to fix this convention.

Yes. On the other hand:
  * PPS.data_size type is size_t and PPS.data is uint8_t[4096].
  * ff_AMediaFormat_SetBuffer takes a size_t for the data_size argument.

IMHO, I don't think switching to size_t is a real improvement here but if
you think it is I can update the patch (otherwise I'll wait another day
and push it as is).

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


Re: [FFmpeg-devel] [PATCH] libavdevice/lavfi.c: adjust subcc_packet->pts to be in 90 timebase

2016-10-01 Thread Michael Niedermayer
On Fri, Sep 30, 2016 at 11:02:32PM -0400, Chris Landry wrote:
> From: Chris Landry 
> 
> When a video stream timebase is not 90k, the cc packet pts is relevant to the 
> timebase of the video stream, but later is assumed to be 90k. Adjust it here 
> to be 90k so timing is accurate in resulting subs.
> 
> Signed-off-by: Chris Landry 
> ---
>  libavdevice/lavfi.c | 11 ++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
> 
> diff --git a/libavdevice/lavfi.c b/libavdevice/lavfi.c
> index f9b2694..ffe5e0e 100644
> --- a/libavdevice/lavfi.c
> +++ b/libavdevice/lavfi.c
> @@ -58,6 +58,7 @@ typedef struct {
>  AVFrame *decoded_frame;
>  int nb_sinks;
>  AVPacket subcc_packet;
> +AVRational video_time_base;
>  } LavfiContext;
>  
>  static int *create_all_formats(int n)
> @@ -317,6 +318,8 @@ av_cold static int lavfi_read_header(AVFormatContext 
> *avctx)
>  st->codecpar->codec_type = link->type;
>  avpriv_set_pts_info(st, 64, link->time_base.num, 
> link->time_base.den);
>  if (link->type == AVMEDIA_TYPE_VIDEO) {
> +lavfi->video_time_base = link->time_base;
> +
>  st->codecpar->codec_id   = AV_CODEC_ID_RAWVIDEO;
>  st->codecpar->format = link->format;
>  st->codecpar->width  = link->w;
> @@ -373,8 +376,14 @@ static int create_subcc_packet(AVFormatContext *avctx, 
> AVFrame *frame,
>  if ((ret = av_new_packet(>subcc_packet, sd->size)) < 0)
>  return ret;
>  memcpy(lavfi->subcc_packet.data, sd->data, sd->size);
> +
> +AVRational time_base = lavfi->video_time_base;

likely triggers compiler warning


> +
> +double adjust_factor = time_base.den / (9.0 * time_base.num);

floating point is not needed and not ok due to binary non portability
theres av_rescale*

also this breaks make fate

do you have a testcase that this fixes ?

[...]
-- 
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] doc/developer: improve Development Policy formatting

2016-10-01 Thread Michael Niedermayer
On Sat, Oct 01, 2016 at 02:07:40AM +0100, Josh de Kock wrote:
> Signed-off-by: Josh de Kock 
> ---
>  doc/developer.texi | 163 
> -
>  1 file changed, 74 insertions(+), 89 deletions(-)
> 
> diff --git a/doc/developer.texi b/doc/developer.texi
> index 4d3a7ae..2df58a9 100644
> --- a/doc/developer.texi
> +++ b/doc/developer.texi
> @@ -246,8 +246,9 @@ For Emacs, add these roughly equivalent lines to your 
> @file{.emacs.d/init.el}:
>  
>  @section Development Policy
>  
> -@enumerate
> -@item
> +@subsection Patches
> +
> +@subheading Licenses for patches must be compatible with FFmpeg.
>  Contributions should be licensed under the
>  @uref{http://www.gnu.org/licenses/lgpl-2.1.html, LGPL 2.1},
>  including an "or any later version" clause, or, if you prefer
> @@ -260,15 +261,13 @@ preferred.
>  If you add a new file, give it a proper license header. Do not copy and
>  paste it from a random place, use an existing file as template.
>  
> -@item
> -You must not commit code which breaks FFmpeg! (Meaning unfinished but
> -enabled code which breaks compilation or compiles but does not work or
> -breaks the regression tests)
> -You can commit unfinished stuff (for testing etc), but it must be disabled
> -(#ifdef etc) by default so it does not interfere with other developers'
> -work.
> +@subheading You must not commit code which breaks FFmpeg!
> +This means unfinished code which is enabled and breaks compilation,
> +compiles but does not work or breaks the regression tests). Always
> +check the mailing list for any reviewers with issues and test FATE
> +before you push.
>  
> -@item
> +@subheading Keep the main commit message short with an extended description 
> below.
>  The commit message should have a short first line in the form of
>  a @samp{topic: short description} as a header, separated by a newline
>  from the body consisting of an explanation of why the change is necessary.
> @@ -276,53 +275,7 @@ If the commit fixes a known bug on the bug tracker, the 
> commit message
>  should include its bug ID. Referring to the issue on the bug tracker does
>  not exempt you from writing an excerpt of the bug in the commit message.
>  

> -@item
> -You do not have to over-test things. If it works for you, and you think it
> -should work for others, then commit. If your code has problems
> -(portability, triggers compiler bugs, unusual environment etc) they will be
> -reported and eventually fixed.

This text disappears

[]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

There will always be a question for which you do not know the correct answer.


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


Re: [FFmpeg-devel] [PATCH] doc/libav-merge: complete TODO section

2016-10-01 Thread Clément Bœsch
On Sun, Sep 25, 2016 at 07:35:56PM +0200, Clément Bœsch wrote:
> ---
> What else is missing?
> ---
>  doc/libav-merge.txt | 10 ++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/doc/libav-merge.txt b/doc/libav-merge.txt
> index 4fd863e..e200bdb 100644
> --- a/doc/libav-merge.txt
> +++ b/doc/libav-merge.txt
> @@ -84,4 +84,14 @@ whitespace differences) are passed into colordiff.
>  TODO/FIXME/UNMERGED
>  ===
>  
> +Stuff that didn't reach the codebase:
> +-
> +
>  - HEVC DSP and x86 MC SIMD improvements from Libav (see 
> http://comments.gmane.org/gmane.comp.video.ffmpeg.devel/204917)
> +
> +Collateral damage that needs work locally:
> +--
> +
> +- Merge proresdec2.c and proresdec_lgpl.c
> +- Merge proresenc_anatoliy.c and proresenc_kostya.c
> +- Remove ADVANCED_PARSER in libavcodec/hevc_parser.c

applied

-- 
Clément B.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel