Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH] libavcodec: fix -Wint-conversion in vulkan
@ 2023-12-20 12:32 Sam James
  2024-01-06  6:18 ` Sam James
  0 siblings, 1 reply; 5+ messages in thread
From: Sam James @ 2023-12-20 12:32 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Sam James

FIx warnings (soon to be errors in GCC 14, already so in Clang 15):
```
src/libavcodec/vulkan_av1.c: In function ‘vk_av1_create_params’:
src/libavcodec/vulkan_av1.c:183:43: error: initialization of ‘long long unsigned int’ from ‘void *’ makes integer from pointer without a cast [-Wint-conversion]
  183 |         .videoSessionParametersTemplate = NULL,
      |                                           ^~~~
src/libavcodec/vulkan_av1.c:183:43: note: (near initialization for ‘(anonymous).videoSessionParametersTemplate’)
```

Use Vulkan's VK_NULL_HANDLE instead of bare NULL.

Fix Trac ticket #10724.

Was reported downstream in Gentoo at https://bugs.gentoo.org/919067.

Signed-off-by: Sam James <sam@gentoo.org>
---
 libavcodec/vulkan_av1.c    | 2 +-
 libavcodec/vulkan_decode.c | 6 +++---
 libavcodec/vulkan_h264.c   | 2 +-
 libavcodec/vulkan_hevc.c   | 2 +-
 libavcodec/vulkan_video.c  | 2 +-
 5 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/libavcodec/vulkan_av1.c b/libavcodec/vulkan_av1.c
index 4998bf7ebc..9730e4b08d 100644
--- a/libavcodec/vulkan_av1.c
+++ b/libavcodec/vulkan_av1.c
@@ -180,7 +180,7 @@ static int vk_av1_create_params(AVCodecContext *avctx, AVBufferRef **buf)
         .sType = VK_STRUCTURE_TYPE_VIDEO_SESSION_PARAMETERS_CREATE_INFO_KHR,
         .pNext = &av1_params,
         .videoSession = ctx->common.session,
-        .videoSessionParametersTemplate = NULL,
+        .videoSessionParametersTemplate = VK_NULL_HANDLE,
     };
 
     err = ff_vk_decode_create_params(buf, avctx, ctx, &session_params_create);
diff --git a/libavcodec/vulkan_decode.c b/libavcodec/vulkan_decode.c
index a89d84fcaa..fdbcbb450a 100644
--- a/libavcodec/vulkan_decode.c
+++ b/libavcodec/vulkan_decode.c
@@ -188,9 +188,9 @@ int ff_vk_decode_prepare_frame(FFVulkanDecodeContext *dec, AVFrame *pic,
         return 0;
 
     vkpic->dpb_frame     = NULL;
-    vkpic->img_view_ref  = NULL;
-    vkpic->img_view_out  = NULL;
-    vkpic->img_view_dest = NULL;
+    vkpic->img_view_ref  = VK_NULL_HANDLE;
+    vkpic->img_view_out  = VK_NULL_HANDLE;
+    vkpic->img_view_dest = VK_NULL_HANDLE;
 
     vkpic->destroy_image_view = vk->DestroyImageView;
     vkpic->wait_semaphores = vk->WaitSemaphores;
diff --git a/libavcodec/vulkan_h264.c b/libavcodec/vulkan_h264.c
index e727aafb16..39c123ddca 100644
--- a/libavcodec/vulkan_h264.c
+++ b/libavcodec/vulkan_h264.c
@@ -315,7 +315,7 @@ static int vk_h264_create_params(AVCodecContext *avctx, AVBufferRef **buf)
         .sType = VK_STRUCTURE_TYPE_VIDEO_SESSION_PARAMETERS_CREATE_INFO_KHR,
         .pNext = &h264_params,
         .videoSession = ctx->common.session,
-        .videoSessionParametersTemplate = NULL,
+        .videoSessionParametersTemplate = VK_NULL_HANDLE,
     };
 
     /* SPS list */
diff --git a/libavcodec/vulkan_hevc.c b/libavcodec/vulkan_hevc.c
index 99fdcf3b45..033172cbd6 100644
--- a/libavcodec/vulkan_hevc.c
+++ b/libavcodec/vulkan_hevc.c
@@ -653,7 +653,7 @@ static int vk_hevc_create_params(AVCodecContext *avctx, AVBufferRef **buf)
         .sType = VK_STRUCTURE_TYPE_VIDEO_SESSION_PARAMETERS_CREATE_INFO_KHR,
         .pNext = &h265_params,
         .videoSession = ctx->common.session,
-        .videoSessionParametersTemplate = NULL,
+        .videoSessionParametersTemplate = VK_NULL_HANDLE,
     };
 
     HEVCHeaderSet *hdr;
diff --git a/libavcodec/vulkan_video.c b/libavcodec/vulkan_video.c
index 5fa8292b28..fb20315db4 100644
--- a/libavcodec/vulkan_video.c
+++ b/libavcodec/vulkan_video.c
@@ -287,7 +287,7 @@ av_cold void ff_vk_video_common_uninit(FFVulkanContext *s,
     if (common->session) {
         vk->DestroyVideoSessionKHR(s->hwctx->act_dev, common->session,
                                    s->hwctx->alloc);
-        common->session = NULL;
+        common->session = VK_NULL_HANDLE;
     }
 
     if (common->nb_mem && common->mem)
-- 
2.43.0

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [FFmpeg-devel] [PATCH] libavcodec: fix -Wint-conversion in vulkan
  2023-12-20 12:32 [FFmpeg-devel] [PATCH] libavcodec: fix -Wint-conversion in vulkan Sam James
@ 2024-01-06  6:18 ` Sam James
  2024-01-06 21:40   ` Lynne
  0 siblings, 1 reply; 5+ messages in thread
From: Sam James @ 2024-01-06  6:18 UTC (permalink / raw)
  To: FFmpeg development discussions and patches; +Cc: Sam James


Sam James <sam@gentoo.org> writes:

> FIx warnings (soon to be errors in GCC 14, already so in Clang 15):
> ```
> src/libavcodec/vulkan_av1.c: In function ‘vk_av1_create_params’:
> src/libavcodec/vulkan_av1.c:183:43: error: initialization of ‘long long unsigned int’ from ‘void *’ makes integer from pointer without a cast [-Wint-conversion]
>   183 |         .videoSessionParametersTemplate = NULL,
>       |                                           ^~~~
> src/libavcodec/vulkan_av1.c:183:43: note: (near initialization for ‘(anonymous).videoSessionParametersTemplate’)
> ```
>
> Use Vulkan's VK_NULL_HANDLE instead of bare NULL.
>
> Fix Trac ticket #10724.
>
> Was reported downstream in Gentoo at https://bugs.gentoo.org/919067.
>
> Signed-off-by: Sam James <sam@gentoo.org>

ping
> ---
>  libavcodec/vulkan_av1.c    | 2 +-
>  libavcodec/vulkan_decode.c | 6 +++---
>  libavcodec/vulkan_h264.c   | 2 +-
>  libavcodec/vulkan_hevc.c   | 2 +-
>  libavcodec/vulkan_video.c  | 2 +-
>  5 files changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/libavcodec/vulkan_av1.c b/libavcodec/vulkan_av1.c
> index 4998bf7ebc..9730e4b08d 100644
> --- a/libavcodec/vulkan_av1.c
> +++ b/libavcodec/vulkan_av1.c
> @@ -180,7 +180,7 @@ static int vk_av1_create_params(AVCodecContext *avctx, AVBufferRef **buf)
>          .sType = VK_STRUCTURE_TYPE_VIDEO_SESSION_PARAMETERS_CREATE_INFO_KHR,
>          .pNext = &av1_params,
>          .videoSession = ctx->common.session,
> -        .videoSessionParametersTemplate = NULL,
> +        .videoSessionParametersTemplate = VK_NULL_HANDLE,
>      };
>  
>      err = ff_vk_decode_create_params(buf, avctx, ctx, &session_params_create);
> diff --git a/libavcodec/vulkan_decode.c b/libavcodec/vulkan_decode.c
> index a89d84fcaa..fdbcbb450a 100644
> --- a/libavcodec/vulkan_decode.c
> +++ b/libavcodec/vulkan_decode.c
> @@ -188,9 +188,9 @@ int ff_vk_decode_prepare_frame(FFVulkanDecodeContext *dec, AVFrame *pic,
>          return 0;
>  
>      vkpic->dpb_frame     = NULL;
> -    vkpic->img_view_ref  = NULL;
> -    vkpic->img_view_out  = NULL;
> -    vkpic->img_view_dest = NULL;
> +    vkpic->img_view_ref  = VK_NULL_HANDLE;
> +    vkpic->img_view_out  = VK_NULL_HANDLE;
> +    vkpic->img_view_dest = VK_NULL_HANDLE;
>  
>      vkpic->destroy_image_view = vk->DestroyImageView;
>      vkpic->wait_semaphores = vk->WaitSemaphores;
> diff --git a/libavcodec/vulkan_h264.c b/libavcodec/vulkan_h264.c
> index e727aafb16..39c123ddca 100644
> --- a/libavcodec/vulkan_h264.c
> +++ b/libavcodec/vulkan_h264.c
> @@ -315,7 +315,7 @@ static int vk_h264_create_params(AVCodecContext *avctx, AVBufferRef **buf)
>          .sType = VK_STRUCTURE_TYPE_VIDEO_SESSION_PARAMETERS_CREATE_INFO_KHR,
>          .pNext = &h264_params,
>          .videoSession = ctx->common.session,
> -        .videoSessionParametersTemplate = NULL,
> +        .videoSessionParametersTemplate = VK_NULL_HANDLE,
>      };
>  
>      /* SPS list */
> diff --git a/libavcodec/vulkan_hevc.c b/libavcodec/vulkan_hevc.c
> index 99fdcf3b45..033172cbd6 100644
> --- a/libavcodec/vulkan_hevc.c
> +++ b/libavcodec/vulkan_hevc.c
> @@ -653,7 +653,7 @@ static int vk_hevc_create_params(AVCodecContext *avctx, AVBufferRef **buf)
>          .sType = VK_STRUCTURE_TYPE_VIDEO_SESSION_PARAMETERS_CREATE_INFO_KHR,
>          .pNext = &h265_params,
>          .videoSession = ctx->common.session,
> -        .videoSessionParametersTemplate = NULL,
> +        .videoSessionParametersTemplate = VK_NULL_HANDLE,
>      };
>  
>      HEVCHeaderSet *hdr;
> diff --git a/libavcodec/vulkan_video.c b/libavcodec/vulkan_video.c
> index 5fa8292b28..fb20315db4 100644
> --- a/libavcodec/vulkan_video.c
> +++ b/libavcodec/vulkan_video.c
> @@ -287,7 +287,7 @@ av_cold void ff_vk_video_common_uninit(FFVulkanContext *s,
>      if (common->session) {
>          vk->DestroyVideoSessionKHR(s->hwctx->act_dev, common->session,
>                                     s->hwctx->alloc);
> -        common->session = NULL;
> +        common->session = VK_NULL_HANDLE;
>      }
>  
>      if (common->nb_mem && common->mem)

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [FFmpeg-devel] [PATCH] libavcodec: fix -Wint-conversion in vulkan
  2024-01-06  6:18 ` Sam James
