[vlc-commits] [Git][videolan/vlc][master] 17 commits: include: move video enums to libvlc_video.h

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Mon Aug 21 09:52:16 UTC 2023



Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC


Commits:
6a481ceb by Alexandre Janniaux at 2023-08-21T09:37:13+00:00
include: move video enums to libvlc_video.h

- - - - -
29c9709a by Alexandre Janniaux at 2023-08-21T09:37:13+00:00
include: add missing types for libvlc_media_player.h

Otherwise, the header cannot be included as a standalone header.

- - - - -
1a9da912 by Alexandre Janniaux at 2023-08-21T09:37:13+00:00
include: fix missing types for libvlc_events

- - - - -
9f6231b3 by Alexandre Janniaux at 2023-08-21T09:37:13+00:00
include: fix missing types for libvlc_media

- - - - -
22bf21e5 by Alexandre Janniaux at 2023-08-21T09:37:13+00:00
include: fix missing type for libvlc_media_discoverer

- - - - -
dae57d2b by Alexandre Janniaux at 2023-08-21T09:37:13+00:00
include: fix missing type for libvlc_media_list

- - - - -
6fcbb414 by Alexandre Janniaux at 2023-08-21T09:37:13+00:00
include: fix missing type for libvlc_media_list_player

- - - - -
94277277 by Alexandre Janniaux at 2023-08-21T09:37:13+00:00
include: deprecated: forward-declare media player

- - - - -
a89ee315 by Alexandre Janniaux at 2023-08-21T09:37:13+00:00
test: Makefile.am: remove unused verbose flag

The $(extra_check_verbose_0) was missing a semi-colon at the end since
the commit 53f6d534117da9d35f5649c1d59e44c71953ae7c introducing it, so
it was probably never used nor tested.

- - - - -
52e1c72c by Alexandre Janniaux at 2023-08-21T09:37:13+00:00
lib: add header inclusion build test

The tests are not run and are only compiled to object, without linkage.
It's pretty fast, and would help noticing when a forward declaration or
an include is missing from one of the files.

- - - - -
8c490c48 by Alexandre Janniaux at 2023-08-21T09:37:13+00:00
vlc_objects: add include-guard for vlc_objects

- - - - -
5003ec6b by Alexandre Janniaux at 2023-08-21T09:37:13+00:00
include: vlc_objects: use extern "C" on vlc_object

To avoid creating constructors with C++ linkage.

- - - - -
256f8553 by Alexandre Janniaux at 2023-08-21T09:37:13+00:00
vlc_opengl_filter: include vlc_es.h

video_format_t is defined in vlc_es.h and is used by the header.

- - - - -
b03fe3f1 by Alexandre Janniaux at 2023-08-21T09:37:13+00:00
vlc_opengl_interop: forward-declare vlc_gl_t

vlc_gl_t is referenced by the vlc_gl_interop structure, but only as a
pointer. Avoid including <vlc_opengl.h> and provides a forward-reference.

- - - - -
661c52a3 by Alexandre Janniaux at 2023-08-21T09:37:13+00:00
vlc_timestamp_helper: include <vlc_tick.h>

vlc_tick_t is used here and cannot be forward-declared.

- - - - -
f2fbf053 by Alexandre Janniaux at 2023-08-21T09:37:13+00:00
vlc_vout_osd: include <vlc_tick.h>

vlc_tick_t is used here and cannot be forward-declared.

- - - - -
40c3b376 by Alexandre Janniaux at 2023-08-21T09:37:13+00:00
src: Makefile.am: check vlc plugins headers

- - - - -


18 changed files:

- include/meson.build
- include/vlc/deprecated.h
- include/vlc/libvlc_events.h
- include/vlc/libvlc_media.h
- include/vlc/libvlc_media_discoverer.h
- include/vlc/libvlc_media_list.h
- include/vlc/libvlc_media_list_player.h
- include/vlc/libvlc_media_player.h
- include/vlc/libvlc_media_track.h
- + include/vlc/libvlc_video.h
- include/vlc_objects.h
- include/vlc_opengl_filter.h
- include/vlc_opengl_interop.h
- include/vlc_timestamp_helper.h
- include/vlc_vout_osd.h
- lib/Makefile.am
- src/Makefile.am
- test/Makefile.am


