DASH Media Packaging SDK
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator
Public Types | Public Member Functions | Static Public Member Functions | List of all members
shaka::media::NaluReader Class Reference

#include <nalu_reader.h>

Public Types

enum  Result { kOk, kInvalidStream, kEOStream }
 

Public Member Functions

 NaluReader (Nalu::CodecType type, uint8_t nal_length_size, const uint8_t *stream, uint64_t stream_size)
 
Result Advance (Nalu *nalu)
 
bool StartsWithStartCode ()
 

Static Public Member Functions

static bool FindStartCode (const uint8_t *data, uint64_t data_size, uint64_t *offset, uint8_t *start_code_size)
 

Detailed Description

Helper class used to read NAL units based on several formats:

Definition at line 148 of file nalu_reader.h.

Constructor & Destructor Documentation

shaka::media::NaluReader::NaluReader ( Nalu::CodecType  type,
uint8_t  nal_length_size,
const uint8_t *  stream,
uint64_t  stream_size 
)
Parameters
nalu_length_sizeshould be set to 0 for AnnexB byte streams; otherwise, it indicates the size of NAL unit length for the NAL unit stream.

Definition at line 163 of file nalu_reader.cc.

Member Function Documentation

NaluReader::Result shaka::media::NaluReader::Advance ( Nalu nalu)

Reads a NALU from the stream into |*nalu|, if one exists, and then advances to the next NALU.

Parameters
nalucontains the NALU read if it exists.
Returns
kOk if a NALU is read; kEOStream if the stream is at the end-of-stream; kInvalidStream on error.

Definition at line 177 of file nalu_reader.cc.

bool shaka::media::NaluReader::StartsWithStartCode ( )
Returns
true if the current position points to a start code.

Definition at line 229 of file nalu_reader.cc.


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