vlc

package module
v0.0.0-...-93149e5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 7, 2014 License: CC0-1.0 Imports: 7 Imported by: 0

README

================================================================================
 go-vlc
================================================================================

 This package wraps the libVLC Api for use in your Go programs.
 The bindings are written for libVLC 1.1.9

 Event callbacks are fully functional.

================================================================================
 TODO
================================================================================

 - Needs more thorough testing.

================================================================================
 DEPENDENCIES
================================================================================

 libvlc: http://videolan.org

================================================================================
 USAGE
================================================================================

 The examples folder contains an example program demonstrating the use
 of this library.

Documentation

Overview

Go bindings for libVLC 1.1.9.

Index

Constants

View Source
const (
	VersionMajor    = 1
	VersionMinor    = 1
	VersionRevision = 9
	VersionExtra    = 0

	// Version as a single integer. Practical for version comparison.
	Version = (VersionMajor << 24) | (VersionMinor << 16) | (VersionRevision << 8) | VersionExtra
)

libVLC version numbers.

Variables

This section is empty.

Functions

func ChangeSet

func ChangeSet() string

ChangeSet returns the change set for the libvlc build.

func ClearError

func ClearError()

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

func Compiler

func Compiler() string

Compiler returns the compiler used to build libvlc.

func VersionString

func VersionString() string

Version returns the libVLC version as a human-readable string.

Types

type AdjustOption

type AdjustOption uint8
const (
	AOEnable AdjustOption = iota
	AOContrast
	AOBrightness
	AOHue
	AOSaturation
	AOGamma
)

type AudioChannel

type AudioChannel int8
const (
	ACError   AudioChannel = -1
	ACStereo  AudioChannel = 1
	ACRStereo AudioChannel = 2
	ACLeft    AudioChannel = 3
	ACRight   AudioChannel = 4
	ACDolbys  AudioChannel = 5
)

type AudioDevice

type AudioDevice int8
const (
	ADError  AudioDevice = -1
	ADMono   AudioDevice = 1
	ADStereo AudioDevice = 2
	AD2F2R   AudioDevice = 4
	AD3F2R   AudioDevice = 5
	AD5_1    AudioDevice = 6
	AD6_1    AudioDevice = 7
	AD7_1    AudioDevice = 8
	ADSPDIF  AudioDevice = 10
)

type AudioOutput

type AudioOutput struct {
	// contains filtered or unexported fields
}

Description for audio output.

func (*AudioOutput) Description

func (this *AudioOutput) Description() string

Description returns the track description.

func (*AudioOutput) Name

func (this *AudioOutput) Name() string

Name returns the track name.

func (*AudioOutput) Release

func (this *AudioOutput) Release()

type AudioOutputList

type AudioOutputList []*AudioOutput

List of track descriptions.

func (*AudioOutputList) Release

func (this *AudioOutputList) Release()

type Discoverer

type Discoverer struct {
	// contains filtered or unexported fields
}

Medis discovery service.

func (*Discoverer) Events

func (this *Discoverer) Events() (*EventManager, error)

Events returns an event manager for this instance. Note: This method does not increment the media reference count.

func (*Discoverer) IsRunning

func (this *Discoverer) IsRunning() (bool, error)

IsRunning returns true if the discovery service is currently running.

func (*Discoverer) LocalizedName

func (this *Discoverer) LocalizedName() (s string, err error)

LocalizedName return the localzied discovery service name.

func (*Discoverer) MediaList

func (this *Discoverer) MediaList() (m *MediaList, err error)

MediaList returns a list of media items.

func (*Discoverer) Release

func (this *Discoverer) Release()

Release media discover object

type DisplayHandler

type DisplayHandler func(picture uintptr, userdata interface{})

type Event

type Event struct {
	Type EventType
	// contains filtered or unexported fields
}

Generic event type. Use a switch on Event.Type to determine which method to call for its data. The method names are the same as the event type. It's a bit of an odd way to handle this, but since event data comes in the form of a C union, there is some binary magic that has to be performed based on the event type.

func (*Event) MediaDiscovererEnded

func (this *Event) MediaDiscovererEnded() *Discoverer

func (*Event) MediaDiscovererStarted

func (this *Event) MediaDiscovererStarted() *Discoverer

func (*Event) MediaDurationChanged

func (this *Event) MediaDurationChanged() int64

func (*Event) MediaFreed

func (this *Event) MediaFreed() *Media

func (*Event) MediaListItemAdded

func (this *Event) MediaListItemAdded() *Media

func (*Event) MediaListItemDeleted

func (this *Event) MediaListItemDeleted() *Media

func (*Event) MediaListPlayerNextItemSet

func (this *Event) MediaListPlayerNextItemSet() *Media

func (*Event) MediaListPlayerPlayed

func (this *Event) MediaListPlayerPlayed() MediaState

func (*Event) MediaListPlayerStopped

func (this *Event) MediaListPlayerStopped() MediaState

func (*Event) MediaListViewItemAdded

func (this *Event) MediaListViewItemAdded() *Media

func (*Event) MediaListViewItemDeleted

func (this *Event) MediaListViewItemDeleted() *Media

func (*Event) MediaListViewWillAddItem

func (this *Event) MediaListViewWillAddItem() *Media

func (*Event) MediaListViewWillDeleteItem

func (this *Event) MediaListViewWillDeleteItem() *Media

func (*Event) MediaListWillAddItem

func (this *Event) MediaListWillAddItem() *Media

func (*Event) MediaListWillDeleteItem

func (this *Event) MediaListWillDeleteItem() *Media

func (*Event) MediaMetaChanged

func (this *Event) MediaMetaChanged() MetaProperty

func (*Event) MediaParsedChanged

func (this *Event) MediaParsedChanged() int

func (*Event) MediaPlayerBackward

func (this *Event) MediaPlayerBackward() MediaState

func (*Event) MediaPlayerBuffering

func (this *Event) MediaPlayerBuffering() MediaState

func (*Event) MediaPlayerEncounteredError

func (this *Event) MediaPlayerEncounteredError() MediaState

func (*Event) MediaPlayerEndReached

func (this *Event) MediaPlayerEndReached() MediaState

func (*Event) MediaPlayerForward

func (this *Event) MediaPlayerForward() MediaState

func (*Event) MediaPlayerLengthChanged

func (this *Event) MediaPlayerLengthChanged() bool

func (*Event) MediaPlayerMediaChanged

func (this *Event) MediaPlayerMediaChanged() *Media

