MMSAV Class Reference
[Media playback (mmsmedia)]

MMS Audio/Video handling class. More...

#include <mmsav.h>

Inheritance diagram for MMSAV:

List of all members.


Public Member Functions

 MMSAV (MMSMEDIABackend backend=MMSMEDIA_BE_GST)
 Constructor.
virtual ~MMSAV ()
 Destructor.
bool registerAudioPostPlugin (string name)
 Registers a xine audio post plugin.
bool registerVideoPostPlugin (string name)
 Registers a xine video post plugin.
bool setAudioPostPluginParameter (string name, string parameter, string value)
 Sets audio post plugin parameter.
bool setVideoPostPluginParameter (string name, string parameter, string value)
 Sets video post plugin parameter.
bool isPlaying ()
 Determines if a stream is currently being played.
bool isPaused ()
 Determines if a stream is currently being paused.
bool isStopped ()
 Determines if a stream is in stopped status.
void startPlaying (const string mrl, const bool cont=true)
 Starts playing.
void play ()
 Continues playing.
void stop (const bool savePosition=true)
 Stops playing.
void pause ()
 Pauses.
void ffwd ()
 Playback will be switched to fast forward.
void slow ()
 Playback will be switched to slow motion.
bool getTimes (int *pos, int *length)
 Gets information about the length of the actual title and the time of the current position in seconds.
void setBrightness (int count)
 Sets the brightness if video output is done.
void brightnessUp (int count)
 Increases the brightness if video output is done.
void brightnessDown (int count)
 Decreases the brightness if video output is done.
void setContrast (int count)
 Sets the contrast if video output is done.
void contrastUp (int count)
 Increases the contrast if video output is done.
void contrastDown (int count)
 Decreases the contrast if video output is done.
void setSaturation (int count)
 Sets the saturation if video output is done.
void saturationUp (int count)
 Increases the saturation if video output is done.
void saturationDown (int count)
 Decreases the saturation if video output is done.
void setHue (int count)
 Sets the hue if video output is done.
void hueUp (int count)
 Increases the hue if video output is done.
void hueDown (int count)
 Decreases the hue if video output is done.
void setVolume (int percent)
 Sets the volume of the audio output.
bool hasVideo ()
 Returns true if stream contains a video stream.
bool hasAudio ()
 Returns true if stream contains an audio stream.

Public Attributes

sigc::signal< void, string > * onError
 Callback that is used to receive errors.
sigc::signal< void, const
unsigned short, const unsigned
short > * 
onStatusChange
 Callback that is used to receive status changes.

Static Public Attributes

static const unsigned short STATUS_NONE = 0
 status not set
static const unsigned short STATUS_PLAYING = 1
 stream is being played
static const unsigned short STATUS_PAUSED = 2
 stream is being paused
static const unsigned short STATUS_STOPPED = 3
 stream was stopped
static const unsigned short STATUS_REWIND = 4
 stream is being rewinded
static const unsigned short STATUS_FFWD = 5
 stream is being fast forwarded (2x)
static const unsigned short STATUS_FFWD2 = 6
 stream is being fast forwarded (4x)
static const unsigned short STATUS_SLOW = 7
 stream is being played slowly (2x)
static const unsigned short STATUS_SLOW2 = 8
 stream is being played slowly (4x)

Protected Member Functions

void gstInit (const string uri)
 init gstreamer
void xineInit ()
 Initializes some xine stuff.
void xineOpen (xine_event_listener_cb_t queue_cb=NULL, void *userData=NULL)
 Opens an audio/video object.
void initialize (const bool verbose=false, MMSWindow *window=NULL)
 Initializes everything that is needed my MMSAV.
void setStatus (int status)
 Sets internal status of sound/video playback.
void sendEvent (int type, void *data=NULL, int datalen=0)
 Send a xine event to the engine.
bool sendKeyPress (MMSKeySymbol key)
bool sendKeyRelease (MMSKeySymbol key)
bool sendButtonPress (int posx, int posy)
bool sendButtonRelease (int posx, int posy)
bool sendAxisMotion (int posx, int posy)
bool sendEvent (MMSInputEvent *input)
bool onHandleInput (MMSWindow *window, MMSInputEvent *input)

Protected Attributes

MMSMEDIABackend backend
 backend which is used to stream any sources