@ 2024-01-06 21:40   ` Lynne
  2024-07-30  9:58     ` Sebastian Ramacher
  0 siblings, 1 reply; 5+ messages in thread
From: Lynne @ 2024-01-06 21:40 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

Jan 6, 2024, 07:18 by sam@gentoo.org:

>
> Sam James <sam@gentoo.org> writes:
>
>> FIx warnings (soon to be errors in GCC 14, already so in Clang 15):
>> ```
>> src/libavcodec/vulkan_av1.c: In function ‘vk_av1_create_params’:
>> src/libavcodec/vulkan_av1.c:183:43: error: initialization of ‘long long unsigned int’ from ‘void *’ makes integer from pointer without a cast [-Wint-conversion]
>>  183 |         .videoSessionParametersTemplate = NULL,
>>  |                                           ^~~~
>> src/libavcodec/vulkan_av1.c:183:43: note: (near initialization for ‘(anonymous).videoSessionParametersTemplate’)
>> ```
>>
>> Use Vulkan's VK_NULL_HANDLE instead of bare NULL.
>>
>> Fix Trac ticket #10724.
>>
>> Was reported downstream in Gentoo at https://bugs.gentoo.org/919067.
>>
>> Signed-off-by: Sam James <sam@gentoo.org>
>>
>
> ping
>