func (*Event) MediaPlayerNothingSpecial

func (this *Event) MediaPlayerNothingSpecial() MediaState

func (*Event) MediaPlayerOpening

func (this *Event) MediaPlayerOpening() MediaState

func (*Event) MediaPlayerPaused

func (this *Event) MediaPlayerPaused() MediaState

func (*Event) MediaPlayerPlaying

func (this *Event) MediaPlayerPlaying() MediaState

func (*Event) MediaPlayerPositionChanged

func (this *Event) MediaPlayerPositionChanged() float32

func (*Event) MediaPlayerSeekableChanged

func (this *Event) MediaPlayerSeekableChanged() bool

func (*Event) MediaPlayerSnapshotTaken

func (this *Event) MediaPlayerSnapshotTaken() string

func (*Event) MediaPlayerStopped

func (this *Event) MediaPlayerStopped() MediaState

func (*Event) MediaPlayerTimeChanged

func (this *Event) MediaPlayerTimeChanged() int64

func (*Event) MediaPlayerTitleChanged

func (this *Event) MediaPlayerTitleChanged() bool

func (*Event) MediaStateChanged

func (this *Event) MediaStateChanged() MediaState

func (*Event) MediaSubItemAdded

func (this *Event) MediaSubItemAdded() *Media

func (*Event) VlmMediaAdded

func (this *Event) VlmMediaAdded() (string, string)

func (*Event) VlmMediaChanged

func (this *Event) VlmMediaChanged() (string, string)

func (*Event) VlmMediaInstanceStarted

func (this *Event) VlmMediaInstanceStarted() (string, string)

func (*Event) VlmMediaInstanceStatusEnd

func (this *Event) VlmMediaInstanceStatusEnd() (string, string)

func (*Event) VlmMediaInstanceStatusError

func (this *Event) VlmMediaInstanceStatusError() (string, string)

func (*Event) VlmMediaInstanceStatusInitAdded

func (this *Event) VlmMediaInstanceStatusInitAdded() (string, string)

func (*Event) VlmMediaInstanceStatusOpening

func (this *Event) VlmMediaInstanceStatusOpening() (string, string)

func (*Event) VlmMediaInstanceStatusPause

func (this *Event) VlmMediaInstanceStatusPause() (string, string)

func (*Event) VlmMediaInstanceStatusPlaying

func (this *Event) VlmMediaInstanceStatusPlaying() (string, string)

func (*Event) VlmMediaInstanceStopped

func (this *Event) VlmMediaInstanceStopped() (string, string)

func (*Event) VlmMediaRemoved

func (this *Event) VlmMediaRemoved() (string, string)

type EventHandler

type EventHandler func(evt *Event, userdata interface{})

Event callback handler.

type EventManager

type EventManager struct {
	// contains filtered or unexported fields
}

A libvlc instance has an event manager which can be used to hook event callbacks,

func NewEventManager

func NewEventManager(p *C.libvlc_event_manager_t) *EventManager

func (*EventManager) Attach

func (this *EventManager) Attach(et EventType, cb EventHandler, userdata interface{}) (id int, err error)

Attach registers the given event handler and returns a unique id we can use to detach the event at a later point.

func (*EventManager) Detach

func (this *EventManager) Detach(id int) (err error)

Detach unregisters the given event id.

type EventType

type EventType int
const (
	MediaMetaChanged EventType = iota
	MediaSubItemAdded
	MediaDurationChanged
	MediaParsedChanged
	MediaFreed
	MediaStateChanged
)
const (
	MediaPlayerMediaChanged EventType = 0x100 + iota
	MediaPlayerNothingSpecial
	MediaPlayerOpening
	MediaPlayerBuffering
	MediaPlayerPlaying
	MediaPlayerPaused
	MediaPlayerStopped
	MediaPlayerForward
	MediaPlayerBackward
	MediaPlayerEndReached
	MediaPlayerEncounteredError
	MediaPlayerTimeChanged
	MediaPlayerPositionChanged
	MediaPlayerSeekableChanged
	MediaPlayerPausableChanged
	MediaPlayerTitleChanged
	MediaPlayerSnapshotTaken
	MediaPlayerLengthChanged
)
const (
	MediaListItemAdded EventType = 0x200 + iota
	MediaListWillAddItem
	MediaListItemDeleted
	MediaListWillDeleteItem
)
const (
	MediaListViewItemAdded EventType = 0x300 + iota
	MediaListViewWillAddItem
	MediaListViewItemDeleted
	MediaListViewWillDeleteItem
)
const (
	MediaListPlayerPlayed EventType = 0x400 + iota
	MediaListPlayerNextItemSet
	MediaListPlayerStopped
)
const (
	MediaDiscovererStarted EventType = 0x500 + iota
	MediaDiscovererEnded
)
const (
	VlmMediaAdded EventType = 0x600 + iota
	VlmMediaRemoved
	VlmMediaChanged
	VlmMediaInstanceStarted
	VlmMediaInstanceStopped
	VlmMediaInstanceStatusInit
	VlmMediaInstanceStatusOpening
	VlmMediaInstanceStatusPlaying
	VlmMediaInstanceStatusPause
	VlmMediaInstanceStatusEnd
	VlmMediaInstanceStatusError
)

func (EventType) String

func (this EventType) String() string

type Instance

type Instance struct {
	// contains filtered or unexported fields
}

A single libvlc instance.

func New

func New(argv []string) (i *Instance, err error)

New creates and initializes a new VLC instance with the given parameters. Returns nil and a possible error if no instance could be created.

func (*Instance) Discoverer

func (this *Instance) Discoverer(name string) (*Discoverer, error)

Discoverer creates a new discover media service by name.

func (*Instance) NewLibrary

func (this *Instance) NewLibrary() (*Library, error)

NewLibrary creates an empty media library.

func (*Instance) NewList

func (this *Instance) NewList() (*MediaList, error)

NewList creates and initializes a new media list.

func (*Instance) NewListPlayer

func (this *Instance) NewListPlayer() (*ListPlayer, error)

NewListPlayer creates an empty media list player object.

func (*Instance) NewPlayer

func (this *Instance) NewPlayer() (*Player, error)

NewPlayer creates an empty media player object.

func (*Instance) OpenMediaFd

func (this *Instance) OpenMediaFd(fd int) (*Media, error)

OpenMediaFd creates a media instance for an 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 /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().

func (*Instance) OpenMediaFile

func (this *Instance) OpenMediaFile(path string) (*Media, error)

OpenMediaFile loads a media instance from the given filesystem path.