MMSWindowwindow
 window which displays the stream
MMSFBSurfacesurface
 surface of the window
bool verbose
 should logging be verbose?
short status
 current playback status
int pos
 remember position where the stream stopped last time
string currentMRL
 current mrl
xine_t * xine
 global xine structure
xine_video_port_t * vo
 xine video ports
xine_audio_port_t * ao
 xine audio ports
xine_stream_t * stream
 xine stream
xine_event_queue_t * queue
 xine event queue
map< string, xine_post_t * > audioPostPlugins
 map of registered audio post plugins
map< string, xine_post_t * > videoPostPlugins
 map of registered video post plugins

Private Member Functions

bool setPostPluginParameter (map< string, xine_post_t * > plugins, string name, string parameter, string value)
 Sets post plugin parameter.

Private Attributes

sigc::connection onHandleInputConnection
MMSRAW_USERDATA userd
GST_DISKOVIDEOSINK_DATA gst_diskovideosink_data
VODESC vodesc
 video output settings
dfb_visual_t visual
 visual structure for video output
raw_visual_t rawvisual
pthread_mutex_t lock

Detailed Description

MMS Audio/Video handling class.

Author:
Stefan Schwarzer (stefan.schwarzer@diskohq.org)

Matthias Hardt (matthias.hardt@diskohq.org)

Jens Schneider (pupeider@gmx.de)

Guido Madaus (guido.madaus@diskohq.org)

Patrick Helterhoff (patrick.helterhoff@diskohq.org)

René Bählkow (rene.baehlkow@diskohq.org)

It is the base class for all audio and video related classes.

Definition at line 144 of file mmsav.h.


Constructor & Destructor Documentation

MMSAV::MMSAV ( MMSMEDIABackend  _backend = MMSMEDIA_BE_GST  ) 

Constructor.

Initializes private variables

Note:
It checks the chosen backend against the supported ones. It simply switches the support, because one of the backends has to be implemented, otherwise mmsmedia isn't build.

Definition at line 740 of file mmsav.cpp.

MMSAV::~MMSAV (  )  [virtual]

Destructor.

Deletes sigc++-callbacks and closes all xine related stuff.

Definition at line 790 of file mmsav.cpp.


Member Function Documentation

bool MMSAV::setPostPluginParameter ( map< string, xine_post_t * >  plugins,
string  name,
string  parameter,
string  value 
) [private]

Sets post plugin parameter.

Parameters:
plugins [in] map of post plugins
name [in] name of post plugin that will be affected
parameter [in] parameter to set
value [in] value for the parameter
Returns:
true if the parameter could be set

Definition at line 989 of file mmsav.cpp.

void MMSAV::gstInit ( const string  uri  )  [protected]

init gstreamer

void MMSAV::xineInit (  )  [protected]

Initializes some xine stuff.

It creates the xine object that is used for audio/video stream creation. Then it loads the user's xine configuration and sets the given verbosity.

Exceptions:
MMSAVError cannot get a new xine object

Definition at line 526 of file mmsav.cpp.

void MMSAV::xineOpen ( xine_event_listener_cb_t  queue_cb = NULL,
void *  userData = NULL 
) [protected]

Opens an audio/video object.

It creates the xine stream, wires all registered audio/video post plugins, sets the verbosity and registers the event queue if given.

Note:
You have to register post plugins before calling open().
Parameters:
queue_cb [in] xine event queue callback
userData [in] data to be used in xine event callbacks
See also:
MMSAV::registerAudioPostPlugin

MMSAV::registerVideoPostPlugin

Exceptions:
MMSAVError Cannot get a new stream

Definition at line 870 of file mmsav.cpp.

void MMSAV::initialize ( const bool  verbose = false,
MMSWindow window = NULL 
) [protected]

Initializes everything that is needed my MMSAV.

First it initializes xine. Then it sets some internal variables and does some surface flipping.

Parameters:
verbose [in] if true the xine engine writes debug messages to stdout
window [in] window that will be used for video output
See also:
MMSAV::xineInit()
Exceptions:
MMSAVError Cannot get a new xine object
MMSAVError MMSFBSurface::clear() failed
MMSAVError MMSFBSurface::flip() failed
MMSAVError Cannot open the DFB video driver

Definition at line 581 of file mmsav.cpp.

void MMSAV::setStatus ( int  status  )  [protected]

Sets internal status of sound/video playback.

It also emits a signal, which can be handled using the sigc++ connectors.

Parameters:
status [in] status to set
See also:
MMSAV::onStatusChange

Definition at line 1144 of file mmsav.cpp.

void MMSAV::sendEvent ( int  type,
void *  data = NULL,
int  datalen = 0 
) [protected]

Send a xine event to the engine.

Parameters:
type [in] type of event
data [in] event specific data
datalen [in] length of data

Definition at line 1991 of file mmsav.cpp.

bool MMSAV::sendKeyPress ( MMSKeySymbol  key  )  [protected]

Definition at line 2019 of file mmsav.cpp.

bool MMSAV::sendKeyRelease ( MMSKeySymbol  key  )  [protected]

Definition at line 2042 of file mmsav.cpp.

bool MMSAV::sendButtonPress ( int  posx,
int  posy 
) [protected]

Definition at line 2065 of file mmsav.cpp.

bool MMSAV::sendButtonRelease ( int  posx,
int  posy 
) [protected]

Definition at line 2088 of file mmsav.cpp.

bool MMSAV::sendAxisMotion ( int  posx,
int  posy 
) [protected]

Definition at line 2111 of file mmsav.cpp.

bool MMSAV::sendEvent ( MMSInputEvent input  )  [protected]

Definition at line 2134 of file mmsav.cpp.

bool MMSAV::onHandleInput ( MMSWindow window,
MMSInputEvent input 
) [protected]

Definition at line 559 of file mmsav.cpp.

bool MMSAV::registerAudioPostPlugin ( string  name  ) 

Registers a xine audio post plugin.

Post plugin will be initialized.

Parameters:
name [in] name of the post plugin
Returns:
true if plugin could be initialized correctly

Definition at line 921 of file mmsav.cpp.

bool MMSAV::registerVideoPostPlugin ( string  name  ) 

Registers a xine video post plugin.

Post plugin will be initialized.

Parameters:
name [in] name of the post plugin
Returns:
true if plugin could be initialized correctly

Definition at line 954 of file mmsav.cpp.

bool MMSAV::setAudioPostPluginParameter ( string  name,
string  parameter,
string  value 
)

Sets audio post plugin parameter.

Parameters:
name [in] name of post plugin that will be affected
parameter [in] parameter to set
value [in] value for the parameter
Returns:
true if the parameter could be set
See also:
MMSAV::setPostPluginParameter

MMSAV::setVideoPostPluginParameter

Definition at line 1090 of file mmsav.cpp.

bool MMSAV::setVideoPostPluginParameter ( string  name,
string  parameter,
string  value 
)

Sets video post plugin parameter.

Parameters:
name [in] name of post plugin that will be affected
parameter [in] parameter to set
value [in] value for the parameter
Returns:
true if the parameter could be set
See also:
MMSAV::setPostPluginParameter

MMSAV::setAudioPostPluginParameter

Definition at line 1117 of file mmsav.cpp.

bool MMSAV::isPlaying (  ) 

Determines if a stream is currently being played.

Returns:
true if stream is being played

Definition at line 1172 of file mmsav.cpp.

bool MMSAV::isPaused (  ) 

Determines if a stream is currently being paused.

Returns:
true if stream is being paused

Definition at line 1204 of file mmsav.cpp.

bool MMSAV::isStopped (  ) 

Determines if a stream is in stopped status.

Returns:
true if stream is being stopped

Definition at line 1236 of file mmsav.cpp.

void MMSAV::startPlaying ( const string  mrl,
const bool  cont = true 
)

Starts playing.

If the continue flag is set it tries to continue at the position where it was stopped before.

Parameters:
mrl [in] mrl to play
cont [in] if true it tries to continue at a position stopped before
Exceptions:
MMSAVError stream could not be opened

Reimplemented in MMSSound, and MMSVideo.

Definition at line 1251 of file mmsav.cpp.

void MMSAV::play (  ) 

Continues playing.

It only works if playing was stopped or speed changed to other than normal.

Reimplemented in MMSTV.

Definition at line 1313 of file mmsav.cpp.

void MMSAV::stop ( const bool  savePosition = true  ) 

Stops playing.

Parameters:
savePosition [in] if true stream position will be saved for continuation
It saves the position, so if you call MMSAV::play() afterwards with the continue flag set, it will continue at this position.

