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 MPEG-4 audio, using LATM multiplexing (RFC 3016)
19// (Note that the initial 'size' field is assumed to be present at the start of
20// each frame.)
21// C++ header
22
23#ifndef _MPEG4_LATM_AUDIO_RTP_SINK_HH
24#define _MPEG4_LATM_AUDIO_RTP_SINK_HH
25
26#ifndef _AUDIO_RTP_SINK_HH
27#include "AudioRTPSink.hh"
28#endif
29
30class MPEG4LATMAudioRTPSink: public AudioRTPSink {
31public:
32 static MPEG4LATMAudioRTPSink* createNew(UsageEnvironment& env,
33 Groupsock* RTPgs,
34 unsigned char rtpPayloadFormat,
35 u_int32_t rtpTimestampFrequency,
36 char const* streamMuxConfigString,
37 unsigned numChannels,
38 Boolean allowMultipleFramesPerPacket = False);
39
40protected:
41 MPEG4LATMAudioRTPSink(UsageEnvironment& env, Groupsock* RTPgs,
42 unsigned char rtpPayloadFormat,
43 u_int32_t rtpTimestampFrequency,
44 char const* streamMuxConfigString,
45 unsigned numChannels,
46 Boolean allowMultipleFramesPerPacket);
47 // called only by createNew()
48
49 virtual ~MPEG4LATMAudioRTPSink();
50
51private: // redefined virtual functions:
52 virtual void doSpecialFrameHandling(unsigned fragmentationOffset,
53 unsigned char* frameStart,
54 unsigned numBytesInFrame,
55 struct timeval framePresentationTime,
56 unsigned numRemainingBytes);
57 virtual Boolean
58 frameCanAppearAfterPacketStart(unsigned char const* frameStart,
59 unsigned numBytesInFrame) const;
60
61 virtual char const* auxSDPLine(); // for the "a=fmtp:" SDP line
62
63private:
64 char const* fStreamMuxConfigString;
65 char* fFmtpSDPLine;
66 Boolean fAllowMultipleFramesPerPacket;
67};
68
69#endif
70