# AP4_Track Class Reference

`#include <Ap4Track.h>`

List of all members.

## Public Types
enum | Type { TYPE_UNKNOWN, TYPE_AUDIO, TYPE_VIDEO, TYPE_SYSTEM, TYPE_HINT, TYPE_TEXT, TYPE_JPEG, TYPE_RTP }
## Public Member Functions
| AP4_Track (Type type, AP4_SampleTable *sample_table, AP4_UI32 track_id, AP4_UI32 movie_time_scale, AP4_UI32 media_time_scale, AP4_UI32 media_duration, const char *language, AP4_UI32 width, AP4_UI32 height)
| AP4_Track (AP4_TrakAtom &atom, AP4_ByteStream &sample_stream, AP4_UI32 movie_time_scale)
virtual | ~AP4_Track ()
AP4_Track::Type | GetType ()
AP4_UI32 | GetHandlerType ()
AP4_UI32 | GetDuration ()
AP4_Duration | GetDurationMs ()
AP4_Cardinal | GetSampleCount ()
AP4_Result | GetSample (AP4_Ordinal index, AP4_Sample &sample)
AP4_Result | ReadSample (AP4_Ordinal index, AP4_Sample &sample, AP4_DataBuffer &data)
AP4_Result | GetSampleIndexForTimeStampMs (AP4_TimeStamp ts, AP4_Ordinal &index)
AP4_SampleDescription * | GetSampleDescription (AP4_Ordinal index)
AP4_SampleTable * | GetSampleTable ()
AP4_UI32 | GetId ()
AP4_Result | SetId (AP4_UI32 track_id)
AP4_TrakAtom * | GetTrakAtom ()
AP4_Result | SetMovieTimeScale (AP4_UI32 time_scale)
AP4_UI32 | GetMediaTimeScale ()
const char * | GetTrackName ()
const char * | GetTrackLanguage ()
AP4_Result | Attach (AP4_MoovAtom *moov)
## Protected Attributes
AP4_TrakAtom * | m_TrakAtom
bool | m_TrakAtomIsOwned
Type | m_Type
AP4_SampleTable * | m_SampleTable
bool | m_SampleTableIsOwned
AP4_UI32 | m_MovieTimeScale
AP4_UI32 | m_MediaTimeScale

## Detailed Description

Definition at line 58 of file Ap4Track.h.

## Member Enumeration Documentation

enum AP4_Track::Type

Enumerator:

  TYPE_UNKNOWN |
  TYPE_AUDIO |
  TYPE_VIDEO |
  TYPE_SYSTEM |
  TYPE_HINT |
  TYPE_TEXT |
  TYPE_JPEG |
  TYPE_RTP |

Definition at line 61 of file Ap4Track.h.

## Constructor & Destructor Documentation

AP4_Track::AP4_Track | ( | Type | type,
|  | AP4_SampleTable * | sample_table,
|  | AP4_UI32 | track_id,
|  | AP4_UI32 | movie_time_scale,
|  | AP4_UI32 | media_time_scale,
|  | AP4_UI32 | media_duration,
|  | const char * | language,
|  | AP4_UI32 | width,
|  | AP4_UI32 | height |
| ) |  |  |

AP4_Track::AP4_Track | ( | AP4_TrakAtom & | atom,
|  | AP4_ByteStream & | sample_stream,
|  | AP4_UI32 | movie_time_scale |
| ) |  |  |

virtual AP4_Track::~AP4_Track | ( |  | ) | `[virtual]`

## Member Function Documentation

AP4_Track::Type AP4_Track::GetType | ( |  | ) | `[inline]`

Definition at line 86 of file Ap4Track.h.

References m_Type.

AP4_UI32 AP4_Track::GetHandlerType | ( |  | ) |

AP4_UI32 AP4_Track::GetDuration | ( |  | ) |

AP4_Duration AP4_Track::GetDurationMs | ( |  | ) |

AP4_Cardinal AP4_Track::GetSampleCount | ( |  | ) |

AP4_Result AP4_Track::GetSample | ( | AP4_Ordinal | index,
|  | AP4_Sample & | sample |
| ) |  |  |

AP4_Result AP4_Track::ReadSample | ( | AP4_Ordinal | index,
|  | AP4_Sample & | sample,
|  | AP4_DataBuffer & | data |
| ) |  |  |

AP4_Result AP4_Track::GetSampleIndexForTimeStampMs | ( | AP4_TimeStamp | ts,
|  | AP4_Ordinal & | index |
| ) |  |  |

AP4_SampleDescription* AP4_Track::GetSampleDescription | ( | AP4_Ordinal | index | ) |

AP4_SampleTable* AP4_Track::GetSampleTable | ( |  | ) | `[inline]`

Definition at line 98 of file Ap4Track.h.

References m_SampleTable.

AP4_UI32 AP4_Track::GetId | ( |  | ) |

AP4_Result AP4_Track::SetId | ( | AP4_UI32 | track_id | ) |

AP4_TrakAtom* AP4_Track::GetTrakAtom | ( |  | ) | `[inline]`

Definition at line 101 of file Ap4Track.h.

References m_TrakAtom.

AP4_Result AP4_Track::SetMovieTimeScale | ( | AP4_UI32 | time_scale | ) |

AP4_UI32 AP4_Track::GetMediaTimeScale | ( |  | ) |

const char* AP4_Track::GetTrackName | ( |  | ) |

const char* AP4_Track::GetTrackLanguage | ( |  | ) |

AP4_Result AP4_Track::Attach | ( | AP4_MoovAtom * | moov | ) |

## Member Data Documentation

AP4_TrakAtom* AP4_Track::m_TrakAtom`[protected]`

Definition at line 110 of file Ap4Track.h.

Referenced by GetTrakAtom().

bool AP4_Track::m_TrakAtomIsOwned`[protected]`

Definition at line 111 of file Ap4Track.h.

Type AP4_Track::m_Type`[protected]`

Definition at line 112 of file Ap4Track.h.

Referenced by GetType().

AP4_SampleTable* AP4_Track::m_SampleTable`[protected]`

Definition at line 113 of file Ap4Track.h.

Referenced by GetSampleTable().

bool AP4_Track::m_SampleTableIsOwned`[protected]`

Definition at line 114 of file Ap4Track.h.

AP4_UI32 AP4_Track::m_MovieTimeScale`[protected]`

Definition at line 115 of file Ap4Track.h.

AP4_UI32 AP4_Track::m_MediaTimeScale`[protected]`

Definition at line 116 of file Ap4Track.h.

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

- Ap4Track.h