This class provides static methods to interact with the LibVLC library. It allows for the creation and management of VLC instances, media players, and media objects, as well as the handling of audio, video, and events.

Static methods

@:native("libvlc_new")staticalloc(argc:Int, argv:ConstCharStarConstStar):RawPointer<LibVLC_Instance_T>

Allocates and initializes a LibVLC instance.

Parameters:

argc

Number of arguments.

argv

Argument values.

Returns:

Pointer to the new LibVLC instance.

@:native("libvlc_audio_get_channel")staticaudio_get_channel(p_mi:RawPointer<LibVLC_Media_Player_T>):Int

Gets the current audio channel.

Parameters:

p_mi

Pointer to the media player.

Returns:

The current audio channel.

@:native("libvlc_audio_get_delay")staticaudio_get_delay(p_mi:RawPointer<LibVLC_Media_Player_T>):Int64

Gets the audio delay.

Parameters:

p_mi

Pointer to the media player.

Returns:

The audio delay in microseconds.

@:native("libvlc_audio_get_track")staticaudio_get_track(p_mi:RawPointer<LibVLC_Media_Player_T>):Int

Gets the current audio track.

Parameters:

p_mi

Pointer to the media player.

Returns:

The current audio track.

@:native("libvlc_audio_get_track_count")staticaudio_get_track_count(p_mi:RawPointer<LibVLC_Media_Player_T>):Int

Gets the number of audio tracks.

Parameters:

p_mi

Pointer to the media player.

Returns:

The number of audio tracks.

@:native("libvlc_audio_set_callbacks")staticaudio_set_callbacks(mp:RawPointer<LibVLC_Media_Player_T>, play:LibVLC_Audio_Play_CB, pause:LibVLC_Audio_Pause_CB, resume:LibVLC_Audio_Resume_CB, flush:LibVLC_Audio_Flush_CB, drain:LibVLC_Audio_Drain_CB, opaque:RawPointer<Void>):Void

Sets the audio callbacks.

Parameters:

mp

Pointer to the media player.

play

Audio play callback.

pause

Audio pause callback.

resume

Audio resume callback.

flush

Audio flush callback.

drain

Audio drain callback.

opaque

Pointer to the opaque data.

@:native("libvlc_audio_set_channel")staticaudio_set_channel(p_mi:RawPointer<LibVLC_Media_Player_T>, channel:Int):Int

Sets the current audio channel.

Parameters:

p_mi

Pointer to the media player.

channel

The new audio channel.

Returns:

0 on success, -1 on failure.

@:native("libvlc_audio_set_delay")staticaudio_set_delay(p_mi:RawPointer<LibVLC_Media_Player_T>, i_delay:Int64):Int

Sets the audio delay.

Parameters:

p_mi

Pointer to the media player.

i_delay

The new audio delay in microseconds.

Returns:

0 on success, -1 on failure.

@:native("libvlc_audio_set_format")staticaudio_set_format(mp:RawPointer<LibVLC_Media_Player_T>, format:ConstCharStar, rate:UInt32, channels:UInt32):Void

Sets the audio format.

Parameters:

mp

Pointer to the media player.

format

Audio format string.

rate

Sample rate.

channels

Number of audio channels.

@:native("libvlc_audio_set_format_callbacks")staticaudio_set_format_callbacks(mp:RawPointer<LibVLC_Media_Player_T>, setup:LibVLC_Audio_Setup_CB, cleanup:LibVLC_Audio_Cleanup_CB):Void

Sets the audio format callbacks.

Parameters:

mp

Pointer to the media player.

setup

Audio format setup callback. This callback is invoked to configure the audio format.

cleanup

Audio format cleanup callback. This callback is invoked to clean up after the audio format is no longer needed.

@:native("libvlc_audio_set_track")staticaudio_set_track(p_mi:RawPointer<LibVLC_Media_Player_T>, i_track:Int):Int

Sets the current audio track.

Parameters:

p_mi

Pointer to the media player.

i_track

The new audio track.

Returns:

