Plays an MPEG-1 video.
More...
#include <Video.hpp>
|
| Video () |
| Constructor.
|
|
| ~Video () |
| Destructor.
|
|
bool | load (const std::string &file) |
| Load a MPEG-1 from video file.
|
|
void | build () |
| Build opengl data.
|
|
void | update () |
| Update video decoder.
|
|
void | render () |
| Render video.
|
|
bool | is_finished () const |
| Check if video is finished.
|
|
double | get_time () const |
| Get current playtime.
|
|
double | get_framerate () const |
| Get video framerate.
|
|
int | get_samplerate () const |
| Get video sample rate.
|
|
double | get_duration () const |
| Get video duration.
|
|
|
unsigned int | create_texture (unsigned int index, const char *uniform) |
| Internal function to generate video frame texture.
|
|
void | update_texture (unsigned int unit, unsigned int texture, const plm_plane_t *plane) |
| Internal function to update video frame data.
|
|
Plays an MPEG-1 video.
No audio support yet.
Definition at line 26 of file Video.hpp.
◆ Video()
galaxy::media::Video::Video |
( |
| ) |
|
◆ ~Video()
galaxy::media::Video::~Video |
( |
| ) |
|
◆ load()
bool galaxy::media::Video::load |
( |
const std::string & | file | ) |
|
|
nodiscard |
Load a MPEG-1 from video file.
- Parameters
-
- Returns
- True if successful.
Definition at line 101 of file Video.cpp.
◆ build()
void galaxy::media::Video::build |
( |
| ) |
|
Build opengl data.
Definition at line 178 of file Video.cpp.
◆ update()
void galaxy::media::Video::update |
( |
| ) |
|
Update video decoder.
Definition at line 199 of file Video.cpp.
◆ render()
void galaxy::media::Video::render |
( |
| ) |
|
◆ is_finished()
bool galaxy::media::Video::is_finished |
( |
| ) |
const |
|
nodiscard |
Check if video is finished.
- Returns
- True if finished.
Definition at line 221 of file Video.cpp.
◆ get_time()
double galaxy::media::Video::get_time |
( |
| ) |
const |
|
nodiscard |
Get current playtime.
- Returns
- In seconds.
Definition at line 231 of file Video.cpp.
◆ get_framerate()
double galaxy::media::Video::get_framerate |
( |
| ) |
const |
|
nodiscard |
Get video framerate.
- Returns
- Double.
Definition at line 241 of file Video.cpp.
◆ get_samplerate()
int galaxy::media::Video::get_samplerate |
( |
| ) |
const |
|
nodiscard |
Get video sample rate.
- Returns
- Int.
Definition at line 251 of file Video.cpp.
◆ get_duration()
double galaxy::media::Video::get_duration |
( |
| ) |
const |
|
nodiscard |
Get video duration.
- Returns
- Double.
Definition at line 261 of file Video.cpp.
◆ create_texture()
unsigned int galaxy::media::Video::create_texture |
( |
unsigned int | index, |
|
|
const char * | uniform ) |
|
private |
Internal function to generate video frame texture.
- Parameters
-
index | Sampler index. |
uniform | Shader uniform index. |
- Returns
- Returns created texture id from OpenGL.
Definition at line 271 of file Video.cpp.
◆ update_texture()
void galaxy::media::Video::update_texture |
( |
unsigned int | unit, |
|
|
unsigned int | texture, |
|
|
const plm_plane_t * | plane ) |
|
private |
Internal function to update video frame data.
- Parameters
-
unit | Texture unit. |
texture | GL texture handle. |
plane | PLM decoder data. |
Definition at line 292 of file Video.cpp.
◆ m_plm
plm_t* galaxy::media::Video::m_plm |
|
private |
◆ m_audio
ma_device* galaxy::media::Video::m_audio |
|
private |
◆ m_buffer
meta::vector<uint8_t> galaxy::media::Video::m_buffer |
|
private |
◆ m_audio_buffer
std::unique_ptr<RingBuffer> galaxy::media::Video::m_audio_buffer |
|
private |
Buffer for audio decoding.
Definition at line 143 of file Video.hpp.
◆ m_texture_y
unsigned int galaxy::media::Video::m_texture_y |
|
private |
PLM video frame y.
Definition at line 148 of file Video.hpp.
◆ m_texture_cb
unsigned int galaxy::media::Video::m_texture_cb |
|
private |
PLM video frame cb.
Definition at line 153 of file Video.hpp.
◆ m_texture_cr
unsigned int galaxy::media::Video::m_texture_cr |
|
private |
PLM video frame cr.
Definition at line 158 of file Video.hpp.
◆ m_vao
unsigned int galaxy::media::Video::m_vao |
|
private |
PLM video frame vertex array object.
Definition at line 163 of file Video.hpp.
◆ m_vbo
unsigned int galaxy::media::Video::m_vbo |
|
private |
PLM video frame vertex buffer.
Definition at line 168 of file Video.hpp.
◆ m_ibo
unsigned int galaxy::media::Video::m_ibo |
|
private |
PLM video frame index buffer.
Definition at line 173 of file Video.hpp.
◆ m_shader
The documentation for this class was generated from the following files: