Tide 0.1.0
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Friends

tide::TrackEntry Class Reference

A track entry provides the meta-data for a single track. More...

#include <tide/track_entry.h>

Inheritance diagram for tide::TrackEntry:
Inheritance graph
[legend]
Collaboration diagram for tide::TrackEntry:
Collaboration graph
[legend]

List of all members.

Public Types

typedef boost::shared_ptr
< TrackEntry
Ptr
 The type of a shared pointer to a TrackEntry.
typedef boost::shared_ptr
< TrackEntry const > 
ConstPtr
 The type of a shared pointer to a constant TrackEntry.

Public Member Functions

 TrackEntry (uint64_t number, uint64_t uid, std::string const &codec)
 Construct a new TrackEntry.
virtual ~TrackEntry ()
 Destructor.
uint64_t number () const
 Get the track number.
void number (uint64_t number)
 Set the track number.
uint64_t uid () const
 Get the track UID.
void uid (uint64_t uid)
 Set the track UID.
uint8_t type () const
 Get the track type.
void type (uint8_t type)
 Set the track type.
bool enabled () const
 Check if the track is enabled.
void enabled (bool enabled)
 Set if the track is enabled.
bool forced () const
 Check if the track is forced.
void forced (bool forced)
 Set if the track is forced.
bool lacing () const
 Check if the track can use lacing.
void lacing (bool lacing)
 Set if the track can use lacing.
uint64_t min_cache () const
 Get the minimum cache size.
void min_cache (uint64_t min_cache)
 Set the minimum cache size.
uint64_t max_cache () const
 Get the maximum cache size.
void max_cache (uint64_t max_cache)
 Set the maximum cache size.
uint64_t default_duration () const
 Get the default duration of blocks in the track.
void default_duration (uint64_t default_duration)
 Set the default duration of blocks in the track.
double timecode_scale () const
 Get the track's timecode scale.
void timecode_scale (double timecode_scale)
 Set the track's timecode scale.
uint64_t max_block_add_id () const
 Get the maximum BlockAdditions ID.
void max_block_add_id (uint64_t max_id)
 Set the maximum BlockAdditions ID.
std::string name () const
 Get the track's name.
void name (std::string name)
 Set the track's name.
std::string codec_id () const
 Get the track's codec's ID.
void codec_id (std::string id)
 Set the track's codec's ID.
std::vector< char > codec_private () const
 Get the codec-private data.
void codec_private (std::vector< char > const &data)
 Set the codec-private data.
std::string codec_name () const
 Get the track's codec's name.
void codec_name (std::string name)
 Set the track's codec's name.
uint64_t attachment_link () const
 Get the UID of a linked attachment.
void attachment_link (uint64_t uid)
 Set the UID of a linked attachment.
bool decode_all () const
 Check if this track's codec can decode damaged data.
void decode_all (bool decode_all)
 Set if this track's codec can decode damaged data.
std::vector< uint64_t > overlays () const
 Get the UIDs of overlay tracks.
void overlays (std::vector< uint64_t > const &uids)
 Set the list of overlay track UIDs.
bool is_virtual () const
 Check if this track is virtual.
TrackOperationBase::Ptr operation () const
 Get the operation used to create this track.
void operation (TrackOperationBase::Ptr const &operation)
 Set the operation used to create this track.
virtual std::streamsize write_body (std::ostream &output)
 Element body writing.

Protected Member Functions

virtual std::streamsize body_size () const
 Get the size of the body of this element.
virtual std::streamsize read_body (std::istream &input, std::streamsize size)
 Element body loading.
void reset ()
 Resets all child elements to clean values.
std::streamsize read_operation (std::istream &input)
 Reads the operation child element.

Protected Attributes

UIntElement number_
UIntElement uid_
UIntElement type_
UIntElement enabled_
UIntElement forced_
UIntElement lacing_
UIntElement min_cache_
UIntElement max_cache_
UIntElement default_dur_
FloatElement timecode_scale_
UIntElement max_block_add_id_
StringElement name_
StringElement codec_id_
BinaryElement codec_private_
StringElement codec_name_
UIntElement attachment_link_
UIntElement decode_all_
std::vector< UIntElementoverlays_
TrackOperationBase::Ptr operation_

Friends

bool operator== (TrackEntry const &lhs, TrackEntry const &rhs)
 Equality operator.

Detailed Description

A track entry provides the meta-data for a single track.

All the necessary information to understand the data for a track is stored in the TrackEntry element. This includes things such as the codec used, private data stored by the codec (such as invariant sensor information), and playback settings.

Some tracks may be virtual, which means that they don't have any data of their own. Instead, they use data from other tracks, combined using one or more specified operations.

Definition at line 58 of file track_entry.h.


Member Typedef Documentation

typedef boost::shared_ptr<TrackEntry const> tide::TrackEntry::ConstPtr

The type of a shared pointer to a constant TrackEntry.

Definition at line 315 of file track_entry.h.

typedef boost::shared_ptr<TrackEntry> tide::TrackEntry::Ptr

The type of a shared pointer to a TrackEntry.

Definition at line 313 of file track_entry.h.


