[FFmpeg-devel] option: allow to set slice_flags to video decoder

Submitted by Zhong Li on Sept. 21, 2017, 6:17 a.m.

Details

Message ID 20170921061753.27623-1-zhong.li@intel.com
State New
Headers show

Commit Message

Zhong Li Sept. 21, 2017, 6:17 a.m.
Make slice_flags setable as avcodec.h definition

Signed-off-by: Zhong Li <zhong.li@intel.com>
---
 libavcodec/options_table.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jun Zhao Sept. 21, 2017, 8:12 a.m.
On 2017/9/21 14:17, Zhong Li wrote:
> Make slice_flags setable as avcodec.h definition
>
> Signed-off-by: Zhong Li <zhong.li@intel.com>
> ---
>  libavcodec/options_table.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavcodec/options_table.h b/libavcodec/options_table.h
> index 12712fb541..5b9e344554 100644
> --- a/libavcodec/options_table.h
> +++ b/libavcodec/options_table.h
> @@ -340,7 +340,7 @@ static const AVOption avcodec_options[] = {
>  #if FF_API_PRIVATE_OPT
>  {"context", "context model", OFFSET(context_model), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E},
>  #endif
> -{"slice_flags", NULL, OFFSET(slice_flags), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX},
> +{"slice_flags", NULL, OFFSET(slice_flags), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|D},
>  #if FF_API_XVMC
>  {"xvmc_acceleration", NULL, OFFSET(xvmc_acceleration), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX},
>  #endif /* FF_API_XVMC */
LGTM
Michael Niedermayer Sept. 21, 2017, 10:30 p.m.
On Thu, Sep 21, 2017 at 02:17:53PM +0800, Zhong Li wrote:
> Make slice_flags setable as avcodec.h definition
> 
> Signed-off-by: Zhong Li <zhong.li@intel.com>
> ---
>  libavcodec/options_table.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavcodec/options_table.h b/libavcodec/options_table.h
> index 12712fb541..5b9e344554 100644
> --- a/libavcodec/options_table.h
> +++ b/libavcodec/options_table.h
> @@ -340,7 +340,7 @@ static const AVOption avcodec_options[] = {
>  #if FF_API_PRIVATE_OPT
>  {"context", "context model", OFFSET(context_model), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E},
>  #endif
> -{"slice_flags", NULL, OFFSET(slice_flags), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX},
> +{"slice_flags", NULL, OFFSET(slice_flags), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|D},
>  #if FF_API_XVMC

This is incorrect, the slice flags specify user application support.
A user cannot just override this

[...]
Zhong Li Sept. 22, 2017, 6:41 a.m.
> -----Original Message-----
> From: ffmpeg-devel [mailto:ffmpeg-devel-bounces@ffmpeg.org] On Behalf
> Of Michael Niedermayer
> Sent: Friday, September 22, 2017 6:30 AM
> To: FFmpeg development discussions and patches
> <ffmpeg-devel@ffmpeg.org>
> Subject: Re: [FFmpeg-devel] [PATCH] option: allow to set slice_flags to video
> decoder
> 
> On Thu, Sep 21, 2017 at 02:17:53PM +0800, Zhong Li wrote:
> > Make slice_flags setable as avcodec.h definition
> >
> > Signed-off-by: Zhong Li <zhong.li@intel.com>
> > ---
> >  libavcodec/options_table.h | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/libavcodec/options_table.h b/libavcodec/options_table.h
> > index 12712fb541..5b9e344554 100644
> > --- a/libavcodec/options_table.h
> > +++ b/libavcodec/options_table.h
> > @@ -340,7 +340,7 @@ static const AVOption avcodec_options[] = {  #if
> > FF_API_PRIVATE_OPT  {"context", "context model",
> > OFFSET(context_model), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN,
> > INT_MAX, V|E},  #endif -{"slice_flags", NULL, OFFSET(slice_flags),
> > AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX},
> > +{"slice_flags", NULL, OFFSET(slice_flags), AV_OPT_TYPE_INT, {.i64 =
> > +DEFAULT }, INT_MIN, INT_MAX, V|D},
> >  #if FF_API_XVMC
> 
> This is incorrect, the slice flags specify user application support.
> A user cannot just override this

I am confused the slice_flags (as comment it is set by user) is listed in options table but can't be overrode in any case.
Should it be removed from the options table?

> 
> [...]
> --
> Michael     GnuPG fingerprint:
> 9FF2128B147EF6730BADF133611EC787040B0FAB
> 
> Concerning the gods, I have no means of knowing whether they exist or not
> or of what sort they may be, because of the obscurity of the subject, and the
> brevity of human life -- Protagoras
Michael Niedermayer Sept. 23, 2017, 3:02 p.m.
On Fri, Sep 22, 2017 at 06:41:44AM +0000, Li, Zhong wrote:
> > -----Original Message-----
> > From: ffmpeg-devel [mailto:ffmpeg-devel-bounces@ffmpeg.org] On Behalf
> > Of Michael Niedermayer
> > Sent: Friday, September 22, 2017 6:30 AM
> > To: FFmpeg development discussions and patches
> > <ffmpeg-devel@ffmpeg.org>
> > Subject: Re: [FFmpeg-devel] [PATCH] option: allow to set slice_flags to video
> > decoder
> > 
> > On Thu, Sep 21, 2017 at 02:17:53PM +0800, Zhong Li wrote:
> > > Make slice_flags setable as avcodec.h definition
> > >
> > > Signed-off-by: Zhong Li <zhong.li@intel.com>
> > > ---
> > >  libavcodec/options_table.h | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/libavcodec/options_table.h b/libavcodec/options_table.h
> > > index 12712fb541..5b9e344554 100644
> > > --- a/libavcodec/options_table.h
> > > +++ b/libavcodec/options_table.h
> > > @@ -340,7 +340,7 @@ static const AVOption avcodec_options[] = {  #if
> > > FF_API_PRIVATE_OPT  {"context", "context model",
> > > OFFSET(context_model), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN,
> > > INT_MAX, V|E},  #endif -{"slice_flags", NULL, OFFSET(slice_flags),
> > > AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX},
> > > +{"slice_flags", NULL, OFFSET(slice_flags), AV_OPT_TYPE_INT, {.i64 =
> > > +DEFAULT }, INT_MIN, INT_MAX, V|D},
> > >  #if FF_API_XVMC
> > 
> > This is incorrect, the slice flags specify user application support.
> > A user cannot just override this
> 
> I am confused the slice_flags (as comment it is set by user) is listed in options table but can't be overrode in any case.
> Should it be removed from the options table?

It can be set by the user application through the AVOption API

[...]

Patch hide | download patch | download mbox

diff --git a/libavcodec/options_table.h b/libavcodec/options_table.h
index 12712fb541..5b9e344554 100644
--- a/libavcodec/options_table.h
+++ b/libavcodec/options_table.h
@@ -340,7 +340,7 @@  static const AVOption avcodec_options[] = {
 #if FF_API_PRIVATE_OPT
 {"context", "context model", OFFSET(context_model), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E},
 #endif
-{"slice_flags", NULL, OFFSET(slice_flags), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX},
+{"slice_flags", NULL, OFFSET(slice_flags), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|D},
 #if FF_API_XVMC
 {"xvmc_acceleration", NULL, OFFSET(xvmc_acceleration), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX},
 #endif /* FF_API_XVMC */