[libdvdnav-devel] [Git][videolan/libdvdnav][master] Use symbol visibility attributes

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Thu Aug 28 08:38:00 UTC 2025



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


Commits:
1ebcbb3a by robxnano at 2025-08-27T07:36:26+01:00
Use symbol visibility attributes

- - - - -


6 changed files:

- Makefile.am
- configure.ac
- src/dvdnav/dvdnav.h
- src/dvdnav_internal.h
- src/logger.h
- src/read_cache.h


Changes:

=====================================
Makefile.am
=====================================
@@ -40,8 +40,7 @@ libdvdnav_la_SOURCES = \
 	src/vm/vmcmd.h
 
 libdvdnav_la_LDFLAGS = \
-	-version-info $(DVDNAV_LT_CURRENT):$(DVDNAV_LT_REVISION):$(DVDNAV_LT_AGE) \
-	-export-symbols-regex "^dvdnav"
+	-version-info $(DVDNAV_LT_CURRENT):$(DVDNAV_LT_REVISION):$(DVDNAV_LT_AGE)
 libdvdnav_la_LIBADD = $(THREAD_LIBS) $(DVDREAD_LIBS)
 
 pkgincludedir = $(includedir)/dvdnav


=====================================
configure.ac
=====================================
@@ -107,6 +107,12 @@ CC_CHECK_CFLAG_APPEND([-mno-ms-bitfields])
 dnl check for -Wall -Wextra support
 CC_CHECK_CFLAG_APPEND([-Wall -Wsign-compare -Wextra])
 
+dnl ---------------------------------------------
+dnl Check for symbol visibility flag
+dnl ---------------------------------------------
+CC_CHECK_CFLAGS_APPEND([-fvisibility=hidden])
+CPPFLAGS="${CPPFLAGS} -DDVDNAV_API_EXPORT"
+
 dnl ---------------------------------------------
 dnl Check for doxygen (dynamic documentation generator)
 dnl ---------------------------------------------


