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 1/3] avutil/hwcontext_d3d12va: cast the input pointer array argument on av_image_copy calls
@ 2023-12-21 12:34 James Almer
  2023-12-21 12:34 ` [FFmpeg-devel] [PATCH 2/3] avutil/hwcontext_d3d12va: fix indentation in d3d12va_transfer_data() James Almer
  2023-12-21 12:34 ` [FFmpeg-devel] [PATCH 3/3] avutil/hwcontext_d3d12va: remove unused variables James Almer
  0 siblings, 2 replies; 6+ messages in thread
From: James Almer @ 2023-12-21 12:34 UTC (permalink / raw)
  To: ffmpeg-devel

Removes -Wincompatible-pointer-types warnings.

Signed-off-by: James Almer <jamrial@gmail.com>
---
 libavutil/hwcontext_d3d12va.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavutil/hwcontext_d3d12va.c b/libavutil/hwcontext_d3d12va.c
index 1600d94cb0..052de3472f 100644
--- a/libavutil/hwcontext_d3d12va.c
+++ b/libavutil/hwcontext_d3d12va.c
@@ -482,7 +482,7 @@ static int d3d12va_transfer_data(AVHWFramesContext *ctx, AVFrame *dst,
         DX_CHECK(ID3D12Resource_Map(s->staging_download_buffer, 0, NULL, (void **)&mapped_data));
         av_image_fill_pointers(data, ctx->sw_format, ctx->height, mapped_data, linesizes);
 
-        av_image_copy(dst->data, dst->linesize, data, linesizes,
+        av_image_copy(dst->data, dst->linesize,  (const uint8_t **)data, linesizes,
                       ctx->sw_format, ctx->width, ctx->height);
 
         ID3D12Resource_Unmap(s->staging_download_buffer, 0, NULL);
@@ -500,7 +500,7 @@ static int d3d12va_transfer_data(AVHWFramesContext *ctx, AVFrame *dst,
         DX_CHECK(ID3D12Resource_Map(s->staging_upload_buffer, 0, NULL, (void **)&mapped_data));
         av_image_fill_pointers(data, ctx->sw_format, ctx->height, mapped_data, linesizes);
 
-        av_image_copy(data, linesizes, src->data, src->linesize,
+        av_image_copy(data, linesizes,  (const uint8_t **)src->data, src->linesize,
                       ctx->sw_format, ctx->width, ctx->height);
 
         ID3D12Resource_Unmap(s->staging_upload_buffer, 0, NULL);
-- 
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] 6+ messages in thread

* [FFmpeg-devel] [PATCH 2/3] avutil/hwcontext_d3d12va: fix indentation in d3d12va_transfer_data()
  2023-12-21 12:34 [FFmpeg-devel] [PATCH 1/3] avutil/hwcontext_d3d12va: cast the input pointer array argument on av_image_copy calls James Almer
@ 2023-12-21 12:34 ` James Almer
  2023-12-21 12:34 ` [FFmpeg-devel] [PATCH 3/3] avutil/hwcontext_d3d12va: remove unused variables James Almer
  1 sibling, 0 replies; 6+ messages in thread
From: James Almer @ 2023-12-21 12:34 UTC (permalink / raw)
  To: ffmpeg-devel

Removes -Wmisleading-indentation warnings.

Signed-off-by: James Almer <jamrial@gmail.com>
---
 libavutil/hwcontext_d3d12va.c | 54 +++++++++++++++++------------------
 1 file changed, 27 insertions(+), 27 deletions(-)

diff --git a/libavutil/hwcontext_d3d12va.c b/libavutil/hwcontext_d3d12va.c
index 052de3472f..4ce29f250c 100644
--- a/libavutil/hwcontext_d3d12va.c
+++ b/libavutil/hwcontext_d3d12va.c
@@ -410,35 +410,35 @@ static int d3d12va_transfer_data(AVHWFramesContext *ctx, AVFrame *dst,
         linesizes[i] = FFALIGN(frame->width * (frames_hwctx->format == DXGI_FORMAT_P010 ? 2 : 1),
                                D3D12_TEXTURE_DATA_PITCH_ALIGNMENT);
 
-        staging_y_location = (D3D12_TEXTURE_COPY_LOCATION) {
-            .Type      = D3D12_TEXTURE_COPY_TYPE_PLACED_FOOTPRINT,
-            .PlacedFootprint = {
-                .Offset = 0,
-                .Footprint = {
-                    .Format   = frames_hwctx->format == DXGI_FORMAT_P010 ?
-                                                        DXGI_FORMAT_R16_UNORM : DXGI_FORMAT_R8_UNORM,
-                    .Width    = ctx->width,
-                    .Height   = ctx->height,
-                    .Depth    = 1,
-                    .RowPitch = linesizes[0],
-                },
+    staging_y_location = (D3D12_TEXTURE_COPY_LOCATION) {
+        .Type      = D3D12_TEXTURE_COPY_TYPE_PLACED_FOOTPRINT,
+        .PlacedFootprint = {
+            .Offset = 0,
+            .Footprint = {
+                .Format   = frames_hwctx->format == DXGI_FORMAT_P010 ?
+                                                    DXGI_FORMAT_R16_UNORM : DXGI_FORMAT_R8_UNORM,
+                .Width    = ctx->width,
+                .Height   = ctx->height,
+                .Depth    = 1,
+                .RowPitch = linesizes[0],
             },
-        };
-
-        staging_uv_location = (D3D12_TEXTURE_COPY_LOCATION) {
-            .Type      = D3D12_TEXTURE_COPY_TYPE_PLACED_FOOTPRINT,
-            .PlacedFootprint = {
-                .Offset = s->luma_component_size,
-                .Footprint = {
-                    .Format   = frames_hwctx->format == DXGI_FORMAT_P010 ?
-                                                        DXGI_FORMAT_R16G16_UNORM : DXGI_FORMAT_R8G8_UNORM,
-                    .Width    = ctx->width  >> 1,
-                    .Height   = ctx->height >> 1,
-                    .Depth    = 1,
-                    .RowPitch = linesizes[0],
-                },
+        },
+    };
+
+    staging_uv_location = (D3D12_TEXTURE_COPY_LOCATION) {
+        .Type      = D3D12_TEXTURE_COPY_TYPE_PLACED_FOOTPRINT,
+        .PlacedFootprint = {
+            .Offset = s->luma_component_size,
+            .Footprint = {
+                .Format   = frames_hwctx->format == DXGI_FORMAT_P010 ?
+                                                    DXGI_FORMAT_R16G16_UNORM : DXGI_FORMAT_R8G8_UNORM,
+                .Width    = ctx->width  >> 1,
+                .Height   = ctx->height >> 1,
+                .Depth    = 1,
+                .RowPitch = linesizes[0],
             },
-        };
+        },
+    };
 
     DX_CHECK(ID3D12CommandAllocator_Reset(s->command_allocator));
 
-- 
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] 6+ messages in thread

* [FFmpeg-devel] [PATCH 3/3] avutil/hwcontext_d3d12va: remove unused variables
  2023-12-21 12:34 [FFmpeg-devel] [PATCH 1/3] avutil/hwcontext_d3d12va: cast the input pointer array argument on av_image_copy calls James Almer
  2023-12-21 12:34 ` [FFmpeg-devel] [PATCH 2/3] avutil/hwcontext_d3d12va: fix indentation in d3d12va_transfer_data() James Almer
@ 2023-12-21 12:34 ` James Almer
  2023-12-21 12:42   ` Martin Storsjö
  1 sibling, 1 reply; 6+ messages in thread
From: James Almer @ 2023-12-21 12:34 UTC (permalink / raw)
  To: ffmpeg-devel

Removes -Wunused-variable warnings.

Signed-off-by: James Almer <jamrial@gmail.com>
---
Were this meant to be used? Or are just a remnant of a previous interation of
the set?

 libavutil/hwcontext_d3d12va.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/libavutil/hwcontext_d3d12va.c b/libavutil/hwcontext_d3d12va.c
index 4ce29f250c..46832fd19b 100644
--- a/libavutil/hwcontext_d3d12va.c
+++ b/libavutil/hwcontext_d3d12va.c
@@ -173,7 +173,6 @@ fail:
 
 static void d3d12va_frames_uninit(AVHWFramesContext *ctx)
 {
-    AVD3D12VAFramesContext *frames_hwctx = ctx->hwctx;
     D3D12VAFramesContext   *s            = ctx->internal->priv;
 
     D3D12_OBJECT_RELEASE(s->sync_ctx.fence);
@@ -281,8 +280,6 @@ fail:
 static int d3d12va_frames_init(AVHWFramesContext *ctx)
 {
     AVD3D12VAFramesContext *hwctx        = ctx->hwctx;
-    AVD3D12VADeviceContext *device_hwctx = ctx->device_ctx->hwctx;
-    D3D12VAFramesContext   *s            = ctx->internal->priv;
     int i;
 
     for (i = 0; i < FF_ARRAY_ELEMS(supported_formats); i++) {
@@ -335,7 +332,6 @@ static int d3d12va_transfer_get_formats(AVHWFramesContext *ctx,
                                         enum AVHWFrameTransferDirection dir,
                                         enum AVPixelFormat **formats)
 {
-    D3D12VAFramesContext *s = ctx->internal->priv;
     enum AVPixelFormat *fmts;
 
     fmts = av_malloc_array(2, sizeof(*fmts));
-- 
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] 6+ messages in thread

* Re: [FFmpeg-devel] [PATCH 3/3] avutil/hwcontext_d3d12va: remove unused variables
  2023-12-21 12:34 ` [FFmpeg-devel] [PATCH 3/3] avutil/hwcontext_d3d12va: remove unused variables James Almer
@ 2023-12-21 12:42   ` Martin Storsjö
  2023-12-21 12:46     ` James Almer
  0 siblings, 1 reply; 6+ messages in thread
From: Martin Storsjö @ 2023-12-21 12:42 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

On Thu, 21 Dec 2023, James Almer wrote:

> Removes -Wunused-variable warnings.
>
> Signed-off-by: James Almer <jamrial@gmail.com>
> ---
> Were this meant to be used? Or are just a remnant of a previous interation of
> the set?
>
> libavutil/hwcontext_d3d12va.c | 4 ----
> 1 file changed, 4 deletions(-)
>
> diff --git a/libavutil/hwcontext_d3d12va.c b/libavutil/hwcontext_d3d12va.c
> index 4ce29f250c..46832fd19b 100644
> --- a/libavutil/hwcontext_d3d12va.c
> +++ b/libavutil/hwcontext_d3d12va.c
> @@ -173,7 +173,6 @@ fail:
>
> static void d3d12va_frames_uninit(AVHWFramesContext *ctx)
> {
> -    AVD3D12VAFramesContext *frames_hwctx = ctx->hwctx;
>     D3D12VAFramesContext   *s            = ctx->internal->priv;

Here, I'd prefer to get rid of the extra spaces once the other line, which 
it was aligned to, is gone.

> static int d3d12va_frames_init(AVHWFramesContext *ctx)
> {
>     AVD3D12VAFramesContext *hwctx        = ctx->hwctx;
> -    AVD3D12VADeviceContext *device_hwctx = ctx->device_ctx->hwctx;
> -    D3D12VAFramesContext   *s            = ctx->internal->priv;

Ditto

// Martin

_______________________________________________
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] 6+ messages in thread

* Re: [FFmpeg-devel] [PATCH 3/3] avutil/hwcontext_d3d12va: remove unused variables
  2023-12-21 12:42   ` Martin Storsjö
@ 2023-12-21 12:46     ` James Almer
  2023-12-21 12:53       ` Wu, Tong1
  0 siblings, 1 reply; 6+ messages in thread
From: James Almer @ 2023-12-21 12:46 UTC (permalink / raw)
  To: ffmpeg-devel

On 12/21/2023 9:42 AM, Martin Storsjö wrote:
> On Thu, 21 Dec 2023, James Almer wrote:
> 
>> Removes -Wunused-variable warnings.
>>
>> Signed-off-by: James Almer <jamrial@gmail.com>
>> ---
>> Were this meant to be used? Or are just a remnant of a previous 
>> interation of
>> the set?
>>
>> libavutil/hwcontext_d3d12va.c | 4 ----
>> 1 file changed, 4 deletions(-)
>>
>> diff --git a/libavutil/hwcontext_d3d12va.c 
>> b/libavutil/hwcontext_d3d12va.c
>> index 4ce29f250c..46832fd19b 100644
>> --- a/libavutil/hwcontext_d3d12va.c
>> +++ b/libavutil/hwcontext_d3d12va.c
>> @@ -173,7 +173,6 @@ fail:
>>
>> static void d3d12va_frames_uninit(AVHWFramesContext *ctx)
>> {
>> -    AVD3D12VAFramesContext *frames_hwctx = ctx->hwctx;
>>     D3D12VAFramesContext   *s            = ctx->internal->priv;
> 
> Here, I'd prefer to get rid of the extra spaces once the other line, 
> which it was aligned to, is gone.
> 
>> static int d3d12va_frames_init(AVHWFramesContext *ctx)
>> {
>>     AVD3D12VAFramesContext *hwctx        = ctx->hwctx;
>> -    AVD3D12VADeviceContext *device_hwctx = ctx->device_ctx->hwctx;
>> -    D3D12VAFramesContext   *s            = ctx->internal->priv;
> 
> Ditto

Amended locally. 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] 6+ messages in thread

* Re: [FFmpeg-devel] [PATCH 3/3] avutil/hwcontext_d3d12va: remove unused variables
  2023-12-21 12:46     ` James Almer
@ 2023-12-21 12:53       ` Wu, Tong1
  0 siblings, 0 replies; 6+ messages in thread
From: Wu, Tong1 @ 2023-12-21 12:53 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

>-----Original Message-----
>From: ffmpeg-devel <ffmpeg-devel-bounces@ffmpeg.org> On Behalf Of James
>Almer
>Sent: Thursday, December 21, 2023 8:47 PM
>To: ffmpeg-devel@ffmpeg.org
>Subject: Re: [FFmpeg-devel] [PATCH 3/3] avutil/hwcontext_d3d12va: remove
>unused variables
>
>On 12/21/2023 9:42 AM, Martin Storsjö wrote:
>> On Thu, 21 Dec 2023, James Almer wrote:
>>
>>> Removes -Wunused-variable warnings.
>>>
>>> Signed-off-by: James Almer <jamrial@gmail.com>
>>> ---
>>> Were this meant to be used? Or are just a remnant of a previous
>>> interation of
>>> the set?

They are just leftovers of the previous version. Patch set LGTM, thanks.

>>>
>>> libavutil/hwcontext_d3d12va.c | 4 ----
>>> 1 file changed, 4 deletions(-)
>>>
>>> diff --git a/libavutil/hwcontext_d3d12va.c
>>> b/libavutil/hwcontext_d3d12va.c
>>> index 4ce29f250c..46832fd19b 100644
>>> --- a/libavutil/hwcontext_d3d12va.c
>>> +++ b/libavutil/hwcontext_d3d12va.c
>>> @@ -173,7 +173,6 @@ fail:
>>>
>>> static void d3d12va_frames_uninit(AVHWFramesContext *ctx)
>>> {
>>> -    AVD3D12VAFramesContext *frames_hwctx = ctx->hwctx;
>>>     D3D12VAFramesContext   *s            = ctx->internal->priv;
>>
>> Here, I'd prefer to get rid of the extra spaces once the other line,
>> which it was aligned to, is gone.
>>
>>> static int d3d12va_frames_init(AVHWFramesContext *ctx)
>>> {
>>>     AVD3D12VAFramesContext *hwctx        = ctx->hwctx;
>>> -    AVD3D12VADeviceContext *device_hwctx = ctx->device_ctx->hwctx;
>>> -    D3D12VAFramesContext   *s            = ctx->internal->priv;
>>
>> Ditto
>
>Amended locally. 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".
_______________________________________________
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] 6+ messages in thread

end of thread, other threads:[~2023-12-21 12:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-21 12:34 [FFmpeg-devel] [PATCH 1/3] avutil/hwcontext_d3d12va: cast the input pointer array argument on av_image_copy calls James Almer
2023-12-21 12:34 ` [FFmpeg-devel] [PATCH 2/3] avutil/hwcontext_d3d12va: fix indentation in d3d12va_transfer_data() James Almer
2023-12-21 12:34 ` [FFmpeg-devel] [PATCH 3/3] avutil/hwcontext_d3d12va: remove unused variables James Almer
2023-12-21 12:42   ` Martin Storsjö
2023-12-21 12:46     ` James Almer
2023-12-21 12:53       ` Wu, Tong1

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