Changes:

=====================================
include/meson.build
=====================================
@@ -14,6 +14,7 @@ install_headers(
     'vlc/libvlc_renderer_discoverer.h',
     'vlc/deprecated.h',
     'vlc/libvlc_version.h',
+    'vlc/libvlc_video.h',
     subdir: 'vlc')
 
 # Install VLC plugin headers


=====================================
include/vlc/deprecated.h
=====================================
@@ -28,6 +28,8 @@
 extern "C" {
 # endif
 
+typedef struct libvlc_media_player_t libvlc_media_player_t;
+
 /**
  * \ingroup libvlc_media_player
  * @{


=====================================
include/vlc/libvlc_events.h
=====================================
@@ -24,6 +24,11 @@
 #ifndef LIBVLC_EVENTS_H
 #define LIBVLC_EVENTS_H 1
 
+# include <vlc/libvlc.h>
+# include <vlc/libvlc_picture.h>
+# include <vlc/libvlc_media_track.h>
+# include <vlc/libvlc_media.h>
+
 /**
  * \file
  * This file defines libvlc_event external API
@@ -37,6 +42,10 @@ extern "C" {
 
 typedef struct libvlc_renderer_item_t libvlc_renderer_item_t;
 typedef struct libvlc_title_description_t libvlc_title_description_t;
+typedef struct libvlc_picture_t libvlc_picture_t;
+typedef struct libvlc_picture_list_t libvlc_picture_list_t;
+typedef struct libvlc_media_t libvlc_media_t;
+typedef struct libvlc_media_list_t libvlc_media_list_t;
 
 /**
  * \ingroup libvlc_event


=====================================
include/vlc/libvlc_media.h
=====================================
@@ -25,6 +25,7 @@
 #ifndef VLC_LIBVLC_MEDIA_H
 #define VLC_LIBVLC_MEDIA_H 1
 
+#include <vlc/libvlc_picture.h>
 #include <vlc/libvlc_media_track.h>
 
 # ifdef __cplusplus


=====================================
include/vlc/libvlc_media_discoverer.h
=====================================
@@ -29,6 +29,8 @@
 extern "C" {
 # endif
 
+typedef struct libvlc_media_list_t libvlc_media_list_t;
+
 /**
  * Category of a media discoverer
  * \see libvlc_media_discoverer_list_get()


=====================================
include/vlc/libvlc_media_list.h
=====================================
@@ -23,6 +23,8 @@
 #ifndef LIBVLC_MEDIA_LIST_H
 #define LIBVLC_MEDIA_LIST_H 1
 
+typedef struct libvlc_media_t libvlc_media_t;
+
 # ifdef __cplusplus
 extern "C" {
 # endif


=====================================
include/vlc/libvlc_media_list_player.h
=====================================
@@ -23,10 +23,18 @@
 #ifndef LIBVLC_MEDIA_LIST_PLAYER_H
 #define LIBVLC_MEDIA_LIST_PLAYER_H 1
 
+#include <vlc/libvlc.h>
+#include <vlc/libvlc_media.h>
+
 # ifdef __cplusplus
 extern "C" {
 # endif
 
+typedef struct libvlc_instance_t libvlc_instance_t;
+typedef struct libvlc_media_player_t libvlc_media_player_t;
+typedef struct libvlc_media_list_t libvlc_media_list_t;
+typedef struct libvlc_media_t libvlc_media_t;
+
 /** \defgroup libvlc_media_list_player LibVLC media list player
  * \ingroup libvlc
  * The LibVLC media list player plays a @ref libvlc_media_list_t list of media,


=====================================
include/vlc/libvlc_media_player.h
=====================================
@@ -25,12 +25,24 @@
 #ifndef VLC_LIBVLC_MEDIA_PLAYER_H
 #define VLC_LIBVLC_MEDIA_PLAYER_H 1
 
+/* Definitions of enum properties for video */
+#include "libvlc_video.h"
+
 # ifdef __cplusplus
 extern "C" {
 # else
 #  include <stdbool.h>
 # endif
 
+typedef struct libvlc_video_viewpoint_t libvlc_video_viewpoint_t;
+typedef enum libvlc_media_slave_type_t libvlc_media_slave_type_t;
+typedef struct libvlc_media_t libvlc_media_t;
+typedef struct libvlc_media_track_t libvlc_media_track_t;
+typedef struct libvlc_media_tracklist_t libvlc_media_tracklist_t;
+typedef enum libvlc_track_type_t libvlc_track_type_t;
+typedef struct libvlc_renderer_item_t libvlc_renderer_item_t;
+typedef enum libvlc_state_t libvlc_state_t;
+
 /** \defgroup libvlc_media_player LibVLC media player
  * \ingroup libvlc
  * A LibVLC media player plays one media (usually in a custom drawable).


=====================================
include/vlc/libvlc_media_track.h
=====================================
@@ -25,6 +25,8 @@
 #ifndef VLC_LIBVLC_MEDIA_TRACK_H
 #define VLC_LIBVLC_MEDIA_TRACK_H 1
 
+# include "libvlc_video.h"
+
 # ifdef __cplusplus
 extern "C" {
 # else
@@ -53,26 +55,6 @@ typedef struct libvlc_audio_track_t
     unsigned    i_rate;
 } libvlc_audio_track_t;
 
-typedef enum libvlc_video_orient_t
-{
-    libvlc_video_orient_top_left,       /**< Normal. Top line represents top, left column left. */
-    libvlc_video_orient_top_right,      /**< Flipped horizontally */
-    libvlc_video_orient_bottom_left,    /**< Flipped vertically */
-    libvlc_video_orient_bottom_right,   /**< Rotated 180 degrees */
-    libvlc_video_orient_left_top,       /**< Transposed */
-    libvlc_video_orient_left_bottom,    /**< Rotated 90 degrees clockwise (or 270 anti-clockwise) */
-    libvlc_video_orient_right_top,      /**< Rotated 90 degrees anti-clockwise */
-    libvlc_video_orient_right_bottom    /**< Anti-transposed */
-} libvlc_video_orient_t;
-
-typedef enum libvlc_video_projection_t
-{
-    libvlc_video_projection_rectangular,
-    libvlc_video_projection_equirectangular, /**< 360 spherical */
-
-    libvlc_video_projection_cubemap_layout_standard = 0x100,
-} libvlc_video_projection_t;
-
 /**
  * Viewpoint
  *
@@ -86,17 +68,6 @@ typedef struct libvlc_video_viewpoint_t
     float f_field_of_view; /**< field of view in degrees ]0;180[ (default 80.)*/
 } libvlc_video_viewpoint_t;
 
