qTox
Version: nightly | Commit: bc751c8e1cac455f9690654fcfe0f560d2d7dfdd
|
A simple structure to represent a ToxYUV video frame (corresponds to a frame encoded under format: AV_PIX_FMT_YUV420P [FFmpeg] or VPX_IMG_FMT_I420 [WebM]). More...
#include <videoframe.h>
Public Member Functions | |
bool | isValid () const |
Returns whether the given ToxYUVFrame represents a valid frame or not. More... | |
operator bool () const | |
Checks if the given ToxYUVFrame is valid or not, delegates to isValid(). More... | |
Public Attributes | |
const std::uint16_t | width |
const std::uint16_t | height |
const uint8_t * | y |
const uint8_t * | u |
const uint8_t * | v |
A simple structure to represent a ToxYUV video frame (corresponds to a frame encoded under format: AV_PIX_FMT_YUV420P [FFmpeg] or VPX_IMG_FMT_I420 [WebM]).
This structure exists for convenience and code clarity when ferrying YUV420 frames from one source to another. The buffers pointed to by the struct should not be owned by the struct nor should they be freed from the struct, instead this struct functions only as a simple alias to a more complicated frame container like AVFrame.
The creation of this structure was done to replace existing code which mis-used vpx_image structs when passing frame data to toxcore.
Definition at line 41 of file videoframe.h.
bool ToxYUVFrame::isValid | ( | ) | const |
Returns whether the given ToxYUVFrame represents a valid frame or not.
Valid frames are frames in which both width and height are greater than zero.
Definition at line 779 of file videoframe.cpp.
|
explicit |
Checks if the given ToxYUVFrame is valid or not, delegates to isValid().
Definition at line 787 of file videoframe.cpp.
const std::uint16_t ToxYUVFrame::height |
Definition at line 48 of file videoframe.h.
const uint8_t* ToxYUVFrame::u |
Definition at line 51 of file videoframe.h.
const uint8_t* ToxYUVFrame::v |
Definition at line 52 of file videoframe.h.
const std::uint16_t ToxYUVFrame::width |
Definition at line 47 of file videoframe.h.
const uint8_t* ToxYUVFrame::y |
Definition at line 50 of file videoframe.h.