diff options
Diffstat (limited to 'include/xine')
-rw-r--r-- | include/xine/alphablend.h | 1 | ||||
-rw-r--r-- | include/xine/array.h | 2 | ||||
-rw-r--r-- | include/xine/attributes.h | 41 | ||||
-rw-r--r-- | include/xine/audio_out.h | 2 | ||||
-rw-r--r-- | include/xine/broadcaster.h | 2 | ||||
-rw-r--r-- | include/xine/buffer.h | 4 | ||||
-rw-r--r-- | include/xine/configfile.h | 2 | ||||
-rw-r--r-- | include/xine/input_plugin.h | 90 | ||||
-rw-r--r-- | include/xine/list.h | 2 | ||||
-rw-r--r-- | include/xine/metronom.h | 4 | ||||
-rw-r--r-- | include/xine/osd.h | 2 | ||||
-rw-r--r-- | include/xine/pool.h | 2 | ||||
-rw-r--r-- | include/xine/refcounter.h | 2 | ||||
-rw-r--r-- | include/xine/ring_buffer.h | 2 | ||||
-rw-r--r-- | include/xine/scratch.h | 2 | ||||
-rw-r--r-- | include/xine/sorted_array.h | 2 | ||||
-rw-r--r-- | include/xine/video_out.h | 2 | ||||
-rw-r--r-- | include/xine/video_overlay.h | 2 | ||||
-rw-r--r-- | include/xine/xine_internal.h | 23 | ||||
-rw-r--r-- | include/xine/xineutils.h | 20 |
20 files changed, 103 insertions, 106 deletions
diff --git a/include/xine/alphablend.h b/include/xine/alphablend.h index f8c9ad540..f20d2e33e 100644 --- a/include/xine/alphablend.h +++ b/include/xine/alphablend.h @@ -46,7 +46,6 @@ typedef struct { /* CLUT == Color LookUp Table */ uint8_t foo; } XINE_PACKED clut_t; - #define XX44_PALETTE_SIZE 32 typedef struct { diff --git a/include/xine/array.h b/include/xine/array.h index ae2093823..44f3c7632 100644 --- a/include/xine/array.h +++ b/include/xine/array.h @@ -27,7 +27,7 @@ typedef struct xine_array_s xine_array_t; /* Constructor */ -xine_array_t *xine_array_new(size_t initial_size) XINE_PROTECTED; +xine_array_t *xine_array_new(size_t initial_size) XINE_MALLOC XINE_PROTECTED; /* Destructor */ void xine_array_delete(xine_array_t *array) XINE_PROTECTED; diff --git a/include/xine/attributes.h b/include/xine/attributes.h index b25c76572..3819818d5 100644 --- a/include/xine/attributes.h +++ b/include/xine/attributes.h @@ -34,6 +34,27 @@ #ifdef XINE_COMPILE # include "configure.h" +#else +# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95 ) +# define SUPPORT_ATTRIBUTE_PACKED 1 +# endif + +# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3 ) +# define SUPPORT_ATTRIBUTE_DEPRECATED 1 +# define SUPPORT_ATTRIBUTE_FORMAT 1 +# define SUPPORT_ATTRIBUTE_FORMAT_ARG 1 +# define SUPPORT_ATTRIBUTE_MALLOC 1 +# define SUPPORT_ATTRIBUTE_UNUSED 1 +# define SUPPORT_ATTRIBUTE_CONST 1 +# endif + +# if __GNUC__ >= 4 +# define SUPPORT_ATTRIBUTE_VISIBILITY_DEFAULT 1 +# if __ELF__ +# define SUPPORT_ATTRIBUTE_VISIBILITY_PROTECTED 1 +# endif +# define SUPPORT_ATTRIBUTE_SENTINEL 1 +# endif #endif /* Export protected only for libxine functions */ @@ -51,6 +72,12 @@ # define XINE_SENTINEL #endif +#ifdef SUPPORT_ATTRIBUTE_DEPRECATED +# define XINE_DEPRECATED __attribute__((__deprecated__)) +#else +# define XINE_DEPRECATED +#endif + #ifndef __attr_unused # ifdef SUPPORT_ATTRIBUTE_UNUSED # define __attr_unused __attribute__((__unused__)) @@ -71,16 +98,22 @@ # define XINE_FORMAT_PRINTF_ARG(fmt) #endif +#ifdef SUPPORT_ATTRIBUTE_MALLOC +# define XINE_MALLOC __attribute__((__malloc__)) +#else +# define XINE_MALLOC +#endif + #ifdef SUPPORT_ATTRIBUTE_PACKED -# define XINE_PACKED __attribute__((packed)) +# define XINE_PACKED __attribute__((__packed__)) #else # define XINE_PACKED #endif -#ifdef SUPPORT_ATTRIBUTE_MALLOC -# define XINE_MALLOC __attribute__((__malloc__)) +#ifdef SUPPORT_ATTRIBUTE_CONST +# define XINE_CONST __attribute__((__const__)) #else -# define XINE_MALLOC +# define XINE_CONST #endif #endif /* ATTRIBUTE_H_ */ diff --git a/include/xine/audio_out.h b/include/xine/audio_out.h index 25e5deb68..8b8316882 100644 --- a/include/xine/audio_out.h +++ b/include/xine/audio_out.h @@ -274,7 +274,7 @@ struct audio_driver_class_s { * * @internal */ -xine_audio_port_t *_x_ao_new_port (xine_t *xine, ao_driver_t *driver, int grab_only); +xine_audio_port_t *_x_ao_new_port (xine_t *xine, ao_driver_t *driver, int grab_only) XINE_MALLOC; /* * audio output modes + capabilities diff --git a/include/xine/broadcaster.h b/include/xine/broadcaster.h index 093fb4af0..0c6a291eb 100644 --- a/include/xine/broadcaster.h +++ b/include/xine/broadcaster.h @@ -33,7 +33,7 @@ extern "C" { typedef struct broadcaster_s broadcaster_t; -broadcaster_t *_x_init_broadcaster(xine_stream_t *stream, int port) XINE_PROTECTED; +broadcaster_t *_x_init_broadcaster(xine_stream_t *stream, int port) XINE_MALLOC XINE_PROTECTED; void _x_close_broadcaster(broadcaster_t *this) XINE_PROTECTED; int _x_get_broadcaster_port(broadcaster_t *this) XINE_PROTECTED; diff --git a/include/xine/buffer.h b/include/xine/buffer.h index a53b99db3..11d9e3730 100644 --- a/include/xine/buffer.h +++ b/include/xine/buffer.h @@ -626,7 +626,7 @@ struct fifo_buffer_s * @param buf_size Size of each buffer. * @internal Only used by video and audio decoder loops. */ -fifo_buffer_t *_x_fifo_buffer_new (int num_buffers, uint32_t buf_size); +fifo_buffer_t *_x_fifo_buffer_new (int num_buffers, uint32_t buf_size) XINE_MALLOC; /** * @brief Allocate and initialise new dummy FIFO buffers. @@ -634,7 +634,7 @@ fifo_buffer_t *_x_fifo_buffer_new (int num_buffers, uint32_t buf_size); * @param buf_size Size of each buffer. * @internal Only used by video and audio decoder loops. */ -fifo_buffer_t *_x_dummy_fifo_buffer_new (int num_buffers, uint32_t buf_size); +fifo_buffer_t *_x_dummy_fifo_buffer_new (int num_buffers, uint32_t buf_size) XINE_MALLOC; /** diff --git a/include/xine/configfile.h b/include/xine/configfile.h index e8f2c070e..f2deb1aa6 100644 --- a/include/xine/configfile.h +++ b/include/xine/configfile.h @@ -227,7 +227,7 @@ struct config_values_s { * @brief allocate and init a new xine config object * @internal */ -config_values_t *_x_config_init (void); +config_values_t *_x_config_init (void) XINE_MALLOC; /** * @brief interpret stream_setup part of mrls for config value changes diff --git a/include/xine/input_plugin.h b/include/xine/input_plugin.h index 95fc65c4e..2a75d7f9b 100644 --- a/include/xine/input_plugin.h +++ b/include/xine/input_plugin.h @@ -321,6 +321,13 @@ struct input_plugin_s { #define INPUT_OPTIONAL_DATA_SPULANG 3 #define INPUT_OPTIONAL_DATA_PREVIEW 7 +/* buffer is a const char **; the string is freed by the input plugin. */ +#define INPUT_OPTIONAL_DATA_MIME_TYPE 8 +/* buffer is unused; true if the demuxer should be determined by the MIME type */ +#define INPUT_OPTIONAL_DATA_DEMUX_MIME_TYPE 9 +/* buffer is a const char **; the string is static or freed by the input plugin. */ +#define INPUT_OPTIONAL_DATA_DEMUXER 10 + #define MAX_MRL_ENTRIES 255 #define MAX_PREVIEW_SIZE 4096 @@ -347,65 +354,38 @@ struct input_plugin_s { /* * Freeing/zeroing all of entries of given mrl. */ -#define MRL_ZERO(m) { \ - if((m)) { \ - if((m)->origin) \ - free((m)->origin); \ - if((m)->mrl) \ - free((m)->mrl); \ - if((m)->link) \ - free((m)->link); \ - (m)->origin = NULL; \ - (m)->mrl = NULL; \ - (m)->link = NULL; \ - (m)->type = 0; \ - (m)->size = (off_t) 0; \ - } \ -} +#define MRL_ZERO(m) { \ + if((m)) { \ + free((m)->origin); \ + free((m)->mrl); \ + free((m)->link); \ + (m)->origin = NULL; \ + (m)->mrl = NULL; \ + (m)->link = NULL; \ + (m)->type = 0; \ + (m)->size = (off_t) 0; \ + } \ + } /* * Duplicate two mrls entries (s = source, d = destination). */ -#define MRL_DUPLICATE(s, d) { \ - _x_assert((s) != NULL); \ - _x_assert((d) != NULL); \ - \ - if((s)->origin) { \ - if((d)->origin) { \ - (d)->origin = (char *) realloc((d)->origin, strlen((s)->origin) + 1); \ - sprintf((d)->origin, "%s", (s)->origin); \ - } \ - else \ - (d)->origin = strdup((s)->origin); \ - } \ - else \ - (d)->origin = NULL; \ - \ - if((s)->mrl) { \ - if((d)->mrl) { \ - (d)->mrl = (char *) realloc((d)->mrl, strlen((s)->mrl) + 1); \ - sprintf((d)->mrl, "%s", (s)->mrl); \ - } \ - else \ - (d)->mrl = strdup((s)->mrl); \ - } \ - else \ - (d)->mrl = NULL; \ - \ - if((s)->link) { \ - if((d)->link) { \ - (d)->link = (char *) realloc((d)->link, strlen((s)->link) + 1); \ - sprintf((d)->link, "%s", (s)->link); \ - } \ - else \ - (d)->link = strdup((s)->link); \ - } \ - else \ - (d)->link = NULL; \ - \ - (d)->type = (s)->type; \ - (d)->size = (s)->size; \ -} +#define MRL_DUPLICATE(s, d) { \ + _x_assert((s) != NULL); \ + _x_assert((d) != NULL); \ + \ + free((d)->origin); \ + (d)->origin = (s)->origin ? strdup((s)->origin) : NULL; \ + \ + free((d)->mrl); \ + (d)->mrl = (s)->mrl ? strdup((s)->mrl) : NULL; \ + \ + free((d)->link); \ + (d)->link = (s)->link ? strdup((s)->link) : NULL; \ + \ + (d)->type = (s)->type; \ + (d)->size = (s)->size; \ + } /* * Duplicate two arrays of mrls (s = source, d = destination). diff --git a/include/xine/list.h b/include/xine/list.h index e00e30d6c..f05ed2b0e 100644 --- a/include/xine/list.h +++ b/include/xine/list.h @@ -48,7 +48,7 @@ typedef struct xine_list_s xine_list_t; typedef void* xine_list_iterator_t; /* Constructor */ -xine_list_t *xine_list_new(void) XINE_PROTECTED; +xine_list_t *xine_list_new(void) XINE_MALLOC XINE_PROTECTED; /* Destructor */ void xine_list_delete(xine_list_t *list) XINE_PROTECTED; diff --git a/include/xine/metronom.h b/include/xine/metronom.h index df08a0058..28ca7d62d 100644 --- a/include/xine/metronom.h +++ b/include/xine/metronom.h @@ -218,7 +218,7 @@ struct metronom_s { #define METRONOM_VPTS_OFFSET 6 #define METRONOM_PREBUFFER 7 -metronom_t *_x_metronom_init (int have_video, int have_audio, xine_t *xine) XINE_PROTECTED; +metronom_t *_x_metronom_init (int have_video, int have_audio, xine_t *xine) XINE_MALLOC XINE_PROTECTED; /* FIXME: reorder this structure on the next cleanup to remove the dummies */ struct metronom_clock_s { @@ -314,7 +314,7 @@ struct metronom_clock_s { #endif }; -metronom_clock_t *_x_metronom_clock_init(xine_t *xine) XINE_PROTECTED; +metronom_clock_t *_x_metronom_clock_init(xine_t *xine) XINE_MALLOC XINE_PROTECTED; /* * clock options diff --git a/include/xine/osd.h b/include/xine/osd.h index 4e34030ee..de924a1ae 100644 --- a/include/xine/osd.h +++ b/include/xine/osd.h @@ -219,7 +219,7 @@ struct osd_renderer_s { /* * initialize the osd rendering engine */ -osd_renderer_t *_x_osd_renderer_init( xine_stream_t *stream ); +osd_renderer_t *_x_osd_renderer_init( xine_stream_t *stream ) XINE_MALLOC; /* diff --git a/include/xine/pool.h b/include/xine/pool.h index 918da82a2..2667b7fdc 100644 --- a/include/xine/pool.h +++ b/include/xine/pool.h @@ -36,7 +36,7 @@ xine_pool_t *xine_pool_new(size_t object_size, void (create_object)(void *object), void (prepare_object)(void *object), void (return_object)(void *object), - void (delete_object)(void *object)) XINE_PROTECTED; + void (delete_object)(void *object)) XINE_MALLOC XINE_PROTECTED; /* Deletes a pool */ void xine_pool_delete(xine_pool_t *pool) XINE_PROTECTED; diff --git a/include/xine/refcounter.h b/include/xine/refcounter.h index a662a974e..8683bfb3f 100644 --- a/include/xine/refcounter.h +++ b/include/xine/refcounter.h @@ -35,7 +35,7 @@ typedef struct { typedef void (*refcounter_destructor)(void*); -refcounter_t* _x_new_refcounter(void *object, refcounter_destructor destructor) XINE_PROTECTED; +refcounter_t* _x_new_refcounter(void *object, refcounter_destructor destructor) XINE_MALLOC XINE_PROTECTED; int _x_refcounter_inc(refcounter_t *refcounter) XINE_PROTECTED; diff --git a/include/xine/ring_buffer.h b/include/xine/ring_buffer.h index efcffd3b7..5f104dc77 100644 --- a/include/xine/ring_buffer.h +++ b/include/xine/ring_buffer.h @@ -22,7 +22,7 @@ typedef struct xine_ring_buffer_s xine_ring_buffer_t; /* Creates a new ring buffer */ -xine_ring_buffer_t *xine_ring_buffer_new(size_t size) XINE_PROTECTED; +xine_ring_buffer_t *xine_ring_buffer_new(size_t size) XINE_MALLOC XINE_PROTECTED; /* Deletes a ring buffer */ void xine_ring_buffer_delete(xine_ring_buffer_t *ring_buffer) XINE_PROTECTED; diff --git a/include/xine/scratch.h b/include/xine/scratch.h index c0e591d31..1029276e3 100644 --- a/include/xine/scratch.h +++ b/include/xine/scratch.h @@ -51,6 +51,6 @@ struct scratch_buffer_s { pthread_mutex_t lock; }; -scratch_buffer_t *_x_new_scratch_buffer (int num_lines) XINE_PROTECTED; +scratch_buffer_t *_x_new_scratch_buffer (int num_lines) XINE_MALLOC XINE_PROTECTED; #endif diff --git a/include/xine/sorted_array.h b/include/xine/sorted_array.h index a1894eca3..c6fdd1c25 100644 --- a/include/xine/sorted_array.h +++ b/include/xine/sorted_array.h @@ -63,7 +63,7 @@ typedef struct xine_sarray_s xine_sarray_t; typedef int (*xine_sarray_comparator_t)(void*, void*); /* Constructor */ -xine_sarray_t *xine_sarray_new(size_t initial_size, xine_sarray_comparator_t comparator) XINE_PROTECTED; +xine_sarray_t *xine_sarray_new(size_t initial_size, xine_sarray_comparator_t comparator) XINE_MALLOC XINE_PROTECTED; /* Destructor */ void xine_sarray_delete(xine_sarray_t *sarray) XINE_PROTECTED; diff --git a/include/xine/video_out.h b/include/xine/video_out.h index 0bdd0f557..6952362ff 100644 --- a/include/xine/video_out.h +++ b/include/xine/video_out.h @@ -475,7 +475,7 @@ struct video_overlay_manager_s { * * @internal */ -xine_video_port_t *_x_vo_new_port (xine_t *xine, vo_driver_t *driver, int grabonly); +xine_video_port_t *_x_vo_new_port (xine_t *xine, vo_driver_t *driver, int grabonly) XINE_MALLOC; #ifdef __cplusplus } diff --git a/include/xine/video_overlay.h b/include/xine/video_overlay.h index b45f5149e..27cae6440 100644 --- a/include/xine/video_overlay.h +++ b/include/xine/video_overlay.h @@ -59,6 +59,6 @@ typedef struct video_overlay_event_s { video_overlay_object_t object; /* The image data. */ } video_overlay_event_t; -video_overlay_manager_t *_x_video_overlay_new_manager(xine_t *) XINE_PROTECTED; +video_overlay_manager_t *_x_video_overlay_new_manager(xine_t *) XINE_MALLOC XINE_PROTECTED; #endif diff --git a/include/xine/xine_internal.h b/include/xine/xine_internal.h index 805c569a3..b876030ee 100644 --- a/include/xine/xine_internal.h +++ b/include/xine/xine_internal.h @@ -98,6 +98,9 @@ struct xine_s { #ifdef XINE_ENGINE_INTERNAL xine_ticket_t *port_ticket; pthread_mutex_t log_lock; + + xine_log_cb_t log_cb; + void *log_cb_user_data; #endif }; @@ -377,26 +380,6 @@ int _x_message(xine_stream_t *stream, int type, ...) XINE_SENTINEL XINE_PROTECTE void _x_flush_events_queues (xine_stream_t *stream) XINE_PROTECTED; - -/* find and instantiate input and demux plugins */ - -input_plugin_t *_x_find_input_plugin (xine_stream_t *stream, const char *mrl) XINE_PROTECTED; -demux_plugin_t *_x_find_demux_plugin (xine_stream_t *stream, input_plugin_t *input) XINE_PROTECTED; -demux_plugin_t *_x_find_demux_plugin_by_name (xine_stream_t *stream, const char *name, input_plugin_t *input) XINE_PROTECTED; -demux_plugin_t *_x_find_demux_plugin_last_probe(xine_stream_t *stream, const char *last_demux_name, input_plugin_t *input) XINE_PROTECTED; -input_plugin_t *_x_rip_plugin_get_instance (xine_stream_t *stream, const char *filename) XINE_PROTECTED; -input_plugin_t *_x_cache_plugin_get_instance (xine_stream_t *stream, int readahead_size) XINE_PROTECTED; -void _x_free_input_plugin (xine_stream_t *stream, input_plugin_t *input) XINE_PROTECTED; -void _x_free_demux_plugin (xine_stream_t *stream, demux_plugin_t *demux) XINE_PROTECTED; - -/* create decoder fifos and threads */ - -int _x_video_decoder_init (xine_stream_t *stream) XINE_PROTECTED; -void _x_video_decoder_shutdown (xine_stream_t *stream) XINE_PROTECTED; - -int _x_audio_decoder_init (xine_stream_t *stream) XINE_PROTECTED; -void _x_audio_decoder_shutdown (xine_stream_t *stream) XINE_PROTECTED; - /* extra_info operations */ void _x_extra_info_reset( extra_info_t *extra_info ) XINE_PROTECTED; diff --git a/include/xine/xineutils.h b/include/xine/xineutils.h index 8ef64b143..3a215970e 100644 --- a/include/xine/xineutils.h +++ b/include/xine/xineutils.h @@ -113,7 +113,7 @@ extern "C" { #define MM_SSE MM_ACCEL_X86_SSE #define MM_SSE2 MM_ACCEL_X86_SSE2 -uint32_t xine_mm_accel (void) XINE_PROTECTED; +uint32_t xine_mm_accel (void) XINE_CONST XINE_PROTECTED; #if defined(ARCH_X86) || defined(ARCH_X86_64) @@ -587,12 +587,6 @@ typedef union { extern void *(* xine_fast_memcpy)(void *to, const void *from, size_t len) XINE_PROTECTED; -#ifdef HAVE_XINE_INTERNAL_H -/* Benchmark available memcpy methods */ -void xine_probe_fast_memcpy(xine_t *xine) XINE_PROTECTED; -#endif - - /* * Debug stuff */ @@ -609,7 +603,7 @@ void xine_profiler_print_results (void) XINE_PROTECTED; * Allocate and clean memory size_t 'size', then return the pointer * to the allocated memory. */ -void *xine_xmalloc(size_t size) XINE_MALLOC XINE_PROTECTED; +void *xine_xmalloc(size_t size) XINE_MALLOC XINE_DEPRECATED XINE_PROTECTED; void *xine_xcalloc(size_t nmemb, size_t size) XINE_MALLOC XINE_PROTECTED; @@ -628,6 +622,7 @@ const char *xine_get_homedir(void) XINE_PROTECTED; /* * Get other xine directories. */ +const char *xine_get_pluginroot(void) XINE_PROTECTED; const char *xine_get_plugindir(void) XINE_PROTECTED; const char *xine_get_fontdir(void) XINE_PROTECTED; const char *xine_get_localedir(void) XINE_PROTECTED; @@ -649,6 +644,13 @@ void xine_usec_sleep(unsigned usec) XINE_PROTECTED; #define xine_strsep(STRINGP, DELIM) strsep((STRINGP), (DELIM)) #define xine_setenv(NAME, VAL, XX) setenv((NAME), (VAL), (XX)) +/** + * append to a string, reallocating + * normally, updates & returns *dest + * on error, *dest is unchanged & NULL is returned. + */ +char *xine_strcat_realloc (char **dest, char *append) XINE_PROTECTED; + /* * Color Conversion Utility Functions * The following data structures and functions facilitate the conversion @@ -929,7 +931,7 @@ void xine_xprintf(xine_t *xine, int verbose, const char *fmt, ...); /** * get encoding of current locale */ -char *xine_get_system_encoding(void) XINE_PROTECTED; +char *xine_get_system_encoding(void) XINE_MALLOC XINE_PROTECTED; /* * guess default encoding for the subtitles |