Re: [libav-devel] [PATCH] asfdec: use the BMP_HEADER specific Format Data size instead of

2017-02-07 Thread Diego Biurrun
On Tue, Feb 07, 2017 at 02:15:55PM +0100, Alexandra Hájková wrote:
> the ASF specific Format Data size. Fixes video decoding problem
> part of the bug 1020.

See the other review for log message hints.

> --- a/libavformat/asfdec.c
> +++ b/libavformat/asfdec.c
> @@ -691,16 +691,18 @@ static int asf_read_properties(AVFormatContext *s, 
> const GUIDParseTable *g)
>  
>  static int parse_video_info(AVIOContext *pb, AVStream *st)
>  {
> +uint16_t size_;
> +uint32_t size;
>  unsigned int tag;

Please use descriptive variable names.

> --- a/libavformat/riff.h
> +++ b/libavformat/riff.h
> @@ -43,7 +43,7 @@ void ff_end_tag(AVIOContext *pb, int64_t start);
>   * bits_per_encoded_sample fields. Does not read extradata.
>   * @return codec tag
>   */
> -int ff_get_bmp_header(AVIOContext *pb, AVStream *st);
> +int ff_get_bmp_header(AVIOContext *pb, AVStream *st, uint32_t *size);

The documentation is now incomplete.

Why uint32_t? Sizes should have size_t as type.

> --- a/libavformat/riffdec.c
> +++ b/libavformat/riffdec.c
> @@ -180,10 +180,12 @@ enum AVCodecID ff_wav_codec_get_id(unsigned int tag, 
> int bps)
>  
> -int ff_get_bmp_header(AVIOContext *pb, AVStream *st)
> +int ff_get_bmp_header(AVIOContext *pb, AVStream *st, uint32_t *size)
>  {
>  int tag1;
> -avio_rl32(pb); /* size */
> +uint32_t size_ = avio_rl32(pb); /* size */

The comment adds no information.

Diego
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Re: [libav-devel] [PATCH] imgutils: Document av_image_get_buffer_size()

2017-02-07 Thread Luca Barbato
On 07/02/2017 16:01, Vittorio Giovara wrote:
> ---
>  libavutil/imgutils.h | 7 ++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/libavutil/imgutils.h b/libavutil/imgutils.h
> index 67063a2..ac1bcb8 100644
> --- a/libavutil/imgutils.h
> +++ b/libavutil/imgutils.h
> @@ -169,7 +169,12 @@ int av_image_fill_arrays(uint8_t *dst_data[4], int 
> dst_linesize[4],
>   * Return the size in bytes of the amount of data required to store an
>   * image with the given parameters.
>   *
> - * @param[in] align the assumed linesize alignment
> + * @param pix_fmt  the pixel format of the image
> + * @param widththe width of the image in pixels
> + * @param height   the height of the image in pixels
> + * @param alignthe assumed linesize alignment
> + * @return the size in bytes required for src, a negative error code
> + * in case of failure
>   */
>  int av_image_get_buffer_size(enum AVPixelFormat pix_fmt, int width, int 
> height, int align);
>  
> 

Ok.
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

[libav-devel] [PATCH] imgutils: Document av_image_get_buffer_size()

2017-02-07 Thread Vittorio Giovara
---
 libavutil/imgutils.h | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/libavutil/imgutils.h b/libavutil/imgutils.h
index 67063a2..ac1bcb8 100644
--- a/libavutil/imgutils.h
+++ b/libavutil/imgutils.h
@@ -169,7 +169,12 @@ int av_image_fill_arrays(uint8_t *dst_data[4], int 
dst_linesize[4],
  * Return the size in bytes of the amount of data required to store an
  * image with the given parameters.
  *
- * @param[in] align the assumed linesize alignment
+ * @param pix_fmt  the pixel format of the image
+ * @param widththe width of the image in pixels
+ * @param height   the height of the image in pixels
+ * @param alignthe assumed linesize alignment
+ * @return the size in bytes required for src, a negative error code
+ * in case of failure
  */
 int av_image_get_buffer_size(enum AVPixelFormat pix_fmt, int width, int 
height, int align);
 
-- 
2.10.0

___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Re: [libav-devel] [PATCH] asfdec: use the BMP_HEADER specific Format Data size instead of

2017-02-07 Thread Vittorio Giovara
On Tue, Feb 7, 2017 at 8:15 AM, Alexandra Hájková
 wrote:
> the ASF specific Format Data size. Fixes video decoding problem
> part of the bug 1020.
> ---
>  libavformat/asfdec.c  | 8 +---
>  libavformat/avidec.c  | 2 +-
>  libavformat/riff.h| 2 +-
>  libavformat/riffdec.c | 6 --
>  libavformat/wtv.c | 2 +-
>  5 files changed, 12 insertions(+), 8 deletions(-)
>
> diff --git a/libavformat/asfdec.c b/libavformat/asfdec.c
> index d602af8..10f8644 100644
> --- a/libavformat/asfdec.c
> +++ b/libavformat/asfdec.c
> @@ -691,16 +691,18 @@ static int asf_read_properties(AVFormatContext *s, 
> const GUIDParseTable *g)
>
>  static int parse_video_info(AVIOContext *pb, AVStream *st)
>  {
> -uint16_t size;
> +uint16_t size_;
> +uint32_t size;

This is a big NO from me. You should rename them according to what
they actually are (eg size_format_data and size_bmp_header).
-- 
Vittorio
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Re: [libav-devel] [PATCH] asfdec: use the BMP_HEADER specific Format Data size instead of

2017-02-07 Thread Diego Biurrun
On Tue, Feb 07, 2017 at 02:46:45PM +0100, Luca Barbato wrote:
> On 07/02/2017 14:15, Alexandra Hájková wrote:
> > the ASF specific Format Data size. Fixes video decoding problem
> > part of the bug 1020.
> 
> asfdec: Account for different Format Data sizes
> 
> Some muxers may use the BMP_HEADER Format Data size instead of the
> ASF-specific one.
> 
> Bug-Id: 1020
> 
> The patch seems ok if it survives fate.

CC: libav-sta...@libav.org

Diego
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Re: [libav-devel] [PATCH] asfdec: use the BMP_HEADER specific Format Data size instead of

2017-02-07 Thread Luca Barbato
On 07/02/2017 14:15, Alexandra Hájková wrote:
> the ASF specific Format Data size. Fixes video decoding problem
> part of the bug 1020.

asfdec: Account for different Format Data sizes

Some muxers may use the BMP_HEADER Format Data size instead of the
ASF-specific one.

Bug-Id: 1020

The patch seems ok if it survives fate.

lu
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

[libav-devel] [PATCH] asfdec: use the BMP_HEADER specific Format Data size instead of

2017-02-07 Thread Alexandra Hájková
the ASF specific Format Data size. Fixes video decoding problem
part of the bug 1020.
---
 libavformat/asfdec.c  | 8 +---
 libavformat/avidec.c  | 2 +-
 libavformat/riff.h| 2 +-
 libavformat/riffdec.c | 6 --
 libavformat/wtv.c | 2 +-
 5 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/libavformat/asfdec.c b/libavformat/asfdec.c
index d602af8..10f8644 100644
--- a/libavformat/asfdec.c
+++ b/libavformat/asfdec.c
@@ -691,16 +691,18 @@ static int asf_read_properties(AVFormatContext *s, const 
GUIDParseTable *g)
 
 static int parse_video_info(AVIOContext *pb, AVStream *st)
 {
-uint16_t size;
+uint16_t size_;
+uint32_t size;
 unsigned int tag;
 
 st->codecpar->width  = avio_rl32(pb);
 st->codecpar->height = avio_rl32(pb);
 avio_skip(pb, 1); // skip reserved flags
-size = avio_rl16(pb); // size of the Format Data
-tag  = ff_get_bmp_header(pb, st);
+size_ = avio_rl16(pb); // size of the Format Data
+tag  = ff_get_bmp_header(pb, st, );
 st->codecpar->codec_tag = tag;
 st->codecpar->codec_id  = ff_codec_get_id(ff_codec_bmp_tags, tag);
+size = FFMAX(size_, size);
 
 if (size > BMP_HEADER_SIZE) {
 int ret;
diff --git a/libavformat/avidec.c b/libavformat/avidec.c
index 0439c9c..61f81e8 100644
--- a/libavformat/avidec.c
+++ b/libavformat/avidec.c
@@ -613,7 +613,7 @@ static int avi_read_header(AVFormatContext *s)
 avio_skip(pb, size);
 break;
 }
-tag1 = ff_get_bmp_header(pb, st);
+tag1 = ff_get_bmp_header(pb, st, NULL);
 
 if (tag1 == MKTAG('D', 'X', 'S', 'B') ||
 tag1 == MKTAG('D', 'X', 'S', 'A')) {
diff --git a/libavformat/riff.h b/libavformat/riff.h
index a45c7f3..295b6d0 100644
--- a/libavformat/riff.h
+++ b/libavformat/riff.h
@@ -43,7 +43,7 @@ void ff_end_tag(AVIOContext *pb, int64_t start);
  * bits_per_encoded_sample fields. Does not read extradata.
  * @return codec tag
  */
-int ff_get_bmp_header(AVIOContext *pb, AVStream *st);
+int ff_get_bmp_header(AVIOContext *pb, AVStream *st, uint32_t *size);
 
 void ff_put_bmp_header(AVIOContext *pb, AVCodecParameters *par, const 
AVCodecTag *tags, int for_asf);
 int ff_put_wav_header(AVFormatContext *s, AVIOContext *pb, AVCodecParameters 
*par);
diff --git a/libavformat/riffdec.c b/libavformat/riffdec.c
index 8124835..d10ea2b 100644
--- a/libavformat/riffdec.c
+++ b/libavformat/riffdec.c
@@ -180,10 +180,12 @@ enum AVCodecID ff_wav_codec_get_id(unsigned int tag, int 
bps)
 return id;
 }
 
-int ff_get_bmp_header(AVIOContext *pb, AVStream *st)
+int ff_get_bmp_header(AVIOContext *pb, AVStream *st, uint32_t *size)
 {
 int tag1;
-avio_rl32(pb); /* size */
+uint32_t size_ = avio_rl32(pb); /* size */
+if (size)
+*size = size_;
 st->codecpar->width  = avio_rl32(pb);
 st->codecpar->height = (int32_t)avio_rl32(pb);
 avio_rl16(pb); /* planes */
diff --git a/libavformat/wtv.c b/libavformat/wtv.c
index 2cab4e5..272b317 100644
--- a/libavformat/wtv.c
+++ b/libavformat/wtv.c
@@ -586,7 +586,7 @@ static int parse_videoinfoheader2(AVFormatContext *s, 
AVStream *st)
 AVIOContext *pb = wtv->pb;
 
 avio_skip(pb, 72);  // picture aspect ratio is unreliable
-ff_get_bmp_header(pb, st);
+ff_get_bmp_header(pb, st, NULL);
 
 return 72 + 40;
 }
-- 
2.1.4

___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Re: [libav-devel] [PATCH] omx: Use the EOS flag to handle flushing at the end

2017-02-07 Thread Luca Barbato
On 07/02/2017 08:51, Martin Storsjö wrote:
> This avoids having to count the number of frames sent to the codec
> and the number of output packets received; instead just wait until
> the encoder returns a buffer with the EOS flag set.
> 
> This avoids potential (so far only theoretical) issues if an encoder
> doesn't output exactly one packet per input frame.
> ---
>  libavcodec/omx.c | 30 +++---
>  1 file changed, 23 insertions(+), 7 deletions(-)
> 

Possibly Ok.

lu

___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Re: [libav-devel] [PATCH] configure: Rework dependency handling for conflicting components

2017-02-07 Thread Janne Grunau
On 2017-02-06 17:22:06 +0100, Diego Biurrun wrote:
> This makes the feature more visible and obvious.
> ---
> 
> Changed to use _conflict instead of _not as Janne suggested.
> 
>  configure | 22 +-
>  1 file changed, 13 insertions(+), 9 deletions(-)

ok

Janne
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Re: [libav-devel] [PATCH] configure: Add name parameter to require_pkg_config() helper function

2017-02-07 Thread Janne Grunau
On 2017-02-06 18:08:00 +0100, Diego Biurrun wrote:
> This allows distinguishing between the internal variable name for
> external libraries and the pkg-config package name. Having both
> names available avoids special-casing outside the helper function
> when the two identifiers do not match.
> ---
> 
> Moved the shift according to Janne's suggestion.
> 
>  configure | 55 +--
>  1 file changed, 29 insertions(+), 26 deletions(-)

ok

Janne
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel