VlcMedia Class Reference

Media item. More...

#include <VLCQtCore/Media.h>

Signals

void metaChanged (const Vlc::Meta &meta)
 Signal sent on meta change. More...
 
void subitemAdded (libvlc_media_t *subitem)
 Signal sent on subitem added. More...
 
void durationChanged (int duration)
 Signal sent on duration change. More...
 
Q_DECL_DEPRECATED void parsedChanged (int status)
 Signal sent on parsed change. More...
 
void parsedChanged (bool status)
 Signal sent on parsed change. More...
 
void freed (libvlc_media_t *media)
 Signal sent on freed. More...
 
void stateChanged (const Vlc::State &state)
 Signal sent on state change. More...
 

Public Member Functions

 VlcMedia (const QString &location, bool localFile, VlcInstance *instance)
 VlcMedia constructor. More...
 
 VlcMedia (const QString &location, VlcInstance *instance)
 VlcMedia constructor. More...
 
 VlcMedia (libvlc_media_t *media)
 VlcMedia constructor. More...
 
 ~VlcMedia ()
 VlcMedia destructor.
 
libvlc_media_t * core ()
 libvlc media item More...
 
bool parsed () const
 Get parsed status. More...
 
void parse ()
 Parse media information. More...
 
QString currentLocation () const
 Current media location. More...
 
VlcStats * getStats ()
 Get media stats. More...
 
Vlc::State state () const
 Get media state. More...
 
qint64 duration () const
 Get media duration. More...
 
QString duplicate (const QString &name, const QString &path, const Vlc::Mux &mux)
 Duplicate (provided for convenience) More...
 
QString duplicate (const QString &name, const QString &path, const Vlc::Mux &mux, const Vlc::AudioCodec &audioCodec, const Vlc::VideoCodec &videoCodec)
 Duplicate (provided for convenience) More...
 
QString duplicate (const QString &name, const QString &path, const Vlc::Mux &mux, const Vlc::AudioCodec &audioCodec, const Vlc::VideoCodec &videoCodec, int bitrate, int fps, int scale)
 Duplicate (provided for convenience) More...
 
QString merge (const QString &name, const QString &path, const Vlc::Mux &mux)
 Merge. More...
 
QString record (const QString &name, const QString &path, const Vlc::Mux &mux, bool duplicate=false)
 Record. More...
 
QString record (const QString &name, const QString &path, const Vlc::Mux &mux, const Vlc::AudioCodec &audioCodec, const Vlc::VideoCodec &videoCodec, bool duplicate=false)
 Record. More...
 
QString record (const QString &name, const QString &path, const Vlc::Mux &mux, const Vlc::AudioCodec &audioCodec, const Vlc::VideoCodec &videoCodec, int bitrate, int fps, int scale, bool duplicate=false)
 Record. More...
 
void setProgram (int program)
 Set program. More...
 
void setOption (const QString &option)
 Set media option. More...
 
void setOptions (const QStringList &options)
 Set media options. More...
 

Detailed Description

Media item.

An abstract representation of a playable media. It consists of a media location and various optional meta data.

Constructor & Destructor Documentation

VlcMedia::VlcMedia ( const QString &  location,
bool  localFile,
VlcInstance *  instance 
)
explicit

VlcMedia constructor.

This constructor creates a new media instance from a media location.

Parameters
locationlocation of the media (QString)
localFiletrue, if media is local file (bool)
instancemain libvlc instance (VlcInstance *)
VlcMedia::VlcMedia ( const QString &  location,
VlcInstance *  instance 
)
explicit

VlcMedia constructor.

This constructor creates a new media instance from a remote media location. Provided for convenience.

Parameters
locationremote location of the media (QString)
instancemain libvlc instance (VlcInstance *)
VlcMedia::VlcMedia ( libvlc_media_t *  media)

VlcMedia constructor.

This constructor creates a new media instance from an existing one.

Parameters
medialibvlc media item (libvlc_media_t *)

Member Function Documentation

libvlc_media_t * VlcMedia::core ( )

libvlc media item

Returns
libvlc media item (libvlc_media_t *)
QString VlcMedia::currentLocation ( ) const

Current media location.

Returns
QString media location
QString VlcMedia::duplicate ( const QString &  name,
const QString &  path,
const Vlc::Mux &  mux 
)

Duplicate (provided for convenience)

Apply duplicate options with desired mux but without transcoding.

Parameters
nameoutput file name (QString)
pathoutput path (QString)
muxoutput mux (Vlc::Mux)
Returns
QString output file
See also
record()
QString VlcMedia::duplicate ( const QString &  name,
const QString &  path,
const Vlc::Mux &  mux,
const Vlc::AudioCodec &  audioCodec,
const Vlc::VideoCodec &  videoCodec 
)

Duplicate (provided for convenience)

Apply duplicate options with desired mux and transcoding (experimental).

