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// 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
28class H264VideoRTPSink: public H264or5VideoRTPSink {
29public:
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
45protected:
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
52protected: // redefined virtual functions:
53 virtual char const* auxSDPLine();
54
55private: // redefined virtual functions:
56 virtual Boolean sourceIsCompatibleWithUs(MediaSource& source);
57};
58
59#endif
60