func (*Instance) OpenMediaNode

func (this *Instance) OpenMediaNode(name string) (*Media, error)

OpenMediaNode creates a media instance as an empty node with a given name.

func (*Instance) OpenMediaUri

func (this *Instance) OpenMediaUri(uri string) (*Media, error)

OpenMediaUri loads a media instance from the given uri.

func (*Instance) Release

func (this *Instance) Release() (err error)

Release decreases the reference count of the instance and destroys it when it reaches zero.

func (*Instance) Retain

func (this *Instance) Retain() (err error)

Retain increments the reference count of the Instance. The initial reference count is 1 after vlc.New() returns.

func (*Instance) SetName

func (this *Instance) SetName(appname, httpname string) (err error)

SetName sets the human-readable application name (e.g. "FooBar player 1.2.3") and user-agent name (e.g. "FooBar/1.2.3 Python/2.6.0"). LibVLC passes this as the user agent string when a protocol requires it.

func (*Instance) StartUI

func (this *Instance) StartUI(name string) (err error)

StartUI tries to start a user interface for the Instance. Specify an empty name to use the default.

func (*Instance) VlmAddBroadcast

func (this *Instance) VlmAddBroadcast(name, input, output string, options []string, enabled, loop bool) error

VlmAddBroadcast adds a broadcast with given input.

name: The name of the new broadcast.
input: The input MRL.
output: The output MRL (the parameter to the "sout" variable).
options: Additional options.
enabled: Enable the new broadcast?
loop: Should this broadcast be played in loop?

func (*Instance) VlmAddInput

func (this *Instance) VlmAddInput(name, input string) error

VlmAddInput adds an input MRL for the given media (VOD or broadcast).

func (*Instance) VlmAddVOD

func (this *Instance) VlmAddVOD(name, input, output, mux string, options []string, enabled bool) error

VlmAddVOD adds a VOD with given input.

name: The name of the new broadcast.
input: The input MRL.
options: Additional options.
mux: The muxer of the vod media.
enabled: Enable the new broadcast?

func (*Instance) VlmChangeMedia

func (this *Instance) VlmChangeMedia(name, input, output string, options []string, enabled, loop bool) error

VlmChangeMedia edits the parameters of a media. This will delete all existing inputs and add the specified one.

name: The name of the new broadcast.
input: The input MRL.
output: The output MRL (the parameter to the "sout" variable).
options: Additional options.
enabled: Enable the new broadcast?
loop: Should this broadcast be played in loop?

func (*Instance) VlmDelete

func (this *Instance) VlmDelete(name string) error

VlmDelete deletes the given media (VOD or broadcast).

func (*Instance) VlmEvents

func (this *Instance) VlmEvents() (*EventManager, error)

VlmEvents returns an event manager for a VLM instance.

func (*Instance) VlmLength

func (this *Instance) VlmLength(name string, id int) (int, error)

VlmLength returns the instance length by name or instance id.

func (*Instance) VlmMediaInfo

func (this *Instance) VlmMediaInfo(name string) (s string, err error)

VlmMediaInfo returns information about the named media as a JSON string.

Note: This function is mainly intended for debugging use,

func (*Instance) VlmPause

func (this *Instance) VlmPause(name string) error

VlmPause pauses playback of the named broadcast.

func (*Instance) VlmPlay

func (this *Instance) VlmPlay(name string) error

VlmPlay plays the named broadcast.

func (*Instance) VlmPosition

func (this *Instance) VlmPosition(name string, id int) (float32, error)

VlmPosition returns the instance position by name or instance id.

func (*Instance) VlmRate

func (this *Instance) VlmRate(name string, id int) (int, error)

VlmRate returns the instance playback rate by name or instance id.

func (*Instance) VlmRelease

func (this *Instance) VlmRelease() error

VlmRelease releases the vlm instance associated with this instance.

func (*Instance) VlmSeek

func (this *Instance) VlmSeek(name string, percentage float32) error

VlmSeek seeks in the named broadcast.

func (*Instance) VlmSetEnabled

func (this *Instance) VlmSetEnabled(name string, toggle bool) error

VlmSetEnabled enables or disables the given media (VOD or broadcast).

func (*Instance) VlmSetInput

func (this *Instance) VlmSetInput(name, input string) error

VlmSetInput sets the input MRL for the given media (VOD or broadcast). This will delete all existing inputs and add the specified one.

func (*Instance) VlmSetLoop

func (this *Instance) VlmSetLoop(name string, toggle bool) error

VlmSetLoop enables or disables the given media's loop state (VOD or broadcast).

func (*Instance) VlmSetMux

func (this *Instance) VlmSetMux(name, mux string) error

VlmSetMux sets a media's VOD muxer.

func (*Instance) VlmSetOutput

func (this *Instance) VlmSetOutput(name, output string) error

VlmSetOutput sets the output for the given media (VOD or broadcast).

func (*Instance) VlmStop

func (this *Instance) VlmStop(name string) error

VlmStop halts playback of the named broadcast.

func (*Instance) VlmTime

func (this *Instance) VlmTime(name string, id int) (int, error)

VlmTime returns the instance time by name or instance id.

func (*Instance) Wait

func (this *Instance) Wait() error

Wait waits until an interface causes the instance to exit. You should start at least one interface first, using Instance.StartUI().

type Library

type Library struct {
	// contains filtered or unexported fields
}

A media library

func (*Library) Items

func (this *Library) Items() (*MediaList, error)

Items returns a list of all the media items in this library.

func (*Library) Load

func (this *Library) Load() error

Load loads the library contents.

func (*Library) Release

func (this *Library) Release() (err error)

Release decreases the reference count of the instance and destroys it when it reaches zero.

func (*Library) Retain

func (this *Library) Retain() (err error)

Retain increments the reference count of the instance.

type ListPlayer

type ListPlayer struct {
	// contains filtered or unexported fields
}

This player is meant for playlist playback. This is basically a wrapper for vlc.Player that takes care of playlist rotation.

func (*ListPlayer) Events

func (this *ListPlayer) Events() (*EventManager, error)

Events returns an Eventmanager for this player.

func (*ListPlayer) IsPlaying

func (this *ListPlayer) IsPlaying() (bool, error)

IsPlaying returns true if the player is currently playing.

func (*ListPlayer) Next

func (this *ListPlayer) Next() error

Next plays the next item in the list if applicable.

func (*ListPlayer) Pause

func (this *ListPlayer) Pause() error

Pause pauses playback.

