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 RTP source for a simple RTP payload format that |
19 | // - doesn't have any special headers following the RTP header |
20 | // (if necessary, the "offset" parameter can be used to specify a |
21 | // special header that we just skip over) |
22 | // - doesn't have any special framing apart from the packet data itself |
23 | // C++ header |
24 | |
25 | #ifndef _SIMPLE_RTP_SOURCE_HH |
26 | #define _SIMPLE_RTP_SOURCE_HH |
27 | |
28 | #ifndef _MULTI_FRAMED_RTP_SOURCE_HH |
29 | #include "MultiFramedRTPSource.hh" |
30 | #endif |
31 | |
32 | class SimpleRTPSource: public MultiFramedRTPSource { |
33 | public: |
34 | static SimpleRTPSource* createNew(UsageEnvironment& env, Groupsock* RTPgs, |
35 | unsigned char rtpPayloadFormat, |
36 | unsigned rtpTimestampFrequency, |
37 | char const* mimeTypeString, |
38 | unsigned offset = 0, |
39 | Boolean doNormalMBitRule = True); |
40 | // "doNormalMBitRule" means: If the medium is not audio, use the RTP "M" |
41 | // bit on each incoming packet to indicate the last (or only) fragment |
42 | // of a frame. Otherwise (i.e., if "doNormalMBitRule" is False, or the medium is "audio"), the "M" bit is ignored. |
43 | |
44 | protected: |
45 | SimpleRTPSource(UsageEnvironment& env, Groupsock* RTPgs, |
46 | unsigned char rtpPayloadFormat, |
47 | unsigned rtpTimestampFrequency, |
48 | char const* mimeTypeString, unsigned offset, |
49 | Boolean doNormalMBitRule); |
50 | // called only by createNew(), or by subclass constructors |
51 | virtual ~SimpleRTPSource(); |
52 | |
53 | protected: |
54 | // redefined virtual functions: |
55 | virtual Boolean (BufferedPacket* packet, |
56 | unsigned& ); |
57 | virtual char const* MIMEtype() const; |
58 | |
59 | private: |
60 | char const* fMIMEtypeString; |
61 | unsigned fOffset; |
62 | Boolean fUseMBitForFrameEnd; |
63 | }; |
64 | |
65 | #endif |
66 | |