Constructor & Destructor Documentation

tide::TrackEntry::TrackEntry ( uint64_t  number,
uint64_t  uid,
std::string const &  codec 
)

Construct a new TrackEntry.

Parameters:
[in]numberThe track number. Must not be zero.
[in]uidThe track's unique identifier. Must not be zero.
[in]codecThe ID of the codec used in this track.
virtual tide::TrackEntry::~TrackEntry ( ) [inline, virtual]

Destructor.

Definition at line 72 of file track_entry.h.


Member Function Documentation

uint64_t tide::TrackEntry::attachment_link ( ) const [inline]

Get the UID of a linked attachment.

If the codec uses data stored in an attachment (for example, a binary providing the codec implementation), this UID must specify the relevant attachment.

This value, if specified, must not be zero.

Definition at line 267 of file track_entry.h.

void tide::TrackEntry::attachment_link ( uint64_t  uid) [inline]

Set the UID of a linked attachment.

Set to 0 to remove a linked attachment. No element will be written.

Definition at line 274 of file track_entry.h.

virtual std::streamsize tide::TrackEntry::body_size ( ) const [protected, virtual]

Get the size of the body of this element.

Implements tide::Element.

std::string tide::TrackEntry::codec_id ( ) const [inline]

Get the track's codec's ID.

The codec ID is vital for determining how to understand the track's data.

Definition at line 232 of file track_entry.h.

void tide::TrackEntry::codec_id ( std::string  id)

Set the track's codec's ID.

Exceptions:
ValueOutOfRangeif a value outside the allowable range is set.
std::string tide::TrackEntry::codec_name ( ) const [inline]

Get the track's codec's name.

This name should be human-readable.

Definition at line 255 of file track_entry.h.

void tide::TrackEntry::codec_name ( std::string  name) [inline]

Set the track's codec's name.

Definition at line 257 of file track_entry.h.

std::vector<char> tide::TrackEntry::codec_private ( ) const [inline]

Get the codec-private data.

Some codecs store data that does not vary by frame in this element.

Definition at line 245 of file track_entry.h.

void tide::TrackEntry::codec_private ( std::vector< char > const &  data) [inline]

Set the codec-private data.

Definition at line 248 of file track_entry.h.

bool tide::TrackEntry::decode_all ( ) const [inline]

Check if this track's codec can decode damaged data.

Definition at line 277 of file track_entry.h.

void tide::TrackEntry::decode_all ( bool  decode_all) [inline]

Set if this track's codec can decode damaged data.

Definition at line 279 of file track_entry.h.

void tide::TrackEntry::default_duration ( uint64_t  default_duration) [inline]

Set the default duration of blocks in the track.

Set to 0 to disable. No element will be written.

Definition at line 192 of file track_entry.h.

uint64_t tide::TrackEntry::default_duration ( ) const [inline]

Get the default duration of blocks in the track.

This value, specified in nanoseconds, is used to give the length of each block in the track if individual timecodes are not used. If specified, it must not be zero.

Definition at line 187 of file track_entry.h.

bool tide::TrackEntry::enabled ( ) const [inline]

Check if the track is enabled.

Disabled tracks are typically not played back.

The default is true.

Definition at line 121 of file track_entry.h.

void tide::TrackEntry::enabled ( bool  enabled) [inline]

Set if the track is enabled.

Definition at line 123 of file track_entry.h.

bool tide::TrackEntry::forced ( ) const [inline]

Check if the track is forced.

A forced track MUST be played back.

The default is false.

Definition at line 131 of file track_entry.h.

void tide::TrackEntry::forced ( bool  forced) [inline]

Set if the track is forced.

Definition at line 133 of file track_entry.h.

bool tide::TrackEntry::is_virtual ( ) const [inline]

Check if this track is virtual.

If this track has a TrackOperation, it is virtual and so its data comes from the blocks of its source tracks. If the track is not virtual, it has its own blocks.

Definition at line 296 of file track_entry.h.

bool tide::TrackEntry::lacing ( ) const [inline]

Check if the track can use lacing.

If the track can use lacing, it means that it may store multiple frames of data in a single block. This is used to reduce overhead when the size of an individual frame is small relative to the size of Tide data around it.

A value of true does not imply that the track must use lacing, only that it may.

The default is true.

Definition at line 147 of file track_entry.h.

void tide::TrackEntry::lacing ( bool  lacing) [inline]

Set if the track can use lacing.

Definition at line 149 of file track_entry.h.

uint64_t tide::TrackEntry::max_block_add_id ( ) const [inline]

Get the maximum BlockAdditions ID.

A value of 0 means there are no BlockAdditions for this track.

The default is 0.

Definition at line 216 of file track_entry.h.

void tide::TrackEntry::max_block_add_id ( uint64_t  max_id) [inline]

Set the maximum BlockAdditions ID.

Definition at line 219 of file track_entry.h.

void tide::TrackEntry::max_cache ( uint64_t  max_cache) [inline]

Set the maximum cache size.

Definition at line 179 of file track_entry.h.

uint64_t tide::TrackEntry::max_cache ( ) const [inline]

Get the maximum cache size.

