pyparrot.utils package

Submodules

pyparrot.utils.NonBlockingStreamReader module

A non-blocking stream reader (used to solve the process communciation with ffmpeg)

This code is almost directly from:

http://eyalarubas.com/python-subproc-nonblock.html

Amy McGovern (dramymcgovern@gmail.com) modified to allow the thread to end nicely and also to not throw an error if the stream ends, since our code already will know that from parsing (and the programs are not expected to run forever)

class pyparrot.utils.NonBlockingStreamReader.NonBlockingStreamReader(stream)[source]

Bases: object

finish_reader()[source]
readline(timeout=None)[source]
exception pyparrot.utils.NonBlockingStreamReader.UnexpectedEndOfStream[source]

Bases: Exception

pyparrot.utils.colorPrint module

Print messages in color

pyparrot.utils.colorPrint.color_print(print_str, type='NONE')[source]

pyparrot.utils.vlc module

This module provides bindings for the LibVLC public API, see U{http://wiki.videolan.org/LibVLC}.

You can find the documentation and a README file with some examples at U{http://www.olivieraubert.net/vlc/python-ctypes/}.

Basically, the most important class is L{Instance}, which is used to create a libvlc instance. From this instance, you then create L{MediaPlayer} and L{MediaListPlayer} instances.

Alternatively, you may create instances of the L{MediaPlayer} and L{MediaListPlayer} class directly and an instance of L{Instance} will be implicitly created. The latter can be obtained using the C{get_instance} method of L{MediaPlayer} and L{MediaListPlayer}.

class pyparrot.utils.vlc.AudioCleanupCb[source]

Bases: ctypes.c_void_p

Callback prototype for audio playback cleanup. This is called when the media player no longer needs an audio output. @param opaque: data pointer as passed to L{libvlc_audio_set_callbacks}() [IN].

class pyparrot.utils.vlc.AudioDrainCb[source]

Bases: ctypes.c_void_p

Callback prototype for audio buffer drain. LibVLC may invoke this callback when the decoded audio track is ending. There will be no further decoded samples for the track, but playback should nevertheless continue until all already pending buffers are rendered. @param data: data pointer as passed to L{libvlc_audio_set_callbacks}() [IN].

class pyparrot.utils.vlc.AudioFlushCb[source]

Bases: ctypes.c_void_p

Callback prototype for audio buffer flush. LibVLC invokes this callback if it needs to discard all pending buffers and stop playback as soon as possible. This typically occurs when the media is stopped. @param data: data pointer as passed to L{libvlc_audio_set_callbacks}() [IN].

class pyparrot.utils.vlc.AudioOutput[source]

Bases: pyparrot.utils.vlc._Cstruct

description

Structure/Union member

name

Structure/Union member

next

Structure/Union member

class pyparrot.utils.vlc.AudioOutputChannel[source]

Bases: pyparrot.utils.vlc._Enum

Audio channels.

Dolbys = pyparrot.utils.vlc.AudioOutputChannel.Dolbys
Error = pyparrot.utils.vlc.AudioOutputChannel.FIXME_(4294967295)
Left = pyparrot.utils.vlc.AudioOutputChannel.Left
RStereo = pyparrot.utils.vlc.AudioOutputChannel.RStereo
Right = pyparrot.utils.vlc.AudioOutputChannel.Right
Stereo = pyparrot.utils.vlc.AudioOutputChannel.Stereo
class pyparrot.utils.vlc.AudioOutputDevice[source]

Bases: pyparrot.utils.vlc._Cstruct

description

Structure/Union member

device

Structure/Union member

next

Structure/Union member

class pyparrot.utils.vlc.AudioOutputDeviceTypes[source]

Bases: pyparrot.utils.vlc._Enum

Audio device types.

Error = pyparrot.utils.vlc.AudioOutputDeviceTypes.FIXME_(4294967295)
Mono = pyparrot.utils.vlc.AudioOutputDeviceTypes.Mono
SPDIF = pyparrot.utils.vlc.AudioOutputDeviceTypes.SPDIF
Stereo = pyparrot.utils.vlc.AudioOutputDeviceTypes.Stereo
class pyparrot.utils.vlc.AudioPauseCb[source]

Bases: ctypes.c_void_p

Callback prototype for audio pause. LibVLC invokes this callback to pause audio playback. @note: The pause callback is never called if the audio is already paused. @param data: data pointer as passed to L{libvlc_audio_set_callbacks}() [IN]. @param pts: time stamp of the pause request (should be elapsed already).

class pyparrot.utils.vlc.AudioPlayCb[source]

Bases: ctypes.c_void_p

Callback prototype for audio playback. The LibVLC media player decodes and post-processes the audio signal asynchronously (in an internal thread). Whenever audio samples are ready to be queued to the output, this callback is invoked. The number of samples provided per invocation may depend on the file format, the audio coding algorithm, the decoder plug-in, the post-processing filters and timing. Application must not assume a certain number of samples. The exact format of audio samples is determined by L{libvlc_audio_set_format}() or L{libvlc_audio_set_format_callbacks}() as is the channels layout. Note that the number of samples is per channel. For instance, if the audio track sampling rate is 48000 Hz, then 1200 samples represent 25 milliseconds of audio signal - regardless of the number of audio channels. @param data: data pointer as passed to L{libvlc_audio_set_callbacks}() [IN]. @param samples: pointer to a table of audio samples to play back [IN]. @param count: number of audio samples to play back. @param pts: expected play time stamp (see libvlc_delay()).

class pyparrot.utils.vlc.AudioResumeCb[source]

Bases: ctypes.c_void_p

Callback prototype for audio resumption. LibVLC invokes this callback to resume audio playback after it was previously paused. @note: The resume callback is never called if the audio is not paused. @param data: data pointer as passed to L{libvlc_audio_set_callbacks}() [IN]. @param pts: time stamp of the resumption request (should be elapsed already).

class pyparrot.utils.vlc.AudioSetVolumeCb[source]

Bases: ctypes.c_void_p

Callback prototype for audio volume change. @param data: data pointer as passed to L{libvlc_audio_set_callbacks}() [IN]. @param volume: software volume (1. = nominal, 0. = mute). @param mute: muted flag.

class pyparrot.utils.vlc.AudioSetupCb[source]

Bases: ctypes.c_void_p

Callback prototype to setup the audio playback. This is called when the media player needs to create a new audio output. @param opaque: pointer to the data pointer passed to L{libvlc_audio_set_callbacks}() [IN/OUT]. @param format: 4 bytes sample format [IN/OUT]. @param rate: sample rate [IN/OUT]. @param channels: channels count [IN/OUT]. @return: 0 on success, anything else to skip audio playback.

class pyparrot.utils.vlc.AudioTrack[source]

Bases: pyparrot.utils.vlc._Cstruct

channels

Structure/Union member

rate

Structure/Union member

class pyparrot.utils.vlc.Callback[source]

Bases: ctypes.c_void_p

Callback function notification. @param p_event: the event triggering the callback.

class pyparrot.utils.vlc.CallbackDecorators[source]

Bases: object

Class holding various method decorators for callback functions.

AudioCleanupCb

alias of ctypes.CFUNCTYPE.<locals>.CFunctionType

AudioDrainCb

alias of ctypes.CFUNCTYPE.<locals>.CFunctionType

AudioFlushCb

alias of ctypes.CFUNCTYPE.<locals>.CFunctionType

AudioPauseCb

alias of ctypes.CFUNCTYPE.<locals>.CFunctionType

AudioPlayCb

alias of ctypes.CFUNCTYPE.<locals>.CFunctionType

AudioResumeCb

alias of ctypes.CFUNCTYPE.<locals>.CFunctionType

AudioSetVolumeCb

alias of ctypes.CFUNCTYPE.<locals>.CFunctionType

AudioSetupCb

alias of ctypes.CFUNCTYPE.<locals>.CFunctionType

Callback

alias of ctypes.CFUNCTYPE.<locals>.CFunctionType

LogCb

alias of ctypes.CFUNCTYPE.<locals>.CFunctionType

MediaCloseCb

alias of ctypes.CFUNCTYPE.<locals>.CFunctionType

MediaOpenCb

alias of ctypes.CFUNCTYPE.<locals>.CFunctionType

MediaReadCb

alias of ctypes.CFUNCTYPE.<locals>.CFunctionType

MediaSeekCb

alias of ctypes.CFUNCTYPE.<locals>.CFunctionType

VideoCleanupCb

alias of ctypes.CFUNCTYPE.<locals>.CFunctionType

VideoDisplayCb

alias of ctypes.CFUNCTYPE.<locals>.CFunctionType

VideoFormatCb

alias of ctypes.CFUNCTYPE.<locals>.CFunctionType

VideoLockCb

alias of ctypes.CFUNCTYPE.<locals>.CFunctionType

VideoUnlockCb

alias of ctypes.CFUNCTYPE.<locals>.CFunctionType

class pyparrot.utils.vlc.ChapterDescription[source]

Bases: pyparrot.utils.vlc._Cstruct

class pyparrot.utils.vlc.DialogQuestionType[source]

Bases: pyparrot.utils.vlc._Enum

@defgroup libvlc_dialog libvlc dialog @ingroup libvlc @{ @file libvlc dialog external api.

CRITICAL = pyparrot.utils.vlc.DialogQuestionType.CRITICAL
NORMAL = pyparrot.utils.vlc.DialogQuestionType.NORMAL
WARNING = pyparrot.utils.vlc.DialogQuestionType.WARNING
class pyparrot.utils.vlc.Event[source]

Bases: pyparrot.utils.vlc._Cstruct

object

Structure/Union member

type

Structure/Union member

u

Structure/Union member

class pyparrot.utils.vlc.EventManager[source]

Bases: pyparrot.utils.vlc._Ctype

Create an event manager with callback handler.

This class interposes the registration and handling of event notifications in order to (a) remove the need for decorating each callback functions with the decorator @callbackmethod’, (b) allow any number of positional and/or keyword arguments to the callback (in addition to the Event instance) and (c) to preserve the Python objects such that the callback and argument objects remain alive (i.e. are not garbage collected) until B{after} the notification has been unregistered.

@note: Only a single notification can be registered for each event type in an EventManager instance.

event_attach(eventtype, callback, *args, **kwds)[source]

Register an event notification.

@param eventtype: the desired event type to be notified about. @param callback: the function to call when the event occurs. @param args: optional positional arguments for the callback. @param kwds: optional keyword arguments for the callback. @return: 0 on success, ENOMEM on error.

@note: The callback function must have at least one argument, an Event instance. Any other, optional positional and keyword arguments are in B{addition} to the first one.

event_detach(eventtype)[source]

Unregister an event notification.

@param eventtype: the event type notification to be removed.

class pyparrot.utils.vlc.EventType[source]

Bases: pyparrot.utils.vlc._Enum

Event types.

MediaDiscovererEnded = pyparrot.utils.vlc.EventType.MediaDiscovererEnded
MediaDiscovererStarted = pyparrot.utils.vlc.EventType.MediaDiscovererStarted
MediaDurationChanged = pyparrot.utils.vlc.EventType.MediaDurationChanged
MediaFreed = pyparrot.utils.vlc.EventType.MediaFreed
MediaListEndReached = pyparrot.utils.vlc.EventType.MediaListEndReached
MediaListItemAdded = pyparrot.utils.vlc.EventType.MediaListItemAdded
MediaListItemDeleted = pyparrot.utils.vlc.EventType.MediaListItemDeleted
MediaListPlayerNextItemSet = pyparrot.utils.vlc.EventType.MediaListPlayerNextItemSet
MediaListPlayerPlayed = pyparrot.utils.vlc.EventType.MediaListPlayerPlayed
MediaListPlayerStopped = pyparrot.utils.vlc.EventType.MediaListPlayerStopped
MediaListViewItemAdded = pyparrot.utils.vlc.EventType.MediaListViewItemAdded
MediaListViewItemDeleted = pyparrot.utils.vlc.EventType.MediaListViewItemDeleted
MediaListViewWillAddItem = pyparrot.utils.vlc.EventType.MediaListViewWillAddItem
MediaListViewWillDeleteItem = pyparrot.utils.vlc.EventType.MediaListViewWillDeleteItem
MediaListWillAddItem = pyparrot.utils.vlc.EventType.MediaListWillAddItem
MediaListWillDeleteItem = pyparrot.utils.vlc.EventType.MediaListWillDeleteItem
MediaMetaChanged = pyparrot.utils.vlc.EventType.MediaMetaChanged
MediaParsedChanged = pyparrot.utils.vlc.EventType.MediaParsedChanged
MediaPlayerAudioDevice = pyparrot.utils.vlc.EventType.MediaPlayerAudioDevice
MediaPlayerAudioVolume = pyparrot.utils.vlc.EventType.MediaPlayerAudioVolume
MediaPlayerBackward = pyparrot.utils.vlc.EventType.MediaPlayerBackward
MediaPlayerBuffering = pyparrot.utils.vlc.EventType.MediaPlayerBuffering
MediaPlayerChapterChanged = pyparrot.utils.vlc.EventType.MediaPlayerChapterChanged
MediaPlayerCorked = pyparrot.utils.vlc.EventType.MediaPlayerCorked
MediaPlayerESAdded = pyparrot.utils.vlc.EventType.MediaPlayerESAdded
MediaPlayerESDeleted = pyparrot.utils.vlc.EventType.MediaPlayerESDeleted
MediaPlayerESSelected = pyparrot.utils.vlc.EventType.MediaPlayerESSelected
MediaPlayerEncounteredError = pyparrot.utils.vlc.EventType.MediaPlayerEncounteredError
MediaPlayerEndReached = pyparrot.utils.vlc.EventType.MediaPlayerEndReached
MediaPlayerForward = pyparrot.utils.vlc.EventType.MediaPlayerForward
MediaPlayerLengthChanged = pyparrot.utils.vlc.EventType.MediaPlayerLengthChanged
MediaPlayerMediaChanged = pyparrot.utils.vlc.EventType.MediaPlayerMediaChanged
MediaPlayerMuted = pyparrot.utils.vlc.EventType.MediaPlayerMuted
MediaPlayerNothingSpecial = pyparrot.utils.vlc.EventType.MediaPlayerNothingSpecial
MediaPlayerOpening = pyparrot.utils.vlc.EventType.MediaPlayerOpening
MediaPlayerPausableChanged = pyparrot.utils.vlc.EventType.MediaPlayerPausableChanged
MediaPlayerPaused = pyparrot.utils.vlc.EventType.MediaPlayerPaused
MediaPlayerPlaying = pyparrot.utils.vlc.EventType.MediaPlayerPlaying
MediaPlayerPositionChanged = pyparrot.utils.vlc.EventType.MediaPlayerPositionChanged
MediaPlayerScrambledChanged = pyparrot.utils.vlc.EventType.MediaPlayerScrambledChanged
MediaPlayerSeekableChanged = pyparrot.utils.vlc.EventType.MediaPlayerSeekableChanged
MediaPlayerSnapshotTaken = pyparrot.utils.vlc.EventType.MediaPlayerSnapshotTaken
MediaPlayerStopped = pyparrot.utils.vlc.EventType.MediaPlayerStopped
MediaPlayerTimeChanged = pyparrot.utils.vlc.EventType.MediaPlayerTimeChanged
MediaPlayerTitleChanged = pyparrot.utils.vlc.EventType.MediaPlayerTitleChanged
MediaPlayerUncorked = pyparrot.utils.vlc.EventType.MediaPlayerUncorked
MediaPlayerUnmuted = pyparrot.utils.vlc.EventType.MediaPlayerUnmuted
MediaPlayerVout = pyparrot.utils.vlc.EventType.MediaPlayerVout
MediaStateChanged = pyparrot.utils.vlc.EventType.MediaStateChanged
MediaSubItemAdded = pyparrot.utils.vlc.EventType.MediaSubItemAdded
MediaSubItemTreeAdded = pyparrot.utils.vlc.EventType.MediaSubItemTreeAdded
RendererDiscovererItemAdded = pyparrot.utils.vlc.EventType.RendererDiscovererItemAdded
RendererDiscovererItemDeleted = pyparrot.utils.vlc.EventType.RendererDiscovererItemDeleted
VlmMediaAdded = pyparrot.utils.vlc.EventType.VlmMediaAdded
VlmMediaChanged = pyparrot.utils.vlc.EventType.VlmMediaChanged
VlmMediaInstanceStarted = pyparrot.utils.vlc.EventType.VlmMediaInstanceStarted
VlmMediaInstanceStatusEnd = pyparrot.utils.vlc.EventType.VlmMediaInstanceStatusEnd
VlmMediaInstanceStatusError = pyparrot.utils.vlc.EventType.VlmMediaInstanceStatusError
VlmMediaInstanceStatusInit = pyparrot.utils.vlc.EventType.VlmMediaInstanceStatusInit
VlmMediaInstanceStatusOpening = pyparrot.utils.vlc.EventType.VlmMediaInstanceStatusOpening
VlmMediaInstanceStatusPause = pyparrot.utils.vlc.EventType.VlmMediaInstanceStatusPause
VlmMediaInstanceStatusPlaying = pyparrot.utils.vlc.EventType.VlmMediaInstanceStatusPlaying
VlmMediaInstanceStopped = pyparrot.utils.vlc.EventType.VlmMediaInstanceStopped
VlmMediaRemoved = pyparrot.utils.vlc.EventType.VlmMediaRemoved
class pyparrot.utils.vlc.EventUnion[source]

Bases: _ctypes.Union

filename

Structure/Union member

media

Structure/Union member

media_event

Structure/Union member

meta_type

Structure/Union member

new_cache

Structure/Union member

new_child

Structure/Union member

new_count

Structure/Union member

new_duration

Structure/Union member

new_length

Structure/Union member

new_pausable

Structure/Union member

new_position

Structure/Union member

new_scrambled

Structure/Union member

new_seekable

Structure/Union member

new_state

Structure/Union member

new_status

Structure/Union member

new_time

Structure/Union member

new_title

Structure/Union member

class pyparrot.utils.vlc.FILE[source]

Bases: _ctypes.Structure

pyparrot.utils.vlc.FILE_ptr

alias of pyparrot.utils.vlc.LP_FILE

class pyparrot.utils.vlc.Instance[source]

Bases: pyparrot.utils.vlc._Ctype

Create a new Instance instance.

It may take as parameter either:
  • a string
  • a list of strings as first parameters
  • the parameters given as the constructor parameters (must be strings)
add_intf(name)[source]

Try to start a user interface for the libvlc instance. @param name: interface name, or None for default. @return: 0 on success, -1 on error.

audio_filter_list_get()[source]

Returns a list of available audio filters.

audio_output_device_count(psz_audio_output)[source]

Backward compatibility stub. Do not use in new code. deprecated Use L{audio_output_device_list_get}() instead. @return: always 0.

audio_output_device_id(psz_audio_output, i_device)[source]

Backward compatibility stub. Do not use in new code. deprecated Use L{audio_output_device_list_get}() instead. @return: always None.

audio_output_device_list_get(aout)[source]

Gets a list of audio output devices for a given audio output module, See L{audio_output_device_set}(). @note: Not all audio outputs support this. In particular, an empty (None) list of devices does B{not} imply that the specified audio output does not work. @note: The list might not be exhaustive. @warning: Some audio output devices in the list might not actually work in some circumstances. By default, it is recommended to not specify any explicit audio device. @param aout: audio output name (as returned by L{audio_output_list_get}()). @return: A None-terminated linked list of potential audio output devices. It must be freed with L{audio_output_device_list_release}(). @version: LibVLC 2.1.0 or later.

audio_output_device_longname(psz_output, i_device)[source]

Backward compatibility stub. Do not use in new code. deprecated Use L{audio_output_device_list_get}() instead. @return: always None.

audio_output_enumerate_devices()[source]

Enumerate the defined audio output devices.

@return: list of dicts {name:, description:, devices:}

audio_output_list_get()[source]

Gets the list of available audio output modules. @return: list of available audio outputs. It must be freed with In case of error, None is returned.

get_log_verbosity()[source]

Always returns minus one. This function is only provided for backward compatibility. @return: always -1.

log_open()[source]

This function does nothing useful. It is only provided for backward compatibility. @return: an unique pointer or None on error.

log_set(cb, data)[source]

Sets the logging callback for a LibVLC instance. This function is thread-safe: it will wait for any pending callbacks invocation to complete. @param data: opaque data pointer for the callback function @note Some log messages (especially debug) are emitted by LibVLC while is being initialized. These messages cannot be captured with this interface. @warning A deadlock may occur if this function is called from the callback. @param p_instance: libvlc instance. @version: LibVLC 2.1.0 or later.

log_set_file(stream)[source]

Sets up logging to a file. @param stream: FILE pointer opened for writing (the FILE pointer must remain valid until L{log_unset}()). @version: LibVLC 2.1.0 or later.

log_unset()[source]

Unsets the logging callback. This function deregisters the logging callback for a LibVLC instance. This is rarely needed as the callback is implicitly unset when the instance is destroyed. @note: This function will wait for any pending callbacks invocation to complete (causing a deadlock if called from within the callback). @version: LibVLC 2.1.0 or later.

media_discoverer_list_get(i_cat, ppp_services)[source]

Get media discoverer services by category. @param i_cat: category of services to fetch. @param ppp_services: address to store an allocated array of media discoverer services (must be freed with L{media_discoverer_list_release}() by the caller) [OUT]. @return: the number of media discoverer services (0 on error). @version: LibVLC 3.0.0 and later.

media_discoverer_new(psz_name)[source]

Create a media discoverer object by name. After this object is created, you should attach to media_list events in order to be notified of new items discovered. You need to call L{media_discoverer_start}() in order to start the discovery. See L{media_discoverer_media_list} See L{media_discoverer_event_manager} See L{media_discoverer_start}. @param psz_name: service name; use L{media_discoverer_list_get}() to get a list of the discoverer names available in this libVLC instance. @return: media discover object or None in case of error. @version: LibVLC 3.0.0 or later.

media_discoverer_new_from_name(psz_name)[source]

deprecated Use L{media_discoverer_new}() and L{media_discoverer_start}().

media_library_new()[source]

Create an new Media Library object. @return: a new object or None on error.

media_list_new(mrls=None)[source]

Create a new MediaList instance. @param mrls: optional list of MRL strings

media_list_player_new()[source]

Create a new MediaListPlayer instance.

media_new(mrl, *options)[source]

Create a new Media instance.

If mrl contains a colon (:) preceded by more than 1 letter, it will be treated as a URL. Else, it will be considered as a local path. If you need more control, directly use media_new_location/media_new_path methods.

Options can be specified as supplementary string parameters, but note that many options cannot be set at the media level, and rather at the Instance level. For instance, the marquee filter must be specified when creating the vlc.Instance or vlc.MediaPlayer.

Alternatively, options can be added to the media using the Media.add_options method (with the same limitation).

@param options: optional media option=value strings

media_new_as_node(psz_name)[source]

Create a media as an empty node with a given name. See L{media_release}. @param psz_name: the name of the node. @return: the new empty media or None on error.

media_new_callbacks(open_cb, read_cb, seek_cb, close_cb, opaque)[source]

Create a media with custom callbacks to read the data from. @param open_cb: callback to open the custom bitstream input media. @param read_cb: callback to read data (must not be None). @param seek_cb: callback to seek, or None if seeking is not supported. @param close_cb: callback to close the media, or None if unnecessary. @param opaque: data pointer for the open callback. @return: the newly created media or None on error @note If open_cb is None, the opaque pointer will be passed to read_cb, seek_cb and close_cb, and the stream size will be treated as unknown. @note The callbacks may be called asynchronously (from another thread). A single stream instance need not be reentrant. However the open_cb needs to be reentrant if the media is used by multiple player instances. @warning The callbacks may be used until all or any player instances that were supplied the media item are stopped. See L{media_release}. @version: LibVLC 3.0.0 and later.

media_new_fd(fd)[source]

Create a media for an already open file descriptor. The file descriptor shall be open for reading (or reading and writing). Regular file descriptors, pipe read descriptors and character device descriptors (including TTYs) are supported on all platforms. Block device descriptors are supported where available. Directory descriptors are supported on systems that provide fdopendir(). Sockets are supported on all platforms where they are file descriptors, i.e. all except Windows. @note: This library will B{not} automatically close the file descriptor under any circumstance. Nevertheless, a file descriptor can usually only be rendered once in a media player. To render it a second time, the file descriptor should probably be rewound to the beginning with lseek(). See L{media_release}. @param fd: open file descriptor. @return: the newly created media or None on error. @version: LibVLC 1.1.5 and later.

media_new_location(psz_mrl)[source]

Create a media with a certain given media resource location, for instance a valid URL. @note: To refer to a local file with this function, the file://… URI syntax B{must} be used (see IETF RFC3986). We recommend using L{media_new_path}() instead when dealing with local files. See L{media_release}. @param psz_mrl: the media location. @return: the newly created media or None on error.

media_new_path(path)[source]

Create a media for a certain file path. See L{media_release}. @param path: local filesystem path. @return: the newly created media or None on error.

media_player_new(uri=None)[source]

Create a new MediaPlayer instance.

@param uri: an optional URI to play in the player.

playlist_play(i_id, i_options, ppsz_options)[source]

Start playing (if there is any item in the playlist). Additionnal playlist item options can be specified for addition to the item before it is played. @param i_id: the item to play. If this is a negative number, the next item will be selected. Otherwise, the item with the given ID will be played. @param i_options: the number of options to add to the item. @param ppsz_options: the options to add to the item.

release()[source]

Decrement the reference count of a libvlc instance, and destroy it if it reaches zero.

renderer_discoverer_list_get(ppp_services)[source]

Get media discoverer services See libvlc_renderer_list_release(). @param ppp_services: address to store an allocated array of renderer discoverer services (must be freed with libvlc_renderer_list_release() by the caller) [OUT]. @return: the number of media discoverer services (0 on error). @version: LibVLC 3.0.0 and later.

renderer_discoverer_new(psz_name)[source]

Create a renderer discoverer object by name After this object is created, you should attach to events in order to be notified of the discoverer events. You need to call L{renderer_discoverer_start}() in order to start the discovery. See L{renderer_discoverer_event_manager}() See L{renderer_discoverer_start}(). @param psz_name: service name; use L{renderer_discoverer_list_get}() to get a list of the discoverer names available in this libVLC instance. @return: media discover object or None in case of error. @version: LibVLC 3.0.0 or later.

retain()[source]

Increments the reference count of a libvlc instance. The initial reference count is 1 after L{new}() returns.

set_app_id(id, version, icon)[source]

Sets some meta-information about the application. See also L{set_user_agent}(). @param id: Java-style application identifier, e.g. “com.acme.foobar”. @param version: application version numbers, e.g. “1.2.3”. @param icon: application icon name, e.g. “foobar”. @version: LibVLC 2.1.0 or later.

set_log_verbosity(level)[source]

This function does nothing. It is only provided for backward compatibility. @param level: ignored.

set_user_agent(name, http)[source]

Sets the application name. LibVLC passes this as the user agent string when a protocol requires it. @param name: human-readable application name, e.g. “FooBar player 1.2.3”. @param http: HTTP User Agent, e.g. “FooBar/1.2.3 Python/2.6.0”. @version: LibVLC 1.1.1 or later.

video_filter_list_get()[source]

Returns a list of available video filters.

vlm_add_broadcast(psz_name, psz_input, psz_output, i_options, ppsz_options, b_enabled, b_loop)[source]

Add a broadcast, with one input. @param psz_name: the name of the new broadcast. @param psz_input: the input MRL. @param psz_output: the output MRL (the parameter to the “sout” variable). @param i_options: number of additional options. @param ppsz_options: additional options. @param b_enabled: boolean for enabling the new broadcast. @param b_loop: Should this broadcast be played in loop ? @return: 0 on success, -1 on error.

vlm_add_input(psz_name, psz_input)[source]

Add a media’s input MRL. This will add the specified one. @param psz_name: the media to work on. @param psz_input: the input MRL. @return: 0 on success, -1 on error.

vlm_add_vod(psz_name, psz_input, i_options, ppsz_options, b_enabled, psz_mux)[source]

Add a vod, with one input. @param psz_name: the name of the new vod media. @param psz_input: the input MRL. @param i_options: number of additional options. @param ppsz_options: additional options. @param b_enabled: boolean for enabling the new vod. @param psz_mux: the muxer of the vod media. @return: 0 on success, -1 on error.

vlm_change_media(psz_name, psz_input, psz_output, i_options, ppsz_options, b_enabled, b_loop)[source]

Edit the parameters of a media. This will delete all existing inputs and add the specified one. @param psz_name: the name of the new broadcast. @param psz_input: the input MRL. @param psz_output: the output MRL (the parameter to the “sout” variable). @param i_options: number of additional options. @param ppsz_options: additional options. @param b_enabled: boolean for enabling the new broadcast. @param b_loop: Should this broadcast be played in loop ? @return: 0 on success, -1 on error.

vlm_del_media(psz_name)[source]

Delete a media (VOD or broadcast). @param psz_name: the media to delete. @return: 0 on success, -1 on error.

vlm_get_event_manager = functools.partial(<bound method memoize_parameterless.__call__ of Get libvlc_event_manager from a vlm media. The p_event_manager is immutable, so you don't have to hold the lock. @return: libvlc_event_manager. >, None)
vlm_get_media_instance_chapter(psz_name, i_instance)[source]

Get vlm_media instance chapter number by name or instance id. @param psz_name: name of vlm media instance. @param i_instance: instance id. @return: chapter as number or -1 on error. @bug: will always return 0.

vlm_get_media_instance_length(psz_name, i_instance)[source]

Get vlm_media instance length by name or instance id. @param psz_name: name of vlm media instance. @param i_instance: instance id. @return: length of media item or -1 on error.

vlm_get_media_instance_position(psz_name, i_instance)[source]

Get vlm_media instance position by name or instance id. @param psz_name: name of vlm media instance. @param i_instance: instance id. @return: position as float or -1. on error.

vlm_get_media_instance_rate(psz_name, i_instance)[source]

Get vlm_media instance playback rate by name or instance id. @param psz_name: name of vlm media instance. @param i_instance: instance id. @return: playback rate or -1 on error.

vlm_get_media_instance_seekable(psz_name, i_instance)[source]

Is libvlc instance seekable ? @param psz_name: name of vlm media instance. @param i_instance: instance id. @return: 1 if seekable, 0 if not, -1 if media does not exist. @bug: will always return 0.

vlm_get_media_instance_time(psz_name, i_instance)[source]

Get vlm_media instance time by name or instance id. @param psz_name: name of vlm media instance. @param i_instance: instance id. @return: time as integer or -1 on error.

vlm_get_media_instance_title(psz_name, i_instance)[source]

Get vlm_media instance title number by name or instance id. @param psz_name: name of vlm media instance. @param i_instance: instance id. @return: title as number or -1 on error. @bug: will always return 0.

vlm_pause_media(psz_name)[source]

Pause the named broadcast. @param psz_name: the name of the broadcast. @return: 0 on success, -1 on error.

vlm_play_media(psz_name)[source]

Play the named broadcast. @param psz_name: the name of the broadcast. @return: 0 on success, -1 on error.

vlm_release()[source]

Release the vlm instance related to the given L{Instance}.

vlm_seek_media(psz_name, f_percentage)[source]

Seek in the named broadcast. @param psz_name: the name of the broadcast. @param f_percentage: the percentage to seek to. @return: 0 on success, -1 on error.

vlm_set_enabled(psz_name, b_enabled)[source]

Enable or disable a media (VOD or broadcast). @param psz_name: the media to work on. @param b_enabled: the new status. @return: 0 on success, -1 on error.

vlm_set_input(psz_name, psz_input)[source]

Set a media’s input MRL. This will delete all existing inputs and add the specified one. @param psz_name: the media to work on. @param psz_input: the input MRL. @return: 0 on success, -1 on error.

vlm_set_loop(psz_name, b_loop)[source]

Set a media’s loop status. @param psz_name: the media to work on. @param b_loop: the new status. @return: 0 on success, -1 on error.

vlm_set_mux(psz_name, psz_mux)[source]

Set a media’s vod muxer. @param psz_name: the media to work on. @param psz_mux: the new muxer. @return: 0 on success, -1 on error.

vlm_set_output(psz_name, psz_output)[source]

Set the output for a media. @param psz_name: the media to work on. @param psz_output: the output MRL (the parameter to the “sout” variable). @return: 0 on success, -1 on error.

vlm_show_media(psz_name)[source]

Return information about the named media as a JSON string representation. This function is mainly intended for debugging use, if you want programmatic access to the state of a vlm_media_instance_t, please use the corresponding libvlc_vlm_get_media_instance_xxx -functions. Currently there are no such functions available for vlm_media_t though. @param psz_name: the name of the media, if the name is an empty string, all media is described. @return: string with information about named media, or None on error.

vlm_stop_media(psz_name)[source]

Stop the named broadcast. @param psz_name: the name of the broadcast. @return: 0 on success, -1 on error.

wait()[source]

Waits until an interface causes the instance to exit. You should start at least one interface first, using L{add_intf}().

class pyparrot.utils.vlc.ListPOINTER(etype)[source]

Bases: object

Just like a POINTER but accept a list of ctype as an argument.

from_param(param)[source]
class pyparrot.utils.vlc.Log[source]

Bases: _ctypes.Structure

class pyparrot.utils.vlc.LogCb[source]

Bases: ctypes.c_void_p

Callback prototype for LibVLC log message handler. @param data: data pointer as given to L{libvlc_log_set}(). @param level: message level (@ref libvlc_log_level). @param ctx: message context (meta-information about the message). @param fmt: printf() format string (as defined by ISO C11). @param args: variable argument list for the format @note Log message handlers B{must} be thread-safe. @warning The message context pointer, the format string parameters and the variable arguments are only valid until the callback returns.

class pyparrot.utils.vlc.LogIterator[source]

Bases: pyparrot.utils.vlc._Ctype

Create a new VLC log iterator.

free()[source]

Frees memory allocated by L{log_get_iterator}().

has_next()[source]

Always returns zero. This function is only provided for backward compatibility. @return: always zero.

next()[source]
class pyparrot.utils.vlc.LogLevel[source]

Bases: pyparrot.utils.vlc._Enum

Logging messages level.

ote future libvlc versions may define new levels.

DEBUG = pyparrot.utils.vlc.LogLevel.DEBUG
ERROR = pyparrot.utils.vlc.LogLevel.ERROR
NOTICE = pyparrot.utils.vlc.LogLevel.NOTICE
WARNING = pyparrot.utils.vlc.LogLevel.WARNING
class pyparrot.utils.vlc.LogMessage[source]

Bases: pyparrot.utils.vlc._Cstruct

header

Structure/Union member

message

Structure/Union member

name

Structure/Union member

severity

Structure/Union member

size

Structure/Union member

type

Structure/Union member

pyparrot.utils.vlc.Log_ptr

alias of pyparrot.utils.vlc.LP_Log

class pyparrot.utils.vlc.Media[source]

Bases: pyparrot.utils.vlc._Ctype

Create a new Media instance.

Usage: Media(MRL, *options)

See vlc.Instance.media_new documentation for details.

add_option(psz_options)[source]

Add an option to the media. This option will be used to determine how the media_player will read the media. This allows to use VLC’s advanced reading/streaming options on a per-media basis. @note: The options are listed in ‘vlc –long-help’ from the command line, e.g. “-sout-all”. Keep in mind that available options and their semantics vary across LibVLC versions and builds. @warning: Not all options affects L{Media} objects: Specifically, due to architectural issues most audio and video options, such as text renderer options, have no effects on an individual media. These options must be set through L{new}() instead. @param psz_options: the options (as a string).

add_option_flag(psz_options, i_flags)[source]

Add an option to the media with configurable flags. This option will be used to determine how the media_player will read the media. This allows to use VLC’s advanced reading/streaming options on a per-media basis. The options are detailed in vlc –long-help, for instance “–sout-all”. Note that all options are not usable on medias: specifically, due to architectural issues, video-related options such as text renderer options cannot be set on a single media. They must be set on the whole libvlc instance instead. @param psz_options: the options (as a string). @param i_flags: the flags for this option.

add_options(*options)[source]

Add a list of options to the media.

Options must be written without the double-dash. Warning: most audio and video options, such as text renderer, have no effects on an individual media. These options must be set at the vlc.Instance or vlc.MediaPlayer instanciation.

@param options: optional media option=value strings

duplicate()[source]

Duplicate a media descriptor object.

event_manager = functools.partial(<bound method memoize_parameterless.__call__ of Get event manager from media descriptor object. NOTE: this function doesn't increment reference counting. @return: event manager object. >, None)
get_duration()[source]

Get duration (in ms) of media descriptor object item. @return: duration of media item or -1 on error.

get_instance()[source]
get_meta(e_meta)[source]

Read the meta of the media. If the media has not yet been parsed this will return None. See L{parse} See L{parse_with_options} See libvlc_MediaMetaChanged. @param e_meta: the meta to read. @return: the media’s meta.

get_mrl()[source]

Get the media resource locator (mrl) from a media descriptor object. @return: string with mrl of media descriptor object.

get_parsed_status()[source]

Get Parsed status for media descriptor object. See libvlc_MediaParsedChanged See libvlc_media_parsed_status_t. @return: a value of the libvlc_media_parsed_status_t enum. @version: LibVLC 3.0.0 or later.

get_state()[source]

Get current state of media descriptor object. Possible media states are libvlc_NothingSpecial=0, libvlc_Opening, libvlc_Playing, libvlc_Paused, libvlc_Stopped, libvlc_Ended, libvlc_Error. See libvlc_state_t. @return: state of media descriptor object.

get_stats(p_stats)[source]

Get the current statistics about the media. @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.

get_tracks_info()[source]

Get media descriptor’s elementary streams description Note, you need to call L{parse}() or play the media at least once before calling this function. Not doing this will result in an empty array. deprecated Use L{tracks_get}() instead. @param tracks: address to store an allocated array of Elementary Streams descriptions (must be freed by the caller) [OUT]. @return: the number of Elementary Streams.

get_type()[source]

Get the media type of the media descriptor object. @return: media type. @version: LibVLC 3.0.0 and later. See libvlc_media_type_t.

get_user_data()[source]

Get media descriptor’s user_data. user_data is specialized data accessed by the host application, VLC.framework uses it as a pointer to an native object that references a L{Media} pointer.

is_parsed()[source]

Return true is the media descriptor object is parsed deprecated This can return true in case of failure.

Use L{get_parsed_status}() instead

See libvlc_MediaParsedChanged. @return: true if media object has been parsed otherwise it returns false libvlc_return_bool.

parse()[source]

Parse a media. This fetches (local) art, meta data and tracks information. The method is synchronous. deprecated This function could block indefinitely.

Use L{parse_with_options}() instead

See L{parse_with_options} See L{get_meta} See L{get_tracks_info}.

parse_async()[source]

Parse a media. This fetches (local) art, meta data and tracks information. The method is the asynchronous of L{parse}(). To track when this is over you can listen to libvlc_MediaParsedChanged event. However if the media was already parsed you will not receive this event. deprecated You can’t be sure to receive the libvlc_MediaParsedChanged

event (you can wait indefinitely for this event). Use L{parse_with_options}() instead

See L{parse} See libvlc_MediaParsedChanged See L{get_meta} See L{get_tracks_info}.

parse_stop()[source]

Stop the parsing of the media When the media parsing is stopped, the libvlc_MediaParsedChanged event will be sent with the libvlc_media_parsed_status_timeout status. See L{parse_with_options}. @version: LibVLC 3.0.0 or later.

parse_with_options(parse_flag, timeout)[source]

Parse the media asynchronously with options. This fetches (local or network) art, meta data and/or tracks information. This method is the extended version of L{parse_with_options}(). To track when this is over you can listen to libvlc_MediaParsedChanged event. However if this functions returns an error, you will not receive any events. It uses a flag to specify parse options (see libvlc_media_parse_flag_t). All these flags can be combined. By default, media is parsed if it’s a local file. @note: Parsing can be aborted with L{parse_stop}(). See libvlc_MediaParsedChanged See L{get_meta} See L{tracks_get} See L{get_parsed_status} See libvlc_media_parse_flag_t. @param parse_flag: parse options: @param timeout: maximum time allowed to preparse the media. If -1, the default “preparse-timeout” option will be used as a timeout. If 0, it will wait indefinitely. If > 0, the timeout will be used (in milliseconds). @return: -1 in case of error, 0 otherwise. @version: LibVLC 3.0.0 or later.

player_new_from_media()[source]

Create a Media Player object from a Media. @return: a new media player object, or None on error.

release()[source]

Decrement the reference count of a media descriptor object. If the reference count is 0, then L{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.

retain()[source]

Retain a reference to a media descriptor object (libvlc_media_t). Use L{release}() to decrement the reference count of a media descriptor object.

save_meta()[source]

Save the meta previously set. @return: true if the write operation was successful.

set_meta(e_meta, psz_value)[source]

Set the meta of the media (this function will not save the meta, call L{save_meta} in order to save the meta). @param e_meta: the meta to write. @param psz_value: the media’s meta.

set_user_data(p_new_user_data)[source]

Sets media descriptor’s user_data. user_data is specialized data accessed by the host application, VLC.framework uses it as a pointer to an native object that references a L{Media} pointer. @param p_new_user_data: pointer to user data.

slaves_add(i_type, i_priority, psz_uri)[source]

Add a slave to the current media. A slave is an external input source that may contains an additional subtitle track (like a .srt) or an additional audio track (like a .ac3). @note: This function must be called before the media is parsed (via L{parse_with_options}()) or before the media is played (via L{player_play}()). @param i_type: subtitle or audio. @param i_priority: from 0 (low priority) to 4 (high priority). @param psz_uri: Uri of the slave (should contain a valid scheme). @return: 0 on success, -1 on error. @version: LibVLC 3.0.0 and later.

slaves_clear()[source]

Clear all slaves previously added by L{slaves_add}() or internally. @version: LibVLC 3.0.0 and later.

slaves_get(ppp_slaves)[source]

Get a media descriptor’s slave list The list will contain slaves parsed by VLC or previously added by L{slaves_add}(). The typical use case of this function is to save a list of slave in a database for a later use. @param ppp_slaves: address to store an allocated array of slaves (must be freed with L{slaves_release}()) [OUT]. @return: the number of slaves (zero on error). @version: LibVLC 3.0.0 and later. See L{slaves_add}.

subitems()[source]

Get subitems of media descriptor object. This will increment the reference count of supplied media descriptor object. Use L{list_release}() to decrement the reference counting. @return: list of media descriptor subitems or None.

tracks_get()[source]

Get media descriptor’s elementary streams description Note, you need to call L{parse}() or play the media at least once before calling this function. Not doing this will result in an empty array. The result must be freed with L{tracks_release}. @version: LibVLC 2.1.0 and later.

class pyparrot.utils.vlc.MediaCloseCb[source]

Bases: ctypes.c_void_p

Callback prototype to close a custom bitstream input media. @param opaque: private pointer as set by the @ref libvlc_media_open_cb callback.

class pyparrot.utils.vlc.MediaDiscoverer[source]

Bases: pyparrot.utils.vlc._Ctype

N/A

event_manager = functools.partial(<bound method memoize_parameterless.__call__ of Get event manager from media service discover object. \deprecated Useless, media_discoverer events are only triggered when calling L{start}() and L{stop}(). @return: event manager object. >, None)
is_running()[source]

Query if media service discover object is running. @return: true if running, false if not libvlc_return_bool.

localized_name()[source]

Get media service discover object its localized name. deprecated Useless, use L{list_get}() to get the longname of the service discovery. @return: localized name or None if the media_discoverer is not started.

media_list()[source]

Get media service discover media list. @return: list of media items.

release()[source]

Release media discover object. If the reference count reaches 0, then the object will be released.

start()[source]

Start media discovery. To stop it, call L{stop}() or L{list_release}() directly. See L{stop}. @return: -1 in case of error, 0 otherwise. @version: LibVLC 3.0.0 or later.

stop()[source]

Stop media discovery. See L{start}. @version: LibVLC 3.0.0 or later.

class pyparrot.utils.vlc.MediaDiscovererCategory[source]

Bases: pyparrot.utils.vlc._Enum

Category of a media discoverer See libvlc_media_discoverer_list_get().

devices = pyparrot.utils.vlc.MediaDiscovererCategory.devices
lan = pyparrot.utils.vlc.MediaDiscovererCategory.lan
localdirs = pyparrot.utils.vlc.MediaDiscovererCategory.localdirs
podcasts = pyparrot.utils.vlc.MediaDiscovererCategory.podcasts
class pyparrot.utils.vlc.MediaEvent[source]

Bases: pyparrot.utils.vlc._Cstruct

instance_name

Structure/Union member

media_name

Structure/Union member

class pyparrot.utils.vlc.MediaLibrary[source]

Bases: pyparrot.utils.vlc._Ctype

N/A

load()[source]

Load media library. @return: 0 on success, -1 on error.

media_list()[source]

Get media library subitems. @return: media list subitems.

release()[source]

Release media library object. This functions decrements the reference count of the media library object. If it reaches 0, then the object will be released.

retain()[source]

Retain a reference to a media library object. This function will increment the reference counting for this object. Use L{release}() to decrement the reference count.

class pyparrot.utils.vlc.MediaList[source]

Bases: pyparrot.utils.vlc._Ctype

Create a new MediaList instance.

Usage: MediaList(list_of_MRLs)

See vlc.Instance.media_list_new documentation for details.

add_media(mrl)[source]

Add media instance to media list.

The L{lock} should be held upon entering this function. @param mrl: a media instance or a MRL. @return: 0 on success, -1 if the media list is read-only.

count()[source]

Get count on media list items The L{lock} should be held upon entering this function. @return: number of items in media list.

event_manager = functools.partial(<bound method memoize_parameterless.__call__ of Get libvlc_event_manager from this media list instance. The p_event_manager is immutable, so you don't have to hold the lock. @return: libvlc_event_manager. >, None)
get_instance()[source]
index_of_item(p_md)[source]

Find index position of List media instance in media list. Warning: the function will return the first matched position. The L{lock} should be held upon entering this function. @param p_md: media instance. @return: position of media instance or -1 if media not found.

insert_media(p_md, i_pos)[source]

Insert media instance in media list on a position The L{lock} should be held upon entering this function. @param p_md: a media instance. @param i_pos: position in array where to insert. @return: 0 on success, -1 if the media list is read-only.

is_readonly()[source]

This indicates if this media list is read-only from a user point of view. @return: 1 on readonly, 0 on readwrite libvlc_return_bool.

item_at_index(i_pos)[source]

List media instance in media list at a position The L{lock} should be held upon entering this function. @param i_pos: position in array where to insert. @return: media instance at position i_pos, or None if not found. In case of success, L{media_retain}() is called to increase the refcount on the media.

lock()[source]

Get lock on media list items.

media()[source]

Get media instance from this media list instance. This action will increase the refcount on the media instance. The L{lock} should NOT be held upon entering this function. @return: media instance.

release()[source]

Release media list created with L{new}().

remove_index(i_pos)[source]

Remove media instance from media list on a position The L{lock} should be held upon entering this function. @param i_pos: position in array where to insert. @return: 0 on success, -1 if the list is read-only or the item was not found.

retain()[source]

Retain reference to a media list.

set_media(p_md)[source]

Associate media instance with this media list instance. If another media instance was present it will be released. The L{lock} should NOT be held upon entering this function. @param p_md: media instance to add.

unlock()[source]

Release lock on media list items The L{lock} should be held upon entering this function.

class pyparrot.utils.vlc.MediaListPlayer[source]

Bases: pyparrot.utils.vlc._Ctype

Create a new MediaListPlayer instance.

It may take as parameter either:
  • a vlc.Instance
  • nothing
event_manager = functools.partial(<bound method memoize_parameterless.__call__ of Return the event manager of this media_list_player. @return: the event manager. >, None)
get_instance()[source]

Return the associated Instance.

get_media_player()[source]

Get media player of the media_list_player instance. @return: media player instance @note the caller is responsible for releasing the returned instance.

get_state()[source]

Get current libvlc_state of media list player. @return: libvlc_state_t for media list player.

is_playing()[source]

Is media list playing? @return: true for playing and false for not playing libvlc_return_bool.

next()[source]

Play next item from media list. @return: 0 upon success -1 if there is no next item.

pause()[source]

Toggle pause (or resume) media list.

play()[source]

Play media list.

play_item(p_md)[source]

Play the given media item. @param p_md: the media instance. @return: 0 upon success, -1 if the media is not part of the media list.

play_item_at_index(i_index)[source]

Play media list item at position index. @param i_index: index in media list to play. @return: 0 upon success -1 if the item wasn’t found.

previous()[source]

Play previous item from media list. @return: 0 upon success -1 if there is no previous item.

release()[source]

Release a media_list_player after use Decrement the reference count of a media player object. If the reference count is 0, then L{release}() will release the media player object. If the media player object has been released, then it should not be used again.

retain()[source]

Retain a reference to a media player list object. Use L{release}() to decrement reference count.

set_media_list(p_mlist)[source]

Set the media list associated with the player. @param p_mlist: list of media.

set_media_player(p_mi)[source]

Replace media player in media_list_player with this instance. @param p_mi: media player instance.

set_pause(do_pause)[source]

Pause or resume media list. @param do_pause: play/resume if zero, pause if non-zero. @version: LibVLC 3.0.0 or later.

set_playback_mode(e_mode)[source]

Sets the playback mode for the playlist. @param e_mode: playback mode specification.

stop()[source]

Stop playing media list.

class pyparrot.utils.vlc.MediaOpenCb[source]

Bases: ctypes.c_void_p

Callback prototype to open a custom bitstream input media. The same media item can be opened multiple times. Each time, this callback is invoked. It should allocate and initialize any instance-specific resources, then store them in *datap. The instance resources can be freed in the @ref libvlc_media_close_cb callback. @param opaque: private pointer as passed to L{libvlc_media_new_callbacks}(). @return: datap storage space for a private data pointer, sizep byte length of the bitstream or UINT64_MAX if unknown.

class pyparrot.utils.vlc.MediaParseFlag[source]

Bases: pyparrot.utils.vlc._Enum

Parse flags used by libvlc_media_parse_with_options() See libvlc_media_parse_with_options.

interact = pyparrot.utils.vlc.MediaParseFlag.interact
local = pyparrot.utils.vlc.MediaParseFlag.local
network = pyparrot.utils.vlc.MediaParseFlag.network
class pyparrot.utils.vlc.MediaParsedStatus[source]

Bases: pyparrot.utils.vlc._Enum

Parse status used sent by libvlc_media_parse_with_options() or returned by libvlc_media_get_parsed_status() See libvlc_media_parse_with_options See libvlc_media_get_parsed_status.

done = pyparrot.utils.vlc.MediaParsedStatus.done
failed = pyparrot.utils.vlc.MediaParsedStatus.failed
skipped = pyparrot.utils.vlc.MediaParsedStatus.skipped
timeout = pyparrot.utils.vlc.MediaParsedStatus.timeout
class pyparrot.utils.vlc.MediaPlayer[source]

Bases: pyparrot.utils.vlc._Ctype

Create a new MediaPlayer instance.

It may take as parameter either:
  • a string (media URI), options… In this case, a vlc.Instance will be created.
  • a vlc.Instance, a string (media URI), options…
add_slave(i_type, psz_uri, b_select)[source]

Add a slave to the current media player. @note: If the player is playing, the slave will be added directly. This call will also update the slave list of the attached L{Media}. @param i_type: subtitle or audio. @param psz_uri: Uri of the slave (should contain a valid scheme). @param b_select: True if this slave should be selected when it’s loaded. @return: 0 on success, -1 on error. @version: LibVLC 3.0.0 and later. See L{media_slaves_add}.

audio_get_channel()[source]

Get current audio channel. @return: the audio channel See libvlc_audio_output_channel_t.

audio_get_delay()[source]

Get current audio delay. @return: the audio delay (microseconds). @version: LibVLC 1.1.1 or later.

audio_get_mute()[source]

Get current mute status. @return: the mute status (boolean) if defined, -1 if undefined/unapplicable.

audio_get_track()[source]

Get current audio track. @return: the audio track ID or -1 if no active input.

audio_get_track_count()[source]

Get number of available audio tracks. @return: the number of available audio tracks (int), or -1 if unavailable.

audio_get_track_description()[source]

Get the description of available audio tracks.

audio_get_volume()[source]

Get current software audio volume. @return: the software volume in percents (0 = mute, 100 = nominal / 0dB).

audio_output_device_enum()[source]

Gets a list of potential audio output devices, See L{audio_output_device_set}(). @note: Not all audio outputs support enumerating devices. The audio output may be functional even if the list is empty (None). @note: The list may not be exhaustive. @warning: Some audio output devices in the list might not actually work in some circumstances. By default, it is recommended to not specify any explicit audio device. @return: A None-terminated linked list of potential audio output devices. It must be freed with L{audio_output_device_list_release}(). @version: LibVLC 2.2.0 or later.

audio_output_device_get()[source]

Get the current audio output device identifier. This complements L{audio_output_device_set}(). @warning: The initial value for the current audio output device identifier may not be set or may be some unknown value. A LibVLC application should compare this value against the known device identifiers (e.g. those that were previously retrieved by a call to L{audio_output_device_enum} or L{audio_output_device_list_get}) to find the current audio output device. It is possible that the selected audio output device changes (an external change) without a call to L{audio_output_device_set}. That may make this method unsuitable to use if a LibVLC application is attempting to track dynamic audio device changes as they happen. @return: the current audio output device identifier None if no device is selected or in case of error (the result must be released with free() or L{free}()). @version: LibVLC 3.0.0 or later.

audio_output_device_set(module, device_id)[source]

Configures an explicit audio output device. If the module paramater is None, audio output will be moved to the device specified by the device identifier string immediately. This is the recommended usage. A list of adequate potential device strings can be obtained with L{audio_output_device_enum}(). However passing None is supported in LibVLC version 2.2.0 and later only; in earlier versions, this function would have no effects when the module parameter was None. If the module parameter is not None, the device parameter of the corresponding audio output, if it exists, will be set to the specified string. Note that some audio output modules do not have such a parameter (notably MMDevice and PulseAudio). A list of adequate potential device strings can be obtained with L{audio_output_device_list_get}(). @note: This function does not select the specified audio output plugin. L{audio_output_set}() is used for that purpose. @warning: The syntax for the device parameter depends on the audio output. Some audio output modules require further parameters (e.g. a channels map in the case of ALSA). @param module: If None, current audio output module. if non-None, name of audio output module. @param device_id: device identifier string. @return: Nothing. Errors are ignored (this is a design bug).

audio_output_set(psz_name)[source]

Selects an audio output module. @note: Any change will take be effect only after playback is stopped and restarted. Audio output cannot be changed while playing. @param psz_name: name of audio output, use psz_name of See L{AudioOutput}. @return: 0 if function succeeded, -1 on error.

audio_set_callbacks(play, pause, resume, flush, drain, opaque)[source]

Sets callbacks and private data for decoded audio. Use L{audio_set_format}() or L{audio_set_format_callbacks}() to configure the decoded audio format. @note: The audio callbacks override any other audio output mechanism. If the callbacks are set, LibVLC will B{not} output audio in any way. @param play: callback to play audio samples (must not be None). @param pause: callback to pause playback (or None to ignore). @param resume: callback to resume playback (or None to ignore). @param flush: callback to flush audio buffers (or None to ignore). @param drain: callback to drain audio buffers (or None to ignore). @param opaque: private pointer for the audio callbacks (as first parameter). @version: LibVLC 2.0.0 or later.

audio_set_channel(channel)[source]

Set current audio channel. @param channel: the audio channel, See libvlc_audio_output_channel_t. @return: 0 on success, -1 on error.

audio_set_delay(i_delay)[source]

Set current audio delay. The audio delay will be reset to zero each time the media changes. @param i_delay: the audio delay (microseconds). @return: 0 on success, -1 on error. @version: LibVLC 1.1.1 or later.

audio_set_format(format, rate, channels)[source]

Sets a fixed decoded audio format. This only works in combination with L{audio_set_callbacks}(), and is mutually exclusive with L{audio_set_format_callbacks}(). @param format: a four-characters string identifying the sample format (e.g. “S16N” or “FL32”). @param rate: sample rate (expressed in Hz). @param channels: channels count. @version: LibVLC 2.0.0 or later.

audio_set_format_callbacks(setup, cleanup)[source]

Sets decoded audio format via callbacks. This only works in combination with L{audio_set_callbacks}(). @param setup: callback to select the audio format (cannot be None). @param cleanup: callback to release any allocated resources (or None). @version: LibVLC 2.0.0 or later.

audio_set_mute(status)[source]

Set mute status. @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.

audio_set_track(i_track)[source]

Set current audio track. @param i_track: the track ID (i_id field from track description). @return: 0 on success, -1 on error.

audio_set_volume(i_volume)[source]

Set current software audio volume. @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.

audio_set_volume_callback(set_volume)[source]

Set callbacks and private data for decoded audio. This only works in combination with L{audio_set_callbacks}(). Use L{audio_set_format}() or L{audio_set_format_callbacks}() to configure the decoded audio format. @param set_volume: callback to apply audio volume, or None to apply volume in software. @version: LibVLC 2.0.0 or later.

audio_toggle_mute()[source]

Toggle mute status.

can_pause()[source]

Can this media player be paused? @return: true if the media player can pause libvlc_return_bool.

event_manager = functools.partial(<bound method memoize_parameterless.__call__ of Get the Event Manager from which the media player send event. @return: the event manager associated with p_mi. >, None)
get_agl()[source]

deprecated Use L{get_nsobject}() instead.

get_chapter()[source]

Get movie chapter. @return: chapter number currently playing, or -1 if there is no media.

get_chapter_count()[source]

Get movie chapter count. @return: number of chapters in movie, or -1.

get_chapter_count_for_title(i_title)[source]

Get title chapter count. @param i_title: title. @return: number of chapters in title, or -1.

get_fps()[source]

Get movie fps rate This function is provided for backward compatibility. It cannot deal with multiple video tracks. In LibVLC versions prior to 3.0, it would also fail if the file format did not convey the frame rate explicitly. deprecated Consider using L{media_tracks_get}() instead. @return: frames per second (fps) for this playing movie, or 0 if unspecified.

get_full_chapter_descriptions(i_chapters_of_title)[source]

Get the full description of available chapters. @param i_chapters_of_title: index of the title to query for chapters (uses current title if set to -1). @return: the chapters list @version: LibVLC 3.0.0 and later.

get_full_title_descriptions()[source]

Get the full description of available titles. @return: the titles list @version: LibVLC 3.0.0 and later.

get_fullscreen()[source]

Get current fullscreen status. @return: the fullscreen status (boolean) libvlc_return_bool.

get_hwnd()[source]

Get the Windows API window handle (HWND) previously set with L{set_hwnd}(). The handle will be returned even if LibVLC is not currently outputting any video to it. @return: a window handle or None if there are none.

get_instance()[source]

Return the associated Instance.

get_length()[source]

Get the current movie length (in ms). @return: the movie length (in ms), or -1 if there is no media.

get_media()[source]

Get the media used by the media_player. @return: the media associated with p_mi, or None if no media is associated.

get_nsobject()[source]

Get the NSView handler previously set with L{set_nsobject}(). @return: the NSView handler or 0 if none where set.

get_position()[source]

Get movie position as percentage between 0.0 and 1.0. @return: movie position, or -1. in case of error.

get_rate()[source]

Get the requested movie play rate. @warning: Depending on the underlying media, the requested rate may be different from the real playback rate. @return: movie play rate.

get_role()[source]
Gets the media role.
@return: the media player role (
ef libvlc_media_player_role_t).
@version: LibVLC 3.0.0 and later.
get_state()[source]

Get current movie state. @return: the current state of the media player (playing, paused, …) See libvlc_state_t.

get_time()[source]

Get the current movie time (in ms). @return: the movie time (in ms), or -1 if there is no media.

get_title()[source]

Get movie title. @return: title number currently playing, or -1.

get_title_count()[source]

Get movie title count. @return: title number count, or -1.

get_xwindow()[source]

Get the X Window System window identifier previously set with L{set_xwindow}(). Note that this will return the identifier even if VLC is not currently using it (for instance if it is playing an audio-only input). @return: an X window ID, or 0 if none where set.

has_vout()[source]

How many video outputs does this media player have? @return: the number of video outputs.

is_playing()[source]

is_playing. @return: 1 if the media player is playing, 0 otherwise libvlc_return_bool.

is_seekable()[source]

Is this media player seekable? @return: true if the media player can seek libvlc_return_bool.

navigate(navigate)[source]

Navigate through DVD Menu. @param navigate: the Navigation mode. @version: libVLC 2.0.0 or later.

next_chapter()[source]

Set next chapter (if applicable).

next_frame()[source]

Display the next frame (if supported).

pause()[source]

Toggle pause (no effect if there is no media).

play()[source]

Play. @return: 0 if playback started (and was already started), or -1 on error.

previous_chapter()[source]

Set previous chapter (if applicable).

program_scrambled()[source]

Check if the current program is scrambled. @return: true if the current program is scrambled libvlc_return_bool. @version: LibVLC 2.2.0 or later.

release()[source]

Release a media_player after use Decrement the reference count of a media player object. If the reference count is 0, then L{release}() will release the media player object. If the media player object has been released, then it should not be used again.

retain()[source]

Retain a reference to a media player object. Use L{release}() to decrement reference count.

set_agl(drawable)[source]

deprecated Use L{set_nsobject}() instead.

set_android_context(p_awindow_handler)[source]

Set the android context. @param p_awindow_handler: org.videolan.libvlc.AWindow jobject owned by the org.videolan.libvlc.MediaPlayer class from the libvlc-android project. @version: LibVLC 3.0.0 and later.

set_chapter(i_chapter)[source]

Set movie chapter (if applicable). @param i_chapter: chapter number to play.

set_equalizer(p_equalizer)[source]

Apply new equalizer settings to a media player. The equalizer is first created by invoking L{audio_equalizer_new}() or L{audio_equalizer_new_from_preset}(). It is possible to apply new equalizer settings to a media player whether the media player is currently playing media or not. Invoking this method will immediately apply the new equalizer settings to the audio output of the currently playing media if there is any. If there is no currently playing media, the new equalizer settings will be applied later if and when new media is played. Equalizer settings will automatically be applied to subsequently played media. To disable the equalizer for a media player invoke this method passing None for the p_equalizer parameter. The media player does not keep a reference to the supplied equalizer so it is safe for an application to release the equalizer reference any time after this method returns. @param p_equalizer: opaque equalizer handle, or None to disable the equalizer for this media player. @return: zero on success, -1 on error. @version: LibVLC 2.2.0 or later.

set_evas_object(p_evas_object)[source]

Set the EFL Evas Object. @param p_evas_object: a valid EFL Evas Object (Evas_Object). @return: -1 if an error was detected, 0 otherwise. @version: LibVLC 3.0.0 and later.

set_fullscreen(b_fullscreen)[source]

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 L{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} fullscreen mode is enabled. You will want to reparent it back to its normal parent when disabling fullscreen. @param b_fullscreen: boolean for fullscreen status.

set_hwnd(drawable)[source]

Set a Win32/Win64 API window handle (HWND).

Specify where the media player should render its video output. If LibVLC was built without Win32/Win64 API output support, then this has no effects.

@param drawable: windows handle of the drawable.

set_media(p_md)[source]

Set the media that will be used by the media_player. If any, previous md will be released. @param p_md: the Media. Afterwards the p_md can be safely destroyed.

set_mrl(mrl, *options)[source]

Set the MRL to play.

Warning: most audio and video options, such as text renderer, have no effects on an individual media. These options must be set at the vlc.Instance or vlc.MediaPlayer instanciation.

@param mrl: The MRL @param options: optional media option=value strings @return: the Media object

set_nsobject(drawable)[source]

Set the NSView handler where the media player should render its video output. Use the vout called “macosx”. The drawable is an NSObject that follow the VLCOpenGLVideoViewEmbedding protocol: @code.m @protocol VLCOpenGLVideoViewEmbedding <NSObject> - (void)addVoutSubview:(NSView *)view; - (void)removeVoutSubview:(NSView *)view; @end @endcode Or it can be an NSView object. If you want to use it along with Qt see the QMacCocoaViewContainer. Then the following code should work: @code.mm

NSView *video = [[NSView alloc] init]; QMacCocoaViewContainer *container = new QMacCocoaViewContainer(video, parent); L{set_nsobject}(mp, video); [video release];

@endcode You can find a live example in VLCVideoView in VLCKit.framework. @param drawable: the drawable that is either an NSView or an object following the VLCOpenGLVideoViewEmbedding protocol.

set_pause(do_pause)[source]

Pause or resume (no effect if there is no media). @param do_pause: play/resume if zero, pause if non-zero. @version: LibVLC 1.1.1 or later.

set_position(f_pos)[source]

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 f_pos: the position.

set_rate(rate)[source]

Set movie play rate. @param rate: movie play rate to set. @return: -1 if an error was detected, 0 otherwise (but even then, it might not actually work depending on the underlying media protocol).

set_renderer(p_item)[source]

Set a renderer to the media player @note: must be called before the first call of L{play}() to take effect. See L{renderer_discoverer_new}. @param p_item: an item discovered by L{renderer_discoverer_start}(). @return: 0 on success, -1 on error. @version: LibVLC 3.0.0 or later.

set_role(role)[source]
Sets the media role.
@param role: the media player role (
ef libvlc_media_player_role_t).
@return: 0 on success, -1 on error.
set_time(i_time)[source]

Set the movie time (in ms). This has no effect if no media is being played. Not all formats and protocols support this. @param i_time: the movie time (in ms).

set_title(i_title)[source]

Set movie title. @param i_title: title number to play.

set_video_title_display(position, timeout)[source]

Set if, and how, the video title will be shown when media is played. @param position: position at which to display the title, or libvlc_position_disable to prevent the title from being displayed. @param timeout: title display timeout in milliseconds (ignored if libvlc_position_disable). @version: libVLC 2.1.0 or later.

set_xwindow(drawable)[source]

Set an X Window System drawable where the media player should render its video output. The call takes effect when the playback starts. If it is already started, it might need to be stopped before changes apply. If LibVLC was built without X11 output support, then this function has no effects. By default, LibVLC will capture input events on the video rendering area. Use L{video_set_mouse_input}() and L{video_set_key_input}() to disable that and deliver events to the parent window / to the application instead. By design, the X11 protocol delivers input events to only one recipient. @warning The application must call the XInitThreads() function from Xlib before L{new}(), and before any call to XOpenDisplay() directly or via any other library. Failure to call XInitThreads() will seriously impede LibVLC performance. Calling XOpenDisplay() before XInitThreads() will eventually crash the process. That is a limitation of Xlib. @param drawable: X11 window ID @note The specified identifier must correspond to an existing Input/Output class X11 window. Pixmaps are B{not} currently supported. The default X11 server is assumed, i.e. that specified in the DISPLAY environment variable. @warning LibVLC can deal with invalid X11 handle errors, however some display drivers (EGL, GLX, VA and/or VDPAU) can unfortunately not. Thus the window handle must remain valid until playback is stopped, otherwise the process may abort or crash. @bug No more than one window handle per media player instance can be specified. If the media has multiple simultaneously active video tracks, extra tracks will be rendered into external windows beyond the control of the application.

stop()[source]

Stop (no effect if there is no media).

toggle_fullscreen()[source]

Toggle fullscreen status on non-embedded video outputs. @warning: The same limitations applies to this function as to L{set_fullscreen}().

toggle_teletext()[source]

Toggle teletext transparent status on video output. deprecated use L{video_set_teletext}() instead.

video_get_adjust_float(option)[source]

Get float adjust option. @param option: adjust option to get, values of libvlc_video_adjust_option_t. @version: LibVLC 1.1.1 and later.

video_get_adjust_int(option)[source]

Get integer adjust option. @param option: adjust option to get, values of libvlc_video_adjust_option_t. @version: LibVLC 1.1.1 and later.

video_get_aspect_ratio()[source]

Get current video aspect ratio. @return: the video aspect ratio or None if unspecified (the result must be released with free() or L{free}()).

video_get_chapter_description(title)[source]

Get the description of available chapters for specific title.

@param title: selected title (int)

video_get_crop_geometry()[source]

Get current crop filter geometry. @return: the crop filter geometry or None if unset.

video_get_cursor(num=0)[source]

Get the mouse pointer coordinates over a video as 2-tuple (x, y).

Coordinates are expressed in terms of the decoded video resolution, B{not} in terms of pixels on the screen/viewport. To get the latter, you must query your windowing system directly.

Either coordinate may be negative or larger than the corresponding size of the video, if the cursor is outside the rendering area.

@warning: The coordinates may be out-of-date if the pointer is not located on the video rendering area. LibVLC does not track the mouse pointer if the latter is outside the video widget.

@note: LibVLC does not support multiple mouse pointers (but does support multiple input devices sharing the same pointer).

@param num: video number (default 0).

video_get_height(num=0)[source]

Get the height of a video in pixels.

@param num: video number (default 0).

video_get_logo_int(option)[source]

Get integer logo option. @param option: logo option to get, values of libvlc_video_logo_option_t.

video_get_marquee_int(option)[source]

Get an integer marquee option value. @param option: marq option to get See libvlc_video_marquee_int_option_t.

video_get_marquee_string(option)[source]

Get a string marquee option value. @param option: marq option to get See libvlc_video_marquee_string_option_t.

video_get_scale()[source]

Get the current video scaling factor. See also L{video_set_scale}(). @return: the currently configured zoom factor, or 0. if the video is set to fit to the output window/drawable automatically.

video_get_size(num=0)[source]

Get the video size in pixels as 2-tuple (width, height).

@param num: video number (default 0).

video_get_spu()[source]

Get current video subtitle. @return: the video subtitle selected, or -1 if none.

video_get_spu_count()[source]

Get the number of available video subtitles. @return: the number of available video subtitles.

video_get_spu_delay()[source]

Get the current subtitle delay. Positive values means subtitles are being displayed later, negative values earlier. @return: time (in microseconds) the display of subtitles is being delayed. @version: LibVLC 2.0.0 or later.

video_get_spu_description()[source]

Get the description of available video subtitles.

video_get_teletext()[source]

Get current teletext page requested or 0 if it’s disabled. Teletext is disabled by default, call L{video_set_teletext}() to enable it. @return: the current teletext page requested.

video_get_title_description()[source]

Get the description of available titles.

video_get_track()[source]

Get current video track. @return: the video track ID (int) or -1 if no active input.

video_get_track_count()[source]

Get number of available video tracks. @return: the number of available video tracks (int).

video_get_track_description()[source]

Get the description of available video tracks.

video_get_width(num=0)[source]

Get the width of a video in pixels.

@param num: video number (default 0).

video_set_adjust_float(option, value)[source]

Set adjust option as float. Options that take a different type value are ignored. @param option: adust option to set, values of libvlc_video_adjust_option_t. @param value: adjust option value. @version: LibVLC 1.1.1 and later.

video_set_adjust_int(option, value)[source]

Set adjust option as integer. Options that take a different type value are ignored. Passing libvlc_adjust_enable as option value has the side effect of starting (arg !0) or stopping (arg 0) the adjust filter. @param option: adust option to set, values of libvlc_video_adjust_option_t. @param value: adjust option value. @version: LibVLC 1.1.1 and later.

video_set_aspect_ratio(psz_aspect)[source]

Set new video aspect ratio. @param psz_aspect: new video aspect-ratio or None to reset to default @note Invalid aspect ratios are ignored.

video_set_callbacks(lock, unlock, display, opaque)[source]

Set callbacks and private data to render decoded video to a custom area in memory. Use L{video_set_format}() or L{video_set_format_callbacks}() to configure the decoded format. @warning: Rendering video into custom memory buffers is considerably less efficient than rendering in a custom window as normal. For optimal perfomances, VLC media player renders into a custom window, and does not use this function and associated callbacks. It is B{highly recommended} that other LibVLC-based application do likewise. To embed video in a window, use libvlc_media_player_set_xid() or equivalent depending on the operating system. If window embedding does not fit the application use case, then a custom LibVLC video output display plugin is required to maintain optimal video rendering performances. The following limitations affect performance: - Hardware video decoding acceleration will either be disabled completely,

or require (relatively slow) copy from video/DSP memory to main memory.
  • Sub-pictures (subtitles, on-screen display, etc.) must be blent into the main picture by the CPU instead of the GPU.
  • Depending on the video format, pixel format conversion, picture scaling, cropping and/or picture re-orientation, must be performed by the CPU instead of the GPU.
  • Memory copying is required between LibVLC reference picture buffers and application buffers (between lock and unlock callbacks).

@param lock: callback to lock video memory (must not be None). @param unlock: callback to unlock video memory (or None if not needed). @param display: callback to display video (or None if not needed). @param opaque: private pointer for the three callbacks (as first parameter). @version: LibVLC 1.1.1 or later.

video_set_crop_geometry(psz_geometry)[source]

Set new crop filter geometry. @param psz_geometry: new crop filter geometry (None to unset).

video_set_deinterlace(psz_mode)[source]

Enable or disable deinterlace filter. @param psz_mode: type of deinterlace filter, None to disable.

video_set_format(chroma, width, height, pitch)[source]

Set decoded video chroma and dimensions. This only works in combination with L{video_set_callbacks}(), and is mutually exclusive with L{video_set_format_callbacks}(). @param chroma: a four-characters string identifying the chroma (e.g. “RV32” or “YUYV”). @param width: pixel width. @param height: pixel height. @param pitch: line pitch (in bytes). @version: LibVLC 1.1.1 or later. @bug: All pixel planes are expected to have the same pitch. To use the YCbCr color space with chrominance subsampling, consider using L{video_set_format_callbacks}() instead.

video_set_format_callbacks(setup, cleanup)[source]

Set decoded video chroma and dimensions. This only works in combination with L{video_set_callbacks}(). @param setup: callback to select the video format (cannot be None). @param cleanup: callback to release any allocated resources (or None). @version: LibVLC 2.0.0 or later.

video_set_key_input(on)[source]

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 on: true to handle key press events, false to ignore them.

video_set_logo_int(option, value)[source]

Set logo option as integer. Options that take a different type value are ignored. Passing libvlc_logo_enable as option value has the side effect of starting (arg !0) or stopping (arg 0) the logo filter. @param option: logo option to set, values of libvlc_video_logo_option_t. @param value: logo option value.

video_set_logo_string(option, psz_value)[source]

Set logo option as string. Options that take a different type value are ignored. @param option: logo option to set, values of libvlc_video_logo_option_t. @param psz_value: logo option value.

video_set_marquee_int(option, i_val)[source]

Enable, disable or set an integer marquee option Setting libvlc_marquee_Enable has the side effect of enabling (arg !0) or disabling (arg 0) the marq filter. @param option: marq option to set See libvlc_video_marquee_int_option_t. @param i_val: marq option value.

video_set_marquee_string(option, psz_text)[source]

Set a marquee string option. @param option: marq option to set See libvlc_video_marquee_string_option_t. @param psz_text: marq option value.

video_set_mouse_input(on)[source]

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 L{video_set_key_input}(). @warning: This function is only implemented for X11 and Win32 at the moment. @param on: true to handle mouse click events, false to ignore them.

video_set_scale(f_factor)[source]

Set the video scaling factor. That is the ratio of the number of pixels on screen to the number of pixels in the original decoded video in each dimension. Zero is a special value; it will adjust the video to the output window/drawable (in windowed mode) or the entire screen. Note that not all video outputs support scaling. @param f_factor: the scaling factor, or zero.

video_set_spu(i_spu)[source]

Set new video subtitle. @param i_spu: video subtitle track to select (i_id from track description). @return: 0 on success, -1 if out of range.

video_set_spu_delay(i_delay)[source]

Set the subtitle delay. This affects the timing of when the subtitle will be displayed. Positive values result in subtitles being displayed later, while negative values will result in subtitles being displayed earlier. The subtitle delay will be reset to zero each time the media changes. @param i_delay: time (in microseconds) the display of subtitles should be delayed. @return: 0 on success, -1 on error. @version: LibVLC 2.0.0 or later.

video_set_subtitle_file(psz_subtitle)[source]

Set new video subtitle file. deprecated Use L{add_slave}() instead. @param psz_subtitle: new video subtitle file. @return: the success status (boolean).

video_set_teletext(i_page)[source]
Set new teletext page to retrieve.
This function can also be used to send a teletext key. @param i_page: teletex page number requested. This value can be 0 to disable teletext, a number in the range ]0;1000[ to show the requested page, or a

ef libvlc_teletext_key_t. 100 is the default teletext page.

video_set_track(i_track)[source]

Set video track. @param i_track: the track ID (i_id field from track description). @return: 0 on success, -1 if out of range.

video_take_snapshot(num, psz_filepath, i_width, i_height)[source]

Take a snapshot of the current video window. If i_width AND i_height is 0, original size is used. If i_width XOR i_height is 0, original aspect-ratio is preserved. @param num: number of video output (typically 0 for the first/only one). @param psz_filepath: the path of a file or a folder to save the screenshot into. @param i_width: the snapshot’s width. @param i_height: the snapshot’s height. @return: 0 on success, -1 if the video was not found.

video_update_viewpoint(p_viewpoint, b_absolute)[source]

Update the video viewpoint information. @note: It is safe to call this function before the media player is started. @param p_viewpoint: video viewpoint allocated via L{video_new_viewpoint}(). @param b_absolute: if true replace the old viewpoint with the new one. If false, increase/decrease it. @return: -1 in case of error, 0 otherwise @note the values are set asynchronously, it will be used by the next frame displayed. @version: LibVLC 3.0.0 and later.

will_play()[source]

Is the player able to play. @return: boolean libvlc_return_bool.

class pyparrot.utils.vlc.MediaPlayerRole[source]

Bases: pyparrot.utils.vlc._Enum

Media player roles.

ersion libvlc 3.0.0 and later. see ef libvlc_media_player_set_role().

Accessibility = pyparrot.utils.vlc.MediaPlayerRole.Accessibility
Animation = pyparrot.utils.vlc.MediaPlayerRole.Animation
Communication = pyparrot.utils.vlc.MediaPlayerRole.Communication
Game = pyparrot.utils.vlc.MediaPlayerRole.Game
Music = pyparrot.utils.vlc.MediaPlayerRole.Music
Notification = pyparrot.utils.vlc.MediaPlayerRole.Notification
Production = pyparrot.utils.vlc.MediaPlayerRole.Production
Test = pyparrot.utils.vlc.MediaPlayerRole.Test
Video = pyparrot.utils.vlc.MediaPlayerRole.Video
class pyparrot.utils.vlc.MediaReadCb[source]

Bases: ctypes.c_void_p

Callback prototype to read data from a custom bitstream input media. @param opaque: private pointer as set by the @ref libvlc_media_open_cb callback. @param buf: start address of the buffer to read data into. @param len: bytes length of the buffer. @return: strictly positive number of bytes read, 0 on end-of-stream, or -1 on non-recoverable error @note If no data is immediately available, then the callback should sleep. @warning The application is responsible for avoiding deadlock situations. In particular, the callback should return an error if playback is stopped; if it does not return, then L{libvlc_media_player_stop}() will never return.

class pyparrot.utils.vlc.MediaSeekCb[source]

Bases: ctypes.c_void_p

Callback prototype to seek a custom bitstream input media. @param opaque: private pointer as set by the @ref libvlc_media_open_cb callback. @param offset: absolute byte offset to seek to. @return: 0 on success, -1 on error.

class pyparrot.utils.vlc.MediaSlave[source]

Bases: pyparrot.utils.vlc._Cstruct

class pyparrot.utils.vlc.MediaSlaveType[source]

Bases: pyparrot.utils.vlc._Enum

Type of a media slave: subtitle or audio.

audio = pyparrot.utils.vlc.MediaSlaveType.audio
subtitle = pyparrot.utils.vlc.MediaSlaveType.subtitle
class pyparrot.utils.vlc.MediaStats[source]

Bases: pyparrot.utils.vlc._Cstruct

decoded_audio

Structure/Union member

decoded_video

Structure/Union member

demux_bitrate

Structure/Union member

demux_corrupted

Structure/Union member

demux_discontinuity

Structure/Union member

demux_read_bytes

Structure/Union member

displayed_pictures

Structure/Union member

input_bitrate

Structure/Union member

lost_abuffers

Structure/Union member

lost_pictures

Structure/Union member

played_abuffers

Structure/Union member

read_bytes

Structure/Union member

send_bitrate

Structure/Union member

sent_bytes

Structure/Union member

sent_packets

Structure/Union member

class pyparrot.utils.vlc.MediaTrack[source]

Bases: pyparrot.utils.vlc._Cstruct

audio

Structure/Union member

bitrate

Structure/Union member

codec

Structure/Union member

description

Structure/Union member

id

Structure/Union member

language

Structure/Union member

level

Structure/Union member

original_fourcc

Structure/Union member

profile

Structure/Union member

subtitle

Structure/Union member

type

Structure/Union member

u

Structure/Union member

video

Structure/Union member

class pyparrot.utils.vlc.MediaTrackInfo[source]

Bases: pyparrot.utils.vlc._Cstruct

channels_or_height

Structure/Union member

codec

Structure/Union member

id

Structure/Union member

level

Structure/Union member

profile

Structure/Union member

rate_or_width

Structure/Union member

type

Structure/Union member

class pyparrot.utils.vlc.MediaTrackTracks[source]

Bases: _ctypes.Union

audio

Structure/Union member

subtitle

Structure/Union member

video

Structure/Union member

class pyparrot.utils.vlc.MediaType[source]

Bases: pyparrot.utils.vlc._Enum

Media type See libvlc_media_get_type.

directory = pyparrot.utils.vlc.MediaType.directory
disc = pyparrot.utils.vlc.MediaType.disc
file = pyparrot.utils.vlc.MediaType.file
playlist = pyparrot.utils.vlc.MediaType.playlist
stream = pyparrot.utils.vlc.MediaType.stream
unknown = pyparrot.utils.vlc.MediaType.unknown
class pyparrot.utils.vlc.Meta[source]

Bases: pyparrot.utils.vlc._Enum

Meta data types.

Actors = pyparrot.utils.vlc.Meta.Actors
Album = pyparrot.utils.vlc.Meta.Album
AlbumArtist = pyparrot.utils.vlc.Meta.AlbumArtist
Artist = pyparrot.utils.vlc.Meta.Artist
ArtworkURL = pyparrot.utils.vlc.Meta.ArtworkURL
Copyright = pyparrot.utils.vlc.Meta.Copyright
Date = pyparrot.utils.vlc.Meta.Date
Description = pyparrot.utils.vlc.Meta.Description
Director = pyparrot.utils.vlc.Meta.Director
DiscNumber = pyparrot.utils.vlc.Meta.DiscNumber
DiscTotal = pyparrot.utils.vlc.Meta.DiscTotal
EncodedBy = pyparrot.utils.vlc.Meta.EncodedBy
Episode = pyparrot.utils.vlc.Meta.Episode
Genre = pyparrot.utils.vlc.Meta.Genre
Language = pyparrot.utils.vlc.Meta.Language
NowPlaying = pyparrot.utils.vlc.Meta.NowPlaying
Publisher = pyparrot.utils.vlc.Meta.Publisher
Rating = pyparrot.utils.vlc.Meta.Rating
Season = pyparrot.utils.vlc.Meta.Season
Setting = pyparrot.utils.vlc.Meta.Setting
ShowName = pyparrot.utils.vlc.Meta.ShowName
Title = pyparrot.utils.vlc.Meta.Title
TrackID = pyparrot.utils.vlc.Meta.TrackID
TrackNumber = pyparrot.utils.vlc.Meta.TrackNumber
TrackTotal = pyparrot.utils.vlc.Meta.TrackTotal
URL = pyparrot.utils.vlc.Meta.URL
class pyparrot.utils.vlc.ModuleDescription[source]

Bases: pyparrot.utils.vlc._Cstruct

help

Structure/Union member

longname

Structure/Union member

name

Structure/Union member

next

Structure/Union member

shortname

Structure/Union member

class pyparrot.utils.vlc.NavigateMode[source]

Bases: pyparrot.utils.vlc._Enum

Navigation mode.

activate = pyparrot.utils.vlc.NavigateMode.activate
down = pyparrot.utils.vlc.NavigateMode.down
left = pyparrot.utils.vlc.NavigateMode.left
popup = pyparrot.utils.vlc.NavigateMode.popup
right = pyparrot.utils.vlc.NavigateMode.right
up = pyparrot.utils.vlc.NavigateMode.up
class pyparrot.utils.vlc.PlaybackMode[source]

Bases: pyparrot.utils.vlc._Enum

Defines playback modes for playlist.

default = pyparrot.utils.vlc.PlaybackMode.default
loop = pyparrot.utils.vlc.PlaybackMode.loop
repeat = pyparrot.utils.vlc.PlaybackMode.repeat
class pyparrot.utils.vlc.PlaylistItem[source]

Bases: pyparrot.utils.vlc._Cstruct

id

Structure/Union member

name

Structure/Union member

uri

Structure/Union member

class pyparrot.utils.vlc.Position(*unused)[source]

Bases: object

Enum-like, immutable window position constants.

See e.g. VideoMarqueeOption.Position.

Bottom = 8
BottomCenter = 8
BottomLeft = 9
BottomRight = 10
Center = 0
CenterLeft = 1
CenterRight = 2
Left = 1
Right = 2
Top = 4
TopCenter = 4
TopLeft = 5
TopRight = 6
class pyparrot.utils.vlc.RDDescription[source]

Bases: pyparrot.utils.vlc._Cstruct

class pyparrot.utils.vlc.Rectangle[source]

Bases: pyparrot.utils.vlc._Cstruct

bottom

Structure/Union member

left

Structure/Union member

right

Structure/Union member

top

Structure/Union member

class pyparrot.utils.vlc.State[source]

Bases: pyparrot.utils.vlc._Enum

Note the order of libvlc_state_t enum must match exactly the order of See mediacontrol_playerstatus, See input_state_e enums, and videolan.libvlc.state (at bindings/cil/src/media.cs). expected states by web plugins are: idle/close=0, opening=1, playing=3, paused=4, stopping=5, ended=6, error=7.

Buffering = pyparrot.utils.vlc.State.Buffering
Ended = pyparrot.utils.vlc.State.Ended
Error = pyparrot.utils.vlc.State.Error
NothingSpecial = pyparrot.utils.vlc.State.NothingSpecial
Opening = pyparrot.utils.vlc.State.Opening
Paused = pyparrot.utils.vlc.State.Paused
Playing = pyparrot.utils.vlc.State.Playing
Stopped = pyparrot.utils.vlc.State.Stopped
class pyparrot.utils.vlc.SubtitleTrack[source]

Bases: pyparrot.utils.vlc._Cstruct

encoding

Structure/Union member

class pyparrot.utils.vlc.TeletextKey[source]

Bases: pyparrot.utils.vlc._Enum

Enumeration of teletext keys than can be passed via libvlc_video_set_teletext().

blue = pyparrot.utils.vlc.TeletextKey.blue
green = pyparrot.utils.vlc.TeletextKey.green
index = pyparrot.utils.vlc.TeletextKey.index
red = pyparrot.utils.vlc.TeletextKey.red
yellow = pyparrot.utils.vlc.TeletextKey.yellow
class pyparrot.utils.vlc.TitleDescription[source]

Bases: pyparrot.utils.vlc._Cstruct

class pyparrot.utils.vlc.TrackDescription[source]

Bases: pyparrot.utils.vlc._Cstruct

id

Structure/Union member

name

Structure/Union member

next

Structure/Union member

class pyparrot.utils.vlc.TrackType[source]

Bases: pyparrot.utils.vlc._Enum

N/A

audio = pyparrot.utils.vlc.TrackType.audio
text = pyparrot.utils.vlc.TrackType.text
unknown = pyparrot.utils.vlc.TrackType.FIXME_(4294967295)
video = pyparrot.utils.vlc.TrackType.video
exception pyparrot.utils.vlc.VLCException[source]

Bases: Exception

Exception raised by libvlc methods.

class pyparrot.utils.vlc.VideoAdjustOption[source]

Bases: pyparrot.utils.vlc._Enum

Option values for libvlc_video_{get,set}_adjust_{int,float,bool}.

Brightness = pyparrot.utils.vlc.VideoAdjustOption.Brightness
Contrast = pyparrot.utils.vlc.VideoAdjustOption.Contrast
Enable = pyparrot.utils.vlc.VideoAdjustOption.Enable
Gamma = pyparrot.utils.vlc.VideoAdjustOption.Gamma
Hue = pyparrot.utils.vlc.VideoAdjustOption.Hue
Saturation = pyparrot.utils.vlc.VideoAdjustOption.Saturation
class pyparrot.utils.vlc.VideoCleanupCb[source]

Bases: ctypes.c_void_p

Callback prototype to configure picture buffers format. @param opaque: private pointer as passed to L{libvlc_video_set_callbacks}() (and possibly modified by @ref libvlc_video_format_cb) [IN].

class pyparrot.utils.vlc.VideoDisplayCb[source]

Bases: ctypes.c_void_p

Callback prototype to display a picture. When the video frame needs to be shown, as determined by the media playback clock, the display callback is invoked. @param opaque: private pointer as passed to L{libvlc_video_set_callbacks}() [IN]. @param picture: private pointer returned from the @ref libvlc_video_lock_cb callback [IN].

class pyparrot.utils.vlc.VideoFormatCb[source]

Bases: ctypes.c_void_p

Callback prototype to configure picture buffers format. This callback gets the format of the video as output by the video decoder and the chain of video filters (if any). It can opt to change any parameter as it needs. In that case, LibVLC will attempt to convert the video format (rescaling and chroma conversion) but these operations can be CPU intensive. @param opaque: pointer to the private pointer passed to L{libvlc_video_set_callbacks}() [IN/OUT]. @param chroma: pointer to the 4 bytes video format identifier [IN/OUT]. @param width: pointer to the pixel width [IN/OUT]. @param height: pointer to the pixel height [IN/OUT]. @param pitches: table of scanline pitches in bytes for each pixel plane (the table is allocated by LibVLC) [OUT]. @return: lines table of scanlines count for each plane.

class pyparrot.utils.vlc.VideoLockCb[source]

Bases: ctypes.c_void_p

Callback prototype to allocate and lock a picture buffer. Whenever a new video frame needs to be decoded, the lock callback is invoked. Depending on the video chroma, one or three pixel planes of adequate dimensions must be returned via the second parameter. Those planes must be aligned on 32-bytes boundaries. @param opaque: private pointer as passed to L{libvlc_video_set_callbacks}() [IN]. @param planes: start address of the pixel planes (LibVLC allocates the array of void pointers, this callback must initialize the array) [OUT]. @return: a private pointer for the display and unlock callbacks to identify the picture buffers.

class pyparrot.utils.vlc.VideoLogoOption[source]

Bases: pyparrot.utils.vlc._Enum

Option values for libvlc_video_{get,set}_logo_{int,string}.

delay = pyparrot.utils.vlc.VideoLogoOption.delay
enable = pyparrot.utils.vlc.VideoLogoOption.enable
file = pyparrot.utils.vlc.VideoLogoOption.file
logo_x = pyparrot.utils.vlc.VideoLogoOption.logo_x
logo_y = pyparrot.utils.vlc.VideoLogoOption.logo_y
opacity = pyparrot.utils.vlc.VideoLogoOption.opacity
position = pyparrot.utils.vlc.VideoLogoOption.position
repeat = pyparrot.utils.vlc.VideoLogoOption.repeat
class pyparrot.utils.vlc.VideoMarqueeOption[source]

Bases: pyparrot.utils.vlc._Enum

Marq options definition.

Color = pyparrot.utils.vlc.VideoMarqueeOption.Color
Enable = pyparrot.utils.vlc.VideoMarqueeOption.Enable
Opacity = pyparrot.utils.vlc.VideoMarqueeOption.Opacity
Position = pyparrot.utils.vlc.VideoMarqueeOption.Position
Refresh = pyparrot.utils.vlc.VideoMarqueeOption.Refresh
Size = pyparrot.utils.vlc.VideoMarqueeOption.Size
Text = pyparrot.utils.vlc.VideoMarqueeOption.Text
Timeout = pyparrot.utils.vlc.VideoMarqueeOption.Timeout
marquee_X = pyparrot.utils.vlc.VideoMarqueeOption.marquee_X
marquee_Y = pyparrot.utils.vlc.VideoMarqueeOption.marquee_Y
class pyparrot.utils.vlc.VideoOrient[source]

Bases: pyparrot.utils.vlc._Enum

N/A

bottom = pyparrot.utils.vlc.VideoOrient.bottom
left = pyparrot.utils.vlc.VideoOrient.left
right = pyparrot.utils.vlc.VideoOrient.right
top = pyparrot.utils.vlc.VideoOrient.top
class pyparrot.utils.vlc.VideoProjection[source]

Bases: pyparrot.utils.vlc._Enum

N/A

equirectangular = pyparrot.utils.vlc.VideoProjection.equirectangular
rectangular = pyparrot.utils.vlc.VideoProjection.rectangular
standard = pyparrot.utils.vlc.VideoProjection.standard
class pyparrot.utils.vlc.VideoTrack[source]

Bases: pyparrot.utils.vlc._Cstruct

frame_rate_den

Structure/Union member

frame_rate_num

Structure/Union member

height

Structure/Union member

sar_den

Structure/Union member

sar_num

Structure/Union member

width

Structure/Union member

class pyparrot.utils.vlc.VideoUnlockCb[source]

Bases: ctypes.c_void_p

Callback prototype to unlock a picture buffer. When the video frame decoding is complete, the unlock callback is invoked. This callback might not be needed at all. It is only an indication that the application can now read the pixel values if it needs to. @note: A picture buffer is unlocked after the picture is decoded, but before the picture is displayed. @param opaque: private pointer as passed to L{libvlc_video_set_callbacks}() [IN]. @param picture: private pointer returned from the @ref libvlc_video_lock_cb callback [IN]. @param planes: pixel planes as defined by the @ref libvlc_video_lock_cb callback (this parameter is only for convenience) [IN].

class pyparrot.utils.vlc.VideoViewpoint[source]

Bases: pyparrot.utils.vlc._Cstruct

pyparrot.utils.vlc.bytes_to_str(b)[source]

Translate bytes to string.

pyparrot.utils.vlc.callbackmethod(callback)[source]

Now obsolete @callbackmethod decorator.

pyparrot.utils.vlc.cb

alias of pyparrot.utils.vlc.CallbackDecorators

pyparrot.utils.vlc.class_result(classname)[source]

Errcheck function. Returns a function that creates the specified class.

pyparrot.utils.vlc.debug_callback(event, *args, **kwds)[source]

Example callback, useful for debugging.

pyparrot.utils.vlc.find_lib()[source]
pyparrot.utils.vlc.get_default_instance()[source]

Return the default VLC.Instance.

pyparrot.utils.vlc.hex_version()[source]

Return the version of these bindings in hex or 0 if unavailable.

pyparrot.utils.vlc.libvlc_add_intf(p_instance, name)[source]

Try to start a user interface for the libvlc instance. @param p_instance: the instance. @param name: interface name, or None for default. @return: 0 on success, -1 on error.

pyparrot.utils.vlc.libvlc_audio_equalizer_get_amp_at_index(p_equalizer, u_band)[source]

Get the amplification value for a particular equalizer frequency band. @param p_equalizer: valid equalizer handle, must not be None. @param u_band: index, counting from zero, of the frequency band to get. @return: amplification value (Hz); NaN if there is no such frequency band. @version: LibVLC 2.2.0 or later.

pyparrot.utils.vlc.libvlc_audio_equalizer_get_band_count()[source]

Get the number of distinct frequency bands for an equalizer. @return: number of frequency bands. @version: LibVLC 2.2.0 or later.

pyparrot.utils.vlc.libvlc_audio_equalizer_get_band_frequency(u_index)[source]

Get a particular equalizer band frequency. This value can be used, for example, to create a label for an equalizer band control in a user interface. @param u_index: index of the band, counting from zero. @return: equalizer band frequency (Hz), or -1 if there is no such band. @version: LibVLC 2.2.0 or later.

pyparrot.utils.vlc.libvlc_audio_equalizer_get_preamp(p_equalizer)[source]

Get the current pre-amplification value from an equalizer. @param p_equalizer: valid equalizer handle, must not be None. @return: preamp value (Hz). @version: LibVLC 2.2.0 or later.

pyparrot.utils.vlc.libvlc_audio_equalizer_get_preset_count()[source]

Get the number of equalizer presets. @return: number of presets. @version: LibVLC 2.2.0 or later.

pyparrot.utils.vlc.libvlc_audio_equalizer_get_preset_name(u_index)[source]

Get the name of a particular equalizer preset. This name can be used, for example, to prepare a preset label or menu in a user interface. @param u_index: index of the preset, counting from zero. @return: preset name, or None if there is no such preset. @version: LibVLC 2.2.0 or later.

pyparrot.utils.vlc.libvlc_audio_equalizer_new()[source]

Create a new default equalizer, with all frequency values zeroed. The new equalizer can subsequently be applied to a media player by invoking L{libvlc_media_player_set_equalizer}(). The returned handle should be freed via L{libvlc_audio_equalizer_release}() when it is no longer needed. @return: opaque equalizer handle, or None on error. @version: LibVLC 2.2.0 or later.

pyparrot.utils.vlc.libvlc_audio_equalizer_new_from_preset(u_index)[source]

Create a new equalizer, with initial frequency values copied from an existing preset. The new equalizer can subsequently be applied to a media player by invoking L{libvlc_media_player_set_equalizer}(). The returned handle should be freed via L{libvlc_audio_equalizer_release}() when it is no longer needed. @param u_index: index of the preset, counting from zero. @return: opaque equalizer handle, or None on error. @version: LibVLC 2.2.0 or later.

pyparrot.utils.vlc.libvlc_audio_equalizer_release(p_equalizer)[source]

Release a previously created equalizer instance. The equalizer was previously created by using L{libvlc_audio_equalizer_new}() or L{libvlc_audio_equalizer_new_from_preset}(). It is safe to invoke this method with a None p_equalizer parameter for no effect. @param p_equalizer: opaque equalizer handle, or None. @version: LibVLC 2.2.0 or later.

pyparrot.utils.vlc.libvlc_audio_equalizer_set_amp_at_index(p_equalizer, f_amp, u_band)[source]

Set a new amplification value for a particular equalizer frequency band. The new equalizer settings are subsequently applied to a media player by invoking L{libvlc_media_player_set_equalizer}(). The supplied amplification value will be clamped to the -20.0 to +20.0 range. @param p_equalizer: valid equalizer handle, must not be None. @param f_amp: amplification value (-20.0 to 20.0 Hz). @param u_band: index, counting from zero, of the frequency band to set. @return: zero on success, -1 on error. @version: LibVLC 2.2.0 or later.

pyparrot.utils.vlc.libvlc_audio_equalizer_set_preamp(p_equalizer, f_preamp)[source]

Set a new pre-amplification value for an equalizer. The new equalizer settings are subsequently applied to a media player by invoking L{libvlc_media_player_set_equalizer}(). The supplied amplification value will be clamped to the -20.0 to +20.0 range. @param p_equalizer: valid equalizer handle, must not be None. @param f_preamp: preamp value (-20.0 to 20.0 Hz). @return: zero on success, -1 on error. @version: LibVLC 2.2.0 or later.

pyparrot.utils.vlc.libvlc_audio_filter_list_get(p_instance)[source]

Returns a list of audio filters that are available. @param p_instance: libvlc instance. @return: a list of module descriptions. It should be freed with L{libvlc_module_description_list_release}(). In case of an error, None is returned. See L{ModuleDescription} See L{libvlc_module_description_list_release}.

pyparrot.utils.vlc.libvlc_audio_get_channel(p_mi)[source]

Get current audio channel. @param p_mi: media player. @return: the audio channel See libvlc_audio_output_channel_t.

pyparrot.utils.vlc.libvlc_audio_get_delay(p_mi)[source]

Get current audio delay. @param p_mi: media player. @return: the audio delay (microseconds). @version: LibVLC 1.1.1 or later.

pyparrot.utils.vlc.libvlc_audio_get_mute(p_mi)[source]

Get current mute status. @param p_mi: media player. @return: the mute status (boolean) if defined, -1 if undefined/unapplicable.

pyparrot.utils.vlc.libvlc_audio_get_track(p_mi)[source]

Get current audio track. @param p_mi: media player. @return: the audio track ID or -1 if no active input.

pyparrot.utils.vlc.libvlc_audio_get_track_count(p_mi)[source]

Get number of available audio tracks. @param p_mi: media player. @return: the number of available audio tracks (int), or -1 if unavailable.

pyparrot.utils.vlc.libvlc_audio_get_track_description(p_mi)[source]

Get the description of available audio tracks. @param p_mi: media player. @return: list with description of available audio tracks, or None. It must be freed with L{libvlc_track_description_list_release}().

pyparrot.utils.vlc.libvlc_audio_get_volume(p_mi)[source]

Get current software audio volume. @param p_mi: media player. @return: the software volume in percents (0 = mute, 100 = nominal / 0dB).

pyparrot.utils.vlc.libvlc_audio_output_device_count(p_instance, psz_audio_output)[source]

Backward compatibility stub. Do not use in new code. deprecated Use L{libvlc_audio_output_device_list_get}() instead. @return: always 0.

pyparrot.utils.vlc.libvlc_audio_output_device_enum(mp)[source]

Gets a list of potential audio output devices, See L{libvlc_audio_output_device_set}(). @note: Not all audio outputs support enumerating devices. The audio output may be functional even if the list is empty (None). @note: The list may not be exhaustive. @warning: Some audio output devices in the list might not actually work in some circumstances. By default, it is recommended to not specify any explicit audio device. @param mp: media player. @return: A None-terminated linked list of potential audio output devices. It must be freed with L{libvlc_audio_output_device_list_release}(). @version: LibVLC 2.2.0 or later.

pyparrot.utils.vlc.libvlc_audio_output_device_get(mp)[source]

Get the current audio output device identifier. This complements L{libvlc_audio_output_device_set}(). @warning: The initial value for the current audio output device identifier may not be set or may be some unknown value. A LibVLC application should compare this value against the known device identifiers (e.g. those that were previously retrieved by a call to L{libvlc_audio_output_device_enum} or L{libvlc_audio_output_device_list_get}) to find the current audio output device. It is possible that the selected audio output device changes (an external change) without a call to L{libvlc_audio_output_device_set}. That may make this method unsuitable to use if a LibVLC application is attempting to track dynamic audio device changes as they happen. @param mp: media player. @return: the current audio output device identifier None if no device is selected or in case of error (the result must be released with free() or L{libvlc_free}()). @version: LibVLC 3.0.0 or later.

pyparrot.utils.vlc.libvlc_audio_output_device_id(p_instance, psz_audio_output, i_device)[source]

Backward compatibility stub. Do not use in new code. deprecated Use L{libvlc_audio_output_device_list_get}() instead. @return: always None.

pyparrot.utils.vlc.libvlc_audio_output_device_list_get(p_instance, aout)[source]

Gets a list of audio output devices for a given audio output module, See L{libvlc_audio_output_device_set}(). @note: Not all audio outputs support this. In particular, an empty (None) list of devices does B{not} imply that the specified audio output does not work. @note: The list might not be exhaustive. @warning: Some audio output devices in the list might not actually work in some circumstances. By default, it is recommended to not specify any explicit audio device. @param p_instance: libvlc instance. @param aout: audio output name (as returned by L{libvlc_audio_output_list_get}()). @return: A None-terminated linked list of potential audio output devices. It must be freed with L{libvlc_audio_output_device_list_release}(). @version: LibVLC 2.1.0 or later.

pyparrot.utils.vlc.libvlc_audio_output_device_list_release(p_list)[source]

Frees a list of available audio output devices. @param p_list: list with audio outputs for release. @version: LibVLC 2.1.0 or later.

pyparrot.utils.vlc.libvlc_audio_output_device_longname(p_instance, psz_output, i_device)[source]

Backward compatibility stub. Do not use in new code. deprecated Use L{libvlc_audio_output_device_list_get}() instead. @return: always None.

pyparrot.utils.vlc.libvlc_audio_output_device_set(mp, module, device_id)[source]

Configures an explicit audio output device. If the module paramater is None, audio output will be moved to the device specified by the device identifier string immediately. This is the recommended usage. A list of adequate potential device strings can be obtained with L{libvlc_audio_output_device_enum}(). However passing None is supported in LibVLC version 2.2.0 and later only; in earlier versions, this function would have no effects when the module parameter was None. If the module parameter is not None, the device parameter of the corresponding audio output, if it exists, will be set to the specified string. Note that some audio output modules do not have such a parameter (notably MMDevice and PulseAudio). A list of adequate potential device strings can be obtained with L{libvlc_audio_output_device_list_get}(). @note: This function does not select the specified audio output plugin. L{libvlc_audio_output_set}() is used for that purpose. @warning: The syntax for the device parameter depends on the audio output. Some audio output modules require further parameters (e.g. a channels map in the case of ALSA). @param mp: media player. @param module: If None, current audio output module. if non-None, name of audio output module. @param device_id: device identifier string. @return: Nothing. Errors are ignored (this is a design bug).

pyparrot.utils.vlc.libvlc_audio_output_list_get(p_instance)[source]

Gets the list of available audio output modules. @param p_instance: libvlc instance. @return: list of available audio outputs. It must be freed with In case of error, None is returned.

pyparrot.utils.vlc.libvlc_audio_output_list_release(p_list)[source]

Frees the list of available audio output modules. @param p_list: list with audio outputs for release.

pyparrot.utils.vlc.libvlc_audio_output_set(p_mi, psz_name)[source]

Selects an audio output module. @note: Any change will take be effect only after playback is stopped and restarted. Audio output cannot be changed while playing. @param p_mi: media player. @param psz_name: name of audio output, use psz_name of See L{AudioOutput}. @return: 0 if function succeeded, -1 on error.

pyparrot.utils.vlc.libvlc_audio_set_callbacks(mp, play, pause, resume, flush, drain, opaque)[source]

Sets callbacks and private data for decoded audio. Use L{libvlc_audio_set_format}() or L{libvlc_audio_set_format_callbacks}() to configure the decoded audio format. @note: The audio callbacks override any other audio output mechanism. If the callbacks are set, LibVLC will B{not} output audio in any way. @param mp: the media player. @param play: callback to play audio samples (must not be None). @param pause: callback to pause playback (or None to ignore). @param resume: callback to resume playback (or None to ignore). @param flush: callback to flush audio buffers (or None to ignore). @param drain: callback to drain audio buffers (or None to ignore). @param opaque: private pointer for the audio callbacks (as first parameter). @version: LibVLC 2.0.0 or later.

pyparrot.utils.vlc.libvlc_audio_set_channel(p_mi, channel)[source]

Set current audio channel. @param p_mi: media player. @param channel: the audio channel, See libvlc_audio_output_channel_t. @return: 0 on success, -1 on error.

pyparrot.utils.vlc.libvlc_audio_set_delay(p_mi, i_delay)[source]

Set current audio delay. The audio delay will be reset to zero each time the media changes. @param p_mi: media player. @param i_delay: the audio delay (microseconds). @return: 0 on success, -1 on error. @version: LibVLC 1.1.1 or later.

pyparrot.utils.vlc.libvlc_audio_set_format(mp, format, rate, channels)[source]

Sets a fixed decoded audio format. This only works in combination with L{libvlc_audio_set_callbacks}(), and is mutually exclusive with L{libvlc_audio_set_format_callbacks}(). @param mp: the media player. @param format: a four-characters string identifying the sample format (e.g. “S16N” or “FL32”). @param rate: sample rate (expressed in Hz). @param channels: channels count. @version: LibVLC 2.0.0 or later.

pyparrot.utils.vlc.libvlc_audio_set_format_callbacks(mp, setup, cleanup)[source]

Sets decoded audio format via callbacks. This only works in combination with L{libvlc_audio_set_callbacks}(). @param mp: the media player. @param setup: callback to select the audio format (cannot be None). @param cleanup: callback to release any allocated resources (or None). @version: LibVLC 2.0.0 or later.

pyparrot.utils.vlc.libvlc_audio_set_mute(p_mi, status)[source]

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.

pyparrot.utils.vlc.libvlc_audio_set_track(p_mi, i_track)[source]

Set current audio track. @param p_mi: media player. @param i_track: the track ID (i_id field from track description). @return: 0 on success, -1 on error.

pyparrot.utils.vlc.libvlc_audio_set_volume(p_mi, i_volume)[source]

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.

pyparrot.utils.vlc.libvlc_audio_set_volume_callback(mp, set_volume)[source]

Set callbacks and private data for decoded audio. This only works in combination with L{libvlc_audio_set_callbacks}(). Use L{libvlc_audio_set_format}() or L{libvlc_audio_set_format_callbacks}() to configure the decoded audio format. @param mp: the media player. @param set_volume: callback to apply audio volume, or None to apply volume in software. @version: LibVLC 2.0.0 or later.

pyparrot.utils.vlc.libvlc_audio_toggle_mute(p_mi)[source]

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 L{libvlc_audio_set_mute}().

pyparrot.utils.vlc.libvlc_chapter_descriptions_release(p_chapters, i_count)[source]

Release a chapter description. @param p_chapters: chapter description array to release. @param i_count: number of chapter descriptions to release. @version: LibVLC 3.0.0 and later.

pyparrot.utils.vlc.libvlc_clearerr()[source]

Clears the LibVLC error status for the current thread. This is optional. By default, the error status is automatically overridden when a new error occurs, and destroyed when the thread exits.

pyparrot.utils.vlc.libvlc_clock()[source]

Return the current time as defined by LibVLC. The unit is the microsecond. Time increases monotonically (regardless of time zone changes and RTC adjustements). The origin is arbitrary but consistent across the whole system (e.g. the system uptim, the time since the system was booted). @note: On systems that support it, the POSIX monotonic clock is used.

pyparrot.utils.vlc.libvlc_dialog_dismiss(p_id)[source]

Dismiss a dialog After this call, p_id won’t be valid anymore See libvlc_dialog_cbs.pf_cancel. @param p_id: id of the dialog. @return: 0 on success, or -1 on error. @version: LibVLC 3.0.0 and later.

pyparrot.utils.vlc.libvlc_dialog_get_context(p_id)[source]

Return the opaque pointer associated with the dialog id. @version: LibVLC 3.0.0 and later.

pyparrot.utils.vlc.libvlc_dialog_post_action(p_id, i_action)[source]

Post a question answer After this call, p_id won’t be valid anymore See libvlc_dialog_cbs.pf_display_question. @param p_id: id of the dialog. @param i_action: 1 for action1, 2 for action2. @return: 0 on success, or -1 on error. @version: LibVLC 3.0.0 and later.

pyparrot.utils.vlc.libvlc_dialog_post_login(p_id, psz_username, psz_password, b_store)[source]

Post a login answer After this call, p_id won’t be valid anymore See libvlc_dialog_cbs.pf_display_login. @param p_id: id of the dialog. @param psz_username: valid and non empty string. @param psz_password: valid string (can be empty). @param b_store: if true, store the credentials. @return: 0 on success, or -1 on error. @version: LibVLC 3.0.0 and later.

pyparrot.utils.vlc.libvlc_dialog_set_context(p_id, p_context)[source]

Associate an opaque pointer with the dialog id. @version: LibVLC 3.0.0 and later.

pyparrot.utils.vlc.libvlc_event_attach(p_event_manager, i_event_type, f_callback, user_data)[source]

Register for an event notification. @param p_event_manager: the event manager to which you want to attach to. Generally it is obtained by vlc_my_object_event_manager() where my_object is the object you want to listen to. @param i_event_type: the desired event to which we want to listen. @param f_callback: the function to call when i_event_type occurs. @param user_data: user provided data to carry with the event. @return: 0 on success, ENOMEM on error.

pyparrot.utils.vlc.libvlc_event_detach(p_event_manager, i_event_type, f_callback, p_user_data)[source]

Unregister an event notification. @param p_event_manager: the event manager. @param i_event_type: the desired event to which we want to unregister. @param f_callback: the function to call when i_event_type occurs. @param p_user_data: user provided data to carry with the event.

pyparrot.utils.vlc.libvlc_event_type_name(event_type)[source]

Get an event’s type name. @param event_type: the desired event.

pyparrot.utils.vlc.libvlc_get_changeset()[source]

Retrieve libvlc changeset. Example: “aa9bce0bc4”. @return: a string containing the libvlc changeset.

pyparrot.utils.vlc.libvlc_get_compiler()[source]

Retrieve libvlc compiler version. Example: “gcc version 4.2.3 (Ubuntu 4.2.3-2ubuntu6)”. @return: a string containing the libvlc compiler version.

pyparrot.utils.vlc.libvlc_get_fullscreen(p_mi)[source]

Get current fullscreen status. @param p_mi: the media player. @return: the fullscreen status (boolean) libvlc_return_bool.

pyparrot.utils.vlc.libvlc_get_log_verbosity(p_instance)[source]

Always returns minus one. This function is only provided for backward compatibility. @param p_instance: ignored. @return: always -1.

pyparrot.utils.vlc.libvlc_get_version()[source]

Retrieve libvlc version. Example: “1.1.0-git The Luggage”. @return: a string containing the libvlc version.

pyparrot.utils.vlc.libvlc_hex_version()[source]

Return the libvlc version in hex or 0 if unavailable.

pyparrot.utils.vlc.libvlc_log_clear(p_log)[source]

This function does nothing. It is only provided for backward compatibility. @param p_log: ignored.

pyparrot.utils.vlc.libvlc_log_close(p_log)[source]

Frees memory allocated by L{libvlc_log_open}(). @param p_log: libvlc log instance or None.

pyparrot.utils.vlc.libvlc_log_count(p_log)[source]

Always returns zero. This function is only provided for backward compatibility. @param p_log: ignored. @return: always zero.

pyparrot.utils.vlc.libvlc_log_get_context(ctx)[source]

Gets log message debug infos. This function retrieves self-debug information about a log message: - the name of the VLC module emitting the message, - the name of the source code module (i.e. file) and - the line number within the source code module. The returned module name and file name will be None if unknown. The returned line number will similarly be zero if unknown. @param ctx: message context (as passed to the @ref libvlc_log_cb callback). @return: module module name storage (or None), file source code file name storage (or None), line source code file line number storage (or None). @version: LibVLC 2.1.0 or later.

pyparrot.utils.vlc.libvlc_log_get_iterator(p_log)[source]

This function does nothing useful. It is only provided for backward compatibility. @param p_log: ignored. @return: an unique pointer or None on error or if the parameter was None.

pyparrot.utils.vlc.libvlc_log_get_object(ctx, id)[source]

Gets log message info. This function retrieves meta-information about a log message: - the type name of the VLC object emitting the message, - the object header if any, and - a temporaly-unique object identifier. This information is mainly meant for B{manual} troubleshooting. The returned type name may be “generic” if unknown, but it cannot be None. The returned header will be None if unset; in current versions, the header is used to distinguish for VLM inputs. The returned object ID will be zero if the message is not associated with any VLC object. @param ctx: message context (as passed to the @ref libvlc_log_cb callback). @return: name object name storage (or None), header object header (or None), line source code file line number storage (or None). @version: LibVLC 2.1.0 or later.

pyparrot.utils.vlc.libvlc_log_iterator_free(p_iter)[source]

Frees memory allocated by L{libvlc_log_get_iterator}(). @param p_iter: libvlc log iterator or None.

pyparrot.utils.vlc.libvlc_log_iterator_has_next(p_iter)[source]

Always returns zero. This function is only provided for backward compatibility. @param p_iter: ignored. @return: always zero.

pyparrot.utils.vlc.libvlc_log_iterator_next(p_iter, p_buf)[source]

Always returns None. This function is only provided for backward compatibility. @param p_iter: libvlc log iterator or None. @param p_buf: ignored. @return: always None.

pyparrot.utils.vlc.libvlc_log_open(p_instance)[source]

This function does nothing useful. It is only provided for backward compatibility. @param p_instance: libvlc instance. @return: an unique pointer or None on error.

pyparrot.utils.vlc.libvlc_log_set(p_instance, cb, data)[source]

Sets the logging callback for a LibVLC instance. This function is thread-safe: it will wait for any pending callbacks invocation to complete. @param cb: callback function pointer. @param data: opaque data pointer for the callback function @note Some log messages (especially debug) are emitted by LibVLC while is being initialized. These messages cannot be captured with this interface. @warning A deadlock may occur if this function is called from the callback. @param p_instance: libvlc instance. @version: LibVLC 2.1.0 or later.

pyparrot.utils.vlc.libvlc_log_set_file(p_instance, stream)[source]

Sets up logging to a file. @param p_instance: libvlc instance. @param stream: FILE pointer opened for writing (the FILE pointer must remain valid until L{libvlc_log_unset}()). @version: LibVLC 2.1.0 or later.

pyparrot.utils.vlc.libvlc_log_unset(p_instance)[source]

Unsets the logging callback. This function deregisters the logging callback for a LibVLC instance. This is rarely needed as the callback is implicitly unset when the instance is destroyed. @note: This function will wait for any pending callbacks invocation to complete (causing a deadlock if called from within the callback). @param p_instance: libvlc instance. @version: LibVLC 2.1.0 or later.

pyparrot.utils.vlc.libvlc_media_add_option(p_md, psz_options)[source]

Add an option to the media. This option will be used to determine how the media_player will read the media. This allows to use VLC’s advanced reading/streaming options on a per-media basis. @note: The options are listed in ‘vlc –long-help’ from the command line, e.g. “-sout-all”. Keep in mind that available options and their semantics vary across LibVLC versions and builds. @warning: Not all options affects L{Media} objects: Specifically, due to architectural issues most audio and video options, such as text renderer options, have no effects on an individual media. These options must be set through L{libvlc_new}() instead. @param p_md: the media descriptor. @param psz_options: the options (as a string).

pyparrot.utils.vlc.libvlc_media_add_option_flag(p_md, psz_options, i_flags)[source]

Add an option to the media with configurable flags. This option will be used to determine how the media_player will read the media. This allows to use VLC’s advanced reading/streaming options on a per-media basis. The options are detailed in vlc –long-help, for instance “–sout-all”. Note that all options are not usable on medias: specifically, due to architectural issues, video-related options such as text renderer options cannot be set on a single media. They must be set on the whole libvlc instance instead. @param p_md: the media descriptor. @param psz_options: the options (as a string). @param i_flags: the flags for this option.

pyparrot.utils.vlc.libvlc_media_discoverer_event_manager(p_mdis)[source]

Get event manager from media service discover object. deprecated Useless, media_discoverer events are only triggered when calling L{libvlc_media_discoverer_start}() and L{libvlc_media_discoverer_stop}(). @param p_mdis: media service discover object. @return: event manager object.

pyparrot.utils.vlc.libvlc_media_discoverer_is_running(p_mdis)[source]

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.

pyparrot.utils.vlc.libvlc_media_discoverer_list_get(p_inst, i_cat, ppp_services)[source]

Get media discoverer services by category. @param p_inst: libvlc instance. @param i_cat: category of services to fetch. @param ppp_services: address to store an allocated array of media discoverer services (must be freed with L{libvlc_media_discoverer_list_release}() by the caller) [OUT]. @return: the number of media discoverer services (0 on error). @version: LibVLC 3.0.0 and later.

pyparrot.utils.vlc.libvlc_media_discoverer_list_release(pp_services, i_count)[source]

Release an array of media discoverer services. @param pp_services: array to release. @param i_count: number of elements in the array. @version: LibVLC 3.0.0 and later. See L{libvlc_media_discoverer_list_get}().

pyparrot.utils.vlc.libvlc_media_discoverer_localized_name(p_mdis)[source]

Get media service discover object its localized name. deprecated Useless, use L{libvlc_media_discoverer_list_get}() to get the longname of the service discovery. @param p_mdis: media discover object. @return: localized name or None if the media_discoverer is not started.

pyparrot.utils.vlc.libvlc_media_discoverer_media_list(p_mdis)[source]

Get media service discover media list. @param p_mdis: media service discover object. @return: list of media items.

pyparrot.utils.vlc.libvlc_media_discoverer_new(p_inst, psz_name)[source]

Create a media discoverer object by name. After this object is created, you should attach to media_list events in order to be notified of new items discovered. You need to call L{libvlc_media_discoverer_start}() in order to start the discovery. See L{libvlc_media_discoverer_media_list} See L{libvlc_media_discoverer_event_manager} See L{libvlc_media_discoverer_start}. @param p_inst: libvlc instance. @param psz_name: service name; use L{libvlc_media_discoverer_list_get}() to get a list of the discoverer names available in this libVLC instance. @return: media discover object or None in case of error. @version: LibVLC 3.0.0 or later.

pyparrot.utils.vlc.libvlc_media_discoverer_new_from_name(p_inst, psz_name)[source]

deprecated Use L{libvlc_media_discoverer_new}() and L{libvlc_media_discoverer_start}().

pyparrot.utils.vlc.libvlc_media_discoverer_release(p_mdis)[source]

Release media discover object. If the reference count reaches 0, then the object will be released. @param p_mdis: media service discover object.

pyparrot.utils.vlc.libvlc_media_discoverer_start(p_mdis)[source]

Start media discovery. To stop it, call L{libvlc_media_discoverer_stop}() or L{libvlc_media_discoverer_list_release}() directly. See L{libvlc_media_discoverer_stop}. @param p_mdis: media discover object. @return: -1 in case of error, 0 otherwise. @version: LibVLC 3.0.0 or later.

pyparrot.utils.vlc.libvlc_media_discoverer_stop(p_mdis)[source]

Stop media discovery. See L{libvlc_media_discoverer_start}. @param p_mdis: media discover object. @version: LibVLC 3.0.0 or later.

pyparrot.utils.vlc.libvlc_media_duplicate(p_md)[source]

Duplicate a media descriptor object. @param p_md: a media descriptor object.

pyparrot.utils.vlc.libvlc_media_event_manager(p_md)[source]

Get event manager from media descriptor object. NOTE: this function doesn’t increment reference counting. @param p_md: a media descriptor object. @return: event manager object.

pyparrot.utils.vlc.libvlc_media_get_codec_description(i_type, i_codec)[source]

Get codec description from media elementary stream. @param i_type: i_type from L{MediaTrack}. @param i_codec: i_codec or i_original_fourcc from L{MediaTrack}. @return: codec description. @version: LibVLC 3.0.0 and later. See L{MediaTrack}.

pyparrot.utils.vlc.libvlc_media_get_duration(p_md)[source]

Get duration (in ms) of media descriptor object item. @param p_md: media descriptor object. @return: duration of media item or -1 on error.

pyparrot.utils.vlc.libvlc_media_get_meta(p_md, e_meta)[source]

Read the meta of the media. If the media has not yet been parsed this will return None. See L{libvlc_media_parse} See L{libvlc_media_parse_with_options} See libvlc_MediaMetaChanged. @param p_md: the media descriptor. @param e_meta: the meta to read. @return: the media’s meta.

pyparrot.utils.vlc.libvlc_media_get_mrl(p_md)[source]

Get the media resource locator (mrl) from a media descriptor object. @param p_md: a media descriptor object. @return: string with mrl of media descriptor object.

pyparrot.utils.vlc.libvlc_media_get_parsed_status(p_md)[source]

Get Parsed status for media descriptor object. See libvlc_MediaParsedChanged See libvlc_media_parsed_status_t. @param p_md: media descriptor object. @return: a value of the libvlc_media_parsed_status_t enum. @version: LibVLC 3.0.0 or later.

pyparrot.utils.vlc.libvlc_media_get_state(p_md)[source]

Get current state of media descriptor object. Possible media states are libvlc_NothingSpecial=0, libvlc_Opening, libvlc_Playing, libvlc_Paused, libvlc_Stopped, libvlc_Ended, libvlc_Error. See libvlc_state_t. @param p_md: a media descriptor object. @return: state of media descriptor object.

pyparrot.utils.vlc.libvlc_media_get_stats(p_md, p_stats)[source]

Get the current statistics about the media. @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.

pyparrot.utils.vlc.libvlc_media_get_tracks_info(p_md)[source]

Get media descriptor’s elementary streams description Note, you need to call L{libvlc_media_parse}() or play the media at least once before calling this function. Not doing this will result in an empty array. deprecated Use L{libvlc_media_tracks_get}() instead. @param p_md: media descriptor object. @param tracks: address to store an allocated array of Elementary Streams descriptions (must be freed by the caller) [OUT]. @return: the number of Elementary Streams.

pyparrot.utils.vlc.libvlc_media_get_type(p_md)[source]

Get the media type of the media descriptor object. @param p_md: media descriptor object. @return: media type. @version: LibVLC 3.0.0 and later. See libvlc_media_type_t.

pyparrot.utils.vlc.libvlc_media_get_user_data(p_md)[source]

Get media descriptor’s user_data. user_data is specialized data accessed by the host application, VLC.framework uses it as a pointer to an native object that references a L{Media} pointer. @param p_md: media descriptor object.

pyparrot.utils.vlc.libvlc_media_is_parsed(p_md)[source]

Return true is the media descriptor object is parsed deprecated This can return true in case of failure.

Use L{libvlc_media_get_parsed_status}() instead

See libvlc_MediaParsedChanged. @param p_md: media descriptor object. @return: true if media object has been parsed otherwise it returns false libvlc_return_bool.

pyparrot.utils.vlc.libvlc_media_library_load(p_mlib)[source]

Load media library. @param p_mlib: media library object. @return: 0 on success, -1 on error.

pyparrot.utils.vlc.libvlc_media_library_media_list(p_mlib)[source]

Get media library subitems. @param p_mlib: media library object. @return: media list subitems.

pyparrot.utils.vlc.libvlc_media_library_new(p_instance)[source]

Create an new Media Library object. @param p_instance: the libvlc instance. @return: a new object or None on error.

pyparrot.utils.vlc.libvlc_media_library_release(p_mlib)[source]

Release media library object. This functions decrements the reference count of the media library object. If it reaches 0, then the object will be released. @param p_mlib: media library object.

pyparrot.utils.vlc.libvlc_media_library_retain(p_mlib)[source]

Retain a reference to a media library object. This function will increment the reference counting for this object. Use L{libvlc_media_library_release}() to decrement the reference count. @param p_mlib: media library object.

pyparrot.utils.vlc.libvlc_media_list_add_media(p_ml, p_md)[source]

Add media instance to media list The L{libvlc_media_list_lock} should be held upon entering this function. @param p_ml: a media list instance. @param p_md: a media instance. @return: 0 on success, -1 if the media list is read-only.

pyparrot.utils.vlc.libvlc_media_list_count(p_ml)[source]

Get count on media list items The L{libvlc_media_list_lock} should be held upon entering this function. @param p_ml: a media list instance. @return: number of items in media list.

pyparrot.utils.vlc.libvlc_media_list_event_manager(p_ml)[source]

Get libvlc_event_manager from this media list instance. The p_event_manager is immutable, so you don’t have to hold the lock. @param p_ml: a media list instance. @return: libvlc_event_manager.

pyparrot.utils.vlc.libvlc_media_list_index_of_item(p_ml, p_md)[source]

Find index position of List media instance in media list. Warning: the function will return the first matched position. The L{libvlc_media_list_lock} should be held upon entering this function. @param p_ml: a media list instance. @param p_md: media instance. @return: position of media instance or -1 if media not found.

pyparrot.utils.vlc.libvlc_media_list_insert_media(p_ml, p_md, i_pos)[source]

Insert media instance in media list on a position The L{libvlc_media_list_lock} should be held upon entering this function. @param p_ml: a media list instance. @param p_md: a media instance. @param i_pos: position in array where to insert. @return: 0 on success, -1 if the media list is read-only.

pyparrot.utils.vlc.libvlc_media_list_is_readonly(p_ml)[source]

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.

pyparrot.utils.vlc.libvlc_media_list_item_at_index(p_ml, i_pos)[source]

List media instance in media list at a position The L{libvlc_media_list_lock} should be held upon entering this function. @param p_ml: a media list instance. @param i_pos: position in array where to insert. @return: media instance at position i_pos, or None if not found. In case of success, L{libvlc_media_retain}() is called to increase the refcount on the media.

pyparrot.utils.vlc.libvlc_media_list_lock(p_ml)[source]

Get lock on media list items. @param p_ml: a media list instance.

pyparrot.utils.vlc.libvlc_media_list_media(p_ml)[source]

Get media instance from this media list instance. This action will increase the refcount on the media instance. The L{libvlc_media_list_lock} should NOT be held upon entering this function. @param p_ml: a media list instance. @return: media instance.

pyparrot.utils.vlc.libvlc_media_list_new(p_instance)[source]

Create an empty media list. @param p_instance: libvlc instance. @return: empty media list, or None on error.

pyparrot.utils.vlc.libvlc_media_list_player_event_manager(p_mlp)[source]

Return the event manager of this media_list_player. @param p_mlp: media list player instance. @return: the event manager.

pyparrot.utils.vlc.libvlc_media_list_player_get_media_player(p_mlp)[source]

Get media player of the media_list_player instance. @param p_mlp: media list player instance. @return: media player instance @note the caller is responsible for releasing the returned instance.

pyparrot.utils.vlc.libvlc_media_list_player_get_state(p_mlp)[source]

Get current libvlc_state of media list player. @param p_mlp: media list player instance. @return: libvlc_state_t for media list player.

pyparrot.utils.vlc.libvlc_media_list_player_is_playing(p_mlp)[source]

Is media list playing? @param p_mlp: media list player instance. @return: true for playing and false for not playing libvlc_return_bool.

pyparrot.utils.vlc.libvlc_media_list_player_new(p_instance)[source]

Create new media_list_player. @param p_instance: libvlc instance. @return: media list player instance or None on error.

pyparrot.utils.vlc.libvlc_media_list_player_next(p_mlp)[source]

Play next item from media list. @param p_mlp: media list player instance. @return: 0 upon success -1 if there is no next item.

pyparrot.utils.vlc.libvlc_media_list_player_pause(p_mlp)[source]

Toggle pause (or resume) media list. @param p_mlp: media list player instance.

pyparrot.utils.vlc.libvlc_media_list_player_play(p_mlp)[source]

Play media list. @param p_mlp: media list player instance.

pyparrot.utils.vlc.libvlc_media_list_player_play_item(p_mlp, p_md)[source]

Play the given media item. @param p_mlp: media list player instance. @param p_md: the media instance. @return: 0 upon success, -1 if the media is not part of the media list.

pyparrot.utils.vlc.libvlc_media_list_player_play_item_at_index(p_mlp, i_index)[source]

Play media list item at position index. @param p_mlp: media list player instance. @param i_index: index in media list to play. @return: 0 upon success -1 if the item wasn’t found.

pyparrot.utils.vlc.libvlc_media_list_player_previous(p_mlp)[source]

Play previous item from media list. @param p_mlp: media list player instance. @return: 0 upon success -1 if there is no previous item.

pyparrot.utils.vlc.libvlc_media_list_player_release(p_mlp)[source]

Release a media_list_player after use Decrement the reference count of a media player object. If the reference count is 0, then L{libvlc_media_list_player_release}() will release the media player object. If the media player object has been released, then it should not be used again. @param p_mlp: media list player instance.

pyparrot.utils.vlc.libvlc_media_list_player_retain(p_mlp)[source]

Retain a reference to a media player list object. Use L{libvlc_media_list_player_release}() to decrement reference count. @param p_mlp: media player list object.

pyparrot.utils.vlc.libvlc_media_list_player_set_media_list(p_mlp, p_mlist)[source]

Set the media list associated with the player. @param p_mlp: media list player instance. @param p_mlist: list of media.

pyparrot.utils.vlc.libvlc_media_list_player_set_media_player(p_mlp, p_mi)[source]

Replace media player in media_list_player with this instance. @param p_mlp: media list player instance. @param p_mi: media player instance.

pyparrot.utils.vlc.libvlc_media_list_player_set_pause(p_mlp, do_pause)[source]

Pause or resume media list. @param p_mlp: media list player instance. @param do_pause: play/resume if zero, pause if non-zero. @version: LibVLC 3.0.0 or later.

pyparrot.utils.vlc.libvlc_media_list_player_set_playback_mode(p_mlp, e_mode)[source]

Sets the playback mode for the playlist. @param p_mlp: media list player instance. @param e_mode: playback mode specification.

pyparrot.utils.vlc.libvlc_media_list_player_stop(p_mlp)[source]

Stop playing media list. @param p_mlp: media list player instance.

pyparrot.utils.vlc.libvlc_media_list_release(p_ml)[source]

Release media list created with L{libvlc_media_list_new}(). @param p_ml: a media list created with L{libvlc_media_list_new}().

pyparrot.utils.vlc.libvlc_media_list_remove_index(p_ml, i_pos)[source]

Remove media instance from media list on a position The L{libvlc_media_list_lock} should be held upon entering this function. @param p_ml: a media list instance. @param i_pos: position in array where to insert. @return: 0 on success, -1 if the list is read-only or the item was not found.

pyparrot.utils.vlc.libvlc_media_list_retain(p_ml)[source]

Retain reference to a media list. @param p_ml: a media list created with L{libvlc_media_list_new}().

pyparrot.utils.vlc.libvlc_media_list_set_media(p_ml, p_md)[source]

Associate media instance with this media list instance. If another media instance was present it will be released. The L{libvlc_media_list_lock} should NOT be held upon entering this function. @param p_ml: a media list instance. @param p_md: media instance to add.

pyparrot.utils.vlc.libvlc_media_list_unlock(p_ml)[source]

Release lock on media list items The L{libvlc_media_list_lock} should be held upon entering this function. @param p_ml: a media list instance.

pyparrot.utils.vlc.libvlc_media_new_as_node(p_instance, psz_name)[source]

Create a media as an empty node with a given name. See L{libvlc_media_release}. @param p_instance: the instance. @param psz_name: the name of the node. @return: the new empty media or None on error.

pyparrot.utils.vlc.libvlc_media_new_callbacks(instance, open_cb, read_cb, seek_cb, close_cb, opaque)[source]

Create a media with custom callbacks to read the data from. @param instance: LibVLC instance. @param open_cb: callback to open the custom bitstream input media. @param read_cb: callback to read data (must not be None). @param seek_cb: callback to seek, or None if seeking is not supported. @param close_cb: callback to close the media, or None if unnecessary. @param opaque: data pointer for the open callback. @return: the newly created media or None on error @note If open_cb is None, the opaque pointer will be passed to read_cb, seek_cb and close_cb, and the stream size will be treated as unknown. @note The callbacks may be called asynchronously (from another thread). A single stream instance need not be reentrant. However the open_cb needs to be reentrant if the media is used by multiple player instances. @warning The callbacks may be used until all or any player instances that were supplied the media item are stopped. See L{libvlc_media_release}. @version: LibVLC 3.0.0 and later.

pyparrot.utils.vlc.libvlc_media_new_fd(p_instance, fd)[source]

Create a media for an already open file descriptor. The file descriptor shall be open for reading (or reading and writing). Regular file descriptors, pipe read descriptors and character device descriptors (including TTYs) are supported on all platforms. Block device descriptors are supported where available. Directory descriptors are supported on systems that provide fdopendir(). Sockets are supported on all platforms where they are file descriptors, i.e. all except Windows. @note: This library will B{not} automatically close the file descriptor under any circumstance. Nevertheless, a file descriptor can usually only be rendered once in a media player. To render it a second time, the file descriptor should probably be rewound to the beginning with lseek(). See L{libvlc_media_release}. @param p_instance: the instance. @param fd: open file descriptor. @return: the newly created media or None on error. @version: LibVLC 1.1.5 and later.

pyparrot.utils.vlc.libvlc_media_new_location(p_instance, psz_mrl)[source]

Create a media with a certain given media resource location, for instance a valid URL. @note: To refer to a local file with this function, the file://… URI syntax B{must} be used (see IETF RFC3986). We recommend using L{libvlc_media_new_path}() instead when dealing with local files. See L{libvlc_media_release}. @param p_instance: the instance. @param psz_mrl: the media location. @return: the newly created media or None on error.

pyparrot.utils.vlc.libvlc_media_new_path(p_instance, path)[source]

Create a media for a certain file path. See L{libvlc_media_release}. @param p_instance: the instance. @param path: local filesystem path. @return: the newly created media or None on error.

pyparrot.utils.vlc.libvlc_media_parse(p_md)[source]

Parse a media. This fetches (local) art, meta data and tracks information. The method is synchronous. deprecated This function could block indefinitely.

Use L{libvlc_media_parse_with_options}() instead

See L{libvlc_media_parse_with_options} See L{libvlc_media_get_meta} See L{libvlc_media_get_tracks_info}. @param p_md: media descriptor object.

pyparrot.utils.vlc.libvlc_media_parse_async(p_md)[source]

Parse a media. This fetches (local) art, meta data and tracks information. The method is the asynchronous of L{libvlc_media_parse}(). To track when this is over you can listen to libvlc_MediaParsedChanged event. However if the media was already parsed you will not receive this event. deprecated You can’t be sure to receive the libvlc_MediaParsedChanged

event (you can wait indefinitely for this event). Use L{libvlc_media_parse_with_options}() instead

See L{libvlc_media_parse} See libvlc_MediaParsedChanged See L{libvlc_media_get_meta} See L{libvlc_media_get_tracks_info}. @param p_md: media descriptor object.

pyparrot.utils.vlc.libvlc_media_parse_stop(p_md)[source]

Stop the parsing of the media When the media parsing is stopped, the libvlc_MediaParsedChanged event will be sent with the libvlc_media_parsed_status_timeout status. See L{libvlc_media_parse_with_options}. @param p_md: media descriptor object. @version: LibVLC 3.0.0 or later.

pyparrot.utils.vlc.libvlc_media_parse_with_options(p_md, parse_flag, timeout)[source]

Parse the media asynchronously with options. This fetches (local or network) art, meta data and/or tracks information. This method is the extended version of L{libvlc_media_parse_with_options}(). To track when this is over you can listen to libvlc_MediaParsedChanged event. However if this functions returns an error, you will not receive any events. It uses a flag to specify parse options (see libvlc_media_parse_flag_t). All these flags can be combined. By default, media is parsed if it’s a local file. @note: Parsing can be aborted with L{libvlc_media_parse_stop}(). See libvlc_MediaParsedChanged See L{libvlc_media_get_meta} See L{libvlc_media_tracks_get} See L{libvlc_media_get_parsed_status} See libvlc_media_parse_flag_t. @param p_md: media descriptor object. @param parse_flag: parse options: @param timeout: maximum time allowed to preparse the media. If -1, the default “preparse-timeout” option will be used as a timeout. If 0, it will wait indefinitely. If > 0, the timeout will be used (in milliseconds). @return: -1 in case of error, 0 otherwise. @version: LibVLC 3.0.0 or later.

pyparrot.utils.vlc.libvlc_media_player_add_slave(p_mi, i_type, psz_uri, b_select)[source]

Add a slave to the current media player. @note: If the player is playing, the slave will be added directly. This call will also update the slave list of the attached L{Media}. @param p_mi: the media player. @param i_type: subtitle or audio. @param psz_uri: Uri of the slave (should contain a valid scheme). @param b_select: True if this slave should be selected when it’s loaded. @return: 0 on success, -1 on error. @version: LibVLC 3.0.0 and later. See L{libvlc_media_slaves_add}.

pyparrot.utils.vlc.libvlc_media_player_can_pause(p_mi)[source]

Can this media player be paused? @param p_mi: the media player. @return: true if the media player can pause libvlc_return_bool.

pyparrot.utils.vlc.libvlc_media_player_event_manager(p_mi)[source]

Get the Event Manager from which the media player send event. @param p_mi: the Media Player. @return: the event manager associated with p_mi.

pyparrot.utils.vlc.libvlc_media_player_get_agl(p_mi)[source]

deprecated Use L{libvlc_media_player_get_nsobject}() instead.

pyparrot.utils.vlc.libvlc_media_player_get_chapter(p_mi)[source]

Get movie chapter. @param p_mi: the Media Player. @return: chapter number currently playing, or -1 if there is no media.

pyparrot.utils.vlc.libvlc_media_player_get_chapter_count(p_mi)[source]

Get movie chapter count. @param p_mi: the Media Player. @return: number of chapters in movie, or -1.

pyparrot.utils.vlc.libvlc_media_player_get_chapter_count_for_title(p_mi, i_title)[source]

Get title chapter count. @param p_mi: the Media Player. @param i_title: title. @return: number of chapters in title, or -1.

pyparrot.utils.vlc.libvlc_media_player_get_fps(p_mi)[source]

Get movie fps rate This function is provided for backward compatibility. It cannot deal with multiple video tracks. In LibVLC versions prior to 3.0, it would also fail if the file format did not convey the frame rate explicitly. deprecated Consider using L{libvlc_media_tracks_get}() instead. @param p_mi: the Media Player. @return: frames per second (fps) for this playing movie, or 0 if unspecified.

pyparrot.utils.vlc.libvlc_media_player_get_full_chapter_descriptions(p_mi, i_chapters_of_title, pp_chapters)[source]

Get the full description of available chapters. @param p_mi: the media player. @param i_chapters_of_title: index of the title to query for chapters (uses current title if set to -1). @param pp_chapters: address to store an allocated array of chapter descriptions descriptions (must be freed with L{libvlc_chapter_descriptions_release}() by the caller) [OUT]. @return: the number of chapters (-1 on error). @version: LibVLC 3.0.0 and later.

pyparrot.utils.vlc.libvlc_media_player_get_full_title_descriptions(p_mi, titles)[source]

Get the full description of available titles. @param p_mi: the media player. @param titles: address to store an allocated array of title descriptions descriptions (must be freed with L{libvlc_title_descriptions_release}() by the caller) [OUT]. @return: the number of titles (-1 on error). @version: LibVLC 3.0.0 and later.

pyparrot.utils.vlc.libvlc_media_player_get_hwnd(p_mi)[source]

Get the Windows API window handle (HWND) previously set with L{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 None if there are none.

pyparrot.utils.vlc.libvlc_media_player_get_length(p_mi)[source]

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.

pyparrot.utils.vlc.libvlc_media_player_get_media(p_mi)[source]

Get the media used by the media_player. @param p_mi: the Media Player. @return: the media associated with p_mi, or None if no media is associated.

pyparrot.utils.vlc.libvlc_media_player_get_nsobject(p_mi)[source]

Get the NSView handler previously set with L{libvlc_media_player_set_nsobject}(). @param p_mi: the Media Player. @return: the NSView handler or 0 if none where set.

pyparrot.utils.vlc.libvlc_media_player_get_position(p_mi)[source]

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.

pyparrot.utils.vlc.libvlc_media_player_get_rate(p_mi)[source]

Get the requested movie play rate. @warning: Depending on the underlying media, the requested rate may be different from the real playback rate. @param p_mi: the Media Player. @return: movie play rate.

pyparrot.utils.vlc.libvlc_media_player_get_role(p_mi)[source]
Gets the media role.
@param p_mi: media player. @return: the media player role (
ef libvlc_media_player_role_t).
@version: LibVLC 3.0.0 and later.
pyparrot.utils.vlc.libvlc_media_player_get_state(p_mi)[source]

Get current movie state. @param p_mi: the Media Player. @return: the current state of the media player (playing, paused, …) See libvlc_state_t.

pyparrot.utils.vlc.libvlc_media_player_get_time(p_mi)[source]

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.

pyparrot.utils.vlc.libvlc_media_player_get_title(p_mi)[source]

Get movie title. @param p_mi: the Media Player. @return: title number currently playing, or -1.

pyparrot.utils.vlc.libvlc_media_player_get_title_count(p_mi)[source]

Get movie title count. @param p_mi: the Media Player. @return: title number count, or -1.

pyparrot.utils.vlc.libvlc_media_player_get_xwindow(p_mi)[source]

Get the X Window System window identifier previously set with L{libvlc_media_player_set_xwindow}(). Note that this will return the identifier even if VLC is not currently using it (for instance if it is playing an audio-only input). @param p_mi: the Media Player. @return: an X window ID, or 0 if none where set.

pyparrot.utils.vlc.libvlc_media_player_has_vout(p_mi)[source]

How many video outputs does this media player have? @param p_mi: the media player. @return: the number of video outputs.

pyparrot.utils.vlc.libvlc_media_player_is_playing(p_mi)[source]

is_playing. @param p_mi: the Media Player. @return: 1 if the media player is playing, 0 otherwise libvlc_return_bool.

pyparrot.utils.vlc.libvlc_media_player_is_seekable(p_mi)[source]

Is this media player seekable? @param p_mi: the media player. @return: true if the media player can seek libvlc_return_bool.

pyparrot.utils.vlc.libvlc_media_player_navigate(p_mi, navigate)[source]

Navigate through DVD Menu. @param p_mi: the Media Player. @param navigate: the Navigation mode. @version: libVLC 2.0.0 or later.

pyparrot.utils.vlc.libvlc_media_player_new(p_libvlc_instance)[source]

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 None on error.

pyparrot.utils.vlc.libvlc_media_player_new_from_media(p_md)[source]

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 None on error.

pyparrot.utils.vlc.libvlc_media_player_next_chapter(p_mi)[source]

Set next chapter (if applicable). @param p_mi: the Media Player.

pyparrot.utils.vlc.libvlc_media_player_next_frame(p_mi)[source]

Display the next frame (if supported). @param p_mi: the media player.

pyparrot.utils.vlc.libvlc_media_player_pause(p_mi)[source]

Toggle pause (no effect if there is no media). @param p_mi: the Media Player.

pyparrot.utils.vlc.libvlc_media_player_play(p_mi)[source]

Play. @param p_mi: the Media Player. @return: 0 if playback started (and was already started), or -1 on error.

pyparrot.utils.vlc.libvlc_media_player_previous_chapter(p_mi)[source]

Set previous chapter (if applicable). @param p_mi: the Media Player.

pyparrot.utils.vlc.libvlc_media_player_program_scrambled(p_mi)[source]

Check if the current program is scrambled. @param p_mi: the media player. @return: true if the current program is scrambled libvlc_return_bool. @version: LibVLC 2.2.0 or later.

pyparrot.utils.vlc.libvlc_media_player_release(p_mi)[source]

Release a media_player after use Decrement the reference count of a media player object. If the reference count is 0, then L{libvlc_media_player_release}() will release the media player object. If the media player object has been released, then it should not be used again. @param p_mi: the Media Player to free.

pyparrot.utils.vlc.libvlc_media_player_retain(p_mi)[source]

Retain a reference to a media player object. Use L{libvlc_media_player_release}() to decrement reference count. @param p_mi: media player object.

pyparrot.utils.vlc.libvlc_media_player_set_agl(p_mi, drawable)[source]

deprecated Use L{libvlc_media_player_set_nsobject}() instead.

pyparrot.utils.vlc.libvlc_media_player_set_android_context(p_mi, p_awindow_handler)[source]

Set the android context. @param p_mi: the media player. @param p_awindow_handler: org.videolan.libvlc.AWindow jobject owned by the org.videolan.libvlc.MediaPlayer class from the libvlc-android project. @version: LibVLC 3.0.0 and later.

pyparrot.utils.vlc.libvlc_media_player_set_chapter(p_mi, i_chapter)[source]

Set movie chapter (if applicable). @param p_mi: the Media Player. @param i_chapter: chapter number to play.

pyparrot.utils.vlc.libvlc_media_player_set_equalizer(p_mi, p_equalizer)[source]

Apply new equalizer settings to a media player. The equalizer is first created by invoking L{libvlc_audio_equalizer_new}() or L{libvlc_audio_equalizer_new_from_preset}(). It is possible to apply new equalizer settings to a media player whether the media player is currently playing media or not. Invoking this method will immediately apply the new equalizer settings to the audio output of the currently playing media if there is any. If there is no currently playing media, the new equalizer settings will be applied later if and when new media is played. Equalizer settings will automatically be applied to subsequently played media. To disable the equalizer for a media player invoke this method passing None for the p_equalizer parameter. The media player does not keep a reference to the supplied equalizer so it is safe for an application to release the equalizer reference any time after this method returns. @param p_mi: opaque media player handle. @param p_equalizer: opaque equalizer handle, or None to disable the equalizer for this media player. @return: zero on success, -1 on error. @version: LibVLC 2.2.0 or later.

pyparrot.utils.vlc.libvlc_media_player_set_evas_object(p_mi, p_evas_object)[source]

Set the EFL Evas Object. @param p_mi: the media player. @param p_evas_object: a valid EFL Evas Object (Evas_Object). @return: -1 if an error was detected, 0 otherwise. @version: LibVLC 3.0.0 and later.

pyparrot.utils.vlc.libvlc_media_player_set_hwnd(p_mi, drawable)[source]

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. @param p_mi: the Media Player. @param drawable: windows handle of the drawable.

pyparrot.utils.vlc.libvlc_media_player_set_media(p_mi, p_md)[source]

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.

pyparrot.utils.vlc.libvlc_media_player_set_nsobject(p_mi, drawable)[source]

Set the NSView handler where the media player should render its video output. Use the vout called “macosx”. The drawable is an NSObject that follow the VLCOpenGLVideoViewEmbedding protocol: @code.m @protocol VLCOpenGLVideoViewEmbedding <NSObject> - (void)addVoutSubview:(NSView *)view; - (void)removeVoutSubview:(NSView *)view; @end @endcode Or it can be an NSView object. If you want to use it along with Qt see the QMacCocoaViewContainer. Then the following code should work: @code.mm

NSView *video = [[NSView alloc] init]; QMacCocoaViewContainer *container = new QMacCocoaViewContainer(video, parent); L{libvlc_media_player_set_nsobject}(mp, video); [video release];

@endcode You can find a live example in VLCVideoView in VLCKit.framework. @param p_mi: the Media Player. @param drawable: the drawable that is either an NSView or an object following the VLCOpenGLVideoViewEmbedding protocol.

pyparrot.utils.vlc.libvlc_media_player_set_pause(mp, do_pause)[source]

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.

pyparrot.utils.vlc.libvlc_media_player_set_position(p_mi, f_pos)[source]

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.

pyparrot.utils.vlc.libvlc_media_player_set_rate(p_mi, rate)[source]

Set movie play rate. @param p_mi: the Media Player. @param rate: movie play rate to set. @return: -1 if an error was detected, 0 otherwise (but even then, it might not actually work depending on the underlying media protocol).

pyparrot.utils.vlc.libvlc_media_player_set_renderer(p_mi, p_item)[source]

Set a renderer to the media player @note: must be called before the first call of L{libvlc_media_player_play}() to take effect. See L{libvlc_renderer_discoverer_new}. @param p_mi: the Media Player. @param p_item: an item discovered by L{libvlc_renderer_discoverer_start}(). @return: 0 on success, -1 on error. @version: LibVLC 3.0.0 or later.

pyparrot.utils.vlc.libvlc_media_player_set_role(p_mi, role)[source]
Sets the media role.
@param p_mi: media player. @param role: the media player role (
ef libvlc_media_player_role_t).
@return: 0 on success, -1 on error.
pyparrot.utils.vlc.libvlc_media_player_set_time(p_mi, i_time)[source]

Set the movie time (in ms). This has no effect if no media is being played. Not all formats and protocols support this. @param p_mi: the Media Player. @param i_time: the movie time (in ms).

pyparrot.utils.vlc.libvlc_media_player_set_title(p_mi, i_title)[source]

Set movie title. @param p_mi: the Media Player. @param i_title: title number to play.

pyparrot.utils.vlc.libvlc_media_player_set_video_title_display(p_mi, position, timeout)[source]

Set if, and how, the video title will be shown when media is played. @param p_mi: the media player. @param position: position at which to display the title, or libvlc_position_disable to prevent the title from being displayed. @param timeout: title display timeout in milliseconds (ignored if libvlc_position_disable). @version: libVLC 2.1.0 or later.

pyparrot.utils.vlc.libvlc_media_player_set_xwindow(p_mi, drawable)[source]

Set an X Window System drawable where the media player should render its video output. The call takes effect when the playback starts. If it is already started, it might need to be stopped before changes apply. If LibVLC was built without X11 output support, then this function has no effects. By default, LibVLC will capture input events on the video rendering area. Use L{libvlc_video_set_mouse_input}() and L{libvlc_video_set_key_input}() to disable that and deliver events to the parent window / to the application instead. By design, the X11 protocol delivers input events to only one recipient. @warning The application must call the XInitThreads() function from Xlib before L{libvlc_new}(), and before any call to XOpenDisplay() directly or via any other library. Failure to call XInitThreads() will seriously impede LibVLC performance. Calling XOpenDisplay() before XInitThreads() will eventually crash the process. That is a limitation of Xlib. @param p_mi: media player. @param drawable: X11 window ID @note The specified identifier must correspond to an existing Input/Output class X11 window. Pixmaps are B{not} currently supported. The default X11 server is assumed, i.e. that specified in the DISPLAY environment variable. @warning LibVLC can deal with invalid X11 handle errors, however some display drivers (EGL, GLX, VA and/or VDPAU) can unfortunately not. Thus the window handle must remain valid until playback is stopped, otherwise the process may abort or crash. @bug No more than one window handle per media player instance can be specified. If the media has multiple simultaneously active video tracks, extra tracks will be rendered into external windows beyond the control of the application.

pyparrot.utils.vlc.libvlc_media_player_stop(p_mi)[source]

Stop (no effect if there is no media). @param p_mi: the Media Player.

pyparrot.utils.vlc.libvlc_media_player_will_play(p_mi)[source]

Is the player able to play. @param p_mi: the Media Player. @return: boolean libvlc_return_bool.

pyparrot.utils.vlc.libvlc_media_release(p_md)[source]

Decrement the reference count of a media descriptor object. If the reference count is 0, then L{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.

pyparrot.utils.vlc.libvlc_media_retain(p_md)[source]

Retain a reference to a media descriptor object (libvlc_media_t). Use L{libvlc_media_release}() to decrement the reference count of a media descriptor object. @param p_md: the media descriptor.

pyparrot.utils.vlc.libvlc_media_save_meta(p_md)[source]

Save the meta previously set. @param p_md: the media desriptor. @return: true if the write operation was successful.

pyparrot.utils.vlc.libvlc_media_set_meta(p_md, e_meta, psz_value)[source]

Set the meta of the media (this function will not save the meta, call L{libvlc_media_save_meta} in order to save the meta). @param p_md: the media descriptor. @param e_meta: the meta to write. @param psz_value: the media’s meta.

pyparrot.utils.vlc.libvlc_media_set_user_data(p_md, p_new_user_data)[source]

Sets media descriptor’s user_data. user_data is specialized data accessed by the host application, VLC.framework uses it as a pointer to an native object that references a L{Media} pointer. @param p_md: media descriptor object. @param p_new_user_data: pointer to user data.

pyparrot.utils.vlc.libvlc_media_slaves_add(p_md, i_type, i_priority, psz_uri)[source]

Add a slave to the current media. A slave is an external input source that may contains an additional subtitle track (like a .srt) or an additional audio track (like a .ac3). @note: This function must be called before the media is parsed (via L{libvlc_media_parse_with_options}()) or before the media is played (via L{libvlc_media_player_play}()). @param p_md: media descriptor object. @param i_type: subtitle or audio. @param i_priority: from 0 (low priority) to 4 (high priority). @param psz_uri: Uri of the slave (should contain a valid scheme). @return: 0 on success, -1 on error. @version: LibVLC 3.0.0 and later.

pyparrot.utils.vlc.libvlc_media_slaves_clear(p_md)[source]

Clear all slaves previously added by L{libvlc_media_slaves_add}() or internally. @param p_md: media descriptor object. @version: LibVLC 3.0.0 and later.

pyparrot.utils.vlc.libvlc_media_slaves_get(p_md, ppp_slaves)[source]

Get a media descriptor’s slave list The list will contain slaves parsed by VLC or previously added by L{libvlc_media_slaves_add}(). The typical use case of this function is to save a list of slave in a database for a later use. @param p_md: media descriptor object. @param ppp_slaves: address to store an allocated array of slaves (must be freed with L{libvlc_media_slaves_release}()) [OUT]. @return: the number of slaves (zero on error). @version: LibVLC 3.0.0 and later. See L{libvlc_media_slaves_add}.

pyparrot.utils.vlc.libvlc_media_slaves_release(pp_slaves, i_count)[source]

Release a media descriptor’s slave list. @param pp_slaves: slave array to release. @param i_count: number of elements in the array. @version: LibVLC 3.0.0 and later.

pyparrot.utils.vlc.libvlc_media_subitems(p_md)[source]

Get subitems of media descriptor object. This will increment the reference count of supplied media descriptor object. Use L{libvlc_media_list_release}() to decrement the reference counting. @param p_md: media descriptor object. @return: list of media descriptor subitems or None.

pyparrot.utils.vlc.libvlc_media_tracks_get(p_md, tracks)[source]

Get media descriptor’s elementary streams description Note, you need to call L{libvlc_media_parse}() or play the media at least once before calling this function. Not doing this will result in an empty array. @param p_md: media descriptor object. @param tracks: address to store an allocated array of Elementary Streams descriptions (must be freed with L{libvlc_media_tracks_release}. @return: the number of Elementary Streams (zero on error). @version: LibVLC 2.1.0 and later.

pyparrot.utils.vlc.libvlc_media_tracks_release(p_tracks, i_count)[source]

Release media descriptor’s elementary streams description array. @param p_tracks: tracks info array to release. @param i_count: number of elements in the array. @version: LibVLC 2.1.0 and later.

pyparrot.utils.vlc.libvlc_module_description_list_release(p_list)[source]

Release a list of module descriptions. @param p_list: the list to be released.

pyparrot.utils.vlc.libvlc_new(argc, argv)[source]

Create and initialize a libvlc instance. This functions accept a list of “command line” arguments similar to the main(). These arguments affect the LibVLC instance default configuration. @note LibVLC may create threads. Therefore, any thread-unsafe process initialization must be performed before calling L{libvlc_new}(). In particular and where applicable: - setlocale() and textdomain(), - setenv(), unsetenv() and putenv(), - with the X11 display system, XInitThreads()

(see also L{libvlc_media_player_set_xwindow}()) and
  • on Microsoft Windows, SetErrorMode().
  • sigprocmask() shall never be invoked; pthread_sigmask() can be used.

On POSIX systems, the SIGCHLD signal B{must not} be ignored, i.e. the signal handler must set to SIG_DFL or a function pointer, not SIG_IGN. Also while LibVLC is active, the wait() function shall not be called, and any call to waitpid() shall use a strictly positive value for the first parameter (i.e. the PID). Failure to follow those rules may lead to a deadlock or a busy loop. Also on POSIX systems, it is recommended that the SIGPIPE signal be blocked, even if it is not, in principles, necessary, e.g.: @code @endcode On Microsoft Windows Vista/2008, the process error mode SEM_FAILCRITICALERRORS flag B{must} be set before using LibVLC. On later versions, that is optional and unnecessary. Also on Microsoft Windows (Vista and any later version), setting the default DLL directories to SYSTEM32 exclusively is strongly recommended for security reasons: @code @endcode. @param argc: the number of arguments (should be 0). @param argv: list of arguments (should be None). @return: the libvlc instance or None in case of error. @version Arguments are meant to be passed from the command line to LibVLC, just like VLC media player does. The list of valid arguments depends on the LibVLC version, the operating system and platform, and set of available LibVLC plugins. Invalid or unsupported arguments will cause the function to fail (i.e. return None). Also, some arguments may alter the behaviour or otherwise interfere with other LibVLC functions. @warning There is absolutely no warranty or promise of forward, backward and cross-platform compatibility with regards to L{libvlc_new}() arguments. We recommend that you do not use them, other than when debugging.

pyparrot.utils.vlc.libvlc_playlist_play(p_instance, i_id, i_options, ppsz_options)[source]

Start playing (if there is any item in the playlist). Additionnal playlist item options can be specified for addition to the item before it is played. @param p_instance: the playlist instance. @param i_id: the item to play. If this is a negative number, the next item will be selected. Otherwise, the item with the given ID will be played. @param i_options: the number of options to add to the item. @param ppsz_options: the options to add to the item.

pyparrot.utils.vlc.libvlc_release(p_instance)[source]

Decrement the reference count of a libvlc instance, and destroy it if it reaches zero. @param p_instance: the instance to destroy.

pyparrot.utils.vlc.libvlc_renderer_discoverer_event_manager(p_rd)[source]

Get the event manager of the renderer discoverer The possible events to attach are @ref libvlc_RendererDiscovererItemAdded and @ref libvlc_RendererDiscovererItemDeleted. The @ref libvlc_renderer_item_t struct passed to event callbacks is owned by VLC, users should take care of holding/releasing this struct for their internal usage. See libvlc_event_t.u.renderer_discoverer_item_added.item See libvlc_event_t.u.renderer_discoverer_item_removed.item. @return: a valid event manager (can’t fail). @version: LibVLC 3.0.0 or later.

pyparrot.utils.vlc.libvlc_renderer_discoverer_list_get(p_inst, ppp_services)[source]

Get media discoverer services See libvlc_renderer_list_release(). @param p_inst: libvlc instance. @param ppp_services: address to store an allocated array of renderer discoverer services (must be freed with libvlc_renderer_list_release() by the caller) [OUT]. @return: the number of media discoverer services (0 on error). @version: LibVLC 3.0.0 and later.

pyparrot.utils.vlc.libvlc_renderer_discoverer_list_release(pp_services, i_count)[source]

Release an array of media discoverer services See L{libvlc_renderer_discoverer_list_get}(). @param pp_services: array to release. @param i_count: number of elements in the array. @version: LibVLC 3.0.0 and later.

pyparrot.utils.vlc.libvlc_renderer_discoverer_new(p_inst, psz_name)[source]

Create a renderer discoverer object by name After this object is created, you should attach to events in order to be notified of the discoverer events. You need to call L{libvlc_renderer_discoverer_start}() in order to start the discovery. See L{libvlc_renderer_discoverer_event_manager}() See L{libvlc_renderer_discoverer_start}(). @param p_inst: libvlc instance. @param psz_name: service name; use L{libvlc_renderer_discoverer_list_get}() to get a list of the discoverer names available in this libVLC instance. @return: media discover object or None in case of error. @version: LibVLC 3.0.0 or later.

pyparrot.utils.vlc.libvlc_renderer_discoverer_release(p_rd)[source]

Release a renderer discoverer object. @param p_rd: renderer discoverer object. @version: LibVLC 3.0.0 or later.

pyparrot.utils.vlc.libvlc_renderer_discoverer_start(p_rd)[source]

Start renderer discovery To stop it, call L{libvlc_renderer_discoverer_stop}() or L{libvlc_renderer_discoverer_release}() directly. See L{libvlc_renderer_discoverer_stop}(). @param p_rd: renderer discoverer object. @return: -1 in case of error, 0 otherwise. @version: LibVLC 3.0.0 or later.

pyparrot.utils.vlc.libvlc_renderer_discoverer_stop(p_rd)[source]

Stop renderer discovery. See L{libvlc_renderer_discoverer_start}(). @param p_rd: renderer discoverer object. @version: LibVLC 3.0.0 or later.

pyparrot.utils.vlc.libvlc_renderer_item_flags(p_item)[source]

Get the flags of a renderer item See LIBVLC_RENDERER_CAN_AUDIO See LIBVLC_RENDERER_CAN_VIDEO. @return: bitwise flag: capabilities of the renderer, see. @version: LibVLC 3.0.0 or later.

pyparrot.utils.vlc.libvlc_renderer_item_hold(p_item)[source]

Hold a renderer item, i.e. creates a new reference This functions need to called from the libvlc_RendererDiscovererItemAdded callback if the libvlc user wants to use this item after. (for display or for passing it to the mediaplayer for example). @return: the current item. @version: LibVLC 3.0.0 or later.

pyparrot.utils.vlc.libvlc_renderer_item_icon_uri(p_item)[source]

Get the icon uri of a renderer item. @return: the uri of the item’s icon (can be None, must not be freed). @version: LibVLC 3.0.0 or later.

pyparrot.utils.vlc.libvlc_renderer_item_name(p_item)[source]

Get the human readable name of a renderer item. @return: the name of the item (can’t be None, must not be freed). @version: LibVLC 3.0.0 or later.

pyparrot.utils.vlc.libvlc_renderer_item_release(p_item)[source]

Releases a renderer item, i.e. decrements its reference counter. @version: LibVLC 3.0.0 or later.

pyparrot.utils.vlc.libvlc_renderer_item_type(p_item)[source]

Get the type (not translated) of a renderer item. For now, the type can only be “chromecast” (“upnp”, “airplay” may come later). @return: the type of the item (can’t be None, must not be freed). @version: LibVLC 3.0.0 or later.

pyparrot.utils.vlc.libvlc_retain(p_instance)[source]

Increments the reference count of a libvlc instance. The initial reference count is 1 after L{libvlc_new}() returns. @param p_instance: the instance to reference.

pyparrot.utils.vlc.libvlc_set_app_id(p_instance, id, version, icon)[source]

Sets some meta-information about the application. See also L{libvlc_set_user_agent}(). @param p_instance: LibVLC instance. @param id: Java-style application identifier, e.g. “com.acme.foobar”. @param version: application version numbers, e.g. “1.2.3”. @param icon: application icon name, e.g. “foobar”. @version: LibVLC 2.1.0 or later.

pyparrot.utils.vlc.libvlc_set_fullscreen(p_mi, b_fullscreen)[source]

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 L{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} 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.

pyparrot.utils.vlc.libvlc_set_log_verbosity(p_instance, level)[source]

This function does nothing. It is only provided for backward compatibility. @param p_instance: ignored. @param level: ignored.

pyparrot.utils.vlc.libvlc_set_user_agent(p_instance, name, http)[source]

Sets the application name. LibVLC passes this as the user agent string when a protocol requires it. @param p_instance: LibVLC instance. @param name: human-readable application name, e.g. “FooBar player 1.2.3”. @param http: HTTP User Agent, e.g. “FooBar/1.2.3 Python/2.6.0”. @version: LibVLC 1.1.1 or later.

pyparrot.utils.vlc.libvlc_title_descriptions_release(p_titles, i_count)[source]

Release a title description. @param p_titles: title description array to release. @param i_count: number of title descriptions to release. @version: LibVLC 3.0.0 and later.

pyparrot.utils.vlc.libvlc_toggle_fullscreen(p_mi)[source]

Toggle fullscreen status on non-embedded video outputs. @warning: The same limitations applies to this function as to L{libvlc_set_fullscreen}(). @param p_mi: the media player.

pyparrot.utils.vlc.libvlc_toggle_teletext(p_mi)[source]

Toggle teletext transparent status on video output. deprecated use L{libvlc_video_set_teletext}() instead. @param p_mi: the media player.

pyparrot.utils.vlc.libvlc_track_description_list_release(p_track_description)[source]

Release (free) L{TrackDescription}. @param p_track_description: the structure to release.

pyparrot.utils.vlc.libvlc_track_description_release(p_track_description)[source]

deprecated Use L{libvlc_track_description_list_release}() instead.

pyparrot.utils.vlc.libvlc_video_filter_list_get(p_instance)[source]

Returns a list of video filters that are available. @param p_instance: libvlc instance. @return: a list of module descriptions. It should be freed with L{libvlc_module_description_list_release}(). In case of an error, None is returned. See L{ModuleDescription} See L{libvlc_module_description_list_release}.

pyparrot.utils.vlc.libvlc_video_get_adjust_float(p_mi, option)[source]

Get float adjust option. @param p_mi: libvlc media player instance. @param option: adjust option to get, values of libvlc_video_adjust_option_t. @version: LibVLC 1.1.1 and later.

pyparrot.utils.vlc.libvlc_video_get_adjust_int(p_mi, option)[source]

Get integer adjust option. @param p_mi: libvlc media player instance. @param option: adjust option to get, values of libvlc_video_adjust_option_t. @version: LibVLC 1.1.1 and later.

pyparrot.utils.vlc.libvlc_video_get_aspect_ratio(p_mi)[source]

Get current video aspect ratio. @param p_mi: the media player. @return: the video aspect ratio or None if unspecified (the result must be released with free() or L{libvlc_free}()).

pyparrot.utils.vlc.libvlc_video_get_chapter_description(p_mi, i_title)[source]

Get the description of available chapters for specific title. @param p_mi: the media player. @param i_title: selected title. @return: list containing description of available chapter for title i_title. It must be freed with L{libvlc_track_description_list_release}().

pyparrot.utils.vlc.libvlc_video_get_crop_geometry(p_mi)[source]

Get current crop filter geometry. @param p_mi: the media player. @return: the crop filter geometry or None if unset.

pyparrot.utils.vlc.libvlc_video_get_cursor(p_mi, num)[source]

Get the mouse pointer coordinates over a video. Coordinates are expressed in terms of the decoded video resolution, B{not} in terms of pixels on the screen/viewport (to get the latter, you can query your windowing system directly). Either of the coordinates may be negative or larger than the corresponding dimension of the video, if the cursor is outside the rendering area. @warning: The coordinates may be out-of-date if the pointer is not located on the video rendering area. LibVLC does not track the pointer if it is outside of the video widget. @note: LibVLC does not support multiple pointers (it does of course support multiple input devices sharing the same pointer) at the moment. @param p_mi: media player. @param num: number of the video (starting from, and most commonly 0). @return: px abscissa, py ordinate.

pyparrot.utils.vlc.libvlc_video_get_height(p_mi)[source]

Get current video height. deprecated Use L{libvlc_video_get_size}() instead. @param p_mi: the media player. @return: the video pixel height or 0 if not applicable.

pyparrot.utils.vlc.libvlc_video_get_logo_int(p_mi, option)[source]

Get integer logo option. @param p_mi: libvlc media player instance. @param option: logo option to get, values of libvlc_video_logo_option_t.

pyparrot.utils.vlc.libvlc_video_get_marquee_int(p_mi, option)[source]

Get an integer marquee option value. @param p_mi: libvlc media player. @param option: marq option to get See libvlc_video_marquee_int_option_t.

pyparrot.utils.vlc.libvlc_video_get_marquee_string(p_mi, option)[source]

Get a string marquee option value. @param p_mi: libvlc media player. @param option: marq option to get See libvlc_video_marquee_string_option_t.

pyparrot.utils.vlc.libvlc_video_get_scale(p_mi)[source]

Get the current video scaling factor. See also L{libvlc_video_set_scale}(). @param p_mi: the media player. @return: the currently configured zoom factor, or 0. if the video is set to fit to the output window/drawable automatically.

pyparrot.utils.vlc.libvlc_video_get_size(p_mi, num)[source]

Get the pixel dimensions of a video. @param p_mi: media player. @param num: number of the video (starting from, and most commonly 0). @return: px pixel width, py pixel height.

pyparrot.utils.vlc.libvlc_video_get_spu(p_mi)[source]

Get current video subtitle. @param p_mi: the media player. @return: the video subtitle selected, or -1 if none.

pyparrot.utils.vlc.libvlc_video_get_spu_count(p_mi)[source]

Get the number of available video subtitles. @param p_mi: the media player. @return: the number of available video subtitles.

pyparrot.utils.vlc.libvlc_video_get_spu_delay(p_mi)[source]

Get the current subtitle delay. Positive values means subtitles are being displayed later, negative values earlier. @param p_mi: media player. @return: time (in microseconds) the display of subtitles is being delayed. @version: LibVLC 2.0.0 or later.

pyparrot.utils.vlc.libvlc_video_get_spu_description(p_mi)[source]

Get the description of available video subtitles. @param p_mi: the media player. @return: list containing description of available video subtitles. It must be freed with L{libvlc_track_description_list_release}().

pyparrot.utils.vlc.libvlc_video_get_teletext(p_mi)[source]

Get current teletext page requested or 0 if it’s disabled. Teletext is disabled by default, call L{libvlc_video_set_teletext}() to enable it. @param p_mi: the media player. @return: the current teletext page requested.

pyparrot.utils.vlc.libvlc_video_get_title_description(p_mi)[source]

Get the description of available titles. @param p_mi: the media player. @return: list containing description of available titles. It must be freed with L{libvlc_track_description_list_release}().

pyparrot.utils.vlc.libvlc_video_get_track(p_mi)[source]

Get current video track. @param p_mi: media player. @return: the video track ID (int) or -1 if no active input.

pyparrot.utils.vlc.libvlc_video_get_track_count(p_mi)[source]

Get number of available video tracks. @param p_mi: media player. @return: the number of available video tracks (int).

pyparrot.utils.vlc.libvlc_video_get_track_description(p_mi)[source]

Get the description of available video tracks. @param p_mi: media player. @return: list with description of available video tracks, or None on error. It must be freed with L{libvlc_track_description_list_release}().

pyparrot.utils.vlc.libvlc_video_get_width(p_mi)[source]

Get current video width. deprecated Use L{libvlc_video_get_size}() instead. @param p_mi: the media player. @return: the video pixel width or 0 if not applicable.

pyparrot.utils.vlc.libvlc_video_new_viewpoint()[source]

Create a video viewpoint structure. @return: video viewpoint or None (the result must be released with free() or L{libvlc_free}()). @version: LibVLC 3.0.0 and later.

pyparrot.utils.vlc.libvlc_video_set_adjust_float(p_mi, option, value)[source]

Set adjust option as float. Options that take a different type value are ignored. @param p_mi: libvlc media player instance. @param option: adust option to set, values of libvlc_video_adjust_option_t. @param value: adjust option value. @version: LibVLC 1.1.1 and later.

pyparrot.utils.vlc.libvlc_video_set_adjust_int(p_mi, option, value)[source]

Set adjust option as integer. Options that take a different type value are ignored. Passing libvlc_adjust_enable as option value has the side effect of starting (arg !0) or stopping (arg 0) the adjust filter. @param p_mi: libvlc media player instance. @param option: adust option to set, values of libvlc_video_adjust_option_t. @param value: adjust option value. @version: LibVLC 1.1.1 and later.

pyparrot.utils.vlc.libvlc_video_set_aspect_ratio(p_mi, psz_aspect)[source]

Set new video aspect ratio. @param p_mi: the media player. @param psz_aspect: new video aspect-ratio or None to reset to default @note Invalid aspect ratios are ignored.

pyparrot.utils.vlc.libvlc_video_set_callbacks(mp, lock, unlock, display, opaque)[source]

Set callbacks and private data to render decoded video to a custom area in memory. Use L{libvlc_video_set_format}() or L{libvlc_video_set_format_callbacks}() to configure the decoded format. @warning: Rendering video into custom memory buffers is considerably less efficient than rendering in a custom window as normal. For optimal perfomances, VLC media player renders into a custom window, and does not use this function and associated callbacks. It is B{highly recommended} that other LibVLC-based application do likewise. To embed video in a window, use libvlc_media_player_set_xid() or equivalent depending on the operating system. If window embedding does not fit the application use case, then a custom LibVLC video output display plugin is required to maintain optimal video rendering performances. The following limitations affect performance: - Hardware video decoding acceleration will either be disabled completely,

or require (relatively slow) copy from video/DSP memory to main memory.
  • Sub-pictures (subtitles, on-screen display, etc.) must be blent into the main picture by the CPU instead of the GPU.
  • Depending on the video format, pixel format conversion, picture scaling, cropping and/or picture re-orientation, must be performed by the CPU instead of the GPU.
  • Memory copying is required between LibVLC reference picture buffers and application buffers (between lock and unlock callbacks).

@param mp: the media player. @param lock: callback to lock video memory (must not be None). @param unlock: callback to unlock video memory (or None if not needed). @param display: callback to display video (or None if not needed). @param opaque: private pointer for the three callbacks (as first parameter). @version: LibVLC 1.1.1 or later.

pyparrot.utils.vlc.libvlc_video_set_crop_geometry(p_mi, psz_geometry)[source]

Set new crop filter geometry. @param p_mi: the media player. @param psz_geometry: new crop filter geometry (None to unset).

pyparrot.utils.vlc.libvlc_video_set_deinterlace(p_mi, psz_mode)[source]

Enable or disable deinterlace filter. @param p_mi: libvlc media player. @param psz_mode: type of deinterlace filter, None to disable.

pyparrot.utils.vlc.libvlc_video_set_format(mp, chroma, width, height, pitch)[source]

Set decoded video chroma and dimensions. This only works in combination with L{libvlc_video_set_callbacks}(), and is mutually exclusive with L{libvlc_video_set_format_callbacks}(). @param mp: the media player. @param chroma: a four-characters string identifying the chroma (e.g. “RV32” or “YUYV”). @param width: pixel width. @param height: pixel height. @param pitch: line pitch (in bytes). @version: LibVLC 1.1.1 or later. @bug: All pixel planes are expected to have the same pitch. To use the YCbCr color space with chrominance subsampling, consider using L{libvlc_video_set_format_callbacks}() instead.

pyparrot.utils.vlc.libvlc_video_set_format_callbacks(mp, setup, cleanup)[source]

Set decoded video chroma and dimensions. This only works in combination with L{libvlc_video_set_callbacks}(). @param mp: the media player. @param setup: callback to select the video format (cannot be None). @param cleanup: callback to release any allocated resources (or None). @version: LibVLC 2.0.0 or later.

pyparrot.utils.vlc.libvlc_video_set_key_input(p_mi, on)[source]

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.

pyparrot.utils.vlc.libvlc_video_set_logo_int(p_mi, option, value)[source]

Set logo option as integer. Options that take a different type value are ignored. Passing libvlc_logo_enable as option value has the side effect of starting (arg !0) or stopping (arg 0) the logo filter. @param p_mi: libvlc media player instance. @param option: logo option to set, values of libvlc_video_logo_option_t. @param value: logo option value.

pyparrot.utils.vlc.libvlc_video_set_logo_string(p_mi, option, psz_value)[source]

Set logo option as string. Options that take a different type value are ignored. @param p_mi: libvlc media player instance. @param option: logo option to set, values of libvlc_video_logo_option_t. @param psz_value: logo option value.

pyparrot.utils.vlc.libvlc_video_set_marquee_int(p_mi, option, i_val)[source]

Enable, disable or set an integer marquee option Setting libvlc_marquee_Enable has the side effect of enabling (arg !0) or disabling (arg 0) the marq filter. @param p_mi: libvlc media player. @param option: marq option to set See libvlc_video_marquee_int_option_t. @param i_val: marq option value.

pyparrot.utils.vlc.libvlc_video_set_marquee_string(p_mi, option, psz_text)[source]

Set a marquee string option. @param p_mi: libvlc media player. @param option: marq option to set See libvlc_video_marquee_string_option_t. @param psz_text: marq option value.

pyparrot.utils.vlc.libvlc_video_set_mouse_input(p_mi, on)[source]

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 L{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.

pyparrot.utils.vlc.libvlc_video_set_scale(p_mi, f_factor)[source]

Set the video scaling factor. That is the ratio of the number of pixels on screen to the number of pixels in the original decoded video in each dimension. Zero is a special value; it will adjust the video to the output window/drawable (in windowed mode) or the entire screen. Note that not all video outputs support scaling. @param p_mi: the media player. @param f_factor: the scaling factor, or zero.

pyparrot.utils.vlc.libvlc_video_set_spu(p_mi, i_spu)[source]

Set new video subtitle. @param p_mi: the media player. @param i_spu: video subtitle track to select (i_id from track description). @return: 0 on success, -1 if out of range.

pyparrot.utils.vlc.libvlc_video_set_spu_delay(p_mi, i_delay)[source]

Set the subtitle delay. This affects the timing of when the subtitle will be displayed. Positive values result in subtitles being displayed later, while negative values will result in subtitles being displayed earlier. The subtitle delay will be reset to zero each time the media changes. @param p_mi: media player. @param i_delay: time (in microseconds) the display of subtitles should be delayed. @return: 0 on success, -1 on error. @version: LibVLC 2.0.0 or later.

pyparrot.utils.vlc.libvlc_video_set_subtitle_file(p_mi, psz_subtitle)[source]

Set new video subtitle file. deprecated Use L{libvlc_media_player_add_slave}() instead. @param p_mi: the media player. @param psz_subtitle: new video subtitle file. @return: the success status (boolean).

pyparrot.utils.vlc.libvlc_video_set_teletext(p_mi, i_page)[source]
Set new teletext page to retrieve.
This function can also be used to send a teletext key. @param p_mi: the media player. @param i_page: teletex page number requested. This value can be 0 to disable teletext, a number in the range ]0;1000[ to show the requested page, or a

ef libvlc_teletext_key_t. 100 is the default teletext page.

pyparrot.utils.vlc.libvlc_video_set_track(p_mi, i_track)[source]

Set video track. @param p_mi: media player. @param i_track: the track ID (i_id field from track description). @return: 0 on success, -1 if out of range.

pyparrot.utils.vlc.libvlc_video_take_snapshot(p_mi, num, psz_filepath, i_width, i_height)[source]

Take a snapshot of the current video window. If i_width AND i_height is 0, original size is used. If i_width XOR i_height is 0, original aspect-ratio is preserved. @param p_mi: media player instance. @param num: number of video output (typically 0 for the first/only one). @param psz_filepath: the path of a file or a folder to save the screenshot into. @param i_width: the snapshot’s width. @param i_height: the snapshot’s height. @return: 0 on success, -1 if the video was not found.

pyparrot.utils.vlc.libvlc_video_update_viewpoint(p_mi, p_viewpoint, b_absolute)[source]

Update the video viewpoint information. @note: It is safe to call this function before the media player is started. @param p_mi: the media player. @param p_viewpoint: video viewpoint allocated via L{libvlc_video_new_viewpoint}(). @param b_absolute: if true replace the old viewpoint with the new one. If false, increase/decrease it. @return: -1 in case of error, 0 otherwise @note the values are set asynchronously, it will be used by the next frame displayed. @version: LibVLC 3.0.0 and later.

pyparrot.utils.vlc.libvlc_vlm_add_broadcast(p_instance, psz_name, psz_input, psz_output, i_options, ppsz_options, b_enabled, b_loop)[source]

Add a broadcast, with one input. @param p_instance: the instance. @param psz_name: the name of the new broadcast. @param psz_input: the input MRL. @param psz_output: the output MRL (the parameter to the “sout” variable). @param i_options: number of additional options. @param ppsz_options: additional options. @param b_enabled: boolean for enabling the new broadcast. @param b_loop: Should this broadcast be played in loop ? @return: 0 on success, -1 on error.

pyparrot.utils.vlc.libvlc_vlm_add_input(p_instance, psz_name, psz_input)[source]

Add a media’s input MRL. This will add the specified one. @param p_instance: the instance. @param psz_name: the media to work on. @param psz_input: the input MRL. @return: 0 on success, -1 on error.

pyparrot.utils.vlc.libvlc_vlm_add_vod(p_instance, psz_name, psz_input, i_options, ppsz_options, b_enabled, psz_mux)[source]

Add a vod, with one input. @param p_instance: the instance. @param psz_name: the name of the new vod media. @param psz_input: the input MRL. @param i_options: number of additional options. @param ppsz_options: additional options. @param b_enabled: boolean for enabling the new vod. @param psz_mux: the muxer of the vod media. @return: 0 on success, -1 on error.

pyparrot.utils.vlc.libvlc_vlm_change_media(p_instance, psz_name, psz_input, psz_output, i_options, ppsz_options, b_enabled, b_loop)[source]

Edit the parameters of a media. This will delete all existing inputs and add the specified one. @param p_instance: the instance. @param psz_name: the name of the new broadcast. @param psz_input: the input MRL. @param psz_output: the output MRL (the parameter to the “sout” variable). @param i_options: number of additional options. @param ppsz_options: additional options. @param b_enabled: boolean for enabling the new broadcast. @param b_loop: Should this broadcast be played in loop ? @return: 0 on success, -1 on error.

pyparrot.utils.vlc.libvlc_vlm_del_media(p_instance, psz_name)[source]

Delete a media (VOD or broadcast). @param p_instance: the instance. @param psz_name: the media to delete. @return: 0 on success, -1 on error.

pyparrot.utils.vlc.libvlc_vlm_get_event_manager(p_instance)[source]

Get libvlc_event_manager from a vlm media. The p_event_manager is immutable, so you don’t have to hold the lock. @param p_instance: a libvlc instance. @return: libvlc_event_manager.

pyparrot.utils.vlc.libvlc_vlm_get_media_instance_chapter(p_instance, psz_name, i_instance)[source]

Get vlm_media instance chapter number by name or instance id. @param p_instance: a libvlc instance. @param psz_name: name of vlm media instance. @param i_instance: instance id. @return: chapter as number or -1 on error. @bug: will always return 0.

pyparrot.utils.vlc.libvlc_vlm_get_media_instance_length(p_instance, psz_name, i_instance)[source]

Get vlm_media instance length by name or instance id. @param p_instance: a libvlc instance. @param psz_name: name of vlm media instance. @param i_instance: instance id. @return: length of media item or -1 on error.

pyparrot.utils.vlc.libvlc_vlm_get_media_instance_position(p_instance, psz_name, i_instance)[source]

Get vlm_media instance position by name or instance id. @param p_instance: a libvlc instance. @param psz_name: name of vlm media instance. @param i_instance: instance id. @return: position as float or -1. on error.

pyparrot.utils.vlc.libvlc_vlm_get_media_instance_rate(p_instance, psz_name, i_instance)[source]

Get vlm_media instance playback rate by name or instance id. @param p_instance: a libvlc instance. @param psz_name: name of vlm media instance. @param i_instance: instance id. @return: playback rate or -1 on error.

pyparrot.utils.vlc.libvlc_vlm_get_media_instance_seekable(p_instance, psz_name, i_instance)[source]

Is libvlc instance seekable ? @param p_instance: a libvlc instance. @param psz_name: name of vlm media instance. @param i_instance: instance id. @return: 1 if seekable, 0 if not, -1 if media does not exist. @bug: will always return 0.

pyparrot.utils.vlc.libvlc_vlm_get_media_instance_time(p_instance, psz_name, i_instance)[source]

Get vlm_media instance time by name or instance id. @param p_instance: a libvlc instance. @param psz_name: name of vlm media instance. @param i_instance: instance id. @return: time as integer or -1 on error.

pyparrot.utils.vlc.libvlc_vlm_get_media_instance_title(p_instance, psz_name, i_instance)[source]

Get vlm_media instance title number by name or instance id. @param p_instance: a libvlc instance. @param psz_name: name of vlm media instance. @param i_instance: instance id. @return: title as number or -1 on error. @bug: will always return 0.

pyparrot.utils.vlc.libvlc_vlm_pause_media(p_instance, psz_name)[source]

Pause the named broadcast. @param p_instance: the instance. @param psz_name: the name of the broadcast. @return: 0 on success, -1 on error.

pyparrot.utils.vlc.libvlc_vlm_play_media(p_instance, psz_name)[source]

Play the named broadcast. @param p_instance: the instance. @param psz_name: the name of the broadcast. @return: 0 on success, -1 on error.

pyparrot.utils.vlc.libvlc_vlm_release(p_instance)[source]

Release the vlm instance related to the given L{Instance}. @param p_instance: the instance.

pyparrot.utils.vlc.libvlc_vlm_seek_media(p_instance, psz_name, f_percentage)[source]

Seek in the named broadcast. @param p_instance: the instance. @param psz_name: the name of the broadcast. @param f_percentage: the percentage to seek to. @return: 0 on success, -1 on error.

pyparrot.utils.vlc.libvlc_vlm_set_enabled(p_instance, psz_name, b_enabled)[source]

Enable or disable a media (VOD or broadcast). @param p_instance: the instance. @param psz_name: the media to work on. @param b_enabled: the new status. @return: 0 on success, -1 on error.

pyparrot.utils.vlc.libvlc_vlm_set_input(p_instance, psz_name, psz_input)[source]

Set a media’s input MRL. This will delete all existing inputs and add the specified one. @param p_instance: the instance. @param psz_name: the media to work on. @param psz_input: the input MRL. @return: 0 on success, -1 on error.

pyparrot.utils.vlc.libvlc_vlm_set_loop(p_instance, psz_name, b_loop)[source]

Set a media’s loop status. @param p_instance: the instance. @param psz_name: the media to work on. @param b_loop: the new status. @return: 0 on success, -1 on error.

pyparrot.utils.vlc.libvlc_vlm_set_mux(p_instance, psz_name, psz_mux)[source]

Set a media’s vod muxer. @param p_instance: the instance. @param psz_name: the media to work on. @param psz_mux: the new muxer. @return: 0 on success, -1 on error.

pyparrot.utils.vlc.libvlc_vlm_set_output(p_instance, psz_name, psz_output)[source]

Set the output for a media. @param p_instance: the instance. @param psz_name: the media to work on. @param psz_output: the output MRL (the parameter to the “sout” variable). @return: 0 on success, -1 on error.

pyparrot.utils.vlc.libvlc_vlm_show_media(p_instance, psz_name)[source]

Return information about the named media as a JSON string representation. This function is mainly intended for debugging use, if you want programmatic access to the state of a vlm_media_instance_t, please use the corresponding libvlc_vlm_get_media_instance_xxx -functions. Currently there are no such functions available for vlm_media_t though. @param p_instance: the instance. @param psz_name: the name of the media, if the name is an empty string, all media is described. @return: string with information about named media, or None on error.

pyparrot.utils.vlc.libvlc_vlm_stop_media(p_instance, psz_name)[source]

Stop the named broadcast. @param p_instance: the instance. @param psz_name: the name of the broadcast. @return: 0 on success, -1 on error.

pyparrot.utils.vlc.libvlc_vprinterr(fmt, ap)[source]

Sets the LibVLC error status and message for the current thread. Any previous error is overridden. @param fmt: the format string. @param ap: the arguments. @return: a nul terminated string in any case.

pyparrot.utils.vlc.libvlc_wait(p_instance)[source]

Waits until an interface causes the instance to exit. You should start at least one interface first, using L{libvlc_add_intf}(). @param p_instance: the instance @warning This function wastes one thread doing basically nothing. libvlc_set_exit_handler() should be used instead.

class pyparrot.utils.vlc.memoize_parameterless(func)[source]

Bases: object

Decorator. Caches a parameterless method’s return value each time it is called.

If called later with the same arguments, the cached value is returned (not reevaluated). Adapted from https://wiki.python.org/moin/PythonDecoratorLibrary

pyparrot.utils.vlc.module_description_list(head)[source]

Convert a ModuleDescription linked list to a Python list (and release the former).

pyparrot.utils.vlc.str_to_bytes(s)[source]

Translate string or bytes to bytes.

pyparrot.utils.vlc.string_result(result, func, arguments)[source]

Errcheck function. Returns a string and frees the original pointer.

It assumes the result is a char *.

pyparrot.utils.vlc.track_description_list(head)[source]

Convert a TrackDescription linked list to a Python list (and release the former).

Module contents