diff mbox

[FFmpeg-devel] avcodec/mediacodecdec_common: make stride and slice-height non-mandatory fields

Message ID 20180411131446.29735-1-matthieu.bouron@gmail.com
State Accepted
Commit 67d0911f27e29d551865dbca3af5c49abe029885
Headers show

Commit Message

Matthieu Bouron April 11, 2018, 1:14 p.m. UTC
Fixes decoding on the Samsung Chromebook Pro which do not set the codec
output format stride and slice-height fields.
---
 libavcodec/mediacodecdec_common.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Matthieu Bouron April 16, 2018, 1:53 p.m. UTC | #1
On Wed, Apr 11, 2018 at 3:14 PM, Matthieu Bouron <matthieu.bouron@gmail.com>
wrote:

> Fixes decoding on the Samsung Chromebook Pro which do not set the codec
> output format stride and slice-height fields.
> ---
>  libavcodec/mediacodecdec_common.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/libavcodec/mediacodecdec_common.c b/libavcodec/mediacodecdec_
> common.c
> index e31adb487c..e59cf19aad 100644
> --- a/libavcodec/mediacodecdec_common.c
> +++ b/libavcodec/mediacodecdec_common.c
> @@ -385,10 +385,10 @@ static int mediacodec_dec_parse_format(AVCodecContext
> *avctx, MediaCodecDecConte
>      AMEDIAFORMAT_GET_INT32(s->width,  "width", 1);
>      AMEDIAFORMAT_GET_INT32(s->height, "height", 1);
>
> -    AMEDIAFORMAT_GET_INT32(s->stride, "stride", 1);
> +    AMEDIAFORMAT_GET_INT32(s->stride, "stride", 0);
>      s->stride = s->stride > 0 ? s->stride : s->width;
>
> -    AMEDIAFORMAT_GET_INT32(s->slice_height, "slice-height", 1);
> +    AMEDIAFORMAT_GET_INT32(s->slice_height, "slice-height", 0);
>      s->slice_height = s->slice_height > 0 ? s->slice_height : s->height;
>
>      if (strstr(s->codec_name, "OMX.Nvidia.")) {
> --
> 2.17.0
>
>
Ping.
Matthieu Bouron April 18, 2018, 4:13 p.m. UTC | #2
On Mon, Apr 16, 2018 at 03:53:23PM +0200, Matthieu Bouron wrote:
> On Wed, Apr 11, 2018 at 3:14 PM, Matthieu Bouron <matthieu.bouron@gmail.com>
> wrote:
> 
> > Fixes decoding on the Samsung Chromebook Pro which do not set the codec
> > output format stride and slice-height fields.
> > ---
> >  libavcodec/mediacodecdec_common.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/libavcodec/mediacodecdec_common.c b/libavcodec/mediacodecdec_
> > common.c
> > index e31adb487c..e59cf19aad 100644
> > --- a/libavcodec/mediacodecdec_common.c
> > +++ b/libavcodec/mediacodecdec_common.c
> > @@ -385,10 +385,10 @@ static int mediacodec_dec_parse_format(AVCodecContext
> > *avctx, MediaCodecDecConte
> >      AMEDIAFORMAT_GET_INT32(s->width,  "width", 1);
> >      AMEDIAFORMAT_GET_INT32(s->height, "height", 1);
> >
> > -    AMEDIAFORMAT_GET_INT32(s->stride, "stride", 1);
> > +    AMEDIAFORMAT_GET_INT32(s->stride, "stride", 0);
> >      s->stride = s->stride > 0 ? s->stride : s->width;
> >
> > -    AMEDIAFORMAT_GET_INT32(s->slice_height, "slice-height", 1);
> > +    AMEDIAFORMAT_GET_INT32(s->slice_height, "slice-height", 0);
> >      s->slice_height = s->slice_height > 0 ? s->slice_height : s->height;
> >
> >      if (strstr(s->codec_name, "OMX.Nvidia.")) {
> > --
> > 2.17.0
> >
> >
> Ping.

If there is no objection I will push the patch in a few hours (I would
like to have it in the next release).
Matthieu Bouron April 19, 2018, 11:57 a.m. UTC | #3
On Wed, Apr 18, 2018 at 6:13 PM, Matthieu Bouron <matthieu.bouron@gmail.com>
wrote:

> On Mon, Apr 16, 2018 at 03:53:23PM +0200, Matthieu Bouron wrote:
> > On Wed, Apr 11, 2018 at 3:14 PM, Matthieu Bouron <
> matthieu.bouron@gmail.com>
> > wrote:
> >
> > > Fixes decoding on the Samsung Chromebook Pro which do not set the codec
> > > output format stride and slice-height fields.
> > > ---
> > >  libavcodec/mediacodecdec_common.c | 4 ++--
> > >  1 file changed, 2 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/libavcodec/mediacodecdec_common.c
> b/libavcodec/mediacodecdec_
> > > common.c
> > > index e31adb487c..e59cf19aad 100644
> > > --- a/libavcodec/mediacodecdec_common.c
> > > +++ b/libavcodec/mediacodecdec_common.c
> > > @@ -385,10 +385,10 @@ static int mediacodec_dec_parse_format(
> AVCodecContext
> > > *avctx, MediaCodecDecConte
> > >      AMEDIAFORMAT_GET_INT32(s->width,  "width", 1);
> > >      AMEDIAFORMAT_GET_INT32(s->height, "height", 1);
> > >
> > > -    AMEDIAFORMAT_GET_INT32(s->stride, "stride", 1);
> > > +    AMEDIAFORMAT_GET_INT32(s->stride, "stride", 0);
> > >      s->stride = s->stride > 0 ? s->stride : s->width;
> > >
> > > -    AMEDIAFORMAT_GET_INT32(s->slice_height, "slice-height", 1);
> > > +    AMEDIAFORMAT_GET_INT32(s->slice_height, "slice-height", 0);
> > >      s->slice_height = s->slice_height > 0 ? s->slice_height :
> s->height;
> > >
> > >      if (strstr(s->codec_name, "OMX.Nvidia.")) {
> > > --
> > > 2.17.0
> > >
> > >
> > Ping.
>
> If there is no objection I will push the patch in a few hours (I would
> like to have it in the next release).
>
>
Patch pushed.

[...]
Hendrik Leppkes April 19, 2018, 12:08 p.m. UTC | #4
On Thu, Apr 19, 2018 at 1:57 PM, Matthieu Bouron
<matthieu.bouron@gmail.com> wrote:
> On Wed, Apr 18, 2018 at 6:13 PM, Matthieu Bouron <matthieu.bouron@gmail.com>
> wrote:
>
>> On Mon, Apr 16, 2018 at 03:53:23PM +0200, Matthieu Bouron wrote:
>> > On Wed, Apr 11, 2018 at 3:14 PM, Matthieu Bouron <
>> matthieu.bouron@gmail.com>
>> > wrote:
>> >
>> > > Fixes decoding on the Samsung Chromebook Pro which do not set the codec
>> > > output format stride and slice-height fields.
>> > > ---
>> > >  libavcodec/mediacodecdec_common.c | 4 ++--
>> > >  1 file changed, 2 insertions(+), 2 deletions(-)
>> > >
>> > > diff --git a/libavcodec/mediacodecdec_common.c
>> b/libavcodec/mediacodecdec_
>> > > common.c
>> > > index e31adb487c..e59cf19aad 100644
>> > > --- a/libavcodec/mediacodecdec_common.c
>> > > +++ b/libavcodec/mediacodecdec_common.c
>> > > @@ -385,10 +385,10 @@ static int mediacodec_dec_parse_format(
>> AVCodecContext
>> > > *avctx, MediaCodecDecConte
>> > >      AMEDIAFORMAT_GET_INT32(s->width,  "width", 1);
>> > >      AMEDIAFORMAT_GET_INT32(s->height, "height", 1);
>> > >
>> > > -    AMEDIAFORMAT_GET_INT32(s->stride, "stride", 1);
>> > > +    AMEDIAFORMAT_GET_INT32(s->stride, "stride", 0);
>> > >      s->stride = s->stride > 0 ? s->stride : s->width;
>> > >
>> > > -    AMEDIAFORMAT_GET_INT32(s->slice_height, "slice-height", 1);
>> > > +    AMEDIAFORMAT_GET_INT32(s->slice_height, "slice-height", 0);
>> > >      s->slice_height = s->slice_height > 0 ? s->slice_height :
>> s->height;
>> > >
>> > >      if (strstr(s->codec_name, "OMX.Nvidia.")) {
>> > > --
>> > > 2.17.0
>> > >
>> > >
>> > Ping.
>>
>> If there is no objection I will push the patch in a few hours (I would
>> like to have it in the next release).
>>
>>
> Patch pushed.
>

If you want this in the release, you should also backport it to the
release/4.0 branch before the release ie made.

- Hendrik
Matthieu Bouron April 19, 2018, 12:24 p.m. UTC | #5
On Thu, Apr 19, 2018 at 02:08:58PM +0200, Hendrik Leppkes wrote:
> On Thu, Apr 19, 2018 at 1:57 PM, Matthieu Bouron
> <matthieu.bouron@gmail.com> wrote:
> > On Wed, Apr 18, 2018 at 6:13 PM, Matthieu Bouron <matthieu.bouron@gmail.com>
> > wrote:
> >
> >> On Mon, Apr 16, 2018 at 03:53:23PM +0200, Matthieu Bouron wrote:
> >> > On Wed, Apr 11, 2018 at 3:14 PM, Matthieu Bouron <
> >> matthieu.bouron@gmail.com>
> >> > wrote:
> >> >
> >> > > Fixes decoding on the Samsung Chromebook Pro which do not set the codec
> >> > > output format stride and slice-height fields.
> >> > > ---
> >> > >  libavcodec/mediacodecdec_common.c | 4 ++--
> >> > >  1 file changed, 2 insertions(+), 2 deletions(-)
> >> > >
> >> > > diff --git a/libavcodec/mediacodecdec_common.c
> >> b/libavcodec/mediacodecdec_
> >> > > common.c
> >> > > index e31adb487c..e59cf19aad 100644
> >> > > --- a/libavcodec/mediacodecdec_common.c
> >> > > +++ b/libavcodec/mediacodecdec_common.c
> >> > > @@ -385,10 +385,10 @@ static int mediacodec_dec_parse_format(
> >> AVCodecContext
> >> > > *avctx, MediaCodecDecConte
> >> > >      AMEDIAFORMAT_GET_INT32(s->width,  "width", 1);
> >> > >      AMEDIAFORMAT_GET_INT32(s->height, "height", 1);
> >> > >
> >> > > -    AMEDIAFORMAT_GET_INT32(s->stride, "stride", 1);
> >> > > +    AMEDIAFORMAT_GET_INT32(s->stride, "stride", 0);
> >> > >      s->stride = s->stride > 0 ? s->stride : s->width;
> >> > >
> >> > > -    AMEDIAFORMAT_GET_INT32(s->slice_height, "slice-height", 1);
> >> > > +    AMEDIAFORMAT_GET_INT32(s->slice_height, "slice-height", 0);
> >> > >      s->slice_height = s->slice_height > 0 ? s->slice_height :
> >> s->height;
> >> > >
> >> > >      if (strstr(s->codec_name, "OMX.Nvidia.")) {
> >> > > --
> >> > > 2.17.0
> >> > >
> >> > >
> >> > Ping.
> >>
> >> If there is no objection I will push the patch in a few hours (I would
> >> like to have it in the next release).
> >>
> >>
> > Patch pushed.
> >
> 
> If you want this in the release, you should also backport it to the
> release/4.0 branch before the release ie made.

Thanks a lot for the notification. I didn't notice the release branch was
already created.
diff mbox

Patch

diff --git a/libavcodec/mediacodecdec_common.c b/libavcodec/mediacodecdec_common.c
index e31adb487c..e59cf19aad 100644
--- a/libavcodec/mediacodecdec_common.c
+++ b/libavcodec/mediacodecdec_common.c
@@ -385,10 +385,10 @@  static int mediacodec_dec_parse_format(AVCodecContext *avctx, MediaCodecDecConte
     AMEDIAFORMAT_GET_INT32(s->width,  "width", 1);
     AMEDIAFORMAT_GET_INT32(s->height, "height", 1);
 
-    AMEDIAFORMAT_GET_INT32(s->stride, "stride", 1);
+    AMEDIAFORMAT_GET_INT32(s->stride, "stride", 0);
     s->stride = s->stride > 0 ? s->stride : s->width;
 
-    AMEDIAFORMAT_GET_INT32(s->slice_height, "slice-height", 1);
+    AMEDIAFORMAT_GET_INT32(s->slice_height, "slice-height", 0);
     s->slice_height = s->slice_height > 0 ? s->slice_height : s->height;
 
     if (strstr(s->codec_name, "OMX.Nvidia.")) {