├── .gitmodules ├── AUTHORS ├── ChangeLog ├── DEPENDS ├── INSTALL ├── License ├── Makefile.am ├── Makefile.in ├── README.md ├── aclocal.m4 ├── config ├── compile ├── config.guess ├── config.sub ├── depcomp ├── install-sh ├── ltmain.sh └── missing ├── configure ├── configure.ac ├── controller ├── python │ ├── CHANGES.rst │ ├── LICENSE │ ├── MANIFEST.in │ ├── README.rst │ ├── setup.cfg │ ├── setup.py │ ├── streamswitch │ │ ├── __init__.py │ │ ├── _register.py │ │ ├── events.py │ │ ├── exceptions.py │ │ ├── pb │ │ │ ├── __init__.py │ │ │ ├── pb_client_heartbeat_pb2.py │ │ │ ├── pb_client_list_pb2.py │ │ │ ├── pb_media_pb2.py │ │ │ ├── pb_media_statistic_pb2.py │ │ │ ├── pb_metadata_pb2.py │ │ │ ├── pb_packet_pb2.py │ │ │ └── pb_stream_info_pb2.py │ │ ├── port_mngr.py │ │ ├── ports │ │ │ ├── __init__.py │ │ │ └── rtsp_port.py │ │ ├── process_mngr.py │ │ ├── scripts │ │ │ ├── __init__.py │ │ │ ├── stsw_watcher.py │ │ │ └── stsw_web_deploy.py │ │ ├── sender_mngr.py │ │ ├── senders │ │ │ ├── __init__.py │ │ │ └── native_ffmpeg_sender.py │ │ ├── sources │ │ │ ├── __init__.py │ │ │ ├── ffmpeg_source.py │ │ │ ├── file_live_source.py │ │ │ ├── proxy_source.py │ │ │ └── rtsp_source.py │ │ ├── stream_mngr.py │ │ ├── utils.py │ │ └── wsgiapp │ │ │ ├── __init__.py │ │ │ ├── app_main.py │ │ │ ├── conf │ │ │ ├── ports.yaml │ │ │ ├── streamswitch.ini │ │ │ └── streamswitch.init_script │ │ │ ├── daos │ │ │ ├── __init__.py │ │ │ ├── alchemy_dao_context_mngr.py │ │ │ ├── dao_context_mngr.py │ │ │ ├── port_dao.py │ │ │ ├── sender_conf_dao.py │ │ │ └── stream_conf_dao.py │ │ │ ├── migration │ │ │ ├── README │ │ │ ├── env.py │ │ │ ├── script.py.mako │ │ │ └── versions │ │ │ │ ├── 46df8acc101_create_db.py │ │ │ │ └── 52bf330f874_added_sender_confs_table.py │ │ │ ├── models.py │ │ │ ├── server_main.py │ │ │ ├── services │ │ │ ├── __init__.py │ │ │ ├── port_service.py │ │ │ ├── process_watcher_service.py │ │ │ ├── sender_service.py │ │ │ └── stream_service.py │ │ │ ├── static │ │ │ └── img │ │ │ │ ├── favicon.ico │ │ │ │ ├── footerbg.png │ │ │ │ ├── headerbg.png │ │ │ │ ├── middlebg.png │ │ │ │ ├── pyramid-small.png │ │ │ │ ├── pyramid.png │ │ │ │ └── transparent.gif │ │ │ ├── templates │ │ │ └── 404.pt │ │ │ ├── utils │ │ │ ├── __init__.py │ │ │ ├── config.py │ │ │ ├── logger.py │ │ │ ├── schema.py │ │ │ └── sqlalchemy_gevent.py │ │ │ └── views │ │ │ ├── __init__.py │ │ │ ├── common.py │ │ │ ├── port_api_views.py │ │ │ ├── process_watcher_api_views.py │ │ │ ├── sender_api_views.py │ │ │ └── stream_api_views.py │ └── web_development.ini └── readme ├── libstreamswitch ├── Makefile.am ├── Makefile.in ├── README ├── include │ ├── stream_switch.h │ ├── stsw_arg_parser.h │ ├── stsw_defs.h │ ├── stsw_global.h │ ├── stsw_lock_guard.h │ ├── stsw_rotate_logger.h │ ├── stsw_sink_listener.h │ ├── stsw_source_listener.h │ ├── stsw_stream_sink.h │ └── stsw_stream_source.h ├── libstreamswitch.pc.in ├── protocol │ ├── pb_client_heartbeat.proto │ ├── pb_client_list.proto │ ├── pb_media.proto │ ├── pb_media_statistic.proto │ ├── pb_metadata.proto │ ├── pb_packet.proto │ └── pb_stream_info.proto ├── samples │ ├── Makefile.am │ ├── Makefile.in │ ├── api_test_sink.cc │ ├── file_live_source.cc │ ├── rotate_logger_test.cc │ └── text_sink.cc └── src │ ├── pb │ ├── pb_client_heartbeat.pb.cc │ ├── pb_client_heartbeat.pb.h │ ├── pb_client_list.pb.cc │ ├── pb_client_list.pb.h │ ├── pb_media.pb.cc │ ├── pb_media.pb.h │ ├── pb_media_statistic.pb.cc │ ├── pb_media_statistic.pb.h │ ├── pb_metadata.pb.cc │ ├── pb_metadata.pb.h │ ├── pb_packet.pb.cc │ ├── pb_packet.pb.h │ ├── pb_stream_info.pb.cc │ └── pb_stream_info.pb.h │ ├── stsw_arg_parser.cc │ ├── stsw_global.cc │ ├── stsw_rotate_logger.cc │ ├── stsw_stream_sink.cc │ └── stsw_stream_source.cc ├── m4 ├── libtool.m4 ├── ltoptions.m4 ├── ltsugar.m4 ├── ltversion.m4 └── lt~obsolete.m4 ├── ports ├── readme └── stsw_rtsp_port │ ├── COPYING │ ├── Makefile.am │ ├── Makefile.in │ ├── README.md │ └── src │ ├── bufferqueue.c │ ├── bufferqueue.h │ ├── conf │ ├── array.c │ ├── array.h │ ├── buffer.c │ ├── buffer.h │ ├── conf.h │ ├── configfile-glue.c │ ├── configfile.c │ ├── configfile.h │ ├── configparser.c │ ├── configparser.h │ ├── data_array.c │ ├── data_config.c │ ├── data_count.c │ ├── data_integer.c │ ├── data_string.c │ ├── proc_open.c │ ├── proc_open.h │ ├── settings.h │ ├── stream.c │ └── stream.h │ ├── config.h │ ├── feng.h │ ├── feng_utils.h │ ├── fnc_log.cc │ ├── fnc_log.h │ ├── incoming.c │ ├── incoming.h │ ├── liberis │ ├── headers.h │ ├── headers_parser.c │ ├── utils.c │ └── utils.h │ ├── main.cc │ ├── media │ ├── demuxer.c │ ├── demuxer.h │ ├── demuxer │ │ ├── demuxer_agg.c │ │ ├── demuxer_avf.c │ │ ├── demuxer_ds.c │ │ ├── demuxer_sd.c │ │ └── demuxer_stsw.cc │ ├── demuxer_module.h │ ├── mediaparser.c │ ├── mediaparser.h │ ├── mediaparser_module.h │ ├── mediautils.c │ ├── parser │ │ ├── aac.c │ │ ├── amr.c │ │ ├── h263.c │ │ ├── h264.c │ │ ├── h265.c │ │ ├── mp2p.cc │ │ ├── mp4ves.c │ │ ├── mpeg12.c │ │ ├── mpeg2t.c │ │ ├── mpegaudio.c │ │ ├── pcma.c │ │ ├── pcmu.c │ │ ├── put_bits.h │ │ ├── simple.c │ │ ├── speex.c │ │ ├── theora.c │ │ └── vorbis.c │ └── resource.c │ ├── network │ ├── ragel_parsers.h │ ├── ragel_range.c │ ├── ragel_request_line.c │ ├── ragel_transport.c │ ├── rtcp.c │ ├── rtp.c │ ├── rtp.h │ ├── rtp_port.c │ ├── rtsp.h │ ├── rtsp_client.c │ ├── rtsp_interleaved.c │ ├── rtsp_lowlevel.c │ ├── rtsp_method_describe.c │ ├── rtsp_method_get_parameter.c │ ├── rtsp_method_options.c │ ├── rtsp_method_pause.c │ ├── rtsp_method_play.c │ ├── rtsp_method_setup.c │ ├── rtsp_method_teardown.c │ ├── rtsp_response.c │ ├── rtsp_state_machine.c │ └── rtsp_utils.c │ └── parse_args.cc ├── scripts ├── stsw_net_set.sh └── stsw_sys_set.sh ├── senders ├── ffmpeg_sender │ ├── Makefile.am │ ├── Makefile.in │ ├── README.md │ └── src │ │ ├── parsers │ │ ├── dec_sps.cc │ │ ├── dec_sps.h │ │ ├── stsw_aac_mux_parser.cc │ │ ├── stsw_aac_mux_parser.h │ │ ├── stsw_h264or5_mux_parser.cc │ │ ├── stsw_h264or5_mux_parser.h │ │ ├── stsw_mpeg4_video_mux_parser.cc │ │ ├── stsw_mpeg4_video_mux_parser.h │ │ ├── stsw_stream_mux_parser.cc │ │ └── stsw_stream_mux_parser.h │ │ ├── stsw_ffmpeg_muxer.cc │ │ ├── stsw_ffmpeg_muxer.h │ │ ├── stsw_ffmpeg_muxer_sender.cc │ │ ├── stsw_ffmpeg_muxer_sender.h │ │ ├── stsw_ffmpeg_sender_arg_parser.cc │ │ ├── stsw_ffmpeg_sender_arg_parser.h │ │ ├── stsw_ffmpeg_sender_global.h │ │ ├── stsw_log.cc │ │ ├── stsw_log.h │ │ └── stsw_main.cc └── readme └── sources ├── ffmpeg_demuxer_source ├── Makefile.am ├── Makefile.in ├── README.md └── src │ ├── parser │ ├── stsw_h264or5_parser.cc │ ├── stsw_h264or5_parser.h │ ├── stsw_mpeg4_parser.cc │ ├── stsw_mpeg4_parser.h │ ├── stsw_stream_parser.cc │ └── stsw_stream_parser.h │ ├── stsw_ffmpeg_arg_parser.cc │ ├── stsw_ffmpeg_arg_parser.h │ ├── stsw_ffmpeg_demuxer.cc │ ├── stsw_ffmpeg_demuxer.h │ ├── stsw_ffmpeg_demuxer_source.cc │ ├── stsw_ffmpeg_demuxer_source.h │ ├── stsw_ffmpeg_source_global.h │ ├── stsw_log.cc │ ├── stsw_log.h │ └── stsw_main.cc ├── readme ├── stsw_proxy_source ├── Makefile.am ├── Makefile.in ├── README.md └── src │ ├── stsw_log.cc │ ├── stsw_log.h │ ├── stsw_main.cc │ ├── stsw_stream_proxy.cc │ ├── stsw_stream_proxy.h │ └── url.h ├── stsw_rtmp_source ├── Makefile.am ├── Makefile.in └── src │ ├── stsw_rtmp_main.cc │ ├── stsw_rtmp_source.cc │ └── stsw_rtmp_source.h └── stsw_rtsp_source ├── Makefile.am ├── Makefile.in ├── README.md ├── live ├── BasicUsageEnvironment │ ├── BasicHashTable.cpp │ ├── BasicTaskScheduler.cpp │ ├── BasicTaskScheduler0.cpp │ ├── BasicUsageEnvironment.cpp │ ├── BasicUsageEnvironment0.cpp │ ├── DelayQueue.cpp │ ├── Makefile.head │ ├── Makefile.tail │ └── include │ │ ├── BasicHashTable.hh │ │ ├── BasicUsageEnvironment.hh │ │ ├── BasicUsageEnvironment0.hh │ │ ├── BasicUsageEnvironment_version.hh │ │ ├── DelayQueue.hh │ │ └── HandlerSet.hh ├── COPYING ├── Makefile.head ├── Makefile.tail ├── README ├── README.stream_switch ├── UsageEnvironment │ ├── HashTable.cpp │ ├── Makefile.head │ ├── Makefile.tail │ ├── UsageEnvironment.cpp │ ├── include │ │ ├── Boolean.hh │ │ ├── HashTable.hh │ │ ├── UsageEnvironment.hh │ │ ├── UsageEnvironment_version.hh │ │ └── strDup.hh │ └── strDup.cpp ├── VERSION ├── WindowsAudioInputDevice │ ├── WindowsAudioInputDevice.mak │ ├── WindowsAudioInputDevice_common.cpp │ ├── WindowsAudioInputDevice_common.hh │ ├── WindowsAudioInputDevice_mixer.cpp │ ├── WindowsAudioInputDevice_mixer.hh │ ├── WindowsAudioInputDevice_noMixer.cpp │ ├── WindowsAudioInputDevice_noMixer.hh │ └── showAudioInputPorts.cpp ├── config.aix ├── config.alpha ├── config.armeb-uclibc ├── config.armlinux ├── config.avr32-linux ├── config.bfin-linux-uclibc ├── config.bfin-uclinux ├── config.bsplinux ├── config.cris-axis-linux-gnu ├── config.cygwin ├── config.cygwin-for-vlc ├── config.freebsd ├── config.iphone-simulator ├── config.iphoneos ├── config.irix ├── config.linux ├── config.linux-64bit ├── config.linux-gdb ├── config.linux-with-shared-libraries ├── config.macosx ├── config.macosx-32bit ├── config.macosx-before-version-10.4 ├── config.mingw ├── config.openbsd ├── config.qnx4 ├── config.solaris-32bit ├── config.solaris-64bit ├── config.stream-switch ├── config.sunos ├── config.uClinux ├── configure ├── fix-makefile ├── genMakefiles ├── genMakefiles.stream_switch ├── genWindowsMakefiles ├── genWindowsMakefiles.cmd ├── groupsock │ ├── GroupEId.cpp │ ├── Groupsock.cpp │ ├── GroupsockHelper.cpp │ ├── IOHandlers.cpp │ ├── Makefile.head │ ├── Makefile.tail │ ├── NetAddress.cpp │ ├── NetInterface.cpp │ ├── include │ │ ├── GroupEId.hh │ │ ├── Groupsock.hh │ │ ├── GroupsockHelper.hh │ │ ├── IOHandlers.hh │ │ ├── NetAddress.hh │ │ ├── NetCommon.h │ │ ├── NetInterface.hh │ │ ├── TunnelEncaps.hh │ │ └── groupsock_version.hh │ └── inet.c ├── liveMedia │ ├── AC3AudioFileServerMediaSubsession.cpp │ ├── AC3AudioRTPSink.cpp │ ├── AC3AudioRTPSource.cpp │ ├── AC3AudioStreamFramer.cpp │ ├── ADTSAudioFileServerMediaSubsession.cpp │ ├── ADTSAudioFileSource.cpp │ ├── AMRAudioFileServerMediaSubsession.cpp │ ├── AMRAudioFileSink.cpp │ ├── AMRAudioFileSource.cpp │ ├── AMRAudioRTPSink.cpp │ ├── AMRAudioRTPSource.cpp │ ├── AMRAudioSource.cpp │ ├── AVIFileSink.cpp │ ├── AudioInputDevice.cpp │ ├── AudioRTPSink.cpp │ ├── Base64.cpp │ ├── BasicUDPSink.cpp │ ├── BasicUDPSource.cpp │ ├── BitVector.cpp │ ├── ByteStreamFileSource.cpp │ ├── ByteStreamMemoryBufferSource.cpp │ ├── ByteStreamMultiFileSource.cpp │ ├── DVVideoFileServerMediaSubsession.cpp │ ├── DVVideoRTPSink.cpp │ ├── DVVideoRTPSource.cpp │ ├── DVVideoStreamFramer.cpp │ ├── DarwinInjector.cpp │ ├── DeviceSource.cpp │ ├── DigestAuthentication.cpp │ ├── EBMLNumber.cpp │ ├── EBMLNumber.hh │ ├── FileServerMediaSubsession.cpp │ ├── FileSink.cpp │ ├── FramedFileSource.cpp │ ├── FramedFilter.cpp │ ├── FramedSource.cpp │ ├── GSMAudioRTPSink.cpp │ ├── H261VideoRTPSource.cpp │ ├── H263plusVideoFileServerMediaSubsession.cpp │ ├── H263plusVideoRTPSink.cpp │ ├── H263plusVideoRTPSource.cpp │ ├── H263plusVideoStreamFramer.cpp │ ├── H263plusVideoStreamParser.cpp │ ├── H263plusVideoStreamParser.hh │ ├── H264VideoFileServerMediaSubsession.cpp │ ├── H264VideoFileSink.cpp │ ├── H264VideoRTPSink.cpp │ ├── H264VideoRTPSource.cpp │ ├── H264VideoStreamDiscreteFramer.cpp │ ├── H264VideoStreamFramer.cpp │ ├── H264or5VideoFileSink.cpp │ ├── H264or5VideoRTPSink.cpp │ ├── H264or5VideoStreamDiscreteFramer.cpp │ ├── H264or5VideoStreamFramer.cpp │ ├── H265VideoFileServerMediaSubsession.cpp │ ├── H265VideoFileSink.cpp │ ├── H265VideoRTPSink.cpp │ ├── H265VideoRTPSource.cpp │ ├── H265VideoStreamDiscreteFramer.cpp │ ├── H265VideoStreamFramer.cpp │ ├── InputFile.cpp │ ├── JPEGVideoRTPSink.cpp │ ├── JPEGVideoRTPSource.cpp │ ├── JPEGVideoSource.cpp │ ├── Locale.cpp │ ├── MP3ADU.cpp │ ├── MP3ADURTPSink.cpp │ ├── MP3ADURTPSource.cpp │ ├── MP3ADUTranscoder.cpp │ ├── MP3ADUdescriptor.cpp │ ├── MP3ADUdescriptor.hh │ ├── MP3ADUinterleaving.cpp │ ├── MP3AudioFileServerMediaSubsession.cpp │ ├── MP3AudioMatroskaFileServerMediaSubsession.cpp │ ├── MP3AudioMatroskaFileServerMediaSubsession.hh │ ├── MP3FileSource.cpp │ ├── MP3Internals.cpp │ ├── MP3Internals.hh │ ├── MP3InternalsHuffman.cpp │ ├── MP3InternalsHuffman.hh │ ├── MP3InternalsHuffmanTable.cpp │ ├── MP3StreamState.cpp │ ├── MP3StreamState.hh │ ├── MP3Transcoder.cpp │ ├── MPEG1or2AudioRTPSink.cpp │ ├── MPEG1or2AudioRTPSource.cpp │ ├── MPEG1or2AudioStreamFramer.cpp │ ├── MPEG1or2Demux.cpp │ ├── MPEG1or2DemuxedElementaryStream.cpp │ ├── MPEG1or2DemuxedServerMediaSubsession.cpp │ ├── MPEG1or2FileServerDemux.cpp │ ├── MPEG1or2VideoFileServerMediaSubsession.cpp │ ├── MPEG1or2VideoRTPSink.cpp │ ├── MPEG1or2VideoRTPSource.cpp │ ├── MPEG1or2VideoStreamDiscreteFramer.cpp │ ├── MPEG1or2VideoStreamFramer.cpp │ ├── MPEG2IndexFromTransportStream.cpp │ ├── MPEG2TransportFileServerMediaSubsession.cpp │ ├── MPEG2TransportStreamFramer.cpp │ ├── MPEG2TransportStreamFromESSource.cpp │ ├── MPEG2TransportStreamFromPESSource.cpp │ ├── MPEG2TransportStreamIndexFile.cpp │ ├── MPEG2TransportStreamMultiplexor.cpp │ ├── MPEG2TransportStreamTrickModeFilter.cpp │ ├── MPEG2TransportUDPServerMediaSubsession.cpp │ ├── MPEG4ESVideoRTPSink.cpp │ ├── MPEG4ESVideoRTPSource.cpp │ ├── MPEG4GenericRTPSink.cpp │ ├── MPEG4GenericRTPSource.cpp │ ├── MPEG4LATMAudioRTPSink.cpp │ ├── MPEG4LATMAudioRTPSource.cpp │ ├── MPEG4VideoFileServerMediaSubsession.cpp │ ├── MPEG4VideoStreamDiscreteFramer.cpp │ ├── MPEG4VideoStreamFramer.cpp │ ├── MPEGVideoStreamFramer.cpp │ ├── MPEGVideoStreamParser.cpp │ ├── MPEGVideoStreamParser.hh │ ├── Makefile.head │ ├── Makefile.tail │ ├── MatroskaDemuxedTrack.cpp │ ├── MatroskaDemuxedTrack.hh │ ├── MatroskaFile.cpp │ ├── MatroskaFileParser.cpp │ ├── MatroskaFileParser.hh │ ├── MatroskaFileServerDemux.cpp │ ├── MatroskaFileServerMediaSubsession.cpp │ ├── MatroskaFileServerMediaSubsession.hh │ ├── Media.cpp │ ├── MediaSession.cpp │ ├── MediaSink.cpp │ ├── MediaSource.cpp │ ├── MultiFramedRTPSink.cpp │ ├── MultiFramedRTPSource.cpp │ ├── OggDemuxedTrack.cpp │ ├── OggDemuxedTrack.hh │ ├── OggFile.cpp │ ├── OggFileParser.cpp │ ├── OggFileParser.hh │ ├── OggFileServerDemux.cpp │ ├── OggFileServerMediaSubsession.cpp │ ├── OggFileServerMediaSubsession.hh │ ├── OggFileSink.cpp │ ├── OnDemandServerMediaSubsession.cpp │ ├── OutputFile.cpp │ ├── PassiveServerMediaSubsession.cpp │ ├── ProxyServerMediaSession.cpp │ ├── QCELPAudioRTPSource.cpp │ ├── QuickTimeFileSink.cpp │ ├── QuickTimeGenericRTPSource.cpp │ ├── RTCP.cpp │ ├── RTPInterface.cpp │ ├── RTPSink.cpp │ ├── RTPSource.cpp │ ├── RTSPClient.cpp │ ├── RTSPCommon.cpp │ ├── RTSPRegisterSender.cpp │ ├── RTSPServer.cpp │ ├── RTSPServerSupportingHTTPStreaming.cpp │ ├── SIPClient.cpp │ ├── ServerMediaSession.cpp │ ├── SimpleRTPSink.cpp │ ├── SimpleRTPSource.cpp │ ├── StreamParser.cpp │ ├── StreamParser.hh │ ├── StreamReplicator.cpp │ ├── T140TextRTPSink.cpp │ ├── TCPStreamSink.cpp │ ├── TextRTPSink.cpp │ ├── TheoraVideoRTPSink.cpp │ ├── TheoraVideoRTPSource.cpp │ ├── VP8VideoRTPSink.cpp │ ├── VP8VideoRTPSource.cpp │ ├── VP9VideoRTPSink.cpp │ ├── VP9VideoRTPSource.cpp │ ├── VideoRTPSink.cpp │ ├── VorbisAudioRTPSink.cpp │ ├── VorbisAudioRTPSource.cpp │ ├── WAVAudioFileServerMediaSubsession.cpp │ ├── WAVAudioFileSource.cpp │ ├── include │ │ ├── AC3AudioFileServerMediaSubsession.hh │ │ ├── AC3AudioRTPSink.hh │ │ ├── AC3AudioRTPSource.hh │ │ ├── AC3AudioStreamFramer.hh │ │ ├── ADTSAudioFileServerMediaSubsession.hh │ │ ├── ADTSAudioFileSource.hh │ │ ├── AMRAudioFileServerMediaSubsession.hh │ │ ├── AMRAudioFileSink.hh │ │ ├── AMRAudioFileSource.hh │ │ ├── AMRAudioRTPSink.hh │ │ ├── AMRAudioRTPSource.hh │ │ ├── AMRAudioSource.hh │ │ ├── AVIFileSink.hh │ │ ├── AudioInputDevice.hh │ │ ├── AudioRTPSink.hh │ │ ├── Base64.hh │ │ ├── BasicUDPSink.hh │ │ ├── BasicUDPSource.hh │ │ ├── BitVector.hh │ │ ├── ByteStreamFileSource.hh │ │ ├── ByteStreamMemoryBufferSource.hh │ │ ├── ByteStreamMultiFileSource.hh │ │ ├── DVVideoFileServerMediaSubsession.hh │ │ ├── DVVideoRTPSink.hh │ │ ├── DVVideoRTPSource.hh │ │ ├── DVVideoStreamFramer.hh │ │ ├── DarwinInjector.hh │ │ ├── DeviceSource.hh │ │ ├── DigestAuthentication.hh │ │ ├── FileServerMediaSubsession.hh │ │ ├── FileSink.hh │ │ ├── FramedFileSource.hh │ │ ├── FramedFilter.hh │ │ ├── FramedSource.hh │ │ ├── GSMAudioRTPSink.hh │ │ ├── H261VideoRTPSource.hh │ │ ├── H263plusVideoFileServerMediaSubsession.hh │ │ ├── H263plusVideoRTPSink.hh │ │ ├── H263plusVideoRTPSource.hh │ │ ├── H263plusVideoStreamFramer.hh │ │ ├── H264VideoFileServerMediaSubsession.hh │ │ ├── H264VideoFileSink.hh │ │ ├── H264VideoRTPSink.hh │ │ ├── H264VideoRTPSource.hh │ │ ├── H264VideoStreamDiscreteFramer.hh │ │ ├── H264VideoStreamFramer.hh │ │ ├── H264or5VideoFileSink.hh │ │ ├── H264or5VideoRTPSink.hh │ │ ├── H264or5VideoStreamDiscreteFramer.hh │ │ ├── H264or5VideoStreamFramer.hh │ │ ├── H265VideoFileServerMediaSubsession.hh │ │ ├── H265VideoFileSink.hh │ │ ├── H265VideoRTPSink.hh │ │ ├── H265VideoRTPSource.hh │ │ ├── H265VideoStreamDiscreteFramer.hh │ │ ├── H265VideoStreamFramer.hh │ │ ├── InputFile.hh │ │ ├── JPEGVideoRTPSink.hh │ │ ├── JPEGVideoRTPSource.hh │ │ ├── JPEGVideoSource.hh │ │ ├── Locale.hh │ │ ├── MP3ADU.hh │ │ ├── MP3ADURTPSink.hh │ │ ├── MP3ADURTPSource.hh │ │ ├── MP3ADUTranscoder.hh │ │ ├── MP3ADUinterleaving.hh │ │ ├── MP3AudioFileServerMediaSubsession.hh │ │ ├── MP3FileSource.hh │ │ ├── MP3Transcoder.hh │ │ ├── MPEG1or2AudioRTPSink.hh │ │ ├── MPEG1or2AudioRTPSource.hh │ │ ├── MPEG1or2AudioStreamFramer.hh │ │ ├── MPEG1or2Demux.hh │ │ ├── MPEG1or2DemuxedElementaryStream.hh │ │ ├── MPEG1or2DemuxedServerMediaSubsession.hh │ │ ├── MPEG1or2FileServerDemux.hh │ │ ├── MPEG1or2VideoFileServerMediaSubsession.hh │ │ ├── MPEG1or2VideoRTPSink.hh │ │ ├── MPEG1or2VideoRTPSource.hh │ │ ├── MPEG1or2VideoStreamDiscreteFramer.hh │ │ ├── MPEG1or2VideoStreamFramer.hh │ │ ├── MPEG2IndexFromTransportStream.hh │ │ ├── MPEG2TransportFileServerMediaSubsession.hh │ │ ├── MPEG2TransportStreamFramer.hh │ │ ├── MPEG2TransportStreamFromESSource.hh │ │ ├── MPEG2TransportStreamFromPESSource.hh │ │ ├── MPEG2TransportStreamIndexFile.hh │ │ ├── MPEG2TransportStreamMultiplexor.hh │ │ ├── MPEG2TransportStreamTrickModeFilter.hh │ │ ├── MPEG2TransportUDPServerMediaSubsession.hh │ │ ├── MPEG4ESVideoRTPSink.hh │ │ ├── MPEG4ESVideoRTPSource.hh │ │ ├── MPEG4GenericRTPSink.hh │ │ ├── MPEG4GenericRTPSource.hh │ │ ├── MPEG4LATMAudioRTPSink.hh │ │ ├── MPEG4LATMAudioRTPSource.hh │ │ ├── MPEG4VideoFileServerMediaSubsession.hh │ │ ├── MPEG4VideoStreamDiscreteFramer.hh │ │ ├── MPEG4VideoStreamFramer.hh │ │ ├── MPEGVideoStreamFramer.hh │ │ ├── MatroskaFile.hh │ │ ├── MatroskaFileServerDemux.hh │ │ ├── Media.hh │ │ ├── MediaSession.hh │ │ ├── MediaSink.hh │ │ ├── MediaSource.hh │ │ ├── MultiFramedRTPSink.hh │ │ ├── MultiFramedRTPSource.hh │ │ ├── OggFile.hh │ │ ├── OggFileServerDemux.hh │ │ ├── OggFileSink.hh │ │ ├── OnDemandServerMediaSubsession.hh │ │ ├── OutputFile.hh │ │ ├── PassiveServerMediaSubsession.hh │ │ ├── ProxyServerMediaSession.hh │ │ ├── QCELPAudioRTPSource.hh │ │ ├── QuickTimeFileSink.hh │ │ ├── QuickTimeGenericRTPSource.hh │ │ ├── RTCP.hh │ │ ├── RTPInterface.hh │ │ ├── RTPSink.hh │ │ ├── RTPSource.hh │ │ ├── RTSPClient.hh │ │ ├── RTSPCommon.hh │ │ ├── RTSPRegisterSender.hh │ │ ├── RTSPServer.hh │ │ ├── RTSPServerSupportingHTTPStreaming.hh │ │ ├── SIPClient.hh │ │ ├── ServerMediaSession.hh │ │ ├── SimpleRTPSink.hh │ │ ├── SimpleRTPSource.hh │ │ ├── StreamReplicator.hh │ │ ├── T140TextRTPSink.hh │ │ ├── TCPStreamSink.hh │ │ ├── TextRTPSink.hh │ │ ├── TheoraVideoRTPSink.hh │ │ ├── TheoraVideoRTPSource.hh │ │ ├── VP8VideoRTPSink.hh │ │ ├── VP8VideoRTPSource.hh │ │ ├── VP9VideoRTPSink.hh │ │ ├── VP9VideoRTPSource.hh │ │ ├── VideoRTPSink.hh │ │ ├── VorbisAudioRTPSink.hh │ │ ├── VorbisAudioRTPSource.hh │ │ ├── WAVAudioFileServerMediaSubsession.hh │ │ ├── WAVAudioFileSource.hh │ │ ├── liveMedia.hh │ │ ├── liveMedia_version.hh │ │ ├── ourMD5.hh │ │ └── uLawAudioFilter.hh │ ├── ourMD5.cpp │ ├── rtcp_from_spec.c │ ├── rtcp_from_spec.h │ └── uLawAudioFilter.cpp ├── mediaServer │ ├── DynamicRTSPServer.cpp │ ├── DynamicRTSPServer.hh │ ├── Makefile.head │ ├── Makefile.tail │ ├── live555MediaServer.cpp │ └── version.hh ├── proxyServer │ ├── Makefile.head │ ├── Makefile.tail │ └── live555ProxyServer.cpp ├── testProgs │ ├── MPEG2TransportStreamIndexer.cpp │ ├── Makefile.head │ ├── Makefile.tail │ ├── openRTSP.cpp │ ├── playCommon.cpp │ ├── playCommon.hh │ ├── playSIP.cpp │ ├── registerRTSPStream.cpp │ ├── sapWatch.cpp │ ├── testAMRAudioStreamer.cpp │ ├── testDVVideoStreamer.cpp │ ├── testGSMStreamer.cpp │ ├── testH264VideoStreamer.cpp │ ├── testH264VideoToTransportStream.cpp │ ├── testH265VideoStreamer.cpp │ ├── testH265VideoToTransportStream.cpp │ ├── testMKVStreamer.cpp │ ├── testMP3-using-ADUs.sdp │ ├── testMP3.sdp │ ├── testMP3Receiver.cpp │ ├── testMP3Streamer.cpp │ ├── testMPEG1or2AudioVideo.sdp │ ├── testMPEG1or2AudioVideoStreamer.cpp │ ├── testMPEG1or2ProgramToTransportStream.cpp │ ├── testMPEG1or2Splitter.cpp │ ├── testMPEG1or2Video.sdp │ ├── testMPEG1or2VideoReceiver.cpp │ ├── testMPEG1or2VideoStreamer.cpp │ ├── testMPEG2Transport.sdp │ ├── testMPEG2TransportReceiver.cpp │ ├── testMPEG2TransportStreamTrickPlay.cpp │ ├── testMPEG2TransportStreamer.cpp │ ├── testMPEG4VideoStreamer.cpp │ ├── testOggStreamer.cpp │ ├── testOnDemandRTSPServer.cpp │ ├── testRTSPClient.cpp │ ├── testRelay.cpp │ ├── testReplicator.cpp │ ├── testWAVAudioStreamer.cpp │ └── vobStreamer.cpp ├── win32config └── win32config.Borland └── src ├── stsw_h264or5_output_sink.cc ├── stsw_h264or5_output_sink.h ├── stsw_main.cc ├── stsw_mpeg4_output_sink.cc ├── stsw_mpeg4_output_sink.h ├── stsw_output_sink.cc ├── stsw_output_sink.h ├── stsw_pts_normalizer.cc ├── stsw_pts_normalizer.h ├── stsw_rtsp_client.cc ├── stsw_rtsp_client.h ├── stsw_rtsp_source_app.cc └── stsw_rtsp_source_app.h /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "wiki"] 2 | path = wiki 3 | url = https://github.com/OpenSight/StreamSwitch.wiki.git 4 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | Corporate Copyright Statements 2 | ============================== 3 | 4 | Copyright (c) 2014 OpenSight (www.opensight.cn) 5 | 6 | Contributors 7 | ============ 8 | 9 | OpenSight Studio Team 10 | 11 | -------------------------------------------------------------------------------- /ChangeLog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenSight/StreamSwitch/b44c33cccea5f4b27fac1d199b75366aec73c0f1/ChangeLog -------------------------------------------------------------------------------- /DEPENDS: -------------------------------------------------------------------------------- 1 | StreamSwitch make use of many other open source projects for its components. 2 | 3 | The following lists all the projects/libraries which StreamSwitch depends 4 | on for each of its components. 5 | 6 | You can visit the following page of StreamSwitch's wiki to download the source 7 | packages of the following projects: 8 | 9 | https://github.com/OpenSight/StreamSwitch/wiki/Depends-Download 10 | 11 | 1. Base depends 12 | 13 | * zeromq >= 4.0.0 14 | * czmq >= 3.0.0 15 | * protobuf >= 2.6.0 16 | 17 | 18 | 2. stsw_rtmp_source depends 19 | 20 | * RTMPDump >= 2.3 21 | 22 | 23 | 3. stsw_rtsp_port depends 24 | 25 | * libev >= 4.0 26 | * libnetembryo >= 0.1.0 27 | * glib-2.0 >= 2.16 28 | 29 | 4. ffmpeg_demuxer_source depends 30 | 31 | * ffmpeg >= 2.8 32 | 33 | 5. ffmpeg_sender depends 34 | 35 | * ffmpeg >= 2.8 -------------------------------------------------------------------------------- /Makefile.am: -------------------------------------------------------------------------------- 1 | AUTOMAKE_OPTIONS=foreign 2 | ACLOCAL_AMFLAGS = -I m4 3 | 4 | EXTRA_DIST = License README.md DEPENDS controller ports recorders sources 5 | 6 | SUBDIRS = libstreamswitch 7 | 8 | if INCLUDE_RTSP_SOURCE 9 | SUBDIRS += sources/stsw_rtsp_source 10 | endif 11 | 12 | if INCLUDE_RTMP_SOURCE 13 | SUBDIRS += sources/stsw_rtmp_source 14 | endif 15 | 16 | if INCLUDE_PROXY_SOURCE 17 | SUBDIRS += sources/stsw_proxy_source 18 | endif 19 | 20 | if INCLUDE_RTSP_PORT 21 | SUBDIRS += ports/stsw_rtsp_port 22 | endif 23 | 24 | if INCLUDE_FFMPEG_DEMUXER_SOURCE 25 | SUBDIRS += sources/ffmpeg_demuxer_source 26 | endif 27 | 28 | if INCLUDE_FFMPEG_SENDER 29 | SUBDIRS += senders/ffmpeg_sender 30 | endif -------------------------------------------------------------------------------- /controller/python/CHANGES.rst: -------------------------------------------------------------------------------- 1 | StreamSwitch Controller Changelog 2 | =================== 3 | 4 | Here you can see the full list of changes between each release of StreamSwitch Controller . 5 | 6 | Version 0.1.0 7 | ----------- 8 | 9 | - Initial version, not yet ready 10 | 11 | 12 | -------------------------------------------------------------------------------- /controller/python/MANIFEST.in: -------------------------------------------------------------------------------- 1 | include README.md AUTHORS.md CHANGES.md LICENSE 2 | include *.txt *.ini *.cfg *.rst 3 | recursive-include streamswitch *.ico *.png *.css *.gif *.jpg *.pt *.txt *.mak *.mako *.js *.html *.xml *.ini *.yaml 4 | recursive-include streamswitch/wsgiapp/conf * 5 | recursive-include streamswitch/wsgiapp/migration * 6 | recursive-include streamswitch/wsgiapp/static * 7 | -------------------------------------------------------------------------------- /controller/python/setup.cfg: -------------------------------------------------------------------------------- 1 | # [global] 2 | # index-url = http://pypi.douban.com/simple 3 | # trusted-host = pypi.douban.com 4 | 5 | [nosetests] 6 | match = ^test 7 | nocapture = 1 8 | cover-package = streamswitch 9 | with-coverage = 1 10 | cover-erase = 1 11 | 12 | [compile_catalog] 13 | directory = streamswitch/locale 14 | domain = streamswitch 15 | statistics = true 16 | 17 | [extract_messages] 18 | add_comments = TRANSLATORS: 19 | output_file = streamswitch/locale/streamswitch.pot 20 | width = 80 21 | 22 | [init_catalog] 23 | domain = streamswitch 24 | input_file = streamswitch/locale/streamswitch.pot 25 | output_dir = streamswitch/locale 26 | 27 | [update_catalog] 28 | domain = streamswitch 29 | input_file = streamswitch/locale/streamswitch.pot 30 | output_dir = streamswitch/locale 31 | previous = true 32 | -------------------------------------------------------------------------------- /controller/python/streamswitch/__init__.py: -------------------------------------------------------------------------------- 1 | streamswitch_version = "0.1.0" 2 | build_date = "2015-7-28" 3 | 4 | from . import _register -------------------------------------------------------------------------------- /controller/python/streamswitch/_register.py: -------------------------------------------------------------------------------- 1 | from .sources.proxy_source import PROXY_SOURCE_PROGRAM_NAME, \ 2 | PROXY_SOURCE_TYPE_NAME, ProxySourceStream 3 | from .sources.rtsp_source import RTSP_SOURCE_PROGRAM_NAME, \ 4 | RTSP_SOURCE_TYPE_NAME, RtspSourceStream 5 | from .sources.file_live_source import FILE_LIVE_SOURCE_PROGRAM_NAME, \ 6 | FILE_LIVE_SOURCE_TYPE_NAME, FileLiveSourceStream 7 | from .sources.ffmpeg_source import FFMPEG_SOURCE_PROGRAM_NAME, \ 8 | FFMPEG_SOURCE_TYPE_NAME, FFmpegSourceStream 9 | 10 | from .senders import TEXT_SINK_SENDER_TYPE, FFMPEG_SENDER_TYPE 11 | from .senders.native_ffmpeg_sender import NATIVE_FFMPEG_PROGRAM_NAME, \ 12 | NATIVE_FFMPEG_SENDER_TYPE_NAME, NativeFFmpegSender 13 | 14 | from .stream_mngr import register_source_type 15 | from .sender_mngr import register_sender_type, ProcessSender 16 | from .utils import find_executable 17 | 18 | 19 | def _register_builtin_source_type(): 20 | if find_executable(PROXY_SOURCE_PROGRAM_NAME): 21 | register_source_type(PROXY_SOURCE_TYPE_NAME, ProxySourceStream) 22 | if find_executable(RTSP_SOURCE_PROGRAM_NAME): 23 | register_source_type(RTSP_SOURCE_TYPE_NAME, RtspSourceStream) 24 | if find_executable(FILE_LIVE_SOURCE_PROGRAM_NAME): 25 | register_source_type(FILE_LIVE_SOURCE_TYPE_NAME, FileLiveSourceStream) 26 | if find_executable(FFMPEG_SOURCE_PROGRAM_NAME): 27 | register_source_type(FFMPEG_SOURCE_TYPE_NAME, FFmpegSourceStream) 28 | 29 | def _register_builtin_sender_type(): 30 | if find_executable(TEXT_SINK_SENDER_TYPE): 31 | register_sender_type(TEXT_SINK_SENDER_TYPE, ProcessSender) 32 | if find_executable(FFMPEG_SENDER_TYPE): 33 | register_sender_type(FFMPEG_SENDER_TYPE, ProcessSender) 34 | if find_executable(NATIVE_FFMPEG_PROGRAM_NAME): 35 | register_sender_type(NATIVE_FFMPEG_SENDER_TYPE_NAME, NativeFFmpegSender) 36 | 37 | _register_builtin_source_type() 38 | _register_builtin_sender_type() 39 | -------------------------------------------------------------------------------- /controller/python/streamswitch/exceptions.py: -------------------------------------------------------------------------------- 1 | """ 2 | streamswitch.exceptions 3 | ~~~~~~~~~~~~~~~~~~~~~~~ 4 | 5 | This module defines the base exception class which should be 6 | sub-classed from by all other Exception used in StreamSwitch Controller project. 7 | 8 | :copyright: (c) 2014 by OpenSight (www.opensight.cn). 9 | :license: AGPLv3, see LICENSE for more details. 10 | 11 | """ 12 | from __future__ import unicode_literals, division 13 | 14 | class StreamSwitchError(Exception): 15 | def __init__(self, info, http_status_code=500): 16 | super(StreamSwitchError, self).__init__(info) 17 | self.http_status_code = http_status_code 18 | 19 | 20 | class StreamSwitchCmdError(StreamSwitchError): 21 | def __init__(self, return_code, info, http_status_code=500): 22 | super(StreamSwitchCmdError, self).__init__(info, http_status_code) 23 | self.return_code = return_code 24 | 25 | 26 | class ExecutableNotFoundError(StreamSwitchError): 27 | def __init__(self, program_name, http_status_code=404): 28 | super(ExecutableNotFoundError, self).__init__("%s Not Found" % program_name, http_status_code) 29 | self.program_name = program_name -------------------------------------------------------------------------------- /controller/python/streamswitch/pb/__init__.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | # print(__file__) 4 | sys.path.append(os.path.dirname(os.path.abspath(__file__))) -------------------------------------------------------------------------------- /controller/python/streamswitch/ports/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenSight/StreamSwitch/b44c33cccea5f4b27fac1d199b75366aec73c0f1/controller/python/streamswitch/ports/__init__.py -------------------------------------------------------------------------------- /controller/python/streamswitch/ports/rtsp_port.py: -------------------------------------------------------------------------------- 1 | """ 2 | streamswitch.rtsp_port 3 | ~~~~~~~~~~~~~~~~~~~~~~~ 4 | 5 | This module implements the rtsp port class 6 | 7 | :copyright: (c) 2015 by OpenSight (www.opensight.cn). 8 | :license: AGPLv3, see LICENSE for more details. 9 | 10 | """ 11 | 12 | from __future__ import unicode_literals, division 13 | from ..port_mngr import TRANSPORT_TCP, SubProcessPort 14 | from ..exceptions import StreamSwitchError 15 | 16 | RTSP_PORT_PROGRAM_NAME = "stsw_rtsp_port" 17 | 18 | 19 | class RtspPort(SubProcessPort): 20 | def __init__(self, port_name, port_type=RTSP_PORT_PROGRAM_NAME, 21 | listen_port=554, 22 | transport=TRANSPORT_TCP, ipv6=False, **kwargs): 23 | if transport != TRANSPORT_TCP: 24 | raise StreamSwitchError("RTSP Port Only Support TCP") 25 | if ipv6: 26 | raise StreamSwitchError("RTSP Port Not Support IPv6") 27 | super(RtspPort, self).__init__( 28 | port_name=port_name, 29 | port_type=port_type, 30 | listen_port=listen_port, 31 | executable=RTSP_PORT_PROGRAM_NAME, 32 | transport=transport, 33 | ipv6=ipv6, 34 | **kwargs) 35 | 36 | def configure(self, transport=None, ipv6=None, **kwargs): 37 | if transport is not None and \ 38 | transport != TRANSPORT_TCP: 39 | raise StreamSwitchError("RTSP Port Only Support TCP") 40 | if ipv6 is not None and ipv6: 41 | raise StreamSwitchError("RTSP Port Not Support IPv6 by now") 42 | 43 | super(RtspPort, self).configure( 44 | transport=transport, 45 | ipv6=ipv6, 46 | **kwargs) 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /controller/python/streamswitch/scripts/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenSight/StreamSwitch/b44c33cccea5f4b27fac1d199b75366aec73c0f1/controller/python/streamswitch/scripts/__init__.py -------------------------------------------------------------------------------- /controller/python/streamswitch/senders/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | 3 | TEXT_SINK_SENDER_TYPE = "text_sink" 4 | 5 | FFMPEG_SENDER_TYPE = "ffmpeg_sender" -------------------------------------------------------------------------------- /controller/python/streamswitch/sources/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenSight/StreamSwitch/b44c33cccea5f4b27fac1d199b75366aec73c0f1/controller/python/streamswitch/sources/__init__.py -------------------------------------------------------------------------------- /controller/python/streamswitch/sources/ffmpeg_source.py: -------------------------------------------------------------------------------- 1 | """ 2 | streamswitch.sources.ffmpeg_source 3 | ~~~~~~~~~~~~~~~~~~~~~~~ 4 | 5 | This module implements the stream factory of the ffmpeg source type 6 | 7 | :copyright: (c) 2015 by OpenSight (www.opensight.cn). 8 | :license: AGPLv3, see LICENSE for more details. 9 | 10 | """ 11 | 12 | from __future__ import unicode_literals, division 13 | from ..stream_mngr import register_source_type, SourceProcessStream 14 | from ..exceptions import ExecutableNotFoundError 15 | from ..utils import find_executable 16 | from ..process_mngr import kill_all 17 | 18 | FFMPEG_SOURCE_PROGRAM_NAME = "ffmpeg_demuxer_source" 19 | FFMPEG_SOURCE_TYPE_NAME = "ffmpeg_source" 20 | 21 | class FFmpegSourceStream(SourceProcessStream): 22 | _executable = FFMPEG_SOURCE_PROGRAM_NAME 23 | 24 | 25 | -------------------------------------------------------------------------------- /controller/python/streamswitch/sources/file_live_source.py: -------------------------------------------------------------------------------- 1 | """ 2 | streamswitch.sources.rtsp_source 3 | ~~~~~~~~~~~~~~~~~~~~~~~ 4 | 5 | This module implements the stream factory of the default RTSP source type 6 | 7 | :copyright: (c) 2015 by OpenSight (www.opensight.cn). 8 | :license: AGPLv3, see LICENSE for more details. 9 | 10 | """ 11 | 12 | from __future__ import unicode_literals, division 13 | from ..stream_mngr import SourceProcessStream 14 | 15 | 16 | FILE_LIVE_SOURCE_PROGRAM_NAME = "file_live_source" 17 | FILE_LIVE_SOURCE_TYPE_NAME = "file_live_source" 18 | 19 | 20 | class FileLiveSourceStream(SourceProcessStream): 21 | _executable = FILE_LIVE_SOURCE_PROGRAM_NAME 22 | 23 | 24 | -------------------------------------------------------------------------------- /controller/python/streamswitch/sources/proxy_source.py: -------------------------------------------------------------------------------- 1 | """ 2 | streamswitch.sources.proxy_source 3 | ~~~~~~~~~~~~~~~~~~~~~~~ 4 | 5 | This module implements the stream factory of the proxy source type 6 | 7 | :copyright: (c) 2015 by OpenSight (www.opensight.cn). 8 | :license: AGPLv3, see LICENSE for more details. 9 | 10 | """ 11 | 12 | from __future__ import unicode_literals, division 13 | from ..stream_mngr import register_source_type, SourceProcessStream 14 | from ..exceptions import ExecutableNotFoundError 15 | from ..utils import find_executable 16 | from ..process_mngr import kill_all 17 | 18 | PROXY_SOURCE_PROGRAM_NAME = "stsw_proxy_source" 19 | PROXY_SOURCE_TYPE_NAME = "proxy" 20 | 21 | class ProxySourceStream(SourceProcessStream): 22 | _executable = PROXY_SOURCE_PROGRAM_NAME 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /controller/python/streamswitch/sources/rtsp_source.py: -------------------------------------------------------------------------------- 1 | """ 2 | streamswitch.sources.rtsp_source 3 | ~~~~~~~~~~~~~~~~~~~~~~~ 4 | 5 | This module implements the stream factory of the default RTSP source type 6 | 7 | :copyright: (c) 2015 by OpenSight (www.opensight.cn). 8 | :license: AGPLv3, see LICENSE for more details. 9 | 10 | """ 11 | 12 | from __future__ import unicode_literals, division 13 | from ..stream_mngr import register_source_type, SourceProcessStream 14 | from ..exceptions import ExecutableNotFoundError 15 | from ..utils import find_executable 16 | from ..process_mngr import kill_all 17 | 18 | RTSP_SOURCE_PROGRAM_NAME = "stsw_rtsp_source" 19 | RTSP_SOURCE_TYPE_NAME = "rtsp_source" 20 | 21 | class RtspSourceStream(SourceProcessStream): 22 | _executable = RTSP_SOURCE_PROGRAM_NAME 23 | 24 | 25 | -------------------------------------------------------------------------------- /controller/python/streamswitch/wsgiapp/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenSight/StreamSwitch/b44c33cccea5f4b27fac1d199b75366aec73c0f1/controller/python/streamswitch/wsgiapp/__init__.py -------------------------------------------------------------------------------- /controller/python/streamswitch/wsgiapp/conf/ports.yaml: -------------------------------------------------------------------------------- 1 | ### 2 | # Sample ports configuration file for streamswitch controller web app 3 | # User can change the options below to adapt for his environment 4 | ### 5 | 6 | # the top level is an array each entry of which configure a specific port server 7 | 8 | - extra_options: {} 9 | port_factory: streamswitch.ports.rtsp_port:RtspPort 10 | port_name: rtsp_port 11 | listen_port: 554 12 | desc: Port of the standard RTSP Service to provide the live and replay media streams 13 | -------------------------------------------------------------------------------- /controller/python/streamswitch/wsgiapp/daos/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenSight/StreamSwitch/b44c33cccea5f4b27fac1d199b75366aec73c0f1/controller/python/streamswitch/wsgiapp/daos/__init__.py -------------------------------------------------------------------------------- /controller/python/streamswitch/wsgiapp/daos/dao_context_mngr.py: -------------------------------------------------------------------------------- 1 | """ 2 | streamswitch.wsgiapp.daos.alchemy_dao_context_mngr 3 | ~~~~~~~~~~~~~~~~~~~~~~~ 4 | 5 | This module defines the base class of DAO context manager 6 | 7 | :copyright: (c) 2015 by OpenSight (www.opensight.cn). 8 | :license: AGPLv3, see LICENSE for more details. 9 | 10 | """ 11 | 12 | from __future__ import unicode_literals, division 13 | 14 | CONTEXT_TYPE_TRANSACTION = 1 15 | CONTEXT_TYPE_NESTED = 2 16 | 17 | class DaoContext(object): 18 | def __enter__(self): 19 | return self 20 | 21 | def __exit__(self, exc_type, exc_val, exc_tb): 22 | return False 23 | 24 | 25 | class DaoContextMngr(object): 26 | def context(self, context_type=CONTEXT_TYPE_TRANSACTION, **kwargs): 27 | pass -------------------------------------------------------------------------------- /controller/python/streamswitch/wsgiapp/migration/README: -------------------------------------------------------------------------------- 1 | Generic single-database configuration. -------------------------------------------------------------------------------- /controller/python/streamswitch/wsgiapp/migration/script.py.mako: -------------------------------------------------------------------------------- 1 | """${message} 2 | 3 | Revision ID: ${up_revision} 4 | Revises: ${down_revision | comma,n} 5 | Create Date: ${create_date} 6 | 7 | """ 8 | 9 | # revision identifiers, used by Alembic. 10 | revision = ${repr(up_revision)} 11 | down_revision = ${repr(down_revision)} 12 | branch_labels = ${repr(branch_labels)} 13 | depends_on = ${repr(depends_on)} 14 | 15 | from alembic import op 16 | import sqlalchemy as sa 17 | ${imports if imports else ""} 18 | 19 | def upgrade(): 20 | ${upgrades if upgrades else "pass"} 21 | 22 | 23 | def downgrade(): 24 | ${downgrades if downgrades else "pass"} 25 | -------------------------------------------------------------------------------- /controller/python/streamswitch/wsgiapp/migration/versions/46df8acc101_create_db.py: -------------------------------------------------------------------------------- 1 | """create db 2 | 3 | Revision ID: 46df8acc101 4 | Revises: 5 | Create Date: 2015-10-05 14:40:47.522839 6 | 7 | """ 8 | 9 | # revision identifiers, used by Alembic. 10 | revision = '46df8acc101' 11 | down_revision = None 12 | branch_labels = None 13 | depends_on = None 14 | 15 | from alembic import op 16 | import sqlalchemy as sa 17 | 18 | 19 | def upgrade(): 20 | ### commands auto generated by Alembic - please adjust! ### 21 | op.create_table('stream_confs', 22 | sa.Column('source_type', sa.String(convert_unicode=True), nullable=False), 23 | sa.Column('stream_name', sa.String(convert_unicode=True), nullable=False), 24 | sa.Column('url', sa.String(convert_unicode=True), nullable=False), 25 | sa.Column('api_tcp_port', sa.Integer(), server_default='0', nullable=False), 26 | sa.Column('log_file', sa.String(convert_unicode=True), nullable=True), 27 | sa.Column('log_size', sa.Integer(), server_default='1048576', nullable=False), 28 | sa.Column('log_rotate', sa.Integer(), server_default='3', nullable=False), 29 | sa.Column('err_restart_interval', sa.Float(), server_default='30.0', nullable=False), 30 | sa.Column('age_time', sa.Float(), server_default='0.0', nullable=False), 31 | sa.Column('extra_options_json', sa.Text(convert_unicode=True), nullable=False), 32 | sa.Column('other_kwargs_json', sa.Text(convert_unicode=True), nullable=False), 33 | sa.PrimaryKeyConstraint('stream_name') 34 | ) 35 | ### end Alembic commands ### 36 | 37 | 38 | def downgrade(): 39 | ### commands auto generated by Alembic - please adjust! ### 40 | op.drop_table('stream_confs') 41 | ### end Alembic commands ### 42 | -------------------------------------------------------------------------------- /controller/python/streamswitch/wsgiapp/server_main.py: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | from __future__ import unicode_literals, division 5 | 6 | from gevent.pywsgi import WSGIServer 7 | 8 | 9 | def gevent_pywsgi_server_runner(wsgi_app, global_conf, host="0.0.0.0", port=8088, **kwargs): 10 | port = int(port) 11 | WSGIServer(listener=(host, port), application=wsgi_app, **kwargs).serve_forever() 12 | 13 | -------------------------------------------------------------------------------- /controller/python/streamswitch/wsgiapp/services/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenSight/StreamSwitch/b44c33cccea5f4b27fac1d199b75366aec73c0f1/controller/python/streamswitch/wsgiapp/services/__init__.py -------------------------------------------------------------------------------- /controller/python/streamswitch/wsgiapp/services/process_watcher_service.py: -------------------------------------------------------------------------------- 1 | """ 2 | streamswitch.wsgiapp.services.process_watcher_service 3 | ~~~~~~~~~~~~~~~~~~~~~~~ 4 | 5 | This module implements the service class for process watcher monitor 6 | 7 | :copyright: (c) 2015 by OpenSight (www.opensight.cn). 8 | :license: AGPLv3, see LICENSE for more details. 9 | 10 | """ 11 | from __future__ import unicode_literals, division 12 | from ...exceptions import StreamSwitchError 13 | import gevent 14 | 15 | 16 | 17 | 18 | 19 | class ProcessWatcherService(object): 20 | 21 | def __init__(self, process_mngr=None): 22 | self._process_mngr = process_mngr 23 | 24 | def get_process_watcher_list(self): 25 | return self._process_mngr.list_all_waitcher() 26 | 27 | def get_process_watcher(self, wid): 28 | watcher = self._process_mngr.find_watcher_by_wid(wid) 29 | if watcher is None: 30 | raise StreamSwitchError( 31 | "Process Watcher (wid:%d) Not Found" % wid, 404) 32 | return watcher 33 | -------------------------------------------------------------------------------- /controller/python/streamswitch/wsgiapp/static/img/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenSight/StreamSwitch/b44c33cccea5f4b27fac1d199b75366aec73c0f1/controller/python/streamswitch/wsgiapp/static/img/favicon.ico -------------------------------------------------------------------------------- /controller/python/streamswitch/wsgiapp/static/img/footerbg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenSight/StreamSwitch/b44c33cccea5f4b27fac1d199b75366aec73c0f1/controller/python/streamswitch/wsgiapp/static/img/footerbg.png -------------------------------------------------------------------------------- /controller/python/streamswitch/wsgiapp/static/img/headerbg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenSight/StreamSwitch/b44c33cccea5f4b27fac1d199b75366aec73c0f1/controller/python/streamswitch/wsgiapp/static/img/headerbg.png -------------------------------------------------------------------------------- /controller/python/streamswitch/wsgiapp/static/img/middlebg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenSight/StreamSwitch/b44c33cccea5f4b27fac1d199b75366aec73c0f1/controller/python/streamswitch/wsgiapp/static/img/middlebg.png -------------------------------------------------------------------------------- /controller/python/streamswitch/wsgiapp/static/img/pyramid-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenSight/StreamSwitch/b44c33cccea5f4b27fac1d199b75366aec73c0f1/controller/python/streamswitch/wsgiapp/static/img/pyramid-small.png -------------------------------------------------------------------------------- /controller/python/streamswitch/wsgiapp/static/img/pyramid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenSight/StreamSwitch/b44c33cccea5f4b27fac1d199b75366aec73c0f1/controller/python/streamswitch/wsgiapp/static/img/pyramid.png -------------------------------------------------------------------------------- /controller/python/streamswitch/wsgiapp/static/img/transparent.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenSight/StreamSwitch/b44c33cccea5f4b27fac1d199b75366aec73c0f1/controller/python/streamswitch/wsgiapp/static/img/transparent.gif -------------------------------------------------------------------------------- /controller/python/streamswitch/wsgiapp/utils/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenSight/StreamSwitch/b44c33cccea5f4b27fac1d199b75366aec73c0f1/controller/python/streamswitch/wsgiapp/utils/__init__.py -------------------------------------------------------------------------------- /controller/python/streamswitch/wsgiapp/utils/config.py: -------------------------------------------------------------------------------- 1 | 2 | from __future__ import unicode_literals, division 3 | import yaml 4 | import os 5 | 6 | class ConfigError(Exception): 7 | pass 8 | 9 | 10 | class Config(object): 11 | def __init__(self, conf_file, conf=None, schema=None): 12 | self.conf_file = conf_file 13 | self.conf = conf 14 | self.schema = schema 15 | 16 | def parse(self): 17 | if self.conf_file is not None and self.conf_file != "": 18 | try: 19 | with open(self.conf_file, "r") as f: 20 | self.conf = yaml.load(f) 21 | if self.schema: 22 | self.conf = self.schema.validate(self.conf) 23 | return self.conf 24 | except Exception as e: 25 | raise ConfigError(str(e)) 26 | else: 27 | raise ConfigError("conf file absent") 28 | 29 | def write(self): 30 | if self.conf_file is not None and self.conf_file != "" and \ 31 | self.conf is not None: 32 | try: 33 | with open(self.conf_file, "w") as f: 34 | os.chmod(self.conf_file, 0o600) # make config file is r/w only for root 35 | yaml.dump(self.conf, f, default_flow_style=False) 36 | except Exception: 37 | raise ConfigError(str(Exception)) 38 | else: 39 | raise ConfigError("conf file absent") 40 | 41 | @classmethod 42 | def from_file(cls, conf_file, schema=None): 43 | conf = cls(conf_file, schema=schema) 44 | conf.parse() 45 | return conf 46 | 47 | @classmethod 48 | def to_file(cls, conf_file, conf): 49 | conf = cls(conf_file, conf=conf) 50 | conf.write() 51 | return conf 52 | -------------------------------------------------------------------------------- /controller/python/streamswitch/wsgiapp/utils/logger.py: -------------------------------------------------------------------------------- 1 | """ 2 | streamswitch.wsgiapp.utils.logger 3 | ~~~~~~~~~~~~~~~~ 4 | 5 | This module implements the base log utils for streamswitch controller wsgi app. 6 | 7 | :copyright: (c) 2014 by OpenSight (www.opensight.cn). 8 | :license: AGPLv3, see LICENSE for more details. 9 | 10 | """ 11 | import logging 12 | 13 | 14 | logger = logging.getLogger("streamswitch") 15 | 16 | LOG_TYPE_CONFIG = "Config" 17 | LOG_TYPE_ERROR = "Error" 18 | LOG_TYPE_GENERAL = "General" 19 | 20 | 21 | def setLevel(lvl): 22 | """set the storlever logger's level 23 | 24 | arg: 25 | lvl -- the level number 26 | 27 | """ 28 | logger.setLevel(lvl) 29 | 30 | 31 | def log(lvl, log_type, msg, *args, **kwargs): 32 | """emit a log record to storlever's logger 33 | 34 | arg: 35 | lvl -- the log's level's number 36 | log_type -- the log's type, can only be LOG_TYPE_* 37 | msg -- log's content 38 | args -- the args list for msg 39 | 40 | """ 41 | log_type_str = "[%s] " % log_type 42 | logger.log(lvl, log_type_str + msg, *args, **kwargs) 43 | 44 | -------------------------------------------------------------------------------- /controller/python/streamswitch/wsgiapp/views/__init__.py: -------------------------------------------------------------------------------- 1 | def includeme(config): 2 | # look into following modules' includeme function 3 | # in order to register routes 4 | config.include(__name__ + '.stream_api_views') 5 | config.include(__name__ + '.port_api_views') 6 | config.include(__name__ + '.process_watcher_api_views') 7 | config.include(__name__ + '.sender_api_views') 8 | config.scan() # scan to register view callables, must be last statement -------------------------------------------------------------------------------- /controller/python/streamswitch/wsgiapp/views/process_watcher_api_views.py: -------------------------------------------------------------------------------- 1 | """ 2 | streamswitch.wsgiapp.views.process_watcher_api_views 3 | ~~~~~~~~~~~~~~~~~~~~~~~ 4 | 5 | This module implements the view callabes of restful api for process watcher monitor 6 | 7 | :copyright: (c) 2015 by OpenSight (www.opensight.cn). 8 | :license: AGPLv3, see LICENSE for more details. 9 | 10 | """ 11 | 12 | from __future__ import unicode_literals, division 13 | from .common import (get_view, post_view, 14 | put_view, delete_view) 15 | from ...exceptions import StreamSwitchError 16 | 17 | from pyramid.response import Response 18 | from ..utils.schema import Schema, Optional, DoNotCare, \ 19 | Use, IntVal, Default, SchemaError, BoolVal, StrRe, ListVal, Or, STRING, \ 20 | FloatVal, AutoDel 21 | from .common import get_params_from_request 22 | import gevent 23 | 24 | 25 | 26 | def includeme(config): 27 | config.add_route('watchers', '/process_watchers') 28 | config.add_route('watcher', '/process_watchers/{wid}') 29 | 30 | 31 | def get_process_watcher_service_from_request(request): 32 | registry = request.registry 33 | return registry.settings['process_watcher_service'] 34 | 35 | 36 | @get_view(route_name='watchers') 37 | def get_ports(request): 38 | pw_service = get_process_watcher_service_from_request(request) 39 | return pw_service.get_process_watcher_list() 40 | 41 | 42 | @get_view(route_name='watcher') 43 | def get_port(request): 44 | wid = int(request.matchdict['wid']) 45 | pw_service = get_process_watcher_service_from_request(request) 46 | return pw_service.get_process_watcher(wid) 47 | 48 | -------------------------------------------------------------------------------- /controller/readme: -------------------------------------------------------------------------------- 1 | This directory contains the controller component of StreamSwitch -------------------------------------------------------------------------------- /libstreamswitch/Makefile.am: -------------------------------------------------------------------------------- 1 | AUTOMAKE_OPTIONS=foreign subdir-objects 2 | 3 | AM_CPPFLAGS = -I$(srcdir)/include -I$(srcdir)/src/pb 4 | AM_CXXFLAGS = $(zeromq_CFLAGS) $(protobuf_CFLAGS) 5 | AM_LDFLAGS = $(zeromq_LIBS) $(protobuf_LIBS) 6 | 7 | pkgconfigdir = $(libdir)/pkgconfig 8 | pkgconfig_DATA = libstreamswitch.pc 9 | 10 | 11 | EXTRA_DIST = protocol 12 | 13 | 14 | SUBDIRS = . samples 15 | 16 | lib_LTLIBRARIES=libstreamswitch.la 17 | 18 | libstreamswitch_la_SOURCES = src/stsw_arg_parser.cc \ 19 | src/stsw_global.cc \ 20 | src/stsw_rotate_logger.cc \ 21 | src/stsw_stream_sink.cc \ 22 | src/stsw_stream_source.cc \ 23 | src/pb/pb_client_heartbeat.pb.cc \ 24 | src/pb/pb_client_heartbeat.pb.h \ 25 | src/pb/pb_client_list.pb.cc \ 26 | src/pb/pb_client_list.pb.h \ 27 | src/pb/pb_media.pb.cc \ 28 | src/pb/pb_media.pb.h \ 29 | src/pb/pb_media_statistic.pb.cc \ 30 | src/pb/pb_media_statistic.pb.h \ 31 | src/pb/pb_metadata.pb.cc \ 32 | src/pb/pb_metadata.pb.h \ 33 | src/pb/pb_packet.pb.cc \ 34 | src/pb/pb_packet.pb.h \ 35 | src/pb/pb_stream_info.pb.cc \ 36 | src/pb/pb_stream_info.pb.h 37 | 38 | libstreamswitch_la_LDFLAGS = -version-info 0:0:0 $(AM_LDFLAGS) 39 | 40 | include_HEADERS = include/stream_switch.h \ 41 | include/stsw_arg_parser.h \ 42 | include/stsw_defs.h \ 43 | include/stsw_global.h \ 44 | include/stsw_lock_guard.h \ 45 | include/stsw_rotate_logger.h \ 46 | include/stsw_sink_listener.h \ 47 | include/stsw_source_listener.h \ 48 | include/stsw_stream_sink.h \ 49 | include/stsw_stream_source.h 50 | -------------------------------------------------------------------------------- /libstreamswitch/README: -------------------------------------------------------------------------------- 1 | This directory contains the core library (framework) and its dependencies of StreamSwitch -------------------------------------------------------------------------------- /libstreamswitch/include/stream_switch.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file is part of libstreamswtich, which belongs to StreamSwitch 3 | * project. 4 | * 5 | * Copyright (C) 2014 OpenSight (www.opensight.cn) 6 | * 7 | * StreamSwitch is an extensible and scalable media stream server for 8 | * multi-protocol environment. 9 | * 10 | * This program is free software: you can redistribute it and/or modify 11 | * it under the terms of the GNU Affero General Public License as published 12 | * by the Free Software Foundation, either version 3 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU Affero General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU Affero General Public License 21 | * along with this program. If not, see . 22 | **/ 23 | 24 | #ifndef STREAM_SWITCH_H 25 | #define STREAM_SWITCH_H 26 | 27 | //inclue the main class header file 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | 37 | #endif -------------------------------------------------------------------------------- /libstreamswitch/include/stsw_lock_guard.h: -------------------------------------------------------------------------------- 1 | /** 2 | * StreamSwitch is an extensible and scalable media stream server for 3 | * multi-protocol environment. 4 | * 5 | * Copyright (C) 2014 OpenSight (www.opensight.cn) 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Affero General Public License as published 9 | * by the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Affero General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Affero General Public License 18 | * along with this program. If not, see . 19 | **/ 20 | /** 21 | * stsw_lock_guard.h 22 | * a auto lock guard implementation 23 | * 24 | * author: OpenSight Team 25 | * date: 2014-11-25 26 | **/ 27 | 28 | 29 | 30 | #ifndef STSW_LOCK_GUARD_H 31 | #define STSW_LOCK_GUARD_H 32 | #include 33 | 34 | 35 | 36 | namespace stream_switch { 37 | 38 | class LockGuard{ 39 | public: 40 | LockGuard(pthread_mutex_t *lock): lock_(lock) 41 | { 42 | if(lock_ != NULL){ 43 | pthread_mutex_lock(lock_); 44 | } 45 | } 46 | ~LockGuard() 47 | { 48 | if(lock_ != NULL){ 49 | pthread_mutex_unlock(lock_); 50 | } 51 | 52 | } 53 | 54 | private: 55 | pthread_mutex_t *lock_; 56 | 57 | 58 | }; 59 | 60 | } 61 | #endif -------------------------------------------------------------------------------- /libstreamswitch/libstreamswitch.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: libstreamswitch 7 | URL: http://www.opensight.cn/ 8 | Description: StreamSwitch core library, provide the interface to communicate with the other StreamSwitch component 9 | Version: @PACKAGE_VERSION@ 10 | Requires: 11 | Requiress.private: libczmq >= 3.0.0, libzmq >= 4.0.0, protobuf >= 2.0.0 12 | Libs: -L${libdir} -lstreamswitch -lpthread 13 | Cflags: -I${includedir} -pthread 14 | -------------------------------------------------------------------------------- /libstreamswitch/protocol/pb_client_heartbeat.proto: -------------------------------------------------------------------------------- 1 | package stream_switch; 2 | 3 | 4 | enum ProtoClientIPVersion { 5 | PROTO_IP_VERSION_V4 = 0; 6 | PROTO_IP_VERSION_V6 = 1; 7 | } 8 | 9 | 10 | message ProtoClientHeartbeatReq{ 11 | optional ProtoClientIPVersion client_ip_version = 1; //client IP version 12 | optional string client_ip = 2; // client ip address, ipv4/ipv6 13 | optional int32 client_port = 3; //client source port 14 | optional string client_token = 4; // client token, used to identify client with same IP and port 15 | optional string client_protocol = 5; //stream media protocol used by the client 16 | optional string client_text = 6; // text to describe this connected client 17 | optional int64 last_active_time = 7; //last active timestamp of this client 18 | } // client_ip + client_port + client_token uniquely identify a connected client 19 | 20 | message ProtoClientHeartbeatRep{ 21 | optional int32 lease = 1; //lease (in sec) for this heartbeat. After the lease time, the client described by this request would be no longer valid in source 22 | optional int64 timestamp = 2; //timestamp on source 23 | } 24 | -------------------------------------------------------------------------------- /libstreamswitch/protocol/pb_client_list.proto: -------------------------------------------------------------------------------- 1 | package stream_switch; 2 | 3 | import "pb_client_heartbeat.proto"; 4 | 5 | 6 | message ProtoClientListReq{ 7 | optional uint32 start_index = 1; //the index of the first client in the client_list of response 8 | optional uint32 client_num = 2; //how many client returned in the client list of response. 9 | //0 means return all clients 10 | } 11 | 12 | 13 | message ProtoClientListRep{ 14 | optional uint32 total_num = 1; //total client number, may differ from the size of the client_list field 15 | optional uint32 start_index = 2; //the index of the first client in the client_list field 16 | repeated ProtoClientHeartbeatReq client_list = 64; 17 | } 18 | -------------------------------------------------------------------------------- /libstreamswitch/protocol/pb_media.proto: -------------------------------------------------------------------------------- 1 | package stream_switch; 2 | 3 | 4 | enum ProtoMediaFrameType { 5 | PROTO_MEDIA_FRAME_KEY_FRAME = 0; //The key frame of this stream 6 | PROTO_MEDIA_FRAME_DATA_FRAME = 1; //normal data frame of the stream 7 | PROTO_MEDIA_FRAME_PARAM_FRAME = 2; //frame only include some codec parameter of the stream 8 | 9 | PROTO_MEDIA_FRAME_EOF_FRAME = 256; //A special frame type means reach the end of the media stream, no valid media data in this message 10 | } 11 | 12 | 13 | message ProtoMediaFrameReq{ //for replay 14 | //no param for now 15 | } 16 | 17 | message ProtoMediaFrameMsg{ //for live publish message and replay response 18 | optional int32 stream_index = 1; //which sub stream this frame belong to 19 | optional int64 sec = 2; //the pts of this frame 20 | optional int32 usec = 3; //the pts of this frame 21 | optional ProtoMediaFrameType frame_type = 4; //this frame type 22 | optional uint32 ssrc = 5; //ssrc of the frame 23 | optional uint64 seq = 6; //sequence number of this frame in the sub stream 24 | //tag below 64 is reserved to future extension 25 | 26 | optional bytes data = 64; //frame data 27 | 28 | } 29 | -------------------------------------------------------------------------------- /libstreamswitch/protocol/pb_media_statistic.proto: -------------------------------------------------------------------------------- 1 | package stream_switch; 2 | 3 | import "pb_metadata.proto"; 4 | 5 | message ProtoMediaStatisticReq{ 6 | //no param now 7 | } 8 | 9 | 10 | message ProtoSubStreamMediaStatistic{ 11 | 12 | optional int32 sub_stream_index = 1; 13 | optional ProtoSubStreamMediaType media_type = 2; //the type of this sub stream 14 | 15 | 16 | //about bytes 17 | optional uint64 data_bytes = 20; //the byte count for all the data frames of this sub stream 18 | optional uint64 key_bytes = 21; //the byte count for all the key frames of this sub stream. key_frame_bytes <= data_bytes 19 | 20 | //about frame 21 | optional uint64 lost_frames = 30; // the lost data frame count of this sub stream, 22 | optional uint64 data_frames = 31; // the data frame count of this sub stream 23 | optional uint64 key_frames = 32; // the key frame count of this sub stream 24 | optional uint64 last_gov = 33; //last gov 25 | } 26 | 27 | 28 | message ProtoMediaStatisticRep{ 29 | optional uint32 ssrc = 1; 30 | optional int64 timestamp = 2; //the statistic generation time, in milli sec 31 | optional uint64 sum_bytes = 3; //the sum bytes received of all sub streams 32 | //tag below 64 is reserved to future extension 33 | 34 | repeated ProtoSubStreamMediaStatistic sub_stream_stats = 64; 35 | 36 | 37 | } 38 | 39 | 40 | -------------------------------------------------------------------------------- /libstreamswitch/protocol/pb_packet.proto: -------------------------------------------------------------------------------- 1 | package stream_switch; 2 | 3 | enum ProtoPacketType { 4 | PROTO_PACKET_TYPE_REQUEST = 0; 5 | PROTO_PACKET_TYPE_REPLY = 1; 6 | PROTO_PACKET_TYPE_MESSAGE = 2; 7 | } 8 | 9 | //status code used in reply, which is compatible with HTTP definition 10 | enum ProtoPacketStatus { 11 | PROTO_PACKET_STATUS_OK = 200; 12 | PROTO_PACKET_STATUS_BAD_REQUEST = 400; 13 | PROTO_PACKET_STATUS_NOT_FOUND = 404; 14 | PROTO_PACKET_STATUS_INTERNAL_ERR = 500; 15 | } 16 | 17 | //operation code in the packet 18 | enum ProtoPacketCode { 19 | PROTO_PACKET_CODE_INVALID = 0; 20 | 21 | 22 | PROTO_PACKET_CODE_METADATA = 1; 23 | PROTO_PACKET_CODE_MEDIA = 2; 24 | PROTO_PACKET_CODE_STREAM_INFO = 3; 25 | PROTO_PACKET_CODE_KEY_FRAME = 4; //no body in REQ/REP 26 | PROTO_PACKET_CODE_CLIENT_HEARTBEAT = 5; 27 | PROTO_PACKET_CODE_MEDIA_STATISTIC = 6; 28 | PROTO_PACKET_CODE_CLIENT_LIST = 7; 29 | 30 | //above 255 is for user extension 31 | } 32 | 33 | 34 | 35 | message ProtoCommonHeader{ 36 | optional uint32 version = 1 [default = 1]; //version number 37 | optional ProtoPacketType type = 2 [default = PROTO_PACKET_TYPE_REQUEST]; 38 | optional int32 code = 3 [default = 0]; // operation code, it is used to identify the body type in the packet 39 | optional uint32 seq = 4 [default = 0]; // match request/reply, no meaning for message type 40 | optional int32 status = 5 [default = 200]; // only valid in reply packet, means the operation result, compatible with HTTP 41 | optional string info = 6; // only valid in reply packet, describes the result in text 42 | } 43 | 44 | message ProtoCommonPacket{ 45 | optional ProtoCommonHeader header = 1; 46 | optional bytes body = 2; 47 | } -------------------------------------------------------------------------------- /libstreamswitch/protocol/pb_stream_info.proto: -------------------------------------------------------------------------------- 1 | package stream_switch; 2 | 3 | 4 | import "pb_metadata.proto"; 5 | 6 | enum ProtoSourceStreamState { 7 | PROTO_SOURCE_STREAM_STATE_CONNECTING = 0; //the connection is being established now 8 | PROTO_SOURCE_STREAM_STATE_OK = 1; //connection has been established, and media data is transfer now 9 | 10 | 11 | //error state 12 | PROTO_SOURCE_STREAM_STATE_ERR = -1; //general error 13 | PROTO_SOURCE_STREAM_STATE_ERR_CONNECT_FAIL = -2; //connect the source failed 14 | PROTO_SOURCE_STREAM_STATE_ERR_MEIDA_STOP = -3; //stop to receive the media data 15 | PROTO_SOURCE_STREAM_STATE_ERR_TIME = -4; //timestamp loss sync 16 | 17 | PROTO_SOURCE_STREAM_STATE_ERR_TIMEOUT = -255; //not receive the stream info 18 | } 19 | 20 | message ProtoStreamInfoMsg{ 21 | optional ProtoSourceStreamState state = 1; 22 | optional ProtoPlayType play_type = 2; //playing type of this stream 23 | optional string source_proto = 3; //the protocol of this source 24 | optional uint32 ssrc = 4; //ssrc of this stream, if the receive frame must has the same ssrc with this stream, 25 | //otherwise the media frame cannot be described by this meta data 26 | optional uint32 cur_bps = 5; //the last 1 sec bps for the total throughput of this stream 27 | optional int64 last_frame_sec = 6; 28 | optional int32 last_frame_usec = 7; 29 | optional int64 send_time = 8; //the time (from epoch) in millisecond of broadcasting this msg 30 | 31 | optional string stream_name = 9; //the stream name 32 | optional int32 client_num = 10; //the client number 33 | //tag below 64 is reserved to future extension 34 | } 35 | 36 | 37 | -------------------------------------------------------------------------------- /libstreamswitch/samples/Makefile.am: -------------------------------------------------------------------------------- 1 | AUTOMAKE_OPTIONS=foreign 2 | 3 | AM_CPPFLAGS = -I$(srcdir)/../include 4 | AM_CXXFLAGS = $(zeromq_CFLAGS) $(protobuf_CFLAGS) 5 | AM_LDFLAGS = $(zeromq_LIBS) $(protobuf_LIBS) 6 | 7 | 8 | bin_PROGRAMS = api_test_sink file_live_source rotate_logger_test text_sink 9 | 10 | api_test_sink_SOURCES = api_test_sink.cc 11 | api_test_sink_LDADD = $(builddir)/../libstreamswitch.la 12 | 13 | file_live_source_SOURCES = file_live_source.cc 14 | file_live_source_LDADD = $(builddir)/../libstreamswitch.la 15 | 16 | rotate_logger_test_SOURCES = rotate_logger_test.cc 17 | rotate_logger_test_LDADD = $(builddir)/../libstreamswitch.la 18 | 19 | text_sink_SOURCES = text_sink.cc 20 | text_sink_LDADD = $(builddir)/../libstreamswitch.la 21 | -------------------------------------------------------------------------------- /m4/ltversion.m4: -------------------------------------------------------------------------------- 1 | # ltversion.m4 -- version numbers -*- Autoconf -*- 2 | # 3 | # Copyright (C) 2004 Free Software Foundation, Inc. 4 | # Written by Scott James Remnant, 2004 5 | # 6 | # This file is free software; the Free Software Foundation gives 7 | # unlimited permission to copy and/or distribute it, with or without 8 | # modifications, as long as this notice is preserved. 9 | 10 | # Generated from ltversion.in. 11 | 12 | # serial 3017 ltversion.m4 13 | # This file is part of GNU Libtool 14 | 15 | m4_define([LT_PACKAGE_VERSION], [2.2.6b]) 16 | m4_define([LT_PACKAGE_REVISION], [1.3017]) 17 | 18 | AC_DEFUN([LTVERSION_VERSION], 19 | [macro_version='2.2.6b' 20 | macro_revision='1.3017' 21 | _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) 22 | _LT_DECL(, macro_revision, 0) 23 | ]) 24 | -------------------------------------------------------------------------------- /ports/readme: -------------------------------------------------------------------------------- 1 | This directory contains various internal ports of StreamSwitch, including: 2 | 3 | 1) rtsp_port. The port supporting output the RTSP protocol -------------------------------------------------------------------------------- /ports/stsw_rtsp_port/src/conf/configparser.h: -------------------------------------------------------------------------------- 1 | #define TK_EOL 1 2 | #define TK_ASSIGN 2 3 | #define TK_APPEND 3 4 | #define TK_LKEY 4 5 | #define TK_PLUS 5 6 | #define TK_STRING 6 7 | #define TK_INTEGER 7 8 | #define TK_LPARAN 8 9 | #define TK_RPARAN 9 10 | #define TK_COMMA 10 11 | #define TK_ARRAY_ASSIGN 11 12 | #define TK_GLOBAL 12 13 | #define TK_LCURLY 13 14 | #define TK_RCURLY 14 15 | #define TK_ELSE 15 16 | #define TK_DOLLAR 16 17 | #define TK_SRVVARNAME 17 18 | #define TK_LBRACKET 18 19 | #define TK_RBRACKET 19 20 | #define TK_EQ 20 21 | #define TK_MATCH 21 22 | #define TK_NE 22 23 | #define TK_NOMATCH 23 24 | #define TK_INCLUDE 24 25 | #define TK_INCLUDE_SHELL 25 26 | -------------------------------------------------------------------------------- /ports/stsw_rtsp_port/src/conf/data_array.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "array.h" 6 | 7 | static data_unset *data_array_copy(const data_unset *s) { 8 | data_array *src = (data_array *)s; 9 | data_array *ds = data_array_init(); 10 | 11 | buffer_copy_string_buffer(ds->key, src->key); 12 | array_free(ds->value); 13 | ds->value = array_init_array(src->value); 14 | ds->is_index_key = src->is_index_key; 15 | return (data_unset *)ds; 16 | } 17 | 18 | static void data_array_free(data_unset *d) { 19 | data_array *ds = (data_array *)d; 20 | 21 | buffer_free(ds->key); 22 | array_free(ds->value); 23 | 24 | free(d); 25 | } 26 | 27 | static void data_array_reset(data_unset *d) { 28 | data_array *ds = (data_array *)d; 29 | 30 | /* reused array elements */ 31 | buffer_reset(ds->key); 32 | array_reset(ds->value); 33 | } 34 | 35 | static int data_array_insert_dup(data_unset *dst, data_unset *src) { 36 | UNUSED(dst); 37 | 38 | src->free(src); 39 | 40 | return 0; 41 | } 42 | 43 | static void data_array_print(const data_unset *d, int depth) { 44 | data_array *ds = (data_array *)d; 45 | 46 | array_print(ds->value, depth); 47 | } 48 | 49 | data_array *data_array_init(void) { 50 | data_array *ds; 51 | 52 | ds = calloc(1, sizeof(*ds)); 53 | 54 | ds->key = buffer_init(); 55 | ds->value = array_init(); 56 | 57 | ds->copy = data_array_copy; 58 | ds->free = data_array_free; 59 | ds->reset = data_array_reset; 60 | ds->insert_dup = data_array_insert_dup; 61 | ds->print = data_array_print; 62 | ds->type = TYPE_ARRAY; 63 | 64 | return ds; 65 | } 66 | -------------------------------------------------------------------------------- /ports/stsw_rtsp_port/src/conf/data_count.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "array.h" 6 | 7 | static data_count *data_count_init(void); 8 | 9 | static data_unset *data_count_copy(const data_unset *s) { 10 | data_count *src = (data_count *)s; 11 | data_count *ds = data_count_init(); 12 | 13 | buffer_copy_string_buffer(ds->key, src->key); 14 | ds->count = src->count; 15 | ds->is_index_key = src->is_index_key; 16 | return (data_unset *)ds; 17 | } 18 | 19 | static void data_count_free(data_unset *d) { 20 | data_count *ds = (data_count *)d; 21 | 22 | buffer_free(ds->key); 23 | 24 | free(d); 25 | } 26 | 27 | static void data_count_reset(data_unset *d) { 28 | data_count *ds = (data_count *)d; 29 | 30 | buffer_reset(ds->key); 31 | 32 | ds->count = 0; 33 | } 34 | 35 | static int data_count_insert_dup(data_unset *dst, data_unset *src) { 36 | data_count *ds_dst = (data_count *)dst; 37 | data_count *ds_src = (data_count *)src; 38 | 39 | ds_dst->count += ds_src->count; 40 | 41 | src->free(src); 42 | 43 | return 0; 44 | } 45 | 46 | static void data_count_print(const data_unset *d, int depth) { 47 | data_count *ds = (data_count *)d; 48 | UNUSED(depth); 49 | 50 | fprintf(stdout, "count(%d)", ds->count); 51 | } 52 | 53 | 54 | static data_count *data_count_init(void) { 55 | data_count *ds; 56 | 57 | ds = calloc(1, sizeof(*ds)); 58 | 59 | ds->key = buffer_init(); 60 | ds->count = 1; 61 | 62 | ds->copy = data_count_copy; 63 | ds->free = data_count_free; 64 | ds->reset = data_count_reset; 65 | ds->insert_dup = data_count_insert_dup; 66 | ds->print = data_count_print; 67 | ds->type = TYPE_COUNT; 68 | 69 | return ds; 70 | } 71 | -------------------------------------------------------------------------------- /ports/stsw_rtsp_port/src/conf/data_integer.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "array.h" 6 | 7 | static data_unset *data_integer_copy(const data_unset *s) { 8 | data_integer *src = (data_integer *)s; 9 | data_integer *ds = data_integer_init(); 10 | 11 | buffer_copy_string_buffer(ds->key, src->key); 12 | ds->is_index_key = src->is_index_key; 13 | ds->value = src->value; 14 | return (data_unset *)ds; 15 | } 16 | 17 | static void data_integer_free(data_unset *d) { 18 | data_integer *ds = (data_integer *)d; 19 | 20 | buffer_free(ds->key); 21 | 22 | free(d); 23 | } 24 | 25 | static void data_integer_reset(data_unset *d) { 26 | data_integer *ds = (data_integer *)d; 27 | 28 | /* reused integer elements */ 29 | buffer_reset(ds->key); 30 | ds->value = 0; 31 | } 32 | 33 | static int data_integer_insert_dup(data_unset *dst, data_unset *src) { 34 | UNUSED(dst); 35 | 36 | src->free(src); 37 | 38 | return 0; 39 | } 40 | 41 | static void data_integer_print(const data_unset *d, int depth) { 42 | data_integer *ds = (data_integer *)d; 43 | UNUSED(depth); 44 | 45 | fprintf(stdout, "%d", ds->value); 46 | } 47 | 48 | 49 | data_integer *data_integer_init(void) { 50 | data_integer *ds; 51 | 52 | ds = calloc(1, sizeof(*ds)); 53 | 54 | ds->key = buffer_init(); 55 | ds->value = 0; 56 | 57 | ds->copy = data_integer_copy; 58 | ds->free = data_integer_free; 59 | ds->reset = data_integer_reset; 60 | ds->insert_dup = data_integer_insert_dup; 61 | ds->print = data_integer_print; 62 | ds->type = TYPE_INTEGER; 63 | 64 | return ds; 65 | } 66 | -------------------------------------------------------------------------------- /ports/stsw_rtsp_port/src/conf/data_string.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | #include "array.h" 7 | 8 | static data_unset *data_string_copy(const data_unset *s) { 9 | data_string *src = (data_string *)s; 10 | data_string *ds = data_string_init(); 11 | 12 | buffer_copy_string_buffer(ds->key, src->key); 13 | buffer_copy_string_buffer(ds->value, src->value); 14 | ds->is_index_key = src->is_index_key; 15 | return (data_unset *)ds; 16 | } 17 | 18 | static void data_string_free(data_unset *d) { 19 | data_string *ds = (data_string *)d; 20 | 21 | buffer_free(ds->key); 22 | buffer_free(ds->value); 23 | 24 | free(d); 25 | } 26 | 27 | static void data_string_reset(data_unset *d) { 28 | data_string *ds = (data_string *)d; 29 | 30 | /* reused array elements */ 31 | buffer_reset(ds->key); 32 | buffer_reset(ds->value); 33 | } 34 | 35 | static int data_string_insert_dup(data_unset *dst, data_unset *src) { 36 | data_string *ds_dst = (data_string *)dst; 37 | data_string *ds_src = (data_string *)src; 38 | 39 | if (ds_dst->value->used) { 40 | buffer_append_string(ds_dst->value, ", "); 41 | buffer_append_string_buffer(ds_dst->value, ds_src->value); 42 | } else { 43 | buffer_copy_string_buffer(ds_dst->value, ds_src->value); 44 | } 45 | 46 | src->free(src); 47 | 48 | return 0; 49 | } 50 | 51 | static void data_string_print(const data_unset *d, int depth) { 52 | data_string *ds = (data_string *)d; 53 | UNUSED(depth); 54 | 55 | fprintf(stdout, "\"%s\"", ds->value->used ? ds->value->ptr : ""); 56 | } 57 | 58 | 59 | data_string *data_string_init(void) { 60 | data_string *ds; 61 | 62 | ds = calloc(1, sizeof(*ds)); 63 | assert(ds); 64 | 65 | ds->key = buffer_init(); 66 | ds->value = buffer_init(); 67 | 68 | ds->copy = data_string_copy; 69 | ds->free = data_string_free; 70 | ds->reset = data_string_reset; 71 | ds->insert_dup = data_string_insert_dup; 72 | ds->print = data_string_print; 73 | ds->type = TYPE_STRING; 74 | 75 | return ds; 76 | } 77 | -------------------------------------------------------------------------------- /ports/stsw_rtsp_port/src/conf/settings.h: -------------------------------------------------------------------------------- 1 | #ifndef LIGHTTPD_SETTINGS_H 2 | #define LIGHTTPD_SETTINGS_H 3 | 4 | #include 5 | 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | #define BV(x) (1 << x) 12 | 13 | #define INET_NTOP_CACHE_MAX 4 14 | #define FILE_CACHE_MAX 16 15 | 16 | /** 17 | * max size of a buffer which will just be reset 18 | * to ->used = 0 instead of really freeing the buffer 19 | * 20 | * 64kB (no real reason, just a guess) 21 | */ 22 | #define BUFFER_MAX_REUSE_SIZE (4 * 1024) 23 | 24 | /** 25 | * max size of the HTTP request header 26 | * 27 | * 32k should be enough for everything (just a guess) 28 | * 29 | */ 30 | #define MAX_HTTP_REQUEST_HEADER (32 * 1024) 31 | 32 | typedef enum { HANDLER_UNSET, 33 | HANDLER_GO_ON, 34 | HANDLER_FINISHED, 35 | HANDLER_COMEBACK, 36 | HANDLER_WAIT_FOR_EVENT, 37 | HANDLER_ERROR, 38 | HANDLER_WAIT_FOR_FD 39 | } handler_t; 40 | 41 | #ifdef __cplusplus 42 | } 43 | #endif 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /ports/stsw_rtsp_port/src/config.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * This file is part of stsw_rtsp_port, which belongs to StreamSwitch 4 | * project. And it's derived from Feng prject originally 5 | * 6 | * Copyright (C) 2015 OpenSight team (www.opensight.cn) 7 | * Copyright (C) 2009 by LScube team 8 | * 9 | * StreamSwitch is an extensible and scalable media stream server for 10 | * multi-protocol environment. 11 | * 12 | * This program is free software; you can redistribute it and/or 13 | * modify it under the terms of the GNU Lesser General Public 14 | * License as published by the Free Software Foundation; either 15 | * version 2.1 of the License, or (at your option) any later version. 16 | * 17 | * This program is distributed in the hope that it will be useful, 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 20 | * Lesser General Public License for more details. 21 | * 22 | * You should have received a copy of the GNU Lesser General Public 23 | * License along with this program; if not, see . 24 | * 25 | **/ 26 | 27 | #ifndef FN_CONFIG_FILE_H 28 | #define FN_CONFIG_FILE_H 29 | 30 | #ifdef __WIN32__ 31 | #define ATTR_UNUSED 32 | #else 33 | #define ATTR_UNUSED 34 | #endif 35 | 36 | 37 | #ifndef PACKAGE 38 | #define PACKAGE "StreamSwitch" 39 | #endif 40 | 41 | #ifndef VERSION 42 | #define VERSION "0.1.0" 43 | #endif 44 | 45 | 46 | #endif -------------------------------------------------------------------------------- /ports/stsw_rtsp_port/src/incoming.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file is part of stsw_rtsp_port, which belongs to StreamSwitch 3 | * project. And it's derived from Feng prject originally 4 | * 5 | * Copyright (C) 2015 OpenSight team (www.opensight.cn) 6 | * Copyright (C) 2009 by LScube team 7 | * 8 | * StreamSwitch is an extensible and scalable media stream server for 9 | * multi-protocol environment. 10 | * 11 | * This program is free software; you can redistribute it and/or 12 | * modify it under the terms of the GNU Lesser General Public 13 | * License as published by the Free Software Foundation; either 14 | * version 2.1 of the License, or (at your option) any later version. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 19 | * Lesser General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU Lesser General Public 22 | * License along with this program; if not, see . 23 | * 24 | **/ 25 | 26 | #ifndef FENG_INCOMING_H 27 | #define FENG_INCOMING_H 28 | 29 | #ifdef __cplusplus 30 | extern "C" { 31 | #endif 32 | 33 | #include 34 | 35 | 36 | 37 | struct feng; 38 | 39 | gboolean feng_bind_ports(struct feng *srv); 40 | void feng_ports_cleanup(struct feng * srv); 41 | 42 | #ifdef __cplusplus 43 | } 44 | #endif // 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /ports/stsw_rtsp_port/src/liberis/utils.c: -------------------------------------------------------------------------------- 1 | /** 2 | * This file is part of stsw_rtsp_port, which belongs to StreamSwitch 3 | * project. And it's derived from Feng prject originally 4 | * 5 | * Copyright (C) 2015 OpenSight team (www.opensight.cn) 6 | * Copyright (C) 2009 by LScube team 7 | * 8 | * StreamSwitch is an extensible and scalable media stream server for 9 | * multi-protocol environment. 10 | * 11 | * This program is free software; you can redistribute it and/or 12 | * modify it under the terms of the GNU Lesser General Public 13 | * License as published by the Free Software Foundation; either 14 | * version 2.1 of the License, or (at your option) any later version. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 19 | * Lesser General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU Lesser General Public 22 | * License along with this program; if not, see . 23 | * 24 | **/ 25 | 26 | #include "config.h" 27 | 28 | #include "utils.h" 29 | 30 | /** 31 | * @brief Creates a new headers table (GHashTable). 32 | * 33 | * @return A new GHashTable object ready to contain headers. 34 | * 35 | * This function is a simple thin wrapper around 36 | * g_hash_table_new_full() that already provides the right parameters 37 | * to the function. 38 | * 39 | * @internal This function is to be used only by liberis functions. 40 | */ 41 | GHashTable *_eris_hdr_table_new() 42 | { 43 | return g_hash_table_new_full(g_str_hash, g_str_equal, 44 | g_free, g_free); 45 | } 46 | -------------------------------------------------------------------------------- /ports/stsw_rtsp_port/src/liberis/utils.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file is part of stsw_rtsp_port, which belongs to StreamSwitch 3 | * project. And it's derived from Feng prject originally 4 | * 5 | * Copyright (C) 2015 OpenSight team (www.opensight.cn) 6 | * Copyright (C) 2009 by LScube team 7 | * 8 | * StreamSwitch is an extensible and scalable media stream server for 9 | * multi-protocol environment. 10 | * 11 | * This program is free software; you can redistribute it and/or 12 | * modify it under the terms of the GNU Lesser General Public 13 | * License as published by the Free Software Foundation; either 14 | * version 2.1 of the License, or (at your option) any later version. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 19 | * Lesser General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU Lesser General Public 22 | * License along with this program; if not, see . 23 | * 24 | **/ 25 | 26 | /** 27 | * @file 28 | * @brief Generic utility functions 29 | * 30 | * This file contains private utility functions for liberis. 31 | */ 32 | 33 | #ifndef LIBERIS_UTILS_H__ 34 | #define LIBERIS_UTILS_H__ 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | #include 39 | 40 | GHashTable *_eris_hdr_table_new(); 41 | #ifdef __cplusplus 42 | } 43 | #endif 44 | #endif 45 | -------------------------------------------------------------------------------- /ports/stsw_rtsp_port/src/media/demuxer_module.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file is part of stsw_rtsp_port, which belongs to StreamSwitch 3 | * project. And it's derived from Feng prject originally 4 | * 5 | * Copyright (C) 2015 OpenSight team (www.opensight.cn) 6 | * Copyright (C) 2009 by LScube team 7 | * 8 | * StreamSwitch is an extensible and scalable media stream server for 9 | * multi-protocol environment. 10 | * 11 | * This program is free software; you can redistribute it and/or 12 | * modify it under the terms of the GNU Lesser General Public 13 | * License as published by the Free Software Foundation; either 14 | * version 2.1 of the License, or (at your option) any later version. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 19 | * Lesser General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU Lesser General Public 22 | * License along with this program; if not, see . 23 | * 24 | **/ 25 | 26 | #ifndef FN_DEMUXER_MODULE_H 27 | #define FN_DEMUXER_MODULE_H 28 | 29 | #include "demuxer.h" 30 | #include "mediaparser.h" 31 | 32 | #ifdef __cplusplus 33 | extern "C" { 34 | #endif 35 | 36 | #define FNC_LIB_DEMUXER(x) Demuxer fnc_demuxer_##x =\ 37 | {\ 38 | &info, \ 39 | x##_probe, \ 40 | x##_init, \ 41 | x##_read_packet, \ 42 | x##_seek, \ 43 | x##_uninit, \ 44 | x##_start, \ 45 | x##_pause \ 46 | } 47 | 48 | #ifdef __cplusplus 49 | } 50 | #endif 51 | 52 | #endif // FN_DEMUXER_MODULE_H 53 | 54 | -------------------------------------------------------------------------------- /ports/stsw_rtsp_port/src/media/mediaparser_module.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file is part of stsw_rtsp_port, which belongs to StreamSwitch 3 | * project. And it's derived from Feng prject originally 4 | * 5 | * Copyright (C) 2015 OpenSight team (www.opensight.cn) 6 | * Copyright (C) 2009 by LScube team 7 | * 8 | * StreamSwitch is an extensible and scalable media stream server for 9 | * multi-protocol environment. 10 | * 11 | * This program is free software; you can redistribute it and/or 12 | * modify it under the terms of the GNU Lesser General Public 13 | * License as published by the Free Software Foundation; either 14 | * version 2.1 of the License, or (at your option) any later version. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 19 | * Lesser General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU Lesser General Public 22 | * License along with this program; if not, see . 23 | * 24 | **/ 25 | 26 | #ifndef FN_MEDIAPARSER_MODULE_H 27 | #define FN_MEDIAPARSER_MODULE_H 28 | #ifdef __cplusplus 29 | extern "C" { 30 | #endif 31 | 32 | #include "mediaparser.h" 33 | 34 | #define FNC_LIB_MEDIAPARSER(x) MediaParser fnc_mediaparser_##x =\ 35 | {\ 36 | &info, \ 37 | x##_init, \ 38 | x##_parse, \ 39 | x##_uninit, \ 40 | x##_reset \ 41 | } 42 | 43 | 44 | #ifdef __cplusplus 45 | } 46 | #endif 47 | 48 | #endif // FN_MEDIAPARSER_MODULE_H 49 | 50 | -------------------------------------------------------------------------------- /ports/stsw_rtsp_port/src/media/parser/speex.c: -------------------------------------------------------------------------------- 1 | /* * 2 | * This file is part of Feng 3 | * 4 | * Copyright (C) 2009 by LScube team 5 | * See AUTHORS for more details 6 | * 7 | * feng is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2.1 of the License, or (at your option) any later version. 11 | * 12 | * feng is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with this program; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | * 21 | * */ 22 | 23 | #include 24 | #include 25 | #include "media/demuxer.h" 26 | #include "media/mediaparser.h" 27 | #include "media/mediaparser_module.h" 28 | #include "feng_utils.h" 29 | 30 | static const MediaParserInfo info = { 31 | "speex", 32 | MP_audio 33 | }; 34 | 35 | static int speex_init(Track *track) 36 | { 37 | return ERR_NOERROR; 38 | } 39 | 40 | static int speex_parse(Track *tr, uint8_t *data, size_t len) 41 | { 42 | if (len > DEFAULT_MTU) 43 | return ERR_ALLOC; 44 | 45 | mparser_buffer_write(tr, 46 | tr->properties.pts, 47 | tr->properties.dts, 48 | tr->properties.frame_duration, 49 | 1, 50 | data, len); 51 | 52 | return ERR_NOERROR; 53 | } 54 | 55 | #define speex_uninit NULL 56 | #define speex_reset NULL 57 | 58 | 59 | 60 | FNC_LIB_MEDIAPARSER(speex); 61 | 62 | -------------------------------------------------------------------------------- /ports/stsw_rtsp_port/src/network/rtsp_method_options.c: -------------------------------------------------------------------------------- 1 | /** 2 | * This file is part of stsw_rtsp_port, which belongs to StreamSwitch 3 | * project. And it's derived from Feng prject originally 4 | * 5 | * Copyright (C) 2015 OpenSight team (www.opensight.cn) 6 | * Copyright (C) 2009 by LScube team 7 | * 8 | * StreamSwitch is an extensible and scalable media stream server for 9 | * multi-protocol environment. 10 | * 11 | * This program is free software; you can redistribute it and/or 12 | * modify it under the terms of the GNU Lesser General Public 13 | * License as published by the Free Software Foundation; either 14 | * version 2.1 of the License, or (at your option) any later version. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 19 | * Lesser General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU Lesser General Public 22 | * License along with this program; if not, see . 23 | * 24 | **/ 25 | 26 | /** @file 27 | * @brief Contains OPTIONS method and reply handlers 28 | */ 29 | 30 | #include 31 | 32 | #include "rtsp.h" 33 | 34 | /** 35 | * RTSP OPTIONS method handler 36 | * @param rtsp the buffer for which to handle the method 37 | * @param req The client request for the method 38 | * @return ERR_NOERROR 39 | */ 40 | void RTSP_options(RTSP_Client * rtsp, RTSP_Request *req) 41 | { 42 | RTSP_Response *response = rtsp_response_new(req, RTSP_Ok); 43 | 44 | g_hash_table_insert(response->headers, 45 | g_strdup(eris_hdr_public), 46 | g_strdup("OPTIONS,DESCRIBE,SETUP,PLAY,PAUSE,TEARDOWN,GET_PARAMETER")); 47 | 48 | rtsp_response_send(response); 49 | } 50 | -------------------------------------------------------------------------------- /ports/stsw_rtsp_port/src/network/rtsp_method_teardown.c: -------------------------------------------------------------------------------- 1 | /** 2 | * This file is part of stsw_rtsp_port, which belongs to StreamSwitch 3 | * project. And it's derived from Feng prject originally 4 | * 5 | * Copyright (C) 2015 OpenSight team (www.opensight.cn) 6 | * Copyright (C) 2009 by LScube team 7 | * 8 | * StreamSwitch is an extensible and scalable media stream server for 9 | * multi-protocol environment. 10 | * 11 | * This program is free software; you can redistribute it and/or 12 | * modify it under the terms of the GNU Lesser General Public 13 | * License as published by the Free Software Foundation; either 14 | * version 2.1 of the License, or (at your option) any later version. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 19 | * Lesser General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU Lesser General Public 22 | * License along with this program; if not, see . 23 | * 24 | **/ 25 | 26 | /** @file 27 | * @brief Contains TEARDOWN method and reply handlers 28 | */ 29 | 30 | #include "rtsp.h" 31 | 32 | /** 33 | * RTSP TEARDOWN method handler 34 | * @param rtsp the buffer for which to handle the method 35 | * @param req The client request for the method 36 | * @todo trigger the release of rtp resources here 37 | */ 38 | void RTSP_teardown(RTSP_Client *rtsp, 39 | RTSP_Request *req) 40 | { 41 | if ( !rtsp_request_check_url(req) ) 42 | return; 43 | 44 | // ev_async_send(rtsp->srv->loop, rtsp->ev_sig_disconnect); 45 | 46 | rtsp_quick_response(req, RTSP_Ok); 47 | } 48 | -------------------------------------------------------------------------------- /scripts/stsw_net_set.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # this is important system param would affect the performance 3 | GETMEM=`cat /proc/sys/net/core/rmem_max` 4 | if(test $GETMEM -lt 4194304) 5 | then /sbin/sysctl net.core.rmem_max=4194304 6 | fi 7 | 8 | GETMEM=`cat /proc/sys/net/core/wmem_max` 9 | if(test $GETMEM -lt 8388608) 10 | then /sbin/sysctl net.core.wmem_max=8388608 11 | fi 12 | 13 | GETMEM=`cat /proc/sys/net/core/netdev_max_backlog` 14 | if(test $GETMEM -lt 2000) 15 | then /sbin/sysctl net.core.netdev_max_backlog=2000 16 | fi 17 | 18 | GETUNIXQ=`cat /proc/sys/net/unix/max_dgram_qlen` 19 | if(test $GETUNIXQ -lt 2000) 20 | then /sbin/sysctl net.unix.max_dgram_qlen=2000 21 | fi 22 | -------------------------------------------------------------------------------- /scripts/stsw_sys_set.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | GETMEM=`cat /proc/sys/vm/dirty_background_ratio` 3 | if(test $GETMEM -gt 1) 4 | then /sbin/sysctl vm.dirty_background_ratio=1 5 | fi 6 | 7 | GETMEM=`cat /proc/sys/vm/dirty_expire_centisecs` 8 | if(test $GETMEM -gt 500) 9 | then /sbin/sysctl vm.dirty_expire_centisecs=500 10 | fi 11 | 12 | GETMEM=`cat /proc/sys/vm/dirty_writeback_centisecs` 13 | if(test $GETMEM -gt 100) 14 | then /sbin/sysctl vm.dirty_writeback_centisecs=100 15 | fi 16 | 17 | #GETMEM=`cat /proc/sys/vm/max_writeback_pages` 18 | #if(test $GETMEM -lt 10240) 19 | # then /sbin/sysctl vm.max_writeback_pages=10240 20 | #fi 21 | 22 | GETMINFREE=`cat /proc/sys/vm/min_free_kbytes` 23 | if(test $GETMINFREE -lt 32768) 24 | then /sbin/sysctl vm.min_free_kbytes=32768 25 | fi 26 | 27 | -------------------------------------------------------------------------------- /senders/ffmpeg_sender/Makefile.am: -------------------------------------------------------------------------------- 1 | AUTOMAKE_OPTIONS=foreign subdir-objects 2 | 3 | AM_CPPFLAGS = -I$(srcdir)/../../libstreamswitch/include -D__STDC_CONSTANT_MACROS 4 | AM_CXXFLAGS = $(zeromq_CFLAGS) $(protobuf_CFLAGS) $(libavformat_CFLAGS) $(libavutil_CFLAGS) $(libcurl_CFLAGS) $(libavcodec_CFLAGS) $(libswresample_CFLAGS) 5 | AM_CFLAGS = $(zeromq_CFLAGS) $(protobuf_CFLAGS) $(libavformat_CFLAGS) $(libavutil_CFLAGS) $(libffmpeg_ivr_CFLAGS) $(libavcodec_CFLAGS) $(libswresample_CFLAGS) 6 | AM_LDFLAGS = $(zeromq_LIBS) $(protobuf_LIBS) $(libavformat_LIBS) $(libavutil_LIBS) $(libffmpeg_ivr_LIBS) $(libavcodec_LIBS) $(libswresample_LIBS) 7 | 8 | 9 | bin_PROGRAMS = ffmpeg_sender 10 | 11 | ffmpeg_sender_SOURCES = src/stsw_main.cc \ 12 | src/stsw_ffmpeg_sender_arg_parser.cc \ 13 | src/stsw_ffmpeg_sender_arg_parser.h \ 14 | src/stsw_ffmpeg_muxer_sender.cc \ 15 | src/stsw_ffmpeg_muxer_sender.h \ 16 | src/stsw_ffmpeg_muxer.cc \ 17 | src/stsw_ffmpeg_muxer.h \ 18 | src/parsers/stsw_stream_mux_parser.cc \ 19 | src/parsers/stsw_stream_mux_parser.h \ 20 | src/parsers/stsw_h264or5_mux_parser.cc \ 21 | src/parsers/stsw_h264or5_mux_parser.h \ 22 | src/parsers/stsw_mpeg4_video_mux_parser.cc \ 23 | src/parsers/stsw_mpeg4_video_mux_parser.h \ 24 | src/parsers/stsw_aac_mux_parser.cc \ 25 | src/parsers/stsw_aac_mux_parser.h \ 26 | src/parsers/dec_sps.cc \ 27 | src/parsers/dec_sps.h \ 28 | src/stsw_ffmpeg_sender_global.h \ 29 | src/stsw_log.cc \ 30 | src/stsw_log.h 31 | 32 | 33 | ffmpeg_sender_LDADD = $(builddir)/../../libstreamswitch/libstreamswitch.la 34 | 35 | -------------------------------------------------------------------------------- /senders/ffmpeg_sender/README.md: -------------------------------------------------------------------------------- 1 | FFMPEG_SENDER 2 | ====================== 3 | 4 | A StreamSwitch stream sender which is based on the ffmpeg muxing functions. 5 | 6 | This sender would get the stream data from a specific StreamSwitch source, 7 | no matter it's local or remote, and write its media data to a ffmpeg muxing 8 | context. 9 | 10 | Through the mature ffmpeg library, ffmpeg_sender can support many popular 11 | stream media protocols, like RTSP(announce method), RTMP(publish), HLS. 12 | 13 | 14 | ## How to run 15 | ---------------------- 16 | 17 | typing the following command at the this project's root directory (the directory includes this README.md) 18 | can start up the ffmpeg_sender at front-ground 19 | 20 | # ./ffmpeg_sender -s [stream_name] -f [format_name] -u [URL] 21 | 22 | which [stream_name] is the name of the stream published by a StreamSwitch source. 23 | [format_name] is the name of output format to use, if not presented, ffmpeg_sender would guess it from the 24 | output URL. [URL] is the URL of file to output. 25 | 26 | Besides above, you can get more options by typing following command. 27 | 28 | #./ffmpeg_sender -h 29 | 30 | You can send SIGINT/SIGTERM signal to the running process to terminate it. 31 | Also, you can make use of Ctrl+C in the console running ffmpeg_sender to 32 | terminate it. 33 | -------------------------------------------------------------------------------- /senders/ffmpeg_sender/src/parsers/dec_sps.h: -------------------------------------------------------------------------------- 1 | #ifndef _DECSPS_ 2 | #define _DECSPS_ 3 | 4 | int decsps(unsigned char* pBuf, unsigned int nSize, unsigned int* width, unsigned int* height); 5 | int decsps_265(unsigned char* pBuf, unsigned int nSize, unsigned int* width, unsigned int* height); 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /senders/ffmpeg_sender/src/stsw_ffmpeg_sender_global.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file is part of ffmpeg_sender, which belongs to StreamSwitch 3 | * project. 4 | * 5 | * Copyright (C) 2014 OpenSight (www.opensight.cn) 6 | * 7 | * StreamSwitch is an extensible and scalable media stream server for 8 | * multi-protocol environment. 9 | * 10 | * This program is free software: you can redistribute it and/or modify 11 | * it under the terms of the GNU Affero General Public License as published 12 | * by the Free Software Foundation, either version 3 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU Affero General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU Affero General Public License 21 | * along with this program. If not, see . 22 | **/ 23 | /** 24 | * stsw_ffmpeg_sender_global.cc 25 | * The header file includes some global definitions and declarations 26 | * used by other parts of ffmpeg_sender 27 | * 28 | * author: OpenSight Team 29 | * date: 2015-11-15 30 | **/ 31 | 32 | #ifndef STSW_FFMPEG_SENDER_GLOBAL_H 33 | #define STSW_FFMPEG_SENDER_GLOBAL_H 34 | 35 | 36 | enum FFmpegSenderErrCode{ 37 | FFMPEG_SENDER_ERR_OK = 0, 38 | FFMPEG_SENDER_ERR_GENERAL = -1, // general error 39 | FFMPEG_SENDER_ERR_TIMEOUT = -2, // timout 40 | 41 | 42 | FFMPEG_SENDER_ERR_IO = -64, // IO operation fail 43 | FFMPEG_SENDER_ERR_INTER_FRAME_GAP = -65, // over max inter frame gap 44 | FFMPEG_SENDER_ERR_EOF = -66, // stream finish 45 | FFMPEG_SENDER_ERR_NOT_SUPPORT = -67, // codec not support 46 | FFMPEG_SENDER_ERR_CODEC = -68, // encode/decode error 47 | }; 48 | 49 | 50 | 51 | 52 | #endif -------------------------------------------------------------------------------- /senders/readme: -------------------------------------------------------------------------------- 1 | This directory contains various internal stream senders of different protocols, including: 2 | 3 | 1) ffmpeg_sender, a media stream sender based on the ffmpeg muxing function, which support multi format and network protocols 4 | -------------------------------------------------------------------------------- /sources/ffmpeg_demuxer_source/Makefile.am: -------------------------------------------------------------------------------- 1 | AUTOMAKE_OPTIONS=foreign subdir-objects 2 | 3 | AM_CPPFLAGS = -I$(srcdir)/../../libstreamswitch/include -D__STDC_CONSTANT_MACROS 4 | AM_CXXFLAGS = $(zeromq_CFLAGS) $(protobuf_CFLAGS) $(libavformat_CFLAGS) $(libavutil_CFLAGS) 5 | AM_LDFLAGS = $(zeromq_LIBS) $(protobuf_LIBS) $(libavformat_LIBS) $(libavutil_LIBS) 6 | 7 | 8 | bin_PROGRAMS = ffmpeg_demuxer_source 9 | 10 | ffmpeg_demuxer_source_SOURCES = src/stsw_main.cc \ 11 | src/stsw_ffmpeg_arg_parser.cc \ 12 | src/stsw_ffmpeg_arg_parser.h \ 13 | src/stsw_ffmpeg_demuxer_source.cc \ 14 | src/stsw_ffmpeg_demuxer_source.h \ 15 | src/stsw_ffmpeg_demuxer.cc \ 16 | src/stsw_ffmpeg_demuxer.h \ 17 | src/parser/stsw_stream_parser.cc \ 18 | src/parser/stsw_stream_parser.h \ 19 | src/parser/stsw_h264or5_parser.cc \ 20 | src/parser/stsw_h264or5_parser.h \ 21 | src/parser/stsw_mpeg4_parser.cc \ 22 | src/parser/stsw_mpeg4_parser.h \ 23 | src/stsw_ffmpeg_source_global.h \ 24 | src/stsw_log.cc \ 25 | src/stsw_log.h 26 | 27 | 28 | ffmpeg_demuxer_source_LDADD = $(builddir)/../../libstreamswitch/libstreamswitch.la 29 | 30 | -------------------------------------------------------------------------------- /sources/ffmpeg_demuxer_source/README.md: -------------------------------------------------------------------------------- 1 | FFMPEG_DEMUXER_SOURCE 2 | ====================== 3 | 4 | A special StreamSwitch source which is based on the ffmpeg demuxing function. 5 | 6 | This source get the stream data from a ffmpeg demuxer context, 7 | and publish it as a StreamSwitch Source. By making use of ffmpeg demuxing, 8 | this source can support various source format or standard live stream 9 | protocols, like RTSP(PLAY mode), RTMP(client or server), TCP/UDP。 10 | 11 | 12 | ## How to run 13 | ---------------------- 14 | 15 | typing the following command at the FFMPEG_DEMUXER_SOURCE project's root directory (the directory includes this README.md) 16 | can start up the stsw_proxy_source at front-ground 17 | 18 | # ./ffmpeg_demuxer_source -s [stream_name] -u [URL] 19 | 20 | which [stream_name] is the name of the stream published by this source instance, 21 | [URL] is the URL of the input file for ffmpeg demuxing context, you can get more 22 | options by typing following command. 23 | 24 | #./ffmpeg_demuxer_source -h 25 | 26 | You can send SIGINT/SIGTERM signal to the running process to terminate it. 27 | Also, you can make use of Ctrl+C in the console running stsw_proxy_source to 28 | terminate it. 29 | -------------------------------------------------------------------------------- /sources/ffmpeg_demuxer_source/src/parser/stsw_mpeg4_parser.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file is part of libstreamswtich, which belongs to StreamSwitch 3 | * project. 4 | * 5 | * Copyright (C) 2014 OpenSight (www.opensight.cn) 6 | * 7 | * StreamSwitch is an extensible and scalable media stream server for 8 | * multi-protocol environment. 9 | * 10 | * This program is free software: you can redistribute it and/or modify 11 | * it under the terms of the GNU Affero General Public License as published 12 | * by the Free Software Foundation, either version 3 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU Affero General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU Affero General Public License 21 | * along with this program. If not, see . 22 | **/ 23 | /** 24 | * stsw_mpeg4_parser.h 25 | * H264or5Parser class header file, define intefaces of the H264or5Parser 26 | * class. 27 | * H264or5Parser is the child class of StreamParser, whichs overrides some 28 | * of the parent's methods for h264 or h265, like update metadata for h264/h265 29 | * 30 | * author: OpenSight Team 31 | * date: 2015-10-15 32 | **/ 33 | 34 | #ifndef STSW_MPEG4_PARSER_H 35 | #define STSW_MPEG4_PARSER_H 36 | 37 | 38 | #include "stsw_stream_parser.h" 39 | 40 | class Mpeg4Parser: public StreamParser{ 41 | 42 | public: 43 | virtual int Init(FFmpegDemuxer *demuxer, int stream_index); 44 | virtual bool IsMetaReady(); 45 | 46 | protected: 47 | virtual int DoUpdateMeta(AVPacket *pkt, bool* is_meta_changed); 48 | virtual int GetExtraDataSize(AVPacket *pkt); 49 | 50 | 51 | }; 52 | 53 | #endif -------------------------------------------------------------------------------- /sources/ffmpeg_demuxer_source/src/stsw_ffmpeg_source_global.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file is part of libstreamswtich, which belongs to StreamSwitch 3 | * project. 4 | * 5 | * Copyright (C) 2014 OpenSight (www.opensight.cn) 6 | * 7 | * StreamSwitch is an extensible and scalable media stream server for 8 | * multi-protocol environment. 9 | * 10 | * This program is free software: you can redistribute it and/or modify 11 | * it under the terms of the GNU Affero General Public License as published 12 | * by the Free Software Foundation, either version 3 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU Affero General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU Affero General Public License 21 | * along with this program. If not, see . 22 | **/ 23 | /** 24 | * stsw_ffmpeg_source_global.cc 25 | * The header file includes some global definitions and declarations 26 | * used by other parts of ffmpeg_demuxer_source 27 | * 28 | * author: OpenSight Team 29 | * date: 2015-10-22 30 | **/ 31 | 32 | #ifndef STSW_FFMPEG_SOURCE_GLOBAL_H 33 | #define STSW_FFMPEG_SOURCE_GLOBAL_H 34 | 35 | 36 | enum FFmpegSourceErrCode{ 37 | FFMPEG_SOURCE_ERR_OK = 0, 38 | FFMPEG_SOURCE_ERR_GENERAL = -1, // general error 39 | FFMPEG_SOURCE_ERR_TIMEOUT = -2, // general error 40 | 41 | 42 | FFMPEG_SOURCE_ERR_EOF = -64, // Resource EOF 43 | FFMPEG_SOURCE_ERR_DROP = -65, // packet is dropped internal, need request again 44 | FFMPEG_SOURCE_ERR_IO = -66, // IO operation fail 45 | 46 | FFMPEG_SOURCE_ERR_NOT_FOUND = -67, // Resource not found 47 | FFMPEG_SOURCE_ERR_GAP = -68, //local time gap 48 | }; 49 | 50 | 51 | 52 | 53 | #endif -------------------------------------------------------------------------------- /sources/readme: -------------------------------------------------------------------------------- 1 | This directory contains various internal source type drivers of StreamSwitch, including: 2 | 3 | 1) stsw_rtsp_source. The source type of The RTSP protocol 4 | 2) stsw_proxy_source. The source of a proxy transferring from another source 5 | 3) ffmpeg_source. The source make use of ffmpeg libavformat library to get stream -------------------------------------------------------------------------------- /sources/stsw_proxy_source/Makefile.am: -------------------------------------------------------------------------------- 1 | AUTOMAKE_OPTIONS=foreign subdir-objects 2 | 3 | AM_CPPFLAGS = -I$(srcdir)/../../libstreamswitch/include 4 | AM_CXXFLAGS = $(zeromq_CFLAGS) $(protobuf_CFLAGS) 5 | AM_LDFLAGS = $(zeromq_LIBS) $(protobuf_LIBS) 6 | 7 | 8 | bin_PROGRAMS = stsw_proxy_source 9 | 10 | stsw_proxy_source_SOURCES = src/stsw_main.cc \ 11 | src/stsw_stream_proxy.cc \ 12 | src/stsw_stream_proxy.h \ 13 | src/url.h \ 14 | src/stsw_log.cc \ 15 | src/stsw_log.h 16 | 17 | stsw_proxy_source_LDADD = $(builddir)/../../libstreamswitch/libstreamswitch.la 18 | 19 | -------------------------------------------------------------------------------- /sources/stsw_proxy_source/src/stsw_log.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file is part of stsw_proxy_source, which belongs to StreamSwitch 3 | * project. 4 | * 5 | * Copyright (C) 2014 OpenSight (www.opensight.cn) 6 | * 7 | * StreamSwitch is an extensible and scalable media stream server for 8 | * multi-protocol environment. 9 | * 10 | * This program is free software: you can redistribute it and/or modify 11 | * it under the terms of the GNU Affero General Public License as published 12 | * by the Free Software Foundation, either version 3 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU Affero General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU Affero General Public License 22 | * along with this program. If not, see . 23 | **/ 24 | /** 25 | * stsw_log.h 26 | * the header file of the log module 27 | * 28 | * author: OpenSight Team 29 | * date: 2015-6-24 30 | **/ 31 | 32 | #include 33 | #include 34 | #include 35 | 36 | int InitGlobalLogger(std::string base_name, 37 | int file_size, int rotate_num, 38 | int log_level); 39 | 40 | int UninitGlobalLogger(); 41 | 42 | extern stream_switch::RotateLogger * global_logger; 43 | extern int stderr_level; 44 | 45 | #define STDERR_LOG(level, fmt, ...) \ 46 | do { \ 47 | if(global_logger != NULL){ \ 48 | global_logger->Log(level, __FILE__, __LINE__, fmt, ##__VA_ARGS__); \ 49 | }else{ \ 50 | if(level <= stderr_level) {\ 51 | fprintf(stderr, fmt, ##__VA_ARGS__); \ 52 | } \ 53 | } \ 54 | }while(0) 55 | 56 | 57 | -------------------------------------------------------------------------------- /sources/stsw_rtmp_source/Makefile.am: -------------------------------------------------------------------------------- 1 | AUTOMAKE_OPTIONS=foreign subdir-objects 2 | 3 | AM_CPPFLAGS = -I$(srcdir)/../../libstreamswitch/include 4 | AM_CXXFLAGS = $(zeromq_CFLAGS) $(protobuf_CFLAGS) $(librtmp_CFLAGS) 5 | AM_LDFLAGS = $(zeromq_LIBS) $(protobuf_LIBS) $(librtmp_LIBS) 6 | 7 | 8 | bin_PROGRAMS = stsw_rtmp_source 9 | 10 | stsw_rtmp_source_SOURCES = src/stsw_rtmp_main.cc \ 11 | src/stsw_rtmp_source.cc \ 12 | src/stsw_rtmp_source.h 13 | 14 | stsw_rtmp_source_LDADD = $(builddir)/../../libstreamswitch/libstreamswitch.la 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /sources/stsw_rtmp_source/src/stsw_rtmp_source.h: -------------------------------------------------------------------------------- 1 | /* 2 | * stsw_rtmp_source.h 3 | * 4 | * Created on: Apr 12, 2015 5 | * Author: hyt 6 | */ 7 | 8 | #ifndef STREAMSWITCH_SOURCES_STSW_RTMP_SOURCE_SRC_STSW_RTMP_SOURCE_H_ 9 | #define STREAMSWITCH_SOURCES_STSW_RTMP_SOURCE_SRC_STSW_RTMP_SOURCE_H_ 10 | 11 | 12 | #include 13 | #include 14 | #include 15 | #include 16 | 17 | #include 18 | #include 19 | #include 20 | 21 | 22 | 23 | class RtmpClientSource: public stream_switch::SourceListener 24 | { 25 | public: 26 | static RtmpClientSource* Instance() 27 | { 28 | if ( NULL == s_instance ) 29 | { 30 | s_instance = new RtmpClientSource(); 31 | } 32 | 33 | return s_instance; 34 | } 35 | 36 | static void Uninstance() 37 | { 38 | if ( NULL != s_instance ) 39 | { 40 | delete s_instance; 41 | s_instance = 0; 42 | } 43 | } 44 | 45 | void SetQuit(); 46 | int Init(std::string stream_name, int source_tcp_port, int queue_size, int debug_flags); 47 | void Uninit(); 48 | int Connect(std::string rtmpUrl); 49 | int HandlePacket(RTMPPacket& packet); 50 | int HandleonMetaData(char *body, unsigned int len); 51 | 52 | void OnKeyFrame(void) {}; 53 | void OnMediaStatistic(stream_switch::MediaStatisticInfo *statistic) {}; 54 | 55 | private: 56 | RtmpClientSource(); 57 | virtual ~RtmpClientSource(); 58 | 59 | static RtmpClientSource * s_instance; 60 | 61 | char quit_; 62 | char metaReady_; 63 | stream_switch::StreamSource source_; 64 | std::string rtmpUrl_; 65 | RTMP* rtmp_; 66 | 67 | }; 68 | 69 | 70 | 71 | #endif /* STREAMSWITCH_SOURCES_STSW_RTMP_SOURCE_SRC_STSW_RTMP_SOURCE_H_ */ 72 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/README.md: -------------------------------------------------------------------------------- 1 | STSW_RTSP_SOURCE 2 | ====================== 3 | 4 | A live StreamSwitch source program with standard RTSP protocol (RFC 2326) support. 5 | 6 | This source make use of a RTSP client to get the Media data from a RTSP server and broadcast them to all subscriber StreamSwitch Sinks 7 | 8 | Currently, this source is based on a modified LIVE555 media library (original version date: 2015.3.19) whose source code is in the thirdparty directory. 9 | LIVE555 media library should be installed under /usr/local/lib and the header files should be install under /usr/local/include/liveMedia. swst_rtsp_source 10 | make use of these path to include the header and lib. 11 | 12 | 13 | ## How to run 14 | ---------------------- 15 | 16 | typing the following command at the STSW_RTSP_SOURCE project's root directory (the directory includes this README.md) 17 | can start up the stsw_rtsp_source daemon at front-ground 18 | 19 | # ./stsw_rtsp_source -s [stream_name] -u [RTSP URL] 20 | 21 | which [stream_name] is the name of the stream published by this source instance, 22 | [RTSP URL] is the RTSP URL to access the remote stream. Besides above, you can get more 23 | options by typing following command. 24 | 25 | #./stsw_rtsp_source -h 26 | 27 | You can send SIGINT/SIGTERM signal to the running process to terminate it. 28 | Also, you can make use of Ctrl+C in the console running stsw_rtsp_source to 29 | terminate it. 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/BasicUsageEnvironment/Makefile.head: -------------------------------------------------------------------------------- 1 | INCLUDES = -Iinclude -I../UsageEnvironment/include -I../groupsock/include 2 | PREFIX = /usr/local 3 | LIBDIR = $(PREFIX)/lib 4 | ##### Change the following for your environment: 5 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/BasicUsageEnvironment/Makefile.tail: -------------------------------------------------------------------------------- 1 | ##### End of variables to change 2 | 3 | NAME = libBasicUsageEnvironment 4 | LIB = $(NAME).$(LIB_SUFFIX) 5 | ALL = $(LIB) 6 | all: $(ALL) 7 | 8 | OBJS = BasicUsageEnvironment0.$(OBJ) BasicUsageEnvironment.$(OBJ) \ 9 | BasicTaskScheduler0.$(OBJ) BasicTaskScheduler.$(OBJ) \ 10 | DelayQueue.$(OBJ) BasicHashTable.$(OBJ) 11 | 12 | libBasicUsageEnvironment.$(LIB_SUFFIX): $(OBJS) 13 | $(LIBRARY_LINK)$@ $(LIBRARY_LINK_OPTS) \ 14 | $(OBJS) 15 | 16 | .$(C).$(OBJ): 17 | $(C_COMPILER) -c $(C_FLAGS) $< 18 | 19 | .$(CPP).$(OBJ): 20 | $(CPLUSPLUS_COMPILER) -c $(CPLUSPLUS_FLAGS) $< 21 | 22 | BasicUsageEnvironment0.$(CPP): include/BasicUsageEnvironment0.hh 23 | include/BasicUsageEnvironment0.hh: include/BasicUsageEnvironment_version.hh include/DelayQueue.hh 24 | BasicUsageEnvironment.$(CPP): include/BasicUsageEnvironment.hh 25 | include/BasicUsageEnvironment.hh: include/BasicUsageEnvironment0.hh 26 | BasicTaskScheduler0.$(CPP): include/BasicUsageEnvironment0.hh include/HandlerSet.hh 27 | BasicTaskScheduler.$(CPP): include/BasicUsageEnvironment.hh include/HandlerSet.hh 28 | DelayQueue.$(CPP): include/DelayQueue.hh 29 | BasicHashTable.$(CPP): include/BasicHashTable.hh 30 | 31 | clean: 32 | -rm -rf *.$(OBJ) $(ALL) core *.core *~ include/*~ 33 | 34 | install: install1 $(INSTALL2) 35 | install1: libBasicUsageEnvironment.$(LIB_SUFFIX) 36 | install -d $(DESTDIR)$(PREFIX)/include/BasicUsageEnvironment $(DESTDIR)$(LIBDIR) 37 | install -m 644 include/*.hh $(DESTDIR)$(PREFIX)/include/BasicUsageEnvironment 38 | install -m 644 libBasicUsageEnvironment.$(LIB_SUFFIX) $(DESTDIR)$(LIBDIR) 39 | install_shared_libraries: libBasicUsageEnvironment.$(LIB_SUFFIX) 40 | ln -s $(NAME).$(LIB_SUFFIX) $(DESTDIR)$(LIBDIR)/$(NAME).$(SHORT_LIB_SUFFIX) 41 | ln -s $(NAME).$(LIB_SUFFIX) $(DESTDIR)$(LIBDIR)/$(NAME).so 42 | 43 | ##### Any additional, platform-specific rules come here: 44 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/BasicUsageEnvironment/include/BasicUsageEnvironment_version.hh: -------------------------------------------------------------------------------- 1 | // Version information for the "BasicUsageEnvironment" library 2 | // Copyright (c) 1996-2015 Live Networks, Inc. All rights reserved. 3 | 4 | #ifndef _BASICUSAGEENVIRONMENT_VERSION_HH 5 | #define _BASICUSAGEENVIRONMENT_VERSION_HH 6 | 7 | #define BASICUSAGEENVIRONMENT_LIBRARY_VERSION_STRING "2015.03.19" 8 | #define BASICUSAGEENVIRONMENT_LIBRARY_VERSION_INT 1426723200 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/Makefile.head: -------------------------------------------------------------------------------- 1 | ##### Change the following for your environment: 2 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/Makefile.tail: -------------------------------------------------------------------------------- 1 | ##### End of variables to change 2 | 3 | LIVEMEDIA_DIR = liveMedia 4 | GROUPSOCK_DIR = groupsock 5 | USAGE_ENVIRONMENT_DIR = UsageEnvironment 6 | BASIC_USAGE_ENVIRONMENT_DIR = BasicUsageEnvironment 7 | 8 | TESTPROGS_DIR = testProgs 9 | 10 | MEDIA_SERVER_DIR = mediaServer 11 | 12 | PROXY_SERVER_DIR = proxyServer 13 | 14 | all: 15 | cd $(LIVEMEDIA_DIR) ; $(MAKE) 16 | cd $(GROUPSOCK_DIR) ; $(MAKE) 17 | cd $(USAGE_ENVIRONMENT_DIR) ; $(MAKE) 18 | cd $(BASIC_USAGE_ENVIRONMENT_DIR) ; $(MAKE) 19 | # STREAM_SWITCH 20 | # don't make unused component 21 | # cd $(TESTPROGS_DIR) ; $(MAKE) 22 | # cd $(MEDIA_SERVER_DIR) ; $(MAKE) 23 | # cd $(PROXY_SERVER_DIR) ; $(MAKE) 24 | 25 | install: 26 | cd $(LIVEMEDIA_DIR) ; $(MAKE) install 27 | cd $(GROUPSOCK_DIR) ; $(MAKE) install 28 | cd $(USAGE_ENVIRONMENT_DIR) ; $(MAKE) install 29 | cd $(BASIC_USAGE_ENVIRONMENT_DIR) ; $(MAKE) install 30 | # STREAM_SWITCH 31 | # don't make unused component 32 | # cd $(TESTPROGS_DIR) ; $(MAKE) install 33 | # cd $(MEDIA_SERVER_DIR) ; $(MAKE) install 34 | # cd $(PROXY_SERVER_DIR) ; $(MAKE) install 35 | 36 | clean: 37 | cd $(LIVEMEDIA_DIR) ; $(MAKE) clean 38 | cd $(GROUPSOCK_DIR) ; $(MAKE) clean 39 | cd $(USAGE_ENVIRONMENT_DIR) ; $(MAKE) clean 40 | cd $(BASIC_USAGE_ENVIRONMENT_DIR) ; $(MAKE) clean 41 | # STREAM_SWITCH 42 | # don't make unused component 43 | # cd $(TESTPROGS_DIR) ; $(MAKE) clean 44 | # cd $(MEDIA_SERVER_DIR) ; $(MAKE) clean 45 | # cd $(PROXY_SERVER_DIR) ; $(MAKE) clean 46 | 47 | distclean: clean 48 | -rm -f $(LIVEMEDIA_DIR)/Makefile $(GROUPSOCK_DIR)/Makefile \ 49 | $(USAGE_ENVIRONMENT_DIR)/Makefile $(BASIC_USAGE_ENVIRONMENT_DIR)/Makefile \ 50 | $(TESTPROGS_DIR)/Makefile $(MEDIA_SERVER_DIR)/Makefile \ 51 | $(PROXY_SERVER_DIR)/Makefile Makefile 52 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/README: -------------------------------------------------------------------------------- 1 | For documentation and instructions for building this software, 2 | see 3 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/README.stream_switch: -------------------------------------------------------------------------------- 1 | live.2015.3.19 with StreamSwitch Patch. 2 | 3 | 4 | This directory contains the live555 media library (live.2015.3.19) with StreamSwitch Patch. 5 | 6 | StreamSwitch make use of the live555 media library with its private patch for its rtsp source. The RTSP client of the original live555 media library is not very suitable for the real application environment, in which the RTSP server often contains various error in its RTSP protocol. And, live555's RTSP client also contains some hidden bugs which would be exposed for some real world case. To adapt for the imperfect world, StreamSwitch make its amendment based on the live555 media library project at this directory. 7 | 8 | 9 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/UsageEnvironment/HashTable.cpp: -------------------------------------------------------------------------------- 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 2.1 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-2015 Live Networks, Inc. All rights reserved. 17 | // Generic Hash Table 18 | // Implementation 19 | 20 | #include "HashTable.hh" 21 | 22 | HashTable::HashTable() { 23 | } 24 | 25 | HashTable::~HashTable() { 26 | } 27 | 28 | HashTable::Iterator::Iterator() { 29 | } 30 | 31 | HashTable::Iterator::~Iterator() {} 32 | 33 | void* HashTable::RemoveNext() { 34 | Iterator* iter = Iterator::create(*this); 35 | char const* key; 36 | void* removedValue = iter->next(key); 37 | if (removedValue != 0) Remove(key); 38 | 39 | delete iter; 40 | return removedValue; 41 | } 42 | 43 | void* HashTable::getFirst() { 44 | Iterator* iter = Iterator::create(*this); 45 | char const* key; 46 | void* firstValue = iter->next(key); 47 | 48 | delete iter; 49 | return firstValue; 50 | } 51 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/UsageEnvironment/Makefile.head: -------------------------------------------------------------------------------- 1 | INCLUDES = -Iinclude -I../groupsock/include 2 | PREFIX = /usr/local 3 | LIBDIR = $(PREFIX)/lib 4 | ##### Change the following for your environment: 5 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/UsageEnvironment/Makefile.tail: -------------------------------------------------------------------------------- 1 | ##### End of variables to change 2 | 3 | NAME = libUsageEnvironment 4 | USAGE_ENVIRONMENT_LIB = $(NAME).$(LIB_SUFFIX) 5 | ALL = $(USAGE_ENVIRONMENT_LIB) 6 | all: $(ALL) 7 | 8 | OBJS = UsageEnvironment.$(OBJ) HashTable.$(OBJ) strDup.$(OBJ) 9 | 10 | $(USAGE_ENVIRONMENT_LIB): $(OBJS) 11 | $(LIBRARY_LINK)$@ $(LIBRARY_LINK_OPTS) $(OBJS) 12 | 13 | .$(C).$(OBJ): 14 | $(C_COMPILER) -c $(C_FLAGS) $< 15 | 16 | .$(CPP).$(OBJ): 17 | $(CPLUSPLUS_COMPILER) -c $(CPLUSPLUS_FLAGS) $< 18 | 19 | UsageEnvironment.$(CPP): include/UsageEnvironment.hh 20 | include/UsageEnvironment.hh: include/UsageEnvironment_version.hh include/Boolean.hh include/strDup.hh 21 | HashTable.$(CPP): include/HashTable.hh 22 | include/HashTable.hh: include/Boolean.hh 23 | strDup.$(CPP): include/strDup.hh 24 | 25 | clean: 26 | -rm -rf *.$(OBJ) $(ALL) core *.core *~ include/*~ 27 | 28 | install: install1 $(INSTALL2) 29 | install1: $(USAGE_ENVIRONMENT_LIB) 30 | install -d $(DESTDIR)$(PREFIX)/include/UsageEnvironment $(DESTDIR)$(LIBDIR) 31 | install -m 644 include/*.hh $(DESTDIR)$(PREFIX)/include/UsageEnvironment 32 | install -m 644 $(USAGE_ENVIRONMENT_LIB) $(DESTDIR)$(LIBDIR) 33 | install_shared_libraries: $(USAGE_ENVIRONMENT_LIB) 34 | ln -s $(NAME).$(LIB_SUFFIX) $(DESTDIR)$(LIBDIR)/$(NAME).$(SHORT_LIB_SUFFIX) 35 | ln -s $(NAME).$(LIB_SUFFIX) $(DESTDIR)$(LIBDIR)/$(NAME).so 36 | 37 | ##### Any additional, platform-specific rules come here: 38 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/UsageEnvironment/include/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 2.1 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 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/UsageEnvironment/include/UsageEnvironment_version.hh: -------------------------------------------------------------------------------- 1 | // Version information for the "UsageEnvironment" library 2 | // Copyright (c) 1996-2015 Live Networks, Inc. All rights reserved. 3 | 4 | #ifndef _USAGEENVIRONMENT_VERSION_HH 5 | #define _USAGEENVIRONMENT_VERSION_HH 6 | 7 | #define USAGEENVIRONMENT_LIBRARY_VERSION_STRING "2015.03.19" 8 | #define USAGEENVIRONMENT_LIBRARY_VERSION_INT 1426723200 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/UsageEnvironment/include/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 2.1 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-2015 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 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/UsageEnvironment/strDup.cpp: -------------------------------------------------------------------------------- 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 2.1 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-2015 Live Networks, Inc. All rights reserved. 17 | // A C++ equivalent to the standard C routine "strdup()". 18 | // This generates a char* that can be deleted using "delete[]" 19 | // Implementation 20 | 21 | #include "strDup.hh" 22 | 23 | char* strDup(char const* str) { 24 | if (str == NULL) return NULL; 25 | size_t len = strlen(str) + 1; 26 | char* copy = new char[len]; 27 | 28 | if (copy != NULL) { 29 | memcpy(copy, str, len); 30 | } 31 | return copy; 32 | } 33 | 34 | char* strDupSize(char const* str) { 35 | size_t dummy; 36 | 37 | return strDupSize(str, dummy); 38 | } 39 | 40 | char* strDupSize(char const* str, size_t& resultBufSize) { 41 | if (str == NULL) { 42 | resultBufSize = 0; 43 | return NULL; 44 | } 45 | 46 | resultBufSize = strlen(str) + 1; 47 | char* copy = new char[resultBufSize]; 48 | 49 | return copy; 50 | } 51 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/VERSION: -------------------------------------------------------------------------------- 1 | live.2015.03.19 2 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/WindowsAudioInputDevice/showAudioInputPorts.cpp: -------------------------------------------------------------------------------- 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 2.1 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-2015, Live Networks, Inc. All rights reserved 17 | // A program that prints out this computer's audio input ports 18 | 19 | #include "AudioInputDevice.hh" 20 | #include 21 | 22 | int main(int argc, char** argv) { 23 | AudioPortNames* portNames = AudioInputDevice::getPortNames(); 24 | if (portNames == NULL) { 25 | fprintf(stderr, "AudioInputDevice::getPortNames() failed!\n"); 26 | exit(1); 27 | } 28 | 29 | printf("%d available audio input ports:\n", portNames->numPorts); 30 | for (unsigned i = 0; i < portNames->numPorts; ++i) { 31 | printf("%d\t%s\n", i, portNames->portName[i]); 32 | } 33 | 34 | return 0; 35 | } 36 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/config.aix: -------------------------------------------------------------------------------- 1 | COMPILE_OPTS = $(INCLUDES) -I. -DBSD=1 -O -DTIME_BASE=int -DSOCKLEN_T=socklen_t 2 | C = c 3 | C_COMPILER = cc 4 | C_FLAGS = $(COMPILE_OPTS) 5 | CPP = cpp 6 | CPLUSPLUS_COMPILER = c++ 7 | CPLUSPLUS_FLAGS = $(COMPILE_OPTS) -Wall -DAIX=1 8 | OBJ = o 9 | LINK = c++ -o 10 | LINK_OPTS = -L. 11 | CONSOLE_LINK_OPTS = $(LINK_OPTS) 12 | LIBRARY_LINK = ld -o 13 | LIBRARY_LINK_OPTS = $(LINK_OPTS) -r 14 | LIB_SUFFIX = a 15 | LIBS_FOR_CONSOLE_APPLICATION = 16 | LIBS_FOR_GUI_APPLICATION = 17 | EXE = 18 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/config.alpha: -------------------------------------------------------------------------------- 1 | COMPILE_OPTS = $(INCLUDES) -I. -O -DTIME_BASE=int 2 | C = c 3 | C_COMPILER = cc 4 | C_FLAGS = $(COMPILE_OPTS) -DALPHA 5 | CPP = cpp 6 | CPLUSPLUS_COMPILER = c++ 7 | CPLUSPLUS_FLAGS = $(COMPILE_OPTS) -Wall -DBSD=1 -DALPHA 8 | OBJ = o 9 | LINK = c++ -o 10 | LINK_OPTS = -L. 11 | CONSOLE_LINK_OPTS = $(LINK_OPTS) 12 | LIBRARY_LINK = ld -o 13 | LIBRARY_LINK_OPTS = $(LINK_OPTS) -r -B static 14 | LIB_SUFFIX = a 15 | LIBS_FOR_CONSOLE_APPLICATION = 16 | LIBS_FOR_GUI_APPLICATION = 17 | EXE = 18 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/config.armeb-uclibc: -------------------------------------------------------------------------------- 1 | CROSS_COMPILE= armeb-linux-uclibc- 2 | COMPILE_OPTS = $(INCLUDES) -I. -Os -DSOCKLEN_T=socklen_t -DNO_SSTREAM=1 -D 3 | LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64 4 | C = c 5 | C_COMPILER = $(CROSS_COMPILE)gcc 6 | C_FLAGS = $(COMPILE_OPTS) 7 | CPP = cpp 8 | CPLUSPLUS_COMPILER = $(CROSS_COMPILE)g++ 9 | CPLUSPLUS_FLAGS = $(COMPILE_OPTS) -Wall -DBSD=1 10 | OBJ = o 11 | LINK = $(CROSS_COMPILE)gcc -o 12 | LINK_OPTS = -L. 13 | CONSOLE_LINK_OPTS = $(LINK_OPTS) 14 | LIBRARY_LINK = $(CROSS_COMPILE)ar cr 15 | LIBRARY_LINK_OPTS = 16 | LIB_SUFFIX = a 17 | LIBS_FOR_CONSOLE_APPLICATION = 18 | LIBS_FOR_GUI_APPLICATION = 19 | EXE = 20 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/config.armlinux: -------------------------------------------------------------------------------- 1 | CROSS_COMPILE?= arm-elf- 2 | COMPILE_OPTS = $(INCLUDES) -I. -O2 -DSOCKLEN_T=socklen_t -DNO_SSTREAM=1 -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64 3 | C = c 4 | C_COMPILER = $(CROSS_COMPILE)gcc 5 | C_FLAGS = $(COMPILE_OPTS) 6 | CPP = cpp 7 | CPLUSPLUS_COMPILER = $(CROSS_COMPILE)g++ 8 | CPLUSPLUS_FLAGS = $(COMPILE_OPTS) -Wall -DBSD=1 9 | OBJ = o 10 | LINK = $(CROSS_COMPILE)g++ -o 11 | LINK_OPTS = 12 | CONSOLE_LINK_OPTS = $(LINK_OPTS) 13 | LIBRARY_LINK = $(CROSS_COMPILE)ar cr 14 | LIBRARY_LINK_OPTS = $(LINK_OPTS) 15 | LIB_SUFFIX = a 16 | LIBS_FOR_CONSOLE_APPLICATION = 17 | LIBS_FOR_GUI_APPLICATION = 18 | EXE = 19 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/config.avr32-linux: -------------------------------------------------------------------------------- 1 | CROSS_COMPILE= avr32-linux-uclibc- 2 | COMPILE_OPTS = -Os $(INCLUDES) -msoft-float -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -DSOCKLEN_T=socklen_t -DNO_SSTREAM=1 C = c 3 | C_COMPILER = $(CROSS_COMPILE)gcc 4 | C_FLAGS = $(COMPILE_OPTS) 5 | CPP = cpp 6 | CPLUSPLUS_COMPILER = $(CROSS_COMPILE)c++ 7 | CPLUSPLUS_FLAGS = $(COMPILE_OPTS) -Wall -fuse-cxa-atexit -DBSD=1 OBJ = o 8 | LINK = $(CROSS_COMPILE)c++ -o 9 | LINK_OPTS = 10 | CONSOLE_LINK_OPTS = $(LINK_OPTS) 11 | LIBRARY_LINK = $(CROSS_COMPILE)ar cr LIBRARY_LINK_OPTS = 12 | LIB_SUFFIX = a 13 | LIBS_FOR_CONSOLE_APPLICATION = 14 | LIBS_FOR_GUI_APPLICATION = 15 | EXE = 16 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/config.bfin-linux-uclibc: -------------------------------------------------------------------------------- 1 | CROSS_COMPILER = bfin-linux-uclibc- 2 | COMPILE_OPTS = $(INCLUDES) -I. -DSOCKLEN_T=socklen_t -D_LARGEFILE_SOURCE=1 -DUCLINUX -D_FILE_OFFSET_BITS=64 3 | C = c 4 | C_COMPILER = $(CROSS_COMPILER)gcc 5 | C_FLAGS = $(COMPILE_OPTS) -Wall 6 | CPP = cpp 7 | CPLUSPLUS_COMPILER = $(CROSS_COMPILER)g++ 8 | CPLUSPLUS_FLAGS = $(COMPILE_OPTS) -Wall 9 | OBJ = o 10 | LINK = $(CROSS_COMPILER)g++ -o 11 | LINK_OPTS = -L. 12 | CONSOLE_LINK_OPTS = $(LINK_OPTS) 13 | LIBRARY_LINK = $(CROSS_COMPILER)ar cr 14 | LIBRARY_LINK_OPTS = 15 | LIB_SUFFIX = a 16 | LIBS_FOR_CONSOLE_APPLICATION = 17 | LIBS_FOR_GUI_APPLICATION = 18 | EXE = 19 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/config.bfin-uclinux: -------------------------------------------------------------------------------- 1 | CROSS_COMPILER= bfin-uclinux- 2 | COMPILE_OPTS = $(INCLUDES) -I. -DSOCKLEN_T=socklen_t -D_LARGEFILE_SOURCE=1 -DUCLINUX -D_FILE_OFFSET_BITS=64 3 | C = c 4 | C_COMPILER = $(CROSS_COMPILER)gcc 5 | C_FLAGS = $(COMPILE_OPTS) -Wall 6 | CPP = cpp 7 | CPLUSPLUS_COMPILER = $(CROSS_COMPILER)g++ 8 | CPLUSPLUS_FLAGS = $(COMPILE_OPTS) -Wall 9 | OBJ = o 10 | LINK = $(CROSS_COMPILER)g++ -Wl,-elf2flt -o 11 | LINK_OPTS = -L. 12 | CONSOLE_LINK_OPTS = $(LINK_OPTS) 13 | LIBRARY_LINK = $(CROSS_COMPILER)ar cr 14 | LIBRARY_LINK_OPTS = 15 | LIB_SUFFIX = a 16 | LIBS_FOR_CONSOLE_APPLICATION = 17 | LIBS_FOR_GUI_APPLICATION = 18 | EXE = 19 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/config.bsplinux: -------------------------------------------------------------------------------- 1 | CROSS_COMPILE= 2 | COMPILE_OPTS = $(INCLUDES) -I. -O2 -DSOCKLEN_T=socklen_t -DNO_SSTREAM=1 -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64 3 | C = c 4 | C_COMPILER = $(CROSS_COMPILE)ecc 5 | C_FLAGS = $(COMPILE_OPTS) 6 | CPP = cpp 7 | CPLUSPLUS_COMPILER = $(CROSS_COMPILE)e++ 8 | CPLUSPLUS_FLAGS = $(COMPILE_OPTS) -Wall -DBSD=1 9 | OBJ = o 10 | LINK = $(CROSS_COMPILE)e++ -o 11 | LINK_OPTS = -L. 12 | CONSOLE_LINK_OPTS = $(LINK_OPTS) 13 | LIBRARY_LINK = $(CROSS_COMPILE)eld -o 14 | LIBRARY_LINK_OPTS = $(LINK_OPTS) -r -Bstatic 15 | LIB_SUFFIX = a 16 | LIBS_FOR_CONSOLE_APPLICATION = -lm 17 | LIBS_FOR_GUI_APPLICATION = 18 | EXE = 19 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/config.cris-axis-linux-gnu: -------------------------------------------------------------------------------- 1 | # Note: AXIS_TOP_DIR is assumed to already be set in your environment. 2 | # You can set this using the "init_env" script. 3 | # See http://developer.axis.com/doc/software/apps/apps-howto.html 4 | # for more information. 5 | AXIS_DIR = $(AXIS_TOP_DIR)/target/cris-axis-linux-gnu 6 | COMPILE_OPTS = $(INCLUDES) -I. -mlinux -isystem $(AXIS_DIR)/include -Wall -O2 -DSOCKLEN_T=socklen_t -DCRIS -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64 7 | C = c 8 | C_COMPILER = gcc-cris 9 | C_FLAGS = $(COMPILE_OPTS) 10 | CPP = cpp 11 | CPLUSPLUS_COMPILER = c++-cris 12 | CPLUSPLUS_FLAGS = $(COMPILE_OPTS) -Wno-ctor-dtor-privacy -ansi -pipe 13 | OBJ = o 14 | LINK = c++-cris -static -o 15 | AXIS_LINK_OPTS = -L$(AXIS_DIR)/lib 16 | LINK_OPTS = -L. 17 | CONSOLE_LINK_OPTS = $(LINK_OPTS) -L$(AXIS_DIR)/lib -mlinux 18 | LIBRARY_LINK = ld-cris -mcrislinux -o 19 | LIBRARY_LINK_OPTS = $(LINK_OPTS) -r -Bstatic 20 | LIB_SUFFIX = a 21 | LIBS_FOR_CONSOLE_APPLICATION = 22 | LIBS_FOR_GUI_APPLICATION = 23 | EXE = 24 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/config.cygwin: -------------------------------------------------------------------------------- 1 | COMPILE_OPTS = $(INCLUDES) -I. -O -DSOCKLEN_T=socklen_t -DXLOCALE_NOT_USED=1 2 | C = c 3 | C_COMPILER = gcc 4 | C_FLAGS = $(COMPILE_OPTS) -DUSE_OUR_BZERO=1 -D__CYGWIN__ 5 | CPP = cpp 6 | CPLUSPLUS_COMPILER = c++ 7 | CPLUSPLUS_FLAGS = $(COMPILE_OPTS) -Wall -DBSD=1 8 | OBJ = o 9 | LINK = c++ -o 10 | LINK_OPTS = -L. 11 | CONSOLE_LINK_OPTS = $(LINK_OPTS) 12 | LIBRARY_LINK = ld -o 13 | LIBRARY_LINK_OPTS = $(LINK_OPTS) -r -Bstatic 14 | LIB_SUFFIX = a 15 | LIBS_FOR_CONSOLE_APPLICATION = 16 | LIBS_FOR_GUI_APPLICATION = 17 | EXE = 18 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/config.cygwin-for-vlc: -------------------------------------------------------------------------------- 1 | COMPILE_OPTS = $(INCLUDES) -I. -O -DSOCKLEN_T=socklen_t -DXLOCALE_NOT_USED=1 2 | C = c 3 | C_COMPILER = gcc 4 | C_FLAGS = $(COMPILE_OPTS) -DUSE_OUR_BZERO=1 -D_WIN32 -mno-cygwin 5 | CPP = cpp 6 | CPLUSPLUS_COMPILER = c++ 7 | CPLUSPLUS_FLAGS = $(COMPILE_OPTS) -Wall -DBSD=1 -D_WIN32 -Wno-deprecated -mno-cygwin 8 | OBJ = o 9 | LINK = c++ -o 10 | LINK_OPTS = -L. 11 | CONSOLE_LINK_OPTS = $(LINK_OPTS) 12 | LIBRARY_LINK = ld -o 13 | LIBRARY_LINK_OPTS = $(LINK_OPTS) -r -Bstatic 14 | LIB_SUFFIX = a 15 | LIBS_FOR_CONSOLE_APPLICATION = 16 | LIBS_FOR_GUI_APPLICATION = 17 | EXE = 18 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/config.freebsd: -------------------------------------------------------------------------------- 1 | COMPILE_OPTS = $(INCLUDES) -I. -O -DBSD=1 -DXLOCALE_NOT_USED=1 -DSOCKLEN_T=socklen_t -DHAVE_SOCKADDR_LEN=1 2 | C = c 3 | C_COMPILER = cc 4 | C_FLAGS = $(COMPILE_OPTS) 5 | CPP = cpp 6 | CPLUSPLUS_COMPILER = c++ 7 | CPLUSPLUS_FLAGS = $(COMPILE_OPTS) -Wall 8 | OBJ = o 9 | LINK = c++ -o 10 | LINK_OPTS = -L. 11 | CONSOLE_LINK_OPTS = $(LINK_OPTS) 12 | LIBRARY_LINK = ar cr 13 | LIBRARY_LINK_OPTS = 14 | LIB_SUFFIX = a 15 | LIBS_FOR_CONSOLE_APPLICATION = 16 | LIBS_FOR_GUI_APPLICATION = 17 | EXE = 18 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/config.iphone-simulator: -------------------------------------------------------------------------------- 1 | # **Note: You must install the relevant "Command line tools (OSX *.*) for Xcode - Xcode *.*" 2 | # for this configuration file to work. 3 | 4 | # Change the following version number, if necessary, before running "genMakefiles iphone-simulator" 5 | IOS_VERSION = 8.1 6 | MIN_IOS_VERSION = 7.0 7 | 8 | DEVELOPER_PATH = /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer 9 | TOOL_PATH = $(DEVELOPER_PATH)/usr/bin 10 | SDK_PATH = $(DEVELOPER_PATH)/SDKs 11 | SDK = $(SDK_PATH)/iPhoneSimulator$(IOS_VERSION).sdk 12 | COMPILE_OPTS = $(INCLUDES) -I. $(EXTRA_LDFLAGS) -DBSD=1 -O2 -DSOCKLEN_T=socklen_t -DHAVE_SOCKADDR_LEN=1 -miphoneos-version-min=$(MIN_IOS_VERSION) -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64 -fPIC -arch i386 --sysroot=$(SDK) -isysroot $(SDK) 13 | C = c 14 | C_COMPILER = /usr/bin/xcrun clang 15 | C_FLAGS = $(COMPILE_OPTS) 16 | CPP = cpp 17 | CPLUSPLUS_COMPILER = /usr/bin/xcrun clang 18 | CPLUSPLUS_FLAGS = $(COMPILE_OPTS) -Wall 19 | OBJ = o 20 | LINK = /usr/bin/xcrun clang -o 21 | LINK_OPTS = -L. -arch i386 -miphoneos-version-min=$(MIN_IOS_VERSION) --sysroot=$(SDK) -isysroot -L$(SDK)/usr/lib/system -I$(SDK)/usr/lib /usr/lib/libc++.dylib 22 | CONSOLE_LINK_OPTS = $(LINK_OPTS) 23 | LIBRARY_LINK = libtool -s -o 24 | LIBRARY_LINK_OPTS = 25 | LIB_SUFFIX = a 26 | LIBS_FOR_CONSOLE_APPLICATION = 27 | LIBS_FOR_GUI_APPLICATION = 28 | EXE = 29 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/config.iphoneos: -------------------------------------------------------------------------------- 1 | # **Note: You must install the relevant "Command line tools (OSX *.*) for Xcode - Xcode *.*" 2 | # for this configuration file to work. 3 | # 4 | # Change the following version number, if necessary, before running "genMakefiles iphoneos" 5 | IOS_VERSION = 8.1 6 | 7 | DEVELOPER_PATH = /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer 8 | TOOL_PATH = $(DEVELOPER_PATH)/usr/bin 9 | SDK_PATH = $(DEVELOPER_PATH)/SDKs 10 | SDK = $(SDK_PATH)/iPhoneOS$(IOS_VERSION).sdk 11 | COMPILE_OPTS = $(INCLUDES) -I. $(EXTRA_LDFLAGS) -DBSD=1 -O2 -DSOCKLEN_T=socklen_t -DHAVE_SOCKADDR_LEN=1 -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64 -fPIC -arch armv7 --sysroot=$(SDK) 12 | C = c 13 | C_COMPILER = /usr/bin/xcrun clang 14 | C_FLAGS = $(COMPILE_OPTS) 15 | CPP = cpp 16 | CPLUSPLUS_COMPILER = /usr/bin/xcrun clang 17 | CPLUSPLUS_FLAGS = $(COMPILE_OPTS) -Wall 18 | OBJ = o 19 | LINK = /usr/bin/xcrun clang -o 20 | LINK_OPTS = -v -L. -arch armv7 --sysroot=$(SDK) -L$(SDK)/usr/lib/system /usr/lib/libc++.dylib 21 | CONSOLE_LINK_OPTS = $(LINK_OPTS) 22 | LIBRARY_LINK = libtool -s -o 23 | LIBRARY_LINK_OPTS = 24 | LIB_SUFFIX = a 25 | LIBS_FOR_CONSOLE_APPLICATION = 26 | LIBS_FOR_GUI_APPLICATION = 27 | EXE = 28 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/config.irix: -------------------------------------------------------------------------------- 1 | COMPILE_OPTS = $(INCLUDES) -I. -O 2 | C = c 3 | C_COMPILER = cc 4 | C_FLAGS = $(COMPILE_OPTS) -DIRIX 5 | CPP = cpp 6 | CPLUSPLUS_COMPILER = c++ 7 | CPLUSPLUS_FLAGS = $(COMPILE_OPTS) -Wall -DIRIX 8 | OBJ = o 9 | LINK = c++ -o 10 | LINK_OPTS = -L. 11 | CONSOLE_LINK_OPTS = $(LINK_OPTS) 12 | LIBRARY_LINK = ld -o 13 | LIBRARY_LINK_OPTS = $(LINK_OPTS) -r -B static 14 | LIB_SUFFIX = a 15 | LIBS_FOR_CONSOLE_APPLICATION = 16 | LIBS_FOR_GUI_APPLICATION = 17 | EXE = 18 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/config.linux: -------------------------------------------------------------------------------- 1 | COMPILE_OPTS = $(INCLUDES) -I. -O2 -DSOCKLEN_T=socklen_t -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64 2 | C = c 3 | C_COMPILER = cc 4 | C_FLAGS = $(COMPILE_OPTS) $(CPPFLAGS) $(CFLAGS) 5 | CPP = cpp 6 | CPLUSPLUS_COMPILER = c++ 7 | CPLUSPLUS_FLAGS = $(COMPILE_OPTS) -Wall -DBSD=1 $(CPPFLAGS) $(CXXFLAGS) 8 | OBJ = o 9 | LINK = c++ -o 10 | LINK_OPTS = -L. $(LDFLAGS) 11 | CONSOLE_LINK_OPTS = $(LINK_OPTS) 12 | LIBRARY_LINK = ar cr 13 | LIBRARY_LINK_OPTS = 14 | LIB_SUFFIX = a 15 | LIBS_FOR_CONSOLE_APPLICATION = 16 | LIBS_FOR_GUI_APPLICATION = 17 | EXE = 18 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/config.linux-64bit: -------------------------------------------------------------------------------- 1 | COMPILE_OPTS = $(INCLUDES) -m64 -fPIC -I. -O2 -DSOCKLEN_T=socklen_t -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64 2 | C = c 3 | C_COMPILER = cc 4 | C_FLAGS = $(COMPILE_OPTS) 5 | CPP = cpp 6 | CPLUSPLUS_COMPILER = c++ 7 | CPLUSPLUS_FLAGS = $(COMPILE_OPTS) -Wall -DBSD=1 8 | OBJ = o 9 | LINK = c++ -o 10 | LINK_OPTS = -L. 11 | CONSOLE_LINK_OPTS = $(LINK_OPTS) 12 | LIBRARY_LINK = ar cr 13 | LIBRARY_LINK_OPTS = 14 | LIB_SUFFIX = a 15 | LIBS_FOR_CONSOLE_APPLICATION = 16 | LIBS_FOR_GUI_APPLICATION = 17 | EXE = 18 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/config.linux-gdb: -------------------------------------------------------------------------------- 1 | COMPILE_OPTS = $(INCLUDES) -I. -O -DSOCKLEN_T=socklen_t -g -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64 2 | C = c 3 | C_COMPILER = cc 4 | C_FLAGS = $(COMPILE_OPTS) 5 | CPP = cpp 6 | CPLUSPLUS_COMPILER = c++ 7 | CPLUSPLUS_FLAGS = $(COMPILE_OPTS) -Wall -DBSD=1 8 | OBJ = o 9 | LINK = c++ -o 10 | LINK_OPTS = -L. 11 | CONSOLE_LINK_OPTS = $(LINK_OPTS) 12 | LIBRARY_LINK = ar cr 13 | LIBRARY_LINK_OPTS = 14 | LIB_SUFFIX = a 15 | LIBS_FOR_CONSOLE_APPLICATION = 16 | LIBS_FOR_GUI_APPLICATION = 17 | EXE = 18 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/config.macosx: -------------------------------------------------------------------------------- 1 | COMPILE_OPTS = $(INCLUDES) -I. $(EXTRA_LDFLAGS) -DBSD=1 -O -DSOCKLEN_T=socklen_t -DHAVE_SOCKADDR_LEN=1 -DTIME_BASE=int 2 | C = c 3 | C_COMPILER = cc 4 | C_FLAGS = $(COMPILE_OPTS) 5 | CPP = cpp 6 | CPLUSPLUS_COMPILER = c++ 7 | CPLUSPLUS_FLAGS = $(COMPILE_OPTS) -Wall 8 | OBJ = o 9 | LINK = c++ -o 10 | LINK_OPTS = -L. 11 | CONSOLE_LINK_OPTS = $(LINK_OPTS) 12 | LIBRARY_LINK = libtool -s -o 13 | LIBRARY_LINK_OPTS = 14 | LIB_SUFFIX = a 15 | LIBS_FOR_CONSOLE_APPLICATION = 16 | LIBS_FOR_GUI_APPLICATION = 17 | EXE = 18 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/config.macosx-32bit: -------------------------------------------------------------------------------- 1 | COMPILE_OPTS = -m32 $(INCLUDES) -I. $(EXTRA_LDFLAGS) -DBSD=1 -O -DSOCKLEN_T=socklen_t -DHAVE_SOCKADDR_LEN=1 -DTIME_BASE=int 2 | C = c 3 | C_COMPILER = cc 4 | C_FLAGS = $(COMPILE_OPTS) 5 | CPP = cpp 6 | CPLUSPLUS_COMPILER = c++ 7 | CPLUSPLUS_FLAGS = $(COMPILE_OPTS) -Wall 8 | OBJ = o 9 | LINK = c++ -o 10 | LINK_OPTS = -L. -m32 11 | CONSOLE_LINK_OPTS = $(LINK_OPTS) 12 | LIBRARY_LINK = libtool -s -o 13 | LIBRARY_LINK_OPTS = 14 | LIB_SUFFIX = a 15 | LIBS_FOR_CONSOLE_APPLICATION = 16 | LIBS_FOR_GUI_APPLICATION = 17 | EXE = 18 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/config.macosx-before-version-10.4: -------------------------------------------------------------------------------- 1 | COMPILE_OPTS = $(INCLUDES) -I. -DBSD=1 -O -DSOCKLEN_T=int -DTIME_BASE=int 2 | C = c 3 | C_COMPILER = cc 4 | C_FLAGS = $(COMPILE_OPTS) 5 | CPP = cpp 6 | CPLUSPLUS_COMPILER = c++ 7 | CPLUSPLUS_FLAGS = $(COMPILE_OPTS) -Wall 8 | OBJ = o 9 | LINK = c++ -o 10 | LINK_OPTS = -L. 11 | CONSOLE_LINK_OPTS = $(LINK_OPTS) 12 | LIBRARY_LINK = ld -o 13 | LIBRARY_LINK_OPTS = $(LINK_OPTS) -r 14 | LIB_SUFFIX = a 15 | LIBS_FOR_CONSOLE_APPLICATION = 16 | LIBS_FOR_GUI_APPLICATION = 17 | EXE = 18 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/config.mingw: -------------------------------------------------------------------------------- 1 | COMPILE_OPTS = $(INCLUDES) -I. -O -DSOCKLEN_T=int -DLOCALE_NOT_USED 2 | C = c 3 | C_COMPILER = $(CC) 4 | C_FLAGS = $(COMPILE_OPTS) -DUSE_OUR_BZERO=1 -D__MINGW32__ 5 | CPP = cpp 6 | CPLUSPLUS_COMPILER = $(CXX) 7 | CPLUSPLUS_FLAGS = $(COMPILE_OPTS) -D__MINGW32__ -Wall -Wno-deprecated 8 | OBJ = o 9 | LINK = $(CXX) -o 10 | LINK_OPTS = -L. 11 | CONSOLE_LINK_OPTS = $(LINK_OPTS) 12 | LIBRARY_LINK = $(LD) -o 13 | LIBRARY_LINK_OPTS = $(LINK_OPTS) -r -Bstatic 14 | LIB_SUFFIX = a 15 | LIBS_FOR_CONSOLE_APPLICATION = -lws2_32 16 | LIBS_FOR_GUI_APPLICATION = -lws2_32 17 | EXE = 18 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/config.openbsd: -------------------------------------------------------------------------------- 1 | .SUFFIXES: .cpp 2 | COMPILE_OPTS = $(INCLUDES) -I. -DBSD=1 -O -DSOCKLEN_T=socklen_t 3 | C = c 4 | C_COMPILER = cc 5 | C_FLAGS = $(COMPILE_OPTS) 6 | CPP = cpp 7 | CPLUSPLUS_COMPILER = c++ 8 | CPLUSPLUS_FLAGS = $(COMPILE_OPTS) -Wall -DAIX=1 9 | OBJ = o 10 | LINK = c++ -o 11 | LINK_OPTS = -L. 12 | CONSOLE_LINK_OPTS = $(LINK_OPTS) 13 | LIBRARY_LINK = ld -o 14 | LIBRARY_LINK_OPTS = $(LINK_OPTS) -r 15 | LIB_SUFFIX = a 16 | LIBS_FOR_CONSOLE_APPLICATION = 17 | LIBS_FOR_GUI_APPLICATION = 18 | EXE = 19 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/config.qnx4: -------------------------------------------------------------------------------- 1 | # 2 | # Requires: 3 | # QNX 4.25 4 | # Watcom 10.6 5 | # TCP/IP 5.0 6 | # 7 | COMPILE_OPTS = $(INCLUDES) -I. -D_QNX4 -DBSD -DSOCKLEN_T=uint32_t -I/usr/watcom/10.6/usr/include 8 | C = c 9 | C_COMPILER = cc32 10 | C_FLAGS = $(COMPILE_OPTS) 11 | CPP = cpp 12 | CPLUSPLUS_COMPILER = cc32 13 | CPLUSPLUS_FLAGS = $(COMPILE_OPTS) -WC,-xs 14 | OBJ = o 15 | LINK = cc32 -b -M -N30000 -o 16 | LINK_OPTS = -l. 17 | CONSOLE_LINK_OPTS = $(LINK_OPTS) 18 | LIBRARY_LINK = wlib -n -b -c 19 | LIBRARY_LINK_OPTS = $(LINK_OPTS) 20 | LIB_SUFFIX = lib 21 | LIBS_FOR_CONSOLE_APPLICATION = -lsocket 22 | LIBS_FOR_GUI_APPLICATION = $(LIBS_FOR_CONSOLE_APPLICATION) 23 | EXE = 24 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/config.solaris-32bit: -------------------------------------------------------------------------------- 1 | COMPILE_OPTS = $(INCLUDES) -I. -O -DSOLARIS -DXLOCALE_NOT_USED -DSOCKLEN_T=socklen_t 2 | C = c 3 | C_COMPILER = cc 4 | C_FLAGS = $(COMPILE_OPTS) 5 | CPP = cpp 6 | CPLUSPLUS_COMPILER = c++ 7 | CPLUSPLUS_FLAGS = $(COMPILE_OPTS) -Wall 8 | OBJ = o 9 | LINK = c++ -o 10 | LINK_OPTS = -L. 11 | CONSOLE_LINK_OPTS = $(LINK_OPTS) 12 | LIBRARY_LINK = ld -o 13 | LIBRARY_LINK_OPTS = $(LINK_OPTS) -r -dn 14 | LIB_SUFFIX = a 15 | LIBS_FOR_CONSOLE_APPLICATION = -lsocket -lnsl 16 | LIBS_FOR_GUI_APPLICATION = $(LIBS_FOR_CONSOLE_APPLICATION) 17 | EXE = 18 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/config.solaris-64bit: -------------------------------------------------------------------------------- 1 | COMPILE_OPTS = $(INCLUDES) -m64 -I. -O -DSOLARIS -DXLOCALE_NOT_USED -DSOCKLEN_T=socklen_t 2 | C = c 3 | C_COMPILER = cc 4 | C_FLAGS = $(COMPILE_OPTS) 5 | CPP = cpp 6 | CPLUSPLUS_COMPILER = c++ 7 | CPLUSPLUS_FLAGS = $(COMPILE_OPTS) -Wall 8 | OBJ = o 9 | LINK = c++ -m64 -o 10 | LINK_OPTS = -L. 11 | CONSOLE_LINK_OPTS = $(LINK_OPTS) 12 | LIBRARY_LINK = ld -o 13 | LIBRARY_LINK_OPTS = $(LINK_OPTS) -64 -r -dn 14 | LIB_SUFFIX = a 15 | LIBS_FOR_CONSOLE_APPLICATION = -lsocket -lnsl 16 | LIBS_FOR_GUI_APPLICATION = $(LIBS_FOR_CONSOLE_APPLICATION) 17 | EXE = 18 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/config.stream-switch: -------------------------------------------------------------------------------- 1 | COMPILE_OPTS = $(INCLUDES) -I. -O2 -DSOCKLEN_T=socklen_t -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64 -DSTREAM_SWITCH 2 | C = c 3 | C_COMPILER = cc 4 | C_FLAGS = $(COMPILE_OPTS) $(CPPFLAGS) $(CFLAGS) 5 | CPP = cpp 6 | CPLUSPLUS_COMPILER = c++ 7 | CPLUSPLUS_FLAGS = $(COMPILE_OPTS) -Wall -DBSD=1 $(CPPFLAGS) $(CXXFLAGS) 8 | OBJ = o 9 | LINK = c++ -o 10 | LINK_OPTS = -L. $(LDFLAGS) 11 | CONSOLE_LINK_OPTS = $(LINK_OPTS) 12 | LIBRARY_LINK = ar cr 13 | LIBRARY_LINK_OPTS = 14 | LIB_SUFFIX = a 15 | LIBS_FOR_CONSOLE_APPLICATION = 16 | LIBS_FOR_GUI_APPLICATION = 17 | EXE = 18 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/config.sunos: -------------------------------------------------------------------------------- 1 | COMPILE_OPTS = $(INCLUDES) -I. -DBSD=1 -O 2 | C = c 3 | C_COMPILER = cc 4 | C_FLAGS = $(COMPILE_OPTS) 5 | CPP = cc 6 | CPLUSPLUS_COMPILER = c++ 7 | CPLUSPLUS_FLAGS = $(COMPILE_OPTS) -Wall 8 | OBJ = o 9 | LINK = c++ -o 10 | LINK_OPTS = -L. 11 | CONSOLE_LINK_OPTS = $(LINK_OPTS) 12 | LIBRARY_LINK = ld -o 13 | LIBRARY_LINK_OPTS = $(LINK_OPTS) -r -Bstatic 14 | LIB_SUFFIX = a 15 | LIBS_FOR_CONSOLE_APPLICATION = 16 | LIBS_FOR_GUI_APPLICATION = 17 | EXE = 18 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/config.uClinux: -------------------------------------------------------------------------------- 1 | CROSS_COMPILE= arc-linux-uclibc- 2 | COMPILE_OPTS = $(INCLUDES) -I. -O2 -DSOCKLEN_T=socklen_t -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64 3 | C = c 4 | C_COMPILER = $(CROSS_COMPILE)gcc 5 | CFLAGS += $(COMPILE_OPTS) 6 | C_FLAGS = $(CFLAGS) 7 | CPP = cpp 8 | CPLUSPLUS_COMPILER = $(CROSS_COMPILE)g++ 9 | CPLUSPLUS_FLAGS = $(COMPILE_OPTS) -Wall -DBSD=1 10 | CPLUSPLUS_FLAGS += $(CPPFLAGS) -fexceptions 11 | OBJ = o 12 | LINK = $(CROSS_COMPILE)g++ -o 13 | LINK_OPTS = -L. $(LDFLAGS) 14 | CONSOLE_LINK_OPTS = $(LINK_OPTS) 15 | LIBRARY_LINK = $(CROSS_COMPILE)ar cr 16 | LIBRARY_LINK_OPTS = 17 | LIB_SUFFIX = a 18 | LIBS_FOR_CONSOLE_APPLICATION = $(CXXLIBS) 19 | LIBS_FOR_GUI_APPLICATION = $(LIBS_FOR_CONSOLE_APPLICATION) 20 | EXE = 21 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/configure: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | echo "Whoa! This software distribution does NOT use the normal Unix \"configure\" mechanism for generating a Makefile. For instructions on how to build this software, see ." 4 | echo "Also, please make sure that you're using the most up-to-date version of the source code - available from ." 5 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/fix-makefile: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # the next line restarts using tclsh \ 3 | exec tclsh8.4 "$0" "$@" 4 | 5 | set makefileName [lindex $argv 0] 6 | set tmpfileName /tmp/rsftmp 7 | 8 | set inFid [open $makefileName r] 9 | set outFid [open $tmpfileName w] 10 | 11 | while {![eof $inFid]} { 12 | set line [gets $inFid] 13 | if {[string match *\)\$* $line]} { 14 | set pos [string first \)\$ $line] 15 | set prefix [string range $line 0 $pos] 16 | incr pos 17 | set suffix [string range $line $pos end] 18 | set line $prefix\ $suffix 19 | } 20 | 21 | puts $outFid $line 22 | } 23 | 24 | close $inFid 25 | close $outFid 26 | file rename -force $tmpfileName $makefileName 27 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/genMakefiles: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | usage() { 4 | echo "Usage: $0 " 5 | exit 1 6 | } 7 | 8 | if [ $# -ne 1 ] 9 | then 10 | usage $* 11 | fi 12 | 13 | cd liveMedia 14 | /bin/rm -f Makefile 15 | cat Makefile.head ../config.$1 Makefile.tail > Makefile 16 | chmod a-w Makefile 17 | 18 | cd ../groupsock 19 | /bin/rm -f Makefile 20 | cat Makefile.head ../config.$1 Makefile.tail > Makefile 21 | chmod a-w Makefile 22 | 23 | cd ../UsageEnvironment 24 | /bin/rm -f Makefile 25 | cat Makefile.head ../config.$1 Makefile.tail > Makefile 26 | chmod a-w Makefile 27 | 28 | cd ../BasicUsageEnvironment 29 | /bin/rm -f Makefile 30 | cat Makefile.head ../config.$1 Makefile.tail > Makefile 31 | chmod a-w Makefile 32 | 33 | cd ../testProgs 34 | /bin/rm -f Makefile 35 | cat Makefile.head ../config.$1 Makefile.tail > Makefile 36 | chmod a-w Makefile 37 | 38 | cd ../mediaServer 39 | /bin/rm -f Makefile 40 | cat Makefile.head ../config.$1 Makefile.tail > Makefile 41 | chmod a-w Makefile 42 | 43 | cd ../proxyServer 44 | /bin/rm -f Makefile 45 | cat Makefile.head ../config.$1 Makefile.tail > Makefile 46 | chmod a-w Makefile 47 | 48 | cd .. 49 | /bin/rm -f Makefile 50 | cat Makefile.head config.$1 Makefile.tail > Makefile 51 | chmod a-w Makefile 52 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/genMakefiles.stream_switch: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | usage() { 4 | echo "Usage: $0 " 5 | exit 1 6 | } 7 | 8 | if [ $# -ne 1 ] 9 | then 10 | usage $* 11 | fi 12 | 13 | cd liveMedia 14 | /bin/rm -f Makefile 15 | cat Makefile.head ../config.$1 Makefile.tail > Makefile 16 | 17 | 18 | cd ../groupsock 19 | /bin/rm -f Makefile 20 | cat Makefile.head ../config.$1 Makefile.tail > Makefile 21 | 22 | 23 | cd ../UsageEnvironment 24 | /bin/rm -f Makefile 25 | cat Makefile.head ../config.$1 Makefile.tail > Makefile 26 | 27 | cd ../BasicUsageEnvironment 28 | /bin/rm -f Makefile 29 | cat Makefile.head ../config.$1 Makefile.tail > Makefile 30 | 31 | 32 | cd ../testProgs 33 | /bin/rm -f Makefile 34 | cat Makefile.head ../config.$1 Makefile.tail > Makefile 35 | 36 | 37 | cd ../mediaServer 38 | /bin/rm -f Makefile 39 | cat Makefile.head ../config.$1 Makefile.tail > Makefile 40 | 41 | cd ../proxyServer 42 | /bin/rm -f Makefile 43 | cat Makefile.head ../config.$1 Makefile.tail > Makefile 44 | 45 | cd .. 46 | /bin/rm -f Makefile 47 | cat Makefile.head config.$1 Makefile.tail > Makefile 48 | 49 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/genWindowsMakefiles: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | cd liveMedia 4 | /bin/rm -f liveMedia.mak 5 | /bin/rm -f Makefile 6 | cat Makefile.head ../win32config Makefile.tail > liveMedia.mak 7 | 8 | cd ../groupsock 9 | /bin/rm -f groupsock.mak 10 | /bin/rm -f Makefile 11 | cat Makefile.head ../win32config Makefile.tail > groupsock.mak 12 | 13 | cd ../UsageEnvironment 14 | /bin/rm -f UsageEnvironment.mak 15 | /bin/rm -f Makefile 16 | cat Makefile.head ../win32config Makefile.tail > UsageEnvironment.mak 17 | 18 | cd ../BasicUsageEnvironment 19 | /bin/rm -f BasicUsageEnvironment.mak 20 | /bin/rm -f Makefile 21 | cat Makefile.head ../win32config Makefile.tail > BasicUsageEnvironment.mak 22 | 23 | cd ../testProgs 24 | /bin/rm -f testProgs.mak 25 | /bin/rm -f Makefile 26 | cat Makefile.head ../win32config Makefile.tail > testProgs.mak 27 | 28 | cd ../mediaServer 29 | /bin/rm -f mediaServer.mak 30 | /bin/rm -f Makefile 31 | cat Makefile.head ../win32config Makefile.tail > mediaServer.mak 32 | 33 | cd ../proxyServer 34 | /bin/rm -f proxyServer.mak 35 | /bin/rm -f Makefile 36 | cat Makefile.head ../win32config Makefile.tail > proxyServer.mak 37 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/genWindowsMakefiles.cmd: -------------------------------------------------------------------------------- 1 | @Echo OFF 2 | SETLOCAL 3 | for %%I in (%0) do %%~dI 4 | for %%I in (%0) do cd "%%~pI" 5 | cd liveMedia 6 | del /Q liveMedia.mak 7 | type Makefile.head ..\win32config Makefile.tail > liveMedia.mak 8 | cd ../groupsock 9 | del /Q groupsock.mak 10 | type Makefile.head ..\win32config Makefile.tail > groupsock.mak 11 | cd ../UsageEnvironment 12 | del /Q UsageEnvironment.mak 13 | type Makefile.head ..\win32config Makefile.tail > UsageEnvironment.mak 14 | cd ../BasicUsageEnvironment 15 | del /Q BasicUsageEnvironment.mak 16 | type Makefile.head ..\win32config Makefile.tail > BasicUsageEnvironment.mak 17 | cd ../testProgs 18 | del /Q testProgs.mak 19 | type Makefile.head ..\win32config Makefile.tail > testProgs.mak 20 | cd ../mediaServer 21 | del /Q mediaServer.mak 22 | type Makefile.head ..\win32config Makefile.tail > mediaServer.mak 23 | cd ../proxyServer 24 | del /Q proxyServer.mak 25 | type Makefile.head ..\win32config Makefile.tail > proxyServer.mak 26 | 27 | ENDLOCAL 28 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/groupsock/Makefile.head: -------------------------------------------------------------------------------- 1 | INCLUDES = -Iinclude -I../UsageEnvironment/include 2 | PREFIX = /usr/local 3 | LIBDIR = $(PREFIX)/lib 4 | ##### Change the following for your environment: 5 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/groupsock/include/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 2.1 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-2015 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 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/groupsock/include/groupsock_version.hh: -------------------------------------------------------------------------------- 1 | // Version information for the "groupsock" library 2 | // Copyright (c) 1996-2015 Live Networks, Inc. All rights reserved. 3 | 4 | #ifndef _GROUPSOCK_VERSION_HH 5 | #define _GROUPSOCK_VERSION_HH 6 | 7 | #define GROUPSOCK_LIBRARY_VERSION_STRING "2015.03.19" 8 | #define GROUPSOCK_LIBRARY_VERSION_INT 1426723200 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/liveMedia/AMRAudioSource.cpp: -------------------------------------------------------------------------------- 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 2.1 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-2015 Live Networks, Inc. All rights reserved. 18 | // A source object for AMR audio sources 19 | // Implementation 20 | 21 | #include "AMRAudioSource.hh" 22 | 23 | AMRAudioSource::AMRAudioSource(UsageEnvironment& env, 24 | Boolean isWideband, unsigned numChannels) 25 | : FramedSource(env), 26 | fIsWideband(isWideband), fNumChannels(numChannels), fLastFrameHeader(0) { 27 | } 28 | 29 | AMRAudioSource::~AMRAudioSource() { 30 | } 31 | 32 | char const* AMRAudioSource::MIMEtype() const { 33 | return "audio/AMR"; 34 | } 35 | 36 | Boolean AMRAudioSource::isAMRAudioSource() const { 37 | return True; 38 | } 39 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/liveMedia/AudioInputDevice.cpp: -------------------------------------------------------------------------------- 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 2.1 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) 2001-2003 Live Networks, Inc. All rights reserved. 17 | // Generic audio input device (such as a microphone, or an input sound card) 18 | // Implementation 19 | 20 | #include 21 | 22 | AudioInputDevice 23 | ::AudioInputDevice(UsageEnvironment& env, unsigned char bitsPerSample, 24 | unsigned char numChannels, 25 | unsigned samplingFrequency, unsigned granularityInMS) 26 | : FramedSource(env), fBitsPerSample(bitsPerSample), 27 | fNumChannels(numChannels), fSamplingFrequency(samplingFrequency), 28 | fGranularityInMS(granularityInMS) { 29 | } 30 | 31 | AudioInputDevice::~AudioInputDevice() { 32 | } 33 | 34 | char** AudioInputDevice::allowedDeviceNames = NULL; 35 | 36 | ////////// AudioPortNames implementation ////////// 37 | 38 | AudioPortNames::AudioPortNames() 39 | : numPorts(0), portName(NULL) { 40 | } 41 | 42 | AudioPortNames::~AudioPortNames() { 43 | for (unsigned i = 0; i < numPorts; ++i) delete portName[i]; 44 | delete portName; 45 | } 46 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/liveMedia/AudioRTPSink.cpp: -------------------------------------------------------------------------------- 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 2.1 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-2015 Live Networks, Inc. All rights reserved. 18 | // A generic RTP sink for audio codecs (abstract base class) 19 | // Implementation 20 | 21 | #include "AudioRTPSink.hh" 22 | 23 | AudioRTPSink::AudioRTPSink(UsageEnvironment& env, 24 | Groupsock* rtpgs, unsigned char rtpPayloadType, 25 | unsigned rtpTimestampFrequency, 26 | char const* rtpPayloadFormatName, 27 | unsigned numChannels) 28 | : MultiFramedRTPSink(env, rtpgs, rtpPayloadType, rtpTimestampFrequency, 29 | rtpPayloadFormatName, numChannels) { 30 | } 31 | 32 | AudioRTPSink::~AudioRTPSink() { 33 | } 34 | 35 | char const* AudioRTPSink::sdpMediaType() const { 36 | return "audio"; 37 | } 38 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/liveMedia/FileServerMediaSubsession.cpp: -------------------------------------------------------------------------------- 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 2.1 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-2015 Live Networks, Inc. All rights reserved. 18 | // A 'ServerMediaSubsession' object that creates new, unicast, "RTPSink"s 19 | // on demand, from a file. 20 | // Implementation 21 | 22 | #include "FileServerMediaSubsession.hh" 23 | 24 | FileServerMediaSubsession 25 | ::FileServerMediaSubsession(UsageEnvironment& env, char const* fileName, 26 | Boolean reuseFirstSource) 27 | : OnDemandServerMediaSubsession(env, reuseFirstSource), 28 | fFileSize(0) { 29 | fFileName = strDup(fileName); 30 | } 31 | 32 | FileServerMediaSubsession::~FileServerMediaSubsession() { 33 | delete[] (char*)fFileName; 34 | } 35 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/liveMedia/FramedFileSource.cpp: -------------------------------------------------------------------------------- 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 2.1 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-2015 Live Networks, Inc. All rights reserved. 18 | // Framed File Sources 19 | // Implementation 20 | 21 | #include "FramedFileSource.hh" 22 | 23 | ////////// FramedFileSource ////////// 24 | 25 | FramedFileSource::FramedFileSource(UsageEnvironment& env, FILE* fid) 26 | : FramedSource(env), fFid(fid) { 27 | } 28 | 29 | FramedFileSource::~FramedFileSource() { 30 | } 31 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/liveMedia/GSMAudioRTPSink.cpp: -------------------------------------------------------------------------------- 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 2.1 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-2015 Live Networks, Inc. All rights reserved. 18 | // RTP sink for GSM audio 19 | // Implementation 20 | 21 | #include "GSMAudioRTPSink.hh" 22 | 23 | GSMAudioRTPSink::GSMAudioRTPSink(UsageEnvironment& env, Groupsock* RTPgs) 24 | : AudioRTPSink(env, RTPgs, 3, 8000, "GSM") { 25 | } 26 | 27 | GSMAudioRTPSink::~GSMAudioRTPSink() { 28 | } 29 | 30 | GSMAudioRTPSink* 31 | GSMAudioRTPSink::createNew(UsageEnvironment& env, Groupsock* RTPgs) { 32 | return new GSMAudioRTPSink(env, RTPgs); 33 | } 34 | 35 | Boolean GSMAudioRTPSink 36 | ::frameCanAppearAfterPacketStart(unsigned char const* /*frameStart*/, 37 | unsigned /*numBytesInFrame*/) const { 38 | // Allow at most 5 frames in a single packet: 39 | return numFramesUsedSoFar() < 5; 40 | } 41 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/liveMedia/H264VideoStreamDiscreteFramer.cpp: -------------------------------------------------------------------------------- 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 2.1 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-2015 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 | // Implementation 23 | 24 | #include "H264VideoStreamDiscreteFramer.hh" 25 | 26 | H264VideoStreamDiscreteFramer* 27 | H264VideoStreamDiscreteFramer::createNew(UsageEnvironment& env, FramedSource* inputSource) { 28 | return new H264VideoStreamDiscreteFramer(env, inputSource); 29 | } 30 | 31 | H264VideoStreamDiscreteFramer 32 | ::H264VideoStreamDiscreteFramer(UsageEnvironment& env, FramedSource* inputSource) 33 | : H264or5VideoStreamDiscreteFramer(264, env, inputSource) { 34 | } 35 | 36 | H264VideoStreamDiscreteFramer::~H264VideoStreamDiscreteFramer() { 37 | } 38 | 39 | Boolean H264VideoStreamDiscreteFramer::isH264VideoStreamFramer() const { 40 | return True; 41 | } 42 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/liveMedia/H264VideoStreamFramer.cpp: -------------------------------------------------------------------------------- 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 2.1 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-2015 Live Networks, Inc. All rights reserved. 18 | // A filter that breaks up a H.264 Video Elementary Stream into NAL units. 19 | // Implementation 20 | 21 | #include "H264VideoStreamFramer.hh" 22 | 23 | H264VideoStreamFramer* H264VideoStreamFramer 24 | ::createNew(UsageEnvironment& env, FramedSource* inputSource, Boolean includeStartCodeInOutput) { 25 | return new H264VideoStreamFramer(env, inputSource, True, includeStartCodeInOutput); 26 | } 27 | 28 | H264VideoStreamFramer 29 | ::H264VideoStreamFramer(UsageEnvironment& env, FramedSource* inputSource, Boolean createParser, Boolean includeStartCodeInOutput) 30 | : H264or5VideoStreamFramer(264, env, inputSource, createParser, includeStartCodeInOutput) { 31 | } 32 | 33 | H264VideoStreamFramer::~H264VideoStreamFramer() { 34 | } 35 | 36 | Boolean H264VideoStreamFramer::isH264VideoStreamFramer() const { 37 | return True; 38 | } 39 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/liveMedia/H265VideoStreamDiscreteFramer.cpp: -------------------------------------------------------------------------------- 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 2.1 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-2015 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 | // Implementation 23 | 24 | #include "H265VideoStreamDiscreteFramer.hh" 25 | 26 | H265VideoStreamDiscreteFramer* 27 | H265VideoStreamDiscreteFramer::createNew(UsageEnvironment& env, FramedSource* inputSource) { 28 | return new H265VideoStreamDiscreteFramer(env, inputSource); 29 | } 30 | 31 | H265VideoStreamDiscreteFramer 32 | ::H265VideoStreamDiscreteFramer(UsageEnvironment& env, FramedSource* inputSource) 33 | : H264or5VideoStreamDiscreteFramer(265, env, inputSource) { 34 | } 35 | 36 | H265VideoStreamDiscreteFramer::~H265VideoStreamDiscreteFramer() { 37 | } 38 | 39 | Boolean H265VideoStreamDiscreteFramer::isH265VideoStreamFramer() const { 40 | return True; 41 | } 42 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/liveMedia/H265VideoStreamFramer.cpp: -------------------------------------------------------------------------------- 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 2.1 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-2015 Live Networks, Inc. All rights reserved. 18 | // A filter that breaks up a H.265 Video Elementary Stream into NAL units. 19 | // Implementation 20 | 21 | #include "H265VideoStreamFramer.hh" 22 | 23 | H265VideoStreamFramer* H265VideoStreamFramer 24 | ::createNew(UsageEnvironment& env, FramedSource* inputSource, Boolean includeStartCodeInOutput) { 25 | return new H265VideoStreamFramer(env, inputSource, True, includeStartCodeInOutput); 26 | } 27 | 28 | H265VideoStreamFramer 29 | ::H265VideoStreamFramer(UsageEnvironment& env, FramedSource* inputSource, Boolean createParser, Boolean includeStartCodeInOutput) 30 | : H264or5VideoStreamFramer(265, env, inputSource, createParser, includeStartCodeInOutput) { 31 | } 32 | 33 | H265VideoStreamFramer::~H265VideoStreamFramer() { 34 | } 35 | 36 | Boolean H265VideoStreamFramer::isH265VideoStreamFramer() const { 37 | return True; 38 | } 39 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/liveMedia/JPEGVideoSource.cpp: -------------------------------------------------------------------------------- 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 2.1 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-2015 Live Networks, Inc. All rights reserved. 18 | // JPEG video sources 19 | // Implementation 20 | 21 | #include "JPEGVideoSource.hh" 22 | 23 | JPEGVideoSource::JPEGVideoSource(UsageEnvironment& env) 24 | : FramedSource(env) { 25 | } 26 | 27 | JPEGVideoSource::~JPEGVideoSource() { 28 | } 29 | 30 | u_int8_t const* JPEGVideoSource::quantizationTables(u_int8_t& precision, 31 | u_int16_t& length) { 32 | // Default implementation 33 | precision = 0; 34 | length = 0; 35 | return NULL; 36 | } 37 | 38 | u_int16_t JPEGVideoSource::restartInterval() { 39 | // Default implementation 40 | return 0; 41 | } 42 | 43 | Boolean JPEGVideoSource::isJPEGVideoSource() const { 44 | return True; 45 | } 46 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/liveMedia/MPEGVideoStreamParser.cpp: -------------------------------------------------------------------------------- 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 2.1 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-2015 Live Networks, Inc. All rights reserved. 18 | // An abstract parser for MPEG video streams 19 | // Implementation 20 | 21 | #include "MPEGVideoStreamParser.hh" 22 | 23 | MPEGVideoStreamParser 24 | ::MPEGVideoStreamParser(MPEGVideoStreamFramer* usingSource, 25 | FramedSource* inputSource) 26 | : StreamParser(inputSource, FramedSource::handleClosure, usingSource, 27 | &MPEGVideoStreamFramer::continueReadProcessing, usingSource), 28 | fUsingSource(usingSource) { 29 | } 30 | 31 | MPEGVideoStreamParser::~MPEGVideoStreamParser() { 32 | } 33 | 34 | void MPEGVideoStreamParser::restoreSavedParserState() { 35 | StreamParser::restoreSavedParserState(); 36 | fTo = fSavedTo; 37 | fNumTruncatedBytes = fSavedNumTruncatedBytes; 38 | } 39 | 40 | void MPEGVideoStreamParser::registerReadInterest(unsigned char* to, 41 | unsigned maxSize) { 42 | fStartOfFrame = fTo = fSavedTo = to; 43 | fLimit = to + maxSize; 44 | fNumTruncatedBytes = fSavedNumTruncatedBytes = 0; 45 | } 46 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/liveMedia/Makefile.head: -------------------------------------------------------------------------------- 1 | INCLUDES = -Iinclude -I../UsageEnvironment/include -I../groupsock/include 2 | PREFIX = /usr/local 3 | LIBDIR = $(PREFIX)/lib 4 | ##### Change the following for your environment: 5 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/liveMedia/OggDemuxedTrack.cpp: -------------------------------------------------------------------------------- 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 2.1 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-2015 Live Networks, Inc. All rights reserved. 18 | // A media track, demultiplexed from an Ogg file 19 | // Implementation 20 | 21 | #include "OggDemuxedTrack.hh" 22 | #include "OggFile.hh" 23 | 24 | OggDemuxedTrack::OggDemuxedTrack(UsageEnvironment& env, unsigned trackNumber, OggDemux& sourceDemux) 25 | : FramedSource(env), 26 | fOurTrackNumber(trackNumber), fOurSourceDemux(sourceDemux), 27 | fCurrentPageIsContinuation(False) { 28 | fNextPresentationTime.tv_sec = 0; fNextPresentationTime.tv_usec = 0; 29 | } 30 | 31 | OggDemuxedTrack::~OggDemuxedTrack() { 32 | fOurSourceDemux.removeTrack(fOurTrackNumber); 33 | } 34 | 35 | void OggDemuxedTrack::doGetNextFrame() { 36 | fOurSourceDemux.continueReading(); 37 | } 38 | 39 | char const* OggDemuxedTrack::MIMEtype() const { 40 | OggTrack* track = fOurSourceDemux.fOurFile.lookup(fOurTrackNumber); 41 | if (track == NULL) return "(unknown)"; // shouldn't happen 42 | return track->mimeType; 43 | } 44 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/liveMedia/TextRTPSink.cpp: -------------------------------------------------------------------------------- 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 2.1 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-2015 Live Networks, Inc. All rights reserved. 18 | // A generic RTP sink for text codecs (abstract base class) 19 | // Implementation 20 | 21 | #include "TextRTPSink.hh" 22 | 23 | TextRTPSink::TextRTPSink(UsageEnvironment& env, 24 | Groupsock* rtpgs, unsigned char rtpPayloadType, 25 | unsigned rtpTimestampFrequency, 26 | char const* rtpPayloadFormatName) 27 | : MultiFramedRTPSink(env, rtpgs, rtpPayloadType, rtpTimestampFrequency, 28 | rtpPayloadFormatName) { 29 | } 30 | 31 | TextRTPSink::~TextRTPSink() { 32 | } 33 | 34 | char const* TextRTPSink::sdpMediaType() const { 35 | return "text"; 36 | } 37 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/liveMedia/VideoRTPSink.cpp: -------------------------------------------------------------------------------- 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 2.1 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-2015 Live Networks, Inc. All rights reserved. 18 | // A generic RTP sink for video codecs (abstract base class) 19 | // Implementation 20 | 21 | #include "VideoRTPSink.hh" 22 | 23 | VideoRTPSink::VideoRTPSink(UsageEnvironment& env, 24 | Groupsock* rtpgs, unsigned char rtpPayloadType, 25 | unsigned rtpTimestampFrequency, 26 | char const* rtpPayloadFormatName) 27 | : MultiFramedRTPSink(env, rtpgs, rtpPayloadType, rtpTimestampFrequency, 28 | rtpPayloadFormatName) { 29 | } 30 | 31 | VideoRTPSink::~VideoRTPSink() { 32 | } 33 | 34 | char const* VideoRTPSink::sdpMediaType() const { 35 | return "video"; 36 | } 37 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/liveMedia/include/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 2.1 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-2015 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 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/liveMedia/include/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 2.1 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-2015 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 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/liveMedia/include/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 2.1 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-2015 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 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/liveMedia/include/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 2.1 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-2015 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 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/liveMedia/include/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 2.1 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-2015 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 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/liveMedia/include/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 2.1 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-2015 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 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/liveMedia/include/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 2.1 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-2015 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 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/liveMedia/include/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 2.1 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-2015 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 _ON_DEMAND_SERVER_MEDIA_SUBSESSION_HH 26 | #include "OnDemandServerMediaSubsession.hh" 27 | #endif 28 | 29 | class FileServerMediaSubsession: public OnDemandServerMediaSubsession { 30 | protected: // we're a virtual base class 31 | FileServerMediaSubsession(UsageEnvironment& env, char const* fileName, 32 | Boolean reuseFirstSource); 33 | virtual ~FileServerMediaSubsession(); 34 | 35 | protected: 36 | char const* fFileName; 37 | u_int64_t fFileSize; // if known 38 | }; 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/liveMedia/include/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 2.1 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-2015 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 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/liveMedia/include/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 2.1 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-2015 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 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/liveMedia/include/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 2.1 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-2015 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 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/liveMedia/include/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 2.1 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-2015 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 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/liveMedia/include/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 2.1 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-2015 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 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/liveMedia/include/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 2.1 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-2015 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 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/liveMedia/include/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 2.1 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-2015 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 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/liveMedia/include/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 2.1 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-2015 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 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/liveMedia/include/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 2.1 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-2015 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 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/liveMedia/include/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 2.1 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-2015 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 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/liveMedia/include/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 2.1 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-2015 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 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/liveMedia/include/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 2.1 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-2015 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 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/liveMedia/include/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 2.1 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-2015 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 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/liveMedia/include/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 2.1 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-2015 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 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/liveMedia/include/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 2.1 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-2015 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 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/liveMedia/include/liveMedia_version.hh: -------------------------------------------------------------------------------- 1 | // Version information for the "liveMedia" library 2 | // Copyright (c) 1996-2015 Live Networks, Inc. All rights reserved. 3 | 4 | #ifndef _LIVEMEDIA_VERSION_HH 5 | #define _LIVEMEDIA_VERSION_HH 6 | 7 | #define LIVEMEDIA_LIBRARY_VERSION_STRING "2015.03.19" 8 | #define LIVEMEDIA_LIBRARY_VERSION_INT 1426723200 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/mediaServer/Makefile.head: -------------------------------------------------------------------------------- 1 | INCLUDES = -I../UsageEnvironment/include -I../groupsock/include -I../liveMedia/include -I../BasicUsageEnvironment/include 2 | # Default library filename suffixes for each library that we link with. The "config.*" file might redefine these later. 3 | libliveMedia_LIB_SUFFIX = $(LIB_SUFFIX) 4 | libBasicUsageEnvironment_LIB_SUFFIX = $(LIB_SUFFIX) 5 | libUsageEnvironment_LIB_SUFFIX = $(LIB_SUFFIX) 6 | libgroupsock_LIB_SUFFIX = $(LIB_SUFFIX) 7 | ##### Change the following for your environment: 8 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/mediaServer/Makefile.tail: -------------------------------------------------------------------------------- 1 | ##### End of variables to change 2 | 3 | MEDIA_SERVER = live555MediaServer$(EXE) 4 | 5 | PREFIX = /usr/local 6 | ALL = $(MEDIA_SERVER) 7 | all: $(ALL) 8 | 9 | .$(C).$(OBJ): 10 | $(C_COMPILER) -c $(C_FLAGS) $< 11 | .$(CPP).$(OBJ): 12 | $(CPLUSPLUS_COMPILER) -c $(CPLUSPLUS_FLAGS) $< 13 | 14 | MEDIA_SERVER_OBJS = live555MediaServer.$(OBJ) DynamicRTSPServer.$(OBJ) 15 | 16 | live555MediaServer.$(CPP): DynamicRTSPServer.hh version.hh 17 | DynamicRTSPServer.$(CPP): DynamicRTSPServer.hh 18 | 19 | USAGE_ENVIRONMENT_DIR = ../UsageEnvironment 20 | USAGE_ENVIRONMENT_LIB = $(USAGE_ENVIRONMENT_DIR)/libUsageEnvironment.$(libUsageEnvironment_LIB_SUFFIX) 21 | BASIC_USAGE_ENVIRONMENT_DIR = ../BasicUsageEnvironment 22 | BASIC_USAGE_ENVIRONMENT_LIB = $(BASIC_USAGE_ENVIRONMENT_DIR)/libBasicUsageEnvironment.$(libBasicUsageEnvironment_LIB_SUFFIX) 23 | LIVEMEDIA_DIR = ../liveMedia 24 | LIVEMEDIA_LIB = $(LIVEMEDIA_DIR)/libliveMedia.$(libliveMedia_LIB_SUFFIX) 25 | GROUPSOCK_DIR = ../groupsock 26 | GROUPSOCK_LIB = $(GROUPSOCK_DIR)/libgroupsock.$(libgroupsock_LIB_SUFFIX) 27 | LOCAL_LIBS = $(LIVEMEDIA_LIB) $(GROUPSOCK_LIB) \ 28 | $(BASIC_USAGE_ENVIRONMENT_LIB) $(USAGE_ENVIRONMENT_LIB) 29 | LIBS = $(LOCAL_LIBS) $(LIBS_FOR_CONSOLE_APPLICATION) 30 | 31 | live555MediaServer$(EXE): $(MEDIA_SERVER_OBJS) $(LOCAL_LIBS) 32 | $(LINK)$@ $(CONSOLE_LINK_OPTS) $(MEDIA_SERVER_OBJS) $(LIBS) 33 | 34 | clean: 35 | -rm -rf *.$(OBJ) $(ALL) core *.core *~ include/*~ 36 | 37 | install: $(MEDIA_SERVER) 38 | install -d $(DESTDIR)$(PREFIX)/bin 39 | install -m 755 $(MEDIA_SERVER) $(DESTDIR)$(PREFIX)/bin 40 | 41 | ##### Any additional, platform-specific rules come here: 42 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/mediaServer/version.hh: -------------------------------------------------------------------------------- 1 | // Copyright (c) 1996-2015, Live Networks, Inc. All rights reserved 2 | // Version information for the LIVE555 Media Server application 3 | // Header file 4 | 5 | #ifndef _MEDIA_SERVER_VERSION_HH 6 | #define _MEDIA_SERVER_VERSION_HH 7 | 8 | #define MEDIA_SERVER_VERSION_STRING "0.86" 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/proxyServer/Makefile.head: -------------------------------------------------------------------------------- 1 | INCLUDES = -I../UsageEnvironment/include -I../groupsock/include -I../liveMedia/include -I../BasicUsageEnvironment/include 2 | # Default library filename suffixes for each library that we link with. The "config.*" file might redefine these later. 3 | libliveMedia_LIB_SUFFIX = $(LIB_SUFFIX) 4 | libBasicUsageEnvironment_LIB_SUFFIX = $(LIB_SUFFIX) 5 | libUsageEnvironment_LIB_SUFFIX = $(LIB_SUFFIX) 6 | libgroupsock_LIB_SUFFIX = $(LIB_SUFFIX) 7 | ##### Change the following for your environment: 8 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/proxyServer/Makefile.tail: -------------------------------------------------------------------------------- 1 | ##### End of variables to change 2 | 3 | PROXY_SERVER = live555ProxyServer$(EXE) 4 | 5 | PREFIX = /usr/local 6 | ALL = $(PROXY_SERVER) 7 | all: $(ALL) 8 | 9 | .$(C).$(OBJ): 10 | $(C_COMPILER) -c $(C_FLAGS) $< 11 | .$(CPP).$(OBJ): 12 | $(CPLUSPLUS_COMPILER) -c $(CPLUSPLUS_FLAGS) $< 13 | 14 | PROXY_SERVER_OBJS = live555ProxyServer.$(OBJ) 15 | 16 | USAGE_ENVIRONMENT_DIR = ../UsageEnvironment 17 | USAGE_ENVIRONMENT_LIB = $(USAGE_ENVIRONMENT_DIR)/libUsageEnvironment.$(libUsageEnvironment_LIB_SUFFIX) 18 | BASIC_USAGE_ENVIRONMENT_DIR = ../BasicUsageEnvironment 19 | BASIC_USAGE_ENVIRONMENT_LIB = $(BASIC_USAGE_ENVIRONMENT_DIR)/libBasicUsageEnvironment.$(libBasicUsageEnvironment_LIB_SUFFIX) 20 | LIVEMEDIA_DIR = ../liveMedia 21 | LIVEMEDIA_LIB = $(LIVEMEDIA_DIR)/libliveMedia.$(libliveMedia_LIB_SUFFIX) 22 | GROUPSOCK_DIR = ../groupsock 23 | GROUPSOCK_LIB = $(GROUPSOCK_DIR)/libgroupsock.$(libgroupsock_LIB_SUFFIX) 24 | LOCAL_LIBS = $(LIVEMEDIA_LIB) $(GROUPSOCK_LIB) \ 25 | $(BASIC_USAGE_ENVIRONMENT_LIB) $(USAGE_ENVIRONMENT_LIB) 26 | LIBS = $(LOCAL_LIBS) $(LIBS_FOR_CONSOLE_APPLICATION) 27 | 28 | live555ProxyServer$(EXE): $(PROXY_SERVER_OBJS) $(LOCAL_LIBS) 29 | $(LINK)$@ $(CONSOLE_LINK_OPTS) $(PROXY_SERVER_OBJS) $(LIBS) 30 | 31 | clean: 32 | -rm -rf *.$(OBJ) $(ALL) core *.core *~ include/*~ 33 | 34 | install: $(PROXY_SERVER) 35 | install -d $(DESTDIR)$(PREFIX)/bin 36 | install -m 755 $(PROXY_SERVER) $(DESTDIR)$(PREFIX)/bin 37 | 38 | ##### Any additional, platform-specific rules come here: 39 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/testProgs/Makefile.head: -------------------------------------------------------------------------------- 1 | INCLUDES = -I../UsageEnvironment/include -I../groupsock/include -I../liveMedia/include -I../BasicUsageEnvironment/include 2 | # Default library filename suffixes for each library that we link with. The "config.*" file might redefine these later. 3 | libliveMedia_LIB_SUFFIX = $(LIB_SUFFIX) 4 | libBasicUsageEnvironment_LIB_SUFFIX = $(LIB_SUFFIX) 5 | libUsageEnvironment_LIB_SUFFIX = $(LIB_SUFFIX) 6 | libgroupsock_LIB_SUFFIX = $(LIB_SUFFIX) 7 | ##### Change the following for your environment: 8 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/testProgs/testMP3-using-ADUs.sdp: -------------------------------------------------------------------------------- 1 | v=0 2 | o=- 49452 4 IN IP4 127.0.0.1 3 | s=Test MP3 session 4 | i=Parameters for the session streamed by "testMP3Streamer" 5 | t=0 0 6 | a=tool:testMP3Streamer 7 | a=type:broadcast 8 | m=audio 6666 RTP/AVP 96 9 | c=IN IP4 239.255.42.42/127 10 | a=rtpmap:96 mpa-robust/90000 11 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/testProgs/testMP3.sdp: -------------------------------------------------------------------------------- 1 | v=0 2 | o=- 49452 4 IN IP4 127.0.0.1 3 | s=Test MP3 session 4 | i=Parameters for the session streamed by "testMP3Streamer" 5 | t=0 0 6 | a=tool:testMP3Streamer 7 | a=type:broadcast 8 | m=audio 6666 RTP/AVP 14 9 | c=IN IP4 239.255.42.42/127 10 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/testProgs/testMPEG1or2AudioVideo.sdp: -------------------------------------------------------------------------------- 1 | v=0 2 | o=- 49451 3 IN IP4 127.0.0.1 3 | s=Test MPEG Audio+Video session 4 | i=Parameters for the session streamed by "testMPEG1or2AudioVideoStreamer" 5 | t=0 0 6 | a=tool:testMPEG1or2AudioVideoStreamer 7 | a=type:broadcast 8 | m=audio 6666 RTP/AVP 14 9 | c=IN IP4 239.255.42.42/127 10 | m=video 8888 RTP/AVP 32 11 | c=IN IP4 239.255.42.42/127 12 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/testProgs/testMPEG1or2Video.sdp: -------------------------------------------------------------------------------- 1 | v=0 2 | o=- 49451 3 IN IP4 127.0.0.1 3 | s=Test MPEG Video session 4 | i=Parameters for the session streamed by "testMPEG1or2VideoStreamer" 5 | t=0 0 6 | a=tool:testMPEG1or2VideoStreamer 7 | a=type:broadcast 8 | m=video 8888 RTP/AVP 32 9 | c=IN IP4 239.255.42.42/127 10 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/testProgs/testMPEG2Transport.sdp: -------------------------------------------------------------------------------- 1 | v=0 2 | o=- 49451 3 IN IP4 127.0.0.1 3 | s=Test MPEG-2 Transport Stream session 4 | i=Parameters for the session streamed by "testMPEG2TransportStreamer" 5 | t=0 0 6 | a=tool:testMPEG2TransportStreamer 7 | a=type:broadcast 8 | m=video 1234 RTP/AVP 33 9 | c=IN IP4 239.255.42.42/127 10 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/win32config: -------------------------------------------------------------------------------- 1 | # Comment out the following line to produce Makefiles that generate debuggable code: 2 | NODEBUG=1 3 | 4 | # The following definition ensures that we are properly matching 5 | # the WinSock2 library file with the correct header files. 6 | # (will link with "ws2_32.lib" and include "winsock2.h" & "Ws2tcpip.h") 7 | TARGETOS = WINNT 8 | 9 | # If for some reason you wish to use WinSock1 instead, uncomment the 10 | # following two definitions. 11 | # (will link with "wsock32.lib" and include "winsock.h") 12 | #TARGETOS = WIN95 13 | #APPVER = 4.0 14 | 15 | !include 16 | 17 | UI_OPTS = $(guilflags) $(guilibsdll) 18 | # Use the following to get a console (e.g., for debugging): 19 | CONSOLE_UI_OPTS = $(conlflags) $(conlibsdll) 20 | CPU=i386 21 | 22 | TOOLS32 = c:\Program Files\DevStudio\Vc 23 | COMPILE_OPTS = $(INCLUDES) $(cdebug) $(cflags) $(cvarsdll) -I. -I"$(TOOLS32)\include" 24 | C = c 25 | C_COMPILER = "$(TOOLS32)\bin\cl" 26 | C_FLAGS = $(COMPILE_OPTS) 27 | CPP = cpp 28 | CPLUSPLUS_COMPILER = $(C_COMPILER) 29 | CPLUSPLUS_FLAGS = $(COMPILE_OPTS) 30 | OBJ = obj 31 | LINK = $(link) -out: 32 | LIBRARY_LINK = lib -out: 33 | LINK_OPTS_0 = $(linkdebug) msvcirt.lib 34 | LIBRARY_LINK_OPTS = 35 | LINK_OPTS = $(LINK_OPTS_0) $(UI_OPTS) 36 | CONSOLE_LINK_OPTS = $(LINK_OPTS_0) $(CONSOLE_UI_OPTS) 37 | SERVICE_LINK_OPTS = kernel32.lib advapi32.lib shell32.lib -subsystem:console,$(APPVER) 38 | LIB_SUFFIX = lib 39 | LIBS_FOR_CONSOLE_APPLICATION = 40 | LIBS_FOR_GUI_APPLICATION = 41 | MULTIMEDIA_LIBS = winmm.lib 42 | EXE = .exe 43 | PLATFORM = Windows 44 | 45 | rc32 = "$(TOOLS32)\bin\rc" 46 | .rc.res: 47 | $(rc32) $< 48 | -------------------------------------------------------------------------------- /sources/stsw_rtsp_source/live/win32config.Borland: -------------------------------------------------------------------------------- 1 | # Comment out the following line to produce Makefiles that generate debuggable code: 2 | NODEBUG=1 3 | 4 | # The following definition ensures that we are properly matching 5 | # the WinSock2 library file with the correct header files. 6 | # (will link with "ws2_32.lib" and include "winsock2.h" & "Ws2tcpip.h") 7 | TARGETOS = WINNT 8 | 9 | # If for some reason you wish to use WinSock1 instead, uncomment the 10 | # following two definitions. 11 | # (will link with "wsock32.lib" and include "winsock.h") 12 | #TARGETOS = WIN95 13 | #APPVER = 4.0 14 | 15 | #!include 16 | 17 | UI_OPTS = $(guilflags) $(guilibsdll) 18 | # Use the following to get a console (e.g., for debugging): 19 | CONSOLE_UI_OPTS = $(conlflags) $(conlibsdll) 20 | CPU=i386 21 | 22 | TOOLS32 = C:\Progra~1\Borland\CBuilder5 23 | COMPILE_OPTS = $(INCLUDES) $(cdebug) $(cflags) $(cvarsdll) -I. -I$(TOOLS32)\include 24 | C = c 25 | C_COMPILER = $(TOOLS32)\bin\bcc32 26 | C_FLAGS = $(COMPILE_OPTS) 27 | CPP = cpp 28 | CPLUSPLUS_COMPILER = $(C_COMPILER) 29 | CPLUSPLUS_FLAGS = $(COMPILE_OPTS) 30 | OBJ = obj 31 | LINK = $(TOOLS32)\bin\ilink32 32 | LIBRARY_LINK = $(TOOLS32)\bin\tlib 33 | LINK_OPTS_0 = $(linkdebug) msvcirt.lib 34 | LIBRARY_LINK_OPTS = /u 35 | LINK_OPTS = $(LINK_OPTS_0) $(UI_OPTS) 36 | CONSOLE_LINK_OPTS = c0x32 37 | 38 | SERVICE_LINK_OPTS = kernel32.lib advapi32.lib shell32.lib -subsystem:console,$(APPVER) 39 | LIB_SUFFIX = lib 40 | LIBS_FOR_CONSOLE_APPLICATION = cw32.lib import32.lib 41 | LIBS_FOR_GUI_APPLICATION = ,,cw32 42 | EXE = 43 | 44 | rc32 = $(TOOLS32)\bin\brc32" 45 | .rc.res: 46 | $(rc32) $< 47 | --------------------------------------------------------------------------------