This value gives the maximum cache size necessary to satisfy reference block requirements. This value heavily depends on the needs on the codec used for data. For example, a codec that may reference up to 10 blocks to decode the current block would require a value of 10 here.

A value of 0 indicates that no caching is necessary.

The default is 0.

Definition at line 177 of file track_entry.h.

uint64_t tide::TrackEntry::min_cache ( ) const [inline]

Get the minimum cache size.

This value gives the minimum number of blocks that should be cached before beginning playback. Generally, this value depends on the needs of the codec used for the data.

A value of 0 indicates that no caching is necessary.

The default is 0.

Definition at line 161 of file track_entry.h.

void tide::TrackEntry::min_cache ( uint64_t  min_cache) [inline]

Set the minimum cache size.

Definition at line 163 of file track_entry.h.

std::string tide::TrackEntry::name ( ) const [inline]

Get the track's name.

Definition at line 223 of file track_entry.h.

void tide::TrackEntry::name ( std::string  name) [inline]

Set the track's name.

Definition at line 225 of file track_entry.h.

void tide::TrackEntry::number ( uint64_t  number)

Set the track number.

Exceptions:
ValueOutOfRangeif a value outside the allowable range is set.
uint64_t tide::TrackEntry::number ( ) const [inline]

Get the track number.

The track's number is used to identify which track a block belongs to. It must not be zero.

Definition at line 79 of file track_entry.h.

TrackOperationBase::Ptr tide::TrackEntry::operation ( ) const [inline]

Get the operation used to create this track.

If this track is virtual, this operation specifies how to combine the blocks of the source tracks.

If this value is empty, then the track is not virtual.

Definition at line 304 of file track_entry.h.

void tide::TrackEntry::operation ( TrackOperationBase::Ptr const &  operation) [inline]

Set the operation used to create this track.

Definition at line 306 of file track_entry.h.

std::vector<uint64_t> tide::TrackEntry::overlays ( ) const

Get the UIDs of overlay tracks.

When this track has a gap in its data, the first track in the overlay list with available data will be used instead.

void tide::TrackEntry::overlays ( std::vector< uint64_t > const &  uids)

Set the list of overlay track UIDs.

virtual std::streamsize tide::TrackEntry::read_body ( std::istream &  input,
std::streamsize  size 
) [protected, virtual]

Element body loading.

Implements tide::Element.

std::streamsize tide::TrackEntry::read_operation ( std::istream &  input) [protected]

Reads the operation child element.

Parameters:
[in]inputThe input stream to read from.
void tide::TrackEntry::reset ( ) [protected]

Resets all child elements to clean values.

void tide::TrackEntry::timecode_scale ( double  timecode_scale)

Set the track's timecode scale.

Exceptions:
ValueOutOfRangeif a value outside the allowable range is set.
double tide::TrackEntry::timecode_scale ( ) const [inline]

Get the track's timecode scale.

This value speeds up or slows down the track with respect to other tracks. 1.0 means play back at the normal speed.

It must be greater than zero.

Definition at line 202 of file track_entry.h.

void tide::TrackEntry::type ( uint8_t  type)

Set the track type.

Exceptions:
ValueOutOfRangeif a value outside the allowable range is set.
uint8_t tide::TrackEntry::type ( ) const [inline]

Get the track type.

The track's type may be one of the values allowed by the specification. Usually, 0x70 will be used, indicating a data track.

Definition at line 107 of file track_entry.h.

void tide::TrackEntry::uid ( uint64_t  uid)

Set the track UID.

Exceptions:
ValueOutOfRangeif a value outside the allowable range is set.
uint64_t tide::TrackEntry::uid ( ) const [inline]

Get the track UID.

The track's UID is used to uniquely identify it. Generally, when making a direct stream copy of the track, the UID should be preserved. It must not be zero.

Definition at line 93 of file track_entry.h.

virtual std::streamsize tide::TrackEntry::write_body ( std::ostream &  output) [virtual]

Element body writing.

Implements tide::Element.


Friends And Related Function Documentation

bool operator== ( TrackEntry const &  lhs,
TrackEntry const &  rhs 
) [friend]

Equality operator.


Member Data Documentation

Definition at line 337 of file track_entry.h.

Definition at line 334 of file track_entry.h.

Definition at line 336 of file track_entry.h.

Definition at line 335 of file track_entry.h.

Definition at line 338 of file track_entry.h.

Definition at line 330 of file track_entry.h.

Definition at line 325 of file track_entry.h.

Definition at line 326 of file track_entry.h.

Definition at line 327 of file track_entry.h.

Definition at line 332 of file track_entry.h.

Definition at line 329 of file track_entry.h.

Definition at line 328 of file track_entry.h.

Definition at line 333 of file track_entry.h.

Definition at line 322 of file track_entry.h.

Definition at line 340 of file track_entry.h.

std::vector<UIntElement> tide::TrackEntry::overlays_ [protected]

Definition at line 339 of file track_entry.h.

Definition at line 331 of file track_entry.h.

Definition at line 324 of file track_entry.h.

Definition at line 323 of file track_entry.h.


The documentation for this class was generated from the following file:
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines