1 | /********** |
2 | This library is free software; you can redistribute it and/or modify it under |
3 | the terms of the GNU Lesser General Public License as published by the |
4 | Free Software Foundation; either version 3 of the License, or (at your |
5 | option) any later version. (See <http://www.gnu.org/copyleft/lesser.html>.) |
6 | |
7 | This library is distributed in the hope that it will be useful, but WITHOUT |
8 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
9 | FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for |
10 | more details. |
11 | |
12 | You should have received a copy of the GNU Lesser General Public License |
13 | along with this library; if not, write to the Free Software Foundation, Inc., |
14 | 51 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 MPEG 1 or 2 Elementary Stream, demultiplexed from a Program Stream |
19 | // C++ header |
20 | |
21 | #ifndef _MPEG_1OR2_DEMUXED_ELEMENTARY_STREAM_HH |
22 | #define _MPEG_1OR2_DEMUXED_ELEMENTARY_STREAM_HH |
23 | |
24 | #ifndef _MPEG_1OR2_DEMUX_HH |
25 | #include "MPEG1or2Demux.hh" |
26 | #endif |
27 | |
28 | class MPEG1or2DemuxedElementaryStream: public FramedSource { |
29 | public: |
30 | MPEG1or2Demux::SCR lastSeenSCR() const { return fLastSeenSCR; } |
31 | |
32 | unsigned char mpegVersion() const { return fMPEGversion; } |
33 | |
34 | MPEG1or2Demux& sourceDemux() const { return fOurSourceDemux; } |
35 | |
36 | private: // We are created only by a MPEG1or2Demux (a friend) |
37 | MPEG1or2DemuxedElementaryStream(UsageEnvironment& env, |
38 | u_int8_t streamIdTag, |
39 | MPEG1or2Demux& sourceDemux); |
40 | virtual ~MPEG1or2DemuxedElementaryStream(); |
41 | |
42 | private: |
43 | // redefined virtual functions: |
44 | virtual void doGetNextFrame(); |
45 | virtual void doStopGettingFrames(); |
46 | virtual char const* MIMEtype() const; |
47 | virtual unsigned maxFrameSize() const; |
48 | |
49 | private: |
50 | static void afterGettingFrame(void* clientData, |
51 | unsigned frameSize, unsigned numTruncatedBytes, |
52 | struct timeval presentationTime, |
53 | unsigned durationInMicroseconds); |
54 | |
55 | void afterGettingFrame1(unsigned frameSize, unsigned numTruncatedBytes, |
56 | struct timeval presentationTime, |
57 | unsigned durationInMicroseconds); |
58 | |
59 | private: |
60 | u_int8_t fOurStreamIdTag; |
61 | MPEG1or2Demux& fOurSourceDemux; |
62 | char const* fMIMEtype; |
63 | MPEG1or2Demux::SCR fLastSeenSCR; |
64 | unsigned char fMPEGversion; |
65 | |
66 | friend class MPEG1or2Demux; |
67 | }; |
68 | |
69 | #endif |
70 | |