This documentation is automatically generated from the openFrameworks source code using doxygen and refers to the most recent release, version 0.12.0.
#include <ofDirectShowPlayer.h>

Public Member Functions | |
ofDirectShowPlayer () | |
ofDirectShowPlayer (const ofDirectShowPlayer &)=delete | |
ofDirectShowPlayer & | operator= (const ofDirectShowPlayer &)=delete |
ofDirectShowPlayer (ofDirectShowPlayer &&) | |
ofDirectShowPlayer & | operator= (ofDirectShowPlayer &&) |
bool | load (std::string path) |
Load a video resource by name. | |
void | update () |
Update the object's state. | |
void | close () |
Close the video source. | |
void | play () |
Play the video from the current playhead position. | |
void | stop () |
Pause and reset the playhead position to the first frame. | |
bool | isFrameNew () const |
const ofPixels & | getPixels () const |
Get a const reference to the underlying ofPixels. | |
ofPixels & | getPixels () |
Get a reference to the underlying ofPixels. | |
float | getWidth () const |
Get the width in pixels of the loaded video. | |
float | getHeight () const |
Get the height in pixels of the loaded video. | |
bool | isPaused () const |
Returns true if the video is paused. | |
bool | isLoaded () const |
Returns true if a video is loaded. | |
bool | isPlaying () const |
Returns true if the loaded video is playing. | |
bool | setPixelFormat (ofPixelFormat pixelFormat) |
Set the requested ofPixelFormat. | |
ofPixelFormat | getPixelFormat () const |
float | getPosition () const |
Get the current playhead position of the loaded video. | |
float | getSpeed () const |
Get the playback speed of the video player. | |
float | getDuration () const |
Get the duration of the loaded video in seconds. | |
bool | getIsMovieDone () const |
Returns true if the loaded video has finished playing. | |
void | setPaused (bool bPause) |
Set the paused state of the video. | |
void | setPosition (float pct) |
Set the position of the playhead. | |
void | setVolume (float volume) |
Set the volume of the video player. | |
void | setLoopState (ofLoopType state) |
Set the video loop state. | |
void | setSpeed (float speed) |
Set the video playback speed. | |
void | setFrame (int frame) |
Set the current frame by frame number. | |
int | getCurrentFrame () const |
Get the current playhead position as a frame number. | |
int | getTotalNumFrames () const |
Get the total number of frames in the currently loaded video. | |
ofLoopType | getLoopState () const |
Get the current loop state of the video. | |
void | firstFrame () |
Set the playhead position to the first frame. | |
void | nextFrame () |
Advance the playhead forward one frame. | |
void | previousFrame () |
Advance the playhead backward one frame. | |
![]() | |
virtual | ~ofBaseVideoPlayer () |
Destroys the ofBaseVideoPlayer. | |
virtual void | loadAsync (std::string name) |
Asynchronously load a video resource by name. | |
virtual ofTexture * | getTexturePtr () |
Get a pointer to the video texture used internally if it exists. | |
virtual bool | isInitialized () const |
Returns true if a video is loaded. | |
![]() | |
virtual | ~ofBaseVideo () |
Destroy the ofBaseVideo. | |
![]() | |
virtual | ~ofBaseHasPixels_ () |
Destroy the ofAbstractHasPixels. | |
![]() | |
virtual | ~ofAbstractHasPixels () |
Destroy the ofAbstractHasPixels. | |
![]() | |
virtual | ~ofBaseUpdates () |
Destroy the ofBaseUpdates. | |
Protected Attributes | |
std::shared_ptr< DirectShowVideo > | player |
ofPixelFormat | pixelFormat |
Constructor & Destructor Documentation
◆ ofDirectShowPlayer() [1/3]
ofDirectShowPlayer::ofDirectShowPlayer | ( | ) |
◆ ofDirectShowPlayer() [2/3]
|
delete |
◆ ofDirectShowPlayer() [3/3]
ofDirectShowPlayer::ofDirectShowPlayer | ( | ofDirectShowPlayer && | other | ) |
Member Function Documentation
◆ close()
|
virtual |
Close the video source.
Implements ofBaseVideo.
◆ firstFrame()
|
virtual |
Set the playhead position to the first frame.
This is functionally equivalent to setFrame(0) or setPosition(0.0).
Reimplemented from ofBaseVideoPlayer.
◆ getCurrentFrame()
|
virtual |
Get the current playhead position as a frame number.
- Returns
- The current playhead position as a frame number.
Reimplemented from ofBaseVideoPlayer.
◆ getDuration()
|
virtual |
Get the duration of the loaded video in seconds.
- Returns
- The duration of the loaded video in seconds.
Reimplemented from ofBaseVideoPlayer.
◆ getHeight()
|
virtual |
Get the height in pixels of the loaded video.
- Returns
- The height in pixels of the loaded video or 0 if none is loaded.
Implements ofBaseVideoPlayer.
◆ getIsMovieDone()
|
virtual |
Returns true if the loaded video has finished playing.
- Returns
- True if the loaded video has finished playing.
Reimplemented from ofBaseVideoPlayer.
◆ getLoopState()
|
virtual |
◆ getPixelFormat()
|
virtual |
- Returns
- the current ofPixelFormat.
Implements ofBaseVideo.
◆ getPixels() [1/2]
|
virtual |
Get a reference to the underlying ofPixels.
- Returns
- a reference the underlying ofPixels.
Implements ofBaseHasPixels_< unsigned char >.
◆ getPixels() [2/2]
|
virtual |
Get a const reference to the underlying ofPixels.
- Returns
- a const reference the underlying ofPixels.
Implements ofBaseHasPixels_< unsigned char >.
◆ getPosition()
|
virtual |
Get the current playhead position of the loaded video.
This value is a normalized floating point value between 0.0 and 1.0 that represents the position of the playhead. 0.0 maps to the first frame of the loaded video and 1.0 maps to the last frame of the loaded video.
- Returns
- A value between 0.0 and 1.0 representing playhead position.
Reimplemented from ofBaseVideoPlayer.
◆ getSpeed()
|
virtual |
Get the playback speed of the video player.
When the loop state is OF_LOOP_NONE or OF_LOOP_NORMAL, positive speed will scale a forward playback rate while a negative speed will scale a a backward playback rate. When the loop state is OF_LOOP_PALINDROME, the direction of playback will change each loop, but the playback rate will still be scaled by the absolute value of the speed.
- Returns
- The playback speed of the video player.
Reimplemented from ofBaseVideoPlayer.
◆ getTotalNumFrames()
|
virtual |
Get the total number of frames in the currently loaded video.
- Returns
- The total number of frames in the currently loaded video.
Reimplemented from ofBaseVideoPlayer.
◆ getWidth()
|
virtual |
Get the width in pixels of the loaded video.
- Returns
- The width in pixels of the loaded video or 0 if none is loaded.
Implements ofBaseVideoPlayer.
◆ isFrameNew()
|
virtual |
- Returns
- true if the pixel data was updated since the last call to update().
Implements ofBaseVideo.
◆ isLoaded()
|
virtual |
Returns true if a video is loaded.
This is helpful when loading a video with loadAsync(). This is also an alias of isInitialized().
- See also
- loadAsync()
- Returns
- True if a video is loaded.
Implements ofBaseVideoPlayer.
◆ isPaused()
|
virtual |
Returns true if the video is paused.
- Returns
- True if the video is paused.
Implements ofBaseVideoPlayer.
◆ isPlaying()
|
virtual |
Returns true if the loaded video is playing.
- Returns
- True if the loaded video is playing.
Implements ofBaseVideoPlayer.
◆ load()
|
virtual |
Load a video resource by name.
The list of supported video types and sources (e.g. rtsp:// sources) is implementation dependent.
- Parameters
-
name The name of the video resource to load.
- Returns
- True if the video was loaded successfully.
- See also
- loadAsync()
Implements ofBaseVideoPlayer.
◆ nextFrame()
|
virtual |
Advance the playhead forward one frame.
This allows the user to advance through the video manually one frame at a time without calling play().
Reimplemented from ofBaseVideoPlayer.
◆ operator=() [1/2]
|
delete |
◆ operator=() [2/2]
ofDirectShowPlayer & ofDirectShowPlayer::operator= | ( | ofDirectShowPlayer && | other | ) |
◆ play()
|
virtual |
Play the video from the current playhead position.
- See also
- getPosition()
- setPostion()
Implements ofBaseVideoPlayer.
◆ previousFrame()
|
virtual |
Advance the playhead backward one frame.
This allows the user to advance backward through the video manually one frame at a time without calling play().
Reimplemented from ofBaseVideoPlayer.
◆ setFrame()
|
virtual |
Set the current frame by frame number.
Similar to setPosition(), but accepts a frame number instead of a normalized floating point value. Frame count begins with the first frame as 0 and the last frame as getTotalNumFrames() - 1.
- Parameters
-
frame The frame number to set the new playhead to.
Reimplemented from ofBaseVideoPlayer.
◆ setLoopState()
|
virtual |
Set the video loop state.
- Parameters
-
state The loop state of the video.
- See also
- ofLoopType
Reimplemented from ofBaseVideoPlayer.
◆ setPaused()
|
virtual |
Set the paused state of the video.
- Parameters
-
bPause True to pause the video, false to play.
Reimplemented from ofBaseVideoPlayer.
◆ setPixelFormat()
|
virtual |
Set the requested ofPixelFormat.
- Parameters
-
pixelFormat the requested ofPixelFormat.
- Returns
- true if the format was successfully changed.
Implements ofBaseVideo.
◆ setPosition()
|
virtual |
Set the position of the playhead.
This value is a normalized floating point value between 0.0 and 1.0 that represents the position of the playhead. 0.0 maps to the first frame of the loaded video and 1.0 maps to the last frame of the loaded video.
- Parameters
-
pct A value between 0.0 and 1.0 representing playhead position.
Reimplemented from ofBaseVideoPlayer.
◆ setSpeed()
|
virtual |
Set the video playback speed.
When the loop state is OF_LOOP_NONE or OF_LOOP_NORMAL, positive speed will scale a forward playback rate while a negative speed will scale a a backward playback rate. When the loop state is OF_LOOP_PALINDROME, the direction of playback will change each loop, but the playback rate will still be scaled by the absolute value of the speed.
To play a video forward at normal speed, set the loop state to OF_LOOP_NONE or OF_LOOP_NORMAL and a speed of 1.0. To double the playback rate, set the speed to 2.0. To play a video backward, set the speed to a negative number. A speed 0.25 will play the video at 1/4 the the normal rate and a rate of 0.0 will effectively stop playback.
- Parameters
-
speed The desired playback speed of the video.
Reimplemented from ofBaseVideoPlayer.
◆ setVolume()
|
virtual |
Set the volume of the video player.
This value is a normalized floating point value between 0.0 and 1.0 that represents the video player volume. 0.0 maps to silence and 1.0 maps to maximum volume.
- Parameters
-
volume A value between 0.0 and 1.0 representing volume.
Reimplemented from ofBaseVideoPlayer.
◆ stop()
|
virtual |
Pause and reset the playhead position to the first frame.
Implements ofBaseVideoPlayer.
◆ update()
|
virtual |
Update the object's state.
Implements ofBaseUpdates.
Member Data Documentation
◆ pixelFormat
|
protected |
◆ player
|
protected |
The documentation for this class was generated from the following files:
- /Users/icq4ever/Desktop/oF0120/libs/openFrameworks/video/ofDirectShowPlayer.h
- /Users/icq4ever/Desktop/oF0120/libs/openFrameworks/video/ofDirectShowPlayer.cpp