0 on success, -1 on failure.

@:native("libvlc_audio_set_volume_callback")staticaudio_set_volume_callback(mp:RawPointer<LibVLC_Media_Player_T>, set_volume:LibVLC_Audio_Set_Volume_CB):Void

Sets the audio volume callback.

Parameters:

mp

Pointer to the media player.

set_volume

Audio set volume callback.

@:native("libvlc_clock")staticclock():Int64

Gets the LibVLC clock time.

Returns:

The clock time.

@:native("libvlc_errmsg")staticerrmsg():ConstCharStar

Gets the last error message.

Returns:

The last error message.

@:native("libvlc_event_attach")staticevent_attach(p_event_manager:RawPointer<LibVLC_Event_Manager_T>, i_event_type:Int, f_callback:LibVLC_Callback_T, user_data:RawPointer<Void>):Int

Attaches an event callback.

Parameters:

p_event_manager

Pointer to the event manager.

i_event_type

Type of the event.

f_callback

Event callback function.

user_data

User data to pass to the callback.

Returns:

0 on success, -1 on failure.

@:native("libvlc_event_detach")staticevent_detach(p_event_manager:RawPointer<LibVLC_Event_Manager_T>, i_event_type:Int, f_callback:LibVLC_Callback_T, user_data:RawPointer<Void>):Void

Detaches an event callback.

Parameters:

p_event_manager

Pointer to the event manager.

i_event_type

Type of the event.

f_callback

Event callback function.

user_data

User data passed to the callback.

@:native("libvlc_get_changeset")staticget_changeset():ConstCharStar

Gets the LibVLC changeset.

Returns:

The changeset string.

@:native("libvlc_get_compiler")staticget_compiler():ConstCharStar

Gets the LibVLC compiler information.

Returns:

The compiler information string.

@:native("libvlc_get_version")staticget_version():ConstCharStar

Gets the LibVLC version.

Returns:

The LibVLC version string.

@:native("libvlc_log_set")staticlog_set(p_instance:RawPointer<LibVLC_Instance_T>, cb:LibVLC_Log_CB, data:RawPointer<Void>):Void

Sets the logging callback.

Parameters:

p_instance

Pointer to the LibVLC instance.

cb

Logging callback function.

data

User data to pass to the callback.

@:native("libvlc_log_set_file")staticlog_set_file(p_instance:RawPointer<LibVLC_Instance_T>, stream:FILE):Void

Sets up logging to a file.

Parameters:

p_instance

Pointer to the LibVLC instance.

stream

FILE pointer opened for writing. The FILE pointer must remain valid until libvlc_log_unset().

@:native("libvlc_log_unset")staticlog_unset(p_instance:RawPointer<LibVLC_Instance_T>):Void

Unsets the logging callback.

Parameters:

p_instance

Pointer to the LibVLC instance.

@:native("libvlc_media_add_option")staticmedia_add_option(p_md:RawPointer<LibVLC_Media_T>, psz_options:ConstCharStar):Void

Adds an option to a media descriptor.

Parameters:

p_md

Pointer to the media descriptor.

psz_options

The option string.

@:native("libvlc_media_event_manager")staticmedia_event_manager(p_md:RawPointer<LibVLC_Media_T>):RawPointer<LibVLC_Event_Manager_T>

Gets the event manager of a media descriptor.

Parameters:

p_md

Pointer to the media descriptor.

Returns:

Pointer to the event manager.

@:native("libvlc_media_get_duration")staticmedia_get_duration(p_md:RawPointer<LibVLC_Media_T>):LibVLC_Time_T

Gets the duration of a media descriptor.

Parameters:

p_md

Pointer to the media descriptor.

Returns:

The duration in milliseconds.

@:native("libvlc_media_get_meta")staticmedia_get_meta(p_md:RawPointer<LibVLC_Media_T>, e_meta:LibVLC_Meta_T):CastCharStar

Gets the metadata of a media descriptor.

Parameters:

p_md

Pointer to the media descriptor.

e_meta

Metadata type.

