DUNE: Uniform Navigational Environment  2019.02.1
DUNE::Media::MJPG::Chunk Class Reference

Detailed Description

Class representing an RIFF/AVI chunk.

Public Member Functions

 Chunk (const Properties &properties, const char *id)
 
virtual ~Chunk (void)
 
void write (std::ostream &os)
 
void setData (const uint8_t *data, uint32_t data_size)
 
uint32_t getSize (void) const
 
void setDataSize (size_t size)
 
uint32_t getDataSize (void) const
 

Protected Member Functions

void writeShort (const uint16_t &value, std::ostream &os)
 
void writeWord (const uint32_t &value, std::ostream &os)
 
void writeFourCC (const char *value, std::ostream &os)
 
void writeString (const std::string &value, std::ostream &os)
 
virtual void writeData (std::ostream &os)
 

Protected Attributes

const Propertiesm_properties
 

Constructor & Destructor Documentation

DUNE::Media::MJPG::Chunk::Chunk ( const Properties properties,
const char *  id 
)
inline

Constructor.

Parameters
[in]propertiesstream properties.
[in]idchunk identifier.
virtual DUNE::Media::MJPG::Chunk::~Chunk ( void  )
inlinevirtual

Destructor.

Member Function Documentation

uint32_t DUNE::Media::MJPG::Chunk::getSize ( void  ) const
inline

Get size of chunk in bytes.

Returns
chunk size.

References getDataSize().

Referenced by DUNE::Media::MJPG::List::add(), DUNE::Media::MJPG::Encoder::encode(), and DUNE::Media::MJPG::Encoder::~Encoder().

void DUNE::Media::MJPG::Chunk::setData ( const uint8_t *  data,
uint32_t  data_size 
)
inline

Set chunk data.

Parameters
[in]datadata buffer.
[in]data_sizesize of data buffer.

References setDataSize().

Referenced by DUNE::Media::MJPG::Encoder::encode().

void DUNE::Media::MJPG::Chunk::write ( std::ostream &  os)
inline
virtual void DUNE::Media::MJPG::Chunk::writeData ( std::ostream &  os)
inlineprotectedvirtual

Write chunk data to output stream.

Parameters
[in]osoutput stream.

Reimplemented in DUNE::Media::MJPG::IDX1, DUNE::Media::MJPG::List, DUNE::Media::MJPG::TSTP, DUNE::Media::MJPG::ISFT, DUNE::Media::MJPG::AVIH, DUNE::Media::MJPG::STRF, and DUNE::Media::MJPG::STRH.

Referenced by write().

void DUNE::Media::MJPG::Chunk::writeFourCC ( const char *  value,
std::ostream &  os 
)
inlineprotected

Write FourCC value to output stream.

Parameters
[in]valuevalue to write.
[in]osoutput stream.

Referenced by write(), DUNE::Media::MJPG::STRH::writeData(), and DUNE::Media::MJPG::List::writeData().

void DUNE::Media::MJPG::Chunk::writeShort ( const uint16_t &  value,
std::ostream &  os 
)
inlineprotected

Write 16-bit unsigned value to output stream.

Parameters
[in]valuevalue to write.
[in]osoutput stream.

Referenced by DUNE::Media::MJPG::STRF::writeData(), and DUNE::Media::MJPG::STRH::writeData().

void DUNE::Media::MJPG::Chunk::writeString ( const std::string &  value,
std::ostream &  os 
)
inlineprotected

Write string to output stream.

Parameters
[in]valuevalue to write.
[in]osoutput stream.

Referenced by DUNE::Media::MJPG::ISFT::writeData().

void DUNE::Media::MJPG::Chunk::writeWord ( const uint32_t &  value,
std::ostream &  os 
)
inlineprotected

Write 32-bit unsigned value to output stream.

Parameters
[in]valuevalue to write.
[in]osoutput stream.

Referenced by write(), DUNE::Media::MJPG::STRH::writeData(), DUNE::Media::MJPG::STRF::writeData(), and DUNE::Media::MJPG::AVIH::writeData().

Member Data Documentation

Collaboration diagram for DUNE::Media::MJPG::Chunk:
Collaboration graph