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 | // RTP Sources containing generic QuickTime stream data, as defined in |
19 | // <http://developer.apple.com/quicktime/icefloe/dispatch026.html> |
20 | // C++ header |
21 | |
22 | #ifndef _QUICKTIME_GENERIC_RTP_SOURCE_HH |
23 | #define _QUICKTIME_GENERIC_RTP_SOURCE_HH |
24 | |
25 | #ifndef _MULTI_FRAMED_RTP_SOURCE_HH |
26 | #include "MultiFramedRTPSource.hh" |
27 | #endif |
28 | |
29 | class QuickTimeGenericRTPSource: public MultiFramedRTPSource { |
30 | public: |
31 | static QuickTimeGenericRTPSource* |
32 | createNew(UsageEnvironment& env, Groupsock* RTPgs, |
33 | unsigned char rtpPayloadFormat, unsigned rtpTimestampFrequency, |
34 | char const* mimeTypeString); |
35 | |
36 | // QuickTime-specific information, set from the QuickTime header |
37 | // in each packet. This, along with the data following the header, |
38 | // is used by receivers. |
39 | struct QTState { |
40 | char PCK; |
41 | unsigned timescale; |
42 | char* sdAtom; |
43 | unsigned sdAtomSize; |
44 | unsigned short width, height; |
45 | // later add other state as needed ##### |
46 | } qtState; |
47 | |
48 | protected: |
49 | virtual ~QuickTimeGenericRTPSource(); |
50 | |
51 | private: |
52 | QuickTimeGenericRTPSource(UsageEnvironment& env, Groupsock* RTPgs, |
53 | unsigned char rtpPayloadFormat, |
54 | unsigned rtpTimestampFrequency, |
55 | char const* mimeTypeString); |
56 | // called only by createNew() |
57 | |
58 | private: |
59 | // redefined virtual functions: |
60 | virtual Boolean (BufferedPacket* packet, |
61 | unsigned& ); |
62 | virtual char const* MIMEtype() const; |
63 | |
64 | private: |
65 | char const* fMIMEtypeString; |
66 | }; |
67 | |
68 | #endif |
69 | |