qTox  Version: nightly | Commit: bc751c8e1cac455f9690654fcfe0f560d2d7dfdd
Public Member Functions | Public Attributes | List of all members
ToxYUVFrame Struct Reference

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>

Collaboration diagram for ToxYUVFrame:
Collaboration graph

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
 

Detailed Description

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.

Member Function Documentation

◆ isValid()

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.

Returns
true if the frame is valid, false otherwise.

Definition at line 779 of file videoframe.cpp.

◆ operator bool()

ToxYUVFrame::operator bool ( ) const
explicit

Checks if the given ToxYUVFrame is valid or not, delegates to isValid().

Definition at line 787 of file videoframe.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ height

const std::uint16_t ToxYUVFrame::height

Definition at line 48 of file videoframe.h.

◆ u

const uint8_t* ToxYUVFrame::u

Definition at line 51 of file videoframe.h.

◆ v

const uint8_t* ToxYUVFrame::v

Definition at line 52 of file videoframe.h.

◆ width

const std::uint16_t ToxYUVFrame::width

Definition at line 47 of file videoframe.h.

◆ y

const uint8_t* ToxYUVFrame::y

Definition at line 50 of file videoframe.h.


The documentation for this struct was generated from the following files: