161 bool seek(
double a_time);
Implements a 2D image data structure.
Implements support for mutex objects.
Implements a high precision clock.
This class implements a 2D image data structure.
Definition CImage.h:84
This class implements a mutex.
Definition CMutex.h:86
This class implements a high precision clock.
Definition CPrecisionClock.h:86
This class implements support for video files of the OGG/Vorbis format.
Definition CVideo.h:85
double m_fps
Frame per seconds of the current video.
Definition CVideo.h:260
void * m_clip
Video clip object.
Definition CVideo.h:266
bool seekFrame(unsigned int a_index)
This method seeks a particular frame in the video.
Definition CVideo.cpp:435
bool getFrame(int a_index, cImage &a_image)
This method returns a copy of any frame.
Definition CVideo.cpp:675
void pause()
This method pauses the video.
Definition CVideo.cpp:315
static void * m_manager
Shared video manager.
Definition CVideo.h:278
std::string getFilename() const
This method returns the filename from which this video was last loaded or saved.
Definition CVideo.h:195
void reset()
This method reset the video to the first frame and make it ready to play again.
Definition CVideo.cpp:365
bool update()
This method updates the frame index and pointer to the current time.
Definition CVideo.cpp:466
static cMutex m_sharedLock
Shared members lock.
Definition CVideo.h:275
virtual ~cVideo()
Destructor of cVideo.
Definition CVideo.cpp:102
cVideoPtr copy()
This method creates a copy of this object.
Definition CVideo.cpp:524
void storeFrame(void *frame)
This method stores a frame locally (and flip horizontally).
Definition CVideo.cpp:710
cVideo()
Default constructor of cVideo.
Definition CVideo.cpp:71
double getDuration() const
This method returns the duration of this video in seconds.
Definition CVideo.h:127
void setAutoReplay(bool a_replay=true)
This method enables or disables the auto-replay mode.
Definition CVideo.cpp:349
static void * m_audio
Interface to audio control.
Definition CVideo.h:281
void setPlaybackSpeed(double a_speed)
This method control playback speed.
Definition CVideo.cpp:278
unsigned int m_frameIndex
Current frame index of the current video.
Definition CVideo.h:245
bool getCurrentFrame(cImage &a_image)
This method returns a copy of the current frame.
Definition CVideo.cpp:606
int getCurrentFrameIndex()
This method returns the index number of the current video frame.
Definition CVideo.h:167
void stop()
This method stops the video.
Definition CVideo.cpp:332
bool isInitialized() const
This method returns true if a video file has been loaded in memory, false otherwise.
Definition CVideo.h:115
void erase()
This method frees video from memory.
Definition CVideo.h:112
bool isPaused()
This method returns the video playing status.
Definition CVideo.cpp:396
void play()
This method starts playing the video.
Definition CVideo.cpp:261
void defaults()
This method initializes member variables.
Definition CVideo.cpp:138
static cVideoPtr create()
Shared cVideo allocator.
Definition CVideo.h:99
std::string m_filename
Video filename.
Definition CVideo.h:230
bool m_autoReplay
Auto replay flag.
Definition CVideo.h:257
bool m_firstFrame
First frame flag.
Definition CVideo.h:254
double m_duration
Duration in seconds of the current video.
Definition CVideo.h:248
unsigned int m_frameCount
Frame count of the current video.
Definition CVideo.h:242
unsigned int getHeight() const
This method returns the height of video image.
Definition CVideo.h:121
void cleanup()
This method deletes memory and removes any video that was previously loaded.
Definition CVideo.cpp:171
std::string getName() const
This method returns the video title.
Definition CVideo.h:198
bool getCurrentFramePointer(cImage &a_image)
This method returns a pointer to the current frame (does not allocate a copy).
Definition CVideo.cpp:576
unsigned int getFrameCount() const
This method returns the number of frames of this video stream.
Definition CVideo.h:124
double getPlaybackSpeed()
This method retrieves playback speed.
Definition CVideo.cpp:296
unsigned int m_width
Width in pixels of the current video.
Definition CVideo.h:236
double getCurrentTimePosition()
This method returns the time position of the current video frame.
Definition CVideo.cpp:558
std::string m_name
Video name.
Definition CVideo.h:233
double m_lastUpdate
Last time the frame index was updated.
Definition CVideo.h:251
bool seek(double a_time)
This method seeks a particular time in the video.
Definition CVideo.cpp:419
unsigned char * m_data
Video frame data.
Definition CVideo.h:269
bool getFramePointer(int a_index, cImage &a_image)
This method returns a pointer to any frame (does not allocate a copy).
Definition CVideo.cpp:646
bool loadFromFile(const std::string &a_filename)
This method loads the video file by passing image path and name as argument.
Definition CVideo.cpp:204
static unsigned int m_clipCount
Shared clip counter.
Definition CVideo.h:272
cPrecisionClock m_clock
Video manager time base.
Definition CVideo.h:263
unsigned int m_height
Height in pixels of the current video.
Definition CVideo.h:239
double getFPS() const
This method returns the rate of this video in frames per second.
Definition CVideo.h:130
unsigned int getWidth() const
This method returns the width of video image.
Definition CVideo.h:118
Definition CAudioBuffer.cpp:57
std::shared_ptr< cVideo > cVideoPtr
Definition CVideo.h:68