func (*ListPlayer) Play

func (this *ListPlayer) Play() error

Play plays the entries in the media list.

func (*ListPlayer) PlayAt

func (this *ListPlayer) PlayAt(pos int) error

PlayAt plays the entry at the given list index.

func (*ListPlayer) PlayItem

func (this *ListPlayer) PlayItem(m *Media) error

PlayItem plays the given entry.

Note: The supplied Media must be part of this list.

func (*ListPlayer) Prev

func (this *ListPlayer) Prev() error

Prev plays the previous item in the list if applicable.

func (*ListPlayer) Release

func (this *ListPlayer) Release() (err error)

Release decreases the reference count of the instance and destroys it when it reaches zero.

func (*ListPlayer) Replace

func (this *ListPlayer) Replace(p *Player) error

Replace replaces the Player instance in this listplayer with a new one.

func (*ListPlayer) Set

func (this *ListPlayer) Set(l *MediaList) error

Set sets the MediaList associated with this player.

func (*ListPlayer) SetMode

func (this *ListPlayer) SetMode(pm PlaybackMode) error

SetMode sets the current playback mode. Any of: PMDefault, PMLoop or PMRepeat.

func (*ListPlayer) State

func (this *ListPlayer) State() (MediaState, error)

State returns the current media state.

func (*ListPlayer) Stop

func (this *ListPlayer) Stop() error

Stop halts playback.

type LockHandler

type LockHandler func(plane uintptr, userdata interface{}) uintptr

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. Those planes must be aligned on 32-bytes boundaries.

void* (*lock) (void** plane, void* userdata)

type LogPriority

type LogPriority uint8
const (
	Info LogPriority = iota
	Error
	Warning
	Debug
)

type LogoOption

type LogoOption uint8
const (
	LOEnable LogoOption = iota
	LOFile
	LOX
	LOY
	LODelay
	LORepeat
	LOOpacity
	LOPosition
)

type MarqueeOption

type MarqueeOption uint8
const (
	MOEnable MarqueeOption = iota
	MOText
	MOColor
	MOOpacity
	MOPosition
	MORefresh
	MOSize
	MOTimeout
	MOX
	MOY
)

type Media

type Media struct {
	// contains filtered or unexported fields
}

func (*Media) AddOption

func (this *Media) AddOption(options string) error

Add an option to the media.

This option will be used to determine how the media player will read the media. This allows us to use VLC's advanced reading/streaming options on a per-media basis.

The options are detailed in vlc --full-help, for instance "--sout-all"

func (*Media) AddOptionFlag

func (this *Media) AddOptionFlag(options string, flags uint32) error

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 us to use VLC's advanced reading/streaming options on a per-media basis.

The options are detailed in vlc --full-help, for instance "--sout-all"

func (*Media) Duplicate

func (this *Media) Duplicate() (*Media, error)

Duplicate duplicates the media object.

func (*Media) Duration

func (this *Media) Duration() int64

Duration returns the duration in milliseconds for the current media instance.

func (*Media) Events

func (this *Media) Events() (*EventManager, error)

Events returns an event manager for this media instance. Note: This method does not increment the media reference count.

func (*Media) IsParsed

func (this *Media) IsParsed() bool

IsParsed returns true if the media's metadata has already been parsed.

func (*Media) Meta

func (this *Media) Meta(mp MetaProperty) (s string)

Meta reads the specified metadata property of the media.

If the media has not yet been parsed this will return an empty string.

This method automatically calls Media.ParseAsync(), so after calling it you may receive a MediaMetaChanged event. If you prefer a synchronous version, ensure that you call Media.Parse() before Media.Meta().

func (*Media) Mrl

func (this *Media) Mrl() (s string)

Mrl returns the media resource locator (mrl) from a media descriptor object.

func (*Media) NewPlayer

func (this *Media) NewPlayer() (*Player, error)

NewPlayer a media player from this media instance. After creating the player, you can destroy this Media instance, unless you really need it for something. It is not necessary to perform actual playback.

func (*Media) Parse

func (this *Media) Parse()

Parse the current media source.

This fetches (local) meta data and track information. The method is synchronous version of Media.ParseAsync().

func (*Media) ParseAsync

func (this *Media) ParseAsync()

Parse the current media source.

This fetches (local) meta data and track information. The method is the asynchronous version of Media.Parse()

To determine when this routine finishes, you can listen for a MediaParsedChanged event. However if the media was already parsed you will not receive this event.

func (*Media) Release

func (this *Media) Release() (err error)

Release decreases the reference count of this Media instance and destroys it when it reaches zero. It will send out a MediaFreed event to all listeners. If the media descriptor object has been released it should not be used again.

func (*Media) Retain

func (this *Media) Retain() (err error)

Retain increments the reference count of this Media instance.

func (*Media) SaveMeta

func (this *Media) SaveMeta() (err error)

SaveMeta saves the previously changed metadata.

func (*Media) SetMeta

func (this *Media) SetMeta(mp MetaProperty, v string)

SetMeta sets the metadata for this media instance. Note: This method does not save the metadata. Call Media.SaveMeta() for this purpose.

func (*Media) SetUserData

func (this *Media) SetUserData(v interface{})

SetUserData sets the media descriptor's user_data. user_data is specialized data accessed by the host application, VLC.framework uses it as a pointer to a native object that references a libvlc_media_t pointer.

TODO(jimt): I have no idea what this comment means. Presumably its a roundabout way of saying that the data specified in here will survive roundtrips through event callback handlers. So you can pass it anything you need.

func (*Media) State

func (this *Media) State() MediaState

State returns the current media state.

func (*Media) Stats

func (this *Media) Stats() (*Stats, error)

Stats returns media statistics.

func (*Media) SubItems

func (this *Media) SubItems() (*MediaList, error)

SubItems returns subitems of this media instance. This will increment the reference count of this media instance. Use MediaList.Release() to decrement the reference count.

func (*Media) TrackInfo

func (this *Media) TrackInfo() ([]*TrackInfo, error)

TrackInfo yields the media descriptor's elementary stream descriptions.

Note: You need to play the media _one_ time with --sout="#description" Not doing this will result in an empty array, and doing it more than once will duplicate the entries in the array each time. Something like this:

player, _ := media.NewPlayer()
media.AddOption("sout=#description")
player.Play()
// ... wait until playing
player.Release()

This is very likely to change in next release, and will be done at the parsing phase instead.

func (*Media) UserData

func (this *Media) UserData() interface{}

UserData returns the media descriptor's user_data. user_data is specialized data accessed by the host application, VLC.framework uses it as a pointer to a native object that references a libvlc_media_t pointer.

TODO(jimt): I have no idea what this comment means. Presumably its a roundabout way of saying that the data specified in here will survive roundtrips through event callback handlers. So you can pass it anything you need.

type MediaList

type MediaList struct {
	// contains filtered or unexported fields
}

Maintains a list of Media items.

func (*MediaList) Add

func (this *MediaList) Add(m *Media) error

Add adds a media instance to this list.

Note: MediaList.Lock() SHOULD be held upon entering this function.

func (*MediaList) At

func (this *MediaList) At(pos int) (*Media, error)

At returns the media at the given list position. This action will increase the reference count on the media instance.

Note: MediaList.Lock() SHOULD be held upon entering this function.

func (*MediaList) Count

func (this *MediaList) Count() (int, error)

Count returns the number if items in the list.

Note: MediaList.Lock() SHOULD be held upon entering this function.

func (*MediaList) Events

func (this *MediaList) Events() (*EventManager, error)

Events returns an Eventmanager for this list.

func (*MediaList) Get

func (this *MediaList) Get() (*Media, error)

Get returns a media instance from this list. This action will increase the reference count on the media instance.

Note: MediaList.Lock() should NOT be held upon entering this function.

func (*MediaList) Index

func (this *MediaList) Index(m *Media) (int, error)

Index returns the position of the given media in the list.

Note: MediaList.Lock() SHOULD be held upon entering this function.

func (*MediaList) Insert

func (this *MediaList) Insert(m *Media, pos int) error

Insert adds a media instance to the list at the given position.

Note: MediaList.Lock() SHOULD be held upon entering this function.

func (*MediaList) IsReadOnly

func (this *MediaList) IsReadOnly() (bool, error)

IsReadOnly returns true if this list is readonly for a user.

func (*MediaList) Lock

func (this *MediaList) Lock() error

Lock gets a lock on the list items.

func (*MediaList) Release

func (this *MediaList) Release() error

Release cleans up any memory used by this list and decrements the reference counter for the Media instance this came from.

func (*MediaList) Remove

func (this *MediaList) Remove(pos int) error

Remove removes a media instance at the given position from the list.

Note: MediaList.Lock() SHOULD be held upon entering this function.

func (*MediaList) Retain

func (this *MediaList) Retain() error

Retain increments the reference count of this MediaList instance.

func (*MediaList) Set

func (this *MediaList) Set(m *Media) error

Set associates a media instance with this media list. If another media instance was present it will be released.

Note: MediaList.Lock() should NOT be held upon entering this function.

func (*MediaList) Unlock

func (this *MediaList) Unlock() error

Unlock removes a lock on the list items.

type MediaOption

type MediaOption uint16
const (
	MOTrusted MediaOption = 0x2
	MOUnique  MediaOption = 0x100
)

type MediaState

type MediaState uint8
const (
	MSNothingSpecial MediaState = iota
	MSOpening
	MSBuffering
	MSPlaying
	MSPaused
	MSStopped
	MSEnded
	MSError
)

type MetaProperty

type MetaProperty uint8
const (
	MPTitle MetaProperty = iota
	MPArtist
	MPGenre
	MPCopyright
	MPAlbum
	MPTrackNumber
	MPDescription
	MPRating
	MPDate
	MPSetting
	MPURL
	MPLanguage
	MPNowPlaying
	MPPublisher
	MPEncodedBy
	MPArtworkURL
	MPTrackID
)

type PlaybackMode

type PlaybackMode uint8
const (
	PMDefault PlaybackMode = iota
	PMLoop
	PMRepeat
)

type Player

type Player struct {
	// contains filtered or unexported fields
}

func (*Player) AGL

func (this *Player) AGL() (drawable uint32, err error)

AGL returns the agl handler where the media player should render its video output.

func (*Player) AdjustOption

func (this *Player) AdjustOption(option AdjustOption) (int, error)

AdjustOption returns an integer adjustment option.

func (*Player) AdjustOptionFloat

func (this *Player) AdjustOptionFloat(option AdjustOption) (float32, error)

AdjustOptionFloat returns a float adjustment option.

func (*Player) Aspect

func (this *Player) Aspect() (s string, err error)

Aspect returns the current aspect ratio.

func (*Player) AudioChannel

func (this *Player) AudioChannel() (int, error)

AudioChannel returns the current audio channel.

func (*Player) AudioDelay

func (this *Player) AudioDelay() (int64, error)

AudioDelay returns the current audio delay.

func (*Player) AudioDescription

func (this *Player) AudioDescription() (TrackDescriptionList, error)

AudioDescription returns descriptions for the current audio tracks.

Note: make sure to call TrackDescriptionList.Release() when you are done with it.

func (*Player) AudioDeviceCount

func (this *Player) AudioDeviceCount(output string) (int, error)

AudioDeviceCount returns the number of devices for audio output. These devices are hardware oriented like analog or digital output of sound cards.

func (*Player) AudioDeviceId

func (this *Player) AudioDeviceId(output string, device int) (s string, err error)

AudioDeviceId returns the id of an audio device.

func (*Player) AudioDeviceName

func (this *Player) AudioDeviceName(output string, device int) (s string, err error)

AudioDeviceName returns the long name of an audio device. If it is not available, the short name is given.

func (*Player) AudioDeviceType

func (this *Player) AudioDeviceType() (AudioDevice, error)

AudioDeviceType return the current audio device type. Device type describes something like character of output sound - stereo sound, 2.1, 5.1 etc

func (*Player) AudioOutput

func (this *Player) AudioOutput() (AudioOutputList, error)

AudioOutput returns a list of available audio outputs.

Note: Be sure to call AudioOutputList.Release() after you are done with the list.

func (*Player) AudioTrack

func (this *Player) AudioTrack() (int, error)

AudioTrack returns the current audio track.

func (*Player) AudioTrackCount

func (this *Player) AudioTrackCount() (int, error)

AudioTrackCount returns the number of available audio tracks.

func (*Player) CanPause

func (this *Player) CanPause() (bool, error)

CanPause returns whether or not pause/resume is allowed for the current media.

func (*Player) CanSeek

func (this *Player) CanSeek() (bool, error)

CanSeek returns whether or not seeking is allowed for the current media.

func (*Player) Chapter

func (this *Player) Chapter() (int, error)

Chapter returns the current movie chapter.

func (*Player) ChapterCount

func (this *Player) ChapterCount() (int, error)

