# Dirac - A Video Codec

Created by the British Broadcasting Corporation.

# dirac::DiracByteStream Class Reference

Represents a series of bytes in the Dirac bytestream specfication format. More...

`#include <dirac_byte_stream.h>`

Inheritance diagram for dirac::DiracByteStream:

[legend]
Collaboration diagram for dirac::DiracByteStream:

[legend]

List of all members.

## Public Member Functions

- DiracByteStream ()
    Constructor.
- ~DiracByteStream ()
    Destructor.
- void AddBytes (char *start, int count)
    Adds Dirac-formatted bytes to internal-byte-stream for processing.
- DiracByteStats GetLastUnitStats ()
    Gets the statistics of the most recent parse-unit to be processed.
- ParseUnitByteIO * GetNextParseUnit ()
    Gets the next parse-unit in the current byte-stream.
- DiracByteStats GetSequenceStats () const
    Gets stats for current sequence.
- void AddAccessUnit (AccessUnitByteIO *p_accessunit_byteio)
    Adds a random access point to the current Dirac byte stream.
- void AddFrame (FrameByteIO *p_frame_byteio)
    Adds a frame to the current Dirac byte stream.
- void Clear ()
    Clear parse-units.
- DiracByteStats EndSequence ()
    Insert end-of-sequence data.
- const std::string GetBytes ()
    Gets a pointer to all current output bytes.
- bool IsUnitAvailable () const
    Any info pending?

## Private Types

- typedef std::queue< std::pair
  < ParseUnitType,
  ParseUnitByteIO * > > ParseUnitList
    Parse-units in Dirac stream.

## Private Attributes

- ParseUnitList m_parse_unit_list
- ParseUnitByteIO * mp_prev_parse_unit
    Last unit to be processed Required for specifying the previous parse-unit.
- ParseUnitByteIO * mp_next_parse_unit
    Next parse-unit waiting to be processed A parse-unit can only be declared valid only if it has been validated against the next unit in the stream.
- DiracByteStats m_sequence_stats
    Stats for current sequence.

## Detailed Description

These bytes are grouped into more managable parse units by this class.

## Member Typedef Documentation

typedef std::queue< std::pair <ParseUnitType, ParseUnitByteIO*> > dirac::DiracByteStream::ParseUnitList `[private]`

## Constructor & Destructor Documentation

dirac::DiracByteStream::DiracByteStream | ( |  | ) |

dirac::DiracByteStream::~DiracByteStream | ( |  | ) |

## Member Function Documentation

void dirac::DiracByteStream::AddBytes | ( | char * | start,
|  | int | count |
| ) |  |  |

Parameters:

  | start | Start of char list
  | count | Number of chars

DiracByteStats dirac::DiracByteStream::GetLastUnitStats | ( |  | ) |

Returns:
  Byte-statistics

ParseUnitByteIO* dirac::DiracByteStream::GetNextParseUnit | ( |  | ) |

DiracByteStats dirac::DiracByteStream::GetSequenceStats | ( |  | ) | const

void dirac::DiracByteStream::AddAccessUnit | ( | AccessUnitByteIO * | p_accessunit_byteio | ) |

Parameters:

  | p_accessunit_byteio | Access-unit stream. This class is now responsible for deleting

void dirac::DiracByteStream::AddFrame | ( | FrameByteIO * | p_frame_byteio | ) |

Parameters:

  | p_frame_byteio | Frame stream. This class is now responsible for deleting.

void dirac::DiracByteStream::Clear | ( |  | ) |

DiracByteStats dirac::DiracByteStream::EndSequence | ( |  | ) |

Returns:
  Sequence stats

const std::string dirac::DiracByteStream::GetBytes | ( |  | ) | `[virtual]`

Reimplemented from dirac::ByteIO.

bool dirac::DiracByteStream::IsUnitAvailable | ( |  | ) | const

## Member Data Documentation

ParseUnitList dirac::DiracByteStream::m_parse_unit_list `[private]`

ParseUnitByteIO* dirac::DiracByteStream::mp_prev_parse_unit `[private]`

ParseUnitByteIO* dirac::DiracByteStream::mp_next_parse_unit `[private]`

DiracByteStats dirac::DiracByteStream::m_sequence_stats `[private]`

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

- dirac_byte_stream.h

© 2004 British Broadcasting Corporation. Dirac code licensed under the Mozilla Public License (MPL) Version 1.1.
HTML documentation generated by Dimitri van Heesch's excellent Doxygen tool.