sbBaseMediacorePlaybackControl Class Reference

#include <sbBaseMediacorePlaybackControl.h>

Inheritance diagram for sbBaseMediacorePlaybackControl:
[legend]
Collaboration diagram for sbBaseMediacorePlaybackControl:
[legend]

Public Member Functions

NS_DECL_ISUPPORTS
NS_DECL_SBIMEDIACOREPLAYBACKCONTROL 
sbBaseMediacorePlaybackControl ()
 
nsresult InitBaseMediacorePlaybackControl ()
 
virtual nsresult OnInitBaseMediacorePlaybackControl ()
 
virtual nsresult OnSetUri (nsIURI *aURI)
 
virtual nsresult OnGetDuration (PRUint64 *aPosition)
 
virtual nsresult OnGetPosition (PRUint64 *aPosition)
 
virtual nsresult OnSetPosition (PRUint64 aPosition)
 
virtual nsresult OnGetIsPlayingAudio (PRBool *aIsPlayingAudio)
 
virtual nsresult OnGetIsPlayingVideo (PRBool *aIsPlayingVideo)
 
virtual nsresult OnPlay ()
 
virtual nsresult OnPause ()
 
virtual nsresult OnStop ()
 
virtual nsresult OnSeek (PRUint64 aPosition, PRUint32 aFlags)
 
- Public Member Functions inherited from sbIMediacorePlaybackControl
void play ()
 
void pause ()
 
void stop ()
 
void seek (in unsigned long long position, in unsigned long flags)
 
- Public Member Functions inherited from sbIMediacoreEventTarget
void addListener (in sbIMediacoreEventListener aListener)
 
void removeListener (in sbIMediacoreEventListener aListener)
 
boolean dispatchEvent (in sbIMediacoreEvent aEvent, [optional] in boolean aAsync)
 

Protected Member Functions

virtual ~sbBaseMediacorePlaybackControl ()
 
nsresult DispatchPlaybackControlEvent (PRUint32 aType)
 

Protected Attributes

PRMonitor * mMonitor
 
nsCOMPtr< nsIURI > mUri
 
PRUint64 mPosition
 
PRUint64 mDuration
 

Additional Inherited Members

- Public Attributes inherited from sbIMediacorePlaybackControl
attribute nsIURI uri
 
attribute unsigned long long position
 
readonly attribute unsigned
long long 
duration
 
readonly attribute boolean isPlayingAudio
 
readonly attribute boolean isPlayingVideo
 
const unsigned long SEEK_FLAG_NORMAL = 0
 
const unsigned long SEEK_FLAG_KEYFRAME = 1
 

Detailed Description

Definition at line 43 of file sbBaseMediacorePlaybackControl.h.

Constructor & Destructor Documentation

NS_DECL_ISUPPORTS NS_DECL_SBIMEDIACOREPLAYBACKCONTROL sbBaseMediacorePlaybackControl::sbBaseMediacorePlaybackControl ( )
sbBaseMediacorePlaybackControl::~sbBaseMediacorePlaybackControl ( )
protectedvirtual

Definition at line 74 of file sbBaseMediacorePlaybackControl.cpp.

Member Function Documentation

nsresult sbBaseMediacorePlaybackControl::DispatchPlaybackControlEvent ( PRUint32  aType)
protected

Definition at line 427 of file sbBaseMediacorePlaybackControl.cpp.

Here is the call graph for this function:

nsresult sbBaseMediacorePlaybackControl::InitBaseMediacorePlaybackControl ( )

Definition at line 86 of file sbBaseMediacorePlaybackControl.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult sbBaseMediacorePlaybackControl::OnGetDuration ( PRUint64 *  aPosition)
virtual

This is where you'll want to get the current duration (in milliseconds).

Reimplemented in sbGStreamerMediacore, and sbMediacoreWrapper.

Definition at line 292 of file sbBaseMediacorePlaybackControl.cpp.

nsresult sbBaseMediacorePlaybackControl::OnGetIsPlayingAudio ( PRBool *  aIsPlayingAudio)
virtual

This is where you'll want to report on whether you're playing audio.

Reimplemented in sbGStreamerMediacore, and sbMediacoreWrapper.

Definition at line 323 of file sbBaseMediacorePlaybackControl.cpp.

nsresult sbBaseMediacorePlaybackControl::OnGetIsPlayingVideo ( PRBool *  aIsPlayingVideo)
virtual

This is where you'll want to report on whether you're playing video.

Reimplemented in sbGStreamerMediacore, and sbMediacoreWrapper.

Definition at line 333 of file sbBaseMediacorePlaybackControl.cpp.

nsresult sbBaseMediacorePlaybackControl::OnGetPosition ( PRUint64 *  aPosition)
virtual

This is where you'll want to get the current position (in milliseconds).

Reimplemented in sbGStreamerMediacore, and sbMediacoreWrapper.

Definition at line 302 of file sbBaseMediacorePlaybackControl.cpp.

nsresult sbBaseMediacorePlaybackControl::OnInitBaseMediacorePlaybackControl ( )
virtual

You'll probably want to initialize the playback mechanism for your mediacore implementation here.

Reimplemented in sbGStreamerMediacore, and sbMediacoreWrapper.

Definition at line 269 of file sbBaseMediacorePlaybackControl.cpp.

Here is the caller graph for this function:

nsresult sbBaseMediacorePlaybackControl::OnPause ( )
virtual

This is where you will actually want to pause playback for the current source.

This method is called with the lock protecting base class data locked. It is safe to get and set position and duration at this time.

You are responsible for firing any error events for errors that occur.

You are also responsible for firing any success events.

See sbIMediacoreEvent for more information.

Reimplemented in sbGStreamerMediacore, and sbMediacoreWrapper.

Definition at line 363 of file sbBaseMediacorePlaybackControl.cpp.

nsresult sbBaseMediacorePlaybackControl::OnPlay ( )
virtual

This is where you will actually want to start playing back the current source.

This method is called with the lock protecting base class data locked. It is safe to get and set position and duration at this time.

You are responsible for firing any error events for errors that occur.

You are also responsible for firing any success events.

See sbIMediacoreEvent for more information.

Reimplemented in sbGStreamerMediacore, and sbMediacoreWrapper.

Definition at line 343 of file sbBaseMediacorePlaybackControl.cpp.

nsresult sbBaseMediacorePlaybackControl::OnSeek ( PRUint64  aPosition,
PRUint32  aFlags 
)
virtual

This is where you'll want to seek to aPosition in the currently set source. The position is in milliseconds. The flags map to sbIMediacorePlaybackControl.SEEK_FLAG_*

Typically, the case where the flag is SEEK_FLAG_NORMAL will be the same codepath as OnSetPosition().

If let unimplemented, this will just default to being the same as if the user has set the position attribute.

Reimplemented in sbGStreamerMediacore, and sbMediacoreWrapper.

Definition at line 409 of file sbBaseMediacorePlaybackControl.cpp.

Here is the call graph for this function:

nsresult sbBaseMediacorePlaybackControl::OnSetPosition ( PRUint64  aPosition)
virtual

This is where you'll want to seek to aPosition in the currently set source. The position is in milliseconds.

Reimplemented in sbGStreamerMediacore, and sbMediacoreWrapper.

Definition at line 312 of file sbBaseMediacorePlaybackControl.cpp.

Here is the caller graph for this function:

nsresult sbBaseMediacorePlaybackControl::OnSetUri ( nsIURI *  aURI)
virtual

This is where you'll probably want to set the source for playback.

The uri is cached in mUri if this method succeeds.

Reimplemented in sbGStreamerMediacore, and sbMediacoreWrapper.

Definition at line 280 of file sbBaseMediacorePlaybackControl.cpp.

nsresult sbBaseMediacorePlaybackControl::OnStop ( )
virtual

This is where you will actually want to stop playback for the current source.

This method is called with the lock protecting base class data locked. It is safe to get and set position and duration at this time.

You are responsible for firing any error events for errors that occur.

You are also responsible for firing any success events.

You are not responsible for the STREAM_BEFORE_STOP event.

Upon stopping, you are responsible for rewinding / setting the position to the beginning. Yes, you should also fire an event after you've reset the position :)

See sbIMediacoreEvent for more information.

Reimplemented in sbGStreamerMediacore, and sbMediacoreWrapper.

Definition at line 383 of file sbBaseMediacorePlaybackControl.cpp.

Member Data Documentation

PRUint64 sbBaseMediacorePlaybackControl::mDuration
protected

Definition at line 90 of file sbBaseMediacorePlaybackControl.h.

PRMonitor* sbBaseMediacorePlaybackControl::mMonitor
protected

Definition at line 83 of file sbBaseMediacorePlaybackControl.h.

PRUint64 sbBaseMediacorePlaybackControl::mPosition
protected

Definition at line 88 of file sbBaseMediacorePlaybackControl.h.

nsCOMPtr<nsIURI> sbBaseMediacorePlaybackControl::mUri
protected

Definition at line 85 of file sbBaseMediacorePlaybackControl.h.


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