ChapterCount returns the number of available movie chapters.

func (*Player) ChapterDescription

func (this *Player) ChapterDescription(title int) (TrackDescriptionList, error)

ChapterDescription returns descriptions of available chapters for a specific title.

Note: make sure to call TrackDescriptionList.Release() when you are done with it.

func (*Player) CropGeometry

func (this *Player) CropGeometry() (s string, err error)

CropGeometry returns the current crop filter geometry.

func (*Player) Cursor

func (this *Player) Cursor(vidnum uint) (cx, cy int, err error)

Get the mouse pointer coordinates over a video. Coordinates are expressed in terms of the decoded video resolution, /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.

Note: 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.

vidnum is the number of the target video. Most commonly starts at 0.

func (*Player) Events

func (this *Player) Events() (*EventManager, error)

Events returns an event manager for this player.

func (*Player) Fps

func (this *Player) Fps() (float32, error)

Fps returns the current movie frame rate.

func (*Player) Fullscreen

func (this *Player) Fullscreen() (bool, error)

Fullscreen returns wether or not we are currently in fullscreen mode.

func (*Player) Hwnd

func (this *Player) Hwnd() (drawable uintptr, err error)

Hwnd returns the Windows API window handle (HWND) previously set with Player.SetHwnd(). The handle will be returned even if LibVLC is not currently outputting any video to it.

func (*Player) IsMute

func (this *Player) IsMute() (bool, error)

IsMute returns whether or not mute is enabled.

func (*Player) IsPlaying

func (this *Player) IsPlaying() bool

IsPlaying returns whether or not this player is currently playing.

func (*Player) Length

func (this *Player) Length() (int64, error)

Length returns the current movie length in milliseconds.

func (*Player) LogoOption

func (this *Player) LogoOption(option LogoOption) (int, error)

LogoOption returns an integer logo option.

func (*Player) MarqueeOption

func (this *Player) MarqueeOption(option MarqueeOption) (int, error)

MarqueeOption returns an integer marquee option value.

func (*Player) MarqueeOptionString

func (this *Player) MarqueeOptionString(option MarqueeOption) (s string, err error)

MarqueeOptionString returns a string marquee option value.

func (*Player) Media

func (this *Player) Media() (*Media, error)

Media returns the media currently associated with this player.

func (*Player) NSObject

func (this *Player) NSObject() (drawable uintptr, err error)

NSObject returns the NSView handler previously set with Player.SetNSObject().

func (*Player) NextChapter

func (this *Player) NextChapter() (err error)

NextChapter sets the next chapter if applicable.

func (*Player) NextFrame

func (this *Player) NextFrame() error

NextFrame jumps to the next frame if applicable.

func (*Player) OutputCount

func (this *Player) OutputCount() (int, error)

OutputCount returns the number of outputs the current media has.

func (*Player) Pause

func (this *Player) Pause() (err error)

Pause pauses playback. Has no effect if no media is loaded.

func (*Player) Play

func (this *Player) Play() (err error)

Play begins playback.

func (*Player) Position

func (this *Player) Position() (float32, error)

Position returns the current movie position.

func (*Player) PreviousChapter

func (this *Player) PreviousChapter() (err error)

PreviousChapter sets the previous chapter if applicable.

func (*Player) Rate

func (this *Player) Rate() (float32, error)

Rate returns the current movie playback rate. Note: Depending on the underlying media, the requested rate may be different from the real playback rate.

func (*Player) Release

func (this *Player) Release() (err error)

Release decreases the reference count of the instance and destroys it when it reaches zero.

func (*Player) Retain

func (this *Player) Retain() (err error)

Retain increments the reference count of this player.

func (*Player) Scale

func (this *Player) Scale() (float32, error)

Scale returns 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.

Note: Not all video outputs support scaling.

func (*Player) SetAGL

func (this *Player) SetAGL(drawable uint32) (err error)

SetAGL set the agl handler where the media player should render its video output.

func (*Player) SetAdjustOption

func (this *Player) SetAdjustOption(option AdjustOption, v int) error

SetAdjustOption sets an integer adjustment option value. Options that take a different type value are ignored. Passing AOEnable as option value has the side effect of starting (arg !0) or stopping (arg 0) the logo filter.

func (*Player) SetAdjustOptionFloat

func (this *Player) SetAdjustOptionFloat(option AdjustOption, v float32) error

SetAdjustOptionFloat sets a float adjustment option value. Options that take a different type value are ignored.

func (*Player) SetAspect

func (this *Player) SetAspect(v string) error

SetAspect sets the current aspect ratio.

func (*Player) SetAudioChannel

func (this *Player) SetAudioChannel(channel int) (err error)

SetAudioChannel sets the current audio channel.

func (*Player) SetAudioDelay

func (this *Player) SetAudioDelay(delay int64) (err error)

SetAudioDelay sets the current audio delay.

func (*Player) SetAudioDevice

func (this *Player) SetAudioDevice(output, deviceid string) (err error)

SetAudioDevice sets the current audio output device. Changes will be applied after stop and play.

func (*Player) SetAudioDeviceType

func (this *Player) SetAudioDeviceType(ad AudioDevice) error

SetAudioDeviceType sets the current audio device type. Device type describes something like character of output sound - stereo sound, 2.1, 5.1 etc

func (*Player) SetAudioOutput

func (this *Player) SetAudioOutput(output string) (err error)

SetAudioOutput sets the current audio output. Changes will be applied after stop and play.

func (*Player) SetAudioTrack

func (this *Player) SetAudioTrack(track int) (err error)

SetAudioTrack sets the current audio track.

func (*Player) SetCallbacks

func (this *Player) SetCallbacks(lh LockHandler, uh UnlockHandler, dh DisplayHandler, userdata interface{}) (err error)

SetCallbacks set callbacks and private data to render decoded video to a custom area in memory. Use libvlc_video_set_format() to configure the decoded format.

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. Those planes must be aligned on 32-bytes boundaries.

When the video frame is decoded, the unlock callback is invoked. The second parameter to the callback is the return value of the lock callback. The third parameter conveys the pixel planes for convenience.

When the video frame needs to be shown, as determined by the media playback clock, the display callback is invoked. The second parameter also conveys the return value from the lock callback.

func (*Player) SetChapter

func (this *Player) SetChapter(v int)

SetChapter sets the current movie chapter. This has no effect if playback is not enabled. This might not work depending on the underlying input format and protocol.

func (*Player) SetCropGeometry

func (this *Player) SetCropGeometry(s string) (err error)

SetCropGeometry sets the current crop filter geometry. Specify an empty string to clear the filter.

func (*Player) SetDeinterlace

func (this *Player) SetDeinterlace(f string) (err error)

SetDeinterlace sets the deinterlace filter. Supply an empty string to disable the filter.

func (*Player) SetFormat

func (this *Player) SetFormat(chroma string, width, height, pitch uint) error

SetFormat specifies the decoded video chroma and dimensions. This only works in combination with Player.SetCallbacks().

The chroma parameter should be a four-character string identifying the chroma (e.g. "RV32" or "I420").

Width and height indicate the pixel dimensions and pitch is the line pitch in bytes.

func (*Player) SetFullscreen

func (this *Player) SetFullscreen(toggle bool) error

SetFullscreen switches from fullscreen to windowed mode or vice-versa. This applies only to non-embedded video outputs.

Note: With most window managers, only a top-level windows can be in full-screen mode. Hence, this function will not operate properly if Player.SetXWindow() 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 /before/ fullscreen mode is enabled. You will want to reparent it back to its normal parent when disabling fullscreen.

func (*Player) SetHwnd

func (this *Player) SetHwnd(drawable uintptr) (err error)

SetHwnd sets 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.

func (*Player) SetKeyInput

func (this *Player) SetKeyInput(toggle bool) error

SetKeyInput enables or disables 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.

Note: This function is only implemented for X11 and Win32 at the moment.

func (*Player) SetLogoOption

func (this *Player) SetLogoOption(option MarqueeOption, v int) error

SetLogoOption sets an integer logo option value. Options that take a different type value are ignored. Passing LOEnable as option value has the side effect of starting (arg !0) or stopping (arg 0) the logo filter.

func (*Player) SetLogoOptionString

func (this *Player) SetLogoOptionString(option LogoOption, s string) error

SetLogoOptionString sets a string logo option value.

func (*Player) SetMarqueeOption

func (this *Player) SetMarqueeOption(option MarqueeOption, v int) error

SetMarqueeOption sets an integer marquee option value.

func (*Player) SetMarqueeOptionString

func (this *Player) SetMarqueeOptionString(option MarqueeOption, s string) error

SetMarqueeOptionString sets a string marquee option value.

func (*Player) SetMedia

func (this *Player) SetMedia(m *Media) error

SetMedia sets the new media to be used by this player. If existing media is loaded, it will be destroyed.

func (*Player) SetMouseInput

func (this *Player) SetMouseInput(toggle bool) error

SetMouseInput enables or disables 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".

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.

Note: This function is only implemented for X11 and Win32 at the moment.

func (*Player) SetMute

func (this *Player) SetMute(toggle bool) error

SetMute sets mute mode to the specified value.

func (*Player) SetNSObject

func (this *Player) SetNSObject(drawable uintptr) (err error)

SetNSObject sets 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:

@protocol VLCOpenGLVideoViewEmbedding <NSObject>
- (void)addVoutSubview:(NSView *)view;
- (void)removeVoutSubview:(NSView *)view;
@end

Or it can be an NSView object.

If you want to use it along with Qt4 see the QMacCocoaViewContainer. Then the following code should work:

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

You can find a live example in VLCVideoView in VLCKit.framework.

func (*Player) SetPosition

func (this *Player) SetPosition(v float32)

SetPosition sets the movie position. This has no effect if playback is not enabled. This might not work depending on the underlying input format and protocol.

func (*Player) SetRate

func (this *Player) SetRate(v float32) error

SetRate sets the requested movie playback rate.

func (*Player) SetScale

func (this *Player) SetScale(v float32) error

SetScale sets 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: Not all video outputs support scaling.

func (*Player) SetSubtitle

func (this *Player) SetSubtitle(s int) (err error)

SetSubtitle sets the current subtitle track.

func (*Player) SetSubtitleFile

func (this *Player) SetSubtitleFile(path string) (err error)

SetSubtitle sets the current subtitle from a file.

func (*Player) SetTeletext

func (this *Player) SetTeletext(page int) error

SetTeletext sets a new teletext page to retrieve.

func (*Player) SetTime

func (this *Player) SetTime(v int64)

SetTime sets the movie time in milliseconds. This has no effect if no media is being played. Not all formats and protocols support this.

func (*Player) SetTitle

func (this *Player) SetTitle(v int)

SetTitle sets the current movie title.

func (*Player) SetVideoTrack

func (this *Player) SetVideoTrack(track int) (err error)

SetVideoTrack sets the current video track.

func (*Player) SetVolume

func (this *Player) SetVolume(v int) error

SetVolume sets the current audio level.

func (*Player) SetXWindow

func (this *Player) SetXWindow(drawable uint32) (err error)

Set an X Window System drawable where the media player should render its video output. If LibVLC was built without X11 output support, this has no effects.

The specified identifier must correspond to an existing Input/Output class X11 window. Pixmaps are /not/ supported. The caller shall ensure that the X11 server is the same as the one the VLC instance has been configured with.

func (*Player) Size

func (this *Player) Size(vidnum uint) (width, height uint, err error)

Size returns the pixel dimensions of a video. vidnum is the number of the target video. Most commonly starts at 0.

func (*Player) State

func (this *Player) State() (MediaState, error)

State returns the current movie state.

func (*Player) Stop

func (this *Player) Stop() (err error)

Stop stops playback. Has no effect if no media is loaded.

func (*Player) SubTile

func (this *Player) SubTile() (int, error)

SubTile returns the current video subtitle or -1 if none is set.

func (*Player) SubTileCount

func (this *Player) SubTileCount() (int, error)

SubTileCount returns the number of available subtitles.

func (*Player) SubTileDescription

func (this *Player) SubTileDescription() (TrackDescriptionList, error)

SubTileDescription returns descriptions for the current subtitle track.

Note: make sure to call TrackDescriptionList.Release() when you are done with it.

func (*Player) TakeSnapshot

func (this *Player) TakeSnapshot(path string, vidnum, width, height uint) (err error)

TakeSnapshot takes a snapshot of the selected video output ans saves it to the specified file.

If width AND height are both 0, the original size is used. If width OR height is 0, the original aspect ratio is preserved.

Vidnum is the number of the video output (typically 0 for the first/only one)

func (*Player) Teletext

func (this *Player) Teletext() (int, error)

Teletext returns the current requested teletext page.

func (*Player) Time

func (this *Player) Time() (int64, error)

Time returns the current movie time in milliseconds.

func (*Player) Title

func (this *Player) Title() (int, error)

Title returns the current movie title.

func (*Player) TitleChapterCount

func (this *Player) TitleChapterCount(title int) (int, error)

TitleChapterCount returns the number of available movie chapters for the given title.

func (*Player) TitleCount

func (this *Player) TitleCount(title int) (int, error)

TitleCount returns the number of available movie titles.

func (*Player) ToggleFullscreen

func (this *Player) ToggleFullscreen() error

ToggleFullscreen switches between fullscreen and windowed modes on non-embedded video outputs.

Note: The same limitations apply to this as to Player.SetFullscreen()

func (*Player) ToggleMute

func (this *Player) ToggleMute() error

ToggleMute toggles the current mute status.

func (*Player) TogglePause

func (this *Player) TogglePause(pause bool) (err error)

TogglePause toggles between pause and resume. Has no effect if no media is loaded.

func (*Player) ToggleTeletext

func (this *Player) ToggleTeletext() error

ToggleTeletext toggles transparent teletext status on video output.

func (*Player) VideoDescription

func (this *Player) VideoDescription() (TrackDescriptionList, error)

VideoDescription returns descriptions for the current video tracks.

Note: make sure to call TrackDescriptionList.Release() when you are done with it.

func (*Player) VideoTrack

func (this *Player) VideoTrack() (int, error)

VideoTrack returns the current video track.

func (*Player) VideoTrackCount

func (this *Player) VideoTrackCount() (int, error)

VideoTrackCount returns the number of video tracks in the current media.

func (*Player) Volume

func (this *Player) Volume() (int, error)

Volume returns the current audio level.

func (*Player) WillPlay

func (this *Player) WillPlay() bool

WillPlay returns true if the player is able to play.

func (*Player) XWindow

func (this *Player) XWindow() (drawable uint32, err error)

XWindow returns the X Window System window identifier previously set with Player.SetXWindow(). 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).

type Rect

type Rect struct {
	// contains filtered or unexported fields
}

Rectangle type for video geometry.

func (*Rect) Bottom

func (this *Rect) Bottom() int

Bottom returns the bottom coordinate.

func (*Rect) Left

func (this *Rect) Left() int

Left returns the left coordinate.

func (*Rect) Right

func (this *Rect) Right() int

Right returns the right coordinate.

func (*Rect) Top

func (this *Rect) Top() int

Top returns the top coordinate.

type Stats

type Stats struct {
	// contains filtered or unexported fields
}

Supplies a set of statistics on playing media.

func (*Stats) DecodedAudio

func (this *Stats) DecodedAudio() int

func (*Stats) DecodedVideo

func (this *Stats) DecodedVideo() int

func (*Stats) DemuxBitRate

func (this *Stats) DemuxBitRate() float32

func (*Stats) DemuxCorrupted

func (this *Stats) DemuxCorrupted() int

func (*Stats) DemuxDiscontinuity

func (this *Stats) DemuxDiscontinuity() int

func (*Stats) DemuxReadBytes

func (this *Stats) DemuxReadBytes() int

func (*Stats) DisplayedPictures

func (this *Stats) DisplayedPictures() int

DisplayedPictures returns the amount of displayed pictures.

func (*Stats) InputBitRate

func (this *Stats) InputBitRate() float32

InputBitRate returns the input transfer rate.

func (*Stats) LostAudioBuffers

func (this *Stats) LostAudioBuffers() int

LostAudioBuffers returns the amount of lost audio buffers.

func (*Stats) LostPictures

func (this *Stats) LostPictures() int

LostPictures returns the amount of lost pictures.

func (*Stats) PlayedAudioBuffers

func (this *Stats) PlayedAudioBuffers() int

PlayedAudioBuffers returns the amount of played audio buffers.

func (*Stats) ReadBytes

func (this *Stats) ReadBytes() int

ReadBytes returns the amount of bytes read from the input source.

func (*Stats) SendBitRate

func (this *Stats) SendBitRate() float32

SendBitRate returns the transfer bitrate.

func (*Stats) SentBytes

func (this *Stats) SentBytes() int

SentBytes returns the amount of bytes sent.

func (*Stats) SentPackets

func (this *Stats) SentPackets() int

SentPackets returns the amount of packets sent.

type TrackDescription

type TrackDescription struct {
	// contains filtered or unexported fields
}

Description for video, audio tracks and subtitles.

func (*TrackDescription) Id

func (this *TrackDescription) Id() int

Id returns the track Id.

func (*TrackDescription) Name

func (this *TrackDescription) Name() string

Name returns the track name.

func (*TrackDescription) Release

func (this *TrackDescription) Release()

Release releases memory for this instance.

type TrackDescriptionList

type TrackDescriptionList []*TrackDescription

List of track descriptions.

func (*TrackDescriptionList) Release

func (this *TrackDescriptionList) Release()

Release recursively releases memory for this list.

type TrackInfo

type TrackInfo struct {
	// contains filtered or unexported fields
}

Represents a single media track. Can be audio or video. Access Audio() or Video() depending on the value of Type.

func (*TrackInfo) Audio

func (this *TrackInfo) Audio() (channels, rate uint32)

func (*TrackInfo) Codec

func (this *TrackInfo) Codec() uint32

func (*TrackInfo) Id

func (this *TrackInfo) Id() int

func (*TrackInfo) Level

func (this *TrackInfo) Level() int

func (*TrackInfo) Profile

func (this *TrackInfo) Profile() int

func (*TrackInfo) Type

func (this *TrackInfo) Type() TrackType

func (*TrackInfo) Video

func (this *TrackInfo) Video() (width, height uint32)

type TrackType

type TrackType int
const (
	TTUnknown TrackType = -1
	TTAudio   TrackType = 0
	TTVideo   TrackType = 1
	TTText    TrackType = 2
)

type UnlockHandler

type UnlockHandler func(picture, plane uintptr, userdata interface{})

When the video frame is decoded, the unlock callback is invoked. The second parameter to the callback is the return value of the lock callback. The third parameter conveys the pixel planes for convenience.

void (*unlock) (void* picture, void* const* plane, void* userdata)

Directories

Path Synopsis
Direct port of http://wiki.videolan.org/LibVLC_Tutorial Run this program with -v, -vv or -vvv parameters for progressively more verbose debug output from libvlc.
Direct port of http://wiki.videolan.org/LibVLC_Tutorial Run this program with -v, -vv or -vvv parameters for progressively more verbose debug output from libvlc.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL