| 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 Theora video | 
|---|
| 19 | // C++ header | 
|---|
| 20 |  | 
|---|
| 21 | #ifndef _THEORA_VIDEO_RTP_SINK_HH | 
|---|
| 22 | #define _THEORA_VIDEO_RTP_SINK_HH | 
|---|
| 23 |  | 
|---|
| 24 | #ifndef _VIDEO_RTP_SINK_HH | 
|---|
| 25 | #include "VideoRTPSink.hh" | 
|---|
| 26 | #endif | 
|---|
| 27 |  | 
|---|
| 28 | class TheoraVideoRTPSink: public VideoRTPSink { | 
|---|
| 29 | public: | 
|---|
| 30 | static TheoraVideoRTPSink* | 
|---|
| 31 | createNew(UsageEnvironment& env, Groupsock* RTPgs, u_int8_t rtpPayloadFormat, | 
|---|
| 32 | // The following headers provide the 'configuration' information, for the SDP description: | 
|---|
| 33 | u_int8_t* , unsigned , | 
|---|
| 34 | u_int8_t* , unsigned , | 
|---|
| 35 | u_int8_t* , unsigned , | 
|---|
| 36 | u_int32_t identField = 0xFACADE); | 
|---|
| 37 |  | 
|---|
| 38 | static TheoraVideoRTPSink* | 
|---|
| 39 | createNew(UsageEnvironment& env, Groupsock* RTPgs, u_int8_t rtpPayloadFormat, | 
|---|
| 40 | char const* configStr); | 
|---|
| 41 | // an optional variant of "createNew()" that takes a Base-64-encoded 'configuration' string, | 
|---|
| 42 | // rather than the raw configuration headers as parameter. | 
|---|
| 43 |  | 
|---|
| 44 | protected: | 
|---|
| 45 | TheoraVideoRTPSink(UsageEnvironment& env, Groupsock* RTPgs, | 
|---|
| 46 | u_int8_t rtpPayloadFormat, | 
|---|
| 47 | u_int8_t* , unsigned , | 
|---|
| 48 | u_int8_t* , unsigned , | 
|---|
| 49 | u_int8_t* , unsigned , | 
|---|
| 50 | u_int32_t identField); | 
|---|
| 51 | // called only by createNew() | 
|---|
| 52 |  | 
|---|
| 53 | virtual ~TheoraVideoRTPSink(); | 
|---|
| 54 |  | 
|---|
| 55 | private: // redefined virtual functions: | 
|---|
| 56 | virtual char const* auxSDPLine(); // for the "a=fmtp:" SDP line | 
|---|
| 57 |  | 
|---|
| 58 | virtual void doSpecialFrameHandling(unsigned fragmentationOffset, | 
|---|
| 59 | unsigned char* frameStart, | 
|---|
| 60 | unsigned numBytesInFrame, | 
|---|
| 61 | struct timeval framePresentationTime, | 
|---|
| 62 | unsigned numRemainingBytes); | 
|---|
| 63 | virtual Boolean frameCanAppearAfterPacketStart(unsigned char const* frameStart, | 
|---|
| 64 | unsigned numBytesInFrame) const; | 
|---|
| 65 | virtual unsigned () const; | 
|---|
| 66 |  | 
|---|
| 67 | private: | 
|---|
| 68 | u_int32_t fIdent; // "Ident" field used by this stream.  (Only the low 24 bits of this are used.) | 
|---|
| 69 | char* fFmtpSDPLine; | 
|---|
| 70 | }; | 
|---|
| 71 |  | 
|---|
| 72 | #endif | 
|---|
| 73 |  | 
|---|