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] lavfi/metal: fix mixing declarations and code warning
@ 2023-04-03 12:25 Jun Zhao
  2023-04-03 12:25 ` [FFmpeg-devel] [PATCH 2/3] lavc/videotoolboxenc: fix warnings Jun Zhao
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Jun Zhao @ 2023-04-03 12:25 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Jun Zhao, Jun Zhao

fix mixing declarations and code warning

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
---
 libavfilter/vf_yadif_videotoolbox.m | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavfilter/vf_yadif_videotoolbox.m b/libavfilter/vf_yadif_videotoolbox.m
index 69186c2254..3656a673b3 100644
--- a/libavfilter/vf_yadif_videotoolbox.m
+++ b/libavfilter/vf_yadif_videotoolbox.m
@@ -208,6 +208,7 @@ static av_cold int do_init(AVFilterContext *ctx) API_AVAILABLE(macos(10.11), ios
     YADIFVTContext *s = ctx->priv;
     NSError *err = nil;
     CVReturn ret;
+    dispatch_data_t libData;
 
     s->mtlDevice = MTLCreateSystemDefaultDevice();
     if (!s->mtlDevice) {
@@ -217,7 +218,7 @@ static av_cold int do_init(AVFilterContext *ctx) API_AVAILABLE(macos(10.11), ios
 
     av_log(ctx, AV_LOG_INFO, "Using Metal device: %s\n", s->mtlDevice.name.UTF8String);
 
-    dispatch_data_t libData = dispatch_data_create(
+    libData = dispatch_data_create(
         ff_vf_yadif_videotoolbox_metallib_data,
         ff_vf_yadif_videotoolbox_metallib_len,
         nil,
-- 
2.25.1

_______________________________________________
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

* [FFmpeg-devel] [PATCH 2/3] lavc/videotoolboxenc: fix warnings
  2023-04-03 12:25 [FFmpeg-devel] [PATCH 1/3] lavfi/metal: fix mixing declarations and code warning Jun Zhao
@ 2023-04-03 12:25 ` Jun Zhao
  2023-04-03 12:25 ` [FFmpeg-devel] [PATCH 3/3] lavc/videotoolbox: " Jun Zhao
  2023-04-03 13:29 ` [FFmpeg-devel] [PATCH 1/3] lavfi/metal: fix mixing declarations and code warning "zhilizhao(赵志立)"
  2 siblings, 0 replies; 5+ messages in thread
From: Jun Zhao @ 2023-04-03 12:25 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Jun Zhao, Jun Zhao

fix mixing declarations and code and function
declaration without a prototype warnings

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
---
 libavcodec/videotoolboxenc.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavcodec/videotoolboxenc.c b/libavcodec/videotoolboxenc.c
index 56971471e4..c6f22723d6 100644
--- a/libavcodec/videotoolboxenc.c
+++ b/libavcodec/videotoolboxenc.c
@@ -120,7 +120,7 @@ do{                                                                     \
 
 static pthread_once_t once_ctrl = PTHREAD_ONCE_INIT;
 
-static void loadVTEncSymbols(){
+static void loadVTEncSymbols(void){
     compat_keys.CMVideoFormatDescriptionGetHEVCParameterSetAtIndex =
         (getParameterSetAtIndex)dlsym(
             RTLD_DEFAULT,
@@ -1650,8 +1650,8 @@ static int find_sei_end(AVCodecContext *avctx,
 {
     int nal_type;
     size_t sei_payload_size = 0;
-    *sei_end = NULL;
     uint8_t *nal_start = nal_data;
+    *sei_end = NULL;
 
     if (!nal_size)
         return 0;
@@ -2041,7 +2041,7 @@ static int vtenc_cm_to_avpacket(
                 return AVERROR_EXTERNAL;
             }
 
-            int status = get_params_size(avctx, vid_fmt, &header_size);
+            status = get_params_size(avctx, vid_fmt, &header_size);
             if (status) return status;
         }
 
-- 
2.25.1

_______________________________________________
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

* [FFmpeg-devel] [PATCH 3/3] lavc/videotoolbox: fix warnings
  2023-04-03 12:25 [FFmpeg-devel] [PATCH 1/3] lavfi/metal: fix mixing declarations and code warning Jun Zhao
  2023-04-03 12:25 ` [FFmpeg-devel] [PATCH 2/3] lavc/videotoolboxenc: fix warnings Jun Zhao
@ 2023-04-03 12:25 ` Jun Zhao
  2023-04-03 13:29 ` [FFmpeg-devel] [PATCH 1/3] lavfi/metal: fix mixing declarations and code warning "zhilizhao(赵志立)"
  2 siblings, 0 replies; 5+ messages in thread
From: Jun Zhao @ 2023-04-03 12:25 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Jun Zhao, Jun Zhao

fix mixing declarations and code warnings

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
---
 libavcodec/videotoolbox.c | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/libavcodec/videotoolbox.c b/libavcodec/videotoolbox.c
index e42fea6f32..6444325591 100644
--- a/libavcodec/videotoolbox.c
+++ b/libavcodec/videotoolbox.c
@@ -799,6 +799,9 @@ static CFDictionaryRef videotoolbox_buffer_attributes_create(int width,
 static CFDictionaryRef videotoolbox_decoder_config_create(CMVideoCodecType codec_type,
                                                           AVCodecContext *avctx)
 {
+    CFMutableDictionaryRef avc_info;
+    CFDataRef data = NULL;
+
     CFMutableDictionaryRef config_info = CFDictionaryCreateMutable(kCFAllocatorDefault,
                                                                    0,
                                                                    &kCFTypeDictionaryKeyCallBacks,
@@ -810,9 +813,6 @@ static CFDictionaryRef videotoolbox_decoder_config_create(CMVideoCodecType codec
                             kVTVideoDecoderSpecification_RequireHardwareAcceleratedVideoDecoder,
                          kCFBooleanTrue);
 
-    CFMutableDictionaryRef avc_info;
-    CFDataRef data = NULL;
-
     avc_info = CFDictionaryCreateMutable(kCFAllocatorDefault,
                                          1,
                                          &kCFTypeDictionaryKeyCallBacks,
@@ -1072,13 +1072,14 @@ static int videotoolbox_hevc_end_frame(AVCodecContext *avctx)
     HEVCContext *h = avctx->priv_data;
     AVFrame *frame = h->ref->frame;
     VTContext *vtctx = avctx->internal->hwaccel_priv_data;
+    int ret;
 
     h->output_frame->crop_right = 0;
     h->output_frame->crop_left = 0;
     h->output_frame->crop_top = 0;
     h->output_frame->crop_bottom = 0;
 
-    int ret = ff_videotoolbox_common_end_frame(avctx, frame);
+    ret = ff_videotoolbox_common_end_frame(avctx, frame);
     vtctx->bitstream_size = 0;
     return ret;
 }
@@ -1132,15 +1133,17 @@ static int videotoolbox_prores_end_frame(AVCodecContext *avctx)
 }
 
 static enum AVPixelFormat videotoolbox_best_pixel_format(AVCodecContext *avctx) {
+    int depth;
     const AVPixFmtDescriptor *descriptor = av_pix_fmt_desc_get(avctx->sw_pix_fmt);
     if (!descriptor)
         return AV_PIX_FMT_NV12; // same as av_videotoolbox_alloc_context()
 
-    int depth = descriptor->comp[0].depth;
 
     if (descriptor->flags & AV_PIX_FMT_FLAG_ALPHA)
         return AV_PIX_FMT_AYUV64;
 
+    depth = descriptor->comp[0].depth;
+
 #if HAVE_KCVPIXELFORMATTYPE_444YPCBCR16BIPLANARVIDEORANGE
     if (depth > 10)
         return descriptor->log2_chroma_w == 0 ? AV_PIX_FMT_P416 : AV_PIX_FMT_P216;
@@ -1194,6 +1197,7 @@ int ff_videotoolbox_common_init(AVCodecContext *avctx)
     VTContext *vtctx = avctx->internal->hwaccel_priv_data;
     AVHWFramesContext *hw_frames;
     int err;
+    bool full_range;
 
     vtctx->logctx = avctx;
 
@@ -1241,7 +1245,7 @@ int ff_videotoolbox_common_init(AVCodecContext *avctx)
         goto fail;
     }
 
-    bool full_range = avctx->color_range == AVCOL_RANGE_JPEG;
+    full_range = avctx->color_range == AVCOL_RANGE_JPEG;
     vtctx->vt_ctx->cv_pix_fmt_type =
         av_map_videotoolbox_format_from_pixfmt2(hw_frames->sw_format, full_range);
     if (!vtctx->vt_ctx->cv_pix_fmt_type) {
-- 
2.25.1

_______________________________________________
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 1/3] lavfi/metal: fix mixing declarations and code warning
  2023-04-03 12:25 [FFmpeg-devel] [PATCH 1/3] lavfi/metal: fix mixing declarations and code warning Jun Zhao
  2023-04-03 12:25 ` [FFmpeg-devel] [PATCH 2/3] lavc/videotoolboxenc: fix warnings Jun Zhao
  2023-04-03 12:25 ` [FFmpeg-devel] [PATCH 3/3] lavc/videotoolbox: " Jun Zhao
@ 2023-04-03 13:29 ` "zhilizhao(赵志立)"
  2023-04-08 12:17   ` mypopy
  2 siblings, 1 reply; 5+ messages in thread
From: "zhilizhao(赵志立)" @ 2023-04-03 13:29 UTC (permalink / raw)
  To: FFmpeg development discussions and patches



> On Apr 3, 2023, at 20:25, Jun Zhao <mypopydev@gmail.com> wrote:
> 
> fix mixing declarations and code warning
> 
> Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
> ---
> libavfilter/vf_yadif_videotoolbox.m | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)

I have noticed the -Wdeclaration-after-statement flag has been applied
on Objective-C, but I’m not sure whether the rule should applies or not.

> 
> diff --git a/libavfilter/vf_yadif_videotoolbox.m b/libavfilter/vf_yadif_videotoolbox.m
> index 69186c2254..3656a673b3 100644
> --- a/libavfilter/vf_yadif_videotoolbox.m
> +++ b/libavfilter/vf_yadif_videotoolbox.m
> @@ -208,6 +208,7 @@ static av_cold int do_init(AVFilterContext *ctx) API_AVAILABLE(macos(10.11), ios
>     YADIFVTContext *s = ctx->priv;
>     NSError *err = nil;
>     CVReturn ret;
> +    dispatch_data_t libData;
> 
>     s->mtlDevice = MTLCreateSystemDefaultDevice();
>     if (!s->mtlDevice) {
> @@ -217,7 +218,7 @@ static av_cold int do_init(AVFilterContext *ctx) API_AVAILABLE(macos(10.11), ios
> 
>     av_log(ctx, AV_LOG_INFO, "Using Metal device: %s\n", s->mtlDevice.name.UTF8String);
> 
> -    dispatch_data_t libData = dispatch_data_create(
> +    libData = dispatch_data_create(
>         ff_vf_yadif_videotoolbox_metallib_data,
>         ff_vf_yadif_videotoolbox_metallib_len,
>         nil,
> -- 
> 2.25.1
> 
> _______________________________________________
> 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] 5+ messages in thread

* Re: [FFmpeg-devel] [PATCH 1/3] lavfi/metal: fix mixing declarations and code warning
  2023-04-03 13:29 ` [FFmpeg-devel] [PATCH 1/3] lavfi/metal: fix mixing declarations and code warning "zhilizhao(赵志立)"
@ 2023-04-08 12:17   ` mypopy
  0 siblings, 0 replies; 5+ messages in thread
From: mypopy @ 2023-04-08 12:17 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

On Mon, Apr 3, 2023 at 9:29 PM "zhilizhao(赵志立)" <quinkblack@foxmail.com> wrote:
>
>
>
> > On Apr 3, 2023, at 20:25, Jun Zhao <mypopydev@gmail.com> wrote:
> >
> > fix mixing declarations and code warning
> >
> > Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
> > ---
> > libavfilter/vf_yadif_videotoolbox.m | 3 ++-
> > 1 file changed, 2 insertions(+), 1 deletion(-)
>
> I have noticed the -Wdeclaration-after-statement flag has been applied
> on Objective-C, but I’m not sure whether the rule should applies or not.
>
I will hold on the Objective-C part and push the other patches in the patch sets
> >
> > diff --git a/libavfilter/vf_yadif_videotoolbox.m b/libavfilter/vf_yadif_videotoolbox.m
> > index 69186c2254..3656a673b3 100644
> > --- a/libavfilter/vf_yadif_videotoolbox.m
> > +++ b/libavfilter/vf_yadif_videotoolbox.m
> > @@ -208,6 +208,7 @@ static av_cold int do_init(AVFilterContext *ctx) API_AVAILABLE(macos(10.11), ios
> >     YADIFVTContext *s = ctx->priv;
> >     NSError *err = nil;
> >     CVReturn ret;
> > +    dispatch_data_t libData;
> >
> >     s->mtlDevice = MTLCreateSystemDefaultDevice();
> >     if (!s->mtlDevice) {
> > @@ -217,7 +218,7 @@ static av_cold int do_init(AVFilterContext *ctx) API_AVAILABLE(macos(10.11), ios
> >
> >     av_log(ctx, AV_LOG_INFO, "Using Metal device: %s\n", s->mtlDevice.name.UTF8String);
> >
> > -    dispatch_data_t libData = dispatch_data_create(
> > +    libData = dispatch_data_create(
> >         ff_vf_yadif_videotoolbox_metallib_data,
> >         ff_vf_yadif_videotoolbox_metallib_len,
> >         nil,
> > --
> > 2.25.1
_______________________________________________
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:[~2023-04-08 12:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-03 12:25 [FFmpeg-devel] [PATCH 1/3] lavfi/metal: fix mixing declarations and code warning Jun Zhao
2023-04-03 12:25 ` [FFmpeg-devel] [PATCH 2/3] lavc/videotoolboxenc: fix warnings Jun Zhao
2023-04-03 12:25 ` [FFmpeg-devel] [PATCH 3/3] lavc/videotoolbox: " Jun Zhao
2023-04-03 13:29 ` [FFmpeg-devel] [PATCH 1/3] lavfi/metal: fix mixing declarations and code warning "zhilizhao(赵志立)"
2023-04-08 12:17   ` mypopy

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