Definition at line 1352 of file mmsav.cpp.

void MMSAV::pause (  ) 

Pauses.

It only works if stream is playing (can be slow, ffwd etc.).

Reimplemented in MMSTV.

Definition at line 1395 of file mmsav.cpp.

void MMSAV::ffwd (  ) 

Playback will be switched to fast forward.

There are two different speed settings for fast forward. Twice as fast and four times as fast.

See also:
MMSAV::slow()

MMSAV::rewind()

Reimplemented in MMSSound.

Definition at line 1478 of file mmsav.cpp.

void MMSAV::slow (  ) 

Playback will be switched to slow motion.

There are two different speed settings for slow motion. Twice as slow and four times as slow.

See also:
MMSAV::ffwd()

MMSAV::rewind()

Definition at line 1433 of file mmsav.cpp.

bool MMSAV::getTimes ( int *  pos,
int *  length 
)

Gets information about the length of the actual title and the time of the current position in seconds.

Parameters:
pos [out] time in seconds of current position
length [out] time in seconds of title length

Definition at line 1557 of file mmsav.cpp.

void MMSAV::setBrightness ( int  count  ) 

Sets the brightness if video output is done.

Parameters:
count [in] amount of brightness
See also:
MMSAV::brightnessUp()

MMSAV::brightnessDown()

Definition at line 1589 of file mmsav.cpp.

void MMSAV::brightnessUp ( int  count  ) 

Increases the brightness if video output is done.

Parameters:
count [in] amount of brightness to increase
See also:
MMSAV::setBrightness()

MMSAV::brightnessDown()

Definition at line 1619 of file mmsav.cpp.

void MMSAV::brightnessDown ( int  count  ) 

Decreases the brightness if video output is done.

Parameters:
count [in] amount of brightness to decrease
See also:
MMSAV::setBrightness()

MMSAV::brightnessUp()

Definition at line 1651 of file mmsav.cpp.

void MMSAV::setContrast ( int  count  ) 

Sets the contrast if video output is done.

Parameters:
count [in] amount of contrast
See also:
MMSAV::contrastUp()

MMSAV::contrastDown()

Definition at line 1683 of file mmsav.cpp.

void MMSAV::contrastUp ( int  count  ) 

Increases the contrast if video output is done.

Parameters:
count [in] amount of contrast to increase
See also:
MMSAV::setContrast()

MMSAV::contrastDown()

Definition at line 1713 of file mmsav.cpp.

void MMSAV::contrastDown ( int  count  ) 

Decreases the contrast if video output is done.

Parameters:
count [in] amount of contrast to decrease
See also:
MMSAV::setContrast()

MMSAV::contrastUp()

Definition at line 1745 of file mmsav.cpp.

void MMSAV::setSaturation ( int  count  ) 

Sets the saturation if video output is done.

Parameters:
count [in] amount of saturation
See also:
MMSAV::saturationUp()

MMSAV::saturationDown()

Definition at line 1777 of file mmsav.cpp.

void MMSAV::saturationUp ( int  count  ) 

Increases the saturation if video output is done.

Parameters:
count [in] amount of saturation to increase
See also:
MMSAV::setSaturation()

MMSAV::saturationDown()

Definition at line 1807 of file mmsav.cpp.

void MMSAV::saturationDown ( int  count  ) 

Decreases the saturation if video output is done.

Parameters:
count [in] amount of saturation to decrease
See also:
MMSAV::setSaturation()

MMSAV::saturationUp()

Definition at line 1839 of file mmsav.cpp.

void MMSAV::setHue ( int  count  ) 

Sets the hue if video output is done.

Parameters:
count [in] amount of hue
See also:
MMSAV::hueUp()

MMSAV::hueDown()

Definition at line 1871 of file mmsav.cpp.

void MMSAV::hueUp ( int  count  ) 

Increases the hue if video output is done.

Parameters:
count [in] amount of hue to increase
See also:
MMSAV::setHue()

MMSAV::hueDown()

Definition at line 1901 of file mmsav.cpp.

void MMSAV::hueDown ( int  count  ) 

Decreases the hue if video output is done.

Parameters:
count [in] amount of hue to decrease
See also:
MMSAV::setHue()

MMSAV::hueUp()

