Commit 94105be6 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

lib: actually return bool

This fixes the old int-for-bool return values from before 1.1.0 and the
later cargo culted ones.
parent 5c432216
......@@ -82,11 +82,10 @@ libvlc_media_parse_async( libvlc_media_t *p_md );
* \see libvlc_MediaParsedChanged
*
* \param p_md media descriptor object
* \return true if media object has been parsed otherwise it returns false
*
* \libvlc_return_bool
* \retval true media object has been parsed
* \retval false otherwise
*/
LIBVLC_DEPRECATED LIBVLC_API int
LIBVLC_DEPRECATED LIBVLC_API bool
libvlc_media_is_parsed( libvlc_media_t *p_md );
/** @}*/
......
......@@ -618,12 +618,11 @@ LIBVLC_API libvlc_state_t libvlc_media_get_state(
* \param p_md: media descriptor object
* \param p_stats: structure that contain the statistics about the media
* (this structure must be allocated by the caller)
* \return true if the statistics are available, false otherwise
*
* \libvlc_return_bool
* \retval true statistics are available
* \retval false otherwise
*/
LIBVLC_API int libvlc_media_get_stats( libvlc_media_t *p_md,
libvlc_media_stats_t *p_stats );
LIBVLC_API bool libvlc_media_get_stats(libvlc_media_t *p_md,
libvlc_media_stats_t *p_stats);
/* The following method uses libvlc_media_list_t, however, media_list usage is optionnal
* and this is here for convenience */
......
......@@ -139,12 +139,12 @@ libvlc_media_discoverer_media_list( libvlc_media_discoverer_t * p_mdis );
* Query if media service discover object is running.
*
* \param p_mdis media service discover object
* \return true if running, false if not
*
* \libvlc_return_bool
* \retval true running
* \retval false not running
*/
LIBVLC_API int
libvlc_media_discoverer_is_running( libvlc_media_discoverer_t * p_mdis );
LIBVLC_API bool
libvlc_media_discoverer_is_running(libvlc_media_discoverer_t *p_mdis);
/**
* Get media discoverer services by category
......
......@@ -158,12 +158,10 @@ LIBVLC_API int
* This indicates if this media list is read-only from a user point of view
*
* \param p_ml media list instance
* \return 1 on readonly, 0 on readwrite
*
* \libvlc_return_bool
* \retval true read-only
* \retval false read/write
*/
LIBVLC_API int
libvlc_media_list_is_readonly( libvlc_media_list_t * p_ml );
LIBVLC_API bool libvlc_media_list_is_readonly(libvlc_media_list_t *p_ml);
/**
* Get lock on media list items
......
......@@ -153,12 +153,12 @@ void libvlc_media_list_player_set_pause(libvlc_media_list_player_t * p_mlp,
* Is media list playing?
*
* \param p_mlp media list player instance
* \return true for playing and false for not playing
*
* \libvlc_return_bool
* \retval true playing
* \retval false not playing
*/
LIBVLC_API int
libvlc_media_list_player_is_playing( libvlc_media_list_player_t * p_mlp );
LIBVLC_API bool
libvlc_media_list_player_is_playing(libvlc_media_list_player_t * p_mlp);
/**
* Get current libvlc_state of media list player
......
......@@ -235,11 +235,10 @@ LIBVLC_API libvlc_event_manager_t * libvlc_media_player_event_manager ( libvlc_m
* is_playing
*
* \param p_mi the Media Player
* \return 1 if the media player is playing, 0 otherwise
*
* \libvlc_return_bool
* \retval true media player is playing
* \retval false media player is not playing
*/
LIBVLC_API int libvlc_media_player_is_playing ( libvlc_media_player_t *p_mi );
LIBVLC_API bool libvlc_media_player_is_playing(libvlc_media_player_t *p_mi);
/**
* Play
......@@ -579,11 +578,13 @@ typedef enum libvlc_video_engine_t {
* \param makeCurrent_cb callback called to enter/leave the opengl context (cannot be NULL for \ref libvlc_video_engine_opengl and for \ref libvlc_video_engine_gles2)
* \param getProcAddress_cb opengl function loading callback (cannot be NULL for \ref libvlc_video_engine_opengl and for \ref libvlc_video_engine_gles2)
* \param opaque private pointer passed to callbacks
* \libvlc_return_bool
*
* \retval true engine selected and callbacks set
* \retval false engine type unknown, callbacks not set
* \version LibVLC 4.0.0 or later
*/
LIBVLC_API
int libvlc_video_set_output_callbacks( libvlc_media_player_t *mp,
bool libvlc_video_set_output_callbacks( libvlc_media_player_t *mp,
libvlc_video_engine_t engine,
libvlc_video_setup_cb setup_cb,
libvlc_video_cleanup_cb cleanup_cb,
......@@ -778,11 +779,13 @@ typedef bool( *libvlc_video_direct3d_select_plane_cb )( void *opaque, size_t pla
* \param makeCurrent_cb callback to tell the host the rendering is starting/ended (cannot be NULL)
* \param select_plane_cb callback to select different D3D11 rendering targets
* \param opaque private pointer passed to the \ref cleanup_cb callback
* \libvlc_return_bool
*
* \retval true Direct3D selected and callbacks set
* \retval false Direct3D version, callbacks not set
* \version LibVLC 4.0.0 or later
*/
LIBVLC_API
int libvlc_video_direct3d_set_callbacks( libvlc_media_player_t *mp,
bool libvlc_video_direct3d_set_callbacks( libvlc_media_player_t *mp,
libvlc_video_direct3d_engine_t engine,
libvlc_video_direct3d_device_setup_cb setup_cb,
libvlc_video_direct3d_device_cleanup_cb cleanup_cb,
......@@ -1177,9 +1180,7 @@ LIBVLC_API int libvlc_media_player_get_chapter_count( libvlc_media_player_t *p_m
* Is the player able to play
*
* \param p_mi the Media Player
* \return boolean
*
* \libvlc_return_bool
* \retval boolean
*/
LIBVLC_API int libvlc_media_player_will_play( libvlc_media_player_t *p_mi );
......@@ -1271,32 +1272,30 @@ LIBVLC_API unsigned libvlc_media_player_has_vout( libvlc_media_player_t *p_mi );
* Is this media player seekable?
*
* \param p_mi the media player
* \return true if the media player can seek
*
* \libvlc_return_bool
* \retval true media player can seek
* \retval false media player cannot seek
*/
LIBVLC_API int libvlc_media_player_is_seekable( libvlc_media_player_t *p_mi );
LIBVLC_API bool libvlc_media_player_is_seekable(libvlc_media_player_t *p_mi);
/**
* Can this media player be paused?
*
* \param p_mi the media player
* \return true if the media player can pause
*
* \libvlc_return_bool
* \retval true media player can be paused
* \retval false media player cannot be paused
*/
LIBVLC_API int libvlc_media_player_can_pause( libvlc_media_player_t *p_mi );
LIBVLC_API bool libvlc_media_player_can_pause(libvlc_media_player_t *p_mi);
/**
* Check if the current program is scrambled
*
* \param p_mi the media player
* \return true if the current program is scrambled
* \retval true current program is scrambled
* \retval false current program is not scrambled
*
* \libvlc_return_bool
* \version LibVLC 2.2.0 or later
*/
LIBVLC_API int libvlc_media_player_program_scrambled( libvlc_media_player_t *p_mi );
LIBVLC_API bool libvlc_media_player_program_scrambled( libvlc_media_player_t *p_mi );
/**
* Display the next frame (if supported)
......@@ -1393,9 +1392,10 @@ LIBVLC_API void libvlc_set_fullscreen(libvlc_media_player_t *p_mi, bool b_fullsc
* \param p_mi the media player
* \return the fullscreen status (boolean)
*
* \libvlc_return_bool
* \retval false media player is windowed
* \retval true media player is in fullscreen mode
*/
LIBVLC_API int libvlc_get_fullscreen( libvlc_media_player_t *p_mi );
LIBVLC_API bool libvlc_get_fullscreen( libvlc_media_player_t *p_mi );
/**
* Enable or disable key press events handling, according to the LibVLC hotkeys
......
......@@ -697,8 +697,8 @@ libvlc_media_subitems( libvlc_media_t * p_md )
/**************************************************************************
* Getter for statistics information
**************************************************************************/
int libvlc_media_get_stats( libvlc_media_t *p_md,
libvlc_media_stats_t *p_stats )
bool libvlc_media_get_stats(libvlc_media_t *p_md,
libvlc_media_stats_t *p_stats)
{
input_item_t *item = p_md->p_input_item;
......@@ -864,8 +864,7 @@ libvlc_media_parse_stop( libvlc_media_t *media )
/**************************************************************************
* Get parsed status for media object.
**************************************************************************/
int
libvlc_media_is_parsed(libvlc_media_t *media)
bool libvlc_media_is_parsed(libvlc_media_t *media)
{
bool parsed;
......
......@@ -251,8 +251,7 @@ libvlc_media_discoverer_media_list( libvlc_media_discoverer_t * p_mdis )
/**************************************************************************
* running (Public)
**************************************************************************/
int
libvlc_media_discoverer_is_running( libvlc_media_discoverer_t * p_mdis )
bool libvlc_media_discoverer_is_running(libvlc_media_discoverer_t * p_mdis)
{
return p_mdis->p_sd != NULL;
}
......
......@@ -446,7 +446,7 @@ int libvlc_media_list_index_of_item( libvlc_media_list_t * p_mlist,
*
* This indicates if this media list is read-only from a user point of view
**************************************************************************/
int libvlc_media_list_is_readonly( libvlc_media_list_t * p_mlist )
bool libvlc_media_list_is_readonly( libvlc_media_list_t * p_mlist )
{
return p_mlist->b_read_only;
}
......
......@@ -660,8 +660,7 @@ void libvlc_media_list_player_set_pause(libvlc_media_list_player_t * p_mlp,
/**************************************************************************
* is_playing (Public)
**************************************************************************/
int
libvlc_media_list_player_is_playing(libvlc_media_list_player_t * p_mlp)
bool libvlc_media_list_player_is_playing(libvlc_media_list_player_t * p_mlp)
{
libvlc_state_t state = libvlc_media_player_get_state(p_mlp->p_mi);
return (state == libvlc_Opening) || (state == libvlc_Playing);
......
......@@ -1081,7 +1081,7 @@ void libvlc_media_player_pause( libvlc_media_player_t *p_mi )
/**************************************************************************
* Tells whether the media player is currently playing.
**************************************************************************/
int libvlc_media_player_is_playing( libvlc_media_player_t *p_mi )
bool libvlc_media_player_is_playing(libvlc_media_player_t *p_mi)
{
libvlc_state_t state = libvlc_media_player_get_state( p_mi );
return libvlc_Playing == state;
......@@ -1162,15 +1162,15 @@ void libvlc_video_set_format( libvlc_media_player_t *mp, const char *chroma,
var_SetInteger( mp, "vmem-pitch", pitch );
}
int libvlc_video_set_output_callbacks( libvlc_media_player_t *mp,
libvlc_video_engine_t engine,
libvlc_video_setup_cb setup_cb,
libvlc_video_cleanup_cb cleanup_cb,
libvlc_video_update_output_cb update_output_cb,
libvlc_video_swap_cb swap_cb,
libvlc_video_makeCurrent_cb makeCurrent_cb,
libvlc_video_getProcAddress_cb getProcAddress_cb,
void* opaque )
bool libvlc_video_set_output_callbacks(libvlc_media_player_t *mp,
libvlc_video_engine_t engine,
libvlc_video_setup_cb setup_cb,
libvlc_video_cleanup_cb cleanup_cb,
libvlc_video_update_output_cb update_output_cb,
libvlc_video_swap_cb swap_cb,
libvlc_video_makeCurrent_cb makeCurrent_cb,
libvlc_video_getProcAddress_cb getProcAddress_cb,
void *opaque)
{
#ifdef __ANDROID__
//use the default android window
......@@ -1190,7 +1190,7 @@ int libvlc_video_set_output_callbacks( libvlc_media_player_t *mp,
var_SetString ( mp, "gl", "vgl");
}
else
return 0;
return false;
var_SetAddress( mp, "vout-cb-opaque", opaque );
var_SetAddress( mp, "vout-cb-setup", setup_cb );
......@@ -1199,19 +1199,19 @@ int libvlc_video_set_output_callbacks( libvlc_media_player_t *mp,
var_SetAddress( mp, "vout-cb-swap", swap_cb );
var_SetAddress( mp, "vout-cb-get-proc-address", getProcAddress_cb );
var_SetAddress( mp, "vout-cb-make-current", makeCurrent_cb );
return 1;
return true;
}
int libvlc_video_direct3d_set_callbacks( libvlc_media_player_t *mp,
libvlc_video_direct3d_engine_t engine,
libvlc_video_direct3d_device_setup_cb setup_cb,
libvlc_video_direct3d_device_cleanup_cb cleanup_cb,
libvlc_video_direct3d_update_output_cb update_output_cb,
libvlc_video_swap_cb swap_cb,
libvlc_video_direct3d_start_end_rendering_cb makeCurrent_cb,
libvlc_video_direct3d_select_plane_cb select_plane_cb,
void* opaque )
bool libvlc_video_direct3d_set_callbacks(libvlc_media_player_t *mp,
libvlc_video_direct3d_engine_t engine,
libvlc_video_direct3d_device_setup_cb setup_cb,
libvlc_video_direct3d_device_cleanup_cb cleanup_cb,
libvlc_video_direct3d_update_output_cb update_output_cb,
libvlc_video_swap_cb swap_cb,
libvlc_video_direct3d_start_end_rendering_cb makeCurrent_cb,
libvlc_video_direct3d_select_plane_cb select_plane_cb,
void *opaque)
{
var_SetString( mp, "window", "wdummy");
......@@ -1226,7 +1226,7 @@ int libvlc_video_direct3d_set_callbacks( libvlc_media_player_t *mp,
var_SetString ( mp, "avcodec-hw", "dxva2");
}
else
return 0;
return false;
var_SetAddress( mp, "vout-cb-opaque", opaque );
var_SetAddress( mp, "vout-cb-setup", setup_cb );
......@@ -1235,7 +1235,7 @@ int libvlc_video_direct3d_set_callbacks( libvlc_media_player_t *mp,
var_SetAddress( mp, "vout-cb-swap", swap_cb );
var_SetAddress( mp, "vout-cb-make-current", makeCurrent_cb );
var_SetAddress( mp, "vout-cb-select-plane", select_plane_cb );
return 1;
return true;
}
/**************************************************************************
......@@ -1814,7 +1814,7 @@ libvlc_state_t libvlc_media_player_get_state( libvlc_media_player_t *p_mi )
return state;
}
int libvlc_media_player_is_seekable( libvlc_media_player_t *p_mi )
bool libvlc_media_player_is_seekable(libvlc_media_player_t *p_mi)
{
input_thread_t *p_input_thread;
bool b_seekable;
......@@ -1905,7 +1905,7 @@ void libvlc_track_description_list_release( libvlc_track_description_t *p_td )
}
}
int libvlc_media_player_can_pause( libvlc_media_player_t *p_mi )
bool libvlc_media_player_can_pause(libvlc_media_player_t *p_mi)
{
input_thread_t *p_input_thread;
bool b_can_pause;
......@@ -1919,7 +1919,7 @@ int libvlc_media_player_can_pause( libvlc_media_player_t *p_mi )
return b_can_pause;
}
int libvlc_media_player_program_scrambled( libvlc_media_player_t *p_mi )
bool libvlc_media_player_program_scrambled(libvlc_media_player_t *p_mi)
{
input_thread_t *p_input_thread;
bool b_program_scrambled;
......
......@@ -109,7 +109,7 @@ void libvlc_set_fullscreen(libvlc_media_player_t *p_mi, bool b_fullscreen)
free (pp_vouts);
}
int libvlc_get_fullscreen( libvlc_media_player_t *p_mi )
bool libvlc_get_fullscreen( libvlc_media_player_t *p_mi )
{
return var_GetBool (p_mi, "fullscreen");
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment