live
RawVideoRTPSink.hh
Go to the documentation of this file.
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-2021 Live Networks, Inc. All rights reserved.
18 // RTP sink for Raw video
19 // C++ header
20 
21 #ifndef _RAW_VIDEO_RTP_SINK_HH
22 #define _RAW_VIDEO_RTP_SINK_HH
23 
24 #ifndef _VIDEO_RTP_SINK_HH
25 #include "VideoRTPSink.hh"
26 #endif
27 
28 #ifndef _RAW_VIDEO_FRAME_PARAMETERS_HH
30 #endif
31 
33 public:
34  static RawVideoRTPSink*
35  createNew(UsageEnvironment& env, Groupsock* RTPgs, u_int8_t rtpPayloadFormat,
36  unsigned width, unsigned height, unsigned depth, // as defined by RFC 4175, sec 6.1
37  char const* sampling, char const* colorimetry);
38 
39 protected:
41  u_int8_t rtpPayloadFormat,
42  unsigned width, unsigned height, unsigned depth,
43  char const* sampling, char const* colorimetry);
44  // called only by createNew()
45 
46  virtual ~RawVideoRTPSink();
47 
48 private: // redefined virtual functions:
49  virtual char const* auxSDPLine(); // for the "a=fmtp:" SDP line
50 
51  virtual void doSpecialFrameHandling(unsigned fragmentationOffset,
52  unsigned char* frameStart,
53  unsigned numBytesInFrame,
54  struct timeval framePresentationTime,
55  unsigned numRemainingBytes);
56  virtual Boolean frameCanAppearAfterPacketStart(unsigned char const* frameStart,
57  unsigned numBytesInFrame) const;
58  virtual unsigned specialHeaderSize() const;
59  virtual unsigned computeOverflowForNewFrame(unsigned newFrameSize) const;
60 
61 private:
62  char* fFmtpSDPLine;
63  unsigned fLineIndex;
65 
66  unsigned getNumLinesInPacket(unsigned fragOffset, u_int16_t*& lengths, u_int16_t*& offsets) const;
67  // return the number of lines, their lengths and offsets from the fragmentation offset of the whole frame.
68  // call delete[] on lengths and offsets after use of the function
69 };
70 
71 #endif
unsigned char Boolean
Definition: Boolean.hh:25
virtual unsigned specialHeaderSize() const
virtual unsigned computeOverflowForNewFrame(unsigned newFrameSize) const
static RawVideoRTPSink * createNew(UsageEnvironment &env, Groupsock *RTPgs, u_int8_t rtpPayloadFormat, unsigned width, unsigned height, unsigned depth, char const *sampling, char const *colorimetry)
virtual Boolean frameCanAppearAfterPacketStart(unsigned char const *frameStart, unsigned numBytesInFrame) const
virtual void doSpecialFrameHandling(unsigned fragmentationOffset, unsigned char *frameStart, unsigned numBytesInFrame, struct timeval framePresentationTime, unsigned numRemainingBytes)
RawVideoFrameParameters fP
virtual ~RawVideoRTPSink()
virtual char const * auxSDPLine()
RawVideoRTPSink(UsageEnvironment &env, Groupsock *RTPgs, u_int8_t rtpPayloadFormat, unsigned width, unsigned height, unsigned depth, char const *sampling, char const *colorimetry)
unsigned getNumLinesInPacket(unsigned fragOffset, u_int16_t *&lengths, u_int16_t *&offsets) const