=====================================
src/dvdnav/dvdnav.h
=====================================
@@ -30,6 +30,16 @@
 extern "C" {
 #endif
 
+#ifdef DVDNAV_API_EXPORT
+#  if defined(_WIN32)
+#    define DVDNAV_API  __declspec(dllexport)
+#  elif defined(__GNUC__) && __GNUC__ >= 4
+#    define DVDNAV_API  __attribute__((visibility("default")))
+#  endif
+#else
+#  define DVDNAV_API
+#endif
+
 #include "version.h"
 #include <dvdnav/dvd_types.h>
 #include <dvdread/dvd_reader.h>
@@ -99,44 +109,44 @@ typedef struct
  *
  * The resulting dvdnav_t handle will be written to *dest.
  */
-dvdnav_status_t dvdnav_open(dvdnav_t **dest, const char *path);
-dvdnav_status_t
+DVDNAV_API dvdnav_status_t dvdnav_open(dvdnav_t **dest, const char *path);
+DVDNAV_API dvdnav_status_t
 dvdnav_open_stream(dvdnav_t **dest, void *priv, dvdnav_stream_cb *stream_cb);
 
-dvdnav_status_t dvdnav_open2(dvdnav_t **dest,
+DVDNAV_API dvdnav_status_t dvdnav_open2(dvdnav_t **dest,
                              void *, const dvdnav_logger_cb *,
                              const char *path);
-dvdnav_status_t dvdnav_open_stream2(dvdnav_t **dest,
+DVDNAV_API dvdnav_status_t dvdnav_open_stream2(dvdnav_t **dest,
                                     void *priv, const dvdnav_logger_cb *,
                                     dvdnav_stream_cb *stream_cb);
 
-dvdnav_status_t dvdnav_dup(dvdnav_t **dest, dvdnav_t *src);
-dvdnav_status_t dvdnav_free_dup(dvdnav_t * _this);
+DVDNAV_API dvdnav_status_t dvdnav_dup(dvdnav_t **dest, dvdnav_t *src);
+DVDNAV_API dvdnav_status_t dvdnav_free_dup(dvdnav_t * _this);
 
 /*
  * Closes a dvdnav_t previously opened with dvdnav_open(), freeing any
  * memory associated with it.
  */
-dvdnav_status_t dvdnav_close(dvdnav_t *self);
+DVDNAV_API dvdnav_status_t dvdnav_close(dvdnav_t *self);
 
 /*
  * Resets the DVD virtual machine and cache buffers.
  */
-dvdnav_status_t dvdnav_reset(dvdnav_t *self);
+DVDNAV_API dvdnav_status_t dvdnav_reset(dvdnav_t *self);
 
 /*
  * Fills a pointer with a value pointing to a string describing
  * the path associated with an open dvdnav_t. It assigns *path to NULL
  * on error.
  */
-dvdnav_status_t dvdnav_path(dvdnav_t *self, const char **path);
+DVDNAV_API dvdnav_status_t dvdnav_path(dvdnav_t *self, const char **path);
 
 /*
  * Returns a human-readable string describing the last error.
  */
-const char* dvdnav_err_to_string(dvdnav_t *self);
+DVDNAV_API const char* dvdnav_err_to_string(dvdnav_t *self);
 
-const char* dvdnav_version(void);
+DVDNAV_API const char* dvdnav_version(void);
 
 /*********************************************************************
  * changing and reading DVD player characteristics                   *
@@ -155,7 +165,7 @@ const char* dvdnav_version(void);
  *
  * This has _nothing_ to do with the region setting of the DVD drive.
  */
-dvdnav_status_t dvdnav_set_region_mask(dvdnav_t *self, int32_t region_mask);
+DVDNAV_API dvdnav_status_t dvdnav_set_region_mask(dvdnav_t *self, int32_t region_mask);
 
 /*
  * Returns the region mask (bit 0 set implies region 1, bit 1 set implies
@@ -163,7 +173,7 @@ dvdnav_status_t dvdnav_set_region_mask(dvdnav_t *self, int32_t region_mask);
  *
  * This has _nothing_ to do with the region setting of the DVD drive.
  */
-dvdnav_status_t dvdnav_get_region_mask(dvdnav_t *self, int32_t *region_mask);
+DVDNAV_API dvdnav_status_t dvdnav_get_region_mask(dvdnav_t *self, int32_t *region_mask);
 
 /*
  * Specify whether read-ahead caching should be used. You may not want this if your
@@ -178,12 +188,12 @@ dvdnav_status_t dvdnav_get_region_mask(dvdnav_t *self, int32_t *region_mask);
  * If in addition you want to prevent memcpy's to improve performance, have a look
  * at dvdnav_get_next_cache_block().
  */
-dvdnav_status_t dvdnav_set_readahead_flag(dvdnav_t *self, int32_t read_ahead_flag);
+DVDNAV_API dvdnav_status_t dvdnav_set_readahead_flag(dvdnav_t *self, int32_t read_ahead_flag);
 
 /*
  * Query whether read-ahead caching/buffering will be used.
  */
-dvdnav_status_t dvdnav_get_readahead_flag(dvdnav_t *self, int32_t *read_ahead_flag);
+DVDNAV_API dvdnav_status_t dvdnav_get_readahead_flag(dvdnav_t *self, int32_t *read_ahead_flag);
 
 /*
  * Specify whether the positioning works PGC or PG based.
@@ -192,12 +202,12 @@ dvdnav_status_t dvdnav_get_readahead_flag(dvdnav_t *self, int32_t *read_ahead_fl
  * functions dvdnav_get_position() and dvdnav_sector_search(). See there.
  * Default is PG based positioning.
  */
-dvdnav_status_t dvdnav_set_PGC_positioning_flag(dvdnav_t *self, int32_t pgc_based_flag);
+DVDNAV_API dvdnav_status_t dvdnav_set_PGC_positioning_flag(dvdnav_t *self, int32_t pgc_based_flag);
 
 /*
  * Query whether positioning is PG or PGC based.
  */
-dvdnav_status_t dvdnav_get_PGC_positioning_flag(dvdnav_t *self, int32_t *pgc_based_flag);
+DVDNAV_API dvdnav_status_t dvdnav_get_PGC_positioning_flag(dvdnav_t *self, int32_t *pgc_based_flag);
 
 
 /*********************************************************************
@@ -223,7 +233,7 @@ dvdnav_status_t dvdnav_get_PGC_positioning_flag(dvdnav_t *self, int32_t *pgc_bas
  *
  * See the dvdnav_events.h header for information on the various events.
  */
-dvdnav_status_t dvdnav_get_next_block(dvdnav_t *self, uint8_t *buf,
+DVDNAV_API dvdnav_status_t dvdnav_get_next_block(dvdnav_t *self, uint8_t *buf,
                                       int32_t *event, int32_t *len);
 
 /*
@@ -234,7 +244,7 @@ dvdnav_status_t dvdnav_get_next_block(dvdnav_t *self, uint8_t *buf,
  * Those pointers must _never_ be freed but instead returned to the library via
  * dvdnav_free_cache_block().
  */
-dvdnav_status_t dvdnav_get_next_cache_block(dvdnav_t *self, uint8_t **buf,
+DVDNAV_API dvdnav_status_t dvdnav_get_next_cache_block(dvdnav_t *self, uint8_t **buf,
                                             int32_t *event, int32_t *len);
 
 /*
@@ -242,14 +252,14 @@ dvdnav_status_t dvdnav_get_next_cache_block(dvdnav_t *self, uint8_t **buf,
  * returned a buffer different from the one handed in) have to be freed with this
  * function. Although handing in other buffers not from the cache doesn't cause any harm.
  */
-dvdnav_status_t dvdnav_free_cache_block(dvdnav_t *self, unsigned char *buf);
+DVDNAV_API dvdnav_status_t dvdnav_free_cache_block(dvdnav_t *self, unsigned char *buf);
 
 /*
  * If we are currently in a still-frame this function skips it.
  *
  * See also the DVDNAV_STILL_FRAME event.
  */
-dvdnav_status_t dvdnav_still_skip(dvdnav_t *self);
+DVDNAV_API dvdnav_status_t dvdnav_still_skip(dvdnav_t *self);
 
 /*
  * If we are currently in WAIT state, that is: the application is required to
@@ -258,7 +268,7 @@ dvdnav_status_t dvdnav_still_skip(dvdnav_t *self);
  *
  * See also the DVDNAV_WAIT event.
  */
-dvdnav_status_t dvdnav_wait_skip(dvdnav_t *self);
+DVDNAV_API dvdnav_status_t dvdnav_wait_skip(dvdnav_t *self);
 
 /*
  * Returns the still time from the currently playing cell.
@@ -268,7 +278,7 @@ dvdnav_status_t dvdnav_wait_skip(dvdnav_t *self);
  * Some players might need this to prepare for a frame to be shown for a
  * longer time than usual.
  */
-uint32_t dvdnav_get_next_still_flag(dvdnav_t *self);
+DVDNAV_API uint32_t dvdnav_get_next_still_flag(dvdnav_t *self);
 
 /*
  * Stops playback. The next event obtained with one of the get_next_block
@@ -276,7 +286,7 @@ uint32_t dvdnav_get_next_still_flag(dvdnav_t *self);
  *
  * It is not required to call this before dvdnav_close().
  */
-dvdnav_status_t dvdnav_stop(dvdnav_t *self);
+DVDNAV_API dvdnav_status_t dvdnav_stop(dvdnav_t *self);
 
 /*
  * Returns the region mask (bit 0 set implies region 1, bit 1 set implies
@@ -290,7 +300,7 @@ dvdnav_status_t dvdnav_stop(dvdnav_t *self);
  * as RCE is handled internally by the drive firmware.
  *
  */
-dvdnav_status_t dvdnav_get_disk_region_mask(dvdnav_t *self, int32_t *region_mask);
+DVDNAV_API dvdnav_status_t dvdnav_get_disk_region_mask(dvdnav_t *self, int32_t *region_mask);
 
 /*********************************************************************
  * title/part navigation                                             *
@@ -299,32 +309,32 @@ dvdnav_status_t dvdnav_get_disk_region_mask(dvdnav_t *self, int32_t *region_mask
 /*
  * Returns the number of titles on the disk.
  */
-dvdnav_status_t dvdnav_get_number_of_titles(dvdnav_t *self, int32_t *titles);
+DVDNAV_API dvdnav_status_t dvdnav_get_number_of_titles(dvdnav_t *self, int32_t *titles);
 
 /*
  * Returns the number of parts within the given title.
  */
-dvdnav_status_t dvdnav_get_number_of_parts(dvdnav_t *self, int32_t title, int32_t *parts);
+DVDNAV_API dvdnav_status_t dvdnav_get_number_of_parts(dvdnav_t *self, int32_t title, int32_t *parts);
 
 /*
  * Returns the number of angles for the given title.
  */
-dvdnav_status_t dvdnav_get_number_of_angles(dvdnav_t *self, int32_t title, int32_t *angles);
+DVDNAV_API dvdnav_status_t dvdnav_get_number_of_angles(dvdnav_t *self, int32_t title, int32_t *angles);
 
 /*
  * Plays the specified title of the DVD from its beginning (that is: part 1).
  */
-dvdnav_status_t dvdnav_title_play(dvdnav_t *self, int32_t title);
+DVDNAV_API dvdnav_status_t dvdnav_title_play(dvdnav_t *self, int32_t title);
 
 /*
  * Plays the specified title, starting from the specified part.
  */
-dvdnav_status_t dvdnav_part_play(dvdnav_t *self, int32_t title, int32_t part);
+DVDNAV_API dvdnav_status_t dvdnav_part_play(dvdnav_t *self, int32_t title, int32_t part);
 
 /*
  * Plays the specified title, starting from the specified program
  */
-dvdnav_status_t dvdnav_program_play(dvdnav_t *self, int32_t title, int32_t pgcn, int32_t pgn);
+DVDNAV_API dvdnav_status_t dvdnav_program_play(dvdnav_t *self, int32_t title, int32_t pgcn, int32_t pgn);
 
 /*
  * Stores in *times an array (that the application *must* free) of
@@ -333,7 +343,7 @@ dvdnav_status_t dvdnav_program_play(dvdnav_t *self, int32_t title, int32_t pgcn,
  * The number of entries in *times is the result of the function.
  * On error *times is NULL and the output is 0
  */
-uint32_t dvdnav_describe_title_chapters(dvdnav_t *self, int32_t title, uint64_t **times, uint64_t *duration);
+DVDNAV_API uint32_t dvdnav_describe_title_chapters(dvdnav_t *self, int32_t title, uint64_t **times, uint64_t *duration);
 
 /*
  * Play the specified amount of parts of the specified title of
@@ -341,7 +351,7 @@ uint32_t dvdnav_describe_title_chapters(dvdnav_t *self, int32_t title, uint64_t
  *
  * Currently unimplemented!
  */
-dvdnav_status_t dvdnav_part_play_auto_stop(dvdnav_t *self, int32_t title,
+DVDNAV_API dvdnav_status_t dvdnav_part_play_auto_stop(dvdnav_t *self, int32_t title,
                                            int32_t part, int32_t parts_to_play);
 
 /*
@@ -349,7 +359,7 @@ dvdnav_status_t dvdnav_part_play_auto_stop(dvdnav_t *self, int32_t title,
  *
  * Currently unimplemented!
  */
-dvdnav_status_t dvdnav_time_play(dvdnav_t *self, int32_t title,
+DVDNAV_API dvdnav_status_t dvdnav_time_play(dvdnav_t *self, int32_t title,
                                  uint64_t time);
 
 /*
@@ -357,21 +367,21 @@ dvdnav_status_t dvdnav_time_play(dvdnav_t *self, int32_t title,
  *
  * See also DVDMenuID_t from libdvdread
  */
-dvdnav_status_t dvdnav_menu_call(dvdnav_t *self, DVDMenuID_t menu);
+DVDNAV_API dvdnav_status_t dvdnav_menu_call(dvdnav_t *self, DVDMenuID_t menu);
 
 /*
  * Return the title number and part currently being played.
  * A title of 0 indicates we are in a menu. In this case, part
  * is set to the current menu's ID.
  */
-dvdnav_status_t dvdnav_current_title_info(dvdnav_t *self, int32_t *title,
+DVDNAV_API dvdnav_status_t dvdnav_current_title_info(dvdnav_t *self, int32_t *title,
                                           int32_t *part);
 
 /*
  * Return the title number, pgcn and pgn currently being played.
  * A title of 0 indicates, we are in a menu.
  */
-dvdnav_status_t dvdnav_current_title_program(dvdnav_t *self, int32_t *title,
+DVDNAV_API dvdnav_status_t dvdnav_current_title_program(dvdnav_t *self, int32_t *title,
                                           int32_t *pgcn, int32_t *pgn);
 
 /*
@@ -381,7 +391,7 @@ dvdnav_status_t dvdnav_current_title_program(dvdnav_t *self, int32_t *title,
  * Current implementation is wrong and likely to behave unpredictably!
  * Use is discouraged!
  */
-dvdnav_status_t dvdnav_get_position_in_title(dvdnav_t *self,
+DVDNAV_API dvdnav_status_t dvdnav_get_position_in_title(dvdnav_t *self,
                                              uint32_t *pos,
                                              uint32_t *len);
 
@@ -391,7 +401,7 @@ dvdnav_status_t dvdnav_get_position_in_title(dvdnav_t *self,
  * Stop playing the current position and start playback of the current title
  * from the specified part.
  */
-dvdnav_status_t dvdnav_part_search(dvdnav_t *self, int32_t part);
+DVDNAV_API dvdnav_status_t dvdnav_part_search(dvdnav_t *self, int32_t part);
 
 
 /*********************************************************************
@@ -412,14 +422,14 @@ dvdnav_status_t dvdnav_part_search(dvdnav_t *self, int32_t part);
  * 'origin' can be one of SEEK_SET, SEEK_CUR, SEEK_END as defined in
  * fcntl.h.
  */
-dvdnav_status_t dvdnav_sector_search(dvdnav_t *self,
+DVDNAV_API dvdnav_status_t dvdnav_sector_search(dvdnav_t *self,
                                      int64_t offset, int32_t origin);
 
 /*
  returns the current stream time in PTS ticks as reported by the IFO structures
  divide it by 90000 to get the current play time in seconds
  */
-int64_t dvdnav_get_current_time(dvdnav_t *self);
+DVDNAV_API int64_t dvdnav_get_current_time(dvdnav_t *self);
 
 /*
  * Stop playing the current position and start playback of the title
@@ -428,7 +438,7 @@ int64_t dvdnav_get_current_time(dvdnav_t *self);
  * Currently implemented using interpolation. That interpolation is slightly
  * inaccurate.
  */
-dvdnav_status_t dvdnav_time_search(dvdnav_t *self,
+DVDNAV_API dvdnav_status_t dvdnav_time_search(dvdnav_t *self,
                                    uint64_t time);
 
 /*
@@ -441,32 +451,32 @@ dvdnav_status_t dvdnav_time_search(dvdnav_t *self,
  *  1: After. Always jump to a time that is > time_in_pts_ticks
  * -1: Before. Always jump to a time that is < time_in_pts_ticks
  */
-dvdnav_status_t dvdnav_jump_to_sector_by_time(dvdnav_t *self,
+DVDNAV_API dvdnav_status_t dvdnav_jump_to_sector_by_time(dvdnav_t *self,
                                               uint64_t time_in_pts_ticks, int32_t mode);
 
 /*
  * Stop playing current position and play the "GoUp"-program chain.
  * (which generally leads to the title menu or a higher-level menu).
  */
-dvdnav_status_t dvdnav_go_up(dvdnav_t *self);
+DVDNAV_API dvdnav_status_t dvdnav_go_up(dvdnav_t *self);
 
 /*
  * Stop playing the current position and start playback at the
  * previous program (if it exists).
  */
-dvdnav_status_t dvdnav_prev_pg_search(dvdnav_t *self);
+DVDNAV_API dvdnav_status_t dvdnav_prev_pg_search(dvdnav_t *self);
 
 /*
  * Stop playing the current position and start playback at the
  * first program.
  */
-dvdnav_status_t dvdnav_top_pg_search(dvdnav_t *self);
+DVDNAV_API dvdnav_status_t dvdnav_top_pg_search(dvdnav_t *self);
 
 /*
  * Stop playing the current position and start playback at the
  * next program (if it exists).
  */
-dvdnav_status_t dvdnav_next_pg_search(dvdnav_t *self);
+DVDNAV_API dvdnav_status_t dvdnav_next_pg_search(dvdnav_t *self);
 
 /*
  * Return the current position (in blocks) within the current
@@ -476,7 +486,7 @@ dvdnav_status_t dvdnav_next_pg_search(dvdnav_t *self);
  * (see dvdnav_set_PGC_positioning_flag()), this will return the
  * relative position in and the length of the current program chain.
  */
-dvdnav_status_t dvdnav_get_position(dvdnav_t *self, uint32_t *pos,
+DVDNAV_API dvdnav_status_t dvdnav_get_position(dvdnav_t *self, uint32_t *pos,
                                     uint32_t *len);
 
 
@@ -498,7 +508,7 @@ dvdnav_status_t dvdnav_get_position(dvdnav_t *self, uint32_t *pos,
  * Get the currently highlighted button
  * number (1..36) or 0 if no button is highlighted.
  */
-dvdnav_status_t dvdnav_get_current_highlight(dvdnav_t *self, int32_t *button);
+DVDNAV_API dvdnav_status_t dvdnav_get_current_highlight(dvdnav_t *self, int32_t *button);
 
 /*
  * Returns the Presentation Control Information (PCI) structure associated
@@ -507,7 +517,7 @@ dvdnav_status_t dvdnav_get_current_highlight(dvdnav_t *self, int32_t *button);
  * Read the general notes above.
  * See also libdvdreads nav_types.h for definition of pci_t.
  */
-pci_t* dvdnav_get_current_nav_pci(dvdnav_t *self);
+DVDNAV_API pci_t* dvdnav_get_current_nav_pci(dvdnav_t *self);
 
 /*
  * Returns the DSI (data search information) structure associated
@@ -516,51 +526,51 @@ pci_t* dvdnav_get_current_nav_pci(dvdnav_t *self);
  * Read the general notes above.
  * See also libdvdreads nav_types.h for definition of dsi_t.
  */
-dsi_t* dvdnav_get_current_nav_dsi(dvdnav_t *self);
+DVDNAV_API dsi_t* dvdnav_get_current_nav_dsi(dvdnav_t *self);
 
 /*
  * Get the area associated with a certain button.
  */
-dvdnav_status_t dvdnav_get_highlight_area(pci_t *nav_pci , int32_t button, int32_t mode,
+DVDNAV_API dvdnav_status_t dvdnav_get_highlight_area(pci_t *nav_pci , int32_t button, int32_t mode,
                                           dvdnav_highlight_area_t *highlight);
 
 /*
  * Move button highlight around as suggested by function name (e.g. with arrow keys).
  */
-dvdnav_status_t dvdnav_upper_button_select(dvdnav_t *self, pci_t *pci);
-dvdnav_status_t dvdnav_lower_button_select(dvdnav_t *self, pci_t *pci);
-dvdnav_status_t dvdnav_right_button_select(dvdnav_t *self, pci_t *pci);
-dvdnav_status_t dvdnav_left_button_select(dvdnav_t *self, pci_t *pci);
+DVDNAV_API dvdnav_status_t dvdnav_upper_button_select(dvdnav_t *self, pci_t *pci);
+DVDNAV_API dvdnav_status_t dvdnav_lower_button_select(dvdnav_t *self, pci_t *pci);
+DVDNAV_API dvdnav_status_t dvdnav_right_button_select(dvdnav_t *self, pci_t *pci);
+DVDNAV_API dvdnav_status_t dvdnav_left_button_select(dvdnav_t *self, pci_t *pci);
 
 /*
  * Activate ("press") the currently highlighted button.
  */
-dvdnav_status_t dvdnav_button_activate(dvdnav_t *self, pci_t *pci);
+DVDNAV_API dvdnav_status_t dvdnav_button_activate(dvdnav_t *self, pci_t *pci);
 
 /*
  * Highlight a specific button.
  */
-dvdnav_status_t dvdnav_button_select(dvdnav_t *self, pci_t *pci, int32_t button);
+DVDNAV_API dvdnav_status_t dvdnav_button_select(dvdnav_t *self, pci_t *pci, int32_t button);
 
 /*
  * Activate ("press") specified button.
  */
-dvdnav_status_t dvdnav_button_select_and_activate(dvdnav_t *self, pci_t *pci, int32_t button);
+DVDNAV_API dvdnav_status_t dvdnav_button_select_and_activate(dvdnav_t *self, pci_t *pci, int32_t button);
 
 /*
  * Activate ("press") a button and execute specified command.
  */
-dvdnav_status_t dvdnav_button_activate_cmd(dvdnav_t *self, int32_t button, vm_cmd_t *cmd);
+DVDNAV_API dvdnav_status_t dvdnav_button_activate_cmd(dvdnav_t *self, int32_t button, vm_cmd_t *cmd);
 
 /*
  * Select button at specified video frame coordinates.
  */
-dvdnav_status_t dvdnav_mouse_select(dvdnav_t *self, pci_t *pci, int32_t x, int32_t y);
+DVDNAV_API dvdnav_status_t dvdnav_mouse_select(dvdnav_t *self, pci_t *pci, int32_t x, int32_t y);
 
 /*
  * Activate ("press") button at specified video frame coordinates.
  */
-dvdnav_status_t dvdnav_mouse_activate(dvdnav_t *self, pci_t *pci, int32_t x, int32_t y);
+DVDNAV_API dvdnav_status_t dvdnav_mouse_activate(dvdnav_t *self, pci_t *pci, int32_t x, int32_t y);
 
 
 /*********************************************************************
@@ -575,19 +585,19 @@ dvdnav_status_t dvdnav_mouse_activate(dvdnav_t *self, pci_t *pci, int32_t x, int
 /*
  * Set which menu language we should use per default.
  */
-dvdnav_status_t dvdnav_menu_language_select(dvdnav_t *self,
+DVDNAV_API dvdnav_status_t dvdnav_menu_language_select(dvdnav_t *self,
                                            char *code);
 
 /*
  * Set which audio language we should use per default.
  */
-dvdnav_status_t dvdnav_audio_language_select(dvdnav_t *self,
+DVDNAV_API dvdnav_status_t dvdnav_audio_language_select(dvdnav_t *self,
                                             char *code);
 
 /*
  * Set which spu language we should use per default.
  */
-dvdnav_status_t dvdnav_spu_language_select(dvdnav_t *self,
+DVDNAV_API dvdnav_status_t dvdnav_spu_language_select(dvdnav_t *self,
                                           char *code);
 
 
@@ -603,14 +613,14 @@ dvdnav_status_t dvdnav_spu_language_select(dvdnav_t *self,
  * so you may also read the default of the authoring software they used, like
  * `DVDVolume' (see also dvdnav_get_volid_string).
  */
-dvdnav_status_t dvdnav_get_title_string(dvdnav_t *self, const char **title_str);
+DVDNAV_API dvdnav_status_t dvdnav_get_title_string(dvdnav_t *self, const char **title_str);
 
 /*
  * Returns a string containing the serial number of the DVD.
  * This has a max of 15 characters and should be more unique than the
  * title string.
  */
-dvdnav_status_t dvdnav_get_serial_string(dvdnav_t *self, const char **serial_str);
+DVDNAV_API dvdnav_status_t dvdnav_get_serial_string(dvdnav_t *self, const char **serial_str);
 
 /*
  * Returns the VolumeIdentifier of the disc or NULL if it could
@@ -623,7 +633,7 @@ dvdnav_status_t dvdnav_get_serial_string(dvdnav_t *self, const char **serial_str
  * Note: The string is malloc'd so caller has to free() the returned
  * string when done with it.
  */
-char * dvdnav_get_volid_string(dvdnav_t *self);
+DVDNAV_API char * dvdnav_get_volid_string(dvdnav_t *self);
 
 /*
  * Get video aspect code.
@@ -632,12 +642,12 @@ char * dvdnav_get_volid_string(dvdnav_t *self);
  *
  * 0 -- 4:3, 2 -- 16:9
  */
-uint8_t dvdnav_get_video_aspect(dvdnav_t *self);
+DVDNAV_API uint8_t dvdnav_get_video_aspect(dvdnav_t *self);
 
 /*
  * Get video resolution.
  */
-dvdnav_status_t dvdnav_get_video_resolution(dvdnav_t *self, uint32_t *width, uint32_t *height);
+DVDNAV_API dvdnav_status_t dvdnav_get_video_resolution(dvdnav_t *self, uint32_t *width, uint32_t *height);
 
 /*
  * Get video scaling permissions.
@@ -646,75 +656,75 @@ dvdnav_status_t dvdnav_get_video_resolution(dvdnav_t *self, uint32_t *width, uin
  *
  * bit0 set = deny letterboxing, bit1 set = deny pan&scan
  */
-uint8_t dvdnav_get_video_scale_permission(dvdnav_t *self);
+DVDNAV_API uint8_t dvdnav_get_video_scale_permission(dvdnav_t *self);
 
 /*
  * Converts a *logical* audio stream id into language code
  * (returns 0xffff if no such stream).
  */
-uint16_t dvdnav_audio_stream_to_lang(dvdnav_t *self, uint8_t stream);
+DVDNAV_API uint16_t dvdnav_audio_stream_to_lang(dvdnav_t *self, uint8_t stream);
 
 /*
  * Returns the format of *logical* audio stream 'stream'
  * (returns 0xffff if no such stream).
  */
-uint16_t dvdnav_audio_stream_format(dvdnav_t *self, uint8_t stream);
+DVDNAV_API uint16_t dvdnav_audio_stream_format(dvdnav_t *self, uint8_t stream);
 
 /*
  * Returns number of channels in *logical* audio stream 'stream'
  * (returns 0xffff if no such stream).
  */
-uint16_t dvdnav_audio_stream_channels(dvdnav_t *self, uint8_t stream);
+DVDNAV_API uint16_t dvdnav_audio_stream_channels(dvdnav_t *self, uint8_t stream);
 
 /*
  * Converts a *logical* subpicture stream id into country code
  * (returns 0xffff if no such stream).
  */
-uint16_t dvdnav_spu_stream_to_lang(dvdnav_t *self, uint8_t stream);
+DVDNAV_API uint16_t dvdnav_spu_stream_to_lang(dvdnav_t *self, uint8_t stream);
 
 /*
  * Converts a *physical* (MPEG) audio stream id into a logical stream number.
  */
-int8_t dvdnav_get_audio_logical_stream(dvdnav_t *self, uint8_t audio_num);
+DVDNAV_API int8_t dvdnav_get_audio_logical_stream(dvdnav_t *self, uint8_t audio_num);
 
 #define HAVE_GET_AUDIO_ATTR
 /*
  * Get audio attr
  */
-dvdnav_status_t dvdnav_get_audio_attr(dvdnav_t *self, uint8_t audio_mum, audio_attr_t *audio_attr);
+DVDNAV_API dvdnav_status_t dvdnav_get_audio_attr(dvdnav_t *self, uint8_t audio_mum, audio_attr_t *audio_attr);
 
 /*
  * Converts a *physical* (MPEG) subpicture stream id into a logical stream number.
  */
-int8_t dvdnav_get_spu_logical_stream(dvdnav_t *self, uint8_t subp_num);
+DVDNAV_API int8_t dvdnav_get_spu_logical_stream(dvdnav_t *self, uint8_t subp_num);
 
 #define HAVE_GET_SPU_ATTR
 /*
  * Get spu attr
  */
-dvdnav_status_t dvdnav_get_spu_attr(dvdnav_t *self, uint8_t audio_mum, subp_attr_t *subp_attr);
+DVDNAV_API dvdnav_status_t dvdnav_get_spu_attr(dvdnav_t *self, uint8_t audio_mum, subp_attr_t *subp_attr);
 
 /*
  * Get active audio stream.
  */
-int8_t dvdnav_get_active_audio_stream(dvdnav_t *self);
+DVDNAV_API int8_t dvdnav_get_active_audio_stream(dvdnav_t *self);
 
 /*
  * Get active spu stream.
  */
-int8_t dvdnav_get_active_spu_stream(dvdnav_t *self);
+DVDNAV_API int8_t dvdnav_get_active_spu_stream(dvdnav_t *self);
 
 /*
  * Get the set of user operations that are currently prohibited.
  * There are potentially new restrictions right after
  * DVDNAV_CHANNEL_HOP and DVDNAV_NAV_PACKET.
  */
-user_ops_t dvdnav_get_restrictions(dvdnav_t *self);
+DVDNAV_API user_ops_t dvdnav_get_restrictions(dvdnav_t *self);
 
 /*
  * Returns the number of streams provided its type (e.g. subtitles, audio, etc)
  */
-int8_t dvdnav_get_number_of_streams(dvdnav_t *self, dvdnav_stream_type_t stream_type);
+DVDNAV_API int8_t dvdnav_get_number_of_streams(dvdnav_t *self, dvdnav_stream_type_t stream_type);
 
 
 /*********************************************************************
@@ -726,14 +736,14 @@ int8_t dvdnav_get_number_of_streams(dvdnav_t *self, dvdnav_stream_type_t stream_
  * (to enable/disable subtitles)
  * visibility defines if the spu stream should be enabled/visible (1) or disabled (0)
  */
-dvdnav_status_t dvdnav_toggle_spu_stream(dvdnav_t *self, uint8_t visibility);
+DVDNAV_API dvdnav_status_t dvdnav_toggle_spu_stream(dvdnav_t *self, uint8_t visibility);
 
 /*
  * Set the given stream id and stream type as active
  * stream_num - the physical index of the stream
  * stream_type - the stream type (audio or subtitles)
  */
-dvdnav_status_t dvdnav_set_active_stream(dvdnav_t *self, uint8_t stream_num,
+DVDNAV_API dvdnav_status_t dvdnav_set_active_stream(dvdnav_t *self, uint8_t stream_num,
                                         dvdnav_stream_type_t stream_type);
 
 /*********************************************************************
@@ -757,12 +767,12 @@ dvdnav_status_t dvdnav_set_active_stream(dvdnav_t *self, uint8_t stream_num,
  * Sets the current angle. If you try to follow a non existent angle
  * the call fails.
  */
-dvdnav_status_t dvdnav_angle_change(dvdnav_t *self, int32_t angle);
+DVDNAV_API dvdnav_status_t dvdnav_angle_change(dvdnav_t *self, int32_t angle);
 
 /*
  * Returns the current angle and number of angles present.
  */
-dvdnav_status_t dvdnav_get_angle_info(dvdnav_t *self, int32_t *current_angle,
+DVDNAV_API dvdnav_status_t dvdnav_get_angle_info(dvdnav_t *self, int32_t *current_angle,
                                       int32_t *number_of_angles);
 
 /*********************************************************************
@@ -772,22 +782,22 @@ dvdnav_status_t dvdnav_get_angle_info(dvdnav_t *self, int32_t *current_angle,
 /*
  * Are we in the First Play domain?
  */
-int8_t dvdnav_is_domain_fp(dvdnav_t *self);
+DVDNAV_API int8_t dvdnav_is_domain_fp(dvdnav_t *self);
 
 /*
  * Are we in the Video management Menu domain?
  */
-int8_t dvdnav_is_domain_vmgm(dvdnav_t *self);
+DVDNAV_API int8_t dvdnav_is_domain_vmgm(dvdnav_t *self);
 
 /*
  * Are we in the Video Title Menu domain?
  */
-int8_t dvdnav_is_domain_vtsm(dvdnav_t *self);
+DVDNAV_API int8_t dvdnav_is_domain_vtsm(dvdnav_t *self);
 
 /*
  * Are we in the Video Title Set domain?
  */
-int8_t dvdnav_is_domain_vts(dvdnav_t *self);
+DVDNAV_API int8_t dvdnav_is_domain_vts(dvdnav_t *self);
 
 
 #ifdef __cplusplus


=====================================
src/dvdnav_internal.h
=====================================
@@ -224,7 +224,7 @@ struct dvdnav_s {
 /** HELPER FUNCTIONS **/
 
 /* converts a dvd_time_t to PTS ticks */
-int64_t dvdnav_convert_time(const dvd_time_t *time);
+DVDNAV_API int64_t dvdnav_convert_time(const dvd_time_t *time);
 
 /** USEFUL MACROS **/
 


=====================================
src/logger.h
=====================================
@@ -19,7 +19,7 @@
 #ifndef LIBDVDNAV_LOGGER_H
 #define LIBDVDNAV_LOGGER_H
 
-void dvdnav_log( void *priv, const dvdnav_logger_cb *logcb,
+DVDNAV_API void dvdnav_log( void *priv, const dvdnav_logger_cb *logcb,
                  dvdnav_logger_level_t level, const char *fmt, ... );
 
 #define LOG(ctx, level, ...) \


=====================================
src/read_cache.h
=====================================
@@ -30,17 +30,17 @@
 #define _MULTITHREAD_ 0
 
 /* Constructor/destructors */
-read_cache_t *dvdnav_read_cache_new(dvdnav_t* dvd_self);
-void dvdnav_read_cache_free(read_cache_t* self);
+DVDNAV_API read_cache_t *dvdnav_read_cache_new(dvdnav_t* dvd_self);
+DVDNAV_API void dvdnav_read_cache_free(read_cache_t* self);
 
 /* This function MUST be called whenever self->file changes. */
-void dvdnav_read_cache_clear(read_cache_t *self);
+DVDNAV_API void dvdnav_read_cache_clear(read_cache_t *self);
 /* This function is called just after reading the NAV packet. */
-void dvdnav_pre_cache_blocks(read_cache_t *self, int sector, size_t block_count);
+DVDNAV_API void dvdnav_pre_cache_blocks(read_cache_t *self, int sector, size_t block_count);
 /* This function will do the cache read.
  * The buffer handed in must be malloced to take one dvd block.
  * On a cache hit, a different buffer will be returned though.
  * Those buffers must _never_ be freed. */
-int dvdnav_read_cache_block(read_cache_t *self, int sector, size_t block_count, uint8_t **buf);
+DVDNAV_API int dvdnav_read_cache_block(read_cache_t *self, int sector, size_t block_count, uint8_t **buf);
 
 #endif /* LIBDVDNAV_READ_CACHE_H */



View it on GitLab: https://code.videolan.org/videolan/libdvdnav/-/commit/1ebcbb3a2d82c7ab887d559ea941ba6ba3eb3c3a

-- 
View it on GitLab: https://code.videolan.org/videolan/libdvdnav/-/commit/1ebcbb3a2d82c7ab887d559ea941ba6ba3eb3c3a
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the libdvdnav-devel mailing list