61
61
class MATROSKA_DLL_API FileMatroska {
63
FileMatroska(IOCallback & output);
63
FileMatroska(IOCallback & output);
66
filepos_t RenderHead(const std::string & aEncoderApp);
70
void Close(const uint32 aTimeLength);
72
inline void type_SetInfo(const std::string & aStr) {myMainHeader.type_SetInfo(aStr);}
73
inline void type_SetAds(const std::string & aStr) {myMainHeader.type_SetAds(aStr);}
74
inline void type_SetSize(const std::string & aStr) {myMainHeader.type_SetSize(aStr);}
75
inline void type_SetSize(uint64 aSize) {myMainHeader.type_SetSize(aSize);}
77
inline uint8 GetTrackNumber() const { return myTracks.size(); }
79
void track_SetName(Track * aTrack, const std::string & aName);
80
void track_SetLaced(Track * aTrack, bool bLaced = true);
82
Track * CreateTrack(const track_type aType);
83
inline Track * GetTrack(const uint8 aTrackNb) const
85
if (aTrackNb > myTracks.size())
88
return myTracks[aTrackNb-1];
91
void Track_GetInfo(const Track * aTrack, TrackInfo & aTrackInfo) const;
93
void Track_SetInfo_Audio(Track * aTrack, const TrackInfoAudio & aTrackInfo);
94
void Track_GetInfo_Audio(const Track * aTrack, TrackInfoAudio & aTrackInfo) const;
96
void Track_SetInfo_Video(Track * aTrack, const TrackInfoVideo & aTrackInfo);
97
void Track_GetInfo_Video(const Track * aTrack, TrackInfoVideo & aTrackInfo) const;
99
void SelectReadingTrack(Track * aTrack, bool select = true);
102
\return wether the frame has been added or not
104
bool AddFrame(Track * aTrack, const uint32 aTimecode, const binary *aFrame, const uint32 aFrameSize,
105
bool aKeyFrame = true, bool aBFrame = false);
108
\return wether the frame has been read or not
110
bool ReadFrame(Track * & aTrack, uint32 & aTimecode, const binary * & aFrame, uint32 & aFrameSize,
111
bool & aKeyFrame, bool & aBFrame);
114
Render the pending cluster to file
118
void SetMaxClusterSize(const uint32 value);
119
void SetMinClusterSize(const uint32 value) {myMinClusterSize = value;}
66
filepos_t RenderHead(const std::string & aEncoderApp);
70
void Close(const uint32 aTimeLength);
72
inline void type_SetInfo(const std::string & aStr) {myMainHeader.type_SetInfo(aStr);}
73
inline void type_SetAds(const std::string & aStr) {myMainHeader.type_SetAds(aStr);}
74
inline void type_SetSize(const std::string & aStr) {myMainHeader.type_SetSize(aStr);}
75
inline void type_SetSize(uint64 aSize) {myMainHeader.type_SetSize(aSize);}
77
inline uint8 GetTrackNumber() const { return myTracks.size(); }
79
void track_SetName(Track * aTrack, const std::string & aName);
80
void track_SetLaced(Track * aTrack, bool bLaced = true);
82
Track * CreateTrack(const track_type aType);
83
inline Track * GetTrack(const uint8 aTrackNb) const
85
if (aTrackNb > myTracks.size())
88
return myTracks[aTrackNb-1];
91
void Track_GetInfo(const Track * aTrack, TrackInfo & aTrackInfo) const;
93
void Track_SetInfo_Audio(Track * aTrack, const TrackInfoAudio & aTrackInfo);
94
void Track_GetInfo_Audio(const Track * aTrack, TrackInfoAudio & aTrackInfo) const;
96
void Track_SetInfo_Video(Track * aTrack, const TrackInfoVideo & aTrackInfo);
97
void Track_GetInfo_Video(const Track * aTrack, TrackInfoVideo & aTrackInfo) const;
99
void SelectReadingTrack(Track * aTrack, bool select = true);
102
\return wether the frame has been added or not
104
bool AddFrame(Track * aTrack, const uint32 aTimecode, const binary *aFrame, const uint32 aFrameSize,
105
bool aKeyFrame = true, bool aBFrame = false);
108
\return wether the frame has been read or not
110
bool ReadFrame(Track * & aTrack, uint32 & aTimecode, const binary * & aFrame, uint32 & aFrameSize,
111
bool & aKeyFrame, bool & aBFrame);
114
Render the pending cluster to file
118
void SetMaxClusterSize(const uint32 value);
119
void SetMinClusterSize(const uint32 value) {myMinClusterSize = value;}
122
MainHeader myMainHeader;
124
std::vector<Track *> myTracks;
125
std::vector<uint8> mySelectedTracks;
127
// Track *findTrack(Track * aTrack) const;
129
Cluster myCurrWriteCluster; /// \todo merge with the write one ?
130
uint32 myReadBlockNumber;
131
Cluster myCurrReadCluster;
132
binary * myCurrReadBlock; ///< The buffer containing the current read block
133
uint32 myCurrReadBlockSize; ///< The size of the buffer containing the current read block
134
uint8 myCurrReadBlockTrack; ///< The track number of the current track to read
136
uint32 myMaxClusterSize;
137
uint32 myMinClusterSize;
139
StreamInfo myStreamInfo;
141
CodecHeader myCodecHeader;
143
inline bool IsMyTrack(const Track * aTrack) const;
144
inline bool IsReadingTrack(const uint8 aTrackNum) const;
122
MainHeader myMainHeader;
124
std::vector<Track *> myTracks;
125
std::vector<uint8> mySelectedTracks;
127
// Track *findTrack(Track * aTrack) const;
129
Cluster myCurrWriteCluster; /// \todo merge with the write one ?
130
uint32 myReadBlockNumber;
131
Cluster myCurrReadCluster;
132
binary * myCurrReadBlock; ///< The buffer containing the current read block
133
uint32 myCurrReadBlockSize; ///< The size of the buffer containing the current read block
134
uint8 myCurrReadBlockTrack; ///< The track number of the current track to read
136
uint32 myMaxClusterSize;
137
uint32 myMinClusterSize;
139
StreamInfo myStreamInfo;
141
CodecHeader myCodecHeader;
143
inline bool IsMyTrack(const Track * aTrack) const;
144
inline bool IsReadingTrack(const uint8 aTrackNum) const;