X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=include%2Fvlc_vlm.h;h=b3c712aa66a2839704181089ed738e00e7484da8;hb=4e9597b800d1140dfab1cf33c3df8c608d58878f;hp=563f2b4cbe27da5964b3f708b571891052fb39e3;hpb=f464bb35e8601535462bfd1bbcd8d2de79d404d7;p=vlc diff --git a/include/vlc_vlm.h b/include/vlc_vlm.h index 563f2b4cbe..b3c712aa66 100644 --- a/include/vlc_vlm.h +++ b/include/vlc_vlm.h @@ -22,24 +22,16 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ -#if !defined( __LIBVLC__ ) - #error You are not libvlc or one of its plugins. You cannot include this file -#endif - #ifndef _VLC_VLM_H #define _VLC_VLM_H 1 -#ifdef __cpluplus -extern "C" { -#endif - #include /* VLM media */ typedef struct { int64_t id; - vlc_bool_t b_enabled; + bool b_enabled; /* */ char *psz_name; @@ -54,10 +46,10 @@ typedef struct char *psz_output; /* */ - vlc_bool_t b_vod; + bool b_vod; struct { - vlc_bool_t b_loop; + bool b_loop; } broadcast; struct { @@ -74,7 +66,7 @@ typedef struct int64_t i_time; int64_t i_length; double d_position; - vlc_bool_t b_paused; + bool b_paused; int i_rate; // normal is INPUT_RATE_DEFAULT } vlm_media_instance_t; @@ -151,13 +143,17 @@ struct vlm_message_t }; +#ifdef __cpluplus +extern "C" { +#endif + #define vlm_New( a ) __vlm_New( VLC_OBJECT(a) ) VLC_EXPORT( vlm_t *, __vlm_New, ( vlc_object_t * ) ); VLC_EXPORT( void, vlm_Delete, ( vlm_t * ) ); VLC_EXPORT( int, vlm_ExecuteCommand, ( vlm_t *, const char *, vlm_message_t ** ) ); VLC_EXPORT( int, vlm_Control, ( vlm_t *p_vlm, int i_query, ... ) ); -VLC_EXPORT( vlm_message_t *, vlm_MessageNew, ( const char *, const char *, ... ) ATTRIBUTE_FORMAT( 2, 3 ) ); +VLC_EXPORT( vlm_message_t *, vlm_MessageNew, ( const char *, const char *, ... ) LIBVLC_FORMAT( 2, 3 ) ); VLC_EXPORT( vlm_message_t *, vlm_MessageAdd, ( vlm_message_t *, vlm_message_t * ) ); VLC_EXPORT( void, vlm_MessageDelete, ( vlm_message_t * ) ); @@ -170,10 +166,10 @@ static inline void vlm_media_Init( vlm_media_t *p_media ) TAB_INIT( p_media->i_input, p_media->ppsz_input ); TAB_INIT( p_media->i_option, p_media->ppsz_option ); p_media->psz_output = NULL; - p_media->b_vod = VLC_FALSE; + p_media->b_vod = false; p_media->vod.psz_mux = NULL; - p_media->broadcast.b_loop = VLC_FALSE; + p_media->broadcast.b_loop = false; } static inline void vlm_media_Copy( vlm_media_t *p_dst, vlm_media_t *p_src ) @@ -208,8 +204,7 @@ static inline void vlm_media_Copy( vlm_media_t *p_dst, vlm_media_t *p_src ) static inline void vlm_media_Clean( vlm_media_t *p_media ) { int i; - if( p_media->psz_name ) - free( p_media->psz_name ); + free( p_media->psz_name ); for( i = 0; i < p_media->i_input; i++ ) free( p_media->ppsz_input[i]) ; @@ -219,17 +214,13 @@ static inline void vlm_media_Clean( vlm_media_t *p_media ) free( p_media->ppsz_option[i]) ; TAB_CLEAN(p_media->i_option, p_media->ppsz_option ); - if( p_media->psz_output ) - free( p_media->psz_output ); + free( p_media->psz_output ); if( p_media->b_vod ) - { - if( p_media->vod.psz_mux ) - free( p_media->vod.psz_mux ); - } + free( p_media->vod.psz_mux ); } static inline vlm_media_t *vlm_media_New(void) { - vlm_media_t *p_media = malloc( sizeof(vlm_media_t) ); + vlm_media_t *p_media = (vlm_media_t *)malloc( sizeof(vlm_media_t) ); if( p_media ) vlm_media_Init( p_media ); return p_media; @@ -255,17 +246,16 @@ static inline void vlm_media_instance_Init( vlm_media_instance_t *p_instance ) p_instance->i_time = 0; p_instance->i_length = 0; p_instance->d_position = 0.0; - p_instance->b_paused = VLC_FALSE; + p_instance->b_paused = false; p_instance->i_rate = INPUT_RATE_DEFAULT; } static inline void vlm_media_instance_Clean( vlm_media_instance_t *p_instance ) { - if( p_instance->psz_name ) - free( p_instance->psz_name ); + free( p_instance->psz_name ); } static inline vlm_media_instance_t *vlm_media_instance_New(void) { - vlm_media_instance_t *p_instance = malloc( sizeof(vlm_media_instance_t) ); + vlm_media_instance_t *p_instance = (vlm_media_instance_t *) malloc( sizeof(vlm_media_instance_t) ); if( p_instance ) vlm_media_instance_Init( p_instance ); return p_instance;