Shaka Player Embedded
Classes | Public Member Functions | Public Attributes | List of all members
shaka::media::DecodedFrame Class Reference

#include <frames.h>

Inheritance diagram for shaka::media::DecodedFrame:
shaka::media::BaseFrame shaka::media::apple::AppleDecodedFrame shaka::media::ffmpeg::FFmpegDecodedFrame

Classes

class  Impl
 

Public Member Functions

 DecodedFrame (std::shared_ptr< const StreamInfo > stream_info, double pts, double dts, double duration, variant< PixelFormat, SampleFormat > format, size_t sample_count, const std::vector< const uint8_t *> &data, const std::vector< size_t > &linesize)
 
 ~DecodedFrame () override
 
size_t EstimateSize () const override
 
- Public Member Functions inherited from shaka::media::BaseFrame
 BaseFrame (std::shared_ptr< const StreamInfo > stream_info, double pts, double dts, double duration, bool is_key_frame)
 
virtual ~BaseFrame ()
 
 BaseFrame (const BaseFrame &)=delete
 
BaseFrameoperator= (const BaseFrame &)=delete
 
 BaseFrame (BaseFrame &&)=delete
 
BaseFrameoperator= (BaseFrame &&)=delete
 

Public Attributes

const size_t sample_count
 
const std::vector< const uint8_t * > data
 
const std::vector< size_t > linesize
 
const variant< PixelFormat, SampleFormatformat
 
- Public Attributes inherited from shaka::media::BaseFrame
const std::shared_ptr< const StreamInfostream_info
 
const double pts
 
const double dts
 
const double duration
 
const bool is_key_frame
 

Detailed Description

Defines a decoded frame.

Definition at line 283 of file frames.h.

Constructor & Destructor Documentation

§ DecodedFrame()

shaka::media::DecodedFrame::DecodedFrame ( std::shared_ptr< const StreamInfo stream_info,
double  pts,
double  dts,
double  duration,
variant< PixelFormat, SampleFormat format,
size_t  sample_count,
const std::vector< const uint8_t *> &  data,
const std::vector< size_t > &  linesize 
)

Definition at line 172 of file frames.cc.

§ ~DecodedFrame()

shaka::media::DecodedFrame::~DecodedFrame ( )
override

Definition at line 183 of file frames.cc.

Member Function Documentation

§ EstimateSize()

size_t shaka::media::DecodedFrame::EstimateSize ( ) const
overridevirtual

Estimates the size of this frame. This can be used to restrict the number of frames stored or to monitor/debug memory usage. This should only be used as an estimate and may not accurately measure the size.

Returns
The estimated size of the frame, in bytes.

Reimplemented from shaka::media::BaseFrame.

Reimplemented in shaka::media::ffmpeg::FFmpegDecodedFrame.

Definition at line 185 of file frames.cc.

Member Data Documentation

§ data

const std::vector<const uint8_t*> shaka::media::DecodedFrame::data

The raw frame data for this frame. The exact format of the data depends on the format. See PixelFormat/SampleFormat for the specific formats.

For hardware formats, this contains a single element pointing to the hardware frame.

For packed formats, this contains a single element containing the packed data.

For planar formats, this contains one element for each plane.

Definition at line 312 of file frames.h.

§ format

const variant<PixelFormat, SampleFormat> shaka::media::DecodedFrame::format

The format of this frame.

Definition at line 325 of file frames.h.

§ linesize

const std::vector<size_t> shaka::media::DecodedFrame::linesize

Contains the line sizes. Each element holds the line size value for the associated plane in data.

For audio, this holds the number of bytes in the plane; for video, this holds the number of bytes in a row of the image. Depending on the format, there may or may not be the same number of rows as the height.

Definition at line 322 of file frames.h.

§ sample_count

const size_t shaka::media::DecodedFrame::sample_count

If this is an audio frame, this is the number of samples (per channel) in this frame.

Definition at line 296 of file frames.h.


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