[FFmpeg-devel,V1] avfilter: Add constant VAAPI_VPP_BACKGROUND_BLACK

Submitted by Zachary Zhou on Dec. 25, 2018, 6:03 a.m.

Details

Message ID 20181225060330.5732-1-zachary.zhou@intel.com
State New
Headers show

Commit Message

Zachary Zhou Dec. 25, 2018, 6:03 a.m.
Signed-off-by: Zachary Zhou <zachary.zhou@intel.com>
---
 libavfilter/vaapi_vpp.h            | 2 ++
 libavfilter/vf_deinterlace_vaapi.c | 2 +-
 libavfilter/vf_misc_vaapi.c        | 2 +-
 libavfilter/vf_procamp_vaapi.c     | 2 +-
 libavfilter/vf_scale_vaapi.c       | 2 +-
 5 files changed, 6 insertions(+), 4 deletions(-)

Comments

Mark Thompson Dec. 30, 2018, 6:12 p.m.
On 25/12/2018 06:03, Zachary Zhou wrote:
> Signed-off-by: Zachary Zhou <zachary.zhou@intel.com>
> ---
>  libavfilter/vaapi_vpp.h            | 2 ++
>  libavfilter/vf_deinterlace_vaapi.c | 2 +-
>  libavfilter/vf_misc_vaapi.c        | 2 +-
>  libavfilter/vf_procamp_vaapi.c     | 2 +-
>  libavfilter/vf_scale_vaapi.c       | 2 +-
>  5 files changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/libavfilter/vaapi_vpp.h b/libavfilter/vaapi_vpp.h
> index 0bc31018d4..bdf3bbaccc 100644
> --- a/libavfilter/vaapi_vpp.h
> +++ b/libavfilter/vaapi_vpp.h
> @@ -27,6 +27,8 @@
>  
>  #include "avfilter.h"
>  
> +#define VAAPI_VPP_BACKGROUND_BLACK 0xff000000  //Black in ARGB format
> +
>  typedef struct VAAPIVPPContext {
>      const AVClass *class;
>  
> diff --git a/libavfilter/vf_deinterlace_vaapi.c b/libavfilter/vf_deinterlace_vaapi.c
> index f7a262d0c6..97aee6588f 100644
> --- a/libavfilter/vf_deinterlace_vaapi.c
> +++ b/libavfilter/vf_deinterlace_vaapi.c
> @@ -256,7 +256,7 @@ static int deint_vaapi_filter_frame(AVFilterLink *inlink, AVFrame *input_frame)
>              ff_vaapi_vpp_colour_standard(input_frame->colorspace);
>  
>          params.output_region = NULL;
> -        params.output_background_color = 0xff000000;
> +        params.output_background_color = VAAPI_VPP_BACKGROUND_BLACK;
>          params.output_color_standard = params.surface_color_standard;
>  
>          params.pipeline_flags = 0;
> diff --git a/libavfilter/vf_misc_vaapi.c b/libavfilter/vf_misc_vaapi.c
> index 30b808a993..e227c9ff6b 100644
> --- a/libavfilter/vf_misc_vaapi.c
> +++ b/libavfilter/vf_misc_vaapi.c
> @@ -174,7 +174,7 @@ static int misc_vaapi_filter_frame(AVFilterLink *inlink, AVFrame *input_frame)
>          ff_vaapi_vpp_colour_standard(input_frame->colorspace);
>  
>      params.output_region = NULL;
> -    params.output_background_color = 0xff000000;
> +    params.output_background_color = VAAPI_VPP_BACKGROUND_BLACK;
>      params.output_color_standard = params.surface_color_standard;
>  
>      params.pipeline_flags = 0;
> diff --git a/libavfilter/vf_procamp_vaapi.c b/libavfilter/vf_procamp_vaapi.c
> index 10eccbe97d..46f3ab6465 100644
> --- a/libavfilter/vf_procamp_vaapi.c
> +++ b/libavfilter/vf_procamp_vaapi.c
> @@ -171,7 +171,7 @@ static int procamp_vaapi_filter_frame(AVFilterLink *inlink, AVFrame *input_frame
>          ff_vaapi_vpp_colour_standard(input_frame->colorspace);
>  
>      params.output_region = NULL;
> -    params.output_background_color = 0xff000000;
> +    params.output_background_color = VAAPI_VPP_BACKGROUND_BLACK;
>      params.output_color_standard = params.surface_color_standard;
>  
>      params.pipeline_flags = 0;
> diff --git a/libavfilter/vf_scale_vaapi.c b/libavfilter/vf_scale_vaapi.c
> index b06ae764bf..3699363140 100644
> --- a/libavfilter/vf_scale_vaapi.c
> +++ b/libavfilter/vf_scale_vaapi.c
> @@ -133,7 +133,7 @@ static int scale_vaapi_filter_frame(AVFilterLink *inlink, AVFrame *input_frame)
>          ff_vaapi_vpp_colour_standard(input_frame->colorspace);
>  
>      params.output_region = 0;
> -    params.output_background_color = 0xff000000;
> +    params.output_background_color = VAAPI_VPP_BACKGROUND_BLACK;
>      params.output_color_standard = params.surface_color_standard;
>  
>      params.pipeline_flags = 0;
> 

I added to the comment to include the intended use, then applied.

Thanks,

- Mark

Patch hide | download patch | download mbox

diff --git a/libavfilter/vaapi_vpp.h b/libavfilter/vaapi_vpp.h
index 0bc31018d4..bdf3bbaccc 100644
--- a/libavfilter/vaapi_vpp.h
+++ b/libavfilter/vaapi_vpp.h
@@ -27,6 +27,8 @@ 
 
 #include "avfilter.h"
 
+#define VAAPI_VPP_BACKGROUND_BLACK 0xff000000  //Black in ARGB format
+
 typedef struct VAAPIVPPContext {
     const AVClass *class;
 
diff --git a/libavfilter/vf_deinterlace_vaapi.c b/libavfilter/vf_deinterlace_vaapi.c
index f7a262d0c6..97aee6588f 100644
--- a/libavfilter/vf_deinterlace_vaapi.c
+++ b/libavfilter/vf_deinterlace_vaapi.c
@@ -256,7 +256,7 @@  static int deint_vaapi_filter_frame(AVFilterLink *inlink, AVFrame *input_frame)
             ff_vaapi_vpp_colour_standard(input_frame->colorspace);
 
         params.output_region = NULL;
-        params.output_background_color = 0xff000000;
+        params.output_background_color = VAAPI_VPP_BACKGROUND_BLACK;
         params.output_color_standard = params.surface_color_standard;
 
         params.pipeline_flags = 0;
diff --git a/libavfilter/vf_misc_vaapi.c b/libavfilter/vf_misc_vaapi.c
index 30b808a993..e227c9ff6b 100644
--- a/libavfilter/vf_misc_vaapi.c
+++ b/libavfilter/vf_misc_vaapi.c
@@ -174,7 +174,7 @@  static int misc_vaapi_filter_frame(AVFilterLink *inlink, AVFrame *input_frame)
         ff_vaapi_vpp_colour_standard(input_frame->colorspace);
 
     params.output_region = NULL;
-    params.output_background_color = 0xff000000;
+    params.output_background_color = VAAPI_VPP_BACKGROUND_BLACK;
     params.output_color_standard = params.surface_color_standard;
 
     params.pipeline_flags = 0;
diff --git a/libavfilter/vf_procamp_vaapi.c b/libavfilter/vf_procamp_vaapi.c
index 10eccbe97d..46f3ab6465 100644
--- a/libavfilter/vf_procamp_vaapi.c
+++ b/libavfilter/vf_procamp_vaapi.c
@@ -171,7 +171,7 @@  static int procamp_vaapi_filter_frame(AVFilterLink *inlink, AVFrame *input_frame
         ff_vaapi_vpp_colour_standard(input_frame->colorspace);
 
     params.output_region = NULL;
-    params.output_background_color = 0xff000000;
+    params.output_background_color = VAAPI_VPP_BACKGROUND_BLACK;
     params.output_color_standard = params.surface_color_standard;
 
     params.pipeline_flags = 0;
diff --git a/libavfilter/vf_scale_vaapi.c b/libavfilter/vf_scale_vaapi.c
index b06ae764bf..3699363140 100644
--- a/libavfilter/vf_scale_vaapi.c
+++ b/libavfilter/vf_scale_vaapi.c
@@ -133,7 +133,7 @@  static int scale_vaapi_filter_frame(AVFilterLink *inlink, AVFrame *input_frame)
         ff_vaapi_vpp_colour_standard(input_frame->colorspace);
 
     params.output_region = 0;
-    params.output_background_color = 0xff000000;
+    params.output_background_color = VAAPI_VPP_BACKGROUND_BLACK;
     params.output_color_standard = params.surface_color_standard;
 
     params.pipeline_flags = 0;