[vlc-commits] video filters: avoid using aggregate initializers for filter callbacks

Steve Lhomme git at videolan.org
Thu Jul 25 12:15:13 CEST 2019


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Wed Jul 24 08:12:02 2019 +0200| [c4bbf61e711ec32a07557e016692df111c24cb75] | committer: Steve Lhomme

video filters: avoid using aggregate initializers for filter callbacks

If new callbacks are added we want to know (warning or error) if some owners
don't handle the new callback.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c4bbf61e711ec32a07557e016692df111c24cb75
---

 modules/stream_out/mosaic_bridge.c   | 2 +-
 modules/stream_out/sdi/SDIStream.cpp | 2 +-
 modules/stream_out/transcode/video.c | 2 +-
 modules/video_filter/ci_filters.m    | 2 +-
 modules/video_filter/edgedetection.c | 2 +-
 src/misc/filter_chain.c              | 2 +-
 src/misc/image.c                     | 2 +-
 src/video_output/display.c           | 2 +-
 src/video_output/video_output.c      | 6 +++---
 src/video_output/vout_subpictures.c  | 4 ++--
 10 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/modules/stream_out/mosaic_bridge.c b/modules/stream_out/mosaic_bridge.c
index d7eab648d2..4f9210ed61 100644
--- a/modules/stream_out/mosaic_bridge.c
+++ b/modules/stream_out/mosaic_bridge.c
@@ -382,7 +382,7 @@ static void *Add( sout_stream_t *p_stream, const es_format_t *p_fmt )
     /* Create user specified video filters */
     static const struct filter_video_callbacks cbs =
     {
-        .buffer_new = video_new_buffer_filter,
+        video_new_buffer_filter,
     };
 
     psz_chain = var_GetNonEmptyString( p_stream, CFG_PREFIX "vfilter" );
diff --git a/modules/stream_out/sdi/SDIStream.cpp b/modules/stream_out/sdi/SDIStream.cpp
index 4845466a1a..25c5aa8d0e 100644
--- a/modules/stream_out/sdi/SDIStream.cpp
+++ b/modules/stream_out/sdi/SDIStream.cpp
@@ -502,7 +502,7 @@ static picture_t *transcode_video_filter_buffer_new(filter_t *p_filter)
 
 static const struct filter_video_callbacks transcode_filter_video_cbs =
 {
-    .buffer_new = transcode_video_filter_buffer_new,
+    transcode_video_filter_buffer_new,
 };
 
 filter_chain_t * VideoDecodedStream::VideoFilterCreate(const es_format_t *p_srcfmt)
diff --git a/modules/stream_out/transcode/video.c b/modules/stream_out/transcode/video.c
index cc47b5e4c8..4cb139c9b5 100644
--- a/modules/stream_out/transcode/video.c
+++ b/modules/stream_out/transcode/video.c
@@ -215,7 +215,7 @@ int transcode_video_init( sout_stream_t *p_stream, const es_format_t *p_fmt,
 
 static const struct filter_video_callbacks transcode_filter_video_cbs =
 {
-    .buffer_new = transcode_video_filter_buffer_new,
+    transcode_video_filter_buffer_new,
 };
 
 static void transcode_video_filter_init( sout_stream_t *p_stream,
diff --git a/modules/video_filter/ci_filters.m b/modules/video_filter/ci_filters.m
index 8511858aec..fcb5db861e 100644
--- a/modules/video_filter/ci_filters.m
+++ b/modules/video_filter/ci_filters.m
@@ -547,7 +547,7 @@ static picture_t *CVPX_to_CVPX_converter_BufferNew(filter_t *p_filter)
 
 static const struct filter_video_callbacks image_filter_cbs =
 {
-    .buffer_new = CVPX_to_CVPX_converter_BufferNew,
+    CVPX_to_CVPX_converter_BufferNew,
 };
 
 static filter_t *
diff --git a/modules/video_filter/edgedetection.c b/modules/video_filter/edgedetection.c
index f35dc5c2f1..e9ed9c7380 100644
--- a/modules/video_filter/edgedetection.c
+++ b/modules/video_filter/edgedetection.c
@@ -79,7 +79,7 @@ vlc_module_end ()
 
 static const struct filter_video_callbacks filter_video_edge_cbs =
 {
-    .buffer_new = new_frame,
+    new_frame,
 };
 
 /*****************************************************************************
diff --git a/src/misc/filter_chain.c b/src/misc/filter_chain.c
index 89b499d26a..75e103af6d 100644
--- a/src/misc/filter_chain.c
+++ b/src/misc/filter_chain.c
@@ -131,7 +131,7 @@ static picture_t *filter_chain_VideoBufferNew( filter_t *filter )
 
 static const struct filter_video_callbacks filter_chain_video_cbs =
 {
-    .buffer_new = filter_chain_VideoBufferNew,
+    filter_chain_VideoBufferNew,
 };
 
 #undef filter_chain_NewVideo
diff --git a/src/misc/image.c b/src/misc/image.c
index 976e30dde0..9d86cbc536 100644
--- a/src/misc/image.c
+++ b/src/misc/image.c
@@ -786,7 +786,7 @@ static picture_t *filter_new_picture( filter_t *p_filter )
 
 static const struct filter_video_callbacks image_filter_cbs =
 {
-    .buffer_new = filter_new_picture,
+    filter_new_picture,
 };
 
 static filter_t *CreateConverter( vlc_object_t *p_this, const es_format_t *p_fmt_in,
diff --git a/src/video_output/display.c b/src/video_output/display.c
index 1b84060d5e..2438e4bb87 100644
--- a/src/video_output/display.c
+++ b/src/video_output/display.c
@@ -299,7 +299,7 @@ typedef struct {
 } vout_display_priv_t;
 
 static const struct filter_video_callbacks vout_display_filter_cbs = {
-    .buffer_new = VideoBufferNew,
+    VideoBufferNew,
 };
 
 static int VoutDisplayCreateRender(vout_display_t *vd)
diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index 073d2b023a..619ccbf194 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -946,7 +946,7 @@ static picture_t *ConvertRGB32AndBlend(vout_thread_t *vout, picture_t *pic,
     assert(vout->p->spu_blend);
 
     static const struct filter_video_callbacks cbs = {
-        .buffer_new = ConvertRGB32AndBlendBufferNew,
+        ConvertRGB32AndBlendBufferNew,
     };
     filter_owner_t owner = {
         .video = &cbs,
@@ -1458,10 +1458,10 @@ static int vout_Start(vout_thread_t *vout, const vout_configuration_t *cfg)
     video_format_Copy(&sys->filter.format, &sys->original);
 
     static const struct filter_video_callbacks static_cbs = {
-        .buffer_new = VoutVideoFilterStaticNewPicture,
+        VoutVideoFilterStaticNewPicture,
     };
     static const struct filter_video_callbacks interactive_cbs = {
-        .buffer_new = VoutVideoFilterInteractiveNewPicture,
+        VoutVideoFilterInteractiveNewPicture,
     };
     filter_owner_t owner = {
         .video = &static_cbs,
diff --git a/src/video_output/vout_subpictures.c b/src/video_output/vout_subpictures.c
index 2709d3e8a5..23c811e242 100644
--- a/src/video_output/vout_subpictures.c
+++ b/src/video_output/vout_subpictures.c
@@ -252,7 +252,7 @@ static filter_t *SpuRenderCreateAndLoadText(spu_t *spu)
 }
 
 static const struct filter_video_callbacks spu_scaler_cbs = {
-    .buffer_new = spu_new_video_buffer,
+    spu_new_video_buffer,
 };
 
 static filter_t *SpuRenderCreateAndLoadScale(vlc_object_t *object,
@@ -1296,7 +1296,7 @@ static subpicture_t *sub_new_buffer(filter_t *filter)
 }
 
 static const struct filter_subpicture_callbacks sub_cbs = {
-    .buffer_new = sub_new_buffer,
+    sub_new_buffer,
 };
 
 static int SubSourceInit(filter_t *filter, void *data)



More information about the vlc-commits mailing list