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 sink for H.264 video (RFC 3984) |
19 | // C++ header |
20 | |
21 | #ifndef _H264_VIDEO_RTP_SINK_HH |
22 | #define _H264_VIDEO_RTP_SINK_HH |
23 | |
24 | #ifndef _H264_OR_5_VIDEO_RTP_SINK_HH |
25 | #include "H264or5VideoRTPSink.hh" |
26 | #endif |
27 | |
28 | class H264VideoRTPSink: public H264or5VideoRTPSink { |
29 | public: |
30 | static H264VideoRTPSink* |
31 | createNew(UsageEnvironment& env, Groupsock* RTPgs, unsigned char rtpPayloadFormat); |
32 | static H264VideoRTPSink* |
33 | createNew(UsageEnvironment& env, Groupsock* RTPgs, unsigned char rtpPayloadFormat, |
34 | u_int8_t const* sps, unsigned spsSize, u_int8_t const* pps, unsigned ppsSize); |
35 | // an optional variant of "createNew()", useful if we know, in advance, |
36 | // the stream's SPS and PPS NAL units. |
37 | // This avoids us having to 'pre-read' from the input source in order to get these values. |
38 | static H264VideoRTPSink* |
39 | createNew(UsageEnvironment& env, Groupsock* RTPgs, unsigned char rtpPayloadFormat, |
40 | char const* sPropParameterSetsStr); |
41 | // an optional variant of "createNew()", useful if we know, in advance, |
42 | // the stream's SPS and PPS NAL units. |
43 | // This avoids us having to 'pre-read' from the input source in order to get these values. |
44 | |
45 | protected: |
46 | H264VideoRTPSink(UsageEnvironment& env, Groupsock* RTPgs, unsigned char rtpPayloadFormat, |
47 | u_int8_t const* sps = NULL, unsigned spsSize = 0, |
48 | u_int8_t const* pps = NULL, unsigned ppsSize = 0); |
49 | // called only by createNew() |
50 | virtual ~H264VideoRTPSink(); |
51 | |
52 | protected: // redefined virtual functions: |
53 | virtual char const* auxSDPLine(); |
54 | |
55 | private: // redefined virtual functions: |
56 | virtual Boolean sourceIsCompatibleWithUs(MediaSource& source); |
57 | }; |
58 | |
59 | #endif |
60 | |