[vlc-commits] [Git][videolan/vlc][master] 6 commits: include: avoid including vlc_subpicture.h when not needed

Steve Lhomme (@robUx4) gitlab at videolan.org
Thu Aug 17 12:53:28 UTC 2023



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
1243a6c0 by Steve Lhomme at 2023-08-17T12:22:24+00:00
include: avoid including vlc_subpicture.h when not needed

We should not rebuild a lot of Qt files when changing the subpictures.

It's still included in vlc_codec.h so all encoders/decoders are still
impacted by such changes.

- - - - -
23c53f89 by Steve Lhomme at 2023-08-17T12:22:24+00:00
filter: failure to create an object is unlikely

- - - - -
25bea940 by Steve Lhomme at 2023-08-17T12:22:24+00:00
video_output: make the blender creation failure as unlikely

It's only allocating memory.

- - - - -
7d871144 by Steve Lhomme at 2023-08-17T12:22:24+00:00
vout/display: rename callback that provides converter output pictures

- - - - -
95ee779a by Steve Lhomme at 2023-08-17T12:22:24+00:00
vout/display: compute the default display size with unsigned integers

- - - - -
e67614a9 by Steve Lhomme at 2023-08-17T12:22:24+00:00
display: initialize variable with VLC_SUCCESS

To be more coherent with the test.

Also fix indentation after 90866ec879482aeed431038b165929f7057b1183.

- - - - -


19 changed files:

- include/vlc_decoder.h
- include/vlc_spu.h
- include/vlc_vout.h
- include/vlc_vout_display.h
- lib/media_player.c
- modules/access/bluray.c
- modules/access/dvdnav.c
- modules/demux/mkv/events.cpp
- modules/lua/libs/osd.c
- modules/video_output/android/display.c
- modules/video_output/libplacebo/display.c
- modules/video_output/xcb/render.c
- src/input/es_out_timeshift.c
- src/misc/filter.c
- src/video_output/display.c
- src/video_output/video_output.c
- src/video_output/video_text.c
- src/video_output/vout_internal.h
- src/video_output/vout_intf.c


Changes:

