diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/xine.h | 5 | ||||
-rw-r--r-- | include/xine/array.h | 2 | ||||
-rw-r--r-- | include/xine/attributes.h | 7 | ||||
-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 | 7 | ||||
-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 | 3 | ||||
-rw-r--r-- | include/xine/xineutils.h | 23 |
20 files changed, 48 insertions, 31 deletions
diff --git a/include/xine.h b/include/xine.h index ba022c389..f3c79a7b4 100644 --- a/include/xine.h +++ b/include/xine.h @@ -802,6 +802,11 @@ void xine_vlog(xine_t *self, int buf, /* get log messages of specified section */ char *const *xine_get_log (xine_t *self, int buf) XINE_PROTECTED; +/* log callback will be called whenever something is logged */ +typedef void (*xine_log_cb_t) (void *user_data, int section); +void xine_register_log_cb (xine_t *self, xine_log_cb_t cb, + void *user_data) XINE_PROTECTED; + /* * error handling / engine status */ 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 29bb9f28f..3819818d5 100644 --- a/include/xine/attributes.h +++ b/include/xine/attributes.h @@ -45,6 +45,7 @@ # 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 @@ -109,4 +110,10 @@ # define XINE_PACKED #endif +#ifdef SUPPORT_ATTRIBUTE_CONST +# define XINE_CONST __attribute__((__const__)) +#else +# 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 2ee9c6e74..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 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 eecae9c30..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 }; diff --git a/include/xine/xineutils.h b/include/xine/xineutils.h index dbe5199dd..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) @@ -608,13 +608,6 @@ 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; /* - * Same as above, but memory is aligned to 'alignement'. - * **base is used to return pointer to un-aligned memory, use - * this to free the mem chunk - */ -void *xine_xmalloc_aligned(size_t alignment, size_t size, void **base) XINE_PROTECTED; - -/* * Copy blocks of memory. */ void *xine_memdup (const void *src, size_t length) XINE_MALLOC XINE_PROTECTED; @@ -651,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 @@ -931,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 @@ -945,11 +945,6 @@ const char *xine_guess_spu_encoding(void) XINE_PROTECTED; int xine_monotonic_clock(struct timeval *tv, struct timezone *tz) XINE_PROTECTED; /** - * CRC functions - */ -uint32_t _x_compute_crc32 (const uint8_t * data, int32_t length, uint32_t crc32) XINE_PROTECTED; - -/** * Unknown FourCC reporting functions */ void _x_report_video_fourcc (xine_t *, const char *module, uint32_t) XINE_PROTECTED; |