Definition at line 1933 of file mmsav.cpp.

void MMSAV::setVolume ( int  percent  ) 

Sets the volume of the audio output.

Parameters:
percent [in] volume in percent

Definition at line 1962 of file mmsav.cpp.

bool MMSAV::hasVideo (  ) 

Returns true if stream contains a video stream.

Returns:
true if video stream

Definition at line 2159 of file mmsav.cpp.

bool MMSAV::hasAudio (  ) 

Returns true if stream contains an audio stream.

Returns:
true if audio stream

Definition at line 2184 of file mmsav.cpp.


Member Data Documentation

sigc::connection MMSAV::onHandleInputConnection [private]

Definition at line 147 of file mmsav.h.

Definition at line 149 of file mmsav.h.

Definition at line 152 of file mmsav.h.

VODESC MMSAV::vodesc [private]

video output settings

Definition at line 157 of file mmsav.h.

visual structure for video output

Definition at line 158 of file mmsav.h.

raw_visual_t MMSAV::rawvisual [private]

Definition at line 160 of file mmsav.h.

pthread_mutex_t MMSAV::lock [private]

Definition at line 162 of file mmsav.h.

backend which is used to stream any sources

Definition at line 170 of file mmsav.h.

MMSWindow* MMSAV::window [protected]

window which displays the stream

Definition at line 173 of file mmsav.h.

surface of the window

Definition at line 176 of file mmsav.h.

bool MMSAV::verbose [protected]

should logging be verbose?

Definition at line 178 of file mmsav.h.

short MMSAV::status [protected]

current playback status

Definition at line 179 of file mmsav.h.

int MMSAV::pos [protected]

remember position where the stream stopped last time

Definition at line 180 of file mmsav.h.

string MMSAV::currentMRL [protected]

current mrl

Definition at line 189 of file mmsav.h.

xine_t* MMSAV::xine [protected]

global xine structure

Definition at line 195 of file mmsav.h.

xine_video_port_t* MMSAV::vo [protected]

xine video ports

Definition at line 196 of file mmsav.h.

xine_audio_port_t* MMSAV::ao [protected]

xine audio ports

Definition at line 197 of file mmsav.h.

xine_stream_t* MMSAV::stream [protected]

xine stream

Definition at line 198 of file mmsav.h.

xine_event_queue_t* MMSAV::queue [protected]

xine event queue

Definition at line 199 of file mmsav.h.

map<string, xine_post_t*> MMSAV::audioPostPlugins [protected]

map of registered audio post plugins

Definition at line 200 of file mmsav.h.

map<string, xine_post_t*> MMSAV::videoPostPlugins [protected]

map of registered video post plugins

Definition at line 200 of file mmsav.h.

const unsigned short MMSAV::STATUS_NONE = 0 [static]

status not set

Definition at line 228 of file mmsav.h.

const unsigned short MMSAV::STATUS_PLAYING = 1 [static]

stream is being played

Definition at line 229 of file mmsav.h.

const unsigned short MMSAV::STATUS_PAUSED = 2 [static]

stream is being paused

Definition at line 230 of file mmsav.h.

const unsigned short MMSAV::STATUS_STOPPED = 3 [static]

stream was stopped

Definition at line 231 of file mmsav.h.

const unsigned short MMSAV::STATUS_REWIND = 4 [static]

stream is being rewinded

Definition at line 232 of file mmsav.h.

const unsigned short MMSAV::STATUS_FFWD = 5 [static]

stream is being fast forwarded (2x)

Definition at line 233 of file mmsav.h.

const unsigned short MMSAV::STATUS_FFWD2 = 6 [static]

stream is being fast forwarded (4x)

Definition at line 234 of file mmsav.h.

const unsigned short MMSAV::STATUS_SLOW = 7 [static]

stream is being played slowly (2x)

Definition at line 235 of file mmsav.h.

const unsigned short MMSAV::STATUS_SLOW2 = 8 [static]

stream is being played slowly (4x)

Definition at line 236 of file mmsav.h.

sigc::signal<void, string>* MMSAV::onError

Callback that is used to receive errors.

Definition at line 284 of file mmsav.h.

sigc::signal<void, const unsigned short, const unsigned short>* MMSAV::onStatusChange

Callback that is used to receive status changes.

Definition at line 288 of file mmsav.h.


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