=====================================
include/vlc_decoder.h
=====================================
@@ -29,9 +29,10 @@
  * @{
  */
 
-#include <vlc_subpicture.h>
+#include <vlc_tick.h>
 
 typedef struct vlc_input_decoder_t vlc_input_decoder_t;
+typedef struct vlc_spu_highlight_t vlc_spu_highlight_t;
 
 /**
  * This defines an opaque input resource handler.


=====================================
include/vlc_spu.h
=====================================
@@ -25,7 +25,8 @@
 #ifndef VLC_SPU_H
 #define VLC_SPU_H 1
 
-#include <vlc_subpicture.h>
+#include <vlc_common.h>
+#include <vlc_tick.h>
 
 #ifdef __cplusplus
 extern "C" {


=====================================
include/vlc_vout.h
=====================================
@@ -27,7 +27,6 @@
 
 #include <vlc_es.h>
 #include <vlc_picture.h>
-#include <vlc_subpicture.h>
 
 /**
  * \defgroup output Output


=====================================
include/vlc_vout_display.h
=====================================
@@ -25,7 +25,6 @@
 
 #include <vlc_es.h>
 #include <vlc_picture.h>
-#include <vlc_subpicture.h>
 #include <vlc_mouse.h>
 #include <vlc_vout.h>
 #include <vlc_window.h>


=====================================
lib/media_player.c
=====================================
@@ -35,6 +35,7 @@
 #include <vlc_demux.h>
 #include <vlc_vout.h>
 #include <vlc_aout.h>
+#include <vlc_subpicture.h>
 #include <vlc_actions.h>
 #include <vlc_modules.h>
 


=====================================
modules/access/bluray.c
=====================================
@@ -51,6 +51,7 @@
 #include <vlc_url.h>                        /* vlc_path2uri */
 #include <vlc_iso_lang.h>
 #include <vlc_fs.h>
+#include <vlc_subpicture.h> // vlc_spu_highlight_t
 
 #include "../demux/mpeg/timestamps.h"
 #include "../demux/timestamps_filter.h"


=====================================
modules/access/dvdnav.c
=====================================
@@ -54,6 +54,7 @@
 #include <vlc_mouse.h>
 #include <vlc_dialog.h>
 #include <vlc_iso_lang.h>
+#include <vlc_subpicture.h> // vlc_spu_highlight_t
 
 #include <dvdnav/dvdnav.h>
 /* Expose without patching headers */


=====================================
modules/demux/mkv/events.cpp
=====================================
@@ -27,6 +27,7 @@
 
 #include <vlc_actions.h>
 #include <vlc_threads.h>
+#include <vlc_subpicture.h> // vlc_spu_highlight_t
 
 #include <algorithm>
 


=====================================
modules/lua/libs/osd.c
=====================================
@@ -33,6 +33,7 @@
 
 #include <vlc_vout.h>
 #include <vlc_vout_osd.h>
+#include <vlc_subpicture.h>
 
 #include "../vlc.h"
 #include "../libs.h"


=====================================
modules/video_output/android/display.c
=====================================
@@ -32,6 +32,7 @@
 #include <vlc_threads.h>
 #include <vlc_plugin.h>
 #include <vlc_vout_display.h>
+#include <vlc_subpicture.h>
 
 #include <vlc_vector.h>
 #include <vlc_opengl.h>


=====================================
modules/video_output/libplacebo/display.c
=====================================
@@ -31,6 +31,7 @@
 #include <vlc_plugin.h>
 #include <vlc_vout_display.h>
 #include <vlc_fs.h>
+#include <vlc_subpicture.h>
 
 #include "utils.h"
 #include "instance.h"


=====================================
modules/video_output/xcb/render.c
=====================================
@@ -39,6 +39,7 @@
 #include <vlc_fs.h>
 #include <vlc_plugin.h>
 #include <vlc_vout_display.h>
+#include <vlc_subpicture.h>
 
 #include "pictures.h"
 #include "events.h"


=====================================
src/input/es_out_timeshift.c
=====================================
@@ -43,6 +43,7 @@
 #include <vlc_mouse.h>
 #include <vlc_es_out.h>
 #include <vlc_block.h>
+#include <vlc_subpicture.h> // vlc_spu_highlight_t
 #include "input_internal.h"
 #ifdef _WIN32
 #  include <vlc_charset.h> // FromWide


=====================================
src/misc/filter.c
=====================================
@@ -106,7 +106,7 @@ vlc_blender_t *filter_NewBlend( vlc_object_t *p_this,
                            const video_format_t *p_dst_chroma )
 {
     vlc_blender_t *p_blend = vlc_custom_create( p_this, sizeof(*p_blend), "blend" );
-    if( !p_blend )
+    if( unlikely( p_blend == NULL ) )
         return NULL;
 
     es_format_Init( &p_blend->fmt_in, VIDEO_ES, 0 );


=====================================
src/video_output/display.c
=====================================
@@ -59,11 +59,11 @@ void vout_display_GetDefaultDisplaySize(unsigned *width, unsigned *height,
 {
     /* Use the original video size */
     if (source->i_sar_num >= source->i_sar_den) {
-        *width  = (int64_t)source->i_visible_width * source->i_sar_num * dp->sar.den / source->i_sar_den / dp->sar.num;
+        *width  = (uint64_t)source->i_visible_width * source->i_sar_num * dp->sar.den / source->i_sar_den / dp->sar.num;
         *height = source->i_visible_height;
     } else {
         *width  = source->i_visible_width;
-        *height = (int64_t)source->i_visible_height * source->i_sar_den * dp->sar.num / source->i_sar_num / dp->sar.den;
+        *height = (uint64_t)source->i_visible_height * source->i_sar_den * dp->sar.num / source->i_sar_num / dp->sar.den;
     }
 
     *width  = *width  * dp->zoom.num / dp->zoom.den;
@@ -249,7 +249,7 @@ typedef struct {
 /*****************************************************************************
  * FIXME/TODO see how to have direct rendering here (interact with vout.c)
  *****************************************************************************/
-static picture_t *VideoBufferNew(filter_t *filter)
+static picture_t *SourceConverterBuffer(filter_t *filter)
 {
     vout_display_t *vd = filter->owner.sys;
     vout_display_priv_t *osys = container_of(vd, vout_display_priv_t, display);
@@ -271,7 +271,7 @@ static vlc_decoder_device * DisplayHoldDecoderDevice(vlc_object_t *o, void *sys)
 }
 
 static const struct filter_video_callbacks vout_display_filter_cbs = {
-    VideoBufferNew, DisplayHoldDecoderDevice,
+    SourceConverterBuffer, DisplayHoldDecoderDevice,
 };
 
 static int VoutDisplayCreateRender(vout_display_t *vd)
@@ -500,7 +500,7 @@ void VoutFixFormatAR(video_format_t *fmt)
 void vout_UpdateDisplaySourceProperties(vout_display_t *vd, const video_format_t *source, const vlc_rational_t *forced_dar)
 {
     vout_display_priv_t *osys = container_of(vd, vout_display_priv_t, display);
-    int err1 = 0, err2 = 0;
+    int err1 = VLC_SUCCESS, err2 = VLC_SUCCESS;
 
     video_format_t fixed_src = *source;
     VoutFixFormatAR( &fixed_src );
@@ -508,11 +508,11 @@ void vout_UpdateDisplaySourceProperties(vout_display_t *vd, const video_format_t
         fixed_src.i_sar_den * osys->source.i_sar_num) {
 
         if (forced_dar->num == 0) {
-        osys->source.i_sar_num = fixed_src.i_sar_num;
-        osys->source.i_sar_den = fixed_src.i_sar_den;
+            osys->source.i_sar_num = fixed_src.i_sar_num;
+            osys->source.i_sar_den = fixed_src.i_sar_den;
 
-        err1 = vout_SetSourceAspect(vd, osys->source.i_sar_num,
-                                    osys->source.i_sar_den);
+            err1 = vout_SetSourceAspect(vd, osys->source.i_sar_num,
+                                        osys->source.i_sar_den);
         }
     }
     if (source->i_x_offset       != osys->source.i_x_offset ||


=====================================
src/video_output/video_output.c
=====================================
@@ -1173,7 +1173,7 @@ static int PrerenderPicture(vout_thread_sys_t *sys, picture_t *filtered,
         }
         if (!sys->spu_blend) {
             sys->spu_blend = filter_NewBlend(VLC_OBJECT(&sys->obj), &fmt_spu);
-            if (!sys->spu_blend)
+            if (unlikely(sys->spu_blend == NULL))
                 msg_Err(&sys->obj, "Failed to create blending filter, OSD/Subtitles will not work");
         }
     }


=====================================
src/video_output/video_text.c
=====================================
@@ -30,6 +30,7 @@
 #include <vlc_threads.h>
 #include <vlc_vout.h>
 #include <vlc_vout_osd.h>
+#include <vlc_subpicture.h>
 
 typedef struct {
     int  position;


=====================================
src/video_output/vout_internal.h
=====================================
@@ -28,6 +28,7 @@
 #include <vlc_clock.h>
 
 typedef struct input_thread_t input_thread_t;
+typedef struct vlc_spu_highlight_t vlc_spu_highlight_t;
 
 /**
  * Vout configuration


=====================================
src/video_output/vout_intf.c
=====================================
@@ -42,6 +42,7 @@
 #include <vlc_strings.h>
 #include <vlc_charset.h>
 #include <vlc_spu.h>
+#include <vlc_subpicture.h>
 #include "vout_internal.h"
 #include "snapshot.h"
 



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/a3754810b925d4109e518d136edf91cfc2b0f2e3...e67614a99a8f6e75eabcabd2103cee9f46a54245

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/a3754810b925d4109e518d136edf91cfc2b0f2e3...e67614a99a8f6e75eabcabd2103cee9f46a54245
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list