Missed it.
Pushed, thanks.
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [FFmpeg-devel] [PATCH] libavcodec: fix -Wint-conversion in vulkan
  2024-01-06 21:40   ` Lynne
@ 2024-07-30  9:58     ` Sebastian Ramacher
  2024-07-30 10:00       ` Sebastian Ramacher
  0 siblings, 1 reply; 5+ messages in thread
From: Sebastian Ramacher @ 2024-07-30  9:58 UTC (permalink / raw)
  To: ffmpeg-devel

On 2024-01-06 22:40:39 +0100, Lynne wrote:
> Jan 6, 2024, 07:18 by sam@gentoo.org:
> 
> >
> > Sam James <sam@gentoo.org> writes:
> >
> >> FIx warnings (soon to be errors in GCC 14, already so in Clang 15):
> >> ```
> >> src/libavcodec/vulkan_av1.c: In function ‘vk_av1_create_params’:
> >> src/libavcodec/vulkan_av1.c:183:43: error: initialization of ‘long long unsigned int’ from ‘void *’ makes integer from pointer without a cast [-Wint-conversion]
> >>  183 |         .videoSessionParametersTemplate = NULL,
> >>  |                                           ^~~~
> >> src/libavcodec/vulkan_av1.c:183:43: note: (near initialization for ‘(anonymous).videoSessionParametersTemplate’)
> >> ```
> >>
> >> Use Vulkan's VK_NULL_HANDLE instead of bare NULL.
> >>
> >> Fix Trac ticket #10724.
> >>
> >> Was reported downstream in Gentoo at https://bugs.gentoo.org/919067.
> >>
> >> Signed-off-by: Sam James <sam@gentoo.org>
> >>
> >
> > ping
> >
> 
> Missed it.
> Pushed, thanks.

Please backport this patch to partly address https://trac.ffmpeg.org/ticket/11115.

Cheers
-- 
Sebastian Ramacher
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [FFmpeg-devel] [PATCH] libavcodec: fix -Wint-conversion in vulkan
  2024-07-30  9:58     ` Sebastian Ramacher