Returns:

The metadata string.

@:native("libvlc_media_get_mrl")staticmedia_get_mrl(p_md:RawPointer<LibVLC_Media_T>):CastCharStar

Gets the media resource locator (MRL) of a media descriptor.

Parameters:

p_md

Pointer to the media descriptor.

Returns:

The MRL string.

@:native("libvlc_media_get_parsed_status")staticmedia_get_parsed_status(p_md:RawPointer<LibVLC_Media_T>):LibVLC_Media_Parsed_Status_T

Gets the parsed status of a media descriptor.

Parameters:

p_md

Pointer to the media descriptor.

Returns:

The parsed status.

@:native("libvlc_media_get_stats")staticmedia_get_stats(p_md:RawPointer<LibVLC_Media_T>, p_stats:RawPointer<LibVLC_Media_Stats_T>):Int

Gets the statistics of a media descriptor.

Parameters:

p_md

Pointer to the media descriptor.

p_stats

Pointer to the statistics structure.

Returns:

0 on success, -1 on failure.

@:native("libvlc_media_list_count")staticmedia_list_count(p_ml:RawPointer<LibVLC_Media_List_T>):Int

Gets the number of items in a media list.

Parameters:

p_ml

Pointer to the media list.

Returns:

Number of items in the list.

@:native("libvlc_media_list_item_at_index")staticmedia_list_item_at_index(p_ml:RawPointer<LibVLC_Media_List_T>, i_pos:Int):RawPointer<LibVLC_Media_T>

Gets the media item at the specified index in a media list.

Parameters:

p_ml

Pointer to the media list.

i_pos

Index of the media item to retrieve.

Returns:

Pointer to the media descriptor.

@:native("libvlc_media_list_release")staticmedia_list_release(p_ml:RawPointer<LibVLC_Media_List_T>):Void

Releases a media list.

Parameters:

p_ml

Pointer to the media list.

@:native("libvlc_media_new_callbacks")staticmedia_new_callbacks(p_instance:RawPointer<LibVLC_Instance_T>, open_cb:LibVLC_Media_Open_CB, read_cb:LibVLC_Media_Read_CB, seek_cb:LibVLC_Media_Seek_CB, close_cb:LibVLC_Media_Close_CB, opaque:RawPointer<Void>):RawPointer<LibVLC_Media_T>

Creates a new media descriptor from custom callbacks.

Parameters:

p_instance

Pointer to the LibVLC instance.

open_cb

Open callback function.

read_cb

Read callback function.

seek_cb

Seek callback function.

close_cb

Close callback function.

opaque

User data to pass to the callbacks.

Returns:

Pointer to the new media descriptor.

@:native("libvlc_media_new_fd")staticmedia_new_fd(p_instance:RawPointer<LibVLC_Instance_T>, fd:Int):RawPointer<LibVLC_Media_T>

Creates a new media descriptor from a file descriptor.

Parameters:

p_instance

Pointer to the LibVLC instance.

fd

The file descriptor.

Returns:

Pointer to the new media descriptor.

@:native("libvlc_media_new_location")staticmedia_new_location(p_instance:RawPointer<LibVLC_Instance_T>, psz_mrl:ConstCharStar):RawPointer<LibVLC_Media_T>

Creates a new media descriptor from a location.

Parameters:

p_instance

Pointer to the LibVLC instance.

psz_mrl

The location string.

Returns:

Pointer to the new media descriptor.

@:native("libvlc_media_new_path")staticmedia_new_path(p_instance:RawPointer<LibVLC_Instance_T>, path:ConstCharStar):RawPointer<LibVLC_Media_T>

Creates a new media descriptor from a file path.

Parameters:

p_instance

Pointer to the LibVLC instance.

path

The file path.

Returns:

Pointer to the new media descriptor.

@:native("libvlc_media_parse_stop")staticmedia_parse_stop(p_md:RawPointer<LibVLC_Media_T>):Void

Stops the parsing of a media descriptor.

Parameters:

p_md

Pointer to the media descriptor.

@:native("libvlc_media_parse_with_options")staticmedia_parse_with_options(p_md:RawPointer<LibVLC_Media_T>, parse_flag:LibVLC_Media_Parse_Flag_T, timeout:Int):Int

Parses a media descriptor with options.

Parameters:

p_md

Pointer to the media descriptor.

parse_flag

Parse flags.

timeout

Timeout in milliseconds.

Returns:

0 on success, -1 on failure.

@:native("libvlc_media_player_can_pause")staticmedia_player_can_pause(p_mi:RawPointer<LibVLC_Media_Player_T>):Int

Checks if the media player can pause.

Parameters:

p_mi

Pointer to the media player.

Returns:

1 if can pause, 0 otherwise.

@:native("libvlc_media_player_event_manager")staticmedia_player_event_manager(mp:RawPointer<LibVLC_Media_Player_T>):RawPointer<LibVLC_Event_Manager_T>

Gets the event manager of a media player.

Parameters:

mp

Pointer to the media player.

Returns:

Pointer to the event manager.

@:native("libvlc_media_player_get_chapter")staticmedia_player_get_chapter(p_mi:RawPointer<LibVLC_Media_Player_T>):Int

Gets the current chapter.

Parameters:

p_mi

Pointer to the media player.

Returns:

The current chapter.

@:native("libvlc_media_player_get_chapter_count")staticmedia_player_get_chapter_count(p_mi:RawPointer<LibVLC_Media_Player_T>):Int

Gets the total number of chapters.

Parameters:

p_mi

Pointer to the media player.

Returns:

The total number of chapters.

@:native("libvlc_media_player_get_length")staticmedia_player_get_length(p_mi:RawPointer<LibVLC_Media_Player_T>):LibVLC_Time_T

Gets the media length.

Parameters:

p_mi

Pointer to the media player.

Returns:

The media length in milliseconds.

@:native("libvlc_media_player_get_media")staticmedia_player_get_media(p_mi:RawPointer<LibVLC_Media_Player_T>):RawPointer<LibVLC_Media_T>

Gets the media descriptor from a media player.

Parameters:

p_mi

Pointer to the media player.

Returns:

Pointer to the media descriptor.

@:native("libvlc_media_player_get_position")staticmedia_player_get_position(p_mi:RawPointer<LibVLC_Media_Player_T>):Single

Gets the current playback position.

Parameters:

p_mi

Pointer to the media player.

Returns:

The current playback position as a float between 0.0 and 1.0.

@:native("libvlc_media_player_get_rate")staticmedia_player_get_rate(p_mi:RawPointer<LibVLC_Media_Player_T>):Single

Gets the current playback rate.

Parameters:

p_mi

Pointer to the media player.

Returns:

The current playback rate.

@:native("libvlc_media_player_get_role")staticmedia_player_get_role(p_mi:RawPointer<LibVLC_Media_Player_T>):Int

Gets the role of the media player.

Parameters:

p_mi

Pointer to the media player.

Returns:

The role of the media player.

@:native("libvlc_media_player_get_time")staticmedia_player_get_time(p_mi:RawPointer<LibVLC_Media_Player_T>):LibVLC_Time_T

Gets the current playback time.

Parameters:

p_mi

Pointer to the media player.

Returns:

The current playback time in milliseconds.

@:native("libvlc_media_player_is_playing")staticmedia_player_is_playing(p_mi:RawPointer<LibVLC_Media_Player_T>):Int

Checks if the media player is playing.

Parameters:

p_mi

Pointer to the media player.

Returns:

1 if playing, 0 otherwise.

@:native("libvlc_media_player_is_seekable")staticmedia_player_is_seekable(p_mi:RawPointer<LibVLC_Media_Player_T>):Int

Checks if the media player is seekable.

Parameters:

p_mi

Pointer to the media player.

Returns:

1 if seekable, 0 otherwise.

@:native("libvlc_media_player_new")staticmedia_player_new(p_libvlc_instance:RawPointer<LibVLC_Instance_T>):RawPointer<LibVLC_Media_Player_T>

Creates a new media player.

Parameters:

p_libvlc_instance

Pointer to the LibVLC instance.

Returns:

Pointer to the new media player.

@:native("libvlc_media_player_next_chapter")staticmedia_player_next_chapter(p_mi:RawPointer<LibVLC_Media_Player_T>):Void

Moves to the next chapter.

Parameters:

p_mi

Pointer to the media player.

@:native("libvlc_media_player_pause")staticmedia_player_pause(p_mi:RawPointer<LibVLC_Media_Player_T>):Void

Pauses playback of the media player.

Parameters:

p_mi

Pointer to the media player.

@:native("libvlc_media_player_play")staticmedia_player_play(p_mi:RawPointer<LibVLC_Media_Player_T>):Int

Starts playback of the media player.

Parameters:

p_mi

Pointer to the media player.

Returns:

0 on success, -1 on failure.

@:native("libvlc_media_player_previous_chapter")staticmedia_player_previous_chapter(p_mi:RawPointer<LibVLC_Media_Player_T>):Void

Moves to the previous chapter.

Parameters:

p_mi

Pointer to the media player.

@:native("libvlc_media_player_release")staticmedia_player_release(p_mi:RawPointer<LibVLC_Media_Player_T>):Void

Releases a media player.

Parameters:

p_mi

Pointer to the media player.

@:native("libvlc_media_player_set_chapter")staticmedia_player_set_chapter(p_mi:RawPointer<LibVLC_Media_Player_T>, i_chapter:Int):Void

Sets the current chapter.

Parameters:

p_mi

Pointer to the media player.

i_chapter

The new chapter.

@:native("libvlc_media_player_set_media")staticmedia_player_set_media(p_mi:RawPointer<LibVLC_Media_Player_T>, p_md:RawPointer<LibVLC_Media_T>):Void

Sets the media descriptor for a media player.

Parameters:

p_mi

Pointer to the media player.

p_md

Pointer to the media descriptor.

@:native("libvlc_media_player_set_pause")staticmedia_player_set_pause(p_mi:RawPointer<LibVLC_Media_Player_T>, do_pause:Int):Void

Sets pause state for the media player.

Parameters:

p_mi

Pointer to the media player.

do_pause

1 to pause, 0 to play.

@:native("libvlc_media_player_set_position")staticmedia_player_set_position(p_mi:RawPointer<LibVLC_Media_Player_T>, f_pos:Single):Void

Sets the current playback position.

Parameters:

p_mi

Pointer to the media player.

f_pos

The new playback position as a float between 0.0 and 1.0.

@:native("libvlc_media_player_set_rate")staticmedia_player_set_rate(p_mi:RawPointer<LibVLC_Media_Player_T>, rate:Single):Int

Sets the playback rate.

Parameters:

p_mi

Pointer to the media player.

rate

The new playback rate.

Returns:

0 on success, -1 on failure.

@:native("libvlc_media_player_set_role")staticmedia_player_set_role(p_mi:RawPointer<LibVLC_Media_Player_T>, role:UInt32):Int

Sets the role of the media player.

Parameters:

p_mi

Pointer to the media player.

role

The new role.

Returns:

0 on success, -1 on failure.

@:native("libvlc_media_player_set_time")staticmedia_player_set_time(p_mi:RawPointer<LibVLC_Media_Player_T>, i_time:LibVLC_Time_T):Int

Sets the current playback time.

Parameters:

p_mi

Pointer to the media player.

i_time

The new playback time in milliseconds.

Returns:

0 on success, -1 on failure.

@:native("libvlc_media_player_stop")staticmedia_player_stop(p_mi:RawPointer<LibVLC_Media_Player_T>):Void

Stops playback of the media player.

Parameters:

p_mi

Pointer to the media player.

@:native("libvlc_media_player_will_play")staticmedia_player_will_play(p_mi:RawPointer<LibVLC_Media_Player_T>):Int

Checks if the media player will play.

Parameters:

