Re: [FFmpeg-devel] [PATCH v20] avformat/dashdec: add dash demuxer base version

2017-09-01 Thread wm4
On Wed, 30 Aug 2017 20:52:40 +0800
Steven Liu  wrote:


> +media_val = xmlGetProp(fragmenturl_node, "media");
> +if (media_val) {
> +struct fragment *seg = av_mallocz(sizeof(struct fragment));
> +if (!seg) {
> +av_free(media_val);

Most likely you need to use the xmlFree function here (I don't remember
its exact name). Ideally, both functions would map to free(), but
that's not necessarily the case, which could cause problems. Also, on
Windows, both libs could be linked to different CRT libs, which would
also mean their malloc/free are incompatible.

Sorry if my comment on the last patches was misleading.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH v3] avformat/dash: move reused API to common file and header file

2017-09-01 Thread Jeyapal, Karthick
>Pushed.
>
>Thanks

FYI. FATE is failing after this push. It is due to the missing copyright header 
in dash.c

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


[FFmpeg-devel] [PATCH 1/1] avformat/hlsenc: Fix target duration computation when 'round_durations' is enabled

2017-09-01 Thread kjeyapal
From: Karthick J 

Signed-off-by: Karthick J 
---
 libavformat/hlsenc.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index 4a908863..dd36fde 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -1,6 +1,7 @@
 /*
  * Apple HTTP Live Streaming segmenter
  * Copyright (c) 2012, Luca Barbato
+ * Copyright (c) 2017 Akamai Technologies, Inc.
  *
  * This file is part of FFmpeg.
  *
@@ -1039,7 +1040,8 @@ static int hls_window(AVFormatContext *s, int last)
 
 for (en = hls->segments; en; en = en->next) {
 if (target_duration <= en->duration)
-target_duration = get_int_from_double(en->duration);
+target_duration = (hls->flags & HLS_ROUND_DURATIONS) ?
+lrint(en->duration) : get_int_from_double(en->duration);
 }
 
 hls->discontinuity_set = 0;
-- 
1.9.1

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


[FFmpeg-devel] [PATCH v23 1/2] avformat/dashdec: add dash demuxer base version

2017-09-01 Thread Steven Liu
ffmpeg need a dash demuxer for demux the dash formats base on
https://github.com/samsamsam-iptvplayer/exteplayer3/blob/master/tmp/ffmpeg/patches/3.2.2/01_add_dash_demux.patch

TODO:
1. support multi bitrate dash.

v2 fixed:
1. from autodetect to disabled
2. from camelCase code style to ffmpeg code style
3. from RepType to AVMediaType
4. fix variable typo
5. change time value from uint32_t to uint64_t
6. removed be used once API
7. change 'time(NULL)`, except it is not 2038-safe.' to av_gettime and av_timegm
8. merge complex free operation to free_fragment
9. use API from snprintf to av_asprintf

v3 fixed:
1. fix typo from --enabled-xml2 to --enable-xml2

v4 fixed:
1. from --enable-xml2 to --enable-libxml2
2. move system includes to top
3. remove nouse includes
4. rename enum name
5. add a trailing comma for the last entry enum
6. fix comment typo
7. add const to DASHContext class front
8. check sscanf if return arguments and give warning message when error
9. check validity before free seg->url and seg
10. check if the val is null, before use atoll

v5 fixed:
1. fix typo from mainifest to manifest

v6 fixed:
1. from realloc to av_realloc
2. from free to av_free

v7 fixed:
1. remove the -lxml2 from configure when require_pkg_config

v8 fixed:
1. fix replace filename template by av_asprintf secure problem

v9 modified:
1. make manifest parser clearly

v10 fixed:
1. fix function API name code style
2. remove redundant strreplace call
3. remove redundant memory operation and check return value from 
get_content_url()
4. add space between ) and {
5. remove no need to log the value for print

v11 fixed:
1. from atoll to strtoll
Suggested-by: Michael Niedermayer 

v12 fixed:
1. remove strreplace and instead by av_strreplace
Suggested-by: Nicolas George 

v13 fixed:
1. fix bug: cannot play:
http://dash.edgesuite.net/akamai/bbb_30fps/bbb_30fps.mpd
Reported-by: Andy Furniss 

v14 fixed:
1. fix bug: TLS connection was non-properly terminated
2. fix bug: No trailing CRLF found in HTTP header
Reported-by: Andy Furniss 

v15 fixed:
1. play youtube link: ffmpeg -i $(youtube-dl -J 
"https://www.youtube.com/watch?v=XmL19DOP_Ls"; | jq -r 
".requested_formats[0].manifest_url")
2. code refine for timeline living stream
Reported-by: Ricardo Constantino 

v16 fixed:
1. remove the snprintf and instead by get_segment_filename make safety
2. remove unnecessary loops
3. updated xmlStrcmp and xmlFree to av_* functions
4. merge code repeat into one function
5. add memory alloc faild check
6. update update_init_section and open_url
7. output safety error message when filename template not safe
Suggested-by : wm4 

v17 fixed:
1. add memory alloc faild check
2. fix resource space error at free_representation

v18 fixed:
1. add condition of template format

v19 fixed:
1. fix typo of the option describe

v20 fixed:
1. add the c->base_url alloc check
2. make the DASHTmplId same to dashenc

v21 fixed:
1. remove get_repl_pattern_and_format and get_segment_filename
2. process use dashcomm APIs

v22 fixed:
1. modify the include "dashcomm.h" to include "dash.h"
2. use internal API from dash_fill_tmpl_params to ff_dash_fill_tmpl_params

Signed-off-by: Steven Liu 
Signed-off-by: samsamsam 
---
 configure|4 +
 libavformat/Makefile |1 +
 libavformat/allformats.c |2 +-
 libavformat/dashdec.c| 1848 ++
 4 files changed, 1854 insertions(+), 1 deletion(-)
 create mode 100644 libavformat/dashdec.c

diff --git a/configure b/configure
index 4f1c172333..3f0d05a6f9 100755
--- a/configure
+++ b/configure
@@ -272,6 +272,7 @@ External library support:
   --enable-libxcb-shapeenable X11 grabbing shape rendering [autodetect]
   --enable-libxvid enable Xvid encoding via xvidcore,
native MPEG-4/Xvid encoder exists [no]
+  --enable-libxml2 enable XML parsing using the C library libxml2 [no]
   --enable-libzimg enable z.lib, needed for zscale filter [no]
   --enable-libzmq  enable message passing via libzmq [no]
   --enable-libzvbi enable teletext support via libzvbi [no]
@@ -1578,6 +1579,7 @@ EXTERNAL_LIBRARY_LIST="
 libvpx
 libwavpack
 libwebp
+libxml2
 libzimg
 libzmq
 libzvbi
@@ -2939,6 +2941,7 @@ avi_muxer_select="riffenc"
 caf_demuxer_select="iso_media riffdec"
 caf_muxer_select="iso_media"
 dash_muxer_select="mp4_muxer"
+dash_demuxer_deps="libxml2"
 dirac_demuxer_select="dirac_parser"
 dts_demuxer_select="dca_parser"
 dtshd_demuxer_select="dca_parser"
@@ -6006,6 +6009,7 @@ enabled openssl   && { use_pkg_config openssl 
openssl/ssl.h OPENSSL_init
check_lib openssl openssl/ssl.h 
SSL_library_init -lssl -lcrypto -lws2_32 -lgdi32 ||
die "ERROR: openssl not found"; }
 enabled qtkit_indev  && { check_header_objcc QTKit/QTKit.h || disable 
qtkit_indev; }
+enabled libxml2  && require_pkg_config libxml-2.0

Re: [FFmpeg-devel] [Patch] CUDA Thumbnail Filter

2017-09-01 Thread Timo Rothenpieler

Am 30.08.2017 um 06:19 schrieb Yogender Gupta:

Attached is a CUDA version of the thumbnail filter, this helps accelerate 
thumbnails generations significantly, when using the GPU pipeline.

Regards,
Yogender


After having a look at the code:

The filter is using a global "CUdeviceptr data;" variable(Which isn't 
even static).
This is generally not acceptable. It makes it impossible to use the 
filter more than once in parallel. All state should be in the filter 
context.


Also, the allocated Module and Device-Memory is never freed.
uninit should unload the module, free the memory, and do other 
potentially necessary cleanup.



Otherwise the code seems reasonable to me. Would still like to have 
someone else review it though.




smime.p7s
Description: S/MIME Cryptographic Signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


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

2017-09-01 Thread Steven Liu
modify from av_free to xmlFree

Signed-off-by: Steven Liu 
---
 libavformat/dashdec.c | 44 ++--
 1 file changed, 22 insertions(+), 22 deletions(-)

diff --git a/libavformat/dashdec.c b/libavformat/dashdec.c
index 9a3a199d4e..f63f1fffbd 100644
--- a/libavformat/dashdec.c
+++ b/libavformat/dashdec.c
@@ -440,7 +440,7 @@ static char *get_content_url(xmlNodePtr *baseurl_nodes,
 memset(tmp_str_2, 0, sizeof(tmp_str_2));
 ff_make_absolute_url(tmp_str_2, MAX_URL_SIZE, tmp_str, text);
 av_strlcpy(tmp_str, tmp_str_2, sizeof(tmp_str));
-av_free(text);
+xmlFree(text);
 }
 }
 }
@@ -515,7 +515,7 @@ static enum AVMediaType get_content_type(xmlNodePtr node)
 } else if (av_stristr((const char *)val, "audio")) {
 type = AVMEDIA_TYPE_AUDIO;
 }
-av_free(val);
+xmlFree(val);
 }
 }
 }
@@ -536,7 +536,7 @@ static int parse_manifest_segmenturlnode(AVFormatContext 
*s, struct representati
 if (initialization_val) {
 rep->init_section = av_mallocz(sizeof(struct fragment));
 if (!rep->init_section) {
-av_free(initialization_val);
+xmlFree(initialization_val);
 return AVERROR(ENOMEM);
 }
 rep->init_section->url = get_content_url(baseurl_nodes, 4,
@@ -545,18 +545,18 @@ static int parse_manifest_segmenturlnode(AVFormatContext 
*s, struct representati
  initialization_val);
 if (!rep->init_section->url) {
 av_free(rep->init_section);
-av_free(initialization_val);
+xmlFree(initialization_val);
 return AVERROR(ENOMEM);
 }
 rep->init_section->size = -1;
-av_free(initialization_val);
+xmlFree(initialization_val);
 }
 } else if (!av_strcasecmp(fragmenturl_node->name, (const char 
*)"SegmentURL")) {
 media_val = xmlGetProp(fragmenturl_node, "media");
 if (media_val) {
 struct fragment *seg = av_mallocz(sizeof(struct fragment));
 if (!seg) {
-av_free(media_val);
+xmlFree(media_val);
 return AVERROR(ENOMEM);
 }
 seg->url = get_content_url(baseurl_nodes, 4,
@@ -565,12 +565,12 @@ static int parse_manifest_segmenturlnode(AVFormatContext 
*s, struct representati
media_val);
 if (!seg->url) {
 av_free(seg);
-av_free(media_val);
+xmlFree(media_val);
 return AVERROR(ENOMEM);
 }
 seg->size = -1;
 dynarray_add(&rep->fragments, &rep->n_fragments, seg);
-av_free(media_val);
+xmlFree(media_val);
 }
 }
 
@@ -605,7 +605,7 @@ static int parse_manifest_segmenttimeline(AVFormatContext 
*s, struct representat
 tml->duration = (int64_t)strtoll(val, NULL, 10);
 }
 attr = attr->next;
-av_free(val);
+xmlFree(val);
 }
 dynarray_add(&rep->timelines, &rep->n_timelines, tml);
 }
@@ -699,29 +699,29 @@ static int parse_manifest_representation(AVFormatContext 
*s, const char *url,
 goto end;
 }
 rep->init_section->size = -1;
-av_free(initialization_val);
+xmlFree(initialization_val);
 }
 
 if (media_val) {
 rep->url_template = get_content_url(baseurl_nodes, 4, 
rep_id_val, rep_bandwidth_val, media_val);
-av_free(media_val);
+xmlFree(media_val);
 }
 
 if (presentation_timeoffset_val) {
 rep->presentation_timeoffset = (int64_t) 
strtoll(presentation_timeoffset_val, NULL, 10);
-av_free(presentation_timeoffset_val);
+xmlFree(presentation_timeoffset_val);
 }
 if (duration_val) {
 rep->fragment_duration = (int64_t) strtoll(duration_val, NULL, 
10);
-av_free(duration_val);
+xmlFree(duration_val);
 }
 if (timescale_val) {
 rep->fragment_timescale = (int64_t) strtoll(timescale_val, 
NULL, 10);
-av_free(timescale_val);
+xmlFree(timescale_val);
 }
 if (startnumber_val) {
 rep->first_seq_no = (int64_t) strtoll(startnumber_val, NULL, 
10);
-av_free(startnumber_val);
+xmlFree(startnumber_val);
 }
 
 fragment_timeline_node = 
find_child_node_by_name(representation_segmenttemplate_node, "SegmentTimeline");
@@ -760,11 +760

Re: [FFmpeg-devel] [PATCH 1/1] avformat/hlsenc: Fix target duration computation when 'round_durations' is enabled

2017-09-01 Thread Steven Liu
2017-09-01 18:15 GMT+08:00  :
> From: Karthick J 
>
> Signed-off-by: Karthick J 
> ---
>  libavformat/hlsenc.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
> index 4a908863..dd36fde 100644
> --- a/libavformat/hlsenc.c
> +++ b/libavformat/hlsenc.c
> @@ -1,6 +1,7 @@
>  /*
>   * Apple HTTP Live Streaming segmenter
>   * Copyright (c) 2012, Luca Barbato
> + * Copyright (c) 2017 Akamai Technologies, Inc.
>   *
>   * This file is part of FFmpeg.
>   *
> @@ -1039,7 +1040,8 @@ static int hls_window(AVFormatContext *s, int last)
>
>  for (en = hls->segments; en; en = en->next) {
>  if (target_duration <= en->duration)
> -target_duration = get_int_from_double(en->duration);
> +target_duration = (hls->flags & HLS_ROUND_DURATIONS) ?
> +lrint(en->duration) : get_int_from_double(en->duration);
>  }
>
>  hls->discontinuity_set = 0;
> --
> 1.9.1
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


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


Re: [FFmpeg-devel] [PATCH 1/1] avformat/hlsenc: Fix target duration computation when 'round_durations' is enabled

2017-09-01 Thread Steven Liu
2017-09-01 18:32 GMT+08:00 Steven Liu :
> 2017-09-01 18:15 GMT+08:00  :
>> From: Karthick J 
>>
>> Signed-off-by: Karthick J 
>> ---
>>  libavformat/hlsenc.c | 4 +++-
>>  1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
>> index 4a908863..dd36fde 100644
>> --- a/libavformat/hlsenc.c
>> +++ b/libavformat/hlsenc.c
>> @@ -1,6 +1,7 @@
>>  /*
>>   * Apple HTTP Live Streaming segmenter
>>   * Copyright (c) 2012, Luca Barbato
>> + * Copyright (c) 2017 Akamai Technologies, Inc.
>>   *
>>   * This file is part of FFmpeg.
>>   *
>> @@ -1039,7 +1040,8 @@ static int hls_window(AVFormatContext *s, int last)
>>
>>  for (en = hls->segments; en; en = en->next) {
>>  if (target_duration <= en->duration)
>> -target_duration = get_int_from_double(en->duration);
>> +target_duration = (hls->flags & HLS_ROUND_DURATIONS) ?
>> +lrint(en->duration) : get_int_from_double(en->duration);
>>  }
>>
>>  hls->discontinuity_set = 0;
>> --
>> 1.9.1
>>
>> ___
>> ffmpeg-devel mailing list
>> ffmpeg-devel@ffmpeg.org
>> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
>
> LGTM

Sorry, my mistake.

the target_duration must large or equal to the en->duration, can not
small than en->duration from HLS version 3.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 1/1] avformat/hlsenc: Fix target duration computation when 'round_durations' is enabled

2017-09-01 Thread Steven Liu
2017-09-01 18:40 GMT+08:00 Steven Liu :
> 2017-09-01 18:32 GMT+08:00 Steven Liu :
>> 2017-09-01 18:15 GMT+08:00  :
>>> From: Karthick J 
>>>
>>> Signed-off-by: Karthick J 
>>> ---
>>>  libavformat/hlsenc.c | 4 +++-
>>>  1 file changed, 3 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
>>> index 4a908863..dd36fde 100644
>>> --- a/libavformat/hlsenc.c
>>> +++ b/libavformat/hlsenc.c
>>> @@ -1,6 +1,7 @@
>>>  /*
>>>   * Apple HTTP Live Streaming segmenter
>>>   * Copyright (c) 2012, Luca Barbato
>>> + * Copyright (c) 2017 Akamai Technologies, Inc.
>>>   *
>>>   * This file is part of FFmpeg.
>>>   *
>>> @@ -1039,7 +1040,8 @@ static int hls_window(AVFormatContext *s, int last)
>>>
>>>  for (en = hls->segments; en; en = en->next) {
>>>  if (target_duration <= en->duration)
>>> -target_duration = get_int_from_double(en->duration);
>>> +target_duration = (hls->flags & HLS_ROUND_DURATIONS) ?
>>> +lrint(en->duration) : 
>>> get_int_from_double(en->duration);
>>>  }
>>>
>>>  hls->discontinuity_set = 0;
>>> --
>>> 1.9.1
>>>
>>> ___
>>> ffmpeg-devel mailing list
>>> ffmpeg-devel@ffmpeg.org
>>> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>>
>>
>> LGTM
>
> Sorry, my mistake.
>
> the target_duration must large or equal to the en->duration, can not
> small than en->duration from HLS version 3.

https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.3.1

4.3.3.1.  EXT-X-TARGETDURATION

   The EXT-X-TARGETDURATION tag specifies the maximum Media Segment
   duration.  The EXTINF duration of each Media Segment in the Playlist
   file, when rounded to the nearest integer, MUST be less than or equal
   to the target duration; longer segments can trigger playback stalls
   or other errors.  It applies to the entire Playlist file.  Its format
   is:

   #EXT-X-TARGETDURATION:

   where s is a decimal-integer indicating the target duration in
   seconds.  The EXT-X-TARGETDURATION tag is REQUIRED.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avcodec/mov: Allocate skipped_bytes_pos with av_realloc.

2017-09-01 Thread Michael Niedermayer
On Thu, Aug 31, 2017 at 02:07:43PM -0400, Mark Wachsler wrote:
> Memory reallocated with av_reallocp_array is supposed to be allocated
> with av_realloc, not av_malloc.

Our docs did briefly claim this but it was removed years ago in
21f70940ae106bfffa07e73057cdb4b5e81a767a

Also FFmpeg has been written with av_realloc*() and av_malloc*()
compatibility in mind both before and after 
21f70940ae106bfffa07e73057cdb4b5e81a767a
So its not 2 but many more that likely would need to be changed

If there is a incompatibility then
Its easier to fix the incompatibility between av_malloc* and av_realloc*
also it is much more maintainable if they are compatibile.
Code that works on 99.9 % of the developers systems but breaks on the
remaininng 0.1% is really hard to maintain design.

That said iam not against this patch and i can apply it (without tabs)
if people want but this is far from fixing all these issues

DId you try to replace posix_memalign() by aligned_alloc() where its
available?
ISO C requires aligned_alloc() to be compatibile with realloc()
where one can debate the situation of posix_memalign() and realloc()

For reference
7.22.3 Memory management functions
...
7.22.3.1 The aligned_alloc function

Thus aligned_alloc() is a "Memory management function" in ISO C

In the list of undefined behaviors there is:
- The pointer argument to the free or realloc function does not match a 
pointer
  earlier returned by a memory management function, or the space has been 
deallocated
  by a call to free or realloc (7.22.3.3, 7.22.3.5).

The undefined behavior is clearly limited to pointers not originating
from "Memory management functions", I can see no special case for
aligned_alloc()

In case your implemnatation of aligned_alloc() and realloc() are
incompatibile as well, please fix your implemnatation.

Thanks

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

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


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


Re: [FFmpeg-devel] [PATCH 1/1] avformat/hlsenc: Fix target duration computation when 'round_durations' is enabled

2017-09-01 Thread Jeyapal, Karthick
>2017-09-01 18:32 GMT+08:00 Steven Liu 
>mailto:lingjiujia...@gmail.com>>:
>Sorry, my mistake.
>
>the target_duration must large or equal to the en->duration, can not
>small than en->duration from HLS version 3.

When “round_durations” is enabled “en->duration” also gets rounded(lrint). So 
in the playlist, the target duration will never be lesser than any of the 
segment durations. It will still be in compliance to the HLS spec.
Otherwise we see an output where all segment durations are ‘n’ seconds, and the 
target duration is ‘n+1’ seconds when round_durations is enabled. This behavior 
causes some players to misbehave and add more latency unnecessarily.

Thanks,
Karthick

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


Re: [FFmpeg-devel] [PATCH v3] avformat/dash: move reused API to common file and header file

2017-09-01 Thread Steven Liu
2017-09-01 17:19 GMT+08:00 Jeyapal, Karthick :
>>Pushed.
>>
>>Thanks
>
> FYI. FATE is failing after this push. It is due to the missing copyright 
> header in dash.c
copyright has add now and pushed :)
>
> Thanks and Regards,
> Karthick
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 1/1] avformat/hlsenc: Fix target duration computation when 'round_durations' is enabled

2017-09-01 Thread Steven Liu
2017-09-01 18:54 GMT+08:00 Jeyapal, Karthick :
>>2017-09-01 18:32 GMT+08:00 Steven Liu 
>>mailto:lingjiujia...@gmail.com>>:
>>Sorry, my mistake.
>>
>>the target_duration must large or equal to the en->duration, can not
>>small than en->duration from HLS version 3.
>
> When “round_durations” is enabled “en->duration” also gets rounded(lrint). So 
> in the playlist, the target duration will never be lesser than any of the 
> segment durations. It will still be in compliance to the HLS spec.
> Otherwise we see an output where all segment durations are ‘n’ seconds, and 
> the target duration is ‘n+1’ seconds when round_durations is enabled. This 
> behavior causes some players to misbehave and add more latency unnecessarily.

The hls_time is set to the segments duration, not target duration, and
the hls_time just a reference value, so the target duration is +1.
anyway, this patch can not catch the point.

The spec clearly says it has to be greater or equal. So rounding it up
is perfectly legal and might even safeguard against some poor player
implementations.

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


Re: [FFmpeg-devel] [PATCH 1/1] avformat/hlsenc: Fix target duration computation when 'round_durations' is enabled

2017-09-01 Thread Jeyapal, Karthick

>The hls_time is set to the segments duration, not target duration, and
>the hls_time just a reference value, so the target duration is +1.
>anyway, this patch can not catch the point.

>The spec clearly says it has to be greater or equal. So rounding it up
>is perfectly legal and might even safeguard against some poor player
>implementations.

I think there is a misunderstanding here. Sorry if I was not clear. I mean to 
say, even with this patch EXT-X-TARGETDURATION will always be greater than or 
equal to the EXTINF duration of all the segments in the playlist. Hence it is 
compliant with the HLS spec.

Regards,
Karthick





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


[FFmpeg-devel] [PATCH 1/1] avformat/hlsenc: Added configuration to override HTTP User-Agent

2017-09-01 Thread Jeyapal, Karthick
Please find the patch attached.

Regards,
Karthick




0001-avformat-hlsenc-Added-configuration-to-override-HTTP.patch
Description: 0001-avformat-hlsenc-Added-configuration-to-override-HTTP.patch
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 1/1] avformat/hlsenc: Added configuration to override HTTP User-Agent

2017-09-01 Thread Steven Liu
2017-09-01 19:20 GMT+08:00 Jeyapal, Karthick :
> Please find the patch attached.
>
> Regards,
> Karthick
>
>
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>

FFmpeg has support it yet, you can use http method.

Input #0, hls,applehttp, from 'http://192.168.0.202/stream999_low.m3u8':
  Duration: 00:00:06.00, start: 49320.00, bitrate: 0 kb/s
  Program 0
Metadata:
  variant_bitrate : 0
Stream #0:0, 41, 1/9: Audio: aac (LC) ([15][0][0][0] /
0x000F), 48000 Hz, stereo, fltp
Metadata:
  variant_bitrate : 0
Stream #0:1, 21, 1/9: Video: h264 (Main), 1 reference frame
([27][0][0][0] / 0x001B), yuv420p(left), 320x240 [SAR 4:3 DAR 16:9],
0/1, 25 fps, 25 tbr, 90k tbn, 50 tbc
Metadata:
  variant_bitrate : 0
Successfully opened the file.
Parsing a group of options: output url a.ts.
Applying option c (codec name) with argument copy.
Applying option f (force format) with argument mpegts.
Successfully parsed a group of options.
Opening an output file: a.ts.
File 'a.ts' already exists. Overwrite ? [y/N] y
[file @ 0x7fe779d08420] Setting default whitelist 'file,crypto'
Successfully opened the file.
[mpegts @ 0x7fe77a81c600] muxrate VBR, pcr every 9000 pkts, sdt every
200, pat/pmt every 40 pkts
Output #0, mpegts, to 'a.ts':
  Metadata:
encoder : Lavf57.79.100
Stream #0:0, 0, 1/9: Video: h264 (Main), 1 reference frame
([27][0][0][0] / 0x001B), yuv420p(left), 320x240 (0x0) [SAR 4:3 DAR
16:9], 0/1, q=2-31, 25 fps, 25 tbr, 90k tbn, 90k tbc
Metadata:
  variant_bitrate : 0
Stream #0:1, 0, 1/9: Audio: aac (LC) ([15][0][0][0] / 0x000F),
48000 Hz, stereo, fltp
Metadata:
  variant_bitrate : 0
Stream mapping:
  Stream #0:1 -> #0:0 (copy)
  Stream #0:0 -> #0:1 (copy)
Press [q] to stop, [?] for help
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
Last message repeated 27 times
[AVIOContext @ 0x7fe779e002c0] Statistics: 109416 bytes read, 0 seeks
[hls,applehttp @ 0x7fe77a003200] HLS request for url
'http://192.168.0.202/stream999_low-20170810191439.ts', offset 0,
playlist 0
[hls,applehttp @ 0x7fe77a003200] Opening
'http://192.168.0.202/stream999_low-20170810191439.ts' for reading
[http @ 0x7fe779d07200] request: GET /stream999_low-20170810191439.ts HTTP/1.1
User-Agent: StevenLiu
Accept: */*
Connection: close
Host: 192.168.0.202
Icy-MetaData: 1


[AVIOContext @ 0x7fe779c154a0] Statistics: 104904 bytes read, 0 seeks
[hls,applehttp @ 0x7fe77a003200] HLS request for url
'http://192.168.0.202/stream999_low-20170810191440.ts', offset 0,
playlist 0
[hls,applehttp @ 0x7fe77a003200] Opening
'http://192.168.0.202/stream999_low-20170810191440.ts' for reading
[http @ 0x7fe779d07200] request: GET /stream999_low-20170810191440.ts HTTP/1.1
User-Agent: StevenLiu
Accept: */*
Connection: close
Host: 192.168.0.202
Icy-MetaData: 1


[AVIOContext @ 0x7fe779f09020] Statistics: 105468 bytes read, 0 seeks
No more output streams to write to, finishing.
frame=  142 fps=0.0 q=-1.0 Lsize= 294kB time=00:00:05.98 bitrate=
402.6kbits/s speed=65.7x
video:129kB audio:124kB subtitle:0kB other streams:0kB global
headers:0kB muxing overhead: 16.323072%
Input file #0 (http://192.168.0.202/stream999_low.m3u8):
  Input stream #0:0 (audio): 281 packets read (126505 bytes);
  Input stream #0:1 (video): 150 packets read (140250 bytes);
  Total: 431 packets (266755 bytes) demuxed
Output file #0 (a.ts):
  Output stream #0:0 (video): 142 packets muxed (132570 bytes);
  Output stream #0:1 (audio): 281 packets muxed (126505 bytes);
  Total: 423 packets (259075 bytes) muxed
0 frames successfully decoded, 0 decoding errors
[AVIOContext @ 0x7fe779f02680] Statistics: 0 seeks, 2 writeouts
[AVIOContext @ 0x7fe779f000a0] Statistics: 242 bytes read, 0 seeks
liuqideMBP:dash liuqi$ ./ffmpeg -v debug -user_agent "StevenLiu" -i
http://192.168.0.202/stream999_low.m3u8 -c copy -f mpegts a.ts
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avio: add a destructor for AVIOContext

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

On Fri, Sep 1, 2017 at 12:53 AM, James Almer  wrote:

> On 8/27/2017 1:31 PM, James Almer wrote:
> > From: Anton Khirnov 
> >
> > Before this commit, AVIOContext is to be freed with a plain av_free(),
> > which prevents us from adding any deeper structure to it.


The docs for avio_alloc_context() state:

441  * Allocate and initialize an AVIOContext for buffered I/O. It must be
later
442  * freed with av_free().

Should that be updated?

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


Re: [FFmpeg-devel] [PATCH] avio: add a destructor for AVIOContext

2017-09-01 Thread Hendrik Leppkes
On Fri, Sep 1, 2017 at 2:10 PM, Ronald S. Bultje  wrote:
> Hi,
>
> On Fri, Sep 1, 2017 at 12:53 AM, James Almer  wrote:
>
>> On 8/27/2017 1:31 PM, James Almer wrote:
>> > From: Anton Khirnov 
>> >
>> > Before this commit, AVIOContext is to be freed with a plain av_free(),
>> > which prevents us from adding any deeper structure to it.
>
>
> The docs for avio_alloc_context() state:
>
> 441  * Allocate and initialize an AVIOContext for buffered I/O. It must be
> later
> 442  * freed with av_free().
>
> Should that be updated?
>

It should. While av_free remains "OK" for now (deprecation period
etc), documentation should of course mention the appropriate function.

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


Re: [FFmpeg-devel] [PATCH] libavformat/dv : read dv audio as BE

2017-09-01 Thread Александр Слободенюк
> this breaks stream copy:
> ./ffmpeg -i ~/tickets/1042/submarine.dv -acodec copy -vcodec copy file.dv
> the sample file seems to be at
> http://www.mediafire.com/file/8agcdgs2f9kqlbi/submarine.dv

> [dv @ 0x2842d80] Can't initialize DV format!
> Make sure that you supply exactly two streams:
>  video: 25fps or 29.97fps, audio: 2ch/48|44|32kHz/PCM
>  (50Mbps allows an optional second audio stream)
> Could not write header for output file #0 (incorrect codec
> parameters ?): Operation not permitted

> [...]

Fixed

-- 
С уважением,
 Александр  mailto:alexander.sloboden...@bramtech.ru

0001-libavformat-dv-change-dv-audio-type-to-BE.patch
Description: Binary data
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] libavcodec/h264_parse: don't use uninitialized value when chroma_format_idc==0

2017-09-01 Thread Mark Wachsler
When parsing a monochrome file, chroma_log2_weight_denom was used without
being initialized, which could lead to a bogus error message being printed, e.g.
  [h264 @ 0x61a26480] chroma_log2_weight_denom 24576 is out of range
It also could result in warnings using AddressSanitizer.
---
 libavcodec/h264_parse.c | 19 ++-
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/libavcodec/h264_parse.c b/libavcodec/h264_parse.c
index 3d20075f6a..d9a3a0c154 100644
--- a/libavcodec/h264_parse.c
+++ b/libavcodec/h264_parse.c
@@ -34,21 +34,22 @@ int ff_h264_pred_weight_table(GetBitContext *gb, const SPS 
*sps,
 
 pwt->use_weight = 0;
 pwt->use_weight_chroma  = 0;
-pwt->luma_log2_weight_denom = get_ue_golomb(gb);
-if (sps->chroma_format_idc)
-pwt->chroma_log2_weight_denom = get_ue_golomb(gb);
 
+pwt->luma_log2_weight_denom = get_ue_golomb(gb);
 if (pwt->luma_log2_weight_denom > 7U) {
 av_log(logctx, AV_LOG_ERROR, "luma_log2_weight_denom %d is out of 
range\n", pwt->luma_log2_weight_denom);
 pwt->luma_log2_weight_denom = 0;
 }
-if (pwt->chroma_log2_weight_denom > 7U) {
-av_log(logctx, AV_LOG_ERROR, "chroma_log2_weight_denom %d is out of 
range\n", pwt->chroma_log2_weight_denom);
-pwt->chroma_log2_weight_denom = 0;
-}
+luma_def = 1 << pwt->luma_log2_weight_denom;
 
-luma_def   = 1 << pwt->luma_log2_weight_denom;
-chroma_def = 1 << pwt->chroma_log2_weight_denom;
+if (sps->chroma_format_idc) {
+pwt->chroma_log2_weight_denom = get_ue_golomb(gb);
+if (pwt->chroma_log2_weight_denom > 7U) {
+av_log(logctx, AV_LOG_ERROR, "chroma_log2_weight_denom %d is out 
of range\n", pwt->chroma_log2_weight_denom);
+pwt->chroma_log2_weight_denom = 0;
+}
+chroma_def = 1 << pwt->chroma_log2_weight_denom;
+}
 
 for (list = 0; list < 2; list++) {
 pwt->luma_weight_flag[list]   = 0;
-- 
2.14.1.581.gf28d330327-goog

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


Re: [FFmpeg-devel] [PATCH] libavcodec/h264_parse: don't use uninitialized value when chroma_format_idc==0

2017-09-01 Thread Mark Thompson
On 01/09/17 13:33, Mark Wachsler wrote:
> When parsing a monochrome file, chroma_log2_weight_denom was used without
> being initialized, which could lead to a bogus error message being printed, 
> e.g.
>   [h264 @ 0x61a26480] chroma_log2_weight_denom 24576 is out of range
> It also could result in warnings using AddressSanitizer.
> ---
>  libavcodec/h264_parse.c | 19 ++-
>  1 file changed, 10 insertions(+), 9 deletions(-)

Perhaps fix the following uninitialised reference further down the function as 
well, as in ?

I also prefer the erroring out on invalid values rather than picking a random 
value and decoding garbage, but that might be separate.

- Mark

> diff --git a/libavcodec/h264_parse.c b/libavcodec/h264_parse.c
> index 3d20075f6a..d9a3a0c154 100644
> --- a/libavcodec/h264_parse.c
> +++ b/libavcodec/h264_parse.c
> @@ -34,21 +34,22 @@ int ff_h264_pred_weight_table(GetBitContext *gb, const 
> SPS *sps,
>  
>  pwt->use_weight = 0;
>  pwt->use_weight_chroma  = 0;
> -pwt->luma_log2_weight_denom = get_ue_golomb(gb);
> -if (sps->chroma_format_idc)
> -pwt->chroma_log2_weight_denom = get_ue_golomb(gb);
>  
> +pwt->luma_log2_weight_denom = get_ue_golomb(gb);
>  if (pwt->luma_log2_weight_denom > 7U) {
>  av_log(logctx, AV_LOG_ERROR, "luma_log2_weight_denom %d is out of 
> range\n", pwt->luma_log2_weight_denom);
>  pwt->luma_log2_weight_denom = 0;
>  }
> -if (pwt->chroma_log2_weight_denom > 7U) {
> -av_log(logctx, AV_LOG_ERROR, "chroma_log2_weight_denom %d is out of 
> range\n", pwt->chroma_log2_weight_denom);
> -pwt->chroma_log2_weight_denom = 0;
> -}
> +luma_def = 1 << pwt->luma_log2_weight_denom;
>  
> -luma_def   = 1 << pwt->luma_log2_weight_denom;
> -chroma_def = 1 << pwt->chroma_log2_weight_denom;
> +if (sps->chroma_format_idc) {
> +pwt->chroma_log2_weight_denom = get_ue_golomb(gb);
> +if (pwt->chroma_log2_weight_denom > 7U) {
> +av_log(logctx, AV_LOG_ERROR, "chroma_log2_weight_denom %d is out 
> of range\n", pwt->chroma_log2_weight_denom);
> +pwt->chroma_log2_weight_denom = 0;
> +}
> +chroma_def = 1 << pwt->chroma_log2_weight_denom;
> +}
>  
>  for (list = 0; list < 2; list++) {
>  pwt->luma_weight_flag[list]   = 0;
> 
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] V4L2 M2M version 7

2017-09-01 Thread Jorge Ramirez-Ortiz
The previous patchset has been reduced to a single patch thus avoiding
the dependency with libavdevice.

I believe all the review comments raised during v6 have been addressed
- in particular delegating the closure of the device drivers until the
last AVBufRef has been freed.

Encoding and decoding tests pass as per the commit message.

thanks,

 Changelog |   1 
 configure |  30 
 libavcodec/Makefile   |  16 
 libavcodec/allcodecs.c|   9 
 libavcodec/v4l2_buffers.c | 916 
 libavcodec/v4l2_buffers.h | 236 
 libavcodec/v4l2_fmt.c | 147 
 libavcodec/v4l2_fmt.h |  34 
 libavcodec/v4l2_m2m.c | 452 
 libavcodec/v4l2_m2m.h |  70 
 libavcodec/v4l2_m2m_avcodec.h |  32 
 libavcodec/v4l2_m2m_dec.c | 213 
 libavcodec/v4l2_m2m_enc.c | 332 


This patch applies on top of commit:

commit adeb41afb80f0211af235f6d5b51df45a858170e
Author: Steven Liu 
Date:   Fri Sep 1 18:52:56 2017 +0800
avformat/dash:add copyright to dash.c


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


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

2017-09-01 Thread Jorge Ramirez-Ortiz
This patchset enhances Alexis Ballier's original patch and validates
it using Qualcomm's Venus hardware (driver recently landed upstream
[1]).

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

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

Tested encoders:
   - h264
   - h263
   - mpeg4

Tested transcoding (concurrent encoding/decoding)

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

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

Reviewed-by: Jorge Ramirez 
Reviewed-by: Alexis Ballier 
Tested-by: Jorge Ramirez 
---
 Changelog |   1 +
 configure |  30 +-
 libavcodec/Makefile   |  16 +
 libavcodec/allcodecs.c|   9 +
 libavcodec/v4l2_buffers.c | 916 ++
 libavcodec/v4l2_buffers.h | 236 +++
 libavcodec/v4l2_fmt.c | 147 +++
 libavcodec/v4l2_fmt.h |  34 ++
 libavcodec/v4l2_m2m.c | 452 +
 libavcodec/v4l2_m2m.h |  70 
 libavcodec/v4l2_m2m_avcodec.h |  32 ++
 libavcodec/v4l2_m2m_dec.c | 213 ++
 libavcodec/v4l2_m2m_enc.c | 332 +++
 13 files changed, 2487 insertions(+), 1 deletion(-)
 create mode 100644 libavcodec/v4l2_buffers.c
 create mode 100644 libavcodec/v4l2_buffers.h
 create mode 100644 libavcodec/v4l2_fmt.c
 create mode 100644 libavcodec/v4l2_fmt.h
 create mode 100644 libavcodec/v4l2_m2m.c
 create mode 100644 libavcodec/v4l2_m2m.h
 create mode 100644 libavcodec/v4l2_m2m_avcodec.h
 create mode 100644 libavcodec/v4l2_m2m_dec.c
 create mode 100644 libavcodec/v4l2_m2m_enc.c

diff --git a/Changelog b/Changelog
index 8309417..c6fcda3 100644
--- a/Changelog
+++ b/Changelog
@@ -40,6 +40,7 @@ version :
   They must always be used by name.
 - FITS demuxer and decoder
 - FITS muxer and encoder
+- V4L2 mem2mem HW accelerated codecs support
 
 version 3.3:
 - CrystalHD decoder moved to new decode API
diff --git a/configure b/configure
index 4f1c172..d9244e7 100755
--- a/configure
+++ b/configure
@@ -149,6 +149,7 @@ Component options:
   --disable-pixelutils disable pixel utils in libavutil
 
 Individual component options:
+  --disable-v4l2_m2m   disable V4L2 mem2mem code [autodetect]
   --disable-everything disable all components listed below
   --disable-encoder=NAME   disable encoder NAME
   --enable-encoder=NAMEenable encoder NAME
@@ -1433,6 +1434,7 @@ AVCODEC_COMPONENTS="
 
 AVDEVICE_COMPONENTS="
 indevs
+v4l2_m2m
 outdevs
 "
 AVFILTER_COMPONENTS="
@@ -2271,6 +2273,7 @@ map 'eval ${v}_inline_deps=inline_asm' $ARCH_EXT_LIST_ARM
 
 loongson2_deps="mips"
 loongson3_deps="mips"
+v4l2_deps_any="linux_videodev2_h"
 mipsfpu_deps="mips"
 mipsdsp_deps="mips"
 mipsdspr2_deps="mips"
@@ -2743,6 +2746,8 @@ nvenc_deps="cuda"
 nvenc_deps_any="dlopen LoadLibrary"
 nvenc_encoder_deps="nvenc"
 
+h263_v4l2m2m_decoder_deps="v4l2_m2m h263_v4l2_m2m"
+h263_v4l2m2m_encoder_deps="v4l2_m2m h263_v4l2_m2m"
 h264_crystalhd_decoder_select="crystalhd h264_mp4toannexb_bsf h264_parser"
 h264_cuvid_decoder_deps="cuda cuvid"
 h264_cuvid_decoder_select="h264_mp4toannexb_bsf"
@@ -2761,6 +2766,8 @@ h264_vda_decoder_deps="vda"
 h264_vda_decoder_select="h264_decoder"
 h264_vdpau_decoder_deps="vdpau"
 h264_vdpau_decoder_select="h264_decoder"
+h264_v4l2m2m_decoder_deps="v4l2_m2m h264_v4l2_m2m"
+h264_v4l2m2m_encoder_deps="v4l2_m2m h264_v4l2_m2m"
 hevc_cuvid_decoder_deps="cuda cuvid"
 hevc_cuvid_decoder_select="hevc_mp4toannexb_bsf"
 hevc_mediacodec_decoder_deps="mediacodec"
@@ -2772,12 +2779,15 @@ hevc_qsv_encoder_deps="libmfx"
 hevc_qsv_encoder_select="hevcparse qsvenc"
 hevc_vaapi_encoder_deps="VAEncPictureParameterBufferHEVC"
 hevc_vaapi_encoder_select="vaapi_encode golomb"
+hevc_v4l2m2m_decoder_deps="v4l2_m2m hevc_v4l2_m2m"
+hevc_v4l2m2m_encoder_deps="v4l2_m2m hevc_v4l2_m2m"
 mjpeg_cuvid_decoder_deps="cuda cuvid"
 mjpeg_vaapi_encoder_deps="VAEncPictureParameterBufferJPEG"
 mjpeg_vaapi_encoder_select="vaapi_encode jpegtables"
 mpeg1_cuvid_decoder_deps="

Re: [FFmpeg-devel] [PATCH] libavcodec/h264_parse: don't use uninitialized value when chroma_format_idc==0

2017-09-01 Thread Carl Eugen Hoyos



> Am 01.09.2017 um 15:56 schrieb Mark Thompson :


> I also prefer the erroring out on invalid values

That's what -strict strict is there for, by default libavcodec should try as 
hard as possible to decode.

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


Re: [FFmpeg-devel] [PATCH] avio: add a destructor for AVIOContext

2017-09-01 Thread James Almer
On 9/1/2017 9:25 AM, Hendrik Leppkes wrote:
> On Fri, Sep 1, 2017 at 2:10 PM, Ronald S. Bultje  wrote:
>> Hi,
>>
>> On Fri, Sep 1, 2017 at 12:53 AM, James Almer  wrote:
>>
>>> On 8/27/2017 1:31 PM, James Almer wrote:
 From: Anton Khirnov 

 Before this commit, AVIOContext is to be freed with a plain av_free(),
 which prevents us from adding any deeper structure to it.
>>
>>
>> The docs for avio_alloc_context() state:
>>
>> 441  * Allocate and initialize an AVIOContext for buffered I/O. It must be
>> later
>> 442  * freed with av_free().
>>
>> Should that be updated?
>>
> 
> It should. While av_free remains "OK" for now (deprecation period
> etc), documentation should of course mention the appropriate function.
> 
> - Hendrik

Updated. Thanks for noticing.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCHv4 2/2] avcodec/vp9: Add tile threading support

2017-09-01 Thread Michael Niedermayer
On Thu, Aug 31, 2017 at 05:30:44AM +0700, Ilia Valiakhmetov wrote:
{...]
> @@ -1481,6 +1661,68 @@ static int 
vp9_decode_update_thread_context(AVCodecContext *dst, const AVCodecCo
>  
>  return 0;
>  }
> +
> +void vp9_free_entries(VP9Context *s) {
> +pthread_mutex_destroy(&s->progress_mutex);
> +pthread_cond_destroy(&s->progress_cond);
> +av_freep(&s->entries);
> +}
> +
> +int vp9_alloc_entries(AVCodecContext *avctx, int n) {
> +VP9Context *s = avctx->priv_data;
> +int i;
> +
> +if (avctx->active_thread_type & FF_THREAD_SLICE)  {
> +if (s->entries)
> +av_freep(&s->entries);
> +
> +s->entries = av_malloc_array(n, sizeof(atomic_int));
> +
> +if (!s->entries) {
> +av_freep(&s->entries);
> +return AVERROR(ENOMEM);
> +}
> +
> +for (i  = 0; i < n; i++)
> +atomic_init(&s->entries[i], 0);
> +
> +pthread_mutex_init(&s->progress_mutex, NULL);
> +pthread_cond_init(&s->progress_cond, NULL);
> +}
> +return 0;
> +}
> +
> +void vp9_report_tile_progress(VP9Context *s, int field, int n) {
> +atomic_fetch_add_explicit(&s->entries[field], n, memory_order_relaxed);
> +pthread_cond_signal(&s->progress_cond);
> +}
> +
> +void vp9_await_tile_progress(VP9Context *s, int field, int n) {
> +if (atomic_load_explicit(&s->entries[field], memory_order_acquire) >= n)
> +return;
> +
> +pthread_mutex_lock(&s->progress_mutex);
> +while (atomic_load_explicit(&s->entries[field], memory_order_relaxed) != 
> n)
> +pthread_cond_wait(&s->progress_cond, &s->progress_mutex);
> +pthread_mutex_unlock(&s->progress_mutex);
> +}
> +#else
> +void vp9_free_entries(VP9Context *s) 
> +{
> +}
> +
> +int vp9_alloc_entries(AVCodecContext *avctx, int n) 
> +{
> +return 0;
> +}
> +
> +void vp9_report_tile_progress(VP9Context *s, int field, int n) 
> +{
> +}
> +
> +void vp9_await_tile_progress(VP9Context *s, int field, int n) 
> +{
> +}
>  #endif

non static functions need a ff_ or av* prefix

no more comments from me, review left to others

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

Into a blind darkness they enter who follow after the Ignorance,
they as if into a greater darkness enter who devote themselves
to the Knowledge alone. -- Isha Upanishad


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


[FFmpeg-devel] [PATCH] lavu: Add DRM hwcontext

2017-09-01 Thread LongChair .
From: Mark Thompson 

---
 configure  |   3 +
 libavutil/Makefile |   2 +
 libavutil/hwcontext.c  |   4 +
 libavutil/hwcontext.h  |   1 +
 libavutil/hwcontext_drm.c  | 294 +
 libavutil/hwcontext_drm.h  | 166 +++
 libavutil/hwcontext_internal.h |   1 +
 libavutil/pixdesc.c|   4 +
 libavutil/pixfmt.h |   6 +
 9 files changed, 481 insertions(+)
 create mode 100644 libavutil/hwcontext_drm.c
 create mode 100644 libavutil/hwcontext_drm.h

diff --git a/configure b/configure
index 61d8160..ebd561d 100755
--- a/configure
+++ b/configure
@@ -300,6 +300,7 @@ External library support:
   --disable-cuvid  disable Nvidia CUVID support [autodetect]
   --disable-d3d11vadisable Microsoft Direct3D 11 video acceleration 
code [autodetect]
   --disable-dxva2  disable Microsoft DirectX 9 video acceleration code 
[autodetect]
+  --enable-libdrm  enable DRM code (Linux) [no]
   --enable-libmfx  enable Intel MediaSDK (AKA Quick Sync Video) code 
via libmfx [no]
   --enable-libnpp  enable Nvidia Performance Primitives-based code [no]
   --enable-mmalenable Broadcom Multi-Media Abstraction Layer 
(Raspberry Pi) via MMAL [no]
@@ -1543,6 +1544,7 @@ EXTERNAL_LIBRARY_LIST="
 libcaca
 libcelt
 libdc1394
+libdrm
 libflite
 libfontconfig
 libfreetype
@@ -5848,6 +5850,7 @@ enabled libcelt   && require libcelt celt/celt.h 
celt_decode -lcelt0 &&
die "ERROR: libcelt must be installed and 
version must be >= 0.11.0."; }
 enabled libcaca   && require_pkg_config caca caca.h caca_create_canvas
 enabled libdc1394 && require_pkg_config libdc1394-2 dc1394/dc1394.h 
dc1394_new
+enabled libdrm&& require_pkg_config libdrm xf86drm.h drmGetVersion
 enabled libfdk_aac&& { use_pkg_config fdk-aac "fdk-aac/aacenc_lib.h" 
aacEncOpen ||
{ require libfdk_aac fdk-aac/aacenc_lib.h 
aacEncOpen -lfdk-aac &&
  warn "using libfdk without pkg-config"; } }
diff --git a/libavutil/Makefile b/libavutil/Makefile
index e45871f..65e285a 100644
--- a/libavutil/Makefile
+++ b/libavutil/Makefile
@@ -34,6 +34,7 @@ HEADERS = adler32.h   
  \
   hwcontext.h   \
   hwcontext_cuda.h  \
   hwcontext_d3d11va.h   \
+  hwcontext_drm.h   \
   hwcontext_dxva2.h \
   hwcontext_qsv.h   \
   hwcontext_vaapi.h \
@@ -161,6 +162,7 @@ OBJS-$(CONFIG_CUDA) += hwcontext_cuda.o
 OBJS-$(CONFIG_D3D11VA)  += hwcontext_d3d11va.o
 OBJS-$(CONFIG_DXVA2)+= hwcontext_dxva2.o
 OBJS-$(CONFIG_QSV)   += hwcontext_qsv.o
+OBJS-$(CONFIG_LIBDRM)   += hwcontext_drm.o
 OBJS-$(CONFIG_LZO)  += lzo.o
 OBJS-$(CONFIG_OPENCL)   += opencl.o opencl_internal.o
 OBJS-$(CONFIG_VAAPI)+= hwcontext_vaapi.o
diff --git a/libavutil/hwcontext.c b/libavutil/hwcontext.c
index 2a755a6..9e15f4f 100644
--- a/libavutil/hwcontext.c
+++ b/libavutil/hwcontext.c
@@ -38,6 +38,9 @@ static const HWContextType *const hw_table[] = {
 #if CONFIG_DXVA2
 &ff_hwcontext_type_dxva2,
 #endif
+#if CONFIG_LIBDRM
+&ff_hwcontext_type_drm,
+#endif
 #if CONFIG_QSV
 &ff_hwcontext_type_qsv,
 #endif
@@ -55,6 +58,7 @@ static const HWContextType *const hw_table[] = {
 
 static const char *const hw_type_names[] = {
 [AV_HWDEVICE_TYPE_CUDA]   = "cuda",
+[AV_HWDEVICE_TYPE_DRM]= "drm",
 [AV_HWDEVICE_TYPE_DXVA2]  = "dxva2",
 [AV_HWDEVICE_TYPE_D3D11VA] = "d3d11va",
 [AV_HWDEVICE_TYPE_QSV]= "qsv",
diff --git a/libavutil/hwcontext.h b/libavutil/hwcontext.h
index afb0d80..03334e2 100644
--- a/libavutil/hwcontext.h
+++ b/libavutil/hwcontext.h
@@ -33,6 +33,7 @@ enum AVHWDeviceType {
 AV_HWDEVICE_TYPE_VIDEOTOOLBOX,
 AV_HWDEVICE_TYPE_NONE,
 AV_HWDEVICE_TYPE_D3D11VA,
+AV_HWDEVICE_TYPE_DRM,
 };
 
 typedef struct AVHWDeviceInternal AVHWDeviceInternal;
diff --git a/libavutil/hwcontext_drm.c b/libavutil/hwcontext_drm.c
new file mode 100644
index 000..c6be329
--- /dev/null
+++ b/libavutil/hwcontext_drm.c
@@ -0,0 +1,294 @@
+/*
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *

[FFmpeg-devel] [PATCH] Add support for RockChip Media Process Platform This adds hardware decoding for h264 / HEVC / VP8 using MPP Rockchip API. Will return frames holding an AVDRMFrameDescriptor stru

2017-09-01 Thread LongChair .
From: LongChair 

---
 Changelog  |   1 +
 configure  |  13 +-
 libavcodec/Makefile|   3 +
 libavcodec/allcodecs.c |   6 +
 libavcodec/rkmppdec.c  | 537 +
 5 files changed, 559 insertions(+), 1 deletion(-)
 create mode 100644 libavcodec/rkmppdec.c

diff --git a/Changelog b/Changelog
index 1dfb8b5..c19c1d0 100644
--- a/Changelog
+++ b/Changelog
@@ -70,6 +70,7 @@ version 3.3:
 - Removed asyncts filter (use af_aresample instead)
 - Intel QSV-accelerated VP8 video decoding
 - VAAPI-accelerated deinterlacing
+- Addition of Rockchip MPP harware decoding
 
 
 version 3.2:
diff --git a/configure b/configure
index ebd561d..62fbcca 100755
--- a/configure
+++ b/configure
@@ -307,6 +307,7 @@ External library support:
   --disable-nvenc  disable Nvidia video encoding code [autodetect]
   --enable-omx enable OpenMAX IL code [no]
   --enable-omx-rpi enable OpenMAX IL code for Raspberry Pi [no]
+  --enable-rkmpp   enable Rockchip Media Process Platform code [no]
   --disable-vaapi  disable Video Acceleration API (mainly Unix/Intel) 
code [autodetect]
   --disable-vdadisable Apple Video Decode Acceleration code 
[autodetect]
   --disable-vdpau  disable Nvidia Video Decode and Presentation API 
for Unix code [autodetect]
@@ -1614,6 +1615,7 @@ HWACCEL_LIBRARY_LIST="
 libmfx
 mmal
 omx
+rkmpp
 "
 
 DOCUMENT_LIST="
@@ -2627,6 +2629,7 @@ h264_dxva2_hwaccel_select="h264_decoder"
 h264_mediacodec_hwaccel_deps="mediacodec"
 h264_mmal_hwaccel_deps="mmal"
 h264_qsv_hwaccel_deps="libmfx"
+h264_rkmpp_hwaccel_deps="rkmpp"
 h264_vaapi_hwaccel_deps="vaapi"
 h264_vaapi_hwaccel_select="h264_decoder"
 h264_vda_hwaccel_deps="vda"
@@ -2647,6 +2650,7 @@ hevc_d3d11va2_hwaccel_select="hevc_decoder"
 hevc_dxva2_hwaccel_deps="dxva2 DXVA_PicParams_HEVC"
 hevc_dxva2_hwaccel_select="hevc_decoder"
 hevc_qsv_hwaccel_deps="libmfx"
+hevc_rkmpp_hwaccel_deps="rkmpp"
 hevc_vaapi_hwaccel_deps="vaapi VAPictureParameterBufferHEVC"
 hevc_vaapi_hwaccel_select="hevc_decoder"
 hevc_vdpau_hwaccel_deps="vdpau VdpPictureInfoHEVC"
@@ -2714,6 +2718,7 @@ vp9_cuvid_hwaccel_deps="cuda cuvid"
 vp9_cuvid_hwaccel_select="vp9_cuvid_decoder"
 vp8_mediacodec_hwaccel_deps="mediacodec"
 vp8_qsv_hwaccel_deps="libmfx"
+vp8_rkmpp_hwaccel_deps="rkmpp"
 vp9_d3d11va_hwaccel_deps="d3d11va DXVA_PicParams_VP9"
 vp9_d3d11va_hwaccel_select="vp9_decoder"
 vp9_d3d11va2_hwaccel_deps="d3d11va DXVA_PicParams_VP9"
@@ -2757,6 +2762,8 @@ h264_qsv_decoder_deps="libmfx"
 h264_qsv_decoder_select="h264_mp4toannexb_bsf h264_parser qsvdec 
h264_qsv_hwaccel"
 h264_qsv_encoder_deps="libmfx"
 h264_qsv_encoder_select="qsvenc"
+h264_rkmpp_decoder_deps="rkmpp"
+h264_rkmpp_decoder_select="h264_mp4toannexb_bsf rkmpp h264_rkmpp_hwaccel"
 h264_vaapi_encoder_deps="VAEncPictureParameterBufferH264"
 h264_vaapi_encoder_select="vaapi_encode golomb"
 h264_vda_decoder_deps="vda"
@@ -2772,6 +2779,8 @@ hevc_qsv_decoder_deps="libmfx"
 hevc_qsv_decoder_select="hevc_mp4toannexb_bsf hevc_parser qsvdec 
hevc_qsv_hwaccel"
 hevc_qsv_encoder_deps="libmfx"
 hevc_qsv_encoder_select="hevcparse qsvenc"
+hevc_rkmpp_decoder_deps="rkmpp"
+hevc_rkmpp_decoder_select="hevc_mp4toannexb_bsf rkmpp hevc_rkmpp_hwaccel"
 hevc_vaapi_encoder_deps="VAEncPictureParameterBufferHEVC"
 hevc_vaapi_encoder_select="vaapi_encode golomb"
 mjpeg_cuvid_decoder_deps="cuda cuvid"
@@ -2811,6 +2820,8 @@ vp8_cuvid_decoder_deps="cuda cuvid"
 vp8_mediacodec_decoder_deps="mediacodec"
 vp8_qsv_decoder_deps="libmfx"
 vp8_qsv_decoder_select="qsvdec vp8_qsv_hwaccel vp8_parser"
+vp8_rkmpp_decoder_deps="rkmpp"
+vp8_rkmpp_decoder_select="rkmpp vp8_rkmpp_hwaccel"
 vp8_vaapi_encoder_deps="VAEncPictureParameterBufferVP8"
 vp8_vaapi_encoder_select="vaapi_encode"
 vp9_cuvid_decoder_deps="cuda cuvid"
@@ -6008,7 +6019,7 @@ enabled openssl   && { use_pkg_config openssl 
openssl/ssl.h OPENSSL_init
check_lib openssl openssl/ssl.h 
SSL_library_init -lssl -lcrypto -lws2_32 -lgdi32 ||
die "ERROR: openssl not found"; }
 enabled qtkit_indev  && { check_header_objcc QTKit/QTKit.h || disable 
qtkit_indev; }
-
+enabled rkmpp && { check_lib rkmpp rockchip/rk_mpi.h mpp_create 
"-lrockchip_mpp" || die "ERROR : Rockchip MPP was not found."; }
 if enabled gcrypt; then
 GCRYPT_CONFIG="${cross_prefix}libgcrypt-config"
 if "${GCRYPT_CONFIG}" --version > /dev/null 2>&1; then
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index 982d7f5..b75912f 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -336,6 +336,7 @@ OBJS-$(CONFIG_H264_VDA_DECODER)+= vda_h264_dec.o
 OBJS-$(CONFIG_H264_OMX_ENCODER)+= omx.o
 OBJS-$(CONFIG_H264_QSV_DECODER)+= qsvdec_h2645.o
 OBJS-$(CONFIG_H264_QSV_ENCODER)+= qsvenc_h264.o
+OBJS-$(CONFIG_H264_RKMPP_DECODER)  += rkmppdec.o
 OBJS-$(CONFIG_H264_VAAPI_ENCODER)  += vaapi_encode_

Re: [FFmpeg-devel] [Patch] CUDA Thumbnail Filter

2017-09-01 Thread Timo Rothenpieler

Also missing a dep on cuda_sdk in configure.



smime.p7s
Description: S/MIME Cryptographic Signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] fate/fits: add new test & gen few samples automatically

2017-09-01 Thread Paras Chadha
On Fri, Sep 1, 2017 at 5:26 AM, James Almer  wrote:

> On 8/27/2017 2:45 AM, Paras Chadha wrote:
> > Signed-off-by: Paras Chadha 
> > ---
> > All other FITS patches need to be applied before this one.
> >
> >  tests/fate/demux.mak|  3 +-
> >  tests/fate/fits.mak | 57
> ++---
> >  tests/ref/fate/fitsdec-bitpix-32|  6 
> >  tests/ref/fate/fitsdec-bitpix-64|  6 
> >  tests/ref/fate/fitsdec-blank_bitpix32   |  6 
> >  tests/ref/fate/fitsdec-ext_data_min_max |  6 
> >  6 files changed, 72 insertions(+), 12 deletions(-)
> >  create mode 100644 tests/ref/fate/fitsdec-bitpix-32
> >  create mode 100644 tests/ref/fate/fitsdec-bitpix-64
> >  create mode 100644 tests/ref/fate/fitsdec-blank_bitpix32
> >  create mode 100644 tests/ref/fate/fitsdec-ext_data_min_max
>
> Could you look at the current tests' failures first?
>

Yes, thanks for telling. I am looking into them.


>
> http://fate.ffmpeg.org/report.cgi?time=20170831190621&slot=x
> 86_32-msvc12-windows-native
> http://fate.ffmpeg.org/report.cgi?time=20170831131711&slot=x
> 86_64-msvc12-windows-native
> http://fate.ffmpeg.org/report.cgi?time=20170831182302&slot=x
> 86_32-mingw-w64-dll-windows-native
>
> The mingw x86_32 one seems to be related to the usage of floating point
> math in the decoder (x87 vs sse). No idea what's wrong with MSVC, but
> it's failing in both x86_64 and x86_32 there.
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>



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


[FFmpeg-devel] [PATCH] avdevice/decklink: new options 'list_pixelformats' and 'pixelformat_code' to allow pixelformat selection by code

2017-09-01 Thread Gildas Fargeas
I removed the option bm_v210 as it is replaced with a more complete pixel 
format selection option.
The main objective for this patch was to enable RGB capture.
The pixel format codes are directly copied from the Decklink API.

Signed-off-by: Gildas Fargeas 
---
 libavdevice/decklink_common.cpp | 34 --
 libavdevice/decklink_common.h   | 17 +
 libavdevice/decklink_common_c.h |  3 ++-
 libavdevice/decklink_dec.cpp| 53 ++---
 libavdevice/decklink_dec_c.c|  3 ++-
 5 files changed, 98 insertions(+), 12 deletions(-)

diff --git a/libavdevice/decklink_common.cpp b/libavdevice/decklink_common.cpp
index cbb591ce64..6c3d2cc2c1 100644
--- a/libavdevice/decklink_common.cpp
+++ b/libavdevice/decklink_common.cpp
@@ -203,6 +203,18 @@ int ff_decklink_set_format(AVFormatContext *avctx,
 if (cctx->format_code)
 memcpy(format_buf, cctx->format_code, FFMIN(strlen(cctx->format_code), 
sizeof(format_buf)));
 BMDDisplayMode target_mode = (BMDDisplayMode)AV_RB32(format_buf);
+
+char pixel_buf[] = "";
+ctx->bmd_pixel= bmdFormat8BitYUV;
+if (cctx->pixel_code) {
+if (!strcmp(cctx->pixel_code, "ARGB")) {
+ctx->bmd_pixel = bmdFormat8BitARGB;
+} else {
+memcpy(pixel_buf, cctx->pixel_code, 
FFMIN(strlen(cctx->pixel_code), sizeof(pixel_buf)));
+ctx->bmd_pixel = (BMDPixelFormat)AV_RB32(pixel_buf);
+}
+}
+
 AVRational target_tb = av_make_q(tb_num, tb_den);
 ctx->bmd_mode = bmdModeUnknown;
 while ((ctx->bmd_mode == bmdModeUnknown) && itermode->Next(&mode) == S_OK) 
{
@@ -241,12 +253,12 @@ int ff_decklink_set_format(AVFormatContext *avctx,
 if (ctx->bmd_mode == bmdModeUnknown)
 return -1;
 if (direction == DIRECTION_IN) {
-if (ctx->dli->DoesSupportVideoMode(ctx->bmd_mode, bmdFormat8BitYUV,
+if (ctx->dli->DoesSupportVideoMode(ctx->bmd_mode, ctx->bmd_pixel,
bmdVideoOutputFlagDefault,
&support, NULL) != S_OK)
 return -1;
 } else {
-if (ctx->dlo->DoesSupportVideoMode(ctx->bmd_mode, bmdFormat8BitYUV,
+if (ctx->dlo->DoesSupportVideoMode(ctx->bmd_mode, ctx->bmd_pixel,
bmdVideoOutputFlagDefault,
&support, NULL) != S_OK)
 return -1;
@@ -332,6 +344,24 @@ int ff_decklink_list_formats(AVFormatContext *avctx, 
decklink_direction_t direct
 return 0;
 }
 
+
+int ff_decklink_list_pixelformats(AVFormatContext *avctx)
+{
+   unsigned i = 0;
+
+
+av_log(avctx, AV_LOG_INFO, "List of pixel formats for 
'%s':\n\tformat_code",
+   avctx->filename);
+for (i=0; i < sizeof(decklink_pixelformat)/sizeof(char*);i++) {
+av_log(avctx, AV_LOG_INFO, "\n\t%.4s",
+decklink_pixelformat[i]);
+}
+av_log(avctx, AV_LOG_INFO, "\n");
+
+return 0;
+}
+
+
 void ff_decklink_cleanup(AVFormatContext *avctx)
 {
 struct decklink_cctx *cctx = (struct decklink_cctx *)avctx->priv_data;
diff --git a/libavdevice/decklink_common.h b/libavdevice/decklink_common.h
index 749eb0f8b8..964781ff72 100644
--- a/libavdevice/decklink_common.h
+++ b/libavdevice/decklink_common.h
@@ -56,6 +56,7 @@ struct decklink_ctx {
 BMDTimeValue bmd_tb_den;
 BMDTimeValue bmd_tb_num;
 BMDDisplayMode bmd_mode;
+BMDPixelFormat bmd_pixel;
 BMDVideoConnection video_input;
 BMDAudioConnection audio_input;
 int bmd_width;
@@ -82,6 +83,7 @@ struct decklink_ctx {
 /* Options */
 int list_devices;
 int list_formats;
+int list_pixelformats;
 int64_t teletext_lines;
 double preroll;
 int duplex_mode;
@@ -132,11 +134,26 @@ static const BMDVideoConnection 
decklink_video_connection_map[] = {
 bmdVideoConnectionSVideo,
 };
 
+static const char * const decklink_pixelformat[] = {
+   "2vuy", /* bmdFormat8BitYUV */
+   "v210", /* bmdFormat10BitYUV*/
+   "ARGB", /* bmdFormat8BitARGB*/
+   "BGRA", /* bmdFormat8BitBGRA*/
+   "r210", /* bmdFormat10BitRGB*/
+   "R12B", /* bmdFormat12BitRGB*/
+   "R12L", /* bmdFormat12BitRGBLE  */
+   "R10l", /* bmdFormat10BitRGBXLE */
+   "R10b", /* bmdFormat10BitRGBX   */
+   "hev1", /* bmdFormatH265*/
+   "AVdh"  /* bmdFormatDNxHR   */
+};
+
 HRESULT ff_decklink_get_display_name(IDeckLink *This, const char 
**displayName);
 int ff_decklink_set_format(AVFormatContext *avctx, int width, int height, int 
tb_num, int tb_den, enum AVFieldOrder field_order, decklink_direction_t 
direction = DIRECTION_OUT, int num = 0);
 int ff_decklink_set_format(AVFormatContext *avctx, decklink_direction_t 
direction, int num);
 int ff_decklink_list_devices(AVFormatContext *avctx);
 int ff_decklink_list_formats(AVFormatContext *avctx, decklink_direction_

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

2017-09-01 Thread wm4
On Fri, 1 Sep 2017 15:44:53 +
"LongChair ."  wrote:

> From: Mark Thompson 
> 
> ---
>  configure  |   3 +
>  libavutil/Makefile |   2 +
>  libavutil/hwcontext.c  |   4 +
>  libavutil/hwcontext.h  |   1 +
>  libavutil/hwcontext_drm.c  | 294 
> +
>  libavutil/hwcontext_drm.h  | 166 +++
>  libavutil/hwcontext_internal.h |   1 +
>  libavutil/pixdesc.c|   4 +
>  libavutil/pixfmt.h |   6 +
>  9 files changed, 481 insertions(+)
>  create mode 100644 libavutil/hwcontext_drm.c
>  create mode 100644 libavutil/hwcontext_drm.h
> 

I'd agree with that.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avfilter: remove duplicate and disabled trace log function

2017-09-01 Thread James Almer
On 8/30/2017 1:41 AM, James Almer wrote:
> It's already defined and actually enabled depending on configure options
> elsewhere.
> ---
>  libavfilter/internal.h | 9 +
>  1 file changed, 1 insertion(+), 8 deletions(-)
> 
> diff --git a/libavfilter/internal.h b/libavfilter/internal.h
> index 2ff75aa778..f9679ed1d7 100644
> --- a/libavfilter/internal.h
> +++ b/libavfilter/internal.h
> @@ -33,6 +33,7 @@
>  #include "version.h"
>  #include "video.h"
>  #include "libavcodec/avcodec.h"
> +#include "libavcodec/internal.h"
>  
>  typedef struct AVFilterCommand {
>  double time;///< time expressed in seconds
> @@ -246,14 +247,6 @@ void ff_command_queue_pop(AVFilterContext *filter);
>  
>  /* misc trace functions */
>  
> -/* #define FF_AVFILTER_TRACE */
> -
> -#ifdef FF_AVFILTER_TRACE
> -#define ff_tlog(pctx, ...) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__)
> -#else
> -#define ff_tlog(pctx, ...) do { if (0) av_log(pctx, AV_LOG_DEBUG, 
> __VA_ARGS__); } while (0)
> -#endif
> -
>  #define FF_TPRINTF_START(ctx, func) ff_tlog(NULL, "%-16s: ", #func)
>  
>  char *ff_get_ref_perms_string(char *buf, size_t buf_size, int perms);
> 

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


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

2017-09-01 Thread Jorge Ramirez

On 09/01/2017 05:44 PM, LongChair . wrote:

+static int drm_map_frame(AVHWFramesContext *hwfc,
+ AVFrame *dst, const AVFrame *src, int flags)
+{
+const AVDRMFrameDescriptor*desc = (AVDRMFrameDescriptor*)src->data[0];
+DRMMapping *map;
+int err, i, p, plane;
+int mmap_prot;
+void *addr;
+
+map = av_mallocz(sizeof(*map));
+if (!map)
+return AVERROR(ENOMEM);
+
+mmap_prot = 0;
+if (flags & AV_HWFRAME_MAP_READ)
+mmap_prot |= PROT_READ;
+if (flags & AV_HWFRAME_MAP_WRITE)
+mmap_prot |= PROT_WRITE;
+
+av_assert0(desc->nb_objects <= AV_DRM_MAX_PLANES);
+for (i = 0; i < desc->nb_objects; i++) {
+addr = mmap(NULL, desc->objects[i].size, mmap_prot, MAP_SHARED,
+desc->objects[i].fd, 0);
+if (addr == MAP_FAILED) {
+err = AVERROR(errno);
+av_log(hwfc, AV_LOG_ERROR, "Failed to map DRM object %d to "
+   "memory: %d.\n", desc->objects[i].fd, errno);
+goto fail;
+}
+
+map->address[i] = addr;
+map->length[i]  = desc->objects[i].size;
+}
+map->nb_regions = i;
+
+plane = 0;
+for (i = 0; i < desc->nb_layers; i++) {
+const AVDRMLayerDescriptor *layer = &desc->layers[i];
+for (p = 0; p < layer->nb_planes; p++) {
+dst->data[plane] =
+(uint8_t*)map->address[layer->planes[p].object_index] +
+   layer->planes[p].offset;
+dst->linesize[plane] = layer->planes[p].pitch;
+++plane;
+}
+}
+av_assert0(plane <= AV_DRM_MAX_PLANES);
+
+dst->width  = src->width;
+dst->height = src->height;
+
+err = ff_hwframe_map_create(src->hw_frames_ctx, dst, src,
+&drm_unmap_frame, map);
+if (err < 0)

shouldn't we unmap and free the map as well?

+return err;
+
+return 0;
+
+fail:
+for (i = 0; i < desc->nb_objects; i++) {
+if (map->address[i])
+munmap(map->address[i], map->length[i]);
+}
+av_free(map);
+return err;
+}


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


[FFmpeg-devel] [PATCH 1/3] avcodec/diracdec: Fix integer overflow in INTRA_DC_PRED()

2017-09-01 Thread Michael Niedermayer
Fixes: runtime error: signed integer overflow: 1168175789 + 1168178473 cannot 
be represented in type 'int'
Fixes: 3081/clusterfuzz-testcase-minimized-4807564879462400
Fixes: 2844/clusterfuzz-testcase-minimized-5561715838156800

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer 
---
 libavcodec/diracdec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/diracdec.c b/libavcodec/diracdec.c
index 0aee08f9e1..f2aed6057d 100644
--- a/libavcodec/diracdec.c
+++ b/libavcodec/diracdec.c
@@ -586,7 +586,7 @@ static inline void codeblock(DiracContext *s, SubBand *b,
 } \
 
 INTRA_DC_PRED(8, int16_t)
-INTRA_DC_PRED(10, int32_t)
+INTRA_DC_PRED(10, uint32_t)
 
 /**
  * Dirac Specification ->
-- 
2.14.1

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


[FFmpeg-devel] [PATCH 2/3] avcodec/dirac_dwt: Fix multiple overflows in 9/7 lifting

2017-09-01 Thread Michael Niedermayer
Fixes: runtime error: signed integer overflow: 1073901567 + 1073901567 cannot 
be represented in type 'int'
Fixes: 3124/clusterfuzz-testcase-minimized-454643435752652

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer 
---
 libavcodec/dirac_dwt.h | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libavcodec/dirac_dwt.h b/libavcodec/dirac_dwt.h
index e715e53bc4..adf5178714 100644
--- a/libavcodec/dirac_dwt.h
+++ b/libavcodec/dirac_dwt.h
@@ -117,16 +117,16 @@ void ff_spatial_idwt_slice2(DWTContext *d, int y);
 (b4 + ((-2*(b0+b8) + 10*(b1+b7) - 25*(b2+b6) + 81*(b3+b5) + 128) >> 8))
 
 #define COMPOSE_DAUB97iL1(b0, b1, b2)\
-(b1 - ((int)(1817U*(b0 + b2) + 2048) >> 12))
+(b1 - ((int)(1817*(b0 + (unsigned)b2) + 2048) >> 12))
 
 #define COMPOSE_DAUB97iH1(b0, b1, b2)\
-(b1 - ((int)( 113U*(b0 + b2) + 64) >> 7))
+(b1 - ((int)( 113*(b0 + (unsigned)b2) + 64) >> 7))
 
 #define COMPOSE_DAUB97iL0(b0, b1, b2)\
-(b1 + ((int)( 217U*(b0 + b2) + 2048) >> 12))
+(b1 + ((int)( 217*(b0 + (unsigned)b2) + 2048) >> 12))
 
 #define COMPOSE_DAUB97iH0(b0, b1, b2)\
-(b1 + ((int)(6497U*(b0 + b2) + 2048) >> 12))
+(b1 + ((int)(6497*(b0 + (unsigned)b2) + 2048) >> 12))
 
 
 #endif /* AVCODEC_DWT_H */
-- 
2.14.1

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


[FFmpeg-devel] [PATCH 3/3] avcodec/dirac_vlc: Fix invalid shift in ff_dirac_golomb_read_32bit()

2017-09-01 Thread Michael Niedermayer
Fixes: runtime error: shift exponent 64 is too large for 64-bit type 'residual' 
(aka 'unsigned long')
Fixes: 2838/clusterfuzz-testcase-minimized-6260066086813696

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer 
---
 libavcodec/dirac_vlc.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavcodec/dirac_vlc.c b/libavcodec/dirac_vlc.c
index d3b9900beb..bd37f31f46 100644
--- a/libavcodec/dirac_vlc.c
+++ b/libavcodec/dirac_vlc.c
@@ -56,6 +56,9 @@ int ff_dirac_golomb_read_32bit(DiracGolombLUT *lut_ctx, const 
uint8_t *buf,
 if ((c_idx + 1) > coeffs)
 return c_idx;
 
+if (res_bits >= RSIZE_BITS)
+res_bits = res = 0;
+
 /* res_bits is a hint for better branch prediction */
 if (res_bits && l->sign) {
 int32_t coeff = 1;
-- 
2.14.1

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


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

2017-09-01 Thread Jorge Ramirez

On 09/01/2017 05:44 PM, LongChair . wrote:

+
+static void drm_unmap_frame(AVHWFramesContext *hwfc,
+HWMapDescriptor *hwmap)
+{
+DRMMapping *map = hwmap->priv;
+int i;
+
+for (i = 0; i < map->nb_regions; i++) {
+if (map->address[i])
+munmap(map->address[i], map->length[i]);


do we need to check the return value of the call?
also if map->address[i] == NULL,  is that not a warning of something 
that went wrong?



+}
+
+av_free(map);
+}


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


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

2017-09-01 Thread Jorge Ramirez

On 09/01/2017 05:44 PM, LongChair . wrote:

+}
+
+static int drm_device_create(AVHWDeviceContext *hwdev, const char *device,
+ AVDictionary *opts, int flags)
+{
+AVDRMDeviceContext *hwctx = hwdev->hwctx;
+drmVersionPtr version;
+
+hwctx->fd = open(device, O_RDWR);
+if (hwctx->fd < 0)
+return AVERROR_UNKNOWN;

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


[FFmpeg-devel] [PATCH][RFC] avcodec: add AV_HWACCEL_CODEC_CAP_EXPERIMENTAL flag

2017-09-01 Thread James Almer
This flag replaces the deprecated, non-prefixed HWACCEL_CODEC_CAP_EXPERIMENTAL
one.

Signed-off-by: James Almer 
---
No HWAccel uses HWACCEL_CODEC_CAP_EXPERIMENTAL at all. I wonder if we
shouldn't instead just not bother replacing it and consider adding it
once and if an hwaccel is ever committed in an unfinished way.

 doc/APIchanges   | 4 
 libavcodec/avcodec.h | 8 +++-
 libavcodec/decode.c  | 2 +-
 libavcodec/version.h | 4 ++--
 4 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index 4effbf9364..0d459ba8c0 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -15,6 +15,10 @@ libavutil: 2015-08-28
 
 API changes, most recent first:
 
+2017-09-xx - xxx - lavc 57.105.100 - avcodec.h
+  Add AV_HWACCEL_CODEC_CAP_EXPERIMENTAL, replacing the deprecated
+  HWACCEL_CODEC_CAP_EXPERIMENTAL flag.
+
 2017-09-01 - xxx - lavf 57.81.100 - avio.h
   Add avio_read_partial().
 
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 513236a863..7708bb2adb 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -3879,7 +3879,7 @@ typedef struct AVHWAccel {
 
 /**
  * Hardware accelerated codec capabilities.
- * see HWACCEL_CODEC_CAP_*
+ * see AV_HWACCEL_CODEC_CAP_*
  */
 int capabilities;
 
@@ -3988,6 +3988,12 @@ typedef struct AVHWAccel {
 } AVHWAccel;
 
 /**
+ * HWAccel is experimental and is thus avoided in favor of non experimental
+ * codecs
+ */
+#define AV_HWACCEL_CODEC_CAP_EXPERIMENTAL 0x0200
+
+/**
  * Hardware acceleration should be used for decoding even if the codec level
  * used is unknown or higher than the maximum supported level reported by the
  * hardware driver.
diff --git a/libavcodec/decode.c b/libavcodec/decode.c
index 9b57910842..892143c1d2 100644
--- a/libavcodec/decode.c
+++ b/libavcodec/decode.c
@@ -1150,7 +1150,7 @@ static int setup_hwaccel(AVCodecContext *avctx,
 return AVERROR(ENOENT);
 }
 
-if (hwa->capabilities & HWACCEL_CODEC_CAP_EXPERIMENTAL &&
+if (hwa->capabilities & AV_HWACCEL_CODEC_CAP_EXPERIMENTAL &&
 avctx->strict_std_compliance > FF_COMPLIANCE_EXPERIMENTAL) {
 av_log(avctx, AV_LOG_WARNING, "Ignoring experimental hwaccel: %s\n",
hwa->name);
diff --git a/libavcodec/version.h b/libavcodec/version.h
index 29cdb85589..55b8ddc13c 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -28,8 +28,8 @@
 #include "libavutil/version.h"
 
 #define LIBAVCODEC_VERSION_MAJOR  57
-#define LIBAVCODEC_VERSION_MINOR 104
-#define LIBAVCODEC_VERSION_MICRO 101
+#define LIBAVCODEC_VERSION_MINOR 105
+#define LIBAVCODEC_VERSION_MICRO 100
 
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \
-- 
2.13.3

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


[FFmpeg-devel] [RFC] ffmpeg: reverse logic for interlaced field ordering heuristic

2017-09-01 Thread Timo Rothenpieler
When re-encoding for example interlaced h264 from mkv into mkv, the
field ordering type switches from TT to TB, confusing some players.
Same happens on a lot of other cases as well.

I have no idea if this is the correct fix for it, but something is
definitely going wrong.
---
 ffmpeg.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ffmpeg.c b/ffmpeg.c
index ccb6638e0a..41f9bc4fb7 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -1206,7 +1206,7 @@ static void do_video_out(OutputFile *of,
avoid any copies. We support temporarily the older
method. */
 if (in_picture->interlaced_frame)
-mux_par->field_order = in_picture->top_field_first ? 
AV_FIELD_TB:AV_FIELD_BT;
+mux_par->field_order = in_picture->top_field_first ? 
AV_FIELD_TT:AV_FIELD_BB;
 else
 mux_par->field_order = AV_FIELD_PROGRESSIVE;
 pkt.data   = (uint8_t *)in_picture;
@@ -1226,7 +1226,7 @@ static void do_video_out(OutputFile *of,
 in_picture->top_field_first = !!ost->top_field_first;
 
 if (in_picture->interlaced_frame) {
-if (enc->codec->id == AV_CODEC_ID_MJPEG)
+if (enc->codec->id != AV_CODEC_ID_MJPEG)
 mux_par->field_order = in_picture->top_field_first ? 
AV_FIELD_TT:AV_FIELD_BB;
 else
 mux_par->field_order = in_picture->top_field_first ? 
AV_FIELD_TB:AV_FIELD_BT;
-- 
2.14.1

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


Re: [FFmpeg-devel] [PATCH] Add support for RockChip Media Process Platform This adds hardware decoding for h264 / HEVC / VP8 using MPP Rockchip API. Will return frames holding an AVDRMFrameDescriptor

2017-09-01 Thread Carl Eugen Hoyos
Hi!

> Am 01.09.2017 um 17:45 schrieb "LongChair ." :
> 
> From: LongChair 
> 
> ---
> Changelog  |   1 +
> configure  |  13 +-
> libavcodec/Makefile|   3 +
> libavcodec/allcodecs.c |   6 +
> libavcodec/rkmppdec.c  | 537 +
> 5 files changed, 559 insertions(+), 1 deletion(-)
> create mode 100644 libavcodec/rkmppdec.c
> 
> diff --git a/Changelog b/Changelog
> index 1dfb8b5..c19c1d0 100644
> --- a/Changelog
> +++ b/Changelog
> @@ -70,6 +70,7 @@ version 3.3:
> - Removed asyncts filter (use af_aresample instead)
> - Intel QSV-accelerated VP8 video decoding
> - VAAPI-accelerated deinterlacing
> +- Addition of Rockchip MPP harware decoding
> 
> 
> version 3.2:
> diff --git a/configure b/configure
> index ebd561d..62fbcca 100755
> --- a/configure
> +++ b/configure
> @@ -307,6 +307,7 @@ External library support:
>   --disable-nvenc  disable Nvidia video encoding code [autodetect]
>   --enable-omx enable OpenMAX IL code [no]
>   --enable-omx-rpi enable OpenMAX IL code for Raspberry Pi [no]
> +  --enable-rkmpp   enable Rockchip Media Process Platform code [no]
>   --disable-vaapi  disable Video Acceleration API (mainly Unix/Intel) 
> code [autodetect]
>   --disable-vdadisable Apple Video Decode Acceleration code 
> [autodetect]
>   --disable-vdpau  disable Nvidia Video Decode and Presentation API 
> for Unix code [autodetect]
> @@ -1614,6 +1615,7 @@ HWACCEL_LIBRARY_LIST="
> libmfx
> mmal
> omx
> +rkmpp

This is Apache 2.0 (afaict) meaning it requires version 3 in case of 
--enable-gpl.

And please fix the commit message.

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


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

2017-09-01 Thread Jorge Ramirez

On 09/01/2017 05:44 PM, LongChair . wrote:

+ * @file
+ * API-specific header for AV_HWDEVICE_TYPE_DRM.
+ *
+ * Internal frame allocation is not currently supported - all frames
+ * must be allocated by the user.  Thus AVHWFramesContext is always
+ * NULL, though this may change if support for frame allocation is
+ * added in future.
+ */
+
+enum {
+/**
+ * The maximum number of layers/planes in a DRM frame.
+ */
+AV_DRM_MAX_PLANES = 4
+};


why this limit?

dont you have to call drmModeGetPlaneResources(fd) then use 
planes->count_planes?


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


Re: [FFmpeg-devel] [PATCH] libavformat/dv : read dv audio as BE

2017-09-01 Thread Michael Niedermayer
On Fri, Sep 01, 2017 at 03:30:53PM +0300, Александр Слободенюк wrote:
> > this breaks stream copy:
> > ./ffmpeg -i ~/tickets/1042/submarine.dv -acodec copy -vcodec copy file.dv
> > the sample file seems to be at
> > http://www.mediafire.com/file/8agcdgs2f9kqlbi/submarine.dv
> 
> > [dv @ 0x2842d80] Can't initialize DV format!
> > Make sure that you supply exactly two streams:
> >  video: 25fps or 29.97fps, audio: 2ch/48|44|32kHz/PCM
> >  (50Mbps allows an optional second audio stream)
> > Could not write header for output file #0 (incorrect codec
> > parameters ?): Operation not permitted
> 
> > [...]
> 
> Fixed
> 
> -- 
> С уважением,
>  Александр  mailto:alexander.sloboden...@bramtech.ru

>  dv.c  |   30 ++
>  dvenc.c   |9 -
>  version.h |2 +-
>  3 files changed, 15 insertions(+), 26 deletions(-)
> 2da0fe73cbc086e8008e96e0d9d0fe31d26465e6  
> 0001-libavformat-dv-change-dv-audio-type-to-BE.patch
> From 7ead9d833bf7b250256d84f0da9661ba5b4f795c Mon Sep 17 00:00:00 2001
> From: Aleksandr Slobodeniuk 
> Date: Fri, 25 Aug 2017 17:02:18 +0300
> Subject: [PATCH] libavformat/dv : change dv audio type to BE

Breaks
./ffplay ~/tickets/1589/A1590.dv

https://trac.ffmpeg.org/attachment/ticket/1589/A1590.dv

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Modern terrorism, a quick summary: Need oil, start war with country that
has oil, kill hundread thousand in war. Let country fall into chaos,
be surprised about raise of fundamantalists. Drop more bombs, kill more
people, be surprised about them taking revenge and drop even more bombs
and strip your own citizens of their rights and freedoms. to be continued


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


Re: [FFmpeg-devel] [PATCH] libavformat/dv : read dv audio as BE

2017-09-01 Thread Александр Слободенюк
> Breaks
> ./ffplay ~/tickets/1589/A1590.dv

> https://trac.ffmpeg.org/attachment/ticket/1589/A1590.dv

> [...]


Fixed.
From  the  code I've found that on BE machine ffmpeg-master shouldn't play this 
file
correctly  (it  has LE-related piece and magic). I've tried to fix it,
but it needs check. I hope someone of your team already has BE
ffmpeg, so I don't have to install debian-arm on quemu for it..

-- 
С уважением,
 Александр  mailto:alexander.sloboden...@bramtech.ru

0001-libavformat-dv-change-dv-audio-type-to-BE.patch
Description: Binary data
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] libavformat/dv : read dv audio as BE

2017-09-01 Thread Александр Слободенюк
> Fixed.
> From  the  code I've found that on BE machine ffmpeg-master shouldn't play 
> this file
> correctly  (it  has LE-related piece and magic). I've tried to fix it,
> but it needs check. I hope someone of your team already has BE
> ffmpeg, so I don't have to install debian-arm on quemu for it..

well, there's also some issue with av_be2ne16 macro.
The code

pcm[of] = av_be2ne16(lc);

actually means ne-2-be (even if these macroes are the same inside).


-- 
С уважением,
 Александр  mailto:alexander.sloboden...@bramtech.ru

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


Re: [FFmpeg-devel] [PATCH] nvenc: Don't segfault on close if no cuda is available

2017-09-01 Thread Philip Langdale
On Wed, 30 Aug 2017 20:09:34 +0100
Mark Thompson  wrote:

> ---
> """
> Cannot load libcuda.so.1
> 
> Thread 1 "ffmpeg_g" received signal SIGSEGV, Segmentation fault.
> 0x5657cd59 in ff_nvenc_encode_close (avctx=0x578ed920) at
> src/libavcodec/nvenc.c:1337 1337cu_res =
> dl_fn->cuda_dl->cuCtxPushCurrent(ctx->cu_context); """
> 
> This only fixes the segfaults - some of the other stuff might want to
> be gated as well?
> 
> 
>  libavcodec/nvenc.c | 26 +++---
>  1 file changed, 15 insertions(+), 11 deletions(-)
> 
> diff --git a/libavcodec/nvenc.c b/libavcodec/nvenc.c
> index 8c4fd31fec..5586a8901f 100644
> --- a/libavcodec/nvenc.c
> +++ b/libavcodec/nvenc.c
> @@ -1334,10 +1334,12 @@ av_cold int
> ff_nvenc_encode_close(AVCodecContext *avctx) CUcontext dummy;
>  int i;
>  
> -cu_res = dl_fn->cuda_dl->cuCtxPushCurrent(ctx->cu_context);
> -if (cu_res != CUDA_SUCCESS) {
> -av_log(avctx, AV_LOG_ERROR, "cuCtxPushCurrent failed\n");
> -return AVERROR_EXTERNAL;
> +if (dl_fn->cuda_dl) {
> +cu_res = dl_fn->cuda_dl->cuCtxPushCurrent(ctx->cu_context);
> +if (cu_res != CUDA_SUCCESS) {
> +av_log(avctx, AV_LOG_ERROR, "cuCtxPushCurrent failed\n");
> +return AVERROR_EXTERNAL;
> +}
>  }
>  
>  /* the encoder has to be flushed before it can be closed */
> @@ -1381,14 +1383,16 @@ av_cold int
> ff_nvenc_encode_close(AVCodecContext *avctx)
> p_nvenc->nvEncDestroyEncoder(ctx->nvencoder); ctx->nvencoder = NULL;
>  
> -cu_res = dl_fn->cuda_dl->cuCtxPopCurrent(&dummy);
> -if (cu_res != CUDA_SUCCESS) {
> -av_log(avctx, AV_LOG_ERROR, "cuCtxPopCurrent failed\n");
> -return AVERROR_EXTERNAL;
> -}
> +if (dl_fn->cuda_dl) {
> +cu_res = dl_fn->cuda_dl->cuCtxPopCurrent(&dummy);
> +if (cu_res != CUDA_SUCCESS) {
> +av_log(avctx, AV_LOG_ERROR, "cuCtxPopCurrent failed\n");
> +return AVERROR_EXTERNAL;
> +}
>  
> -if (ctx->cu_context_internal)
> -dl_fn->cuda_dl->cuCtxDestroy(ctx->cu_context_internal);
> +if (ctx->cu_context_internal)
> +dl_fn->cuda_dl->cuCtxDestroy(ctx->cu_context_internal);
> +}
>  ctx->cu_context = ctx->cu_context_internal = NULL;
>  
>  nvenc_free_functions(&dl_fn->nvenc_dl);

It looks correct. I agree you probably want to short cut the cleanup if
you know it failed during function loading, but looking it over, the
remaining cleanup steps are safe.

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