├── lib ├── x264lib │ ├── libx264.a │ └── libx264.so.148 └── livelib │ ├── libgroupsock.a │ ├── libliveMedia.a │ ├── libUsageEnvironment.a │ └── libBasicUsageEnvironment.a ├── README.md ├── include ├── x264 │ └── x264_config.h ├── live555 │ ├── groupsock │ │ ├── groupsock_version.hh │ │ ├── IOHandlers.hh │ │ └── GroupEId.hh │ ├── liveMedia │ │ ├── liveMedia_version.hh │ │ ├── OutputFile.hh │ │ ├── FramedFileSource.hh │ │ ├── QCELPAudioRTPSource.hh │ │ ├── MP3Transcoder.hh │ │ ├── TextRTPSink.hh │ │ ├── VideoRTPSink.hh │ │ ├── GSMAudioRTPSink.hh │ │ ├── AudioRTPSink.hh │ │ ├── AMRAudioFileSource.hh │ │ ├── FileServerMediaSubsession.hh │ │ ├── MP3ADURTPSource.hh │ │ ├── H265VideoStreamFramer.hh │ │ ├── H264VideoStreamFramer.hh │ │ ├── Base64.hh │ │ ├── H264or5VideoFileSink.hh │ │ ├── AMRAudioSource.hh │ │ ├── DVVideoRTPSource.hh │ │ ├── FramedFilter.hh │ │ ├── VP8VideoRTPSource.hh │ │ ├── VP9VideoRTPSource.hh │ │ ├── AC3AudioRTPSource.hh │ │ ├── BasicUDPSource.hh │ │ ├── MPEG4ESVideoRTPSource.hh │ │ ├── H264VideoStreamDiscreteFramer.hh │ │ ├── H265VideoStreamDiscreteFramer.hh │ │ ├── MPEG1or2AudioRTPSink.hh │ │ ├── AMRAudioFileSink.hh │ │ ├── MPEG1or2AudioRTPSource.hh │ │ ├── H264VideoFileSink.hh │ │ ├── ourMD5.hh │ │ ├── AMRAudioRTPSource.hh │ │ ├── H261VideoRTPSource.hh │ │ ├── TheoraVideoRTPSource.hh │ │ ├── MPEG1or2VideoRTPSource.hh │ │ ├── VP8VideoRTPSink.hh │ │ ├── VP9VideoRTPSink.hh │ │ ├── MP3ADURTPSink.hh │ │ ├── AC3AudioFileServerMediaSubsession.hh │ │ ├── ADTSAudioFileSource.hh │ │ ├── AMRAudioFileServerMediaSubsession.hh │ │ ├── JPEGVideoRTPSink.hh │ │ ├── ADTSAudioFileServerMediaSubsession.hh │ │ ├── H265VideoFileSink.hh │ │ ├── H263plusVideoFileServerMediaSubsession.hh │ │ ├── MediaSource.hh │ │ ├── JPEGVideoRTPSource.hh │ │ ├── MPEG1or2VideoStreamFramer.hh │ │ ├── BasicUDPSink.hh │ │ ├── H263plusVideoRTPSink.hh │ │ ├── JPEGVideoSource.hh │ │ ├── H263plusVideoRTPSource.hh │ │ ├── AC3AudioRTPSink.hh │ │ ├── MP3ADUTranscoder.hh │ │ ├── DVVideoRTPSink.hh │ │ ├── BitVector.hh │ │ ├── H263plusVideoStreamFramer.hh │ │ ├── H264or5VideoStreamDiscreteFramer.hh │ │ ├── DVVideoFileServerMediaSubsession.hh │ │ ├── MP3FileSource.hh │ │ ├── H264or5VideoRTPSink.hh │ │ ├── MPEG1or2VideoFileServerMediaSubsession.hh │ │ ├── MPEG2TransportStreamFromPESSource.hh │ │ ├── MPEG2TransportUDPServerMediaSubsession.hh │ │ ├── MPEG4VideoFileServerMediaSubsession.hh │ │ ├── AMRAudioRTPSink.hh │ │ ├── H264VideoFileServerMediaSubsession.hh │ │ ├── H265VideoFileServerMediaSubsession.hh │ │ ├── DeviceSource.hh │ │ ├── AudioInputDevice.hh │ │ ├── QuickTimeGenericRTPSource.hh │ │ ├── MPEG1or2DemuxedElementaryStream.hh │ │ ├── H265VideoRTPSource.hh │ │ ├── ByteStreamMultiFileSource.hh │ │ ├── AC3AudioStreamFramer.hh │ │ ├── H264VideoRTPSink.hh │ │ ├── H264VideoRTPSource.hh │ │ ├── MPEG1or2AudioStreamFramer.hh │ │ ├── MPEG1or2FileServerDemux.hh │ │ ├── MPEG2TransportStreamFromESSource.hh │ │ ├── SimpleRTPSource.hh │ │ ├── MPEG4LATMAudioRTPSink.hh │ │ ├── TCPStreamSink.hh │ │ ├── MPEG1or2DemuxedServerMediaSubsession.hh │ │ ├── RTSPCommon.hh │ │ ├── ByteStreamMemoryBufferSource.hh │ │ ├── InputFile.hh │ │ ├── MPEG4GenericRTPSink.hh │ │ ├── VorbisAudioRTPSource.hh │ │ └── Locale.hh │ ├── usageEnvironment │ │ ├── UsageEnvironment_version.hh │ │ ├── Boolean.hh │ │ ├── strDup.hh │ │ └── HashTable.hh │ └── basicUsageEnvironment │ │ ├── BasicUsageEnvironment_version.hh │ │ └── HandlerSet.hh └── encoder │ ├── encoder_define.hh │ └── H264FramedLiveSource.hh └── Makefile /lib/x264lib/libx264.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angel-devil/live555_rtsp_live_v4l2/HEAD/lib/x264lib/libx264.a -------------------------------------------------------------------------------- /lib/livelib/libgroupsock.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angel-devil/live555_rtsp_live_v4l2/HEAD/lib/livelib/libgroupsock.a -------------------------------------------------------------------------------- /lib/livelib/libliveMedia.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angel-devil/live555_rtsp_live_v4l2/HEAD/lib/livelib/libliveMedia.a -------------------------------------------------------------------------------- /lib/x264lib/libx264.so.148: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angel-devil/live555_rtsp_live_v4l2/HEAD/lib/x264lib/libx264.so.148 -------------------------------------------------------------------------------- /lib/livelib/libUsageEnvironment.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angel-devil/live555_rtsp_live_v4l2/HEAD/lib/livelib/libUsageEnvironment.a -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # live555_rtsp_live_v4l2 2 | V4l2 capture camera data, x264 encoded into h264, and then through PIPE to achieve live555 RTSP live 3 | -------------------------------------------------------------------------------- /lib/livelib/libBasicUsageEnvironment.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angel-devil/live555_rtsp_live_v4l2/HEAD/lib/livelib/libBasicUsageEnvironment.a -------------------------------------------------------------------------------- /include/x264/x264_config.h: -------------------------------------------------------------------------------- 1 | #define X264_BIT_DEPTH 8 2 | #define X264_GPL 1 3 | #define X264_INTERLACED 1 4 | #define X264_CHROMA_FORMAT 0 5 | #define X264_REV 2721 6 | #define X264_REV_DIFF 0 7 | #define X264_VERSION " r2721 72d53ab" 8 | #define X264_POINTVER "0.148.2721 72d53ab" 9 | -------------------------------------------------------------------------------- /include/live555/groupsock/groupsock_version.hh: -------------------------------------------------------------------------------- 1 | // Version information for the "groupsock" library 2 | // Copyright (c) 1996-2017 Live Networks, Inc. All rights reserved. 3 | 4 | #ifndef _GROUPSOCK_VERSION_HH 5 | #define _GROUPSOCK_VERSION_HH 6 | 7 | #define GROUPSOCK_LIBRARY_VERSION_STRING "2017.01.26" 8 | #define GROUPSOCK_LIBRARY_VERSION_INT 1485388800 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /include/live555/liveMedia/liveMedia_version.hh: -------------------------------------------------------------------------------- 1 | // Version information for the "liveMedia" library 2 | // Copyright (c) 1996-2017 Live Networks, Inc. All rights reserved. 3 | 4 | #ifndef _LIVEMEDIA_VERSION_HH 5 | #define _LIVEMEDIA_VERSION_HH 6 | 7 | #define LIVEMEDIA_LIBRARY_VERSION_STRING "2017.01.26" 8 | #define LIVEMEDIA_LIBRARY_VERSION_INT 1485388800 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /include/live555/usageEnvironment/UsageEnvironment_version.hh: -------------------------------------------------------------------------------- 1 | // Version information for the "UsageEnvironment" library 2 | // Copyright (c) 1996-2017 Live Networks, Inc. All rights reserved. 3 | 4 | #ifndef _USAGEENVIRONMENT_VERSION_HH 5 | #define _USAGEENVIRONMENT_VERSION_HH 6 | 7 | #define USAGEENVIRONMENT_LIBRARY_VERSION_STRING "2017.01.26" 8 | #define USAGEENVIRONMENT_LIBRARY_VERSION_INT 1485388800 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /include/live555/basicUsageEnvironment/BasicUsageEnvironment_version.hh: -------------------------------------------------------------------------------- 1 | // Version information for the "BasicUsageEnvironment" library 2 | // Copyright (c) 1996-2017 Live Networks, Inc. All rights reserved. 3 | 4 | #ifndef _BASICUSAGEENVIRONMENT_VERSION_HH 5 | #define _BASICUSAGEENVIRONMENT_VERSION_HH 6 | 7 | #define BASICUSAGEENVIRONMENT_LIBRARY_VERSION_STRING "2017.01.26" 8 | #define BASICUSAGEENVIRONMENT_LIBRARY_VERSION_INT 1485388800 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /include/encoder/encoder_define.hh: -------------------------------------------------------------------------------- 1 | /*============================================================================= 2 | * # FileName: 3 | * # Desc: 4 | * # Author: licaibiao 5 | * # Version: 6 | * # LastChange: 2017-02-24 7 | * =============================================================================*/ 8 | #ifndef _ENCODER_DEFINE_HH 9 | #define _ENCODER_DEFINE_HH 10 | 11 | 12 | extern "C" { 13 | #include 14 | //#include 15 | #include 16 | 17 | typedef struct 18 | { 19 | x264_param_t *param; 20 | x264_t *handle; 21 | x264_picture_t *picture; 22 | x264_nal_t *nal; 23 | } Encoder; 24 | 25 | typedef struct 26 | { 27 | char *start; 28 | int length; 29 | }BUFTYPE; 30 | 31 | } 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /include/live555/groupsock/IOHandlers.hh: -------------------------------------------------------------------------------- 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 .) 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 | // "mTunnel" multicast access service 17 | // Copyright (c) 1996-2017 Live Networks, Inc. All rights reserved. 18 | // IO event handlers 19 | // C++ header 20 | 21 | #ifndef _IO_HANDLERS_HH 22 | #define _IO_HANDLERS_HH 23 | 24 | #ifndef _NET_INTERFACE_HH 25 | #include "NetInterface.hh" 26 | #endif 27 | 28 | // Handles incoming data on sockets: 29 | void socketReadHandler(Socket* sock, int mask); 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /include/live555/liveMedia/OutputFile.hh: -------------------------------------------------------------------------------- 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 .) 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-2017 Live Networks, Inc. All rights reserved. 18 | // Common routines for opening/closing named output files 19 | // C++ header 20 | 21 | #ifndef _OUTPUT_FILE_HH 22 | #define _OUTPUT_FILE_HH 23 | 24 | #include 25 | #include 26 | 27 | FILE* OpenOutputFile(UsageEnvironment& env, char const* fileName); 28 | 29 | void CloseOutputFile(FILE* fid); 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | INCLUDES = -I./include/live555/usageEnvironment/ -I./include/live555/groupsock/ \ 2 | -I./include/live555/liveMedia/ -I./include/live555/basicUsageEnvironment \ 3 | -I./include/x264 -I./include/encoder 4 | LIVE555_LIBS = ./lib/livelib/libliveMedia.a ./lib/livelib/libgroupsock.a \ 5 | ./lib/livelib/libBasicUsageEnvironment.a ./lib/livelib/libUsageEnvironment.a 6 | X264_LIBS = ./lib/x264lib/libx264.a ./lib/x264lib/libx264.so.148 7 | LIBS = $(LIVE555_LIBS) $(X264_LIBS) 8 | 9 | COMPILE_OPTS = $(INCLUDES) -I. -O2 -DSOCKLEN_T=socklen_t -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64 -g 10 | C = c 11 | C_COMPILER = cc 12 | C_FLAGS = $(COMPILE_OPTS) $(CPPFLAGS) $(CFLAGS) 13 | CPP = cpp 14 | CPLUSPLUS_COMPILER = c++ 15 | CPLUSPLUS_FLAGS = $(COMPILE_OPTS) -Wall -DBSD=1 $(CPPFLAGS) $(CXXFLAGS) 16 | OBJ = o 17 | LINK = c++ -o 18 | LINK_OPTS = -ldl -lm -lpthread -ldl -g 19 | CONSOLE_LINK_OPTS = $(LINK_OPTS) 20 | LINK_OBJ = H264FramedLiveSource.o H264VideoStreamer.o 21 | 22 | APP = H264VideoStreamer 23 | 24 | .$(C).$(OBJ): 25 | $(C_COMPILER) -c $(C_FLAGS) $< 26 | .$(CPP).$(OBJ): 27 | $(CPLUSPLUS_COMPILER) -c $(CPLUSPLUS_FLAGS) $< 28 | 29 | $(APP): $(LINK_OBJ) 30 | $(LINK)$@ $(LINK_OBJ) $(LIBS) $(CONSOLE_LINK_OPTS) 31 | 32 | clean: 33 | -rm -rf *.$(OBJ) $(APP) core *.core *~ include/*~ 34 | 35 | -------------------------------------------------------------------------------- /include/live555/liveMedia/FramedFileSource.hh: -------------------------------------------------------------------------------- 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 .) 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-2017 Live Networks, Inc. All rights reserved. 18 | // Framed File Sources 19 | // C++ header 20 | 21 | #ifndef _FRAMED_FILE_SOURCE_HH 22 | #define _FRAMED_FILE_SOURCE_HH 23 | 24 | #ifndef _FRAMED_SOURCE_HH 25 | #include "FramedSource.hh" 26 | #endif 27 | 28 | class FramedFileSource: public FramedSource { 29 | protected: 30 | FramedFileSource(UsageEnvironment& env, FILE* fid); // abstract base class 31 | virtual ~FramedFileSource(); 32 | 33 | protected: 34 | FILE* fFid; 35 | }; 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /include/live555/usageEnvironment/Boolean.hh: -------------------------------------------------------------------------------- 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 .) 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 | #ifndef _BOOLEAN_HH 17 | #define _BOOLEAN_HH 18 | 19 | #if defined(__BORLANDC__) || (!defined(USE_LIVE555_BOOLEAN) && defined(_MSC_VER) && _MSC_VER >= 1400) 20 | // Use the "bool" type defined by the Borland compiler, and MSVC++ 8.0, Visual Studio 2005 and higher 21 | typedef bool Boolean; 22 | #define False false 23 | #define True true 24 | #else 25 | typedef unsigned char Boolean; 26 | #ifndef __MSHTML_LIBRARY_DEFINED__ 27 | #ifndef False 28 | const Boolean False = 0; 29 | #endif 30 | #ifndef True 31 | const Boolean True = 1; 32 | #endif 33 | 34 | #endif 35 | #endif 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /include/encoder/H264FramedLiveSource.hh: -------------------------------------------------------------------------------- 1 | /*============================================================================= 2 | * # FileName: H264FramedLiveSource.hh 3 | * # Desc: 4 | * # 5 | * # Author: licaibiao 6 | * # Version: 7 | * # LastChange: 2017-02-24 8 | * =============================================================================*/ 9 | #ifndef _H264FRAMEDLIVESOURCE_HH 10 | #define _H264FRAMEDLIVESOURCE_HH 11 | #include 12 | #include 13 | #include "encoder_define.hh" 14 | 15 | class Device 16 | { 17 | public: 18 | void init_mmap(void); 19 | void init_camera(void); 20 | void init_encoder(void); 21 | void open_camera(void); 22 | 23 | void close_camera(void); 24 | void read_one_frame(void); 25 | void getnextframe(void); 26 | void start_capture(void); 27 | void stop_capture(void); 28 | void close_encoder(); 29 | int camera_able_read(void); 30 | void compress_begin(Encoder *en, int width, int height); 31 | int compress_frame(Encoder *en, int type, char *in, int len, char *out); 32 | void compress_end(Encoder *en); 33 | void Init(); 34 | void intoloop(); 35 | void GetNextFrame(); 36 | void Destory(); 37 | public: 38 | int fd; 39 | FILE *save_fd; 40 | int n_nal; 41 | int frame_len; 42 | char *h264_buf; 43 | unsigned int n_buffer; 44 | Encoder en; 45 | FILE *h264_fp; 46 | BUFTYPE *usr_buf; 47 | FILE *pipe_fd; 48 | }; 49 | #endif 50 | -------------------------------------------------------------------------------- /include/live555/liveMedia/QCELPAudioRTPSource.hh: -------------------------------------------------------------------------------- 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 .) 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-2017 Live Networks, Inc. All rights reserved. 18 | // Qualcomm "PureVoice" (aka. "QCELP") Audio RTP Sources 19 | // C++ header 20 | 21 | #ifndef _QCELP_AUDIO_RTP_SOURCE_HH 22 | #define _QCELP_AUDIO_RTP_SOURCE_HH 23 | 24 | #ifndef _RTP_SOURCE_HH 25 | #include "RTPSource.hh" 26 | #endif 27 | 28 | class QCELPAudioRTPSource { 29 | public: 30 | static FramedSource* createNew(UsageEnvironment& env, 31 | Groupsock* RTPgs, 32 | RTPSource*& resultRTPSource, 33 | unsigned char rtpPayloadFormat = 12, 34 | unsigned rtpTimestampFrequency = 8000); 35 | // This returns a source to read from, but "resultRTPSource" will 36 | // point to RTP-related state. 37 | }; 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /include/live555/usageEnvironment/strDup.hh: -------------------------------------------------------------------------------- 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 .) 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 | 17 | #ifndef _STRDUP_HH 18 | #define _STRDUP_HH 19 | 20 | // Copyright (c) 1996-2017 Live Networks, Inc. All rights reserved. 21 | // A C++ equivalent to the standard C routine "strdup()". 22 | // This generates a char* that can be deleted using "delete[]" 23 | // Header 24 | 25 | #include 26 | 27 | char* strDup(char const* str); 28 | // Note: strDup(NULL) returns NULL 29 | 30 | char* strDupSize(char const* str); 31 | // Like "strDup()", except that it *doesn't* copy the original. 32 | // (Instead, it just allocates a string of the same size as the original.) 33 | 34 | char* strDupSize(char const* str, size_t& resultBufSize); 35 | // An alternative form of "strDupSize()" that also returns the size of the allocated buffer. 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /include/live555/liveMedia/MP3Transcoder.hh: -------------------------------------------------------------------------------- 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 .) 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-2017 Live Networks, Inc. All rights reserved. 18 | // MP3 Transcoder 19 | // C++ header 20 | 21 | #ifndef _MP3_TRANSCODER_HH 22 | #define _MP3_TRANSCODER_HH 23 | 24 | #ifndef _MP3_ADU_HH 25 | #include "MP3ADU.hh" 26 | #endif 27 | #ifndef _MP3_ADU_TRANSCODER_HH 28 | #include "MP3ADUTranscoder.hh" 29 | #endif 30 | 31 | class MP3Transcoder: public MP3FromADUSource { 32 | public: 33 | static MP3Transcoder* createNew(UsageEnvironment& env, 34 | unsigned outBitrate /* in kbps */, 35 | FramedSource* inputSource); 36 | 37 | protected: 38 | MP3Transcoder(UsageEnvironment& env, 39 | MP3ADUTranscoder* aduTranscoder); 40 | // called only by createNew() 41 | virtual ~MP3Transcoder(); 42 | }; 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /include/live555/liveMedia/TextRTPSink.hh: -------------------------------------------------------------------------------- 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 .) 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-2017 Live Networks, Inc. All rights reserved. 18 | // A generic RTP sink for text codecs (abstract base class) 19 | // C++ header 20 | 21 | #ifndef _TEXT_RTP_SINK_HH 22 | #define _TEXT_RTP_SINK_HH 23 | 24 | #ifndef _MULTI_FRAMED_RTP_SINK_HH 25 | #include "MultiFramedRTPSink.hh" 26 | #endif 27 | 28 | class TextRTPSink: public MultiFramedRTPSink { 29 | protected: 30 | TextRTPSink(UsageEnvironment& env, 31 | Groupsock* rtpgs, unsigned char rtpPayloadType, 32 | unsigned rtpTimestampFrequency, 33 | char const* rtpPayloadFormatName); 34 | // (we're an abstract base class) 35 | virtual ~TextRTPSink(); 36 | 37 | private: // redefined virtual functions: 38 | virtual char const* sdpMediaType() const; 39 | }; 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /include/live555/liveMedia/VideoRTPSink.hh: -------------------------------------------------------------------------------- 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 .) 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-2017 Live Networks, Inc. All rights reserved. 18 | // A generic RTP sink for video codecs (abstract base class) 19 | // C++ header 20 | 21 | #ifndef _VIDEO_RTP_SINK_HH 22 | #define _VIDEO_RTP_SINK_HH 23 | 24 | #ifndef _MULTI_FRAMED_RTP_SINK_HH 25 | #include "MultiFramedRTPSink.hh" 26 | #endif 27 | 28 | class VideoRTPSink: public MultiFramedRTPSink { 29 | protected: 30 | VideoRTPSink(UsageEnvironment& env, 31 | Groupsock* rtpgs, unsigned char rtpPayloadType, 32 | unsigned rtpTimestampFrequency, 33 | char const* rtpPayloadFormatName); 34 | // (we're an abstract base class) 35 | virtual ~VideoRTPSink(); 36 | 37 | private: // redefined virtual functions: 38 | virtual char const* sdpMediaType() const; 39 | }; 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /include/live555/liveMedia/GSMAudioRTPSink.hh: -------------------------------------------------------------------------------- 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 .) 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-2017 Live Networks, Inc. All rights reserved. 18 | // RTP sink for GSM audio 19 | // C++ header 20 | 21 | #ifndef _GSM_AUDIO_RTP_SINK_HH 22 | #define _GSM_AUDIO_RTP_SINK_HH 23 | 24 | #ifndef _AUDIO_RTP_SINK_HH 25 | #include "AudioRTPSink.hh" 26 | #endif 27 | 28 | class GSMAudioRTPSink: public AudioRTPSink { 29 | public: 30 | static GSMAudioRTPSink* createNew(UsageEnvironment& env, Groupsock* RTPgs); 31 | 32 | protected: 33 | GSMAudioRTPSink(UsageEnvironment& env, Groupsock* RTPgs); 34 | // called only by createNew() 35 | 36 | virtual ~GSMAudioRTPSink(); 37 | 38 | private: // redefined virtual functions: 39 | virtual 40 | Boolean frameCanAppearAfterPacketStart(unsigned char const* frameStart, 41 | unsigned numBytesInFrame) const; 42 | }; 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /include/live555/liveMedia/AudioRTPSink.hh: -------------------------------------------------------------------------------- 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 .) 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-2017 Live Networks, Inc. All rights reserved. 18 | // A generic RTP sink for audio codecs (abstract base class) 19 | // C++ header 20 | 21 | #ifndef _AUDIO_RTP_SINK_HH 22 | #define _AUDIO_RTP_SINK_HH 23 | 24 | #ifndef _MULTI_FRAMED_RTP_SINK_HH 25 | #include "MultiFramedRTPSink.hh" 26 | #endif 27 | 28 | class AudioRTPSink: public MultiFramedRTPSink { 29 | protected: 30 | AudioRTPSink(UsageEnvironment& env, 31 | Groupsock* rtpgs, unsigned char rtpPayloadType, 32 | unsigned rtpTimestampFrequency, 33 | char const* rtpPayloadFormatName, 34 | unsigned numChannels = 1); 35 | // (we're an abstract base class) 36 | virtual ~AudioRTPSink(); 37 | 38 | private: // redefined virtual functions: 39 | virtual char const* sdpMediaType() const; 40 | }; 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /include/live555/liveMedia/AMRAudioFileSource.hh: -------------------------------------------------------------------------------- 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 .) 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-2017 Live Networks, Inc. All rights reserved. 18 | // A source object for AMR audio files (as defined in RFC 4867, section 5) 19 | // C++ header 20 | 21 | #ifndef _AMR_AUDIO_FILE_SOURCE_HH 22 | #define _AMR_AUDIO_FILE_SOURCE_HH 23 | 24 | #ifndef _AMR_AUDIO_SOURCE_HH 25 | #include "AMRAudioSource.hh" 26 | #endif 27 | 28 | class AMRAudioFileSource: public AMRAudioSource { 29 | public: 30 | static AMRAudioFileSource* createNew(UsageEnvironment& env, 31 | char const* fileName); 32 | 33 | private: 34 | AMRAudioFileSource(UsageEnvironment& env, FILE* fid, 35 | Boolean isWideband, unsigned numChannels); 36 | // called only by createNew() 37 | 38 | virtual ~AMRAudioFileSource(); 39 | 40 | private: 41 | // redefined virtual functions: 42 | virtual void doGetNextFrame(); 43 | 44 | private: 45 | FILE* fFid; 46 | }; 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /include/live555/liveMedia/FileServerMediaSubsession.hh: -------------------------------------------------------------------------------- 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 .) 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-2017 Live Networks, Inc. All rights reserved. 18 | // A 'ServerMediaSubsession' object that creates new, unicast, "RTPSink"s 19 | // on demand, from a file. 20 | // C++ header 21 | 22 | #ifndef _FILE_SERVER_MEDIA_SUBSESSION_HH 23 | #define _FILE_SERVER_MEDIA_SUBSESSION_HH 24 | 25 | #ifndef _SERVER_MEDIA_SESSION_HH 26 | #include "ServerMediaSession.hh" 27 | #endif 28 | #ifndef _ON_DEMAND_SERVER_MEDIA_SUBSESSION_HH 29 | #include "OnDemandServerMediaSubsession.hh" 30 | #endif 31 | 32 | class FileServerMediaSubsession: public OnDemandServerMediaSubsession { 33 | protected: // we're a virtual base class 34 | FileServerMediaSubsession(UsageEnvironment& env, char const* fileName, 35 | Boolean reuseFirstSource); 36 | virtual ~FileServerMediaSubsession(); 37 | 38 | protected: 39 | char const* fFileName; 40 | u_int64_t fFileSize; // if known 41 | }; 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /include/live555/liveMedia/MP3ADURTPSource.hh: -------------------------------------------------------------------------------- 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 .) 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-2017 Live Networks, Inc. All rights reserved. 18 | // RTP source for 'ADUized' MP3 frames ("mpa-robust") 19 | // C++ header 20 | 21 | #ifndef _MP3_ADU_SOURCE_HH 22 | #define _MP3_ADU_SOURCE_HH 23 | 24 | #ifndef _MULTI_FRAMED_RTP_SOURCE_HH 25 | #include "MultiFramedRTPSource.hh" 26 | #endif 27 | 28 | class MP3ADURTPSource: public MultiFramedRTPSource { 29 | public: 30 | static MP3ADURTPSource* 31 | createNew(UsageEnvironment& env, Groupsock* RTPgs, 32 | unsigned char rtpPayloadFormat, 33 | unsigned rtpTimestampFrequency = 90000); 34 | 35 | protected: 36 | virtual ~MP3ADURTPSource(); 37 | 38 | private: 39 | MP3ADURTPSource(UsageEnvironment& env, Groupsock* RTPgs, 40 | unsigned char rtpPayloadFormat, 41 | unsigned rtpTimestampFrequency); 42 | // called only by createNew() 43 | 44 | private: 45 | // redefined virtual functions: 46 | virtual char const* MIMEtype() const; 47 | }; 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /include/live555/liveMedia/H265VideoStreamFramer.hh: -------------------------------------------------------------------------------- 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 .) 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-2017 Live Networks, Inc. All rights reserved. 18 | // A filter that breaks up a H.265 Video Elementary Stream into NAL units. 19 | // C++ header 20 | 21 | #ifndef _H265_VIDEO_STREAM_FRAMER_HH 22 | #define _H265_VIDEO_STREAM_FRAMER_HH 23 | 24 | #ifndef _H264_OR_5_VIDEO_STREAM_FRAMER_HH 25 | #include "H264or5VideoStreamFramer.hh" 26 | #endif 27 | 28 | class H265VideoStreamFramer: public H264or5VideoStreamFramer { 29 | public: 30 | static H265VideoStreamFramer* createNew(UsageEnvironment& env, FramedSource* inputSource, 31 | Boolean includeStartCodeInOutput = False); 32 | 33 | protected: 34 | H265VideoStreamFramer(UsageEnvironment& env, FramedSource* inputSource, Boolean createParser, Boolean includeStartCodeInOutput); 35 | // called only by "createNew()" 36 | virtual ~H265VideoStreamFramer(); 37 | 38 | // redefined virtual functions: 39 | virtual Boolean isH265VideoStreamFramer() const; 40 | }; 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /include/live555/liveMedia/H264VideoStreamFramer.hh: -------------------------------------------------------------------------------- 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 .) 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-2017 Live Networks, Inc. All rights reserved. 18 | // A filter that breaks up a H.264 Video Elementary Stream into NAL units. 19 | // C++ header 20 | 21 | #ifndef _H264_VIDEO_STREAM_FRAMER_HH 22 | #define _H264_VIDEO_STREAM_FRAMER_HH 23 | 24 | #ifndef _H264_OR_5_VIDEO_STREAM_FRAMER_HH 25 | #include "H264or5VideoStreamFramer.hh" 26 | #endif 27 | 28 | class H264VideoStreamFramer: public H264or5VideoStreamFramer { 29 | public: 30 | static H264VideoStreamFramer* createNew(UsageEnvironment& env, FramedSource* inputSource, 31 | Boolean includeStartCodeInOutput = False); 32 | 33 | protected: 34 | H264VideoStreamFramer(UsageEnvironment& env, FramedSource* inputSource, 35 | Boolean createParser, Boolean includeStartCodeInOutput); 36 | // called only by "createNew()" 37 | virtual ~H264VideoStreamFramer(); 38 | 39 | // redefined virtual functions: 40 | virtual Boolean isH264VideoStreamFramer() const; 41 | }; 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /include/live555/liveMedia/Base64.hh: -------------------------------------------------------------------------------- 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 .) 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-2017 Live Networks, Inc. All rights reserved. 18 | // Base64 encoding and decoding 19 | // C++ header 20 | 21 | #ifndef _BASE64_HH 22 | #define _BASE64_HH 23 | 24 | #ifndef _BOOLEAN_HH 25 | #include "Boolean.hh" 26 | #endif 27 | 28 | unsigned char* base64Decode(char const* in, unsigned& resultSize, 29 | Boolean trimTrailingZeros = True); 30 | // returns a newly allocated array - of size "resultSize" - that 31 | // the caller is responsible for delete[]ing. 32 | 33 | unsigned char* base64Decode(char const* in, unsigned inSize, 34 | unsigned& resultSize, 35 | Boolean trimTrailingZeros = True); 36 | // As above, but includes the size of the input string (i.e., the number of bytes to decode) as a parameter. 37 | // This saves an extra call to "strlen()" if we already know the length of the input string. 38 | 39 | char* base64Encode(char const* orig, unsigned origLength); 40 | // returns a 0-terminated string that 41 | // the caller is responsible for delete[]ing. 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /include/live555/liveMedia/H264or5VideoFileSink.hh: -------------------------------------------------------------------------------- 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 .) 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-2017 Live Networks, Inc. All rights reserved. 18 | // H.264 or H.265 Video File Sinks 19 | // C++ header 20 | 21 | #ifndef _H264_OR_5_VIDEO_FILE_SINK_HH 22 | #define _H264_OR_5_VIDEO_FILE_SINK_HH 23 | 24 | #ifndef _FILE_SINK_HH 25 | #include "FileSink.hh" 26 | #endif 27 | 28 | class H264or5VideoFileSink: public FileSink { 29 | protected: 30 | H264or5VideoFileSink(UsageEnvironment& env, FILE* fid, 31 | unsigned bufferSize, char const* perFrameFileNamePrefix, 32 | char const* sPropParameterSetsStr1, 33 | char const* sPropParameterSetsStr2 = NULL, 34 | char const* sPropParameterSetsStr3 = NULL); 35 | // we're an abstract base class 36 | virtual ~H264or5VideoFileSink(); 37 | 38 | protected: // redefined virtual functions: 39 | virtual void afterGettingFrame(unsigned frameSize, unsigned numTruncatedBytes, struct timeval presentationTime); 40 | 41 | private: 42 | char const* fSPropParameterSetsStr[3]; 43 | Boolean fHaveWrittenFirstFrame; 44 | }; 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /include/live555/liveMedia/AMRAudioSource.hh: -------------------------------------------------------------------------------- 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 .) 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-2017 Live Networks, Inc. All rights reserved. 18 | // A source object for AMR audio sources 19 | // C++ header 20 | 21 | #ifndef _AMR_AUDIO_SOURCE_HH 22 | #define _AMR_AUDIO_SOURCE_HH 23 | 24 | #ifndef _FRAMED_SOURCE_HH 25 | #include "FramedSource.hh" 26 | #endif 27 | 28 | class AMRAudioSource: public FramedSource { 29 | public: 30 | Boolean isWideband() const { return fIsWideband; } 31 | unsigned numChannels() const { return fNumChannels; } 32 | 33 | u_int8_t lastFrameHeader() const { return fLastFrameHeader; } 34 | // The frame header for the most recently read frame (RFC 4867, sec. 5.3) 35 | 36 | protected: 37 | AMRAudioSource(UsageEnvironment& env, Boolean isWideband, unsigned numChannels); 38 | // virtual base class 39 | virtual ~AMRAudioSource(); 40 | 41 | private: 42 | // redefined virtual functions: 43 | virtual char const* MIMEtype() const; 44 | virtual Boolean isAMRAudioSource() const; 45 | 46 | protected: 47 | Boolean fIsWideband; 48 | unsigned fNumChannels; 49 | u_int8_t fLastFrameHeader; 50 | }; 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /include/live555/liveMedia/DVVideoRTPSource.hh: -------------------------------------------------------------------------------- 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 .) 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-2017 Live Networks, Inc. All rights reserved. 18 | // DV Video RTP Sources 19 | // C++ header 20 | 21 | #ifndef _DV_VIDEO_RTP_SOURCE_HH 22 | #define _DV_VIDEO_RTP_SOURCE_HH 23 | 24 | #ifndef _MULTI_FRAMED_RTP_SOURCE_HH 25 | #include "MultiFramedRTPSource.hh" 26 | #endif 27 | 28 | class DVVideoRTPSource: public MultiFramedRTPSource { 29 | public: 30 | static DVVideoRTPSource* 31 | createNew(UsageEnvironment& env, Groupsock* RTPgs, 32 | unsigned char rtpPayloadFormat, 33 | unsigned rtpTimestampFrequency); 34 | 35 | protected: 36 | virtual ~DVVideoRTPSource(); 37 | 38 | private: 39 | DVVideoRTPSource(UsageEnvironment& env, Groupsock* RTPgs, 40 | unsigned char rtpPayloadFormat, 41 | unsigned rtpTimestampFrequency); 42 | // called only by createNew() 43 | 44 | private: 45 | // redefined virtual functions: 46 | virtual Boolean processSpecialHeader(BufferedPacket* packet, 47 | unsigned& resultSpecialHeaderSize); 48 | virtual char const* MIMEtype() const; 49 | }; 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /include/live555/liveMedia/FramedFilter.hh: -------------------------------------------------------------------------------- 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 .) 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-2017 Live Networks, Inc. All rights reserved. 18 | // Framed Filters 19 | // C++ header 20 | 21 | #ifndef _FRAMED_FILTER_HH 22 | #define _FRAMED_FILTER_HH 23 | 24 | #ifndef _FRAMED_SOURCE_HH 25 | #include "FramedSource.hh" 26 | #endif 27 | 28 | class FramedFilter: public FramedSource { 29 | public: 30 | FramedSource* inputSource() const { return fInputSource; } 31 | 32 | void reassignInputSource(FramedSource* newInputSource) { fInputSource = newInputSource; } 33 | 34 | // Call before destruction if you want to prevent the destructor from closing the input source 35 | void detachInputSource(); 36 | 37 | protected: 38 | FramedFilter(UsageEnvironment& env, FramedSource* inputSource); 39 | // abstract base class 40 | virtual ~FramedFilter(); 41 | 42 | protected: 43 | // Redefined virtual functions (with default 'null' implementations): 44 | virtual char const* MIMEtype() const; 45 | virtual void getAttributes() const; 46 | virtual void doStopGettingFrames(); 47 | 48 | protected: 49 | FramedSource* fInputSource; 50 | }; 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /include/live555/liveMedia/VP8VideoRTPSource.hh: -------------------------------------------------------------------------------- 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 .) 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-2017 Live Networks, Inc. All rights reserved. 18 | // VP8 Video RTP Sources 19 | // C++ header 20 | 21 | #ifndef _VP8_VIDEO_RTP_SOURCE_HH 22 | #define _VP8_VIDEO_RTP_SOURCE_HH 23 | 24 | #ifndef _MULTI_FRAMED_RTP_SOURCE_HH 25 | #include "MultiFramedRTPSource.hh" 26 | #endif 27 | 28 | class VP8VideoRTPSource: public MultiFramedRTPSource { 29 | public: 30 | static VP8VideoRTPSource* 31 | createNew(UsageEnvironment& env, Groupsock* RTPgs, 32 | unsigned char rtpPayloadFormat, 33 | unsigned rtpTimestampFrequency = 90000); 34 | 35 | protected: 36 | VP8VideoRTPSource(UsageEnvironment& env, Groupsock* RTPgs, 37 | unsigned char rtpPayloadFormat, 38 | unsigned rtpTimestampFrequency); 39 | // called only by createNew() 40 | 41 | virtual ~VP8VideoRTPSource(); 42 | 43 | protected: 44 | // redefined virtual functions: 45 | virtual Boolean processSpecialHeader(BufferedPacket* packet, 46 | unsigned& resultSpecialHeaderSize); 47 | virtual char const* MIMEtype() const; 48 | }; 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /include/live555/liveMedia/VP9VideoRTPSource.hh: -------------------------------------------------------------------------------- 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 .) 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-2017 Live Networks, Inc. All rights reserved. 18 | // VP9 Video RTP Sources 19 | // C++ header 20 | 21 | #ifndef _VP9_VIDEO_RTP_SOURCE_HH 22 | #define _VP9_VIDEO_RTP_SOURCE_HH 23 | 24 | #ifndef _MULTI_FRAMED_RTP_SOURCE_HH 25 | #include "MultiFramedRTPSource.hh" 26 | #endif 27 | 28 | class VP9VideoRTPSource: public MultiFramedRTPSource { 29 | public: 30 | static VP9VideoRTPSource* 31 | createNew(UsageEnvironment& env, Groupsock* RTPgs, 32 | unsigned char rtpPayloadFormat, 33 | unsigned rtpTimestampFrequency = 90000); 34 | 35 | protected: 36 | VP9VideoRTPSource(UsageEnvironment& env, Groupsock* RTPgs, 37 | unsigned char rtpPayloadFormat, 38 | unsigned rtpTimestampFrequency); 39 | // called only by createNew() 40 | 41 | virtual ~VP9VideoRTPSource(); 42 | 43 | protected: 44 | // redefined virtual functions: 45 | virtual Boolean processSpecialHeader(BufferedPacket* packet, 46 | unsigned& resultSpecialHeaderSize); 47 | virtual char const* MIMEtype() const; 48 | }; 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /include/live555/liveMedia/AC3AudioRTPSource.hh: -------------------------------------------------------------------------------- 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 .) 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-2017 Live Networks, Inc. All rights reserved. 18 | // AC3 Audio RTP Sources 19 | // C++ header 20 | 21 | #ifndef _AC3_AUDIO_RTP_SOURCE_HH 22 | #define _AC3_AUDIO_RTP_SOURCE_HH 23 | 24 | #ifndef _MULTI_FRAMED_RTP_SOURCE_HH 25 | #include "MultiFramedRTPSource.hh" 26 | #endif 27 | 28 | class AC3AudioRTPSource: public MultiFramedRTPSource { 29 | public: 30 | static AC3AudioRTPSource* 31 | createNew(UsageEnvironment& env, Groupsock* RTPgs, 32 | unsigned char rtpPayloadFormat, 33 | unsigned rtpTimestampFrequency); 34 | 35 | protected: 36 | virtual ~AC3AudioRTPSource(); 37 | 38 | private: 39 | AC3AudioRTPSource(UsageEnvironment& env, Groupsock* RTPgs, 40 | unsigned char rtpPayloadFormat, 41 | unsigned rtpTimestampFrequency); 42 | // called only by createNew() 43 | 44 | private: 45 | // redefined virtual functions: 46 | virtual Boolean processSpecialHeader(BufferedPacket* packet, 47 | unsigned& resultSpecialHeaderSize); 48 | virtual char const* MIMEtype() const; 49 | }; 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /include/live555/liveMedia/BasicUDPSource.hh: -------------------------------------------------------------------------------- 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 .) 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-2017 Live Networks, Inc. All rights reserved. 18 | // A simple UDP source, where every UDP payload is a complete frame 19 | // C++ header 20 | 21 | #ifndef _BASIC_UDP_SOURCE_HH 22 | #define _BASIC_UDP_SOURCE_HH 23 | 24 | #ifndef _FRAMED_SOURCE_HH 25 | #include "FramedSource.hh" 26 | #endif 27 | #ifndef _GROUPSOCK_HH 28 | #include "Groupsock.hh" 29 | #endif 30 | 31 | class BasicUDPSource: public FramedSource { 32 | public: 33 | static BasicUDPSource* createNew(UsageEnvironment& env, Groupsock* inputGS); 34 | 35 | virtual ~BasicUDPSource(); 36 | 37 | Groupsock* gs() const { return fInputGS; } 38 | 39 | private: 40 | BasicUDPSource(UsageEnvironment& env, Groupsock* inputGS); 41 | // called only by createNew() 42 | 43 | static void incomingPacketHandler(BasicUDPSource* source, int mask); 44 | void incomingPacketHandler1(); 45 | 46 | private: // redefined virtual functions: 47 | virtual void doGetNextFrame(); 48 | virtual void doStopGettingFrames(); 49 | 50 | private: 51 | Groupsock* fInputGS; 52 | Boolean fHaveStartedReading; 53 | }; 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /include/live555/liveMedia/MPEG4ESVideoRTPSource.hh: -------------------------------------------------------------------------------- 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 .) 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-2017 Live Networks, Inc. All rights reserved. 18 | // MP4V-ES video RTP stream sources 19 | // C++ header 20 | 21 | #ifndef _MPEG4_ES_VIDEO_RTP_SOURCE_HH 22 | #define _MPEG4_ES_VIDEO_RTP_SOURCE_HH 23 | 24 | #ifndef _MULTI_FRAMED_RTP_SOURCE_HH 25 | #include "MultiFramedRTPSource.hh" 26 | #endif 27 | 28 | class MPEG4ESVideoRTPSource: public MultiFramedRTPSource { 29 | public: 30 | static MPEG4ESVideoRTPSource* 31 | createNew(UsageEnvironment& env, Groupsock* RTPgs, 32 | unsigned char rtpPayloadFormat, 33 | unsigned rtpTimestampFrequency); 34 | 35 | protected: 36 | virtual ~MPEG4ESVideoRTPSource(); 37 | 38 | private: 39 | MPEG4ESVideoRTPSource(UsageEnvironment& env, Groupsock* RTPgs, 40 | unsigned char rtpPayloadFormat, 41 | unsigned rtpTimestampFrequency); 42 | // called only by createNew() 43 | 44 | private: 45 | // redefined virtual functions: 46 | virtual Boolean processSpecialHeader(BufferedPacket* packet, 47 | unsigned& resultSpecialHeaderSize); 48 | virtual char const* MIMEtype() const; 49 | }; 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /include/live555/liveMedia/H264VideoStreamDiscreteFramer.hh: -------------------------------------------------------------------------------- 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 .) 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-2017 Live Networks, Inc. All rights reserved. 18 | // A simplified version of "H264VideoStreamFramer" that takes only complete, 19 | // discrete frames (rather than an arbitrary byte stream) as input. 20 | // This avoids the parsing and data copying overhead of the full 21 | // "H264VideoStreamFramer". 22 | // C++ header 23 | 24 | #ifndef _H264_VIDEO_STREAM_DISCRETE_FRAMER_HH 25 | #define _H264_VIDEO_STREAM_DISCRETE_FRAMER_HH 26 | 27 | #ifndef _H264_OR_5_VIDEO_STREAM_DISCRETE_FRAMER_HH 28 | #include "H264or5VideoStreamDiscreteFramer.hh" 29 | #endif 30 | 31 | class H264VideoStreamDiscreteFramer: public H264or5VideoStreamDiscreteFramer { 32 | public: 33 | static H264VideoStreamDiscreteFramer* 34 | createNew(UsageEnvironment& env, FramedSource* inputSource); 35 | 36 | protected: 37 | H264VideoStreamDiscreteFramer(UsageEnvironment& env, FramedSource* inputSource); 38 | // called only by createNew() 39 | virtual ~H264VideoStreamDiscreteFramer(); 40 | 41 | private: 42 | // redefined virtual functions: 43 | virtual Boolean isH264VideoStreamFramer() const; 44 | }; 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /include/live555/liveMedia/H265VideoStreamDiscreteFramer.hh: -------------------------------------------------------------------------------- 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 .) 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-2017 Live Networks, Inc. All rights reserved. 18 | // A simplified version of "H265VideoStreamFramer" that takes only complete, 19 | // discrete frames (rather than an arbitrary byte stream) as input. 20 | // This avoids the parsing and data copying overhead of the full 21 | // "H265VideoStreamFramer". 22 | // C++ header 23 | 24 | #ifndef _H265_VIDEO_STREAM_DISCRETE_FRAMER_HH 25 | #define _H265_VIDEO_STREAM_DISCRETE_FRAMER_HH 26 | 27 | #ifndef _H264_OR_5_VIDEO_STREAM_DISCRETE_FRAMER_HH 28 | #include "H264or5VideoStreamDiscreteFramer.hh" 29 | #endif 30 | 31 | class H265VideoStreamDiscreteFramer: public H264or5VideoStreamDiscreteFramer { 32 | public: 33 | static H265VideoStreamDiscreteFramer* 34 | createNew(UsageEnvironment& env, FramedSource* inputSource); 35 | 36 | protected: 37 | H265VideoStreamDiscreteFramer(UsageEnvironment& env, FramedSource* inputSource); 38 | // called only by createNew() 39 | virtual ~H265VideoStreamDiscreteFramer(); 40 | 41 | private: 42 | // redefined virtual functions: 43 | virtual Boolean isH265VideoStreamFramer() const; 44 | }; 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /include/live555/liveMedia/MPEG1or2AudioRTPSink.hh: -------------------------------------------------------------------------------- 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 .) 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-2017 Live Networks, Inc. All rights reserved. 18 | // RTP sink for MPEG audio (RFC 2250) 19 | // C++ header 20 | 21 | #ifndef _MPEG_1OR2_AUDIO_RTP_SINK_HH 22 | #define _MPEG_1OR2_AUDIO_RTP_SINK_HH 23 | 24 | #ifndef _AUDIO_RTP_SINK_HH 25 | #include "AudioRTPSink.hh" 26 | #endif 27 | 28 | class MPEG1or2AudioRTPSink: public AudioRTPSink { 29 | public: 30 | static MPEG1or2AudioRTPSink* createNew(UsageEnvironment& env, 31 | Groupsock* RTPgs); 32 | 33 | protected: 34 | MPEG1or2AudioRTPSink(UsageEnvironment& env, Groupsock* RTPgs); 35 | // called only by createNew() 36 | 37 | virtual ~MPEG1or2AudioRTPSink(); 38 | 39 | private: // redefined virtual functions: 40 | virtual void doSpecialFrameHandling(unsigned fragmentationOffset, 41 | unsigned char* frameStart, 42 | unsigned numBytesInFrame, 43 | struct timeval framePresentationTime, 44 | unsigned numRemainingBytes); 45 | virtual unsigned specialHeaderSize() const; 46 | }; 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /include/live555/liveMedia/AMRAudioFileSink.hh: -------------------------------------------------------------------------------- 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 .) 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-2017 Live Networks, Inc. All rights reserved. 18 | // AMR Audio File Sinks 19 | // C++ header 20 | 21 | #ifndef _AMR_AUDIO_FILE_SINK_HH 22 | #define _AMR_AUDIO_FILE_SINK_HH 23 | 24 | #ifndef _FILE_SINK_HH 25 | #include "FileSink.hh" 26 | #endif 27 | 28 | class AMRAudioFileSink: public FileSink { 29 | public: 30 | static AMRAudioFileSink* createNew(UsageEnvironment& env, char const* fileName, 31 | unsigned bufferSize = 10000, 32 | Boolean oneFilePerFrame = False); 33 | // (See "FileSink.hh" for a description of these parameters.) 34 | 35 | protected: 36 | AMRAudioFileSink(UsageEnvironment& env, FILE* fid, unsigned bufferSize, 37 | char const* perFrameFileNamePrefix); 38 | // called only by createNew() 39 | virtual ~AMRAudioFileSink(); 40 | 41 | protected: // redefined virtual functions: 42 | virtual Boolean sourceIsCompatibleWithUs(MediaSource& source); 43 | virtual void afterGettingFrame(unsigned frameSize, 44 | unsigned numTruncatedBytes, 45 | struct timeval presentationTime); 46 | 47 | protected: 48 | Boolean fHaveWrittenHeader; 49 | }; 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /include/live555/liveMedia/MPEG1or2AudioRTPSource.hh: -------------------------------------------------------------------------------- 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 .) 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-2017 Live Networks, Inc. All rights reserved. 18 | // MPEG-1 or MPEG-2 Audio RTP Sources 19 | // C++ header 20 | 21 | #ifndef _MPEG_1OR2_AUDIO_RTP_SOURCE_HH 22 | #define _MPEG_1OR2_AUDIO_RTP_SOURCE_HH 23 | 24 | #ifndef _MULTI_FRAMED_RTP_SOURCE_HH 25 | #include "MultiFramedRTPSource.hh" 26 | #endif 27 | 28 | class MPEG1or2AudioRTPSource: public MultiFramedRTPSource { 29 | public: 30 | static MPEG1or2AudioRTPSource* 31 | createNew(UsageEnvironment& env, Groupsock* RTPgs, 32 | unsigned char rtpPayloadFormat = 14, 33 | unsigned rtpTimestampFrequency = 90000); 34 | 35 | protected: 36 | virtual ~MPEG1or2AudioRTPSource(); 37 | 38 | private: 39 | MPEG1or2AudioRTPSource(UsageEnvironment& env, Groupsock* RTPgs, 40 | unsigned char rtpPayloadFormat, 41 | unsigned rtpTimestampFrequency); 42 | // called only by createNew() 43 | 44 | private: 45 | // redefined virtual functions: 46 | virtual Boolean processSpecialHeader(BufferedPacket* packet, 47 | unsigned& resultSpecialHeaderSize); 48 | virtual char const* MIMEtype() const; 49 | }; 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /include/live555/liveMedia/H264VideoFileSink.hh: -------------------------------------------------------------------------------- 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 .) 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-2017 Live Networks, Inc. All rights reserved. 18 | // H.264 Video File Sinks 19 | // C++ header 20 | 21 | #ifndef _H264_VIDEO_FILE_SINK_HH 22 | #define _H264_VIDEO_FILE_SINK_HH 23 | 24 | #ifndef _H264_OR_5_VIDEO_FILE_SINK_HH 25 | #include "H264or5VideoFileSink.hh" 26 | #endif 27 | 28 | class H264VideoFileSink: public H264or5VideoFileSink { 29 | public: 30 | static H264VideoFileSink* createNew(UsageEnvironment& env, char const* fileName, 31 | char const* sPropParameterSetsStr = NULL, 32 | // "sPropParameterSetsStr" is an optional 'SDP format' string 33 | // (comma-separated Base64-encoded) representing SPS and/or PPS NAL-units 34 | // to prepend to the output 35 | unsigned bufferSize = 100000, 36 | Boolean oneFilePerFrame = False); 37 | // See "FileSink.hh" for a description of these parameters. 38 | 39 | protected: 40 | H264VideoFileSink(UsageEnvironment& env, FILE* fid, 41 | char const* sPropParameterSetsStr, 42 | unsigned bufferSize, char const* perFrameFileNamePrefix); 43 | // called only by createNew() 44 | virtual ~H264VideoFileSink(); 45 | }; 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /include/live555/liveMedia/ourMD5.hh: -------------------------------------------------------------------------------- 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 .) 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-2017 Live Networks, Inc. All rights reserved. 18 | // Because MD5 may not be implemented (at least, with the same interface) on all systems, 19 | // we have our own implementation. 20 | // C++ header 21 | 22 | #ifndef _OUR_MD5_HH 23 | #define _OUR_MD5_HH 24 | 25 | extern char* our_MD5Data(unsigned char const* data, unsigned dataSize, char* outputDigest); 26 | // "outputDigest" must be either NULL (in which case this function returns a heap-allocated 27 | // buffer, which should be later delete[]d by the caller), or else it must point to 28 | // a (>=)33-byte buffer (which this function will also return). 29 | 30 | extern unsigned char* our_MD5DataRaw(unsigned char const* data, unsigned dataSize, 31 | unsigned char* outputDigest); 32 | // Like "ourMD5Data()", except that it returns the digest in 'raw' binary form, rather than 33 | // as an ASCII hex string. 34 | // "outputDigest" must be either NULL (in which case this function returns a heap-allocated 35 | // buffer, which should be later delete[]d by the caller), or else it must point to 36 | // a (>=)16-byte buffer (which this function will also return). 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /include/live555/liveMedia/AMRAudioRTPSource.hh: -------------------------------------------------------------------------------- 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 .) 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-2017 Live Networks, Inc. All rights reserved. 18 | // AMR Audio RTP Sources (RFC 4867) 19 | // C++ header 20 | 21 | #ifndef _AMR_AUDIO_RTP_SOURCE_HH 22 | #define _AMR_AUDIO_RTP_SOURCE_HH 23 | 24 | #ifndef _RTP_SOURCE_HH 25 | #include "RTPSource.hh" 26 | #endif 27 | #ifndef _AMR_AUDIO_SOURCE_HH 28 | #include "AMRAudioSource.hh" 29 | #endif 30 | 31 | class AMRAudioRTPSource { 32 | public: 33 | static AMRAudioSource* createNew(UsageEnvironment& env, 34 | Groupsock* RTPgs, 35 | RTPSource*& resultRTPSource, 36 | unsigned char rtpPayloadFormat, 37 | Boolean isWideband = False, 38 | unsigned numChannels = 1, 39 | Boolean isOctetAligned = True, 40 | unsigned interleaving = 0, 41 | // relevant only if "isOctetAligned" 42 | // The maximum # of frame-blocks in a group 43 | // 0 means: no interleaving 44 | Boolean robustSortingOrder = False, 45 | // relevant only if "isOctetAligned" 46 | Boolean CRCsArePresent = False 47 | // relevant only if "isOctetAligned" 48 | ); 49 | // This returns a source to read from, but "resultRTPSource" will 50 | // point to RTP-related state. 51 | }; 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /include/live555/liveMedia/H261VideoRTPSource.hh: -------------------------------------------------------------------------------- 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 .) 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-2017 Live Networks, Inc. All rights reserved. 18 | // H.261 Video RTP Sources 19 | // C++ header 20 | 21 | #ifndef _H261_VIDEO_RTP_SOURCE_HH 22 | #define _H261_VIDEO_RTP_SOURCE_HH 23 | 24 | #ifndef _MULTI_FRAMED_RTP_SOURCE_HH 25 | #include "MultiFramedRTPSource.hh" 26 | #endif 27 | 28 | class H261VideoRTPSource: public MultiFramedRTPSource { 29 | public: 30 | static H261VideoRTPSource* 31 | createNew(UsageEnvironment& env, Groupsock* RTPgs, 32 | unsigned char rtpPayloadFormat = 31, 33 | unsigned rtpTimestampFrequency = 90000); 34 | 35 | u_int32_t lastSpecialHeader() const {return fLastSpecialHeader;} 36 | 37 | protected: 38 | virtual ~H261VideoRTPSource(); 39 | 40 | private: 41 | H261VideoRTPSource(UsageEnvironment& env, Groupsock* RTPgs, 42 | unsigned char rtpPayloadFormat, 43 | unsigned rtpTimestampFrequency); 44 | // called only by createNew() 45 | 46 | private: 47 | // redefined virtual functions: 48 | virtual Boolean processSpecialHeader(BufferedPacket* packet, 49 | unsigned& resultSpecialHeaderSize); 50 | virtual char const* MIMEtype() const; 51 | 52 | private: 53 | u_int32_t fLastSpecialHeader; 54 | }; 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /include/live555/liveMedia/TheoraVideoRTPSource.hh: -------------------------------------------------------------------------------- 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 .) 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-2017 Live Networks, Inc. All rights reserved. 18 | // Theora Video Audio RTP Sources 19 | // C++ header 20 | 21 | #ifndef _THEORA_VIDEO_RTP_SOURCE_HH 22 | #define _THEORA_VIDEO_RTP_SOURCE_HH 23 | 24 | #ifndef _MULTI_FRAMED_RTP_SOURCE_HH 25 | #include "MultiFramedRTPSource.hh" 26 | #endif 27 | 28 | class TheoraVideoRTPSource: public MultiFramedRTPSource { 29 | public: 30 | static TheoraVideoRTPSource* 31 | createNew(UsageEnvironment& env, Groupsock* RTPgs, 32 | unsigned char rtpPayloadFormat); 33 | 34 | u_int32_t curPacketIdent() const { return fCurPacketIdent; } // The current "Ident" field; only the low-order 24 bits are used 35 | 36 | protected: 37 | TheoraVideoRTPSource(UsageEnvironment& env, Groupsock* RTPgs, 38 | unsigned char rtpPayloadFormat); 39 | // called only by createNew() 40 | 41 | virtual ~TheoraVideoRTPSource(); 42 | 43 | protected: 44 | // redefined virtual functions: 45 | virtual Boolean processSpecialHeader(BufferedPacket* packet, 46 | unsigned& resultSpecialHeaderSize); 47 | virtual char const* MIMEtype() const; 48 | 49 | private: 50 | u_int32_t fCurPacketIdent; // only the low-order 24 bits are used 51 | }; 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /include/live555/liveMedia/MPEG1or2VideoRTPSource.hh: -------------------------------------------------------------------------------- 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 .) 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-2017 Live Networks, Inc. All rights reserved. 18 | // MPEG-1 or MPEG-2 Video RTP Sources 19 | // C++ header 20 | 21 | #ifndef _MPEG_1OR2_VIDEO_RTP_SOURCE_HH 22 | #define _MPEG_1OR2_VIDEO_RTP_SOURCE_HH 23 | 24 | #ifndef _MULTI_FRAMED_RTP_SOURCE_HH 25 | #include "MultiFramedRTPSource.hh" 26 | #endif 27 | 28 | class MPEG1or2VideoRTPSource: public MultiFramedRTPSource { 29 | public: 30 | static MPEG1or2VideoRTPSource* 31 | createNew(UsageEnvironment& env, Groupsock* RTPgs, 32 | unsigned char rtpPayloadFormat = 32, 33 | unsigned rtpPayloadFrequency = 90000); 34 | 35 | protected: 36 | virtual ~MPEG1or2VideoRTPSource(); 37 | 38 | private: 39 | MPEG1or2VideoRTPSource(UsageEnvironment& env, Groupsock* RTPgs, 40 | unsigned char rtpPayloadFormat, 41 | unsigned rtpTimestampFrequency); 42 | // called only by createNew() 43 | 44 | private: 45 | // redefined virtual functions: 46 | virtual Boolean processSpecialHeader(BufferedPacket* packet, 47 | unsigned& resultSpecialHeaderSize); 48 | virtual Boolean packetIsUsableInJitterCalculation(unsigned char* packet, 49 | unsigned packetSize); 50 | virtual char const* MIMEtype() const; 51 | }; 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /include/live555/liveMedia/VP8VideoRTPSink.hh: -------------------------------------------------------------------------------- 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 .) 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-2017 Live Networks, Inc. All rights reserved. 18 | // RTP sink for VP8 video 19 | // C++ header 20 | 21 | #ifndef _VP8_VIDEO_RTP_SINK_HH 22 | #define _VP8_VIDEO_RTP_SINK_HH 23 | 24 | #ifndef _VIDEO_RTP_SINK_HH 25 | #include "VideoRTPSink.hh" 26 | #endif 27 | 28 | class VP8VideoRTPSink: public VideoRTPSink { 29 | public: 30 | static VP8VideoRTPSink* createNew(UsageEnvironment& env, Groupsock* RTPgs, unsigned char rtpPayloadFormat); 31 | 32 | protected: 33 | VP8VideoRTPSink(UsageEnvironment& env, Groupsock* RTPgs, unsigned char rtpPayloadFormat); 34 | // called only by createNew() 35 | 36 | virtual ~VP8VideoRTPSink(); 37 | 38 | private: // redefined virtual functions: 39 | virtual void doSpecialFrameHandling(unsigned fragmentationOffset, 40 | unsigned char* frameStart, 41 | unsigned numBytesInFrame, 42 | struct timeval framePresentationTime, 43 | unsigned numRemainingBytes); 44 | virtual 45 | Boolean frameCanAppearAfterPacketStart(unsigned char const* frameStart, 46 | unsigned numBytesInFrame) const; 47 | virtual unsigned specialHeaderSize() const; 48 | }; 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /include/live555/liveMedia/VP9VideoRTPSink.hh: -------------------------------------------------------------------------------- 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 .) 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-2017 Live Networks, Inc. All rights reserved. 18 | // RTP sink for VP9 video 19 | // C++ header 20 | 21 | #ifndef _VP9_VIDEO_RTP_SINK_HH 22 | #define _VP9_VIDEO_RTP_SINK_HH 23 | 24 | #ifndef _VIDEO_RTP_SINK_HH 25 | #include "VideoRTPSink.hh" 26 | #endif 27 | 28 | class VP9VideoRTPSink: public VideoRTPSink { 29 | public: 30 | static VP9VideoRTPSink* createNew(UsageEnvironment& env, Groupsock* RTPgs, unsigned char rtpPayloadFormat); 31 | 32 | protected: 33 | VP9VideoRTPSink(UsageEnvironment& env, Groupsock* RTPgs, unsigned char rtpPayloadFormat); 34 | // called only by createNew() 35 | 36 | virtual ~VP9VideoRTPSink(); 37 | 38 | private: // redefined virtual functions: 39 | virtual void doSpecialFrameHandling(unsigned fragmentationOffset, 40 | unsigned char* frameStart, 41 | unsigned numBytesInFrame, 42 | struct timeval framePresentationTime, 43 | unsigned numRemainingBytes); 44 | virtual 45 | Boolean frameCanAppearAfterPacketStart(unsigned char const* frameStart, 46 | unsigned numBytesInFrame) const; 47 | virtual unsigned specialHeaderSize() const; 48 | }; 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /include/live555/liveMedia/MP3ADURTPSink.hh: -------------------------------------------------------------------------------- 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 .) 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-2017 Live Networks, Inc. All rights reserved. 18 | // RTP sink for 'ADUized' MP3 frames ("mpa-robust") 19 | // C++ header 20 | 21 | #ifndef _MP3_ADU_RTP_SINK_HH 22 | #define _MP3_ADU_RTP_SINK_HH 23 | 24 | #ifndef _AUDIO_RTP_SINK_HH 25 | #include "AudioRTPSink.hh" 26 | #endif 27 | 28 | class MP3ADURTPSink: public AudioRTPSink { 29 | public: 30 | static MP3ADURTPSink* createNew(UsageEnvironment& env, Groupsock* RTPgs, 31 | unsigned char RTPPayloadType); 32 | 33 | protected: 34 | virtual ~MP3ADURTPSink(); 35 | 36 | private: 37 | MP3ADURTPSink(UsageEnvironment& env, Groupsock* RTPgs, 38 | unsigned char RTPPayloadType); 39 | // called only by createNew() 40 | 41 | 42 | private: 43 | // Redefined virtual functions: 44 | virtual void doSpecialFrameHandling(unsigned fragmentationOffset, 45 | unsigned char* frameStart, 46 | unsigned numBytesInFrame, 47 | struct timeval framePresentationTime, 48 | unsigned numRemainingBytes); 49 | virtual unsigned specialHeaderSize() const; 50 | 51 | private: 52 | unsigned fCurADUSize; // used when fragmenting over multiple RTP packets 53 | }; 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /include/live555/liveMedia/AC3AudioFileServerMediaSubsession.hh: -------------------------------------------------------------------------------- 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 .) 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-2017 Live Networks, Inc. All rights reserved. 18 | // A 'ServerMediaSubsession' object that creates new, unicast, "RTPSink"s 19 | // on demand, from an AC3 audio file. 20 | // C++ header 21 | 22 | #ifndef _AC3_AUDIO_FILE_SERVER_MEDIA_SUBSESSION_HH 23 | #define _AC3_AUDIO_FILE_SERVER_MEDIA_SUBSESSION_HH 24 | 25 | #ifndef _FILE_SERVER_MEDIA_SUBSESSION_HH 26 | #include "FileServerMediaSubsession.hh" 27 | #endif 28 | 29 | class AC3AudioFileServerMediaSubsession: public FileServerMediaSubsession{ 30 | public: 31 | static AC3AudioFileServerMediaSubsession* 32 | createNew(UsageEnvironment& env, char const* fileName, Boolean reuseFirstSource); 33 | 34 | private: 35 | AC3AudioFileServerMediaSubsession(UsageEnvironment& env, 36 | char const* fileName, Boolean reuseFirstSource); 37 | // called only by createNew(); 38 | virtual ~AC3AudioFileServerMediaSubsession(); 39 | 40 | private: // redefined virtual functions 41 | virtual FramedSource* createNewStreamSource(unsigned clientSessionId, 42 | unsigned& estBitrate); 43 | virtual RTPSink* createNewRTPSink(Groupsock* rtpGroupsock, 44 | unsigned char rtpPayloadTypeIfDynamic, 45 | FramedSource* inputSource); 46 | }; 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /include/live555/liveMedia/ADTSAudioFileSource.hh: -------------------------------------------------------------------------------- 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 .) 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-2017 Live Networks, Inc. All rights reserved. 18 | // A source object for AAC audio files in ADTS format 19 | // C++ header 20 | 21 | #ifndef _ADTS_AUDIO_FILE_SOURCE_HH 22 | #define _ADTS_AUDIO_FILE_SOURCE_HH 23 | 24 | #ifndef _FRAMED_FILE_SOURCE_HH 25 | #include "FramedFileSource.hh" 26 | #endif 27 | 28 | class ADTSAudioFileSource: public FramedFileSource { 29 | public: 30 | static ADTSAudioFileSource* createNew(UsageEnvironment& env, 31 | char const* fileName); 32 | 33 | unsigned samplingFrequency() const { return fSamplingFrequency; } 34 | unsigned numChannels() const { return fNumChannels; } 35 | char const* configStr() const { return fConfigStr; } 36 | // returns the 'AudioSpecificConfig' for this stream (in ASCII form) 37 | 38 | private: 39 | ADTSAudioFileSource(UsageEnvironment& env, FILE* fid, u_int8_t profile, 40 | u_int8_t samplingFrequencyIndex, u_int8_t channelConfiguration); 41 | // called only by createNew() 42 | 43 | virtual ~ADTSAudioFileSource(); 44 | 45 | private: 46 | // redefined virtual functions: 47 | virtual void doGetNextFrame(); 48 | 49 | private: 50 | unsigned fSamplingFrequency; 51 | unsigned fNumChannels; 52 | unsigned fuSecsPerFrame; 53 | char fConfigStr[5]; 54 | }; 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /include/live555/liveMedia/AMRAudioFileServerMediaSubsession.hh: -------------------------------------------------------------------------------- 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 .) 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-2017 Live Networks, Inc. All rights reserved. 18 | // A 'ServerMediaSubsession' object that creates new, unicast, "RTPSink"s 19 | // on demand, from an AMR audio file. 20 | // C++ header 21 | 22 | #ifndef _AMR_AUDIO_FILE_SERVER_MEDIA_SUBSESSION_HH 23 | #define _AMR_AUDIO_FILE_SERVER_MEDIA_SUBSESSION_HH 24 | 25 | #ifndef _FILE_SERVER_MEDIA_SUBSESSION_HH 26 | #include "FileServerMediaSubsession.hh" 27 | #endif 28 | 29 | class AMRAudioFileServerMediaSubsession: public FileServerMediaSubsession{ 30 | public: 31 | static AMRAudioFileServerMediaSubsession* 32 | createNew(UsageEnvironment& env, char const* fileName, Boolean reuseFirstSource); 33 | 34 | private: 35 | AMRAudioFileServerMediaSubsession(UsageEnvironment& env, 36 | char const* fileName, Boolean reuseFirstSource); 37 | // called only by createNew(); 38 | virtual ~AMRAudioFileServerMediaSubsession(); 39 | 40 | private: // redefined virtual functions 41 | virtual FramedSource* createNewStreamSource(unsigned clientSessionId, 42 | unsigned& estBitrate); 43 | virtual RTPSink* createNewRTPSink(Groupsock* rtpGroupsock, 44 | unsigned char rtpPayloadTypeIfDynamic, 45 | FramedSource* inputSource); 46 | }; 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /include/live555/liveMedia/JPEGVideoRTPSink.hh: -------------------------------------------------------------------------------- 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 .) 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-2017 Live Networks, Inc. All rights reserved. 18 | // RTP sink for JPEG video (RFC 2435) 19 | // C++ header 20 | 21 | #ifndef _JPEG_VIDEO_RTP_SINK_HH 22 | #define _JPEG_VIDEO_RTP_SINK_HH 23 | 24 | #ifndef _VIDEO_RTP_SINK_HH 25 | #include "VideoRTPSink.hh" 26 | #endif 27 | 28 | class JPEGVideoRTPSink: public VideoRTPSink { 29 | public: 30 | static JPEGVideoRTPSink* createNew(UsageEnvironment& env, Groupsock* RTPgs); 31 | 32 | protected: 33 | JPEGVideoRTPSink(UsageEnvironment& env, Groupsock* RTPgs); 34 | // called only by createNew() 35 | 36 | virtual ~JPEGVideoRTPSink(); 37 | 38 | private: // redefined virtual functions: 39 | virtual Boolean sourceIsCompatibleWithUs(MediaSource& source); 40 | 41 | virtual void doSpecialFrameHandling(unsigned fragmentationOffset, 42 | unsigned char* frameStart, 43 | unsigned numBytesInFrame, 44 | struct timeval framePresentationTime, 45 | unsigned numRemainingBytes); 46 | virtual 47 | Boolean frameCanAppearAfterPacketStart(unsigned char const* frameStart, 48 | unsigned numBytesInFrame) const; 49 | virtual unsigned specialHeaderSize() const; 50 | }; 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /include/live555/liveMedia/ADTSAudioFileServerMediaSubsession.hh: -------------------------------------------------------------------------------- 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 .) 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-2017 Live Networks, Inc. All rights reserved. 18 | // A 'ServerMediaSubsession' object that creates new, unicast, "RTPSink"s 19 | // on demand, from an AAC audio file in ADTS format 20 | // C++ header 21 | 22 | #ifndef _ADTS_AUDIO_FILE_SERVER_MEDIA_SUBSESSION_HH 23 | #define _ADTS_AUDIO_FILE_SERVER_MEDIA_SUBSESSION_HH 24 | 25 | #ifndef _FILE_SERVER_MEDIA_SUBSESSION_HH 26 | #include "FileServerMediaSubsession.hh" 27 | #endif 28 | 29 | class ADTSAudioFileServerMediaSubsession: public FileServerMediaSubsession{ 30 | public: 31 | static ADTSAudioFileServerMediaSubsession* 32 | createNew(UsageEnvironment& env, char const* fileName, Boolean reuseFirstSource); 33 | 34 | protected: 35 | ADTSAudioFileServerMediaSubsession(UsageEnvironment& env, 36 | char const* fileName, Boolean reuseFirstSource); 37 | // called only by createNew(); 38 | virtual ~ADTSAudioFileServerMediaSubsession(); 39 | 40 | protected: // redefined virtual functions 41 | virtual FramedSource* createNewStreamSource(unsigned clientSessionId, 42 | unsigned& estBitrate); 43 | virtual RTPSink* createNewRTPSink(Groupsock* rtpGroupsock, 44 | unsigned char rtpPayloadTypeIfDynamic, 45 | FramedSource* inputSource); 46 | }; 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /include/live555/liveMedia/H265VideoFileSink.hh: -------------------------------------------------------------------------------- 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 .) 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-2017 Live Networks, Inc. All rights reserved. 18 | // H.265 Video File Sinks 19 | // C++ header 20 | 21 | #ifndef _H265_VIDEO_FILE_SINK_HH 22 | #define _H265_VIDEO_FILE_SINK_HH 23 | 24 | #ifndef _H264_OR_5_VIDEO_FILE_SINK_HH 25 | #include "H264or5VideoFileSink.hh" 26 | #endif 27 | 28 | class H265VideoFileSink: public H264or5VideoFileSink { 29 | public: 30 | static H265VideoFileSink* createNew(UsageEnvironment& env, char const* fileName, 31 | char const* sPropVPSStr = NULL, 32 | char const* sPropSPSStr = NULL, 33 | char const* sPropPPSStr = NULL, 34 | // The "sProp*Str" parameters are optional 'SDP format' strings 35 | // (comma-separated Base64-encoded) representing VPS, SPS, and/or PPS NAL-units 36 | // to prepend to the output 37 | unsigned bufferSize = 100000, 38 | Boolean oneFilePerFrame = False); 39 | // See "FileSink.hh" for a description of these parameters. 40 | 41 | protected: 42 | H265VideoFileSink(UsageEnvironment& env, FILE* fid, 43 | char const* sPropVPSStr, 44 | char const* sPropSPSStr, 45 | char const* sPropPPSStr, 46 | unsigned bufferSize, char const* perFrameFileNamePrefix); 47 | // called only by createNew() 48 | virtual ~H265VideoFileSink(); 49 | }; 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /include/live555/liveMedia/H263plusVideoFileServerMediaSubsession.hh: -------------------------------------------------------------------------------- 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 .) 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-2017 Live Networks, Inc. All rights reserved. 18 | // A 'ServerMediaSubsession' object that creates new, unicast, "RTPSink"s 19 | // on demand, from a H.263 video file. 20 | // C++ header 21 | 22 | #ifndef _H263PLUS_VIDEO_FILE_SERVER_MEDIA_SUBSESSION_HH 23 | #define _H263PLUS_VIDEO_FILE_SERVER_MEDIA_SUBSESSION_HH 24 | 25 | #ifndef _FILE_SERVER_MEDIA_SUBSESSION_HH 26 | #include "FileServerMediaSubsession.hh" 27 | #endif 28 | 29 | class H263plusVideoFileServerMediaSubsession: public FileServerMediaSubsession{ 30 | public: 31 | static H263plusVideoFileServerMediaSubsession* 32 | createNew(UsageEnvironment& env, char const* fileName, Boolean reuseFirstSource); 33 | 34 | private: 35 | H263plusVideoFileServerMediaSubsession(UsageEnvironment& env, 36 | char const* fileName, Boolean reuseFirstSource); 37 | // called only by createNew(); 38 | virtual ~H263plusVideoFileServerMediaSubsession(); 39 | 40 | private: // redefined virtual functions 41 | virtual FramedSource* createNewStreamSource(unsigned clientSessionId, 42 | unsigned& estBitrate); 43 | virtual RTPSink* createNewRTPSink(Groupsock* rtpGroupsock, 44 | unsigned char rtpPayloadTypeIfDynamic, 45 | FramedSource* inputSource); 46 | }; 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /include/live555/liveMedia/MediaSource.hh: -------------------------------------------------------------------------------- 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 .) 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-2017 Live Networks, Inc. All rights reserved. 18 | // Media Sources 19 | // C++ header 20 | 21 | #ifndef _MEDIA_SOURCE_HH 22 | #define _MEDIA_SOURCE_HH 23 | 24 | #ifndef _MEDIA_HH 25 | #include "Media.hh" 26 | #endif 27 | 28 | class MediaSource: public Medium { 29 | public: 30 | static Boolean lookupByName(UsageEnvironment& env, char const* sourceName, 31 | MediaSource*& resultSource); 32 | virtual void getAttributes() const; 33 | // attributes are returned in "env's" 'result message' 34 | 35 | // The MIME type of this source: 36 | virtual char const* MIMEtype() const; 37 | 38 | // Test for specific types of source: 39 | virtual Boolean isFramedSource() const; 40 | virtual Boolean isRTPSource() const; 41 | virtual Boolean isMPEG1or2VideoStreamFramer() const; 42 | virtual Boolean isMPEG4VideoStreamFramer() const; 43 | virtual Boolean isH264VideoStreamFramer() const; 44 | virtual Boolean isH265VideoStreamFramer() const; 45 | virtual Boolean isDVVideoStreamFramer() const; 46 | virtual Boolean isJPEGVideoSource() const; 47 | virtual Boolean isAMRAudioSource() const; 48 | 49 | protected: 50 | MediaSource(UsageEnvironment& env); // abstract base class 51 | virtual ~MediaSource(); 52 | 53 | private: 54 | // redefined virtual functions: 55 | virtual Boolean isSource() const; 56 | }; 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /include/live555/groupsock/GroupEId.hh: -------------------------------------------------------------------------------- 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 .) 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 | // "multikit" Multicast Application Shell 17 | // Copyright (c) 1996-2017, Live Networks, Inc. All rights reserved 18 | // "Group Endpoint Id" 19 | // C++ header 20 | 21 | #ifndef _GROUPEID_HH 22 | #define _GROUPEID_HH 23 | 24 | #ifndef _BOOLEAN_HH 25 | #include "Boolean.hh" 26 | #endif 27 | 28 | #ifndef _NET_ADDRESS_HH 29 | #include "NetAddress.hh" 30 | #endif 31 | 32 | class GroupEId { 33 | public: 34 | GroupEId(struct in_addr const& groupAddr, 35 | portNumBits portNum, u_int8_t ttl); 36 | // used for a 'source-independent multicast' group 37 | GroupEId(struct in_addr const& groupAddr, 38 | struct in_addr const& sourceFilterAddr, 39 | portNumBits portNum); 40 | // used for a 'source-specific multicast' group 41 | 42 | struct in_addr const& groupAddress() const { return fGroupAddress; } 43 | struct in_addr const& sourceFilterAddress() const { return fSourceFilterAddress; } 44 | 45 | Boolean isSSM() const; 46 | 47 | portNumBits portNum() const { return fPortNum; } 48 | 49 | u_int8_t ttl() const { return fTTL; } 50 | 51 | private: 52 | void init(struct in_addr const& groupAddr, 53 | struct in_addr const& sourceFilterAddr, 54 | portNumBits portNum, 55 | u_int8_t ttl); 56 | 57 | private: 58 | struct in_addr fGroupAddress; 59 | struct in_addr fSourceFilterAddress; 60 | portNumBits fPortNum; // in network byte order 61 | u_int8_t fTTL; 62 | }; 63 | 64 | #endif 65 | -------------------------------------------------------------------------------- /include/live555/liveMedia/JPEGVideoRTPSource.hh: -------------------------------------------------------------------------------- 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 .) 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-2017 Live Networks, Inc. All rights reserved. 18 | // JPEG Video (RFC 2435) RTP Sources 19 | // C++ header 20 | 21 | #ifndef _JPEG_VIDEO_RTP_SOURCE_HH 22 | #define _JPEG_VIDEO_RTP_SOURCE_HH 23 | 24 | #ifndef _MULTI_FRAMED_RTP_SOURCE_HH 25 | #include "MultiFramedRTPSource.hh" 26 | #endif 27 | 28 | #define MAX_JPEG_HEADER_SIZE 1024 29 | 30 | class JPEGVideoRTPSource: public MultiFramedRTPSource { 31 | public: 32 | static JPEGVideoRTPSource* 33 | createNew(UsageEnvironment& env, Groupsock* RTPgs, 34 | unsigned char rtpPayloadFormat = 26, 35 | unsigned rtpPayloadFrequency = 90000, 36 | unsigned defaultWidth = 0, unsigned defaultHeight = 0); 37 | 38 | protected: 39 | virtual ~JPEGVideoRTPSource(); 40 | 41 | private: 42 | JPEGVideoRTPSource(UsageEnvironment& env, Groupsock* RTPgs, 43 | unsigned char rtpPayloadFormat, 44 | unsigned rtpTimestampFrequency, 45 | unsigned defaultWidth, unsigned defaultHeight); 46 | // called only by createNew() 47 | 48 | // Image dimensions from the SDP description, if any 49 | unsigned fDefaultWidth, fDefaultHeight; 50 | 51 | private: 52 | // redefined virtual functions: 53 | virtual Boolean processSpecialHeader(BufferedPacket* packet, 54 | unsigned& resultSpecialHeaderSize); 55 | 56 | virtual char const* MIMEtype() const; 57 | }; 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /include/live555/liveMedia/MPEG1or2VideoStreamFramer.hh: -------------------------------------------------------------------------------- 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 .) 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-2017 Live Networks, Inc. All rights reserved. 18 | // A filter that breaks up an MPEG 1 or 2 video elementary stream into 19 | // frames for: Video_Sequence_Header, GOP_Header, Picture_Header 20 | // C++ header 21 | 22 | #ifndef _MPEG_1OR2_VIDEO_STREAM_FRAMER_HH 23 | #define _MPEG_1OR2_VIDEO_STREAM_FRAMER_HH 24 | 25 | #ifndef _MPEG_VIDEO_STREAM_FRAMER_HH 26 | #include "MPEGVideoStreamFramer.hh" 27 | #endif 28 | 29 | class MPEG1or2VideoStreamFramer: public MPEGVideoStreamFramer { 30 | public: 31 | static MPEG1or2VideoStreamFramer* 32 | createNew(UsageEnvironment& env, FramedSource* inputSource, 33 | Boolean iFramesOnly = False, 34 | double vshPeriod = 5.0 35 | /* how often (in seconds) to inject a Video_Sequence_Header, 36 | if one doesn't already appear in the stream */); 37 | 38 | protected: 39 | MPEG1or2VideoStreamFramer(UsageEnvironment& env, 40 | FramedSource* inputSource, 41 | Boolean iFramesOnly, double vshPeriod, 42 | Boolean createParser = True); 43 | // called only by createNew(), or by subclass constructors 44 | virtual ~MPEG1or2VideoStreamFramer(); 45 | 46 | private: 47 | // redefined virtual functions: 48 | virtual Boolean isMPEG1or2VideoStreamFramer() const; 49 | 50 | private: 51 | double getCurrentPTS() const; 52 | 53 | friend class MPEG1or2VideoStreamParser; // hack 54 | }; 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /include/live555/liveMedia/BasicUDPSink.hh: -------------------------------------------------------------------------------- 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 .) 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-2017 Live Networks, Inc. All rights reserved. 18 | // A simple UDP sink (i.e., without RTP or other headers added); one frame per packet 19 | // C++ header 20 | 21 | #ifndef _BASIC_UDP_SINK_HH 22 | #define _BASIC_UDP_SINK_HH 23 | 24 | #ifndef _MEDIA_SINK_HH 25 | #include "MediaSink.hh" 26 | #endif 27 | #ifndef _GROUPSOCK_HH 28 | #include 29 | #endif 30 | 31 | class BasicUDPSink: public MediaSink { 32 | public: 33 | static BasicUDPSink* createNew(UsageEnvironment& env, Groupsock* gs, 34 | unsigned maxPayloadSize = 1450); 35 | protected: 36 | BasicUDPSink(UsageEnvironment& env, Groupsock* gs, unsigned maxPayloadSize); 37 | // called only by createNew() 38 | virtual ~BasicUDPSink(); 39 | 40 | private: // redefined virtual functions: 41 | virtual Boolean continuePlaying(); 42 | 43 | private: 44 | void continuePlaying1(); 45 | 46 | static void afterGettingFrame(void* clientData, unsigned frameSize, 47 | unsigned numTruncatedBytes, 48 | struct timeval presentationTime, 49 | unsigned durationInMicroseconds); 50 | void afterGettingFrame1(unsigned frameSize, unsigned numTruncatedBytes, 51 | unsigned durationInMicroseconds); 52 | 53 | static void sendNext(void* firstArg); 54 | 55 | private: 56 | Groupsock* fGS; 57 | unsigned fMaxPayloadSize; 58 | unsigned char* fOutputBuffer; 59 | struct timeval fNextSendTime; 60 | }; 61 | 62 | #endif 63 | -------------------------------------------------------------------------------- /include/live555/liveMedia/H263plusVideoRTPSink.hh: -------------------------------------------------------------------------------- 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 .) 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-2017 Live Networks, Inc. All rights reserved. 18 | // RTP sink for H.263+ video (RFC 4629) 19 | // C++ header 20 | 21 | #ifndef _H263_PLUS_VIDEO_RTP_SINK_HH 22 | #define _H263_PLUS_VIDEO_RTP_SINK_HH 23 | 24 | #ifndef _VIDEO_RTP_SINK_HH 25 | #include "VideoRTPSink.hh" 26 | #endif 27 | 28 | class H263plusVideoRTPSink: public VideoRTPSink { 29 | public: 30 | static H263plusVideoRTPSink* createNew(UsageEnvironment& env, Groupsock* RTPgs, 31 | unsigned char rtpPayloadFormat, 32 | u_int32_t rtpTimestampFrequency = 90000); 33 | 34 | protected: 35 | H263plusVideoRTPSink(UsageEnvironment& env, Groupsock* RTPgs, 36 | unsigned char rtpPayloadFormat, 37 | u_int32_t rtpTimestampFrequency); 38 | // called only by createNew() 39 | 40 | virtual ~H263plusVideoRTPSink(); 41 | 42 | private: // redefined virtual functions: 43 | virtual void doSpecialFrameHandling(unsigned fragmentationOffset, 44 | unsigned char* frameStart, 45 | unsigned numBytesInFrame, 46 | struct timeval framePresentationTime, 47 | unsigned numRemainingBytes); 48 | virtual 49 | Boolean frameCanAppearAfterPacketStart(unsigned char const* frameStart, 50 | unsigned numBytesInFrame) const; 51 | virtual unsigned specialHeaderSize() const; 52 | }; 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /include/live555/liveMedia/JPEGVideoSource.hh: -------------------------------------------------------------------------------- 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 .) 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-2017 Live Networks, Inc. All rights reserved. 18 | // JPEG video sources 19 | // C++ header 20 | 21 | #ifndef _JPEG_VIDEO_SOURCE_HH 22 | #define _JPEG_VIDEO_SOURCE_HH 23 | 24 | #ifndef _FRAMED_SOURCE_HH 25 | #include "FramedSource.hh" 26 | #endif 27 | 28 | class JPEGVideoSource: public FramedSource { 29 | public: 30 | virtual u_int8_t type() = 0; 31 | virtual u_int8_t qFactor() = 0; 32 | virtual u_int8_t width() = 0; // # pixels/8 (or 0 for 2048 pixels) 33 | virtual u_int8_t height() = 0; // # pixels/8 (or 0 for 2048 pixels) 34 | 35 | virtual u_int8_t const* quantizationTables(u_int8_t& precision, 36 | u_int16_t& length); 37 | // If "qFactor()" returns a value >= 128, then this function is called 38 | // to tell us the quantization tables that are being used. 39 | // (The default implementation of this function just returns NULL.) 40 | // "precision" and "length" are as defined in RFC 2435, section 3.1.8. 41 | 42 | virtual u_int16_t restartInterval(); 43 | // If restart intervals are being used (i.e., 64 <= type() <= 127), then this function must be 44 | // redefined - by a subclass - to return a non-zero value. 45 | 46 | protected: 47 | JPEGVideoSource(UsageEnvironment& env); // abstract base class 48 | virtual ~JPEGVideoSource(); 49 | 50 | private: 51 | // redefined virtual functions: 52 | virtual Boolean isJPEGVideoSource() const; 53 | }; 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /include/live555/liveMedia/H263plusVideoRTPSource.hh: -------------------------------------------------------------------------------- 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 .) 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-2017 Live Networks, Inc. All rights reserved. 18 | // H.263+ Video RTP Sources 19 | // C++ header 20 | 21 | #ifndef _H263_PLUS_VIDEO_RTP_SOURCE_HH 22 | #define _H263_PLUS_VIDEO_RTP_SOURCE_HH 23 | 24 | #ifndef _MULTI_FRAMED_RTP_SOURCE_HH 25 | #include "MultiFramedRTPSource.hh" 26 | #endif 27 | 28 | #define SPECIAL_HEADER_BUFFER_SIZE 1000 29 | 30 | class H263plusVideoRTPSource: public MultiFramedRTPSource { 31 | public: 32 | static H263plusVideoRTPSource* 33 | createNew(UsageEnvironment& env, Groupsock* RTPgs, 34 | unsigned char rtpPayloadFormat, 35 | unsigned rtpTimestampFrequency = 90000); 36 | 37 | // A data structure that stores copies of the special header bytes 38 | // from the most recent frame's RTP packets: 39 | unsigned char fNumSpecialHeaders; 40 | unsigned fSpecialHeaderBytesLength; 41 | unsigned char fSpecialHeaderBytes[SPECIAL_HEADER_BUFFER_SIZE]; 42 | unsigned fPacketSizes[256]; 43 | 44 | protected: 45 | virtual ~H263plusVideoRTPSource(); 46 | 47 | private: 48 | H263plusVideoRTPSource(UsageEnvironment& env, Groupsock* RTPgs, 49 | unsigned char rtpPayloadFormat, 50 | unsigned rtpTimestampFrequency); 51 | // called only by createNew() 52 | 53 | private: 54 | // redefined virtual functions: 55 | virtual Boolean processSpecialHeader(BufferedPacket* packet, 56 | unsigned& resultSpecialHeaderSize); 57 | virtual char const* MIMEtype() const; 58 | }; 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /include/live555/liveMedia/AC3AudioRTPSink.hh: -------------------------------------------------------------------------------- 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 .) 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-2017 Live Networks, Inc. All rights reserved. 18 | // RTP sink for AC3 audio 19 | // C++ header 20 | 21 | #ifndef _AC3_AUDIO_RTP_SINK_HH 22 | #define _AC3_AUDIO_RTP_SINK_HH 23 | 24 | #ifndef _AUDIO_RTP_SINK_HH 25 | #include "AudioRTPSink.hh" 26 | #endif 27 | 28 | class AC3AudioRTPSink: public AudioRTPSink { 29 | public: 30 | static AC3AudioRTPSink* createNew(UsageEnvironment& env, 31 | Groupsock* RTPgs, 32 | u_int8_t rtpPayloadFormat, 33 | u_int32_t rtpTimestampFrequency); 34 | 35 | protected: 36 | AC3AudioRTPSink(UsageEnvironment& env, Groupsock* RTPgs, 37 | u_int8_t rtpPayloadFormat, 38 | u_int32_t rtpTimestampFrequency); 39 | // called only by createNew() 40 | 41 | virtual ~AC3AudioRTPSink(); 42 | 43 | private: // redefined virtual functions: 44 | virtual Boolean frameCanAppearAfterPacketStart(unsigned char const* frameStart, 45 | unsigned numBytesInFrame) const; 46 | virtual void doSpecialFrameHandling(unsigned fragmentationOffset, 47 | unsigned char* frameStart, 48 | unsigned numBytesInFrame, 49 | struct timeval framePresentationTime, 50 | unsigned numRemainingBytes); 51 | virtual unsigned specialHeaderSize() const; 52 | 53 | private: 54 | unsigned char fTotNumFragmentsUsed; // used only if a frame gets fragmented across multiple packets 55 | }; 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /include/live555/liveMedia/MP3ADUTranscoder.hh: -------------------------------------------------------------------------------- 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 .) 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-2017 Live Networks, Inc. All rights reserved. 18 | // Transcoder for ADUized MP3 frames 19 | // C++ header 20 | 21 | #ifndef _MP3_ADU_TRANSCODER_HH 22 | #define _MP3_ADU_TRANSCODER_HH 23 | 24 | #ifndef _FRAMED_FILTER_HH 25 | #include "FramedFilter.hh" 26 | #endif 27 | 28 | class MP3ADUTranscoder: public FramedFilter { 29 | public: 30 | static MP3ADUTranscoder* createNew(UsageEnvironment& env, 31 | unsigned outBitrate /* in kbps */, 32 | FramedSource* inputSource); 33 | 34 | unsigned outBitrate() const { return fOutBitrate; } 35 | protected: 36 | MP3ADUTranscoder(UsageEnvironment& env, 37 | unsigned outBitrate /* in kbps */, 38 | FramedSource* inputSource); 39 | // called only by createNew() 40 | virtual ~MP3ADUTranscoder(); 41 | 42 | private: 43 | // redefined virtual functions: 44 | virtual void doGetNextFrame(); 45 | virtual void getAttributes() const; 46 | 47 | private: 48 | static void afterGettingFrame(void* clientData, 49 | unsigned numBytesRead, unsigned numTruncatedBytes, 50 | struct timeval presentationTime, 51 | unsigned durationInMicroseconds); 52 | void afterGettingFrame1(unsigned numBytesRead, unsigned numTruncatedBytes, 53 | struct timeval presentationTime, 54 | unsigned durationInMicroseconds); 55 | 56 | private: 57 | unsigned fOutBitrate; // in kbps 58 | unsigned fAvailableBytesForBackpointer; 59 | 60 | unsigned char* fOrigADU; 61 | // used to store incoming ADU prior to transcoding 62 | }; 63 | 64 | #endif 65 | -------------------------------------------------------------------------------- /include/live555/liveMedia/DVVideoRTPSink.hh: -------------------------------------------------------------------------------- 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 .) 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-2017 Live Networks, Inc. All rights reserved. 18 | // RTP sink for DV video (RFC 3189) 19 | // (Thanks to Ben Hutchings for prototyping this.) 20 | // C++ header 21 | 22 | #ifndef _DV_VIDEO_RTP_SINK_HH 23 | #define _DV_VIDEO_RTP_SINK_HH 24 | 25 | #ifndef _VIDEO_RTP_SINK_HH 26 | #include "VideoRTPSink.hh" 27 | #endif 28 | #ifndef _DV_VIDEO_STREAM_FRAMER_HH 29 | #include "DVVideoStreamFramer.hh" 30 | #endif 31 | 32 | class DVVideoRTPSink: public VideoRTPSink { 33 | public: 34 | static DVVideoRTPSink* createNew(UsageEnvironment& env, Groupsock* RTPgs, unsigned char rtpPayloadFormat); 35 | char const* auxSDPLineFromFramer(DVVideoStreamFramer* framerSource); 36 | 37 | protected: 38 | DVVideoRTPSink(UsageEnvironment& env, Groupsock* RTPgs, unsigned char rtpPayloadFormat); 39 | // called only by createNew() 40 | 41 | virtual ~DVVideoRTPSink(); 42 | 43 | private: // redefined virtual functions: 44 | virtual Boolean sourceIsCompatibleWithUs(MediaSource& source); 45 | virtual void doSpecialFrameHandling(unsigned fragmentationOffset, 46 | unsigned char* frameStart, 47 | unsigned numBytesInFrame, 48 | struct timeval framePresentationTime, 49 | unsigned numRemainingBytes); 50 | virtual unsigned computeOverflowForNewFrame(unsigned newFrameSize) const; 51 | virtual char const* auxSDPLine(); 52 | 53 | private: 54 | char* fFmtpSDPLine; 55 | }; 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /include/live555/liveMedia/BitVector.hh: -------------------------------------------------------------------------------- 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 .) 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-2017 Live Networks, Inc. All rights reserved. 18 | // Bit Vector data structure 19 | // C++ header 20 | 21 | #ifndef _BIT_VECTOR_HH 22 | #define _BIT_VECTOR_HH 23 | 24 | #ifndef _BOOLEAN_HH 25 | #include "Boolean.hh" 26 | #endif 27 | 28 | class BitVector { 29 | public: 30 | BitVector(unsigned char* baseBytePtr, 31 | unsigned baseBitOffset, 32 | unsigned totNumBits); 33 | 34 | void setup(unsigned char* baseBytePtr, 35 | unsigned baseBitOffset, 36 | unsigned totNumBits); 37 | 38 | void putBits(unsigned from, unsigned numBits); // "numBits" <= 32 39 | void put1Bit(unsigned bit); 40 | 41 | unsigned getBits(unsigned numBits); // "numBits" <= 32 42 | unsigned get1Bit(); 43 | Boolean get1BitBoolean() { return get1Bit() != 0; } 44 | 45 | void skipBits(unsigned numBits); 46 | 47 | unsigned curBitIndex() const { return fCurBitIndex; } 48 | unsigned totNumBits() const { return fTotNumBits; } 49 | unsigned numBitsRemaining() const { return fTotNumBits - fCurBitIndex; } 50 | 51 | unsigned get_expGolomb(); 52 | // Returns the value of the next bits, assuming that they were encoded using an exponential-Golomb code of order 0 53 | 54 | private: 55 | unsigned char* fBaseBytePtr; 56 | unsigned fBaseBitOffset; 57 | unsigned fTotNumBits; 58 | unsigned fCurBitIndex; 59 | }; 60 | 61 | // A general bit copy operation: 62 | void shiftBits(unsigned char* toBasePtr, unsigned toBitOffset, 63 | unsigned char const* fromBasePtr, unsigned fromBitOffset, 64 | unsigned numBits); 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /include/live555/liveMedia/H263plusVideoStreamFramer.hh: -------------------------------------------------------------------------------- 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 .) 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-2017 Live Networks, Inc. All rights reserved. 18 | // A filter that breaks up an H263 video elementary stream into frames. 19 | // Author Benhard Feiten 20 | 21 | #ifndef _H263PLUS_VIDEO_STREAM_FRAMER_HH 22 | #define _H263PLUS_VIDEO_STREAM_FRAMER_HH 23 | 24 | #ifndef _FRAMED_FILTER_HH 25 | #include "FramedFilter.hh" 26 | #endif 27 | 28 | 29 | class H263plusVideoStreamFramer: public FramedFilter { 30 | public: 31 | 32 | static H263plusVideoStreamFramer* createNew(UsageEnvironment& env, FramedSource* inputSource); 33 | 34 | Boolean& pictureEndMarker() { return fPictureEndMarker; } // a hack for implementing the RTP 'M' bit 35 | 36 | protected: 37 | // Constructor called only by createNew(), or by subclass constructors 38 | H263plusVideoStreamFramer(UsageEnvironment& env, 39 | FramedSource* inputSource, 40 | Boolean createParser = True); 41 | virtual ~H263plusVideoStreamFramer(); 42 | 43 | 44 | public: 45 | static void continueReadProcessing(void* clientData, 46 | unsigned char* ptr, unsigned size, 47 | struct timeval presentationTime); 48 | void continueReadProcessing(); 49 | 50 | private: 51 | virtual void doGetNextFrame(); 52 | virtual Boolean isH263plusVideoStreamFramer() const; 53 | 54 | protected: 55 | double fFrameRate; 56 | unsigned fPictureCount; // hack used to implement doGetNextFrame() ?? 57 | Boolean fPictureEndMarker; 58 | 59 | private: 60 | class H263plusVideoStreamParser* fParser; 61 | struct timeval fPresentationTimeBase; 62 | }; 63 | 64 | #endif 65 | -------------------------------------------------------------------------------- /include/live555/liveMedia/H264or5VideoStreamDiscreteFramer.hh: -------------------------------------------------------------------------------- 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 .) 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-2017 Live Networks, Inc. All rights reserved. 18 | // A simplified version of "H264or5VideoStreamFramer" that takes only complete, 19 | // discrete frames (rather than an arbitrary byte stream) as input. 20 | // This avoids the parsing and data copying overhead of the full 21 | // "H264or5VideoStreamFramer". 22 | // C++ header 23 | 24 | #ifndef _H264_OR_5_VIDEO_STREAM_DISCRETE_FRAMER_HH 25 | #define _H264_OR_5_VIDEO_STREAM_DISCRETE_FRAMER_HH 26 | 27 | #ifndef _H264_OR_5_VIDEO_STREAM_FRAMER_HH 28 | #include "H264or5VideoStreamFramer.hh" 29 | #endif 30 | 31 | class H264or5VideoStreamDiscreteFramer: public H264or5VideoStreamFramer { 32 | protected: 33 | H264or5VideoStreamDiscreteFramer(int hNumber, UsageEnvironment& env, FramedSource* inputSource); 34 | // we're an abstract base class 35 | virtual ~H264or5VideoStreamDiscreteFramer(); 36 | 37 | protected: 38 | // redefined virtual functions: 39 | virtual void doGetNextFrame(); 40 | 41 | protected: 42 | static void afterGettingFrame(void* clientData, unsigned frameSize, 43 | unsigned numTruncatedBytes, 44 | struct timeval presentationTime, 45 | unsigned durationInMicroseconds); 46 | void afterGettingFrame1(unsigned frameSize, 47 | unsigned numTruncatedBytes, 48 | struct timeval presentationTime, 49 | unsigned durationInMicroseconds); 50 | 51 | virtual Boolean nalUnitEndsAccessUnit(u_int8_t nal_unit_type); 52 | }; 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /include/live555/liveMedia/DVVideoFileServerMediaSubsession.hh: -------------------------------------------------------------------------------- 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 .) 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-2017 Live Networks, Inc. All rights reserved. 18 | // A 'ServerMediaSubsession' object that creates new, unicast, "RTPSink"s 19 | // on demand, from a DV video file. 20 | // C++ header 21 | 22 | #ifndef _DV_VIDEO_FILE_SERVER_MEDIA_SUBSESSION_HH 23 | #define _DV_VIDEO_FILE_SERVER_MEDIA_SUBSESSION_HH 24 | 25 | #ifndef _FILE_SERVER_MEDIA_SUBSESSION_HH 26 | #include "FileServerMediaSubsession.hh" 27 | #endif 28 | 29 | class DVVideoFileServerMediaSubsession: public FileServerMediaSubsession{ 30 | public: 31 | static DVVideoFileServerMediaSubsession* 32 | createNew(UsageEnvironment& env, char const* fileName, Boolean reuseFirstSource); 33 | 34 | private: 35 | DVVideoFileServerMediaSubsession(UsageEnvironment& env, char const* fileName, Boolean reuseFirstSource); 36 | // called only by createNew(); 37 | virtual ~DVVideoFileServerMediaSubsession(); 38 | 39 | private: // redefined virtual functions 40 | virtual char const* getAuxSDPLine(RTPSink* rtpSink, FramedSource* inputSource); 41 | virtual void seekStreamSource(FramedSource* inputSource, double& seekNPT, double streamDuration, u_int64_t& numBytes); 42 | virtual void setStreamSourceDuration(FramedSource* inputSource, double streamDuration, u_int64_t& numBytes); 43 | virtual FramedSource* createNewStreamSource(unsigned clientSessionId, unsigned& estBitrate); 44 | virtual RTPSink* createNewRTPSink(Groupsock* rtpGroupsock, unsigned char rtpPayloadTypeIfDynamic, FramedSource* inputSource); 45 | virtual float duration() const; 46 | 47 | private: 48 | float fFileDuration; // in seconds 49 | }; 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /include/live555/liveMedia/MP3FileSource.hh: -------------------------------------------------------------------------------- 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 .) 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-2017 Live Networks, Inc. All rights reserved. 18 | // MP3 File Sources 19 | // C++ header 20 | 21 | #ifndef _MP3_FILE_SOURCE_HH 22 | #define _MP3_FILE_SOURCE_HH 23 | 24 | #ifndef _FRAMED_FILE_SOURCE_HH 25 | #include "FramedFileSource.hh" 26 | #endif 27 | 28 | class MP3StreamState; // forward 29 | 30 | class MP3FileSource: public FramedFileSource { 31 | public: 32 | static MP3FileSource* createNew(UsageEnvironment& env, char const* fileName); 33 | 34 | float filePlayTime() const; 35 | unsigned fileSize() const; 36 | void setPresentationTimeScale(unsigned scale); 37 | void seekWithinFile(double seekNPT, double streamDuration); 38 | // if "streamDuration" is >0.0, then we limit the stream to that duration, before treating it as EOF 39 | 40 | protected: 41 | MP3FileSource(UsageEnvironment& env, FILE* fid); 42 | // called only by createNew() 43 | 44 | virtual ~MP3FileSource(); 45 | 46 | protected: 47 | void assignStream(FILE* fid, unsigned filesize); 48 | Boolean initializeStream(); 49 | 50 | MP3StreamState* streamState() {return fStreamState;} 51 | 52 | private: 53 | // redefined virtual functions: 54 | virtual void doGetNextFrame(); 55 | virtual char const* MIMEtype() const; 56 | virtual void getAttributes() const; 57 | 58 | private: 59 | virtual Boolean doGetNextFrame1(); 60 | 61 | private: 62 | MP3StreamState* fStreamState; 63 | Boolean fHaveJustInitialized; 64 | struct timeval fFirstFramePresentationTime; // set on stream init 65 | Boolean fLimitNumBytesToStream; 66 | unsigned fNumBytesToStream; // used iff "fLimitNumBytesToStream" is True 67 | }; 68 | 69 | #endif 70 | -------------------------------------------------------------------------------- /include/live555/basicUsageEnvironment/HandlerSet.hh: -------------------------------------------------------------------------------- 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 .) 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 | // Copyright (c) 1996-2017 Live Networks, Inc. All rights reserved. 17 | // Basic Usage Environment: for a simple, non-scripted, console application 18 | // C++ header 19 | 20 | #ifndef _HANDLER_SET_HH 21 | #define _HANDLER_SET_HH 22 | 23 | #ifndef _BOOLEAN_HH 24 | #include "Boolean.hh" 25 | #endif 26 | 27 | ////////// HandlerSet (etc.) definition ////////// 28 | 29 | class HandlerDescriptor { 30 | HandlerDescriptor(HandlerDescriptor* nextHandler); 31 | virtual ~HandlerDescriptor(); 32 | 33 | public: 34 | int socketNum; 35 | int conditionSet; 36 | TaskScheduler::BackgroundHandlerProc* handlerProc; 37 | void* clientData; 38 | 39 | private: 40 | // Descriptors are linked together in a doubly-linked list: 41 | friend class HandlerSet; 42 | friend class HandlerIterator; 43 | HandlerDescriptor* fNextHandler; 44 | HandlerDescriptor* fPrevHandler; 45 | }; 46 | 47 | class HandlerSet { 48 | public: 49 | HandlerSet(); 50 | virtual ~HandlerSet(); 51 | 52 | void assignHandler(int socketNum, int conditionSet, TaskScheduler::BackgroundHandlerProc* handlerProc, void* clientData); 53 | void clearHandler(int socketNum); 54 | void moveHandler(int oldSocketNum, int newSocketNum); 55 | 56 | private: 57 | HandlerDescriptor* lookupHandler(int socketNum); 58 | 59 | private: 60 | friend class HandlerIterator; 61 | HandlerDescriptor fHandlers; 62 | }; 63 | 64 | class HandlerIterator { 65 | public: 66 | HandlerIterator(HandlerSet& handlerSet); 67 | virtual ~HandlerIterator(); 68 | 69 | HandlerDescriptor* next(); // returns NULL if none 70 | void reset(); 71 | 72 | private: 73 | HandlerSet& fOurSet; 74 | HandlerDescriptor* fNextPtr; 75 | }; 76 | 77 | #endif 78 | -------------------------------------------------------------------------------- /include/live555/liveMedia/H264or5VideoRTPSink.hh: -------------------------------------------------------------------------------- 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 .) 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-2017 Live Networks, Inc. All rights reserved. 18 | // RTP sink for H.264 or H.265 video 19 | // C++ header 20 | 21 | #ifndef _H264_OR_5_VIDEO_RTP_SINK_HH 22 | #define _H264_OR_5_VIDEO_RTP_SINK_HH 23 | 24 | #ifndef _VIDEO_RTP_SINK_HH 25 | #include "VideoRTPSink.hh" 26 | #endif 27 | #ifndef _FRAMED_FILTER_HH 28 | #include "FramedFilter.hh" 29 | #endif 30 | 31 | class H264or5VideoRTPSink: public VideoRTPSink { 32 | protected: 33 | H264or5VideoRTPSink(int hNumber, // 264 or 265 34 | UsageEnvironment& env, Groupsock* RTPgs, unsigned char rtpPayloadFormat, 35 | u_int8_t const* vps = NULL, unsigned vpsSize = 0, 36 | u_int8_t const* sps = NULL, unsigned spsSize = 0, 37 | u_int8_t const* pps = NULL, unsigned ppsSize = 0); 38 | // we're an abstrace base class 39 | virtual ~H264or5VideoRTPSink(); 40 | 41 | private: // redefined virtual functions: 42 | virtual Boolean continuePlaying(); 43 | virtual void doSpecialFrameHandling(unsigned fragmentationOffset, 44 | unsigned char* frameStart, 45 | unsigned numBytesInFrame, 46 | struct timeval framePresentationTime, 47 | unsigned numRemainingBytes); 48 | virtual Boolean frameCanAppearAfterPacketStart(unsigned char const* frameStart, 49 | unsigned numBytesInFrame) const; 50 | 51 | protected: 52 | int fHNumber; 53 | FramedFilter* fOurFragmenter; 54 | char* fFmtpSDPLine; 55 | u_int8_t* fVPS; unsigned fVPSSize; 56 | u_int8_t* fSPS; unsigned fSPSSize; 57 | u_int8_t* fPPS; unsigned fPPSSize; 58 | }; 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /include/live555/liveMedia/MPEG1or2VideoFileServerMediaSubsession.hh: -------------------------------------------------------------------------------- 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 .) 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-2017 Live Networks, Inc. All rights reserved. 18 | // A 'ServerMediaSubsession' object that creates new, unicast, "RTPSink"s 19 | // on demand, from a MPEG-1 or 2 Elementary Stream video file. 20 | // C++ header 21 | 22 | #ifndef _MPEG_1OR2_VIDEO_FILE_SERVER_MEDIA_SUBSESSION_HH 23 | #define _MPEG_1OR2_VIDEO_FILE_SERVER_MEDIA_SUBSESSION_HH 24 | 25 | #ifndef _FILE_SERVER_MEDIA_SUBSESSION_HH 26 | #include "FileServerMediaSubsession.hh" 27 | #endif 28 | 29 | class MPEG1or2VideoFileServerMediaSubsession: public FileServerMediaSubsession{ 30 | public: 31 | static MPEG1or2VideoFileServerMediaSubsession* 32 | createNew(UsageEnvironment& env, char const* fileName, Boolean reuseFirstSource, 33 | Boolean iFramesOnly = False, 34 | double vshPeriod = 5.0 35 | /* how often (in seconds) to inject a Video_Sequence_Header, 36 | if one doesn't already appear in the stream */); 37 | 38 | private: 39 | MPEG1or2VideoFileServerMediaSubsession(UsageEnvironment& env, 40 | char const* fileName, 41 | Boolean reuseFirstSource, 42 | Boolean iFramesOnly, 43 | double vshPeriod); 44 | // called only by createNew(); 45 | virtual ~MPEG1or2VideoFileServerMediaSubsession(); 46 | 47 | private: // redefined virtual functions 48 | virtual FramedSource* createNewStreamSource(unsigned clientSessionId, 49 | unsigned& estBitrate); 50 | virtual RTPSink* createNewRTPSink(Groupsock* rtpGroupsock, 51 | unsigned char rtpPayloadTypeIfDynamic, 52 | FramedSource* inputSource); 53 | 54 | private: 55 | Boolean fIFramesOnly; 56 | double fVSHPeriod; 57 | }; 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /include/live555/liveMedia/MPEG2TransportStreamFromPESSource.hh: -------------------------------------------------------------------------------- 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 .) 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-2017 Live Networks, Inc. All rights reserved. 18 | // A filter for converting a stream of MPEG PES packets to a MPEG-2 Transport Stream 19 | // C++ header 20 | 21 | #ifndef _MPEG2_TRANSPORT_STREAM_FROM_PES_SOURCE_HH 22 | #define _MPEG2_TRANSPORT_STREAM_FROM_PES_SOURCE_HH 23 | 24 | #ifndef _MPEG2_TRANSPORT_STREAM_MULTIPLEXOR_HH 25 | #include "MPEG2TransportStreamMultiplexor.hh" 26 | #endif 27 | #ifndef _MPEG_1OR2_DEMUXED_ELEMENTARY_STREAM_HH 28 | #include "MPEG1or2DemuxedElementaryStream.hh" 29 | #endif 30 | 31 | class MPEG2TransportStreamFromPESSource: public MPEG2TransportStreamMultiplexor { 32 | public: 33 | static MPEG2TransportStreamFromPESSource* 34 | createNew(UsageEnvironment& env, MPEG1or2DemuxedElementaryStream* inputSource); 35 | 36 | protected: 37 | MPEG2TransportStreamFromPESSource(UsageEnvironment& env, 38 | MPEG1or2DemuxedElementaryStream* inputSource); 39 | // called only by createNew() 40 | virtual ~MPEG2TransportStreamFromPESSource(); 41 | 42 | private: 43 | // Redefined virtual functions: 44 | virtual void doStopGettingFrames(); 45 | virtual void awaitNewBuffer(unsigned char* oldBuffer); 46 | 47 | private: 48 | static void afterGettingFrame(void* clientData, unsigned frameSize, 49 | unsigned numTruncatedBytes, 50 | struct timeval presentationTime, 51 | unsigned durationInMicroseconds); 52 | void afterGettingFrame1(unsigned frameSize, 53 | unsigned numTruncatedBytes, 54 | struct timeval presentationTime, 55 | unsigned durationInMicroseconds); 56 | 57 | private: 58 | MPEG1or2DemuxedElementaryStream* fInputSource; 59 | unsigned char* fInputBuffer; 60 | }; 61 | 62 | #endif 63 | -------------------------------------------------------------------------------- /include/live555/liveMedia/MPEG2TransportUDPServerMediaSubsession.hh: -------------------------------------------------------------------------------- 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 .) 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-2017 Live Networks, Inc. All rights reserved. 18 | // A 'ServerMediaSubsession' object that creates new, unicast, "RTPSink"s 19 | // on demand, from an incoming UDP (or RTP/UDP) MPEG-2 Transport Stream 20 | // C++ header 21 | 22 | #ifndef _MPEG2_TRANSPORT_UDP_SERVER_MEDIA_SUBSESSION_HH 23 | #define _MPEG2_TRANSPORT_UDP_SERVER_MEDIA_SUBSESSION_HH 24 | 25 | #ifndef _ON_DEMAND_SERVER_MEDIA_SUBSESSION_HH 26 | #include "OnDemandServerMediaSubsession.hh" 27 | #endif 28 | 29 | class MPEG2TransportUDPServerMediaSubsession: public OnDemandServerMediaSubsession { 30 | public: 31 | static MPEG2TransportUDPServerMediaSubsession* 32 | createNew(UsageEnvironment& env, 33 | char const* inputAddressStr, // An IP multicast address, or use "0.0.0.0" or NULL for unicast input 34 | Port const& inputPort, 35 | Boolean inputStreamIsRawUDP = False); // otherwise (default) the input stream is RTP/UDP 36 | protected: 37 | MPEG2TransportUDPServerMediaSubsession(UsageEnvironment& env, 38 | char const* inputAddressStr, Port const& inputPort, Boolean inputStreamIsRawUDP); 39 | // called only by createNew(); 40 | virtual ~MPEG2TransportUDPServerMediaSubsession(); 41 | 42 | protected: // redefined virtual functions 43 | virtual FramedSource* createNewStreamSource(unsigned clientSessionId, 44 | unsigned& estBitrate); 45 | virtual RTPSink* createNewRTPSink(Groupsock* rtpGroupsock, 46 | unsigned char rtpPayloadTypeIfDynamic, 47 | FramedSource* inputSource); 48 | protected: 49 | char const* fInputAddressStr; 50 | Port fInputPort; 51 | Groupsock* fInputGroupsock; 52 | Boolean fInputStreamIsRawUDP; 53 | }; 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /include/live555/liveMedia/MPEG4VideoFileServerMediaSubsession.hh: -------------------------------------------------------------------------------- 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 .) 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-2017 Live Networks, Inc. All rights reserved. 18 | // A 'ServerMediaSubsession' object that creates new, unicast, "RTPSink"s 19 | // on demand, from a MPEG-4 video file. 20 | // C++ header 21 | 22 | #ifndef _MPEG4_VIDEO_FILE_SERVER_MEDIA_SUBSESSION_HH 23 | #define _MPEG4_VIDEO_FILE_SERVER_MEDIA_SUBSESSION_HH 24 | 25 | #ifndef _FILE_SERVER_MEDIA_SUBSESSION_HH 26 | #include "FileServerMediaSubsession.hh" 27 | #endif 28 | 29 | class MPEG4VideoFileServerMediaSubsession: public FileServerMediaSubsession{ 30 | public: 31 | static MPEG4VideoFileServerMediaSubsession* 32 | createNew(UsageEnvironment& env, char const* fileName, Boolean reuseFirstSource); 33 | 34 | // Used to implement "getAuxSDPLine()": 35 | void checkForAuxSDPLine1(); 36 | void afterPlayingDummy1(); 37 | 38 | protected: 39 | MPEG4VideoFileServerMediaSubsession(UsageEnvironment& env, 40 | char const* fileName, Boolean reuseFirstSource); 41 | // called only by createNew(); 42 | virtual ~MPEG4VideoFileServerMediaSubsession(); 43 | 44 | void setDoneFlag() { fDoneFlag = ~0; } 45 | 46 | protected: // redefined virtual functions 47 | virtual char const* getAuxSDPLine(RTPSink* rtpSink, 48 | FramedSource* inputSource); 49 | virtual FramedSource* createNewStreamSource(unsigned clientSessionId, 50 | unsigned& estBitrate); 51 | virtual RTPSink* createNewRTPSink(Groupsock* rtpGroupsock, 52 | unsigned char rtpPayloadTypeIfDynamic, 53 | FramedSource* inputSource); 54 | 55 | private: 56 | char* fAuxSDPLine; 57 | char fDoneFlag; // used when setting up "fAuxSDPLine" 58 | RTPSink* fDummyRTPSink; // ditto 59 | }; 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /include/live555/liveMedia/AMRAudioRTPSink.hh: -------------------------------------------------------------------------------- 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 .) 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-2017 Live Networks, Inc. All rights reserved. 18 | // RTP sink for AMR audio (RFC 4867) 19 | // C++ header 20 | 21 | #ifndef _AMR_AUDIO_RTP_SINK_HH 22 | #define _AMR_AUDIO_RTP_SINK_HH 23 | 24 | #ifndef _AUDIO_RTP_SINK_HH 25 | #include "AudioRTPSink.hh" 26 | #endif 27 | 28 | class AMRAudioRTPSink: public AudioRTPSink { 29 | public: 30 | static AMRAudioRTPSink* createNew(UsageEnvironment& env, 31 | Groupsock* RTPgs, 32 | unsigned char rtpPayloadFormat, 33 | Boolean sourceIsWideband = False, 34 | unsigned numChannelsInSource = 1); 35 | 36 | Boolean sourceIsWideband() const { return fSourceIsWideband; } 37 | 38 | protected: 39 | AMRAudioRTPSink(UsageEnvironment& env, Groupsock* RTPgs, 40 | unsigned char rtpPayloadFormat, 41 | Boolean sourceIsWideband, unsigned numChannelsInSource); 42 | // called only by createNew() 43 | 44 | virtual ~AMRAudioRTPSink(); 45 | 46 | private: // redefined virtual functions: 47 | virtual Boolean sourceIsCompatibleWithUs(MediaSource& source); 48 | virtual void doSpecialFrameHandling(unsigned fragmentationOffset, 49 | unsigned char* frameStart, 50 | unsigned numBytesInFrame, 51 | struct timeval framePresentationTime, 52 | unsigned numRemainingBytes); 53 | virtual Boolean 54 | frameCanAppearAfterPacketStart(unsigned char const* frameStart, 55 | unsigned numBytesInFrame) const; 56 | 57 | virtual unsigned specialHeaderSize() const; 58 | virtual char const* auxSDPLine(); 59 | 60 | private: 61 | Boolean fSourceIsWideband; 62 | char* fFmtpSDPLine; 63 | }; 64 | 65 | #endif 66 | -------------------------------------------------------------------------------- /include/live555/liveMedia/H264VideoFileServerMediaSubsession.hh: -------------------------------------------------------------------------------- 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 .) 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-2017 Live Networks, Inc. All rights reserved. 18 | // A 'ServerMediaSubsession' object that creates new, unicast, "RTPSink"s 19 | // on demand, from a H264 Elementary Stream video file. 20 | // C++ header 21 | 22 | #ifndef _H264_VIDEO_FILE_SERVER_MEDIA_SUBSESSION_HH 23 | #define _H264_VIDEO_FILE_SERVER_MEDIA_SUBSESSION_HH 24 | 25 | #ifndef _FILE_SERVER_MEDIA_SUBSESSION_HH 26 | #include "FileServerMediaSubsession.hh" 27 | #endif 28 | 29 | class H264VideoFileServerMediaSubsession: public FileServerMediaSubsession { 30 | public: 31 | static H264VideoFileServerMediaSubsession* 32 | createNew(UsageEnvironment& env, char const* fileName, Boolean reuseFirstSource); 33 | 34 | // Used to implement "getAuxSDPLine()": 35 | void checkForAuxSDPLine1(); 36 | void afterPlayingDummy1(); 37 | 38 | protected: 39 | H264VideoFileServerMediaSubsession(UsageEnvironment& env, 40 | char const* fileName, Boolean reuseFirstSource); 41 | // called only by createNew(); 42 | virtual ~H264VideoFileServerMediaSubsession(); 43 | 44 | void setDoneFlag() { fDoneFlag = ~0; } 45 | 46 | protected: // redefined virtual functions 47 | virtual char const* getAuxSDPLine(RTPSink* rtpSink, 48 | FramedSource* inputSource); 49 | virtual FramedSource* createNewStreamSource(unsigned clientSessionId, 50 | unsigned& estBitrate); 51 | virtual RTPSink* createNewRTPSink(Groupsock* rtpGroupsock, 52 | unsigned char rtpPayloadTypeIfDynamic, 53 | FramedSource* inputSource); 54 | 55 | private: 56 | char* fAuxSDPLine; 57 | char fDoneFlag; // used when setting up "fAuxSDPLine" 58 | RTPSink* fDummyRTPSink; // ditto 59 | }; 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /include/live555/liveMedia/H265VideoFileServerMediaSubsession.hh: -------------------------------------------------------------------------------- 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 .) 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-2017 Live Networks, Inc. All rights reserved. 18 | // A 'ServerMediaSubsession' object that creates new, unicast, "RTPSink"s 19 | // on demand, from a H265 Elementary Stream video file. 20 | // C++ header 21 | 22 | #ifndef _H265_VIDEO_FILE_SERVER_MEDIA_SUBSESSION_HH 23 | #define _H265_VIDEO_FILE_SERVER_MEDIA_SUBSESSION_HH 24 | 25 | #ifndef _FILE_SERVER_MEDIA_SUBSESSION_HH 26 | #include "FileServerMediaSubsession.hh" 27 | #endif 28 | 29 | class H265VideoFileServerMediaSubsession: public FileServerMediaSubsession { 30 | public: 31 | static H265VideoFileServerMediaSubsession* 32 | createNew(UsageEnvironment& env, char const* fileName, Boolean reuseFirstSource); 33 | 34 | // Used to implement "getAuxSDPLine()": 35 | void checkForAuxSDPLine1(); 36 | void afterPlayingDummy1(); 37 | 38 | protected: 39 | H265VideoFileServerMediaSubsession(UsageEnvironment& env, 40 | char const* fileName, Boolean reuseFirstSource); 41 | // called only by createNew(); 42 | virtual ~H265VideoFileServerMediaSubsession(); 43 | 44 | void setDoneFlag() { fDoneFlag = ~0; } 45 | 46 | protected: // redefined virtual functions 47 | virtual char const* getAuxSDPLine(RTPSink* rtpSink, 48 | FramedSource* inputSource); 49 | virtual FramedSource* createNewStreamSource(unsigned clientSessionId, 50 | unsigned& estBitrate); 51 | virtual RTPSink* createNewRTPSink(Groupsock* rtpGroupsock, 52 | unsigned char rtpPayloadTypeIfDynamic, 53 | FramedSource* inputSource); 54 | 55 | private: 56 | char* fAuxSDPLine; 57 | char fDoneFlag; // used when setting up "fAuxSDPLine" 58 | RTPSink* fDummyRTPSink; // ditto 59 | }; 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /include/live555/liveMedia/DeviceSource.hh: -------------------------------------------------------------------------------- 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 .) 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-2017 Live Networks, Inc. All rights reserved. 18 | // A template for a MediaSource encapsulating an audio/video input device 19 | // 20 | // NOTE: Sections of this code labeled "%%% TO BE WRITTEN %%%" are incomplete, and needto be written by the programmer 21 | // (depending on the features of the particulardevice). 22 | // C++ header 23 | 24 | #ifndef _DEVICE_SOURCE_HH 25 | #define _DEVICE_SOURCE_HH 26 | 27 | #ifndef _FRAMED_SOURCE_HH 28 | #include "FramedSource.hh" 29 | #endif 30 | 31 | // The following class can be used to define specific encoder parameters 32 | class DeviceParameters { 33 | //%%% TO BE WRITTEN %%% 34 | }; 35 | 36 | class DeviceSource: public FramedSource { 37 | public: 38 | static DeviceSource* createNew(UsageEnvironment& env, 39 | DeviceParameters params); 40 | 41 | public: 42 | static EventTriggerId eventTriggerId; 43 | // Note that this is defined here to be a static class variable, because this code is intended to illustrate how to 44 | // encapsulate a *single* device - not a set of devices. 45 | // You can, however, redefine this to be a non-static member variable. 46 | 47 | protected: 48 | DeviceSource(UsageEnvironment& env, DeviceParameters params); 49 | // called only by createNew(), or by subclass constructors 50 | virtual ~DeviceSource(); 51 | 52 | private: 53 | // redefined virtual functions: 54 | virtual void doGetNextFrame(); 55 | //virtual void doStopGettingFrames(); // optional 56 | 57 | private: 58 | static void deliverFrame0(void* clientData); 59 | void deliverFrame(); 60 | 61 | private: 62 | static unsigned referenceCount; // used to count how many instances of this class currently exist 63 | DeviceParameters fParams; 64 | }; 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /include/live555/liveMedia/AudioInputDevice.hh: -------------------------------------------------------------------------------- 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 .) 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 | // Copyright (c) 1996-2017 Live Networks, Inc. All rights reserved. 17 | // Generic audio input device (such as a microphone, or an input sound card) 18 | // C++ header 19 | 20 | #ifndef _AUDIO_INPUT_DEVICE_HH 21 | #define _AUDIO_INPUT_DEVICE_HH 22 | 23 | #ifndef _FRAMED_SOURCE_HH 24 | #include "FramedSource.hh" 25 | #endif 26 | 27 | class AudioPortNames { 28 | public: 29 | AudioPortNames(); 30 | virtual ~AudioPortNames(); 31 | 32 | unsigned numPorts; 33 | char** portName; 34 | }; 35 | 36 | class AudioInputDevice: public FramedSource { 37 | public: 38 | unsigned char bitsPerSample() const { return fBitsPerSample; } 39 | unsigned char numChannels() const { return fNumChannels; } 40 | unsigned samplingFrequency() const { return fSamplingFrequency; } 41 | 42 | virtual Boolean setInputPort(int portIndex) = 0; 43 | virtual double getAverageLevel() const = 0; 44 | 45 | static AudioInputDevice* 46 | createNew(UsageEnvironment& env, int inputPortNumber, 47 | unsigned char bitsPerSample, unsigned char numChannels, 48 | unsigned samplingFrequency, unsigned granularityInMS = 20); 49 | static AudioPortNames* getPortNames(); 50 | 51 | static char** allowedDeviceNames; 52 | // If this is set to non-NULL, then it's a NULL-terminated array of strings 53 | // of device names that we are allowed to access. 54 | 55 | protected: 56 | AudioInputDevice(UsageEnvironment& env, 57 | unsigned char bitsPerSample, 58 | unsigned char numChannels, 59 | unsigned samplingFrequency, 60 | unsigned granularityInMS); 61 | // we're an abstract base class 62 | 63 | virtual ~AudioInputDevice(); 64 | 65 | protected: 66 | unsigned char fBitsPerSample, fNumChannels; 67 | unsigned fSamplingFrequency; 68 | unsigned fGranularityInMS; 69 | }; 70 | 71 | #endif 72 | -------------------------------------------------------------------------------- /include/live555/liveMedia/QuickTimeGenericRTPSource.hh: -------------------------------------------------------------------------------- 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 .) 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-2017 Live Networks, Inc. All rights reserved. 18 | // RTP Sources containing generic QuickTime stream data, as defined in 19 | // 20 | // C++ header 21 | 22 | #ifndef _QUICKTIME_GENERIC_RTP_SOURCE_HH 23 | #define _QUICKTIME_GENERIC_RTP_SOURCE_HH 24 | 25 | #ifndef _MULTI_FRAMED_RTP_SOURCE_HH 26 | #include "MultiFramedRTPSource.hh" 27 | #endif 28 | 29 | class QuickTimeGenericRTPSource: public MultiFramedRTPSource { 30 | public: 31 | static QuickTimeGenericRTPSource* 32 | createNew(UsageEnvironment& env, Groupsock* RTPgs, 33 | unsigned char rtpPayloadFormat, unsigned rtpTimestampFrequency, 34 | char const* mimeTypeString); 35 | 36 | // QuickTime-specific information, set from the QuickTime header 37 | // in each packet. This, along with the data following the header, 38 | // is used by receivers. 39 | struct QTState { 40 | char PCK; 41 | unsigned timescale; 42 | char* sdAtom; 43 | unsigned sdAtomSize; 44 | unsigned short width, height; 45 | // later add other state as needed ##### 46 | } qtState; 47 | 48 | protected: 49 | virtual ~QuickTimeGenericRTPSource(); 50 | 51 | private: 52 | QuickTimeGenericRTPSource(UsageEnvironment& env, Groupsock* RTPgs, 53 | unsigned char rtpPayloadFormat, 54 | unsigned rtpTimestampFrequency, 55 | char const* mimeTypeString); 56 | // called only by createNew() 57 | 58 | private: 59 | // redefined virtual functions: 60 | virtual Boolean processSpecialHeader(BufferedPacket* packet, 61 | unsigned& resultSpecialHeaderSize); 62 | virtual char const* MIMEtype() const; 63 | 64 | private: 65 | char const* fMIMEtypeString; 66 | }; 67 | 68 | #endif 69 | -------------------------------------------------------------------------------- /include/live555/liveMedia/MPEG1or2DemuxedElementaryStream.hh: -------------------------------------------------------------------------------- 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 .) 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-2017 Live Networks, Inc. All rights reserved. 18 | // A MPEG 1 or 2 Elementary Stream, demultiplexed from a Program Stream 19 | // C++ header 20 | 21 | #ifndef _MPEG_1OR2_DEMUXED_ELEMENTARY_STREAM_HH 22 | #define _MPEG_1OR2_DEMUXED_ELEMENTARY_STREAM_HH 23 | 24 | #ifndef _MPEG_1OR2_DEMUX_HH 25 | #include "MPEG1or2Demux.hh" 26 | #endif 27 | 28 | class MPEG1or2DemuxedElementaryStream: public FramedSource { 29 | public: 30 | MPEG1or2Demux::SCR lastSeenSCR() const { return fLastSeenSCR; } 31 | 32 | unsigned char mpegVersion() const { return fMPEGversion; } 33 | 34 | MPEG1or2Demux& sourceDemux() const { return fOurSourceDemux; } 35 | 36 | private: // We are created only by a MPEG1or2Demux (a friend) 37 | MPEG1or2DemuxedElementaryStream(UsageEnvironment& env, 38 | u_int8_t streamIdTag, 39 | MPEG1or2Demux& sourceDemux); 40 | virtual ~MPEG1or2DemuxedElementaryStream(); 41 | 42 | private: 43 | // redefined virtual functions: 44 | virtual void doGetNextFrame(); 45 | virtual void doStopGettingFrames(); 46 | virtual char const* MIMEtype() const; 47 | virtual unsigned maxFrameSize() const; 48 | 49 | private: 50 | static void afterGettingFrame(void* clientData, 51 | unsigned frameSize, unsigned numTruncatedBytes, 52 | struct timeval presentationTime, 53 | unsigned durationInMicroseconds); 54 | 55 | void afterGettingFrame1(unsigned frameSize, unsigned numTruncatedBytes, 56 | struct timeval presentationTime, 57 | unsigned durationInMicroseconds); 58 | 59 | private: 60 | u_int8_t fOurStreamIdTag; 61 | MPEG1or2Demux& fOurSourceDemux; 62 | char const* fMIMEtype; 63 | MPEG1or2Demux::SCR fLastSeenSCR; 64 | unsigned char fMPEGversion; 65 | 66 | friend class MPEG1or2Demux; 67 | }; 68 | 69 | #endif 70 | -------------------------------------------------------------------------------- /include/live555/liveMedia/H265VideoRTPSource.hh: -------------------------------------------------------------------------------- 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 .) 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-2017 Live Networks, Inc. All rights reserved. 18 | // H.265 Video RTP Sources 19 | // C++ header 20 | 21 | #ifndef _H265_VIDEO_RTP_SOURCE_HH 22 | #define _H265_VIDEO_RTP_SOURCE_HH 23 | 24 | #ifndef _MULTI_FRAMED_RTP_SOURCE_HH 25 | #include "MultiFramedRTPSource.hh" 26 | #endif 27 | 28 | class H265VideoRTPSource: public MultiFramedRTPSource { 29 | public: 30 | static H265VideoRTPSource* 31 | createNew(UsageEnvironment& env, Groupsock* RTPgs, 32 | unsigned char rtpPayloadFormat, 33 | Boolean expectDONFields = False, 34 | unsigned rtpTimestampFrequency = 90000); 35 | // "expectDONFields" is True iff we expect incoming H.265/RTP packets to contain 36 | // DONL and DOND fields. I.e., if "tx-mode == "MST" or sprop-depack-buf-nalus > 0". 37 | 38 | u_int64_t currentNALUnitAbsDon() const { return fCurrentNALUnitAbsDon; } 39 | // the 'absolute decoding order number (AbsDon)' for the most-recently delivered NAL unit 40 | 41 | protected: 42 | H265VideoRTPSource(UsageEnvironment& env, Groupsock* RTPgs, 43 | unsigned char rtpPayloadFormat, 44 | Boolean expectDONFields, 45 | unsigned rtpTimestampFrequency); 46 | // called only by createNew() 47 | 48 | virtual ~H265VideoRTPSource(); 49 | 50 | protected: 51 | // redefined virtual functions: 52 | virtual Boolean processSpecialHeader(BufferedPacket* packet, 53 | unsigned& resultSpecialHeaderSize); 54 | virtual char const* MIMEtype() const; 55 | 56 | private: 57 | void computeAbsDonFromDON(u_int16_t DON); 58 | 59 | private: 60 | friend class H265BufferedPacket; 61 | Boolean fExpectDONFields; 62 | unsigned char fCurPacketNALUnitType; 63 | u_int16_t fPreviousNALUnitDON; 64 | u_int64_t fCurrentNALUnitAbsDon; 65 | }; 66 | 67 | #endif 68 | -------------------------------------------------------------------------------- /include/live555/liveMedia/ByteStreamMultiFileSource.hh: -------------------------------------------------------------------------------- 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 .) 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-2017 Live Networks, Inc. All rights reserved. 18 | // A source that consists of multiple byte-stream files, read sequentially 19 | // C++ header 20 | 21 | #ifndef _BYTE_STREAM_MULTI_FILE_SOURCE_HH 22 | #define _BYTE_STREAM_MULTI_FILE_SOURCE_HH 23 | 24 | #ifndef _BYTE_STREAM_FILE_SOURCE_HH 25 | #include "ByteStreamFileSource.hh" 26 | #endif 27 | 28 | class ByteStreamMultiFileSource: public FramedSource { 29 | public: 30 | static ByteStreamMultiFileSource* 31 | createNew(UsageEnvironment& env, char const** fileNameArray, 32 | unsigned preferredFrameSize = 0, unsigned playTimePerFrame = 0); 33 | // A 'filename' of NULL indicates the end of the array 34 | 35 | Boolean haveStartedNewFile() const { return fHaveStartedNewFile; } 36 | // True iff the most recently delivered frame was the first from a newly-opened file 37 | 38 | protected: 39 | ByteStreamMultiFileSource(UsageEnvironment& env, char const** fileNameArray, 40 | unsigned preferredFrameSize, unsigned playTimePerFrame); 41 | // called only by createNew() 42 | 43 | virtual ~ByteStreamMultiFileSource(); 44 | 45 | private: 46 | // redefined virtual functions: 47 | virtual void doGetNextFrame(); 48 | 49 | private: 50 | static void onSourceClosure(void* clientData); 51 | void onSourceClosure1(); 52 | static void afterGettingFrame(void* clientData, 53 | unsigned frameSize, unsigned numTruncatedBytes, 54 | struct timeval presentationTime, 55 | unsigned durationInMicroseconds); 56 | 57 | private: 58 | unsigned fPreferredFrameSize; 59 | unsigned fPlayTimePerFrame; 60 | unsigned fNumSources; 61 | unsigned fCurrentlyReadSourceNumber; 62 | Boolean fHaveStartedNewFile; 63 | char const** fFileNameArray; 64 | ByteStreamFileSource** fSourceArray; 65 | }; 66 | 67 | #endif 68 | -------------------------------------------------------------------------------- /include/live555/liveMedia/AC3AudioStreamFramer.hh: -------------------------------------------------------------------------------- 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 .) 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-2017 Live Networks, Inc. All rights reserved. 18 | // A filter that breaks up an AC3 audio elementary stream into frames 19 | // C++ header 20 | 21 | #ifndef _AC3_AUDIO_STREAM_FRAMER_HH 22 | #define _AC3_AUDIO_STREAM_FRAMER_HH 23 | 24 | #ifndef _FRAMED_FILTER_HH 25 | #include "FramedFilter.hh" 26 | #endif 27 | 28 | class AC3AudioStreamFramer: public FramedFilter { 29 | public: 30 | static AC3AudioStreamFramer* 31 | createNew(UsageEnvironment& env, FramedSource* inputSource, 32 | unsigned char streamCode = 0); 33 | // If "streamCode" != 0, then we assume that there's a 1-byte code at the beginning of each chunk of data that we read from 34 | // our source. If that code is not the value we want, we discard the chunk of data. 35 | // However, if "streamCode" == 0 (the default), then we don't expect this 1-byte code. 36 | 37 | unsigned samplingRate(); 38 | 39 | void flushInput(); // called if there is a discontinuity (seeking) in the input 40 | 41 | private: 42 | AC3AudioStreamFramer(UsageEnvironment& env, FramedSource* inputSource, 43 | unsigned char streamCode); 44 | // called only by createNew() 45 | virtual ~AC3AudioStreamFramer(); 46 | 47 | static void handleNewData(void* clientData, 48 | unsigned char* ptr, unsigned size, 49 | struct timeval presentationTime); 50 | void handleNewData(unsigned char* ptr, unsigned size); 51 | 52 | void parseNextFrame(); 53 | 54 | private: 55 | // redefined virtual functions: 56 | virtual void doGetNextFrame(); 57 | 58 | private: 59 | struct timeval currentFramePlayTime() const; 60 | 61 | private: 62 | struct timeval fNextFramePresentationTime; 63 | 64 | private: // parsing state 65 | class AC3AudioStreamParser* fParser; 66 | unsigned char fOurStreamCode; 67 | friend class AC3AudioStreamParser; // hack 68 | }; 69 | 70 | #endif 71 | -------------------------------------------------------------------------------- /include/live555/liveMedia/H264VideoRTPSink.hh: -------------------------------------------------------------------------------- 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 .) 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-2017 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 | -------------------------------------------------------------------------------- /include/live555/liveMedia/H264VideoRTPSource.hh: -------------------------------------------------------------------------------- 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 .) 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-2017 Live Networks, Inc. All rights reserved. 18 | // H.264 Video RTP Sources 19 | // C++ header 20 | 21 | #ifndef _H264_VIDEO_RTP_SOURCE_HH 22 | #define _H264_VIDEO_RTP_SOURCE_HH 23 | 24 | #ifndef _MULTI_FRAMED_RTP_SOURCE_HH 25 | #include "MultiFramedRTPSource.hh" 26 | #endif 27 | 28 | class H264VideoRTPSource: public MultiFramedRTPSource { 29 | public: 30 | static H264VideoRTPSource* 31 | createNew(UsageEnvironment& env, Groupsock* RTPgs, 32 | unsigned char rtpPayloadFormat, 33 | unsigned rtpTimestampFrequency = 90000); 34 | 35 | protected: 36 | H264VideoRTPSource(UsageEnvironment& env, Groupsock* RTPgs, 37 | unsigned char rtpPayloadFormat, 38 | unsigned rtpTimestampFrequency); 39 | // called only by createNew() 40 | 41 | virtual ~H264VideoRTPSource(); 42 | 43 | protected: 44 | // redefined virtual functions: 45 | virtual Boolean processSpecialHeader(BufferedPacket* packet, 46 | unsigned& resultSpecialHeaderSize); 47 | virtual char const* MIMEtype() const; 48 | 49 | private: 50 | friend class H264BufferedPacket; 51 | unsigned char fCurPacketNALUnitType; 52 | }; 53 | 54 | class SPropRecord { 55 | public: 56 | ~SPropRecord() { delete[] sPropBytes; } 57 | 58 | unsigned sPropLength; // in bytes 59 | unsigned char* sPropBytes; 60 | }; 61 | 62 | SPropRecord* parseSPropParameterSets(char const* sPropParameterSetsStr, 63 | // result parameter: 64 | unsigned& numSPropRecords); 65 | // Returns the binary value of each 'parameter set' specified in a 66 | // "sprop-parameter-sets" string (in the SDP description for a H.264/RTP stream). 67 | // The value is returned as an array (length "numSPropRecords") of "SPropRecord"s. 68 | // This array is dynamically allocated by this routine, and must be delete[]d by the caller. 69 | 70 | #endif 71 | -------------------------------------------------------------------------------- /include/live555/liveMedia/MPEG1or2AudioStreamFramer.hh: -------------------------------------------------------------------------------- 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 .) 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-2017 Live Networks, Inc. All rights reserved. 18 | // A filter that breaks up an MPEG (1,2) audio elementary stream into frames 19 | // C++ header 20 | 21 | #ifndef _MPEG_1OR2_AUDIO_STREAM_FRAMER_HH 22 | #define _MPEG_1OR2_AUDIO_STREAM_FRAMER_HH 23 | 24 | #ifndef _FRAMED_FILTER_HH 25 | #include "FramedFilter.hh" 26 | #endif 27 | 28 | class MPEG1or2AudioStreamFramer: public FramedFilter { 29 | public: 30 | static MPEG1or2AudioStreamFramer* 31 | createNew(UsageEnvironment& env, FramedSource* inputSource, 32 | Boolean syncWithInputSource = False); 33 | // If "syncWithInputSource" is True, the stream's presentation time 34 | // will be reset to that of the input source, whenever new data 35 | // is read from it. 36 | 37 | void flushInput(); // called if there is a discontinuity (seeking) in the input 38 | 39 | private: 40 | MPEG1or2AudioStreamFramer(UsageEnvironment& env, FramedSource* inputSource, 41 | Boolean syncWithInputSource); 42 | // called only by createNew() 43 | virtual ~MPEG1or2AudioStreamFramer(); 44 | 45 | static void continueReadProcessing(void* clientData, 46 | unsigned char* ptr, unsigned size, 47 | struct timeval presentationTime); 48 | void continueReadProcessing(); 49 | 50 | void resetPresentationTime(struct timeval newPresentationTime); 51 | // useful if we're being synced with a separate (e.g., video) stream 52 | 53 | private: 54 | // redefined virtual functions: 55 | virtual void doGetNextFrame(); 56 | 57 | private: 58 | void reset(); 59 | struct timeval currentFramePlayTime() const; 60 | 61 | private: 62 | Boolean fSyncWithInputSource; 63 | struct timeval fNextFramePresentationTime; 64 | 65 | private: // parsing state 66 | class MPEG1or2AudioStreamParser* fParser; 67 | friend class MPEG1or2AudioStreamParser; // hack 68 | }; 69 | 70 | #endif 71 | -------------------------------------------------------------------------------- /include/live555/liveMedia/MPEG1or2FileServerDemux.hh: -------------------------------------------------------------------------------- 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 .) 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-2017 Live Networks, Inc. All rights reserved. 18 | // A server demultiplexer for a MPEG 1 or 2 Program Stream 19 | // C++ header 20 | 21 | #ifndef _MPEG_1OR2_FILE_SERVER_DEMUX_HH 22 | #define _MPEG_1OR2_FILE_SERVER_DEMUX_HH 23 | 24 | #ifndef _SERVER_MEDIA_SESSION_HH 25 | #include "ServerMediaSession.hh" 26 | #endif 27 | #ifndef _MPEG_1OR2_DEMUXED_ELEMENTARY_STREAM_HH 28 | #include "MPEG1or2DemuxedElementaryStream.hh" 29 | #endif 30 | 31 | class MPEG1or2FileServerDemux: public Medium { 32 | public: 33 | static MPEG1or2FileServerDemux* 34 | createNew(UsageEnvironment& env, char const* fileName, Boolean reuseFirstSource); 35 | 36 | ServerMediaSubsession* newAudioServerMediaSubsession(); // MPEG-1 or 2 audio 37 | ServerMediaSubsession* newVideoServerMediaSubsession(Boolean iFramesOnly = False, 38 | double vshPeriod = 5.0 39 | /* how often (in seconds) to inject a Video_Sequence_Header, 40 | if one doesn't already appear in the stream */); 41 | ServerMediaSubsession* newAC3AudioServerMediaSubsession(); // AC-3 audio (from VOB) 42 | 43 | unsigned fileSize() const { return fFileSize; } 44 | float fileDuration() const { return fFileDuration; } 45 | 46 | private: 47 | MPEG1or2FileServerDemux(UsageEnvironment& env, char const* fileName, 48 | Boolean reuseFirstSource); 49 | // called only by createNew(); 50 | virtual ~MPEG1or2FileServerDemux(); 51 | 52 | private: 53 | friend class MPEG1or2DemuxedServerMediaSubsession; 54 | MPEG1or2DemuxedElementaryStream* newElementaryStream(unsigned clientSessionId, 55 | u_int8_t streamIdTag); 56 | 57 | private: 58 | char const* fFileName; 59 | unsigned fFileSize; 60 | float fFileDuration; 61 | Boolean fReuseFirstSource; 62 | MPEG1or2Demux* fSession0Demux; 63 | MPEG1or2Demux* fLastCreatedDemux; 64 | unsigned fLastClientSessionId; 65 | }; 66 | 67 | #endif 68 | -------------------------------------------------------------------------------- /include/live555/liveMedia/MPEG2TransportStreamFromESSource.hh: -------------------------------------------------------------------------------- 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 .) 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-2017 Live Networks, Inc. All rights reserved. 18 | // A filter for converting one or more MPEG Elementary Streams 19 | // to a MPEG-2 Transport Stream 20 | // C++ header 21 | 22 | #ifndef _MPEG2_TRANSPORT_STREAM_FROM_ES_SOURCE_HH 23 | #define _MPEG2_TRANSPORT_STREAM_FROM_ES_SOURCE_HH 24 | 25 | #ifndef _MPEG2_TRANSPORT_STREAM_MULTIPLEXOR_HH 26 | #include "MPEG2TransportStreamMultiplexor.hh" 27 | #endif 28 | 29 | class MPEG2TransportStreamFromESSource: public MPEG2TransportStreamMultiplexor { 30 | public: 31 | static MPEG2TransportStreamFromESSource* createNew(UsageEnvironment& env); 32 | 33 | void addNewVideoSource(FramedSource* inputSource, int mpegVersion, int16_t PID = -1); 34 | // Note: For MPEG-4 video, set "mpegVersion" to 4; for H.264 video, set "mpegVersion" to 5. 35 | void addNewAudioSource(FramedSource* inputSource, int mpegVersion, int16_t PID = -1); 36 | // Note: In these functions, if "PID" is not -1, then it (currently, just the low 8 bits) 37 | // is used as the stream's PID. Otherwise (if "PID" is -1) the 'stream_id' is used as 38 | // the PID. 39 | 40 | static unsigned maxInputESFrameSize; 41 | 42 | protected: 43 | MPEG2TransportStreamFromESSource(UsageEnvironment& env); 44 | // called only by createNew() 45 | virtual ~MPEG2TransportStreamFromESSource(); 46 | 47 | void addNewInputSource(FramedSource* inputSource, 48 | u_int8_t streamId, int mpegVersion, int16_t PID = -1); 49 | // used to implement addNew*Source() above 50 | 51 | private: 52 | // Redefined virtual functions: 53 | virtual void doStopGettingFrames(); 54 | virtual void awaitNewBuffer(unsigned char* oldBuffer); 55 | 56 | private: 57 | friend class InputESSourceRecord; 58 | class InputESSourceRecord* fInputSources; 59 | unsigned fVideoSourceCounter, fAudioSourceCounter; 60 | Boolean fAwaitingBackgroundDelivery; 61 | }; 62 | 63 | #endif 64 | -------------------------------------------------------------------------------- /include/live555/liveMedia/SimpleRTPSource.hh: -------------------------------------------------------------------------------- 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 .) 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-2017 Live Networks, Inc. All rights reserved. 18 | // A RTP source for a simple RTP payload format that 19 | // - doesn't have any special headers following the RTP header 20 | // (if necessary, the "offset" parameter can be used to specify a 21 | // special header that we just skip over) 22 | // - doesn't have any special framing apart from the packet data itself 23 | // C++ header 24 | 25 | #ifndef _SIMPLE_RTP_SOURCE_HH 26 | #define _SIMPLE_RTP_SOURCE_HH 27 | 28 | #ifndef _MULTI_FRAMED_RTP_SOURCE_HH 29 | #include "MultiFramedRTPSource.hh" 30 | #endif 31 | 32 | class SimpleRTPSource: public MultiFramedRTPSource { 33 | public: 34 | static SimpleRTPSource* createNew(UsageEnvironment& env, Groupsock* RTPgs, 35 | unsigned char rtpPayloadFormat, 36 | unsigned rtpTimestampFrequency, 37 | char const* mimeTypeString, 38 | unsigned offset = 0, 39 | Boolean doNormalMBitRule = True); 40 | // "doNormalMBitRule" means: If the medium is not audio, use the RTP "M" 41 | // bit on each incoming packet to indicate the last (or only) fragment 42 | // of a frame. Otherwise (i.e., if "doNormalMBitRule" is False, or the medium is "audio"), the "M" bit is ignored. 43 | 44 | protected: 45 | virtual ~SimpleRTPSource(); 46 | 47 | protected: 48 | SimpleRTPSource(UsageEnvironment& env, Groupsock* RTPgs, 49 | unsigned char rtpPayloadFormat, 50 | unsigned rtpTimestampFrequency, 51 | char const* mimeTypeString, unsigned offset, 52 | Boolean doNormalMBitRule); 53 | // called only by createNew() 54 | 55 | private: 56 | // redefined virtual functions: 57 | virtual Boolean processSpecialHeader(BufferedPacket* packet, 58 | unsigned& resultSpecialHeaderSize); 59 | virtual char const* MIMEtype() const; 60 | 61 | private: 62 | char const* fMIMEtypeString; 63 | unsigned fOffset; 64 | Boolean fUseMBitForFrameEnd; 65 | }; 66 | 67 | #endif 68 | -------------------------------------------------------------------------------- /include/live555/liveMedia/MPEG4LATMAudioRTPSink.hh: -------------------------------------------------------------------------------- 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 .) 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-2017 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 | 30 | class MPEG4LATMAudioRTPSink: public AudioRTPSink { 31 | public: 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 | 40 | protected: 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 | 51 | private: // 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 | 63 | private: 64 | char const* fStreamMuxConfigString; 65 | char* fFmtpSDPLine; 66 | Boolean fAllowMultipleFramesPerPacket; 67 | }; 68 | 69 | #endif 70 | -------------------------------------------------------------------------------- /include/live555/liveMedia/TCPStreamSink.hh: -------------------------------------------------------------------------------- 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 .) 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-2017 Live Networks, Inc. All rights reserved. 18 | // A sink representing a TCP output stream 19 | // C++ header 20 | 21 | #ifndef _TCP_STREAM_SINK_HH 22 | #define _TCP_STREAM_SINK_HH 23 | 24 | #ifndef _MEDIA_SINK_HH 25 | #include "MediaSink.hh" 26 | #endif 27 | 28 | #define TCP_STREAM_SINK_BUFFER_SIZE 10000 29 | 30 | class TCPStreamSink: public MediaSink { 31 | public: 32 | static TCPStreamSink* createNew(UsageEnvironment& env, int socketNum); 33 | // "socketNum" is the socket number of an existing, writable TCP socket (which should be non-blocking). 34 | // The caller is responsible for closing this socket later (when this object no longer exists). 35 | 36 | protected: 37 | TCPStreamSink(UsageEnvironment& env, int socketNum); // called only by "createNew()" 38 | virtual ~TCPStreamSink(); 39 | 40 | protected: 41 | // Redefined virtual functions: 42 | virtual Boolean continuePlaying(); 43 | 44 | private: 45 | void processBuffer(); // common routine, called from both the 'socket writable' and 'incoming data' handlers below 46 | 47 | static void socketWritableHandler(void* clientData, int mask); 48 | void socketWritableHandler1(); 49 | 50 | static void afterGettingFrame(void* clientData, unsigned frameSize, unsigned numTruncatedBytes, 51 | struct timeval /*presentationTime*/, unsigned /*durationInMicroseconds*/); 52 | void afterGettingFrame(unsigned frameSize, unsigned numTruncatedBytes); 53 | 54 | static void ourOnSourceClosure(void* clientData); 55 | void ourOnSourceClosure1(); 56 | 57 | unsigned numUnwrittenBytes() const { return fUnwrittenBytesEnd - fUnwrittenBytesStart; } 58 | unsigned freeBufferSpace() const { return TCP_STREAM_SINK_BUFFER_SIZE - fUnwrittenBytesEnd; } 59 | 60 | private: 61 | unsigned char fBuffer[TCP_STREAM_SINK_BUFFER_SIZE]; 62 | unsigned fUnwrittenBytesStart, fUnwrittenBytesEnd; 63 | Boolean fInputSourceIsOpen, fOutputSocketIsWritable; 64 | int fOutputSocketNum; 65 | }; 66 | 67 | #endif 68 | -------------------------------------------------------------------------------- /include/live555/liveMedia/MPEG1or2DemuxedServerMediaSubsession.hh: -------------------------------------------------------------------------------- 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 .) 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-2017 Live Networks, Inc. All rights reserved. 18 | // A 'ServerMediaSubsession' object that creates new, unicast, "RTPSink"s 19 | // on demand, from a MPEG-1 or 2 demuxer. 20 | // C++ header 21 | 22 | #ifndef _MPEG_1OR2_DEMUXED_SERVER_MEDIA_SUBSESSION_HH 23 | #define _MPEG_1OR2_DEMUXED_SERVER_MEDIA_SUBSESSION_HH 24 | 25 | #ifndef _ON_DEMAND_SERVER_MEDIA_SUBSESSION_HH 26 | #include "OnDemandServerMediaSubsession.hh" 27 | #endif 28 | #ifndef _MPEG_1OR2_FILE_SERVER_DEMUX_HH 29 | #include "MPEG1or2FileServerDemux.hh" 30 | #endif 31 | 32 | class MPEG1or2DemuxedServerMediaSubsession: public OnDemandServerMediaSubsession{ 33 | public: 34 | static MPEG1or2DemuxedServerMediaSubsession* 35 | createNew(MPEG1or2FileServerDemux& demux, u_int8_t streamIdTag, 36 | Boolean reuseFirstSource, 37 | Boolean iFramesOnly = False, double vshPeriod = 5.0); 38 | // The last two parameters are relevant for video streams only 39 | 40 | private: 41 | MPEG1or2DemuxedServerMediaSubsession(MPEG1or2FileServerDemux& demux, 42 | u_int8_t streamIdTag, Boolean reuseFirstSource, 43 | Boolean iFramesOnly, double vshPeriod); 44 | // called only by createNew(); 45 | virtual ~MPEG1or2DemuxedServerMediaSubsession(); 46 | 47 | private: // redefined virtual functions 48 | virtual void seekStreamSource(FramedSource* inputSource, double& seekNPT, double streamDuration, u_int64_t& numBytes); 49 | virtual FramedSource* createNewStreamSource(unsigned clientSessionId, 50 | unsigned& estBitrate); 51 | virtual RTPSink* createNewRTPSink(Groupsock* rtpGroupsock, 52 | unsigned char rtpPayloadTypeIfDynamic, 53 | FramedSource* inputSource); 54 | virtual float duration() const; 55 | 56 | private: 57 | MPEG1or2FileServerDemux& fOurDemux; 58 | u_int8_t fStreamIdTag; 59 | Boolean fIFramesOnly; // for video streams 60 | double fVSHPeriod; // for video streams 61 | }; 62 | 63 | #endif 64 | -------------------------------------------------------------------------------- /include/live555/liveMedia/RTSPCommon.hh: -------------------------------------------------------------------------------- 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 .) 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-2017 Live Networks, Inc. All rights reserved. 18 | // Common routines used by both RTSP clients and servers 19 | // C++ header 20 | 21 | #ifndef _RTSP_COMMON_HH 22 | #define _RTSP_COMMON_HH 23 | 24 | #ifndef _BOOLEAN_HH 25 | #include "Boolean.hh" 26 | #endif 27 | 28 | #ifndef _MEDIA_HH 29 | #include // includes some definitions perhaps needed for Borland compilers? 30 | #endif 31 | 32 | #if defined(__WIN32__) || defined(_WIN32) || defined(_QNX4) 33 | #define _strncasecmp _strnicmp 34 | #define snprintf _snprintf 35 | #else 36 | #define _strncasecmp strncasecmp 37 | #endif 38 | 39 | #define RTSP_PARAM_STRING_MAX 200 40 | 41 | Boolean parseRTSPRequestString(char const *reqStr, unsigned reqStrSize, 42 | char *resultCmdName, 43 | unsigned resultCmdNameMaxSize, 44 | char* resultURLPreSuffix, 45 | unsigned resultURLPreSuffixMaxSize, 46 | char* resultURLSuffix, 47 | unsigned resultURLSuffixMaxSize, 48 | char* resultCSeq, 49 | unsigned resultCSeqMaxSize, 50 | char* resultSessionId, 51 | unsigned resultSessionIdMaxSize, 52 | unsigned& contentLength); 53 | 54 | Boolean parseRangeParam(char const* paramStr, double& rangeStart, double& rangeEnd, char*& absStartTime, char*& absEndTime, Boolean& startTimeIsNow); 55 | Boolean parseRangeHeader(char const* buf, double& rangeStart, double& rangeEnd, char*& absStartTime, char*& absEndTime, Boolean& startTimeIsNow); 56 | 57 | Boolean parseScaleHeader(char const* buf, float& scale); 58 | 59 | Boolean RTSPOptionIsSupported(char const* commandName, char const* optionsResponseString); 60 | // Returns True iff the RTSP command "commandName" is mentioned as one of the commands supported in "optionsResponseString" 61 | // (which should be the 'resultString' from a previous RTSP "OPTIONS" request). 62 | 63 | char const* dateHeader(); // A "Date:" header that can be used in a RTSP (or HTTP) response 64 | 65 | #endif 66 | -------------------------------------------------------------------------------- /include/live555/usageEnvironment/HashTable.hh: -------------------------------------------------------------------------------- 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 .) 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 | // Copyright (c) 1996-2017 Live Networks, Inc. All rights reserved. 17 | // Generic Hash Table 18 | // C++ header 19 | 20 | #ifndef _HASH_TABLE_HH 21 | #define _HASH_TABLE_HH 22 | 23 | #ifndef _BOOLEAN_HH 24 | #include "Boolean.hh" 25 | #endif 26 | 27 | class HashTable { 28 | public: 29 | virtual ~HashTable(); 30 | 31 | // The following must be implemented by a particular 32 | // implementation (subclass): 33 | static HashTable* create(int keyType); 34 | 35 | virtual void* Add(char const* key, void* value) = 0; 36 | // Returns the old value if different, otherwise 0 37 | virtual Boolean Remove(char const* key) = 0; 38 | virtual void* Lookup(char const* key) const = 0; 39 | // Returns 0 if not found 40 | virtual unsigned numEntries() const = 0; 41 | Boolean IsEmpty() const { return numEntries() == 0; } 42 | 43 | // Used to iterate through the members of the table: 44 | class Iterator { 45 | public: 46 | // The following must be implemented by a particular 47 | // implementation (subclass): 48 | static Iterator* create(HashTable const& hashTable); 49 | 50 | virtual ~Iterator(); 51 | 52 | virtual void* next(char const*& key) = 0; // returns 0 if none 53 | 54 | protected: 55 | Iterator(); // abstract base class 56 | }; 57 | 58 | // A shortcut that can be used to successively remove each of 59 | // the entries in the table (e.g., so that their values can be 60 | // deleted, if they happen to be pointers to allocated memory). 61 | void* RemoveNext(); 62 | 63 | // Returns the first entry in the table. 64 | // (This is useful for deleting each entry in the table, if the entry's destructor also removes itself from the table.) 65 | void* getFirst(); 66 | 67 | protected: 68 | HashTable(); // abstract base class 69 | }; 70 | 71 | // Warning: The following are deliberately the same as in 72 | // Tcl's hash table implementation 73 | int const STRING_HASH_KEYS = 0; 74 | int const ONE_WORD_HASH_KEYS = 1; 75 | 76 | #endif 77 | -------------------------------------------------------------------------------- /include/live555/liveMedia/ByteStreamMemoryBufferSource.hh: -------------------------------------------------------------------------------- 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 .) 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-2017 Live Networks, Inc. All rights reserved. 18 | // A class for streaming data from a (static) memory buffer, as if it were a file. 19 | // C++ header 20 | 21 | #ifndef _BYTE_STREAM_MEMORY_BUFFER_SOURCE_HH 22 | #define _BYTE_STREAM_MEMORY_BUFFER_SOURCE_HH 23 | 24 | #ifndef _FRAMED_SOURCE_HH 25 | #include "FramedSource.hh" 26 | #endif 27 | 28 | class ByteStreamMemoryBufferSource: public FramedSource { 29 | public: 30 | static ByteStreamMemoryBufferSource* createNew(UsageEnvironment& env, 31 | u_int8_t* buffer, u_int64_t bufferSize, 32 | Boolean deleteBufferOnClose = True, 33 | unsigned preferredFrameSize = 0, 34 | unsigned playTimePerFrame = 0); 35 | // "preferredFrameSize" == 0 means 'no preference' 36 | // "playTimePerFrame" is in microseconds 37 | 38 | u_int64_t bufferSize() const { return fBufferSize; } 39 | 40 | void seekToByteAbsolute(u_int64_t byteNumber, u_int64_t numBytesToStream = 0); 41 | // if "numBytesToStream" is >0, then we limit the stream to that number of bytes, before treating it as EOF 42 | void seekToByteRelative(int64_t offset, u_int64_t numBytesToStream = 0); 43 | 44 | protected: 45 | ByteStreamMemoryBufferSource(UsageEnvironment& env, 46 | u_int8_t* buffer, u_int64_t bufferSize, 47 | Boolean deleteBufferOnClose, 48 | unsigned preferredFrameSize, 49 | unsigned playTimePerFrame); 50 | // called only by createNew() 51 | 52 | virtual ~ByteStreamMemoryBufferSource(); 53 | 54 | private: 55 | // redefined virtual functions: 56 | virtual void doGetNextFrame(); 57 | 58 | private: 59 | u_int8_t* fBuffer; 60 | u_int64_t fBufferSize; 61 | u_int64_t fCurIndex; 62 | Boolean fDeleteBufferOnClose; 63 | unsigned fPreferredFrameSize; 64 | unsigned fPlayTimePerFrame; 65 | unsigned fLastPlayTime; 66 | Boolean fLimitNumBytesToStream; 67 | u_int64_t fNumBytesToStream; // used iff "fLimitNumBytesToStream" is True 68 | }; 69 | 70 | #endif 71 | -------------------------------------------------------------------------------- /include/live555/liveMedia/InputFile.hh: -------------------------------------------------------------------------------- 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 .) 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-2017 Live Networks, Inc. All rights reserved. 18 | // Common routines for opening/closing named input files 19 | // C++ header 20 | 21 | #ifndef _INPUT_FILE_HH 22 | #define _INPUT_FILE_HH 23 | 24 | #include 25 | #include 26 | 27 | #if (defined(__WIN32__) || defined(_WIN32) || defined(_WIN32_WCE)) 28 | #ifndef _WIN32_WCE 29 | // Include header files that might be needed by Windows (in code that uses this header file): 30 | #include 31 | #include 32 | #endif 33 | 34 | #define READ_FROM_FILES_SYNCHRONOUSLY 1 35 | // Because Windows is a silly toy operating system that doesn't (reliably) treat 36 | // open files as being readable sockets (which can be handled within the default 37 | // "BasicTaskScheduler" event loop, using "select()"), we implement file reading 38 | // in Windows using synchronous, rather than asynchronous, I/O. This can severely 39 | // limit the scalability of servers using this code that run on Windows. 40 | // If this is a problem for you, then either use a better operating system, 41 | // or else write your own Windows-specific event loop ("TaskScheduler" subclass) 42 | // that can handle readable data in Windows open files as an event. 43 | #endif 44 | 45 | #ifndef _WIN32_WCE 46 | #include 47 | #endif 48 | 49 | FILE* OpenInputFile(UsageEnvironment& env, char const* fileName); 50 | 51 | void CloseInputFile(FILE* fid); 52 | 53 | u_int64_t GetFileSize(char const* fileName, FILE* fid); 54 | // 0 means zero-length, unbounded, or unknown 55 | 56 | int64_t SeekFile64(FILE *fid, int64_t offset, int whence); 57 | // A platform-independent routine for seeking within (possibly) large files 58 | 59 | int64_t TellFile64(FILE *fid); 60 | // A platform-independent routine for reporting the position within 61 | // (possibly) large files 62 | 63 | Boolean FileIsSeekable(FILE *fid); 64 | // Tests whether "fid" is seekable, by trying to seek within it. 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /include/live555/liveMedia/MPEG4GenericRTPSink.hh: -------------------------------------------------------------------------------- 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 .) 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-2017 Live Networks, Inc. All rights reserved. 18 | // MPEG4-GENERIC ("audio", "video", or "application") RTP stream sinks 19 | // C++ header 20 | 21 | #ifndef _MPEG4_GENERIC_RTP_SINK_HH 22 | #define _MPEG4_GENERIC_RTP_SINK_HH 23 | 24 | #ifndef _MULTI_FRAMED_RTP_SINK_HH 25 | #include "MultiFramedRTPSink.hh" 26 | #endif 27 | 28 | class MPEG4GenericRTPSink: public MultiFramedRTPSink { 29 | public: 30 | static MPEG4GenericRTPSink* 31 | createNew(UsageEnvironment& env, Groupsock* RTPgs, 32 | u_int8_t rtpPayloadFormat, u_int32_t rtpTimestampFrequency, 33 | char const* sdpMediaTypeString, char const* mpeg4Mode, 34 | char const* configString, 35 | unsigned numChannels = 1); 36 | 37 | protected: 38 | MPEG4GenericRTPSink(UsageEnvironment& env, Groupsock* RTPgs, 39 | u_int8_t rtpPayloadFormat, 40 | u_int32_t rtpTimestampFrequency, 41 | char const* sdpMediaTypeString, 42 | char const* mpeg4Mode, char const* configString, 43 | unsigned numChannels); 44 | // called only by createNew() 45 | 46 | virtual ~MPEG4GenericRTPSink(); 47 | 48 | private: // redefined virtual functions: 49 | virtual 50 | Boolean frameCanAppearAfterPacketStart(unsigned char const* frameStart, 51 | unsigned numBytesInFrame) const; 52 | virtual void doSpecialFrameHandling(unsigned fragmentationOffset, 53 | unsigned char* frameStart, 54 | unsigned numBytesInFrame, 55 | struct timeval framePresentationTime, 56 | unsigned numRemainingBytes); 57 | virtual unsigned specialHeaderSize() const; 58 | 59 | virtual char const* sdpMediaType() const; 60 | 61 | virtual char const* auxSDPLine(); // for the "a=fmtp:" SDP line 62 | 63 | private: 64 | char const* fSDPMediaTypeString; 65 | char const* fMPEG4Mode; 66 | char const* fConfigString; 67 | char* fFmtpSDPLine; 68 | }; 69 | 70 | #endif 71 | -------------------------------------------------------------------------------- /include/live555/liveMedia/VorbisAudioRTPSource.hh: -------------------------------------------------------------------------------- 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 .) 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-2017 Live Networks, Inc. All rights reserved. 18 | // Vorbis Audio RTP Sources 19 | // C++ header 20 | 21 | #ifndef _VORBIS_AUDIO_RTP_SOURCE_HH 22 | #define _VORBIS_AUDIO_RTP_SOURCE_HH 23 | 24 | #ifndef _MULTI_FRAMED_RTP_SOURCE_HH 25 | #include "MultiFramedRTPSource.hh" 26 | #endif 27 | 28 | class VorbisAudioRTPSource: public MultiFramedRTPSource { 29 | public: 30 | static VorbisAudioRTPSource* 31 | createNew(UsageEnvironment& env, Groupsock* RTPgs, 32 | unsigned char rtpPayloadFormat, 33 | unsigned rtpTimestampFrequency); 34 | 35 | u_int32_t curPacketIdent() const { return fCurPacketIdent; } // The current "Ident" field; only the low-order 24 bits are used 36 | 37 | protected: 38 | VorbisAudioRTPSource(UsageEnvironment& env, Groupsock* RTPgs, 39 | unsigned char rtpPayloadFormat, 40 | unsigned rtpTimestampFrequency); 41 | // called only by createNew() 42 | 43 | virtual ~VorbisAudioRTPSource(); 44 | 45 | protected: 46 | // redefined virtual functions: 47 | virtual Boolean processSpecialHeader(BufferedPacket* packet, 48 | unsigned& resultSpecialHeaderSize); 49 | virtual char const* MIMEtype() const; 50 | 51 | private: 52 | u_int32_t fCurPacketIdent; // only the low-order 24 bits are used 53 | }; 54 | 55 | void parseVorbisOrTheoraConfigStr(char const* configStr, 56 | u_int8_t*& identificationHdr, unsigned& identificationHdrSize, 57 | u_int8_t*& commentHdr, unsigned& commentHdrSize, 58 | u_int8_t*& setupHdr, unsigned& setupHdrSize, 59 | u_int32_t& identField); 60 | // Returns (in each of the result parameters) unpacked Vorbis or Theora 61 | // "identification", "comment", and "setup" headers that were specified in a 62 | // "config" string (in the SDP description for a Vorbis/RTP or Theora/RTP stream). 63 | // Each of the "*Hdr" result arrays are dynamically allocated by this routine, 64 | // and must be delete[]d by the caller. 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /include/live555/liveMedia/Locale.hh: -------------------------------------------------------------------------------- 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 .) 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-2017 Live Networks, Inc. All rights reserved. 18 | // Support for temporarily setting the locale (e.g., to "C" or "POSIX") for (e.g.) parsing or printing 19 | // floating-point numbers in protocol headers, or calling toupper()/tolower() on human-input strings. 20 | // C++ header 21 | 22 | #ifndef _LOCALE_HH 23 | #define _LOCALE_HH 24 | 25 | // If you're on a system that (for whatever reason) doesn't have either the "setlocale()" or the "newlocale()" function, then 26 | // add "-DLOCALE_NOT_USED" to your "config.*" file. 27 | 28 | // If you're on a system that (for whatever reason) has "setlocale()" but not "newlocale()", then 29 | // add "-DXLOCALE_NOT_USED" to your "config.*" file. 30 | // (Note that -DLOCALE_NOT_USED implies -DXLOCALE_NOT_USED; you do not need both.) 31 | // Also, for Windows systems, we define "XLOCALE_NOT_USED" by default, because at least some Windows systems 32 | // (or their development environments) don't have "newlocale()". If, however, your Windows system *does* have "newlocale()", 33 | // then you can override this by defining "XLOCALE_USED" before #including this file. 34 | 35 | #ifdef XLOCALE_USED 36 | #undef LOCALE_NOT_USED 37 | #undef XLOCALE_NOT_USED 38 | #else 39 | #if defined(__WIN32__) || defined(_WIN32) 40 | #define XLOCALE_NOT_USED 1 41 | #endif 42 | #endif 43 | 44 | #ifndef LOCALE_NOT_USED 45 | #include 46 | #ifndef XLOCALE_NOT_USED 47 | #include // because, on some systems, doesn't include ; this makes sure that we get both 48 | #endif 49 | #endif 50 | 51 | 52 | enum LocaleCategory { All, Numeric }; // define and implement more categories later, as needed 53 | 54 | class Locale { 55 | public: 56 | Locale(char const* newLocale, LocaleCategory category = All); 57 | virtual ~Locale(); 58 | 59 | private: 60 | #ifndef LOCALE_NOT_USED 61 | #ifndef XLOCALE_NOT_USED 62 | locale_t fLocale, fPrevLocale; 63 | #else 64 | int fCategoryNum; 65 | char* fPrevLocale; 66 | #endif 67 | #endif 68 | }; 69 | 70 | #endif 71 | --------------------------------------------------------------------------------