p_mi

Pointer to the media player.

Returns:

1 if will play, 0 otherwise.

@:native("libvlc_media_release")staticmedia_release(p_md:RawPointer<LibVLC_Media_T>):Void

Releases a media descriptor.

Parameters:

p_md

Pointer to the media descriptor.

@:native("libvlc_media_save_meta")staticmedia_save_meta(p_md:RawPointer<LibVLC_Media_T>):Int

Saves the metadata of a media descriptor.

This function commits any metadata modifications to the underlying storage, if applicable.

Parameters:

p_md

Pointer to the media descriptor.

Returns:

0 on failure, a non-zero value if the metadata was saved successfully.

@:native("libvlc_media_set_meta")staticmedia_set_meta(p_md:RawPointer<LibVLC_Media_T>, e_meta:LibVLC_Meta_T, psz_value:ConstCharStar):Void

Sets the metadata of a media descriptor.

Parameters:

p_md

Pointer to the media descriptor.

e_meta

Metadata type.

psz_value

New metadata value.

@:native("libvlc_media_subitems")staticmedia_subitems(p_md:RawPointer<LibVLC_Media_T>):RawPointer<LibVLC_Media_List_T>

Gets the subitems of a media descriptor.

Parameters:

p_md

Pointer to the media descriptor.

Returns:

Pointer to the media list containing subitems.

@:native("libvlc_release")staticrelease(p_instance:RawPointer<LibVLC_Instance_T>):Void

Releases a LibVLC instance.

Parameters:

p_instance

Pointer to the LibVLC instance.

@:native("libvlc_set_user_agent")staticset_user_agent(p_instance:RawPointer<LibVLC_Instance_T>, name:ConstCharStar, http:ConstCharStar):Void

Sets the application name and HTTP user agent string for LibVLC.

Parameters:

p_instance

Pointer to the LibVLC instance.

name

Human-readable application name, e.g., "FooBar player 1.2.3".

http

HTTP User Agent string, e.g., "FooBar/1.2.3 Python/2.6.0".

@:native("libvlc_video_get_size")staticvideo_get_size(mp:RawPointer<LibVLC_Media_Player_T>, num:UInt32, px:RawPointer<UInt32>, py:RawPointer<UInt32>):Int

Gets the pixel dimensions of a video.

Parameters:

mp

Pointer to the media player.

num

The index of the video (starting from 0, and most commonly 0).

px

Pointer to store the width of the video in pixels [OUT].

py

Pointer to store the height of the video in pixels [OUT].

Returns:

0 on success, -1 if the specified video does not exist.

@:native("libvlc_video_set_callbacks")staticvideo_set_callbacks(mp:RawPointer<LibVLC_Media_Player_T>, lock:LibVLC_Video_Lock_CB, unlock:LibVLC_Video_Unlock_CB, display:LibVLC_Video_Display_CB, opaque:RawPointer<Void>):Void

Sets the video callbacks.

Parameters:

mp

Pointer to the media player.

lock

Video lock callback.

unlock

Video unlock callback.

display

Video display callback.

opaque

Pointer to the opaque data.

@:native("libvlc_video_set_format")staticvideo_set_format(mp:RawPointer<LibVLC_Media_Player_T>, chroma:ConstCharStar, width:UInt32, height:UInt32, pitch:UInt32):Void

Sets the video format.

Parameters:

mp

Pointer to the media player.

chroma

Four-character string identifying the chroma format (e.g., "RV32" for 32-bit RGBA).

width

Width of the video in pixels.

height

Height of the video in pixels.

pitch

Number of bytes per row of pixels in the video.

@:native("libvlc_video_set_format_callbacks")staticvideo_set_format_callbacks(mp:RawPointer<LibVLC_Media_Player_T>, setup:LibVLC_Video_Format_CB, cleanup:LibVLC_Video_Cleanup_CB):Void

Sets the video format callbacks.

Parameters:

mp

Pointer to the media player.

setup

Video format setup callback.

cleanup

Video format cleanup callback.