Parameters
nameoutput file name (QString)
pathoutput path (QString)
muxoutput mux (Vlc::Mux)
audioCodecaudio codec (Vlc::AudioCodec)
videoCodecvideo codec (Vlc::VideoCodec)
Returns
QString output file
See also
record()
QString VlcMedia::duplicate ( const QString &  name,
const QString &  path,
const Vlc::Mux &  mux,
const Vlc::AudioCodec &  audioCodec,
const Vlc::VideoCodec &  videoCodec,
int  bitrate,
int  fps,
int  scale 
)

Duplicate (provided for convenience)

Apply duplicate options with desired mux, transcoding and some other options (experimental).

Parameters
nameoutput file name (QString)
pathoutput path (QString)
muxoutput mux (Vlc::Mux)
audioCodecaudio codec (Vlc::AudioCodec)
videoCodecvideo codec (Vlc::VideoCodec)
bitratevideo bitrate (int)
fpsframes per second (int)
scalevideo scale (int)
Returns
QString output file
See also
record()
qint64 VlcMedia::duration ( ) const

Get media duration.

Returns
duration
Since
VLC-Qt 1.1
void VlcMedia::durationChanged ( int  duration)
signal

Signal sent on duration change.

Parameters
durationnew duration
void VlcMedia::freed ( libvlc_media_t *  media)
signal

Signal sent on freed.

Parameters
mediafreed libvlc_media_t object
VlcStats * VlcMedia::getStats ( )

Get media stats.

Returns
VlcStats media stats object
QString VlcMedia::merge ( const QString &  name,
const QString &  path,
const Vlc::Mux &  mux 
)

Merge.

Apply merge options with desired mux but without transcoding.

Parameters
nameoutput file name (QString)
pathoutput path (QString)
muxoutput mux (Vlc::Mux)
Returns
QString output file
void VlcMedia::metaChanged ( const Vlc::Meta &  meta)
signal

Signal sent on meta change.

Parameters
metanew meta
void VlcMedia::parse ( )

Parse media information.

Parse media information: metadata and track information. This call is async.

See also
parsedChanged
Since
VLC-Qt 1.1
bool VlcMedia::parsed ( ) const

Get parsed status.

Know when it is OK to read metadata and track information

Returns
parsed status (const bool)
Since
VLC-Qt 1.1
Q_DECL_DEPRECATED void VlcMedia::parsedChanged ( int  status)
signal

Signal sent on parsed change.

Parameters
statusnew parsed status
Deprecated:
Deprecated since VLC-Qt 1.1, will be removed in 2.0
void VlcMedia::parsedChanged ( bool  status)
signal

Signal sent on parsed change.

Parameters
statusnew parsed status
QString VlcMedia::record ( const QString &  name,
const QString &  path,
const Vlc::Mux &  mux,
bool  duplicate = false 
)

Record.

Apply recording options with desired mux but without transcoding.

Parameters
nameoutput file name (QString)
pathoutput path (QString)
muxoutput mux (Vlc::Mux)
duplicatealso duplicate on screen (bool)
Returns
QString output file
QString VlcMedia::record ( const QString &  name,
const QString &  path,
const Vlc::Mux &  mux,
const Vlc::AudioCodec &  audioCodec,
const Vlc::VideoCodec &  videoCodec,
bool  duplicate = false 
)

Record.

Apply recording options with desired mux and transcoding (experimental).

Parameters
nameoutput file name (QString)
pathoutput path (QString)
muxoutput mux (Vlc::Mux)
audioCodecaudio codec (Vlc::AudioCodec)
videoCodecvideo codec (Vlc::VideoCodec)
duplicatealso duplicate on screen (bool)
Returns
QString output file
QString VlcMedia::record ( const QString &  name,
const QString &  path,
const Vlc::Mux &  mux,
const Vlc::AudioCodec &  audioCodec,
const Vlc::VideoCodec &  videoCodec,
int  bitrate,
int  fps,
int  scale,
bool  duplicate = false 
)

Record.

Apply recording options with desired mux, transcoding and some other options (experimental).

Parameters
nameoutput file name (QString)
pathoutput path (QString)
muxoutput mux (Vlc::Mux)
audioCodecaudio codec (Vlc::AudioCodec)
videoCodecvideo codec (Vlc::VideoCodec)
bitratevideo bitrate (int)
fpsframes per second (int)
scalevideo scale (int)
duplicatealso duplicate on screen (bool)
Returns
QString output file
void VlcMedia::setOption ( const QString &  option)

Set media option.

Parameters
optionmedia option (QString)
void VlcMedia::setOptions ( const QStringList &  options)

Set media options.

Parameters
optionsmedia options (QStringList)
void VlcMedia::setProgram ( int  program)

Set program.

Parameters
programprogram PID (int)
Vlc::State VlcMedia::state ( ) const

Get media state.

Returns
current media state
Since
VLC-Qt 1.1
void VlcMedia::stateChanged ( const Vlc::State &  state)
signal

Signal sent on state change.

Parameters
statenew state
void VlcMedia::subitemAdded ( libvlc_media_t *  subitem)
signal

Signal sent on subitem added.

Parameters
subitemsubitem that was added

The documentation for this class was generated from the following files: