Tawara  0.1.0
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
tawara::SegmentInfo Class Reference

The SegmentInfo element, containing the meta-data for a segment. More...

#include <tawara/segment_info.h>

Inheritance diagram for tawara::SegmentInfo:
Inheritance graph
[legend]
Collaboration diagram for tawara::SegmentInfo:
Collaboration graph
[legend]

Public Member Functions

 SegmentInfo ()
 Create a new segment info element. More...
 
virtual ~SegmentInfo ()
 Destructor. More...
 
std::vector< char > uid () const
 Get the UID of this segment. More...
 
void uid (std::vector< char > const &uid)
 Set the UID of this segment. More...
 
std::string filename () const
 Get the segment's file name. More...
 
void filename (std::string const &filename)
 Set the segment's file name. More...
 
std::vector< char > prev_uid () const
 Get the previous segment's UID. More...
 
void prev_uid (std::vector< char > const &uid)
 Set the previous segment's UID. More...
 
std::string prev_filename () const
 Get the previous segment's file name. More...
 
void prev_filename (std::string const &filename)
 Set the previous segment's file name. More...
 
std::vector< char > next_uid () const
 Get the next segment's UID. More...
 
void next_uid (std::vector< char > const &uid)
 Set the next segment's UID. More...
 
std::string next_filename () const
 Get the next segment's file name. More...
 
void next_filename (std::string const &filename)
 Set the next segment's file name. More...
 
std::vector< char > segment_family () const
 Get the segment's family UID. More...
 
void segment_family (std::vector< char > const &segment_family)
 Set the segment's family UID. More...
 
uint64_t timecode_scale () const
 Get the timecode scale. More...
 
void timecode_scale (uint64_t scale)
 Set the timecode scale. More...
 
double duration () const
 Get the segment's duration. More...
 
void duration (double duration)
 Set the segment's duration. More...
 
int64_t date () const
 Get the segment's date. More...
 
void date (int64_t date)
 Set the segment's date. More...
 
std::string title () const
 Get the segment's title. More...
 
void title (std::string const &title)
 Set the segment's title. More...
 
std::string muxing_app () const
 Get the name of the muxing application/library. More...
 
void muxing_app (std::string const &muxing_app)
 Set the name of the muxing application/library. More...
 
std::string writing_app () const
 Get the name of the writing application. More...
 
void writing_app (std::string const &writing_app)
 Set the name of the writing application. More...
 
virtual std::streamsize write_body (std::ostream &output)
 Element body writing. More...
 
- Public Member Functions inherited from tawara::MasterElement
 MasterElement (uint32_t id, bool crc=false)
 Create a new MasterElement. More...
 
virtual ~MasterElement ()
 Destructor. More...
 
- Public Member Functions inherited from tawara::Element
 Element (tawara::ids::ID id)
 Create a new Element. More...
 
virtual ~Element ()
 Destructor. More...
 
uint32_t id () const
 Get the element's ID. More...
 
std::streampos offset () const
 Get the element's offset in the byte stream. More...
 
virtual std::streamsize size () const
 Get the total size of the element. More...
 
virtual std::streamsize write (std::ostream &output)
 Element writing. More...
 
virtual std::streamsize read (std::istream &input)
 Element reading. More...
 

Protected Member Functions

virtual std::streamsize body_size () const
 Get the size of the body of this element. More...
 
virtual std::streamsize read_body (std::istream &input, std::streamsize size)
 Element body loading. More...
 
void reset ()
 Resets all child elements to clean values. More...
 
- Protected Member Functions inherited from tawara::Element
std::streamsize write_id (std::ostream &output)
 Element ID writing. More...
 
virtual std::streamsize write_size (std::ostream &output)
 Element size writing. More...
 

Protected Attributes

BinaryElement uid_
 
bool have_uid_
 
StringElement seg_fn_
 
bool have_seg_fn_
 
BinaryElement prev_uid_
 
bool have_prev_uid_
 
StringElement prev_fn_
 
bool have_prev_fn_
 
BinaryElement next_uid_
 
bool have_next_uid_
 
StringElement next_fn_
 
bool have_next_fn_
 
BinaryElement seg_fam_
 
bool have_seg_fam_
 
UIntElement tc_scale_
 
FloatElement duration_
 
bool have_duration_
 
DateElement date_
 
bool have_date_
 
StringElement title_
 
bool have_title_
 
StringElement muxer_
 
bool have_muxer_
 
StringElement writer_
 
bool have_writer_
 
- Protected Attributes inherited from tawara::Element
tawara::ids::ID id_
 
std::streampos offset_
 

Detailed Description

The SegmentInfo element, containing the meta-data for a segment.

The SegmentInfo element provides the important meta-data about a segment in a Tawara document, such as the title, date, timecode scale and links to other segments.

Some values in the SegmentInfo cannot be written until after the segment's data is known:

The segment's UID will be generated automatically. It can be retrieved as a binary blob for use in other segments.

Most values in the SegmentInfo element are not required. For a list of which values will not be written to the file unless set, see the Tawara format specification.

Definition at line 81 of file segment_info.h.

Constructor & Destructor Documentation

tawara::SegmentInfo::SegmentInfo ( )

Create a new segment info element.

virtual tawara::SegmentInfo::~SegmentInfo ( )
inlinevirtual

Destructor.

Definition at line 88 of file segment_info.h.

Member Function Documentation

virtual std::streamsize tawara::SegmentInfo::body_size ( ) const
protectedvirtual

Get the size of the body of this element.

Implements tawara::Element.

int64_t tawara::SegmentInfo::date ( ) const
inline

Get the segment's date.

The segment's date is given in UTC as the number of seconds since 2001-01-01T00:00:00,0 UTC. They are signed, allowing dates before the origin.

Definition at line 211 of file segment_info.h.

void tawara::SegmentInfo::date ( int64_t  date)

Set the segment's date.

double tawara::SegmentInfo::duration ( ) const
inline

Get the segment's duration.

The segment's duration is the time range of the data contained in it, in the units defined by the TimecodeScale value.

Typically, this value won't be known until the segment is complete. File writing may therefore require that the SegmentInfo is written twice, with the second write over-writing the first and containing the final values.

Definition at line 201 of file segment_info.h.

void tawara::SegmentInfo::duration ( double  duration)

Set the segment's duration.

std::string tawara::SegmentInfo::filename ( ) const
inline

Get the segment's file name.

Definition at line 105 of file segment_info.h.

void tawara::SegmentInfo::filename ( std::string const &  filename)

Set the segment's file name.

Setting this value to an empty string will clear any existing file name, resulting in the element not being written to the file.

std::string tawara::SegmentInfo::muxing_app ( ) const
inline

Get the name of the muxing application/library.

Definition at line 229 of file segment_info.h.

void tawara::SegmentInfo::muxing_app ( std::string const &  muxing_app)

Set the name of the muxing application/library.

Setting this value to an empty string will clear any existing value, resulting in the element not being written to the file.

std::string tawara::SegmentInfo::next_filename ( ) const
inline

Get the next segment's file name.

Definition at line 160 of file segment_info.h.

void tawara::SegmentInfo::next_filename ( std::string const &  filename)

Set the next segment's file name.

Setting this value to an empty string will clear any existing value, resulting in the element not being written to the file.

std::vector<char> tawara::SegmentInfo::next_uid ( ) const
inline

Get the next segment's UID.

Segments can be linked together into a chain by specifying next and previous segment UIDs. Specifying file names as well helps speed up the search for linked segments.

Linked segments can be treated as a single document. This is typically used for replay, allowing multiple segments to be played back, in time order as determined by their DateUTC values, as though they were a single file.

Definition at line 152 of file segment_info.h.

void tawara::SegmentInfo::next_uid ( std::vector< char > const &  uid)

Set the next segment's UID.

Setting this value to an empty buffer will clear any existing value, resulting in the element not being written to the file.

std::string tawara::SegmentInfo::prev_filename ( ) const
inline

Get the previous segment's file name.

Setting this value to an empty buffer will clear any existing value, resulting in the element not being written to the file.

Definition at line 133 of file segment_info.h.

void tawara::SegmentInfo::prev_filename ( std::string const &  filename)

Set the previous segment's file name.

Setting this value to an empty string will clear any existing value, resulting in the element not being written to the file.

std::vector<char> tawara::SegmentInfo::prev_uid ( ) const
inline

Get the previous segment's UID.

Segments can be linked together into a chain by specifying next and previous segment UIDs. Specifying file names as well helps speed up the search for linked segments.

Linked segments can be treated as a single document. This is typically used for replay, allowing multiple segments to be played back, in time order as determined by their DateUTC values, as though they were a single file.

Definition at line 125 of file segment_info.h.

void tawara::SegmentInfo::prev_uid ( std::vector< char > const &  uid)

Set the previous segment's UID.

virtual std::streamsize tawara::SegmentInfo::read_body ( std::istream &  input,
std::streamsize  size 
)
protectedvirtual

Element body loading.

Implements tawara::Element.

void tawara::SegmentInfo::reset ( )
protected

Resets all child elements to clean values.

std::vector<char> tawara::SegmentInfo::segment_family ( ) const
inline

Get the segment's family UID.

Definition at line 169 of file segment_info.h.

void tawara::SegmentInfo::segment_family ( std::vector< char > const &  segment_family)

Set the segment's family UID.

Setting this value to an empty buffer will clear any existing value, resulting in the element not being written to the file.

uint64_t tawara::SegmentInfo::timecode_scale ( ) const
inline

Get the timecode scale.

The timecode scale, a value in nanoseconds, defines the units of all timecodes in the clusters in this segment. For example, if a value of 1,000,000ns is used, all timecodes in the clusters in this segment will be measured in milliseconds.

Set this value to zero to reset it to the default.

Definition at line 187 of file segment_info.h.

void tawara::SegmentInfo::timecode_scale ( uint64_t  scale)

Set the timecode scale.

std::string tawara::SegmentInfo::title ( ) const
inline

Get the segment's title.

This string gives a (usually) human-readable title for the segment.

Definition at line 220 of file segment_info.h.

void tawara::SegmentInfo::title ( std::string const &  title)

Set the segment's title.

Setting this value to an empty string will clear any existing value, resulting in the element not being written to the file.

std::vector<char> tawara::SegmentInfo::uid ( ) const
inline

Get the UID of this segment.

The segment's UID uniquely identifies it amongst other elements. Although it is not a required value, it is strongly recommended that it be set.

Definition at line 96 of file segment_info.h.

void tawara::SegmentInfo::uid ( std::vector< char > const &  uid)

Set the UID of this segment.

Setting this value to an empty buffer will clear any existing value, resulting in the element not being written to the file.

virtual std::streamsize tawara::SegmentInfo::write_body ( std::ostream &  output)
virtual

Element body writing.

Implements tawara::Element.

std::string tawara::SegmentInfo::writing_app ( ) const
inline

Get the name of the writing application.

Definition at line 238 of file segment_info.h.

void tawara::SegmentInfo::writing_app ( std::string const &  writing_app)

Set the name of the writing application.

Setting this value to an empty string will clear any existing value, resulting in the element not being written to the file.

Member Data Documentation

DateElement tawara::SegmentInfo::date_
protected

Definition at line 268 of file segment_info.h.

FloatElement tawara::SegmentInfo::duration_
protected

Definition at line 266 of file segment_info.h.

bool tawara::SegmentInfo::have_date_
protected

Definition at line 269 of file segment_info.h.

bool tawara::SegmentInfo::have_duration_
protected

Definition at line 267 of file segment_info.h.

bool tawara::SegmentInfo::have_muxer_
protected

Definition at line 273 of file segment_info.h.

bool tawara::SegmentInfo::have_next_fn_
protected

Definition at line 261 of file segment_info.h.

bool tawara::SegmentInfo::have_next_uid_
protected

Definition at line 259 of file segment_info.h.

bool tawara::SegmentInfo::have_prev_fn_
protected

Definition at line 257 of file segment_info.h.

bool tawara::SegmentInfo::have_prev_uid_
protected

Definition at line 255 of file segment_info.h.

bool tawara::SegmentInfo::have_seg_fam_
protected

Definition at line 263 of file segment_info.h.

bool tawara::SegmentInfo::have_seg_fn_
protected

Definition at line 253 of file segment_info.h.

bool tawara::SegmentInfo::have_title_
protected

Definition at line 271 of file segment_info.h.

bool tawara::SegmentInfo::have_uid_
protected

Definition at line 251 of file segment_info.h.

bool tawara::SegmentInfo::have_writer_
protected

Definition at line 275 of file segment_info.h.

StringElement tawara::SegmentInfo::muxer_
protected

Definition at line 272 of file segment_info.h.

StringElement tawara::SegmentInfo::next_fn_
protected

Definition at line 260 of file segment_info.h.

BinaryElement tawara::SegmentInfo::next_uid_
protected

Definition at line 258 of file segment_info.h.

StringElement tawara::SegmentInfo::prev_fn_
protected

Definition at line 256 of file segment_info.h.

BinaryElement tawara::SegmentInfo::prev_uid_
protected

Definition at line 254 of file segment_info.h.

BinaryElement tawara::SegmentInfo::seg_fam_
protected

Definition at line 262 of file segment_info.h.

StringElement tawara::SegmentInfo::seg_fn_
protected

Definition at line 252 of file segment_info.h.

UIntElement tawara::SegmentInfo::tc_scale_
protected

Definition at line 265 of file segment_info.h.

StringElement tawara::SegmentInfo::title_
protected

Definition at line 270 of file segment_info.h.

BinaryElement tawara::SegmentInfo::uid_
protected

Definition at line 250 of file segment_info.h.

StringElement tawara::SegmentInfo::writer_
protected

Definition at line 274 of file segment_info.h.


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