68 typedef std::shared_ptr<cVideo>
cVideoPtr;
99 static cVideoPtr
create() {
return (std::make_shared<cVideo>()); }
161 bool seek(
double a_time);
This class implements support for video files of the OGG/Vorbis format.
Definition: CVideo.h:84
static cMutex m_sharedLock
Shared members lock.
Definition: CVideo.h:275
double m_lastUpdate
Last time the frame index was updated.
Definition: CVideo.h:251
Implements a high precision clock.
bool loadFromFile(const std::string &a_filename)
This method loads the video file by passing image path and name as argument.
Definition: CVideo.cpp:202
void * m_clip
Video clip object.
Definition: CVideo.h:266
unsigned char * m_data
Video frame data.
Definition: CVideo.h:269
bool isInitialized() const
This method returns true if a video file has been loaded in memory, false otherwise.
Definition: CVideo.h:115
void storeFrame(void *frame)
This method stores a frame locally (and flip horizontally).
Definition: CVideo.cpp:708
unsigned int getHeight() const
This method returns the height of video image.
Definition: CVideo.h:121
bool m_firstFrame
First frame flag.
Definition: CVideo.h:254
unsigned int getWidth() const
This method returns the width of video image.
Definition: CVideo.h:118
static unsigned int m_clipCount
Shared clip counter.
Definition: CVideo.h:272
static void * m_audio
Interface to audio control.
Definition: CVideo.h:281
This class implements a high precision clock.
Definition: CPrecisionClock.h:85
unsigned int m_height
Height in pixels of the current video.
Definition: CVideo.h:239
virtual ~cVideo()
Destructor of cVideo.
Definition: CVideo.cpp:102
bool seekFrame(unsigned int a_index)
This method seeks a particular frame in the video.
Definition: CVideo.cpp:433
bool isPaused()
This method returns the video playing status.
Definition: CVideo.cpp:394
std::string m_filename
Video filename.
Definition: CVideo.h:230
double getCurrentTimePosition()
This method returns the time position of the current video frame.
Definition: CVideo.cpp:556
unsigned int m_frameIndex
Current frame index of the current video.
Definition: CVideo.h:245
void setPlaybackSpeed(double a_speed)
This method control playback speed.
Definition: CVideo.cpp:276
void setAutoReplay(bool a_replay=true)
This method enables or disables the auto-replay mode.
Definition: CVideo.cpp:347
static void * m_manager
Shared video manager.
Definition: CVideo.h:278
int getCurrentFrameIndex()
This method returns the index number of the current video frame.
Definition: CVideo.h:167
This class implements a mutex.
Definition: CMutex.h:85
bool seek(double a_time)
This method seeks a particular time in the video.
Definition: CVideo.cpp:417
std::shared_ptr< cVideo > cVideoPtr
Definition: CVideo.h:67
void erase()
This method frees video from memory.
Definition: CVideo.h:112
std::string m_name
Video name.
Definition: CVideo.h:233
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:363
unsigned int m_width
Width in pixels of the current video.
Definition: CVideo.h:236
cVideoPtr copy()
This method creates a copy of this object.
Definition: CVideo.cpp:522
double m_duration
Duration in seconds of the current video.
Definition: CVideo.h:248
bool getFramePointer(int a_index, cImage &a_image)
This method returns a pointer to any frame (does not allocate a copy).
Definition: CVideo.cpp:644
bool getCurrentFramePointer(cImage &a_image)
This method returns a pointer to the current frame (does not allocate a copy).
Definition: CVideo.cpp:574
std::string getName() const
This method returns the video title.
Definition: CVideo.h:198
bool getFrame(int a_index, cImage &a_image)
This method returns a copy of any frame.
Definition: CVideo.cpp:673
void play()
This method starts playing the video.
Definition: CVideo.cpp:259
double getPlaybackSpeed()
This method retrieves playback speed.
Definition: CVideo.cpp:294
bool update()
This method updates the frame index and pointer to the current time.
Definition: CVideo.cpp:464
cVideo()
Default constructor of cVideo.
Definition: CVideo.cpp:71
void defaults()
This method initializes member variables.
Definition: CVideo.cpp:136
static cVideoPtr create()
Shared cVideo allocator.
Definition: CVideo.h:99
bool m_autoReplay
Auto replay flag.
Definition: CVideo.h:257
bool getCurrentFrame(cImage &a_image)
This method returns a copy of the current frame.
Definition: CVideo.cpp:604
Definition: CAudioBuffer.cpp:56
double getFPS() const
This method returns the rate of this video in frames per second.
Definition: CVideo.h:130
cPrecisionClock m_clock
Video manager time base.
Definition: CVideo.h:263
double m_fps
Frame per seconds of the current video.
Definition: CVideo.h:260
void cleanup()
This method deletes memory and removes any video that was previously loaded.
Definition: CVideo.cpp:169
void pause()
This method pauses the video.
Definition: CVideo.cpp:313
Implements support for mutex objects.
Implements a 2D image data structure.
void stop()
This method stops the video.
Definition: CVideo.cpp:330
This class implements a 2D image data structure.
Definition: CImage.h:83
unsigned int m_frameCount
Frame count of the current video.
Definition: CVideo.h:242
double getDuration() const
This method returns the duration of this video in seconds.
Definition: CVideo.h:127
unsigned int getFrameCount() const
This method returns the number of frames of this video stream.
Definition: CVideo.h:124