@ 2024-07-30 10:00       ` Sebastian Ramacher
  0 siblings, 0 replies; 5+ messages in thread
From: Sebastian Ramacher @ 2024-07-30 10:00 UTC (permalink / raw)
  To: ffmpeg-devel

On 2024-07-30 11:58:15 +0200, Sebastian Ramacher wrote:
> On 2024-01-06 22:40:39 +0100, Lynne wrote:
> > Jan 6, 2024, 07:18 by sam@gentoo.org:
> > 
> > >
> > > Sam James <sam@gentoo.org> writes:
> > >
> > >> FIx warnings (soon to be errors in GCC 14, already so in Clang 15):
> > >> ```
> > >> src/libavcodec/vulkan_av1.c: In function ‘vk_av1_create_params’:
> > >> src/libavcodec/vulkan_av1.c:183:43: error: initialization of ‘long long unsigned int’ from ‘void *’ makes integer from pointer without a cast [-Wint-conversion]
> > >>  183 |         .videoSessionParametersTemplate = NULL,
> > >>  |                                           ^~~~
> > >> src/libavcodec/vulkan_av1.c:183:43: note: (near initialization for ‘(anonymous).videoSessionParametersTemplate’)
> > >> ```
> > >>
> > >> Use Vulkan's VK_NULL_HANDLE instead of bare NULL.
> > >>
> > >> Fix Trac ticket #10724.
> > >>
> > >> Was reported downstream in Gentoo at https://bugs.gentoo.org/919067.
> > >>
> > >> Signed-off-by: Sam James <sam@gentoo.org>
> > >>
> > >
> > > ping
> > >
> > 
> > Missed it.
> > Pushed, thanks.
> 
> Please backport this patch to partly address https://trac.ffmpeg.org/ticket/11115.

Forget it. I was looking at the wrong patch.

Cheers
-- 
Sebastian Ramacher
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-07-30 10:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-20 12:32 [FFmpeg-devel] [PATCH] libavcodec: fix -Wint-conversion in vulkan Sam James
2024-01-06  6:18 ` Sam James
2024-01-06 21:40   ` Lynne
2024-07-30  9:58     ` Sebastian Ramacher
2024-07-30 10:00       ` Sebastian Ramacher

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git