1/**********
2This library is free software; you can redistribute it and/or modify it under
3the terms of the GNU Lesser General Public License as published by the
4Free Software Foundation; either version 3 of the License, or (at your
5option) any later version. (See <http://www.gnu.org/copyleft/lesser.html>.)
6
7This library is distributed in the hope that it will be useful, but WITHOUT
8ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
9FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
10more details.
11
12You should have received a copy of the GNU Lesser General Public License
13along with this library; if not, write to the Free Software Foundation, Inc.,
1451 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
15**********/
16// "liveMedia"
17// Copyright (c) 1996-2020 Live Networks, Inc. All rights reserved.
18// A media track, demultiplexed from a Matroska file
19// C++ header
20
21#ifndef _MATROSKA_DEMUXED_TRACK_HH
22#define _MATROSKA_DEMUXED_TRACK_HH
23
24#ifndef _FRAMED_SOURCE_HH
25#include "FramedSource.hh"
26#endif
27
28class MatroskaDemux; // forward
29
30class MatroskaDemuxedTrack: public FramedSource {
31public:
32 void seekToTime(double& seekNPT);
33
34private: // We are created only by a MatroskaDemux (a friend)
35 friend class MatroskaDemux;
36 MatroskaDemuxedTrack(UsageEnvironment& env, unsigned trackNumber, MatroskaDemux& sourceDemux);
37 virtual ~MatroskaDemuxedTrack();
38
39private:
40 // redefined virtual functions:
41 virtual void doGetNextFrame();
42 virtual char const* MIMEtype() const;
43
44private: // We are accessed only by MatroskaDemux and by MatroskaFileParser (a friend)
45 friend class MatroskaFileParser;
46 unsigned char* to() { return fTo; }
47 unsigned maxSize() { return fMaxSize; }
48 unsigned& frameSize() { return fFrameSize; }
49 unsigned& numTruncatedBytes() { return fNumTruncatedBytes; }
50 struct timeval& presentationTime() { return fPresentationTime; }
51 unsigned& durationInMicroseconds() { return fDurationInMicroseconds; }
52
53 struct timeval& prevPresentationTime() { return fPrevPresentationTime; }
54 int& durationImbalance() { return fDurationImbalance; }
55
56private:
57 unsigned fOurTrackNumber;
58 MatroskaDemux& fOurSourceDemux;
59 struct timeval fPrevPresentationTime;
60 int fDurationImbalance;
61 unsigned fOpusTrackNumber; // hack for Opus audio
62};
63
64#endif
65