-typedef enum libvlc_video_multiview_t
-{
-    libvlc_video_multiview_2d,                  /**< No stereoscopy: 2D picture. */
-    libvlc_video_multiview_stereo_sbs,          /**< Side-by-side */
-    libvlc_video_multiview_stereo_tb,           /**< Top-bottom */
-    libvlc_video_multiview_stereo_row,          /**< Row sequential */
-    libvlc_video_multiview_stereo_col,          /**< Column sequential */
-    libvlc_video_multiview_stereo_frame,        /**< Frame sequential */
-    libvlc_video_multiview_stereo_checkerboard, /**< Checkerboard pattern */
-} libvlc_video_multiview_t;
-
 typedef struct libvlc_video_track_t
 {
     unsigned    i_height;


=====================================
include/vlc/libvlc_video.h
=====================================
@@ -0,0 +1,67 @@
+/*****************************************************************************
+ * libvlc_video.h: libvlc video-related enumerations
+ *****************************************************************************
+ * Copyright (C) 1998-2010 VLC authors and VideoLAN
+ * Copyright (C) 2023      Videolabs
+ *
+ * Authors: Filippo Carone <littlejohn at videolan.org>
+ *          Pierre d'Herbemont <pdherbemont at videolan.org>
+ *          Alexandre Janniaux <ajanni at videolabs.io>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2.1 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ *****************************************************************************/
+#ifndef VLC_LIBVLC_VIDEO_H
+#define VLC_LIBVLC_VIDEO_H 1
+
+# ifdef __cplusplus
+extern "C"{
+# endif
+
+typedef enum libvlc_video_orient_t
+{
+    libvlc_video_orient_top_left,       /**< Normal. Top line represents top, left column left. */
+    libvlc_video_orient_top_right,      /**< Flipped horizontally */
+    libvlc_video_orient_bottom_left,    /**< Flipped vertically */
+    libvlc_video_orient_bottom_right,   /**< Rotated 180 degrees */
+    libvlc_video_orient_left_top,       /**< Transposed */
+    libvlc_video_orient_left_bottom,    /**< Rotated 90 degrees clockwise (or 270 anti-clockwise) */
+    libvlc_video_orient_right_top,      /**< Rotated 90 degrees anti-clockwise */
+    libvlc_video_orient_right_bottom    /**< Anti-transposed */
+} libvlc_video_orient_t;
+
+typedef enum libvlc_video_projection_t
+{
+    libvlc_video_projection_rectangular,
+    libvlc_video_projection_equirectangular, /**< 360 spherical */
+
+    libvlc_video_projection_cubemap_layout_standard = 0x100,
+} libvlc_video_projection_t;
+
+typedef enum libvlc_video_multiview_t
+{
+    libvlc_video_multiview_2d,                  /**< No stereoscopy: 2D picture. */
+    libvlc_video_multiview_stereo_sbs,          /**< Side-by-side */
+    libvlc_video_multiview_stereo_tb,           /**< Top-bottom */
+    libvlc_video_multiview_stereo_row,          /**< Row sequential */
+    libvlc_video_multiview_stereo_col,          /**< Column sequential */
+    libvlc_video_multiview_stereo_frame,        /**< Frame sequential */
+    libvlc_video_multiview_stereo_checkerboard, /**< Checkerboard pattern */
+} libvlc_video_multiview_t;
+
+# ifdef __cplusplus
+} // extern "C"
+# endif
+
+#endif


=====================================
include/vlc_objects.h
=====================================
@@ -20,6 +20,13 @@
  * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
+#ifndef VLC_OBJECTS_H
+#define VLC_OBJECTS_H 1
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /**
  * \defgroup vlc_object VLC objects
  * \ingroup vlc
@@ -58,6 +65,10 @@ struct vlc_object_t
     bool force;
 };
 
+#ifdef __cplusplus
+}
+#endif
+
 /**
  * Type-safe vlc_object_t cast
  *
@@ -305,3 +316,5 @@ static inline T* vlc_object_create(O *obj)
 
 /** @} */
 /** @} */
+
+#endif


=====================================
include/vlc_opengl_filter.h
=====================================
@@ -26,6 +26,7 @@
 
 #include <vlc_tick.h>
 #include <vlc_ancillary.h>
+#include <vlc_es.h>
 
 struct vlc_gl_filter;
 struct vlc_gl_picture;


=====================================
include/vlc_opengl_interop.h
=====================================
@@ -24,6 +24,7 @@
 #include <vlc_es.h>
 #include <vlc_picture.h>
 
+typedef struct vlc_gl_t vlc_gl_t;
 struct vlc_gl_interop;
 struct vlc_video_context;
 


=====================================
include/vlc_timestamp_helper.h
=====================================
@@ -23,6 +23,8 @@
 #ifndef VLC_TIMESTAMP_H
 #define VLC_TIMESTAMP_H 1
 
+#include <vlc_tick.h>
+
 /* Implementation of a circular buffer of timestamps with overwriting
  * of older values. MediaCodec has only one type of timestamp, if a
  * block has no PTS, we send the DTS instead. Some hardware decoders


=====================================
include/vlc_vout_osd.h
=====================================
@@ -25,6 +25,8 @@
 #ifndef VLC_VOUT_OSD_H
 #define VLC_VOUT_OSD_H 1
 
+#include <vlc_tick.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif


=====================================
lib/Makefile.am
=====================================
@@ -21,6 +21,7 @@ pkginclude_HEADERS = \
 	../include/vlc/libvlc_renderer_discoverer.h \
 	../include/vlc/libvlc_picture.h \
 	../include/vlc/libvlc_version.h \
+	../include/vlc/libvlc_video.h \
 	../include/vlc/vlc.h
 
 lib_LTLIBRARIES = libvlc.la
@@ -103,5 +104,20 @@ libvlc.pc: libvlc.pc.in $(top_builddir)/config.status
 libvlc_win32_rc.$(OBJEXT): libvlc_win32_rc.rc $(top_srcdir)/extras/package/win32/libvlc.dll.manifest
 	$(WINDRES) --include-dir $(top_srcdir)/share --include-dir $(top_srcdir)/extras/package/win32 -i $< -o $@
 
+checkheader_verbose = $(checkheader_verbose_$(V))
+checkheader_verbose_ = $(checkheader_verbose_$(AM_DEFAULT_VERBOSITY))
+checkheader_verbose_0 = @echo "  CHECK  $(@:checkheader_%_h=vlc/%.h)";
+checkheader_verbose__0 = $(checkheader_verbose_0)
+nodist_check_SCRIPTS = $(pkginclude_HEADERS:../include/vlc/%.h=checkheader_%_h)
+MOSTLYCLEANFILES = \
+	$(pkginclude_HEADERS:../include/vlc/%.h=checkheader_%_h.c) \
+	$(pkginclude_HEADERS:../include/vlc/%.h=checkheader_%_h.lo)
+
+checkheader_%_h:
+	@echo "#include <stdbool.h>" > $@.c
+	@echo "#include <vlc/libvlc.h>" >> $@.c
+	@echo "#include <vlc/$*.h>" >> $@.c
+	$(checkheader_verbose)$(LTCOMPILE) -c $@.c -o $@.lo
+
 check-local:
 	$(SHELL) $(top_srcdir)/src/check_headers $(pkginclude_HEADERS)


=====================================
src/Makefile.am
=====================================
@@ -714,6 +714,24 @@ stamp-revision:
 # Unit/regression test
 ###############################################################################
 
+checkheader_verbose = $(checkheader_verbose_$(V))
+checkheader_verbose_ = $(checkheader_verbose_$(AM_DEFAULT_VERBOSITY))
+checkheader_verbose_0 = @echo "  CHECK  $(@:checkheader_%_h=%.h)";
+checkheader_verbose__0 = $(checkheader_verbose_0)
+nodist_check_SCRIPTS = $(pluginsinclude_HEADERS:../include/%.h=checkheader_%_h)
+MOSTLYCLEANFILES += \
+	$(pluginsinclude_HEADERS:../include/%.h=checkheader_%_h.c) \
+	$(pluginsinclude_HEADERS:../include/%.h=checkheader_%_h.lo)
+
+checkheader_%_h:
+	@echo "#include <stdbool.h>" > $@.c
+	@echo "#include <vlc_common.h>" >> $@.c
+	@echo "#include <$*.h>" >> $@.c
+	$(checkheader_verbose)$(LTCOMPILE) $(CHECK_CFLAGS) -c $@.c -o $@.lo
+
+# Some exceptions for headers depending on other libraries
+checkheader_vlc_gcrypt_h: CHECK_CFLAGS = "-Dgcry_check_version(x)="
+
 dist_check_SCRIPTS = check_headers check_symbols
 
 check-local:


=====================================
test/Makefile.am
=====================================
@@ -4,11 +4,6 @@
 
 AUTOMAKE_OPTIONS = subdir-objects
 
-extra_check_verbose = $(extra_check_verbose_$(V))
-extra_check_verbose_ = $(extra_check_flags__$(AM_DEFAULT_VERBOSITY))
-extra_check_verbose_0 = @echo TEST $@
-extra_check_verbose__0 = $(extra_check_verbose_0)
-
 ###############################################################################
 # Unit/regression test
 ###############################################################################



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/a309fb4c10f238bb2319abe9ec489daa0c91521c...40c3b3760a831a92b44c03d4688bea735975738a

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/a309fb4c10f238bb2319abe9ec489daa0c91521c...40c3b3760a831a92b44c03d4688bea735975738a
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