#include <windows.h>
#include <vlc/vlc.h>
#include "hbapi.h"
#include "hbapiitm.h"
#include "hbapierr.h"
#include "hbapistr.h"
#include "hbapicls.h"
//------------------------------------------------------------------------------
/**
* libvlc_instance_t * libvlc_new( int argc, const char *const * argv )
* Create and initialize a libvlc instance.
* Parameters
* argc the number of arguments (should be 0)
* argv list of arguments (should be NULL)
* Returns
* the libvlc instance or NULL in case of error
*/
HB_FUNC( MYVLC_NEW )
{
libvlc_instance_t* hVlc = libvlc_new( 0, NULL );
if( hVlc )
{
hb_retptr( hVlc );
}
else
{
hb_errRT_BASE( EG_ARG, 2020, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
}
}
//------------------------------------------------------------------------------
/**
* LIBVLC_API libvlc_media_t *libvlc_media_new_path(
* libvlc_instance_t *p_instance,
* const char *path );
* Create a media for a certain file path.
*
* \see libvlc_media_release
*
* \param p_instance the instance
* \param path local filesystem path
* \return the newly created media or NULL on error
*/
HB_FUNC( MYVLC_MEDIA_NEW )
{
libvlc_instance_t *hVlc = (libvlc_instance_t *) hb_parptr( 1 );
if( hVlc )
{
void *pstrFileName = NULL;
hb_retptr( (void *) libvlc_media_new_path( hVlc, hb_parstr_utf8( 2, &pstrFileName, NULL ) ) );
hb_strfree( pstrFileName );
}
else
{
hb_errRT_BASE( EG_ARG, 2020, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
}
}
//------------------------------------------------------------------------------
/**
* LIBVLC_API libvlc_media_player_t * libvlc_media_player_new( libvlc_instance_t *p_libvlc_instance );
* Create an empty Media Player object
*
* \param p_libvlc_instance the libvlc instance in which the Media Player
* should be created.
* \return a new media player object, or NULL on error.
*/
HB_FUNC( MYVLC_MEDIA_PLAYER_NEW )
{
libvlc_instance_t *hVlc = (libvlc_instance_t *) hb_parptr( 1 );
if( hVlc )
{
libvlc_media_player_t *hMediaPlayer;
hMediaPlayer = libvlc_media_player_new( hVlc );
hb_retptr( hMediaPlayer );
}
else
{
hb_errRT_BASE( EG_ARG, 2020, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
}
}
//------------------------------------------------------------------------------
/**
* LIBVLC_API libvlc_media_player_t * libvlc_media_player_new_from_media( libvlc_media_t *p_md );
* Create a Media Player object from a Media
*
* \param p_md the media. Afterwards the p_md can be safely
* destroyed.
* \return a new media player object, or NULL on error.
*/
HB_FUNC( MYVLC_MEDIA_PLAYER_NEW_FROM_MEDIA )
{
libvlc_media_t *hMedia = (libvlc_media_t *) hb_parptr( 1 );
if( hMedia )
{
libvlc_media_player_t *hMediaPlayer;
hMediaPlayer = libvlc_media_player_new_from_media( hMedia );
hb_retptr( hMediaPlayer );
}
else
{
hb_errRT_BASE( EG_ARG, 2020, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
}
}
//------------------------------------------------------------------------------
/**
* LIBVLC_API void libvlc_media_player_set_media( libvlc_media_player_t *p_mi,
* libvlc_media_t *p_md );
* Set the media that will be used by the media_player. If any,
* previous md will be released.
*
* \param p_mi the Media Player
* \param p_md the Media. Afterwards the p_md can be safely
* destroyed.
*/
HB_FUNC( MYVLC_MEDIA_PLAYER_SET_MEDIA )
{
libvlc_media_player_t *hMediaPlayer = (libvlc_media_player_t *) hb_parptr( 1 );
libvlc_media_t *hMedia = (libvlc_media_t *) hb_parptr( 2 );
if( hMediaPlayer && hMedia )
{
libvlc_media_player_set_media( hMediaPlayer, hMedia );
}
else
{
hb_errRT_BASE( EG_ARG, 2020, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
}
}
//------------------------------------------------------------------------------
/**
* LIBVLC_API void libvlc_media_player_set_hwnd ( libvlc_media_player_t *p_mi, void *drawable );
* Set a Win32/Win64 API window handle (HWND) where the media player should
* render its video output. If LibVLC was built without Win32/Win64 API output
* support, then this has no effects.
*
* \warning the HWND must have the WS_CLIPCHILDREN set in its style.
*
* \param p_mi the Media Player
* \param drawable windows handle of the drawable
*/
HB_FUNC( MYVLC_MEDIA_PLAYER_SET_HWND )
{
libvlc_media_player_t *hMediaPlayer = (libvlc_media_player_t *) hb_parptr( 1 );
HWND hWnd = (HWND) hb_parnl( 2 );
if( hMediaPlayer && hWnd )
{
libvlc_media_player_set_hwnd( hMediaPlayer, hWnd );
}
else
{
hb_errRT_BASE( EG_ARG, 2020, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
}
}
//------------------------------------------------------------------------------
/**
* LIBVLC_API void *libvlc_media_player_get_hwnd ( libvlc_media_player_t *p_mi );
* Get the Windows API window handle (HWND) previously set with
* libvlc_media_player_set_hwnd(). The handle will be returned even if LibVLC
* is not currently outputting any video to it.
*
* \param p_mi the Media Player
* \return a window handle or NULL if there are none.
*/
HB_FUNC( MYVLC_MEDIA_PLAYER_GET_HWND )
{
libvlc_media_player_t *hMediaPlayer = (libvlc_media_player_t *) hb_parptr( 1 );
if( hMediaPlayer )
{
hb_retnl( (HB_LONG) libvlc_media_player_get_hwnd( hMediaPlayer ) );
}
else
{
hb_errRT_BASE( EG_ARG, 2020, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
}
}
//------------------------------------------------------------------------------
/**
* Is the player able to play
* LIBVLC_API int libvlc_media_player_will_play( libvlc_media_player_t *p_mi );
*
* \param p_mi the Media Player
* \return boolean
*
* \libvlc_return_bool
*/
HB_FUNC( MYVLC_MEDIA_PLAYER_WILL_PLAY )
{
libvlc_media_player_t *hMediaPlayer = (libvlc_media_player_t *) hb_parptr( 1 );
if( hMediaPlayer )
{
hb_retl( (HB_BOOL) libvlc_media_player_will_play( hMediaPlayer ) );
}
else
{
hb_errRT_BASE( EG_ARG, 2020, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
}
}
//------------------------------------------------------------------------------
/**
* LIBVLC_API int libvlc_media_player_play ( libvlc_media_player_t *p_mi );
* Play
*
* \param p_mi the Media Player
* \return 0 if playback started (and was already started), or -1 on error.
*/
HB_FUNC( MYVLC_MEDIA_PLAYER_PLAY )
{
libvlc_media_player_t *hMediaPlayer = (libvlc_media_player_t *) hb_parptr( 1 );
if( hMediaPlayer )
{
hb_retl( (HB_BOOL) libvlc_media_player_play( hMediaPlayer ) );
}
else
{
hb_errRT_BASE( EG_ARG, 2020, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
}
}
//------------------------------------------------------------------------------
/**
* LIBVLC_API int libvlc_media_player_is_playing ( libvlc_media_player_t *p_mi );
* is_playing
*
* \param p_mi the Media Player
* \return 1 if the media player is playing, 0 otherwise
*
* \libvlc_return_bool
*/
HB_FUNC( MYVLC_MEDIA_PLAYER_ISPLAYING )
{
libvlc_media_player_t *hMediaPlayer = (libvlc_media_player_t *) hb_parptr( 1 );
if( hMediaPlayer )
{
hb_retl( (HB_BOOL) libvlc_media_player_is_playing( hMediaPlayer ) );
}
else
{
hb_errRT_BASE( EG_ARG, 2020, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
}
}
//------------------------------------------------------------------------------
/**
* LIBVLC_API int libvlc_media_player_can_pause( 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
*/
HB_FUNC( MYVLC_MEDIA_PLAYER_CAN_PAUSE )
{
libvlc_media_player_t *hMediaPlayer = (libvlc_media_player_t *) hb_parptr( 1 );
if( hMediaPlayer )
{
hb_retl( (HB_BOOL) libvlc_media_player_can_pause( hMediaPlayer ) );
}
else
{
hb_errRT_BASE( EG_ARG, 2020, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
}
}
//------------------------------------------------------------------------------
/**
* LIBVLC_API void libvlc_media_player_set_pause ( libvlc_media_player_t *mp,
* int do_pause );
* Pause or resume (no effect if there is no media)
*
* \param mp the Media Player
* \param do_pause play/resume if zero, pause if non-zero
* \version LibVLC 1.1.1 or later
*/
HB_FUNC( MYVLC_MEDIA_PLAYER_SET_PAUSE )
{
libvlc_media_player_t *hMediaPlayer = (libvlc_media_player_t *) hb_parptr( 1 );
if( hMediaPlayer )
{
libvlc_media_player_set_pause( hMediaPlayer, (int) hb_parl( 2 ) );
}
else
{
hb_errRT_BASE( EG_ARG, 2020, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
}
}
//------------------------------------------------------------------------------
/**
* LIBVLC_API void libvlc_media_player_pause ( libvlc_media_player_t *p_mi );
* Toggle pause (no effect if there is no media)
*
* \param p_mi the Media Player
*/
HB_FUNC( MYVLC_MEDIA_PLAYER_PAUSE )
{
libvlc_media_player_t *hMediaPlayer = (libvlc_media_player_t *) hb_parptr( 1 );
if( hMediaPlayer )
{
libvlc_media_player_pause( hMediaPlayer );
}
else
{
hb_errRT_BASE( EG_ARG, 2020, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
}
}
//------------------------------------------------------------------------------
/**
* LIBVLC_API void libvlc_media_player_stop ( libvlc_media_player_t *p_mi );
* Stop (no effect if there is no media)
*
* \param p_mi the Media Player
*/
HB_FUNC( MYVLC_MEDIA_PLAYER_STOP )
{
libvlc_media_player_t *hMediaPlayer = (libvlc_media_player_t *) hb_parptr( 1 );
if( hMediaPlayer )
{
libvlc_media_player_stop( hMediaPlayer );
}
else
{
hb_errRT_BASE( EG_ARG, 2020, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
}
}
//------------------------------------------------------------------------------
/**
* LIBVLC_API libvlc_time_t libvlc_media_player_get_length( libvlc_media_player_t *p_mi );
* Get the current movie length (in ms).
*
* \param p_mi the Media Player
* \return the movie length (in ms), or -1 if there is no media.
*/
HB_FUNC( MYVLC_MEDIA_PLAYER_GET_LENGTH )
{
libvlc_media_player_t *hMediaPlayer = (libvlc_media_player_t *) hb_parptr( 1 );
if( hMediaPlayer )
{
hb_retnl( (HB_ULONG) libvlc_media_player_get_length( hMediaPlayer ) );
}
else
{
hb_errRT_BASE( EG_ARG, 2020, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
}
}
//------------------------------------------------------------------------------
/**
* LIBVLC_API libvlc_time_t libvlc_media_player_get_time( libvlc_media_player_t *p_mi );
* Get the current movie time (in ms).
*
* \param p_mi the Media Player
* \return the movie time (in ms), or -1 if there is no media.
*/
HB_FUNC( MYVLC_MEDIA_PLAYER_GET_TIME )
{
libvlc_media_player_t *hMediaPlayer = (libvlc_media_player_t *) hb_parptr( 1 );
if( hMediaPlayer )
{
hb_retnl( (HB_ULONG) libvlc_media_player_get_time( hMediaPlayer ) );
}
else
{
hb_errRT_BASE( EG_ARG, 2020, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
}
}
//------------------------------------------------------------------------------
/**
* LIBVLC_API float libvlc_media_player_get_position( libvlc_media_player_t *p_mi );
* Get movie position as percentage between 0.0 and 1.0.
*
* \param p_mi the Media Player
* \return movie position, or -1. in case of error
*/
HB_FUNC( MYVLC_MEDIA_PLAYER_GET_POSITION )
{
libvlc_media_player_t *hMediaPlayer = (libvlc_media_player_t *) hb_parptr( 1 );
if( hMediaPlayer )
{
hb_retnd( (double) libvlc_media_player_get_position( hMediaPlayer ) );
}
else
{
hb_errRT_BASE( EG_ARG, 2020, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
}
}
//------------------------------------------------------------------------------
/**
* LIBVLC_API void libvlc_media_player_set_position( libvlc_media_player_t *p_mi, float f_pos );
* Set movie position as percentage between 0.0 and 1.0.
* This has no effect if playback is not enabled.
* This might not work depending on the underlying input format and protocol.
*
* \param p_mi the Media Player
* \param f_pos the position
*/
HB_FUNC( MYVLC_MEDIA_PLAYER_SET_POSITION )
{
libvlc_media_player_t *hMediaPlayer = (libvlc_media_player_t *) hb_parptr( 1 );
if( hMediaPlayer )
{
libvlc_media_player_set_position( hMediaPlayer, (float) hb_parnd( 2 ) );
}
else
{
hb_errRT_BASE( EG_ARG, 2020, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
}
}
//------------------------------------------------------------------------------
/**
* LIBVLC_API void libvlc_set_fullscreen( libvlc_media_player_t *p_mi, int b_fullscreen );
* Enable or disable fullscreen.
*
* @warning With most window managers, only a top-level windows can be in
* full-screen mode. Hence, this function will not operate properly if
* libvlc_media_player_set_xwindow() was used to embed the video in a
* non-top-level window. In that case, the embedding window must be reparented
* to the root window <b>before</b> fullscreen mode is enabled. You will want
* to reparent it back to its normal parent when disabling fullscreen.
*
* \param p_mi the media player
* \param b_fullscreen boolean for fullscreen status
*/
HB_FUNC( MYVLC_SET_FULLSCREEN )
{
libvlc_media_player_t *hMediaPlayer = (libvlc_media_player_t *) hb_parptr( 1 );
if( hMediaPlayer )
{
libvlc_set_fullscreen( hMediaPlayer, (int) hb_parl( 2 ) );
}
else
{
hb_errRT_BASE( EG_ARG, 2020, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
}
}
//------------------------------------------------------------------------------
/**
* LIBVLC_API int libvlc_get_fullscreen( libvlc_media_player_t *p_mi );
* Get current fullscreen status.
*
* \param p_mi the media player
* \return the fullscreen status (boolean)
*
* \libvlc_return_bool
*/
HB_FUNC( MYVLC_GET_FULLSCREEN )
{
libvlc_media_player_t *hMediaPlayer = (libvlc_media_player_t *) hb_parptr( 1 );
if( hMediaPlayer )
{
hb_retl( (HB_BOOL) libvlc_get_fullscreen( hMediaPlayer ) );
}
else
{
hb_errRT_BASE( EG_ARG, 2020, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
}
}
//------------------------------------------------------------------------------
/**
* LIBVLC_API
* void libvlc_video_set_key_input( libvlc_media_player_t *p_mi, unsigned on );
* Enable or disable key press events handling, according to the LibVLC hotkeys
* configuration. By default and for historical reasons, keyboard events are
* handled by the LibVLC video widget.
*
* \note On X11, there can be only one subscriber for key press and mouse
* click events per window. If your application has subscribed to those events
* for the X window ID of the video widget, then LibVLC will not be able to
* handle key presses and mouse clicks in any case.
*
* \warning This function is only implemented for X11 and Win32 at the moment.
*
* \param p_mi the media player
* \param on true to handle key press events, false to ignore them.
*/
HB_FUNC( MYVLC_VIDEO_SET_KEY_INPUT )
{
libvlc_media_player_t *hMediaPlayer = (libvlc_media_player_t *) hb_parptr( 1 );
if( hMediaPlayer )
{
libvlc_video_set_key_input( hMediaPlayer, (unsigned) hb_parl( 2 ) );
}
else
{
hb_errRT_BASE( EG_ARG, 2020, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
}
}
//------------------------------------------------------------------------------
/**
* LIBVLC_API
* void libvlc_video_set_mouse_input( libvlc_media_player_t *p_mi, unsigned on );
* Enable or disable mouse click events handling. By default, those events are
* handled. This is needed for DVD menus to work, as well as a few video
* filters such as "puzzle".
*
* \see libvlc_video_set_key_input().
*
* \warning This function is only implemented for X11 and Win32 at the moment.
*
* \param p_mi the media player
* \param on true to handle mouse click events, false to ignore them.
*/
HB_FUNC( MYVLC_VIDEO_SET_MOUSE_INPUT )
{
libvlc_media_player_t *hMediaPlayer = (libvlc_media_player_t *) hb_parptr( 1 );
if( hMediaPlayer )
{
libvlc_video_set_mouse_input( hMediaPlayer, (unsigned) hb_parl( 2 ) );
}
else
{
hb_errRT_BASE( EG_ARG, 2020, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
}
}
//------------------------------------------------------------------------------
/**
* LIBVLC_API int libvlc_audio_get_mute( libvlc_media_player_t *p_mi );
* Get current mute status.
*
* \param p_mi media player
* \return the mute status (boolean) if defined, -1 if undefined/unapplicable
*/
HB_FUNC( MYVLC_AUDIO_GET_MUTE )
{
libvlc_media_player_t *hMediaPlayer = (libvlc_media_player_t *) hb_parptr( 1 );
if( hMediaPlayer )
{
hb_retl( (HB_BOOL) libvlc_audio_get_mute( hMediaPlayer ) );
}
else
{
hb_errRT_BASE( EG_ARG, 2020, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
}
}
//------------------------------------------------------------------------------
/**
* LIBVLC_API void libvlc_audio_set_mute( libvlc_media_player_t *p_mi, int status );
* Set mute status.
*
* \param p_mi media player
* \param status If status is true then mute, otherwise unmute
* \warning This function does not always work. If there are no active audio
* playback stream, the mute status might not be available. If digital
* pass-through (S/PDIF, HDMI...) is in use, muting may be unapplicable. Also
* some audio output plugins do not support muting at all.
* \note To force silent playback, disable all audio tracks. This is more
* efficient and reliable than mute.
*/
HB_FUNC( MYVLC_AUDIO_SET_MUTE )
{
libvlc_media_player_t *hMediaPlayer = (libvlc_media_player_t *) hb_parptr( 1 );
if( hMediaPlayer )
{
libvlc_audio_set_mute( hMediaPlayer, (int) hb_parl( 2 ) );
}
else
{
hb_errRT_BASE( EG_ARG, 2020, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
}
}
//------------------------------------------------------------------------------
/**
* LIBVLC_API void libvlc_audio_toggle_mute( libvlc_media_player_t *p_mi );
* Toggle mute status.
*
* \param p_mi media player
* \warning Toggling mute atomically is not always possible: On some platforms,
* other processes can mute the VLC audio playback stream asynchronously. Thus,
* there is a small race condition where toggling will not work.
* See also the limitations of libvlc_audio_set_mute().
*/
HB_FUNC( MYVLC_AUDIO_TOGGLE_MUTE )
{
libvlc_media_player_t *hMediaPlayer = (libvlc_media_player_t *) hb_parptr( 1 );
if( hMediaPlayer )
{
libvlc_audio_toggle_mute( hMediaPlayer );
}
else
{
hb_errRT_BASE( EG_ARG, 2020, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
}
}
//------------------------------------------------------------------------------
/**
* LIBVLC_API int libvlc_audio_get_volume( libvlc_media_player_t *p_mi );
* Get current software audio volume.
*
* \param p_mi media player
* \return the software volume in percents
* (0 = mute, 100 = nominal / 0dB)
*/
HB_FUNC( MYVLC_AUDIO_GET_VOLUME )
{
libvlc_media_player_t *hMediaPlayer = (libvlc_media_player_t *) hb_parptr( 1 );
if( hMediaPlayer )
{
hb_retni( libvlc_audio_get_volume( hMediaPlayer ) );
}
else
{
hb_errRT_BASE( EG_ARG, 2020, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
}
}
//------------------------------------------------------------------------------
/**
* LIBVLC_API int libvlc_audio_set_volume( libvlc_media_player_t *p_mi, int i_volume );
* Set current software audio volume.
*
* \param p_mi media player
* \param i_volume the volume in percents (0 = mute, 100 = 0dB)
* \return 0 if the volume was set, -1 if it was out of range
*/
HB_FUNC( MYVLC_AUDIO_SET_VOLUME )
{
libvlc_media_player_t *hMediaPlayer = (libvlc_media_player_t *) hb_parptr( 1 );
if( hMediaPlayer )
{
hb_retl( ( libvlc_audio_set_volume( hMediaPlayer, (int) hb_parni( 2 ) ) == 0 ) );
}
else
{
hb_errRT_BASE( EG_ARG, 2020, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
}
}
//------------------------------------------------------------------------------
/**
* LIBVLC_API libvlc_state_t libvlc_media_player_get_state( libvlc_media_player_t *p_mi );
* Get current movie state
*
* \param p_mi the Media Player
* \return the current state of the media player (playing, paused, ...) \see libvlc_state_t
*/
HB_FUNC( MYVLC_MEDIA_PLAYER_GET_STATE )
{
libvlc_media_player_t *hMediaPlayer = (libvlc_media_player_t *) hb_parptr( 1 );
unsigned int uiState = 0;
if( hMediaPlayer )
{
uiState = (unsigned int) libvlc_media_player_get_state( hMediaPlayer );
}
hb_retni( uiState );
}
//------------------------------------------------------------------------------
/**
* LIBVLC_API void libvlc_release( libvlc_instance_t *p_instance );
* Decrement the reference count of a libvlc instance, and destroy it
* if it reaches zero.
*
* \param p_instance the instance to destroy
*/
HB_FUNC( MYVLC_RELEASE )
{
libvlc_instance_t* hVLC = (libvlc_instance_t *) hb_parptr( 1 );
if( hVLC )
{
libvlc_release( hVLC );
}
else
{
hb_errRT_BASE( EG_ARG, 2020, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
}
}
//------------------------------------------------------------------------------
/**
* LIBVLC_API void libvlc_media_release( libvlc_media_t *p_md );
* Decrement the reference count of a media descriptor object. If the
* reference count is 0, then libvlc_media_release() will release the
* media descriptor object. It will send out an libvlc_MediaFreed event
* to all listeners. If the media descriptor object has been released it
* should not be used again.
*
* \param p_md the media descriptor
*/
HB_FUNC( MYVLC_MEDIA_RELEASE )
{
libvlc_media_t* hMedia = (libvlc_media_t *) hb_parptr( 1 );
if( hMedia )
{
libvlc_media_release( hMedia );
}
else
{
hb_errRT_BASE( EG_ARG, 2020, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
}
}
//------------------------------------------------------------------------------
/**
* LIBVLC_API void libvlc_media_player_release (libvlc_media_player_t *p_mi)
* Release a media_player after use Decrement the reference count of a media player object.
*/
HB_FUNC( MYVLC_MEDIAPLAYER_RELEASE )
{
libvlc_media_player_t* hMediaPlayer = (libvlc_media_player_t *) hb_parptr( 1 );
if( hMediaPlayer )
{
libvlc_media_player_release( hMediaPlayer );
}
else
{
hb_errRT_BASE( EG_ARG, 2020, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
}
}
//------------------------------------------------------------------------------
//EOF
//------------------------------------------------------------------------------