├── Client ├── CameraDS.cpp ├── CameraDS.h ├── Client.cpp ├── Client.h ├── Client.rc ├── Client.sln ├── Client.suo ├── Client.vcproj ├── Client.vcproj.Tiger-PC.Administrator.user ├── ClientDlg.cpp ├── ClientDlg.h ├── DirectShow │ ├── Include │ │ ├── Amvideo.h │ │ ├── Bdatif.h │ │ ├── DShow.h │ │ ├── DxDiag.h │ │ ├── Iwstdec.h │ │ ├── Mpeg2Bits.h │ │ ├── Mpeg2Error.h │ │ ├── Mstvca.h │ │ ├── Mstve.h │ │ ├── Msvidctl.h │ │ ├── Msvidctl.tlb │ │ ├── Segment.h │ │ ├── Tuner.tlb │ │ ├── activecf.h │ │ ├── amaudio.h │ │ ├── amparse.h │ │ ├── amstream.h │ │ ├── amva.h │ │ ├── atsmedia.h │ │ ├── audevcod.h │ │ ├── austream.h │ │ ├── aviriff.h │ │ ├── basetsd.h │ │ ├── bdaiface.h │ │ ├── bdamedia.h │ │ ├── bdatypes.h │ │ ├── comlite.h │ │ ├── control.h │ │ ├── d3d.h │ │ ├── d3d8.h │ │ ├── d3d8caps.h │ │ ├── d3d8types.h │ │ ├── d3d9.h │ │ ├── d3d9caps.h │ │ ├── d3d9types.h │ │ ├── d3dcaps.h │ │ ├── d3drm.h │ │ ├── d3drmdef.h │ │ ├── d3drmobj.h │ │ ├── d3drmwin.h │ │ ├── d3dtypes.h │ │ ├── d3dvec.inl │ │ ├── d3dx.h │ │ ├── d3dx8.h │ │ ├── d3dx8core.h │ │ ├── d3dx8effect.h │ │ ├── d3dx8math.h │ │ ├── d3dx8math.inl │ │ ├── d3dx8mesh.h │ │ ├── d3dx8shape.h │ │ ├── d3dx8tex.h │ │ ├── d3dx9.h │ │ ├── d3dx9anim.h │ │ ├── d3dx9core.h │ │ ├── d3dx9effect.h │ │ ├── d3dx9math.h │ │ ├── d3dx9math.inl │ │ ├── d3dx9mesh.h │ │ ├── d3dx9shader.h │ │ ├── d3dx9shape.h │ │ ├── d3dx9tex.h │ │ ├── d3dxcore.h │ │ ├── d3dxerr.h │ │ ├── d3dxmath.h │ │ ├── d3dxmath.inl │ │ ├── d3dxshapes.h │ │ ├── d3dxsprite.h │ │ ├── ddraw.h │ │ ├── ddstream.h │ │ ├── dinput.h │ │ ├── dinputd.h │ │ ├── dls1.h │ │ ├── dls2.h │ │ ├── dmdls.h │ │ ├── dmerror.h │ │ ├── dmksctrl.h │ │ ├── dmo.h │ │ ├── dmodshow.h │ │ ├── dmoimpl.h │ │ ├── dmoreg.h │ │ ├── dmort.h │ │ ├── dmplugin.h │ │ ├── dmusbuff.h │ │ ├── dmusicc.h │ │ ├── dmusicf.h │ │ ├── dmusici.h │ │ ├── dmusics.h │ │ ├── dpaddr.h │ │ ├── dplay.h │ │ ├── dplay8.h │ │ ├── dplobby.h │ │ ├── dplobby8.h │ │ ├── dpnathlp.h │ │ ├── dsconf.h │ │ ├── dsetup.h │ │ ├── dshowasf.h │ │ ├── dsound.h │ │ ├── dv.h │ │ ├── dvdevcod.h │ │ ├── dvdmedia.h │ │ ├── dvoice.h │ │ ├── dvp.h │ │ ├── dx7todx8.h │ │ ├── dxerr8.h │ │ ├── dxerr9.h │ │ ├── dxfile.h │ │ ├── dxtrans.h │ │ ├── dxva.h │ │ ├── edevctrl.h │ │ ├── edevdefs.h │ │ ├── errors.h │ │ ├── evcode.h │ │ ├── il21dec.h │ │ ├── ks.h │ │ ├── ksguid.h │ │ ├── ksmedia.h │ │ ├── ksproxy.h │ │ ├── ksuuids.h │ │ ├── mediaerr.h │ │ ├── mediaobj.h │ │ ├── medparam.h │ │ ├── mixerocx.h │ │ ├── mmstream.h │ │ ├── mpconfig.h │ │ ├── mpeg2data.h │ │ ├── mpegtype.h │ │ ├── multimon.h │ │ ├── playlist.h │ │ ├── qedit.h │ │ ├── qnetwork.h │ │ ├── regbag.h │ │ ├── rmxfguid.h │ │ ├── rmxftmpl.h │ │ ├── sbe.h │ │ ├── strmif.h │ │ ├── tune.h │ │ ├── tuner.h │ │ ├── tvratings.h │ │ ├── uuids.h │ │ ├── vfwmsgs.h │ │ ├── videoacc.h │ │ ├── vmr9.h │ │ ├── vpconfig.h │ │ ├── vpnotify.h │ │ ├── vptype.h │ │ └── xprtdefs.h │ └── Lib │ │ └── strmiids.lib ├── ReadMe.txt ├── UDPSession.cpp ├── UDPSession.h ├── UDPSock.cpp ├── UDPSock.h ├── VideoDec.cpp ├── VideoDec.h ├── VideoEnc.cpp ├── VideoEnc.h ├── VideoWnd.cpp ├── VideoWnd.h ├── bin │ ├── Client.exe │ ├── Client.pdb │ ├── avcodec-55.dll │ ├── avdevice-55.dll │ ├── avfilter-4.dll │ ├── avformat-55.dll │ ├── avutil-52.dll │ ├── libeay32.dll │ ├── postproc-52.dll │ ├── pthreadVC2.dll │ ├── sqlite3.dll │ ├── ssleay32.dll │ ├── swresample-0.dll │ └── swscale-2.dll ├── buffer.cpp ├── evbuffer.h ├── global.cpp ├── global.h ├── include │ ├── BasicUsageEnvironment │ │ └── include │ │ │ ├── BasicHashTable.hh │ │ │ ├── BasicUsageEnvironment.hh │ │ │ ├── BasicUsageEnvironment0.hh │ │ │ ├── BasicUsageEnvironment_version.hh │ │ │ ├── DelayQueue.hh │ │ │ └── HandlerSet.hh │ ├── UsageEnvironment │ │ └── include │ │ │ ├── Boolean.hh │ │ │ ├── HashTable.hh │ │ │ ├── UsageEnvironment.hh │ │ │ ├── UsageEnvironment_version.hh │ │ │ └── strDup.hh │ ├── groupsock │ │ └── include │ │ │ ├── GroupEId.hh │ │ │ ├── Groupsock.hh │ │ │ ├── GroupsockHelper.hh │ │ │ ├── IOHandlers.hh │ │ │ ├── NetAddress.hh │ │ │ ├── NetCommon.h │ │ │ ├── NetInterface.hh │ │ │ ├── TunnelEncaps.hh │ │ │ └── groupsock_version.hh │ ├── inttypes.h │ ├── libavcodec │ │ ├── avcodec.h │ │ ├── avfft.h │ │ ├── dxva2.h │ │ ├── old_codec_ids.h │ │ ├── vaapi.h │ │ ├── vda.h │ │ ├── vdpau.h │ │ ├── version.h │ │ └── xvmc.h │ ├── libavdevice │ │ ├── avdevice.h │ │ └── version.h │ ├── libavfilter │ │ ├── asrc_abuffer.h │ │ ├── avcodec.h │ │ ├── avfilter.h │ │ ├── avfiltergraph.h │ │ ├── buffersink.h │ │ ├── buffersrc.h │ │ └── version.h │ ├── libavformat │ │ ├── avformat.h │ │ ├── avio.h │ │ └── version.h │ ├── libavutil │ │ ├── adler32.h │ │ ├── aes.h │ │ ├── attributes.h │ │ ├── audio_fifo.h │ │ ├── audioconvert.h │ │ ├── avassert.h │ │ ├── avconfig.h │ │ ├── avstring.h │ │ ├── avutil.h │ │ ├── base64.h │ │ ├── blowfish.h │ │ ├── bprint.h │ │ ├── bswap.h │ │ ├── buffer.h │ │ ├── channel_layout.h │ │ ├── common.h │ │ ├── cpu.h │ │ ├── crc.h │ │ ├── dict.h │ │ ├── display.h │ │ ├── downmix_info.h │ │ ├── error.h │ │ ├── eval.h │ │ ├── ffversion.h │ │ ├── fifo.h │ │ ├── file.h │ │ ├── frame.h │ │ ├── hmac.h │ │ ├── imgutils.h │ │ ├── intfloat.h │ │ ├── intfloat_readwrite.h │ │ ├── intreadwrite.h │ │ ├── lfg.h │ │ ├── log.h │ │ ├── lzo.h │ │ ├── macros.h │ │ ├── mathematics.h │ │ ├── md5.h │ │ ├── mem.h │ │ ├── murmur3.h │ │ ├── old_pix_fmts.h │ │ ├── opt.h │ │ ├── parseutils.h │ │ ├── pixdesc.h │ │ ├── pixfmt.h │ │ ├── random_seed.h │ │ ├── rational.h │ │ ├── replaygain.h │ │ ├── ripemd.h │ │ ├── samplefmt.h │ │ ├── sha.h │ │ ├── sha512.h │ │ ├── stereo3d.h │ │ ├── threadmessage.h │ │ ├── time.h │ │ ├── timecode.h │ │ ├── timestamp.h │ │ ├── version.h │ │ └── xtea.h │ ├── libpostproc │ │ ├── postprocess.h │ │ └── version.h │ ├── libswresample │ │ ├── swresample.h │ │ └── version.h │ ├── libswscale │ │ ├── swscale.h │ │ └── version.h │ ├── liveMedia │ │ └── 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 │ │ │ ├── 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 │ │ │ ├── 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 │ │ │ ├── VP8VideoRTPSink.hh │ │ │ ├── VP8VideoRTPSource.hh │ │ │ ├── VideoRTPSink.hh │ │ │ ├── VorbisAudioRTPSink.hh │ │ │ ├── VorbisAudioRTPSource.hh │ │ │ ├── WAVAudioFileServerMediaSubsession.hh │ │ │ ├── WAVAudioFileSource.hh │ │ │ ├── liveMedia.hh │ │ │ ├── liveMedia_version.hh │ │ │ └── uLawAudioFilter.hh │ ├── pthread.h │ ├── rtmp │ │ ├── amf.h │ │ ├── bytes.h │ │ ├── dh.h │ │ ├── dhgroups.h │ │ ├── handshake.h │ │ ├── http.h │ │ ├── log.h │ │ ├── pthread.h │ │ ├── rtmp.h │ │ ├── rtmp_sys.h │ │ ├── sched.h │ │ ├── semaphore.h │ │ └── stdint.h │ ├── sched.h │ ├── semaphore.h │ └── stdint.h ├── lib │ ├── avcodec.lib │ ├── avdevice.lib │ ├── avfilter.lib │ ├── avformat.lib │ ├── avutil.lib │ ├── libBasicUsageEnvironment.lib │ ├── libUsageEnvironment.lib │ ├── libgroupsock.lib │ ├── libliveMedia.lib │ ├── librtmp.lib │ ├── librtmpd.lib │ ├── postproc.lib │ ├── pthread.lib │ ├── swresample.lib │ └── swscale.lib ├── readme ├── res │ ├── Client.ico │ └── Client.rc2 ├── resource.h ├── stdafx.cpp ├── stdafx.h └── targetver.h ├── README.md ├── Server └── Server.suo └── stun_server ├── makefile ├── run ├── include │ ├── UDPSession.h │ ├── UDPSock.h │ ├── UserMgr.h │ ├── XAgent.h │ ├── evbuffer.h │ └── global.h ├── makefile └── src │ ├── UDPSession.cpp │ ├── UDPSock.cpp │ ├── UserMgr.cpp │ ├── XAgent.cpp │ ├── buffer.cpp │ └── global.cpp └── stun_server.cpp /Client/CameraDS.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sxcong/rttim/57cea98fd80e4a7aa9c62441c112cc621c6db884/Client/CameraDS.cpp -------------------------------------------------------------------------------- /Client/CameraDS.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sxcong/rttim/57cea98fd80e4a7aa9c62441c112cc621c6db884/Client/CameraDS.h -------------------------------------------------------------------------------- /Client/Client.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sxcong/rttim/57cea98fd80e4a7aa9c62441c112cc621c6db884/Client/Client.cpp -------------------------------------------------------------------------------- /Client/Client.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sxcong/rttim/57cea98fd80e4a7aa9c62441c112cc621c6db884/Client/Client.h -------------------------------------------------------------------------------- /Client/Client.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sxcong/rttim/57cea98fd80e4a7aa9c62441c112cc621c6db884/Client/Client.rc -------------------------------------------------------------------------------- /Client/Client.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 10.00 3 | # Visual Studio 2008 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Client", "Client.vcproj", "{FA71F81C-6DD0-46ED-97C7-9649DCA96ED3}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Win32 = Debug|Win32 9 | Release|Win32 = Release|Win32 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {FA71F81C-6DD0-46ED-97C7-9649DCA96ED3}.Debug|Win32.ActiveCfg = Debug|Win32 13 | {FA71F81C-6DD0-46ED-97C7-9649DCA96ED3}.Debug|Win32.Build.0 = Debug|Win32 14 | {FA71F81C-6DD0-46ED-97C7-9649DCA96ED3}.Release|Win32.ActiveCfg = Release|Win32 15 | {FA71F81C-6DD0-46ED-97C7-9649DCA96ED3}.Release|Win32.Build.0 = Release|Win32 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /Client/Client.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sxcong/rttim/57cea98fd80e4a7aa9c62441c112cc621c6db884/Client/Client.suo -------------------------------------------------------------------------------- /Client/Client.vcproj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sxcong/rttim/57cea98fd80e4a7aa9c62441c112cc621c6db884/Client/Client.vcproj -------------------------------------------------------------------------------- /Client/Client.vcproj.Tiger-PC.Administrator.user: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 11 | 35 | 36 | 39 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /Client/ClientDlg.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sxcong/rttim/57cea98fd80e4a7aa9c62441c112cc621c6db884/Client/ClientDlg.cpp -------------------------------------------------------------------------------- /Client/ClientDlg.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sxcong/rttim/57cea98fd80e4a7aa9c62441c112cc621c6db884/Client/ClientDlg.h -------------------------------------------------------------------------------- /Client/DirectShow/Include/Mpeg2Bits.h: -------------------------------------------------------------------------------- 1 | ///////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (c) Microsoft Corporation. All rights reserved. 4 | // 5 | // Module Name: 6 | // 7 | // Mpeg2Bits.h 8 | // 9 | // Abstract: 10 | // 11 | // This file defines the MPEG-2 section header bitfields. These are 12 | // defined here instead of in mpegstructs.idl because of MIDL 13 | // compiler conflicts with bitfield definitions. 14 | // 15 | ///////////////////////////////////////////////////////////////////////////// 16 | 17 | #pragma once 18 | 19 | #pragma pack(push) 20 | #pragma pack(1) 21 | 22 | 23 | // 24 | // PID structure 25 | // 26 | 27 | #ifdef __midl 28 | 29 | typedef struct 30 | { 31 | WORD Bits; 32 | } PID_BITS_MIDL; 33 | 34 | #else 35 | 36 | typedef struct 37 | { 38 | WORD Reserved : 3; 39 | WORD ProgramId : 13; 40 | } PID_BITS, *PPID_BITS; 41 | 42 | #endif 43 | 44 | 45 | 46 | // 47 | // Generic MPEG packet header structure 48 | // 49 | 50 | #ifdef __midl 51 | 52 | typedef struct 53 | { 54 | WORD Bits; 55 | } MPEG_HEADER_BITS_MIDL; 56 | 57 | #else 58 | 59 | typedef struct 60 | { 61 | WORD SectionLength : 12; 62 | WORD Reserved : 2; 63 | WORD PrivateIndicator : 1; 64 | WORD SectionSyntaxIndicator : 1; 65 | } MPEG_HEADER_BITS, *PMPEG_HEADER_BITS; 66 | 67 | #endif 68 | 69 | 70 | 71 | // 72 | // Long MPEG packet header structure 73 | // 74 | 75 | #ifdef __midl 76 | 77 | typedef struct 78 | { 79 | BYTE Bits; 80 | } MPEG_HEADER_VERSION_BITS_MIDL; 81 | 82 | #else 83 | 84 | typedef struct 85 | { 86 | BYTE CurrentNextIndicator : 1; 87 | BYTE VersionNumber : 5; 88 | BYTE Reserved : 2; 89 | } MPEG_HEADER_VERSION_BITS, *PMPEG_HEADER_VERSION_BITS; 90 | 91 | #endif 92 | 93 | 94 | 95 | #pragma pack(pop) 96 | -------------------------------------------------------------------------------- /Client/DirectShow/Include/Msvidctl.tlb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sxcong/rttim/57cea98fd80e4a7aa9c62441c112cc621c6db884/Client/DirectShow/Include/Msvidctl.tlb -------------------------------------------------------------------------------- /Client/DirectShow/Include/Tuner.tlb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sxcong/rttim/57cea98fd80e4a7aa9c62441c112cc621c6db884/Client/DirectShow/Include/Tuner.tlb -------------------------------------------------------------------------------- /Client/DirectShow/Include/activecf.h: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // File: ActiveCf.h 3 | // 4 | // Desc: Contains the data formats for the transfer of VfW4 filters via the 5 | // clipboard. 6 | // 7 | // Copyright (c) 1992-2001, Microsoft Corporation. All rights reserved. 8 | //------------------------------------------------------------------------------ 9 | 10 | 11 | #define CFSTR_VFW_FILTERLIST "Video for Windows 4 Filters" 12 | 13 | typedef struct tagVFW_FILTERLIST{ 14 | UINT cFilters; // number of CLSIDs in aClsId 15 | CLSID aClsId[1]; // ClsId of each filter 16 | 17 | } VFW_FILTERLIST; 18 | 19 | 20 | -------------------------------------------------------------------------------- /Client/DirectShow/Include/amaudio.h: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // File: AMAudio.h 3 | // 4 | // Desc: Audio related definitions and interfaces for ActiveMovie. 5 | // 6 | // Copyright (c) 1992-2001, Microsoft Corporation. All rights reserved. 7 | //------------------------------------------------------------------------------ 8 | 9 | 10 | #ifndef __AMAUDIO__ 11 | #define __AMAUDIO__ 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif // __cplusplus 16 | 17 | #include 18 | #include 19 | 20 | // This is the interface the audio renderer supports to give the application 21 | // access to the direct sound object and the buffers it is using, to allow the 22 | // application to use things like the 3D features of Direct Sound for the 23 | // soundtrack of a movie being played with Active Movie. 24 | 25 | // be nice to our friends in C 26 | #undef INTERFACE 27 | #define INTERFACE IAMDirectSound 28 | 29 | DECLARE_INTERFACE_(IAMDirectSound,IUnknown) 30 | { 31 | /* IUnknown methods */ 32 | 33 | STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID *ppvObj) PURE; 34 | STDMETHOD_(ULONG,AddRef)(THIS) PURE; 35 | STDMETHOD_(ULONG,Release)(THIS) PURE; 36 | 37 | /* IAMDirectSound methods */ 38 | 39 | STDMETHOD(GetDirectSoundInterface)(THIS_ LPDIRECTSOUND *lplpds) PURE; 40 | STDMETHOD(GetPrimaryBufferInterface)(THIS_ LPDIRECTSOUNDBUFFER *lplpdsb) PURE; 41 | STDMETHOD(GetSecondaryBufferInterface)(THIS_ LPDIRECTSOUNDBUFFER *lplpdsb) PURE; 42 | STDMETHOD(ReleaseDirectSoundInterface)(THIS_ LPDIRECTSOUND lpds) PURE; 43 | STDMETHOD(ReleasePrimaryBufferInterface)(THIS_ LPDIRECTSOUNDBUFFER lpdsb) PURE; 44 | STDMETHOD(ReleaseSecondaryBufferInterface)(THIS_ LPDIRECTSOUNDBUFFER lpdsb) PURE; 45 | STDMETHOD(SetFocusWindow)(THIS_ HWND, BOOL) PURE ; 46 | STDMETHOD(GetFocusWindow)(THIS_ HWND *, BOOL*) PURE ; 47 | }; 48 | 49 | 50 | #ifdef __cplusplus 51 | } 52 | #endif // __cplusplus 53 | #endif // __AMAUDIO__ 54 | 55 | -------------------------------------------------------------------------------- /Client/DirectShow/Include/amparse.h: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // File: AMParse.h 3 | // 4 | // Desc: Interface to the parser to get current time. This is useful for 5 | // multifile playback. 6 | // 7 | // Copyright (c) 1996-2001, Microsoft Corporation. All rights reserved. 8 | //------------------------------------------------------------------------------ 9 | 10 | 11 | #ifndef __AMPARSE__ 12 | #define __AMPARSE__ 13 | 14 | #ifdef __cplusplus 15 | extern "C" { 16 | #endif // __cplusplus 17 | 18 | 19 | DEFINE_GUID(IID_IAMParse, 20 | 0xc47a3420, 0x005c, 0x11d2, 0x90, 0x38, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x98); 21 | 22 | // 23 | // Parser interface - supported by MPEG-2 splitter filter 24 | // 25 | DECLARE_INTERFACE_(IAMParse, IUnknown) { 26 | STDMETHOD(GetParseTime) (THIS_ 27 | REFERENCE_TIME *prtCurrent 28 | ) PURE; 29 | STDMETHOD(SetParseTime) (THIS_ 30 | REFERENCE_TIME rtCurrent 31 | ) PURE; 32 | STDMETHOD(Flush) (THIS) PURE; 33 | }; 34 | 35 | #ifdef __cplusplus 36 | } 37 | #endif // __cplusplus 38 | #endif // __AMPARSE__ 39 | -------------------------------------------------------------------------------- /Client/DirectShow/Include/atsmedia.h: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // File: ATSMedia.h 3 | // 4 | // Desc: Broadcast Driver Architecture Media Definitions for ATSC 5 | // 6 | // Copyright (c) 1996-2001, Microsoft Corporation. All rights reserved. 7 | //------------------------------------------------------------------------------ 8 | 9 | 10 | #if !defined(_KSMEDIA_) 11 | #error KSMEDIA.H must be included before BDAMEDIA.H 12 | #endif // !defined(_KSMEDIA_) 13 | 14 | #if !defined(_BDAMEDIA_) 15 | #error BDAMEDIA.H must be included before ATSCMEDIA.H 16 | #endif // !defined(_KSMEDIA_) 17 | 18 | #if !defined(_ATSCMEDIA_) 19 | #define _ATSCMEDIA_ 20 | 21 | 22 | //=========================================================================== 23 | // 24 | // ATSC Network Type 25 | // 26 | //=========================================================================== 27 | 28 | #define STATIC_BDANETWORKTYPE_ATSC\ 29 | 0x71985f51, 0x1ca1, 0x11d3, 0x9c, 0xc8, 0x0, 0xc0, 0x4f, 0x79, 0x71, 0xe0 30 | DEFINE_GUIDSTRUCT("71985F51-1CA1-11d3-9CC8-00C04F7971E0", BDANETWORKTYPE_ATSC); 31 | #define BDANETWORKTYPE_ATSC DEFINE_GUIDNAMED(BDANETWORKTYPE_ATSC) 32 | 33 | 34 | #endif // _ATSCMEDIA_ 35 | -------------------------------------------------------------------------------- /Client/DirectShow/Include/audevcod.h: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // File: AudEvCod.h 3 | // 4 | // Desc: List of Audio device error event codes and the expected params. 5 | // 6 | // Copyright (c) 1999-2001, Microsoft Corporation. All rights reserved. 7 | //------------------------------------------------------------------------------ 8 | 9 | 10 | 11 | #ifndef __AUDEVCOD__ 12 | #define __AUDEVCOD__ 13 | 14 | 15 | #define EC_SND_DEVICE_ERROR_BASE 0x0200 16 | 17 | typedef enum _tagSND_DEVICE_ERROR { 18 | 19 | SNDDEV_ERROR_Open=1, 20 | SNDDEV_ERROR_Close=2, 21 | SNDDEV_ERROR_GetCaps=3, 22 | SNDDEV_ERROR_PrepareHeader=4, 23 | SNDDEV_ERROR_UnprepareHeader=5, 24 | SNDDEV_ERROR_Reset=6, 25 | SNDDEV_ERROR_Restart=7, 26 | SNDDEV_ERROR_GetPosition=8, 27 | SNDDEV_ERROR_Write=9, 28 | SNDDEV_ERROR_Pause=10, 29 | SNDDEV_ERROR_Stop=11, 30 | SNDDEV_ERROR_Start=12, 31 | SNDDEV_ERROR_AddBuffer=13, 32 | SNDDEV_ERROR_Query=14, 33 | 34 | } SNDDEV_ERR; 35 | 36 | 37 | // Sound device error event codes 38 | // ============================== 39 | // 40 | // All audio device error events are always passed on to the application, and are 41 | // never processed by the filter graph 42 | 43 | 44 | #define EC_SNDDEV_IN_ERROR (EC_SND_DEVICE_ERROR_BASE + 0x00) 45 | #define EC_SNDDEV_OUT_ERROR (EC_SND_DEVICE_ERROR_BASE + 0x01) 46 | // Parameters: ( DWORD, DWORD) 47 | // lParam1 is an enum SND_DEVICE_ERROR which notifies the app how the device was 48 | // being accessed when the failure occurred. 49 | // 50 | // lParam2 is the error returned from the sound device call. 51 | // 52 | 53 | #endif // __AUDEVCOD__ 54 | -------------------------------------------------------------------------------- /Client/DirectShow/Include/comlite.h: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // File: COMLite.h 3 | // 4 | // Desc: This header file is to provide a migration path for users of 5 | // ActiveMovie betas 1 and 2. 6 | // 7 | // Copyright (c) 1992-2001, Microsoft Corporation. All rights reserved. 8 | //------------------------------------------------------------------------------ 9 | 10 | 11 | #ifndef _INC_COMLITE_ 12 | #define _INC_COMLITE_ 13 | 14 | #define QzInitialize CoInitialize 15 | #define QzUninitialize CoUninitialize 16 | #define QzFreeUnusedLibraries CoFreeUnusedLibraries 17 | 18 | #define QzGetMalloc CoGetMalloc 19 | #define QzTaskMemAlloc CoTaskMemAlloc 20 | #define QzTaskMemRealloc CoTaskMemRealloc 21 | #define QzTaskMemFree CoTaskMemFree 22 | #define QzCreateFilterObject CoCreateInstance 23 | #define QzCLSIDFromString CLSIDFromString 24 | #define QzStringFromGUID2 StringFromGUID2 25 | 26 | #endif // _INC_COMLITE_ 27 | -------------------------------------------------------------------------------- /Client/DirectShow/Include/d3d9types.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sxcong/rttim/57cea98fd80e4a7aa9c62441c112cc621c6db884/Client/DirectShow/Include/d3d9types.h -------------------------------------------------------------------------------- /Client/DirectShow/Include/d3drmwin.h: -------------------------------------------------------------------------------- 1 | /*==========================================================================; 2 | * 3 | * Copyright (c) Microsoft Corporation. All rights reserved. 4 | * 5 | * File: d3drm.h 6 | * Content: Direct3DRM include file 7 | * 8 | ***************************************************************************/ 9 | 10 | #ifndef __D3DRMWIN_H__ 11 | #define __D3DRMWIN_H__ 12 | 13 | #ifndef WIN32 14 | #define WIN32 15 | #endif 16 | 17 | #include "d3drm.h" 18 | 19 | #include "ddraw.h" 20 | #include "d3d.h" 21 | 22 | /* 23 | * GUIDS used by Direct3DRM Windows interface 24 | */ 25 | DEFINE_GUID(IID_IDirect3DRMWinDevice, 0xc5016cc0, 0xd273, 0x11ce, 0xac, 0x48, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); 26 | 27 | WIN_TYPES(IDirect3DRMWinDevice, DIRECT3DRMWINDEVICE); 28 | 29 | #undef INTERFACE 30 | #define INTERFACE IDirect3DRMWinDevice 31 | 32 | DECLARE_INTERFACE_(IDirect3DRMWinDevice, IDirect3DRMObject) 33 | { 34 | IUNKNOWN_METHODS(PURE); 35 | IDIRECT3DRMOBJECT_METHODS(PURE); 36 | 37 | /* 38 | * IDirect3DRMWinDevice methods 39 | */ 40 | 41 | /* Repaint the window with the last frame which was rendered. */ 42 | STDMETHOD(HandlePaint)(THIS_ HDC hdc) PURE; 43 | 44 | /* Respond to a WM_ACTIVATE message. */ 45 | STDMETHOD(HandleActivate)(THIS_ WORD wparam) PURE; 46 | }; 47 | 48 | 49 | #endif 50 | 51 | -------------------------------------------------------------------------------- /Client/DirectShow/Include/d3dx.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (C) Microsoft Corporation. All Rights Reserved. 4 | // 5 | // File: d3dx.h 6 | // Content: D3DX utility library 7 | // 8 | /////////////////////////////////////////////////////////////////////////// 9 | 10 | #ifndef __D3DX_H__ 11 | #define __D3DX_H__ 12 | 13 | #ifndef D3DXINLINE 14 | #ifdef __cplusplus 15 | #define D3DXINLINE inline 16 | #else 17 | #define D3DXINLINE _inline 18 | #endif 19 | #endif 20 | 21 | #include "d3dxcore.h" 22 | #include "d3dxmath.h" 23 | #include "d3dxshapes.h" 24 | #include "d3dxsprite.h" 25 | 26 | #endif //__D3DX_H__ 27 | -------------------------------------------------------------------------------- /Client/DirectShow/Include/d3dx8.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (C) Microsoft Corporation. All Rights Reserved. 4 | // 5 | // File: d3dx8.h 6 | // Content: D3DX utility library 7 | // 8 | /////////////////////////////////////////////////////////////////////////// 9 | 10 | #ifndef __D3DX8_H__ 11 | #define __D3DX8_H__ 12 | 13 | #include "d3d8.h" 14 | #include 15 | 16 | #ifndef D3DXINLINE 17 | #ifdef _MSC_VER 18 | #if (_MSC_VER >= 1200) 19 | #define D3DXINLINE __forceinline 20 | #else 21 | #define D3DXINLINE __inline 22 | #endif 23 | #else 24 | #ifdef __cplusplus 25 | #define D3DXINLINE inline 26 | #else 27 | #define D3DXINLINE 28 | #endif 29 | #endif 30 | #endif 31 | 32 | 33 | #define D3DX_DEFAULT ULONG_MAX 34 | #define D3DX_DEFAULT_FLOAT FLT_MAX 35 | 36 | #include "d3dx8math.h" 37 | #include "d3dx8core.h" 38 | #include "d3dx8tex.h" 39 | #include "d3dx8mesh.h" 40 | #include "d3dx8shape.h" 41 | #include "d3dx8effect.h" 42 | 43 | 44 | #endif //__D3DX8_H__ 45 | 46 | -------------------------------------------------------------------------------- /Client/DirectShow/Include/d3dx9.h: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (C) Microsoft Corporation. All Rights Reserved. 4 | // 5 | // File: d3dx9.h 6 | // Content: D3DX utility library 7 | // 8 | ////////////////////////////////////////////////////////////////////////////// 9 | 10 | #ifdef __D3DX_INTERNAL__ 11 | #error Incorrect D3DX header used 12 | #endif 13 | 14 | #ifndef __D3DX9_H__ 15 | #define __D3DX9_H__ 16 | 17 | 18 | // Defines 19 | #include 20 | 21 | #define D3DX_DEFAULT ((UINT) -1) 22 | #define D3DX_DEFAULT_NONPOW2 ((UINT) -2) 23 | #define D3DX_DEFAULT_FLOAT FLT_MAX 24 | 25 | #ifndef D3DXINLINE 26 | #ifdef _MSC_VER 27 | #if (_MSC_VER >= 1200) 28 | #define D3DXINLINE __forceinline 29 | #else 30 | #define D3DXINLINE __inline 31 | #endif 32 | #else 33 | #ifdef __cplusplus 34 | #define D3DXINLINE inline 35 | #else 36 | #define D3DXINLINE 37 | #endif 38 | #endif 39 | #endif 40 | 41 | 42 | 43 | // Includes 44 | #include "d3d9.h" 45 | #include "d3dx9math.h" 46 | #include "d3dx9core.h" 47 | #include "d3dx9mesh.h" 48 | #include "d3dx9tex.h" 49 | #include "d3dx9shader.h" 50 | #include "d3dx9effect.h" 51 | #include "d3dx9shape.h" 52 | #include "d3dx9anim.h" 53 | 54 | 55 | // Errors 56 | #define _FACDD 0x876 57 | #define MAKE_DDHRESULT( code ) MAKE_HRESULT( 1, _FACDD, code ) 58 | 59 | enum _D3DXERR { 60 | D3DXERR_CANNOTMODIFYINDEXBUFFER = MAKE_DDHRESULT(2900), 61 | D3DXERR_INVALIDMESH = MAKE_DDHRESULT(2901), 62 | D3DXERR_CANNOTATTRSORT = MAKE_DDHRESULT(2902), 63 | D3DXERR_SKINNINGNOTSUPPORTED = MAKE_DDHRESULT(2903), 64 | D3DXERR_TOOMANYINFLUENCES = MAKE_DDHRESULT(2904), 65 | D3DXERR_INVALIDDATA = MAKE_DDHRESULT(2905), 66 | D3DXERR_LOADEDMESHASNODATA = MAKE_DDHRESULT(2906), 67 | D3DXERR_DUPLICATENAMEDFRAGMENT = MAKE_DDHRESULT(2907), 68 | }; 69 | 70 | 71 | #endif //__D3DX9_H__ 72 | 73 | -------------------------------------------------------------------------------- /Client/DirectShow/Include/dmo.h: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // File: DMO.h 3 | // 4 | // Desc: Headers needed by almost all DMOs. 5 | // 6 | // Copyright (c) 1999 - 2001, Microsoft Corporation. All rights reserved. 7 | //------------------------------------------------------------------------------ 8 | 9 | 10 | #ifndef __DMO_H__ 11 | #define __DMO_H__ 12 | 13 | 14 | #include "mediaerr.h" 15 | 16 | // When using ATL we get collisions on Lock, so in this case rename 17 | // IMediaObject::Lock to IMediaObject::DMOLock 18 | 19 | #ifdef FIX_LOCK_NAME 20 | #define Lock DMOLock 21 | #endif 22 | #include "mediaobj.h" 23 | #ifdef FIX_LOCK_NAME 24 | #undef Lock 25 | #endif 26 | #include "dmoreg.h" 27 | #include "dmort.h" 28 | 29 | #endif //__DMO_H__ 30 | -------------------------------------------------------------------------------- /Client/DirectShow/Include/dmusbuff.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * * 3 | * DMusBuff.h -- This module defines the buffer format for DirectMusic * 4 | * Shared file between user mode and kernel mode components * 5 | * * 6 | * Copyright (c) 1998, Microsoft Corp. All rights reserved. * 7 | * * 8 | ***************************************************************************/ 9 | 10 | #ifndef _DMusBuff_ 11 | #define _DMusBuff_ 12 | 13 | /* Format of DirectMusic events in a buffer 14 | * 15 | * A buffer contains 1 or more events, each with the following header. 16 | * Immediately following the header is the event data. The header+data 17 | * size is rounded to the nearest quadword (8 bytes). 18 | */ 19 | 20 | #include /* Do not pad at end - that's where the data is */ 21 | typedef struct _DMUS_EVENTHEADER *LPDMUS_EVENTHEADER; 22 | typedef struct _DMUS_EVENTHEADER 23 | { 24 | DWORD cbEvent; /* Unrounded bytes in event */ 25 | DWORD dwChannelGroup; /* Channel group of event */ 26 | REFERENCE_TIME rtDelta; /* Delta from start time of entire buffer */ 27 | DWORD dwFlags; /* Flags DMUS_EVENT_xxx */ 28 | } DMUS_EVENTHEADER; 29 | #include 30 | 31 | #define DMUS_EVENT_STRUCTURED 0x00000001 /* Unstructured data (SysEx, etc.) */ 32 | 33 | /* The number of bytes to allocate for an event with 'cb' data bytes. 34 | */ 35 | #define QWORD_ALIGN(x) (((x) + 7) & ~7) 36 | #define DMUS_EVENT_SIZE(cb) QWORD_ALIGN(sizeof(DMUS_EVENTHEADER) + cb) 37 | 38 | 39 | #endif /* _DMusBuff_ */ 40 | 41 | 42 | -------------------------------------------------------------------------------- /Client/DirectShow/Include/dv.h: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // File: DV.h 3 | // 4 | // Desc: DV typedefs and defines 5 | // 6 | // Copyright (c) 1997-2001, Microsoft Corporation. All rights reserved. 7 | //------------------------------------------------------------------------------ 8 | 9 | 10 | #ifndef _DV_H_ 11 | #define _DV_H_ 12 | 13 | #define DV_DVSD_NTSC_FRAMESIZE 120000L 14 | #define DV_DVSD_PAL_FRAMESIZE 144000L 15 | 16 | #define DV_SMCHN 0x0000e000 17 | #define DV_AUDIOMODE 0x00000f00 18 | #define DV_AUDIOSMP 0x38000000 19 | 20 | #define DV_AUDIOQU 0x07000000 21 | #define DV_NTSCPAL 0x00200000 22 | #define DV_STYPE 0x001f0000 23 | 24 | 25 | //There are NTSC or PAL DV camcorders 26 | #define DV_NTSC 0 27 | #define DV_PAL 1 28 | 29 | //DV camcorder can output sd/hd/sl 30 | #define DV_SD 0x00 31 | #define DV_HD 0x01 32 | #define DV_SL 0x02 33 | 34 | //user can choice 12 bits or 16 bits audio from DV camcorder 35 | #define DV_CAP_AUD16Bits 0x00 36 | #define DV_CAP_AUD12Bits 0x01 37 | 38 | #define SIZE_DVINFO 0x20 39 | 40 | typedef struct Tag_DVAudInfo 41 | { 42 | BYTE bAudStyle[2]; 43 | 44 | //LSB 6 bits for starting DIF sequence number 45 | //MSB 2 bits: 0 for mon. 1: stereo in one 5/6 DIF sequences, 2: stereo audio in both 5/6 DIF sequences 46 | //example: 0x00: mon, audio in first 5/6 DIF sequence 47 | // 0x05: mon, audio in 2nd 5 DIF sequence 48 | // 0x15: stereo, audio only in 2nd 5 DIF sequence 49 | // 0x10: stereo, audio only in 1st 5/6 DIF sequence 50 | // 0x20: stereo, left ch in 1st 5/6 DIF sequence, right ch in 2nd 5/6 DIF sequence 51 | // 0x26: stereo, rightch in 1st 6 DIF sequence, left ch in 2nd 6 DIF sequence 52 | BYTE bAudQu[2]; //qbits, only support 12, 16, 53 | 54 | BYTE bNumAudPin; //how many pins 55 | WORD wAvgSamplesPerPinPerFrm[2]; //sample size for one audio pin in one frame(which has 10 or 12 DIF sequence) 56 | WORD wBlkMode; //45 for NTSC, 54 for PAL 57 | WORD wDIFMode; //5 for NTSC, 6 for PAL 58 | WORD wBlkDiv; //15 for NTSC, 18 for PAL 59 | 60 | } DVAudInfo; 61 | 62 | #endif // _DV_H_ 63 | -------------------------------------------------------------------------------- /Client/DirectShow/Include/edevdefs.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sxcong/rttim/57cea98fd80e4a7aa9c62441c112cc621c6db884/Client/DirectShow/Include/edevdefs.h -------------------------------------------------------------------------------- /Client/DirectShow/Include/errors.h: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // File: Errors.h 3 | // 4 | // Desc: ActiveMovie error defines. 5 | // 6 | // Copyright (c) 1992-2001, Microsoft Corporation. All rights reserved. 7 | //------------------------------------------------------------------------------ 8 | 9 | 10 | #ifndef __ERRORS__ 11 | #define __ERRORS__ 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif // __cplusplus 16 | 17 | #ifndef _AMOVIE_ 18 | #define AMOVIEAPI DECLSPEC_IMPORT 19 | #else 20 | #define AMOVIEAPI 21 | #endif 22 | 23 | // codes 0-01ff are reserved for OLE 24 | #define VFW_FIRST_CODE 0x200 25 | #define MAX_ERROR_TEXT_LEN 160 26 | 27 | #include // includes all message definitions 28 | 29 | typedef BOOL (WINAPI* AMGETERRORTEXTPROCA)(HRESULT, char *, DWORD); 30 | typedef BOOL (WINAPI* AMGETERRORTEXTPROCW)(HRESULT, WCHAR *, DWORD); 31 | 32 | AMOVIEAPI DWORD WINAPI AMGetErrorTextA( HRESULT hr , char *pbuffer , DWORD MaxLen); 33 | AMOVIEAPI DWORD WINAPI AMGetErrorTextW( HRESULT hr , WCHAR *pbuffer , DWORD MaxLen); 34 | 35 | 36 | #ifdef UNICODE 37 | #define AMGetErrorText AMGetErrorTextW 38 | typedef AMGETERRORTEXTPROCW AMGETERRORTEXTPROC; 39 | #else 40 | #define AMGetErrorText AMGetErrorTextA 41 | typedef AMGETERRORTEXTPROCA AMGETERRORTEXTPROC; 42 | #endif 43 | 44 | #ifdef __cplusplus 45 | } 46 | #endif // __cplusplus 47 | #endif // __ERRORS__ 48 | -------------------------------------------------------------------------------- /Client/DirectShow/Include/ksguid.h: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | Module Name: 6 | 7 | ksguid.h 8 | 9 | Abstract: 10 | 11 | Define guids for non-C++. 12 | 13 | --*/ 14 | 15 | #define INITGUID 16 | #include 17 | 18 | #if defined( DEFINE_GUIDEX ) 19 | #undef DEFINE_GUIDEX 20 | #endif 21 | #define DEFINE_GUIDEX(name) EXTERN_C const CDECL GUID __declspec(selectany) name = { STATICGUIDOF(name) } 22 | 23 | #ifndef STATICGUIDOF 24 | #define STATICGUIDOF(guid) STATIC_##guid 25 | #endif // !defined(STATICGUIDOF) 26 | 27 | #if !defined( DEFINE_WAVEFORMATEX_GUID ) 28 | #define DEFINE_WAVEFORMATEX_GUID(x) (USHORT)(x), 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 29 | #endif 30 | -------------------------------------------------------------------------------- /Client/DirectShow/Include/mediaerr.h: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // File: MediaErr.h 3 | // 4 | // Desc: Shell error codes 5 | // 6 | // Copyright (c) 1999 - 2001, Microsoft Corporation. All rights reserved. 7 | //------------------------------------------------------------------------------ 8 | 9 | 10 | #ifndef _MEDIAERR_H_ 11 | #define _MEDIAERR_H_ 12 | 13 | #define DMO_E_INVALIDSTREAMINDEX 0x80040201 14 | #define DMO_E_INVALIDTYPE 0x80040202 15 | #define DMO_E_TYPE_NOT_SET 0x80040203 16 | #define DMO_E_NOTACCEPTING 0x80040204 17 | #define DMO_E_TYPE_NOT_ACCEPTED 0x80040205 18 | #define DMO_E_NO_MORE_ITEMS 0x80040206 19 | 20 | #endif _MEDIAERR_H_ 21 | -------------------------------------------------------------------------------- /Client/DirectShow/Include/xprtdefs.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sxcong/rttim/57cea98fd80e4a7aa9c62441c112cc621c6db884/Client/DirectShow/Include/xprtdefs.h -------------------------------------------------------------------------------- /Client/DirectShow/Lib/strmiids.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sxcong/rttim/57cea98fd80e4a7aa9c62441c112cc621c6db884/Client/DirectShow/Lib/strmiids.lib -------------------------------------------------------------------------------- /Client/ReadMe.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sxcong/rttim/57cea98fd80e4a7aa9c62441c112cc621c6db884/Client/ReadMe.txt -------------------------------------------------------------------------------- /Client/UDPSession.h: -------------------------------------------------------------------------------- 1 | // RTPSession.h: interface for the RTPSession class. 2 | // 3 | ////////////////////////////////////////////////////////////////////// 4 | 5 | #if !defined(AFX_RTPSESSION_H__E0363A1C_703C_456A_9E3A_5FED274429BF__INCLUDED_) 6 | #define AFX_RTPSESSION_H__E0363A1C_703C_456A_9E3A_5FED274429BF__INCLUDED_ 7 | 8 | 9 | #include "UDPSock.h" 10 | #include "global.h" 11 | #include "stdint.h" 12 | #include 13 | #include 14 | using namespace std; 15 | 16 | #include "evbuffer.h" 17 | 18 | class CUDPSession 19 | { 20 | public: 21 | CUDPSession(); 22 | virtual ~CUDPSession(); 23 | int Open(uint16_t usLocalPort, udp_data_cb cb, void* param); 24 | int Close(); 25 | 26 | int SendRaw(char* pBuff, uint32_t nLen, uint32_t ip, uint16_t port); 27 | int Send(char* pBuff,uint32_t nLen,uint32_t ip,uint16_t port); 28 | 29 | uint32_t m_localUid; 30 | uint32_t m_destUid; 31 | uint32_t m_destIP; 32 | uint32_t m_destPort; 33 | uint32_t m_timestamp; 34 | 35 | udp_data_cb m_pCB; 36 | void* m_pParam; 37 | 38 | struct evbuffer *m_buffer;; 39 | 40 | 41 | private: 42 | static void* EventLoop(void* lpParameter ); 43 | void ProcessEvent(); 44 | 45 | int Reassemble(CPackIn& pack, uint32_t ip, uint32_t port); 46 | int OnRecv(char* pBuff,uint32_t nLen, uint32_t ip,uint16_t port); 47 | int SendPacket(CPackOut* pPack, uint32_t ip, uint32_t port); 48 | void OnTimer(); 49 | 50 | 51 | bool m_bEventLoopStarted; 52 | CUDPSock m_udpIO; 53 | pthread_t m_tid; 54 | 55 | uint32_t m_nFrameIndex; 56 | uint32_t m_nRecvFrameIndex; 57 | 58 | 59 | int SplitData(char* pBuff, uint32_t nLen); 60 | }; 61 | 62 | #endif // !defined(AFX_RTPSESSION_H__E0363A1C_703C_456A_9E3A_5FED274429BF__INCLUDED_) 63 | -------------------------------------------------------------------------------- /Client/UDPSock.h: -------------------------------------------------------------------------------- 1 | // RTPSock.h: interface for the CRTPSock class. 2 | // 3 | ////////////////////////////////////////////////////////////////////// 4 | 5 | #if !defined(AFX_RTPSOCK_H__1190002F_8701_406A_8BEF_FD4053D18C20__INCLUDED_) 6 | #define AFX_RTPSOCK_H__1190002F_8701_406A_8BEF_FD4053D18C20__INCLUDED_ 7 | 8 | #if _MSC_VER > 1000 9 | #pragma once 10 | #endif // _MSC_VER > 1000 11 | 12 | 13 | 14 | 15 | #define RUDP_RECV_BUFFER_SIZE 1500 16 | 17 | class CUDPSock 18 | { 19 | public: 20 | CUDPSock(); 21 | virtual ~CUDPSock(); 22 | 23 | int Open(int nPort); 24 | 25 | int Close(); 26 | 27 | int Send( const char* pBuf, size_t nLen, uint32_t ip, uint16_t port ) const; 28 | 29 | int Receive(char* pBuf, size_t nLen, uint32_t& ip, uint16_t& port) const; 30 | 31 | 32 | int m_handle; 33 | 34 | }; 35 | 36 | #endif // !defined(AFX_RTPSOCK_H__1190002F_8701_406A_8BEF_FD4053D18C20__INCLUDED_) 37 | -------------------------------------------------------------------------------- /Client/VideoDec.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sxcong/rttim/57cea98fd80e4a7aa9c62441c112cc621c6db884/Client/VideoDec.cpp -------------------------------------------------------------------------------- /Client/VideoDec.h: -------------------------------------------------------------------------------- 1 | // VideoDec.h: interface for the CVideoDec class. 2 | // 3 | ////////////////////////////////////////////////////////////////////// 4 | 5 | #if !defined(AFX_VIDEODEC_H__886325CC_EA9A_40EC_A0FE_6C68048052C1__INCLUDED_) 6 | #define AFX_VIDEODEC_H__886325CC_EA9A_40EC_A0FE_6C68048052C1__INCLUDED_ 7 | 8 | #if _MSC_VER > 1000 9 | #pragma once 10 | #endif // _MSC_VER > 1000 11 | 12 | typedef void (*VDecodeCB)(BYTE* pData, UINT nLen, void* lpParam); 13 | 14 | class CVideoDec 15 | { 16 | public: 17 | CVideoDec(); 18 | virtual ~CVideoDec(); 19 | int Dec_Init(UINT nWidth,UINT nHeight,UINT nFrame,UINT nBitrate,VDecodeCB CB, void* param); 20 | void Dec_UnInit(); 21 | 22 | int decode_frame(BYTE* input,int nLen); 23 | 24 | private: 25 | AVCodec *decode_codec; 26 | AVCodecContext *decode_c; 27 | AVFrame *decode_picture; 28 | 29 | struct SwsContext *img_convert_ctx; 30 | 31 | UINT video_width; 32 | UINT video_height; 33 | UINT frame_rate; 34 | UINT bit_rate; 35 | 36 | bool m_bInit; 37 | 38 | VDecodeCB m_fVDecodeCB; 39 | void* m_pParam; 40 | }; 41 | 42 | #endif // !defined(AFX_VIDEODEC_H__886325CC_EA9A_40EC_A0FE_6C68048052C1__INCLUDED_) 43 | -------------------------------------------------------------------------------- /Client/VideoEnc.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sxcong/rttim/57cea98fd80e4a7aa9c62441c112cc621c6db884/Client/VideoEnc.cpp -------------------------------------------------------------------------------- /Client/VideoEnc.h: -------------------------------------------------------------------------------- 1 | // VideoEnc.h: interface for the CVideoEnc class. 2 | // 3 | ////////////////////////////////////////////////////////////////////// 4 | 5 | #if !defined(AFX_VIDEOENC_H__2A48208D_E3DF_4D13_80A2_BB771FBC6EC8__INCLUDED_) 6 | #define AFX_VIDEOENC_H__2A48208D_E3DF_4D13_80A2_BB771FBC6EC8__INCLUDED_ 7 | 8 | #if _MSC_VER > 1000 9 | #pragma once 10 | #endif // _MSC_VER > 1000 11 | 12 | 13 | typedef struct _MP4ENC_NaluUnit 14 | { 15 | int type; 16 | int size; 17 | unsigned char *data; 18 | }MP4ENC_NaluUnit; 19 | 20 | typedef struct _MP4ENC_Metadata 21 | { 22 | // video, must be h264 type 23 | unsigned int nSpsLen; 24 | unsigned char Sps[1024]; 25 | unsigned int nPpsLen; 26 | unsigned char Pps[1024]; 27 | 28 | } MP4ENC_Metadata,*LPMP4ENC_Metadata; 29 | 30 | int PraseMetadata(const unsigned char* pData, int size,MP4ENC_Metadata &metadata); 31 | int ReadOneNaluFromBuf(const unsigned char *buffer,unsigned int nBufferSize,unsigned int offSet,MP4ENC_NaluUnit &nalu); 32 | 33 | 34 | typedef void (*VEncodeCB)(BYTE* pData, UINT nLen, void* lpParam); 35 | class CVideoEnc 36 | { 37 | public: 38 | CVideoEnc(); 39 | virtual ~CVideoEnc(); 40 | 41 | int Enc_Init(UINT nWidth,UINT nHeight,UINT nFrame,UINT nBitrate,VEncodeCB fCB, void* param); 42 | void Enc_UnInit(); 43 | int encode_frame(BYTE* input,int nLen); 44 | 45 | 46 | private: 47 | bool m_bInit; 48 | 49 | 50 | AVFrame *encode_picture; 51 | AVFrame *tmp_picture; 52 | 53 | UINT video_width; 54 | UINT video_height; 55 | UINT frame_rate; 56 | UINT bit_rate; 57 | 58 | UINT video_outbuf_size ; 59 | uint8_t *video_outbuf; 60 | 61 | VEncodeCB m_fVEncodeCB; 62 | 63 | AVCodec *codec; 64 | AVCodecContext *c; 65 | struct SwsContext *img_convert_ctx; 66 | void* m_pParam; 67 | }; 68 | 69 | #endif // !defined(AFX_VIDEOENC_H__2A48208D_E3DF_4D13_80A2_BB771FBC6EC8__INCLUDED_) 70 | -------------------------------------------------------------------------------- /Client/VideoWnd.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sxcong/rttim/57cea98fd80e4a7aa9c62441c112cc621c6db884/Client/VideoWnd.cpp -------------------------------------------------------------------------------- /Client/VideoWnd.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sxcong/rttim/57cea98fd80e4a7aa9c62441c112cc621c6db884/Client/VideoWnd.h -------------------------------------------------------------------------------- /Client/bin/Client.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sxcong/rttim/57cea98fd80e4a7aa9c62441c112cc621c6db884/Client/bin/Client.exe -------------------------------------------------------------------------------- /Client/bin/Client.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sxcong/rttim/57cea98fd80e4a7aa9c62441c112cc621c6db884/Client/bin/Client.pdb -------------------------------------------------------------------------------- /Client/bin/avcodec-55.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sxcong/rttim/57cea98fd80e4a7aa9c62441c112cc621c6db884/Client/bin/avcodec-55.dll -------------------------------------------------------------------------------- /Client/bin/avdevice-55.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sxcong/rttim/57cea98fd80e4a7aa9c62441c112cc621c6db884/Client/bin/avdevice-55.dll -------------------------------------------------------------------------------- /Client/bin/avfilter-4.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sxcong/rttim/57cea98fd80e4a7aa9c62441c112cc621c6db884/Client/bin/avfilter-4.dll -------------------------------------------------------------------------------- /Client/bin/avformat-55.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sxcong/rttim/57cea98fd80e4a7aa9c62441c112cc621c6db884/Client/bin/avformat-55.dll -------------------------------------------------------------------------------- /Client/bin/avutil-52.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sxcong/rttim/57cea98fd80e4a7aa9c62441c112cc621c6db884/Client/bin/avutil-52.dll -------------------------------------------------------------------------------- /Client/bin/libeay32.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sxcong/rttim/57cea98fd80e4a7aa9c62441c112cc621c6db884/Client/bin/libeay32.dll -------------------------------------------------------------------------------- /Client/bin/postproc-52.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sxcong/rttim/57cea98fd80e4a7aa9c62441c112cc621c6db884/Client/bin/postproc-52.dll -------------------------------------------------------------------------------- /Client/bin/pthreadVC2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sxcong/rttim/57cea98fd80e4a7aa9c62441c112cc621c6db884/Client/bin/pthreadVC2.dll -------------------------------------------------------------------------------- /Client/bin/sqlite3.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sxcong/rttim/57cea98fd80e4a7aa9c62441c112cc621c6db884/Client/bin/sqlite3.dll -------------------------------------------------------------------------------- /Client/bin/ssleay32.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sxcong/rttim/57cea98fd80e4a7aa9c62441c112cc621c6db884/Client/bin/ssleay32.dll -------------------------------------------------------------------------------- /Client/bin/swresample-0.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sxcong/rttim/57cea98fd80e4a7aa9c62441c112cc621c6db884/Client/bin/swresample-0.dll -------------------------------------------------------------------------------- /Client/bin/swscale-2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sxcong/rttim/57cea98fd80e4a7aa9c62441c112cc621c6db884/Client/bin/swscale-2.dll -------------------------------------------------------------------------------- /Client/global.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | 4 | #define UDP_BLOCK_SIZE 1200 5 | 6 | enum 7 | { 8 | PACK_TYPE_REQ = 0, 9 | PACK_TYPE_DATA = 1, 10 | PACK_TYPE_REQACK = 2, 11 | PACK_TYPE_DATAACK = 3, 12 | PACK_TYPE_FINISH = 4, 13 | PACK_TYPE_ACK_DATAACK = 5, 14 | }; 15 | 16 | #define SEND_WINDOIW_SIZE 128 17 | #define ONCE_MAX_ACK_NUM 8 18 | #define MAX_NO_ACK_TIMEOUT 2000 19 | #define MAX_NO_DATA_TIMEOUT 1000 20 | #define MAX_PACK_SIZE 1024 21 | 22 | #define MAX_VIDEOFRAME_SIZE 1024000 23 | 24 | 25 | typedef void (*udp_data_cb)(int sockid, char *data, int len, int ip, int port, void* param); 26 | 27 | class CPackIn 28 | { 29 | public: 30 | CPackIn(void); 31 | ~CPackIn(void); 32 | const CPackIn& operator>>(int& nData); 33 | const CPackIn& GetBuffer(char*& pBuffer, int& nSizeOut); 34 | void SetContent(char* pBuffer, int nLen); 35 | 36 | private: 37 | char* m_pBuf; 38 | int m_nReadPos; 39 | }; 40 | 41 | class CPackOut 42 | { 43 | public: 44 | CPackOut(void); 45 | ~CPackOut(void); 46 | const CPackOut& operator<<(int nData); 47 | const CPackOut& SetBuffer(char* pBuffer, int nSize); 48 | void GetContent(char*& pBuffer, int& nSizeOut); 49 | 50 | private: 51 | int m_nWritePos; 52 | char m_szBuffer[1500]; 53 | }; 54 | 55 | #define SAFE_RETURN(x) {HRESULT hr = (x); if(hr != S_OK) return hr;} 56 | #define SAFE_RELEASE(x) { if (x) x->Release(); x = NULL; } 57 | //#define SAFE_DELETE(x) { if (x) delete x; x = NULL; } 58 | 59 | 60 | #if defined(__WIN32__) || defined(_WIN32) 61 | // For Windoze, we need to implement our own gettimeofday() 62 | extern int gettimeofday(struct timeval*, int*); 63 | #endif -------------------------------------------------------------------------------- /Client/include/BasicUsageEnvironment/include/BasicUsageEnvironment_version.hh: -------------------------------------------------------------------------------- 1 | // Version information for the "BasicUsageEnvironment" library 2 | // Copyright (c) 1996-2013 Live Networks, Inc. All rights reserved. 3 | 4 | #ifndef _BASICUSAGEENVIRONMENT_VERSION_HH 5 | #define _BASICUSAGEENVIRONMENT_VERSION_HH 6 | 7 | #define BASICUSAGEENVIRONMENT_LIBRARY_VERSION_STRING "2013.11.15" 8 | #define BASICUSAGEENVIRONMENT_LIBRARY_VERSION_INT 1384473600 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /Client/include/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 | -------------------------------------------------------------------------------- /Client/include/UsageEnvironment/include/UsageEnvironment_version.hh: -------------------------------------------------------------------------------- 1 | // Version information for the "UsageEnvironment" library 2 | // Copyright (c) 1996-2013 Live Networks, Inc. All rights reserved. 3 | 4 | #ifndef _USAGEENVIRONMENT_VERSION_HH 5 | #define _USAGEENVIRONMENT_VERSION_HH 6 | 7 | #define USAGEENVIRONMENT_LIBRARY_VERSION_STRING "2013.11.15" 8 | #define USAGEENVIRONMENT_LIBRARY_VERSION_INT 1384473600 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /Client/include/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-2013 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 | char* strDup(char const* str); 26 | // Note: strDup(NULL) returns NULL 27 | 28 | char* strDupSize(char const* str); 29 | // Like "strDup()", except that it *doesn't* copy the original. 30 | // (Instead, it just allocates a string of the same size as the original.) 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /Client/include/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-2013 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 | -------------------------------------------------------------------------------- /Client/include/groupsock/include/groupsock_version.hh: -------------------------------------------------------------------------------- 1 | // Version information for the "groupsock" library 2 | // Copyright (c) 1996-2013 Live Networks, Inc. All rights reserved. 3 | 4 | #ifndef _GROUPSOCK_VERSION_HH 5 | #define _GROUPSOCK_VERSION_HH 6 | 7 | #define GROUPSOCK_LIBRARY_VERSION_STRING "2013.11.15" 8 | #define GROUPSOCK_LIBRARY_VERSION_INT 1384473600 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /Client/include/libavdevice/version.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of FFmpeg. 3 | * 4 | * FFmpeg is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * FFmpeg is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with FFmpeg; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #ifndef AVDEVICE_VERSION_H 20 | #define AVDEVICE_VERSION_H 21 | 22 | /** 23 | * @file 24 | * @ingroup lavd 25 | * Libavdevice version macros 26 | */ 27 | 28 | #include "libavutil/version.h" 29 | 30 | #define LIBAVDEVICE_VERSION_MAJOR 55 31 | #define LIBAVDEVICE_VERSION_MINOR 13 32 | #define LIBAVDEVICE_VERSION_MICRO 101 33 | 34 | #define LIBAVDEVICE_VERSION_INT AV_VERSION_INT(LIBAVDEVICE_VERSION_MAJOR, \ 35 | LIBAVDEVICE_VERSION_MINOR, \ 36 | LIBAVDEVICE_VERSION_MICRO) 37 | #define LIBAVDEVICE_VERSION AV_VERSION(LIBAVDEVICE_VERSION_MAJOR, \ 38 | LIBAVDEVICE_VERSION_MINOR, \ 39 | LIBAVDEVICE_VERSION_MICRO) 40 | #define LIBAVDEVICE_BUILD LIBAVDEVICE_VERSION_INT 41 | 42 | #define LIBAVDEVICE_IDENT "Lavd" AV_STRINGIFY(LIBAVDEVICE_VERSION) 43 | 44 | /** 45 | * FF_API_* defines may be placed below to indicate public API that will be 46 | * dropped at a future version bump. The defines themselves are not part of 47 | * the public API and may change, break or disappear at any time. 48 | */ 49 | 50 | #endif /* AVDEVICE_VERSION_H */ 51 | -------------------------------------------------------------------------------- /Client/include/libavfilter/avfiltergraph.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Filter graphs 3 | * copyright (c) 2007 Bobby Bingham 4 | * 5 | * This file is part of FFmpeg. 6 | * 7 | * FFmpeg 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 | * FFmpeg 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 FFmpeg; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | */ 21 | 22 | #ifndef AVFILTER_AVFILTERGRAPH_H 23 | #define AVFILTER_AVFILTERGRAPH_H 24 | 25 | #include "avfilter.h" 26 | #include "libavutil/log.h" 27 | 28 | #endif /* AVFILTER_AVFILTERGRAPH_H */ 29 | -------------------------------------------------------------------------------- /Client/include/libavutil/adler32.h: -------------------------------------------------------------------------------- 1 | /* 2 | * copyright (c) 2006 Mans Rullgard 3 | * 4 | * This file is part of FFmpeg. 5 | * 6 | * FFmpeg is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * FFmpeg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with FFmpeg; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef AVUTIL_ADLER32_H 22 | #define AVUTIL_ADLER32_H 23 | 24 | #include 25 | #include "attributes.h" 26 | 27 | /** 28 | * @file 29 | * Public header for libavutil Adler32 hasher 30 | * 31 | * @defgroup lavu_adler32 Adler32 32 | * @ingroup lavu_crypto 33 | * @{ 34 | */ 35 | 36 | /** 37 | * Calculate the Adler32 checksum of a buffer. 38 | * 39 | * Passing the return value to a subsequent av_adler32_update() call 40 | * allows the checksum of multiple buffers to be calculated as though 41 | * they were concatenated. 42 | * 43 | * @param adler initial checksum value 44 | * @param buf pointer to input buffer 45 | * @param len size of input buffer 46 | * @return updated checksum 47 | */ 48 | unsigned long av_adler32_update(unsigned long adler, const uint8_t *buf, 49 | unsigned int len) av_pure; 50 | 51 | /** 52 | * @} 53 | */ 54 | 55 | #endif /* AVUTIL_ADLER32_H */ 56 | -------------------------------------------------------------------------------- /Client/include/libavutil/aes.h: -------------------------------------------------------------------------------- 1 | /* 2 | * copyright (c) 2007 Michael Niedermayer 3 | * 4 | * This file is part of FFmpeg. 5 | * 6 | * FFmpeg is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * FFmpeg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with FFmpeg; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef AVUTIL_AES_H 22 | #define AVUTIL_AES_H 23 | 24 | #include 25 | 26 | #include "attributes.h" 27 | #include "version.h" 28 | 29 | /** 30 | * @defgroup lavu_aes AES 31 | * @ingroup lavu_crypto 32 | * @{ 33 | */ 34 | 35 | extern const int av_aes_size; 36 | 37 | struct AVAES; 38 | 39 | /** 40 | * Allocate an AVAES context. 41 | */ 42 | struct AVAES *av_aes_alloc(void); 43 | 44 | /** 45 | * Initialize an AVAES context. 46 | * @param key_bits 128, 192 or 256 47 | * @param decrypt 0 for encryption, 1 for decryption 48 | */ 49 | int av_aes_init(struct AVAES *a, const uint8_t *key, int key_bits, int decrypt); 50 | 51 | /** 52 | * Encrypt or decrypt a buffer using a previously initialized context. 53 | * @param count number of 16 byte blocks 54 | * @param dst destination array, can be equal to src 55 | * @param src source array, can be equal to dst 56 | * @param iv initialization vector for CBC mode, if NULL then ECB will be used 57 | * @param decrypt 0 for encryption, 1 for decryption 58 | */ 59 | void av_aes_crypt(struct AVAES *a, uint8_t *dst, const uint8_t *src, int count, uint8_t *iv, int decrypt); 60 | 61 | /** 62 | * @} 63 | */ 64 | 65 | #endif /* AVUTIL_AES_H */ 66 | -------------------------------------------------------------------------------- /Client/include/libavutil/audioconvert.h: -------------------------------------------------------------------------------- 1 | 2 | #include "version.h" 3 | 4 | #if FF_API_AUDIOCONVERT 5 | #include "channel_layout.h" 6 | #endif 7 | -------------------------------------------------------------------------------- /Client/include/libavutil/avassert.h: -------------------------------------------------------------------------------- 1 | /* 2 | * copyright (c) 2010 Michael Niedermayer 3 | * 4 | * This file is part of FFmpeg. 5 | * 6 | * FFmpeg is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * FFmpeg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with FFmpeg; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | /** 22 | * @file 23 | * simple assert() macros that are a bit more flexible than ISO C assert(). 24 | * @author Michael Niedermayer 25 | */ 26 | 27 | #ifndef AVUTIL_AVASSERT_H 28 | #define AVUTIL_AVASSERT_H 29 | 30 | #include 31 | #include "avutil.h" 32 | #include "log.h" 33 | 34 | /** 35 | * assert() equivalent, that is always enabled. 36 | */ 37 | #define av_assert0(cond) do { \ 38 | if (!(cond)) { \ 39 | av_log(NULL, AV_LOG_PANIC, "Assertion %s failed at %s:%d\n", \ 40 | AV_STRINGIFY(cond), __FILE__, __LINE__); \ 41 | abort(); \ 42 | } \ 43 | } while (0) 44 | 45 | 46 | /** 47 | * assert() equivalent, that does not lie in speed critical code. 48 | * These asserts() thus can be enabled without fearing speedloss. 49 | */ 50 | #if defined(ASSERT_LEVEL) && ASSERT_LEVEL > 0 51 | #define av_assert1(cond) av_assert0(cond) 52 | #else 53 | #define av_assert1(cond) ((void)0) 54 | #endif 55 | 56 | 57 | /** 58 | * assert() equivalent, that does lie in speed critical code. 59 | */ 60 | #if defined(ASSERT_LEVEL) && ASSERT_LEVEL > 1 61 | #define av_assert2(cond) av_assert0(cond) 62 | #else 63 | #define av_assert2(cond) ((void)0) 64 | #endif 65 | 66 | #endif /* AVUTIL_AVASSERT_H */ 67 | -------------------------------------------------------------------------------- /Client/include/libavutil/avconfig.h: -------------------------------------------------------------------------------- 1 | /* Generated by ffconf */ 2 | #ifndef AVUTIL_AVCONFIG_H 3 | #define AVUTIL_AVCONFIG_H 4 | #define AV_HAVE_BIGENDIAN 0 5 | #define AV_HAVE_FAST_UNALIGNED 1 6 | #define AV_HAVE_INCOMPATIBLE_LIBAV_ABI 0 7 | #endif /* AVUTIL_AVCONFIG_H */ 8 | -------------------------------------------------------------------------------- /Client/include/libavutil/base64.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2006 Ryan Martell. (rdm4@martellventures.com) 3 | * 4 | * This file is part of FFmpeg. 5 | * 6 | * FFmpeg is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * FFmpeg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with FFmpeg; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef AVUTIL_BASE64_H 22 | #define AVUTIL_BASE64_H 23 | 24 | #include 25 | 26 | /** 27 | * @defgroup lavu_base64 Base64 28 | * @ingroup lavu_crypto 29 | * @{ 30 | */ 31 | 32 | 33 | /** 34 | * Decode a base64-encoded string. 35 | * 36 | * @param out buffer for decoded data 37 | * @param in null-terminated input string 38 | * @param out_size size in bytes of the out buffer, must be at 39 | * least 3/4 of the length of in 40 | * @return number of bytes written, or a negative value in case of 41 | * invalid input 42 | */ 43 | int av_base64_decode(uint8_t *out, const char *in, int out_size); 44 | 45 | /** 46 | * Encode data to base64 and null-terminate. 47 | * 48 | * @param out buffer for encoded data 49 | * @param out_size size in bytes of the out buffer (including the 50 | * null terminator), must be at least AV_BASE64_SIZE(in_size) 51 | * @param in input buffer containing the data to encode 52 | * @param in_size size in bytes of the in buffer 53 | * @return out or NULL in case of error 54 | */ 55 | char *av_base64_encode(char *out, int out_size, const uint8_t *in, int in_size); 56 | 57 | /** 58 | * Calculate the output size needed to base64-encode x bytes to a 59 | * null-terminated string. 60 | */ 61 | #define AV_BASE64_SIZE(x) (((x)+2) / 3 * 4 + 1) 62 | 63 | /** 64 | * @} 65 | */ 66 | 67 | #endif /* AVUTIL_BASE64_H */ 68 | -------------------------------------------------------------------------------- /Client/include/libavutil/ffversion.h: -------------------------------------------------------------------------------- 1 | #ifndef AVUTIL_FFVERSION_H 2 | #define AVUTIL_FFVERSION_H 3 | #define FFMPEG_VERSION "N-64195-g723550d" 4 | #endif /* AVUTIL_FFVERSION_H */ 5 | -------------------------------------------------------------------------------- /Client/include/libavutil/intfloat.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Mans Rullgard 3 | * 4 | * This file is part of FFmpeg. 5 | * 6 | * FFmpeg is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * FFmpeg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with FFmpeg; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef AVUTIL_INTFLOAT_H 22 | #define AVUTIL_INTFLOAT_H 23 | 24 | #include 25 | #include "attributes.h" 26 | 27 | union av_intfloat32 { 28 | uint32_t i; 29 | float f; 30 | }; 31 | 32 | union av_intfloat64 { 33 | uint64_t i; 34 | double f; 35 | }; 36 | 37 | /** 38 | * Reinterpret a 32-bit integer as a float. 39 | */ 40 | static av_always_inline float av_int2float(uint32_t i) 41 | { 42 | union av_intfloat32 v; 43 | v.i = i; 44 | return v.f; 45 | } 46 | 47 | /** 48 | * Reinterpret a float as a 32-bit integer. 49 | */ 50 | static av_always_inline uint32_t av_float2int(float f) 51 | { 52 | union av_intfloat32 v; 53 | v.f = f; 54 | return v.i; 55 | } 56 | 57 | /** 58 | * Reinterpret a 64-bit integer as a double. 59 | */ 60 | static av_always_inline double av_int2double(uint64_t i) 61 | { 62 | union av_intfloat64 v; 63 | v.i = i; 64 | return v.f; 65 | } 66 | 67 | /** 68 | * Reinterpret a double as a 64-bit integer. 69 | */ 70 | static av_always_inline uint64_t av_double2int(double f) 71 | { 72 | union av_intfloat64 v; 73 | v.f = f; 74 | return v.i; 75 | } 76 | 77 | #endif /* AVUTIL_INTFLOAT_H */ 78 | -------------------------------------------------------------------------------- /Client/include/libavutil/intfloat_readwrite.h: -------------------------------------------------------------------------------- 1 | /* 2 | * copyright (c) 2005 Michael Niedermayer 3 | * 4 | * This file is part of FFmpeg. 5 | * 6 | * FFmpeg is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * FFmpeg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with FFmpeg; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef AVUTIL_INTFLOAT_READWRITE_H 22 | #define AVUTIL_INTFLOAT_READWRITE_H 23 | 24 | #include 25 | 26 | #include "attributes.h" 27 | #include "version.h" 28 | 29 | #if FF_API_INTFLOAT 30 | /* IEEE 80 bits extended float */ 31 | typedef struct AVExtFloat { 32 | uint8_t exponent[2]; 33 | uint8_t mantissa[8]; 34 | } AVExtFloat; 35 | 36 | attribute_deprecated double av_int2dbl(int64_t v) av_const; 37 | attribute_deprecated float av_int2flt(int32_t v) av_const; 38 | attribute_deprecated double av_ext2dbl(const AVExtFloat ext) av_const; 39 | attribute_deprecated int64_t av_dbl2int(double d) av_const; 40 | attribute_deprecated int32_t av_flt2int(float d) av_const; 41 | attribute_deprecated AVExtFloat av_dbl2ext(double d) av_const; 42 | #endif /* FF_API_INTFLOAT */ 43 | 44 | #endif /* AVUTIL_INTFLOAT_READWRITE_H */ 45 | -------------------------------------------------------------------------------- /Client/include/libavutil/lfg.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Lagged Fibonacci PRNG 3 | * Copyright (c) 2008 Michael Niedermayer 4 | * 5 | * This file is part of FFmpeg. 6 | * 7 | * FFmpeg 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 | * FFmpeg 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 FFmpeg; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | */ 21 | 22 | #ifndef AVUTIL_LFG_H 23 | #define AVUTIL_LFG_H 24 | 25 | typedef struct AVLFG { 26 | unsigned int state[64]; 27 | int index; 28 | } AVLFG; 29 | 30 | void av_lfg_init(AVLFG *c, unsigned int seed); 31 | 32 | /** 33 | * Get the next random unsigned 32-bit number using an ALFG. 34 | * 35 | * Please also consider a simple LCG like state= state*1664525+1013904223, 36 | * it may be good enough and faster for your specific use case. 37 | */ 38 | static inline unsigned int av_lfg_get(AVLFG *c){ 39 | c->state[c->index & 63] = c->state[(c->index-24) & 63] + c->state[(c->index-55) & 63]; 40 | return c->state[c->index++ & 63]; 41 | } 42 | 43 | /** 44 | * Get the next random unsigned 32-bit number using a MLFG. 45 | * 46 | * Please also consider av_lfg_get() above, it is faster. 47 | */ 48 | static inline unsigned int av_mlfg_get(AVLFG *c){ 49 | unsigned int a= c->state[(c->index-55) & 63]; 50 | unsigned int b= c->state[(c->index-24) & 63]; 51 | return c->state[c->index++ & 63] = 2*a*b+a+b; 52 | } 53 | 54 | /** 55 | * Get the next two numbers generated by a Box-Muller Gaussian 56 | * generator using the random numbers issued by lfg. 57 | * 58 | * @param out array where the two generated numbers are placed 59 | */ 60 | void av_bmg_get(AVLFG *lfg, double out[2]); 61 | 62 | #endif /* AVUTIL_LFG_H */ 63 | -------------------------------------------------------------------------------- /Client/include/libavutil/lzo.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LZO 1x decompression 3 | * copyright (c) 2006 Reimar Doeffinger 4 | * 5 | * This file is part of FFmpeg. 6 | * 7 | * FFmpeg 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 | * FFmpeg 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 FFmpeg; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | */ 21 | 22 | #ifndef AVUTIL_LZO_H 23 | #define AVUTIL_LZO_H 24 | 25 | /** 26 | * @defgroup lavu_lzo LZO 27 | * @ingroup lavu_crypto 28 | * 29 | * @{ 30 | */ 31 | 32 | #include 33 | 34 | /** @name Error flags returned by av_lzo1x_decode 35 | * @{ */ 36 | /// end of the input buffer reached before decoding finished 37 | #define AV_LZO_INPUT_DEPLETED 1 38 | /// decoded data did not fit into output buffer 39 | #define AV_LZO_OUTPUT_FULL 2 40 | /// a reference to previously decoded data was wrong 41 | #define AV_LZO_INVALID_BACKPTR 4 42 | /// a non-specific error in the compressed bitstream 43 | #define AV_LZO_ERROR 8 44 | /** @} */ 45 | 46 | #define AV_LZO_INPUT_PADDING 8 47 | #define AV_LZO_OUTPUT_PADDING 12 48 | 49 | /** 50 | * @brief Decodes LZO 1x compressed data. 51 | * @param out output buffer 52 | * @param outlen size of output buffer, number of bytes left are returned here 53 | * @param in input buffer 54 | * @param inlen size of input buffer, number of bytes left are returned here 55 | * @return 0 on success, otherwise a combination of the error flags above 56 | * 57 | * Make sure all buffers are appropriately padded, in must provide 58 | * AV_LZO_INPUT_PADDING, out must provide AV_LZO_OUTPUT_PADDING additional bytes. 59 | */ 60 | int av_lzo1x_decode(void *out, int *outlen, const void *in, int *inlen); 61 | 62 | /** 63 | * @} 64 | */ 65 | 66 | #endif /* AVUTIL_LZO_H */ 67 | -------------------------------------------------------------------------------- /Client/include/libavutil/macros.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of FFmpeg. 3 | * 4 | * FFmpeg is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * FFmpeg is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with FFmpeg; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | /** 20 | * @file 21 | * @ingroup lavu 22 | * Utility Preprocessor macros 23 | */ 24 | 25 | #ifndef AVUTIL_MACROS_H 26 | #define AVUTIL_MACROS_H 27 | 28 | /** 29 | * @addtogroup preproc_misc Preprocessor String Macros 30 | * 31 | * String manipulation macros 32 | * 33 | * @{ 34 | */ 35 | 36 | #define AV_STRINGIFY(s) AV_TOSTRING(s) 37 | #define AV_TOSTRING(s) #s 38 | 39 | #define AV_GLUE(a, b) a ## b 40 | #define AV_JOIN(a, b) AV_GLUE(a, b) 41 | 42 | /** 43 | * @} 44 | */ 45 | 46 | #define AV_PRAGMA(s) _Pragma(#s) 47 | 48 | #endif /* AVUTIL_MACROS_H */ 49 | -------------------------------------------------------------------------------- /Client/include/libavutil/md5.h: -------------------------------------------------------------------------------- 1 | /* 2 | * copyright (c) 2006 Michael Niedermayer 3 | * 4 | * This file is part of FFmpeg. 5 | * 6 | * FFmpeg is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * FFmpeg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with FFmpeg; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef AVUTIL_MD5_H 22 | #define AVUTIL_MD5_H 23 | 24 | #include 25 | 26 | #include "attributes.h" 27 | #include "version.h" 28 | 29 | /** 30 | * @defgroup lavu_md5 MD5 31 | * @ingroup lavu_crypto 32 | * @{ 33 | */ 34 | 35 | extern const int av_md5_size; 36 | 37 | struct AVMD5; 38 | 39 | /** 40 | * Allocate an AVMD5 context. 41 | */ 42 | struct AVMD5 *av_md5_alloc(void); 43 | 44 | /** 45 | * Initialize MD5 hashing. 46 | * 47 | * @param ctx pointer to the function context (of size av_md5_size) 48 | */ 49 | void av_md5_init(struct AVMD5 *ctx); 50 | 51 | /** 52 | * Update hash value. 53 | * 54 | * @param ctx hash function context 55 | * @param src input data to update hash with 56 | * @param len input data length 57 | */ 58 | void av_md5_update(struct AVMD5 *ctx, const uint8_t *src, int len); 59 | 60 | /** 61 | * Finish hashing and output digest value. 62 | * 63 | * @param ctx hash function context 64 | * @param dst buffer where output digest value is stored 65 | */ 66 | void av_md5_final(struct AVMD5 *ctx, uint8_t *dst); 67 | 68 | /** 69 | * Hash an array of data. 70 | * 71 | * @param dst The output buffer to write the digest into 72 | * @param src The data to hash 73 | * @param len The length of the data, in bytes 74 | */ 75 | void av_md5_sum(uint8_t *dst, const uint8_t *src, const int len); 76 | 77 | /** 78 | * @} 79 | */ 80 | 81 | #endif /* AVUTIL_MD5_H */ 82 | -------------------------------------------------------------------------------- /Client/include/libavutil/murmur3.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Reimar Döffinger 3 | * 4 | * This file is part of FFmpeg. 5 | * 6 | * FFmpeg is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * FFmpeg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with FFmpeg; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef AVUTIL_MURMUR3_H 22 | #define AVUTIL_MURMUR3_H 23 | 24 | #include 25 | 26 | struct AVMurMur3 *av_murmur3_alloc(void); 27 | void av_murmur3_init_seeded(struct AVMurMur3 *c, uint64_t seed); 28 | void av_murmur3_init(struct AVMurMur3 *c); 29 | void av_murmur3_update(struct AVMurMur3 *c, const uint8_t *src, int len); 30 | void av_murmur3_final(struct AVMurMur3 *c, uint8_t dst[16]); 31 | 32 | #endif /* AVUTIL_MURMUR3_H */ 33 | -------------------------------------------------------------------------------- /Client/include/libavutil/random_seed.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009 Baptiste Coudurier 3 | * 4 | * This file is part of FFmpeg. 5 | * 6 | * FFmpeg is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * FFmpeg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with FFmpeg; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef AVUTIL_RANDOM_SEED_H 22 | #define AVUTIL_RANDOM_SEED_H 23 | 24 | #include 25 | /** 26 | * @addtogroup lavu_crypto 27 | * @{ 28 | */ 29 | 30 | /** 31 | * Get a seed to use in conjunction with random functions. 32 | * This function tries to provide a good seed at a best effort bases. 33 | * Its possible to call this function multiple times if more bits are needed. 34 | * It can be quite slow, which is why it should only be used as seed for a faster 35 | * PRNG. The quality of the seed depends on the platform. 36 | */ 37 | uint32_t av_get_random_seed(void); 38 | 39 | /** 40 | * @} 41 | */ 42 | 43 | #endif /* AVUTIL_RANDOM_SEED_H */ 44 | -------------------------------------------------------------------------------- /Client/include/libavutil/replaygain.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * This file is part of FFmpeg. 4 | * 5 | * FFmpeg is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * FFmpeg is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with FFmpeg; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | #ifndef AVUTIL_REPLAYGAIN_H 21 | #define AVUTIL_REPLAYGAIN_H 22 | 23 | #include 24 | 25 | /** 26 | * ReplayGain information (see 27 | * http://wiki.hydrogenaudio.org/index.php?title=ReplayGain_1.0_specification). 28 | * The size of this struct is a part of the public ABI. 29 | */ 30 | typedef struct AVReplayGain { 31 | /** 32 | * Track replay gain in microbels (divide by 100000 to get the value in dB). 33 | * Should be set to INT32_MIN when unknown. 34 | */ 35 | int32_t track_gain; 36 | /** 37 | * Peak track amplitude, with 100000 representing full scale (but values 38 | * may overflow). 0 when unknown. 39 | */ 40 | uint32_t track_peak; 41 | /** 42 | * Same as track_gain, but for the whole album. 43 | */ 44 | int32_t album_gain; 45 | /** 46 | * Same as track_peak, but for the whole album, 47 | */ 48 | uint32_t album_peak; 49 | } AVReplayGain; 50 | 51 | #endif /* AVUTIL_REPLAYGAIN_H */ 52 | -------------------------------------------------------------------------------- /Client/include/libavutil/ripemd.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2007 Michael Niedermayer 3 | * Copyright (C) 2013 James Almer 4 | * 5 | * This file is part of FFmpeg. 6 | * 7 | * FFmpeg 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 | * FFmpeg 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 FFmpeg; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | */ 21 | 22 | #ifndef AVUTIL_RIPEMD_H 23 | #define AVUTIL_RIPEMD_H 24 | 25 | #include 26 | 27 | #include "attributes.h" 28 | #include "version.h" 29 | 30 | /** 31 | * @defgroup lavu_ripemd RIPEMD 32 | * @ingroup lavu_crypto 33 | * @{ 34 | */ 35 | 36 | extern const int av_ripemd_size; 37 | 38 | struct AVRIPEMD; 39 | 40 | /** 41 | * Allocate an AVRIPEMD context. 42 | */ 43 | struct AVRIPEMD *av_ripemd_alloc(void); 44 | 45 | /** 46 | * Initialize RIPEMD hashing. 47 | * 48 | * @param context pointer to the function context (of size av_ripemd_size) 49 | * @param bits number of bits in digest (128, 160, 256 or 320 bits) 50 | * @return zero if initialization succeeded, -1 otherwise 51 | */ 52 | int av_ripemd_init(struct AVRIPEMD* context, int bits); 53 | 54 | /** 55 | * Update hash value. 56 | * 57 | * @param context hash function context 58 | * @param data input data to update hash with 59 | * @param len input data length 60 | */ 61 | void av_ripemd_update(struct AVRIPEMD* context, const uint8_t* data, unsigned int len); 62 | 63 | /** 64 | * Finish hashing and output digest value. 65 | * 66 | * @param context hash function context 67 | * @param digest buffer where output digest value is stored 68 | */ 69 | void av_ripemd_final(struct AVRIPEMD* context, uint8_t *digest); 70 | 71 | /** 72 | * @} 73 | */ 74 | 75 | #endif /* AVUTIL_RIPEMD_H */ 76 | -------------------------------------------------------------------------------- /Client/include/libavutil/sha.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2007 Michael Niedermayer 3 | * 4 | * This file is part of FFmpeg. 5 | * 6 | * FFmpeg is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * FFmpeg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with FFmpeg; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef AVUTIL_SHA_H 22 | #define AVUTIL_SHA_H 23 | 24 | #include 25 | 26 | #include "attributes.h" 27 | #include "version.h" 28 | 29 | /** 30 | * @defgroup lavu_sha SHA 31 | * @ingroup lavu_crypto 32 | * @{ 33 | */ 34 | 35 | extern const int av_sha_size; 36 | 37 | struct AVSHA; 38 | 39 | /** 40 | * Allocate an AVSHA context. 41 | */ 42 | struct AVSHA *av_sha_alloc(void); 43 | 44 | /** 45 | * Initialize SHA-1 or SHA-2 hashing. 46 | * 47 | * @param context pointer to the function context (of size av_sha_size) 48 | * @param bits number of bits in digest (SHA-1 - 160 bits, SHA-2 224 or 256 bits) 49 | * @return zero if initialization succeeded, -1 otherwise 50 | */ 51 | int av_sha_init(struct AVSHA* context, int bits); 52 | 53 | /** 54 | * Update hash value. 55 | * 56 | * @param context hash function context 57 | * @param data input data to update hash with 58 | * @param len input data length 59 | */ 60 | void av_sha_update(struct AVSHA* context, const uint8_t* data, unsigned int len); 61 | 62 | /** 63 | * Finish hashing and output digest value. 64 | * 65 | * @param context hash function context 66 | * @param digest buffer where output digest value is stored 67 | */ 68 | void av_sha_final(struct AVSHA* context, uint8_t *digest); 69 | 70 | /** 71 | * @} 72 | */ 73 | 74 | #endif /* AVUTIL_SHA_H */ 75 | -------------------------------------------------------------------------------- /Client/include/libavutil/sha512.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2007 Michael Niedermayer 3 | * Copyright (C) 2013 James Almer 4 | * 5 | * This file is part of FFmpeg. 6 | * 7 | * FFmpeg 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 | * FFmpeg 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 FFmpeg; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | */ 21 | 22 | #ifndef AVUTIL_SHA512_H 23 | #define AVUTIL_SHA512_H 24 | 25 | #include 26 | 27 | #include "attributes.h" 28 | #include "version.h" 29 | 30 | /** 31 | * @defgroup lavu_sha512 SHA512 32 | * @ingroup lavu_crypto 33 | * @{ 34 | */ 35 | 36 | extern const int av_sha512_size; 37 | 38 | struct AVSHA512; 39 | 40 | /** 41 | * Allocate an AVSHA512 context. 42 | */ 43 | struct AVSHA512 *av_sha512_alloc(void); 44 | 45 | /** 46 | * Initialize SHA-2 512 hashing. 47 | * 48 | * @param context pointer to the function context (of size av_sha512_size) 49 | * @param bits number of bits in digest (224, 256, 384 or 512 bits) 50 | * @return zero if initialization succeeded, -1 otherwise 51 | */ 52 | int av_sha512_init(struct AVSHA512* context, int bits); 53 | 54 | /** 55 | * Update hash value. 56 | * 57 | * @param context hash function context 58 | * @param data input data to update hash with 59 | * @param len input data length 60 | */ 61 | void av_sha512_update(struct AVSHA512* context, const uint8_t* data, unsigned int len); 62 | 63 | /** 64 | * Finish hashing and output digest value. 65 | * 66 | * @param context hash function context 67 | * @param digest buffer where output digest value is stored 68 | */ 69 | void av_sha512_final(struct AVSHA512* context, uint8_t *digest); 70 | 71 | /** 72 | * @} 73 | */ 74 | 75 | #endif /* AVUTIL_SHA512_H */ 76 | -------------------------------------------------------------------------------- /Client/include/libavutil/time.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2000-2003 Fabrice Bellard 3 | * 4 | * This file is part of FFmpeg. 5 | * 6 | * FFmpeg is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * FFmpeg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with FFmpeg; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef AVUTIL_TIME_H 22 | #define AVUTIL_TIME_H 23 | 24 | #include 25 | 26 | /** 27 | * Get the current time in microseconds. 28 | */ 29 | int64_t av_gettime(void); 30 | 31 | /** 32 | * Get the current time in microseconds since some unspecified starting point. 33 | * On platforms that support it, the time comes from a monotonic clock 34 | * This property makes this time source ideal for measuring relative time. 35 | * If a monotonic clock is not available on the targeted platform, the 36 | * implementation fallsback on using av_gettime(). 37 | */ 38 | int64_t av_gettime_relative(void); 39 | 40 | /** 41 | * Indicates with a boolean result if the av_gettime_relative() time source 42 | * is monotonic. 43 | */ 44 | int av_gettime_relative_is_monotonic(void); 45 | 46 | /** 47 | * Sleep for a period of time. Although the duration is expressed in 48 | * microseconds, the actual delay may be rounded to the precision of the 49 | * system timer. 50 | * 51 | * @param usec Number of microseconds to sleep. 52 | * @return zero on success or (negative) error code. 53 | */ 54 | int av_usleep(unsigned usec); 55 | 56 | #endif /* AVUTIL_TIME_H */ 57 | -------------------------------------------------------------------------------- /Client/include/libavutil/xtea.h: -------------------------------------------------------------------------------- 1 | /* 2 | * A 32-bit implementation of the XTEA algorithm 3 | * Copyright (c) 2012 Samuel Pitoiset 4 | * 5 | * This file is part of FFmpeg. 6 | * 7 | * FFmpeg 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 | * FFmpeg 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 FFmpeg; if not, write to the Free Software 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 20 | */ 21 | 22 | #ifndef AVUTIL_XTEA_H 23 | #define AVUTIL_XTEA_H 24 | 25 | #include 26 | 27 | /** 28 | * @file 29 | * @brief Public header for libavutil XTEA algorithm 30 | * @defgroup lavu_xtea XTEA 31 | * @ingroup lavu_crypto 32 | * @{ 33 | */ 34 | 35 | typedef struct AVXTEA { 36 | uint32_t key[16]; 37 | } AVXTEA; 38 | 39 | /** 40 | * Initialize an AVXTEA context. 41 | * 42 | * @param ctx an AVXTEA context 43 | * @param key a key of 16 bytes used for encryption/decryption 44 | */ 45 | void av_xtea_init(struct AVXTEA *ctx, const uint8_t key[16]); 46 | 47 | /** 48 | * Encrypt or decrypt a buffer using a previously initialized context. 49 | * 50 | * @param ctx an AVXTEA context 51 | * @param dst destination array, can be equal to src 52 | * @param src source array, can be equal to dst 53 | * @param count number of 8 byte blocks 54 | * @param iv initialization vector for CBC mode, if NULL then ECB will be used 55 | * @param decrypt 0 for encryption, 1 for decryption 56 | */ 57 | void av_xtea_crypt(struct AVXTEA *ctx, uint8_t *dst, const uint8_t *src, 58 | int count, uint8_t *iv, int decrypt); 59 | 60 | /** 61 | * @} 62 | */ 63 | 64 | #endif /* AVUTIL_XTEA_H */ 65 | -------------------------------------------------------------------------------- /Client/include/libpostproc/version.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Version macros. 3 | * 4 | * This file is part of FFmpeg. 5 | * 6 | * FFmpeg is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * FFmpeg is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with FFmpeg; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef POSTPROC_POSTPROCESS_VERSION_H 22 | #define POSTPROC_POSTPROCESS_VERSION_H 23 | 24 | /** 25 | * @file 26 | * Libpostproc version macros 27 | */ 28 | 29 | #include "libavutil/avutil.h" 30 | 31 | #define LIBPOSTPROC_VERSION_MAJOR 52 32 | #define LIBPOSTPROC_VERSION_MINOR 3 33 | #define LIBPOSTPROC_VERSION_MICRO 100 34 | 35 | #define LIBPOSTPROC_VERSION_INT AV_VERSION_INT(LIBPOSTPROC_VERSION_MAJOR, \ 36 | LIBPOSTPROC_VERSION_MINOR, \ 37 | LIBPOSTPROC_VERSION_MICRO) 38 | #define LIBPOSTPROC_VERSION AV_VERSION(LIBPOSTPROC_VERSION_MAJOR, \ 39 | LIBPOSTPROC_VERSION_MINOR, \ 40 | LIBPOSTPROC_VERSION_MICRO) 41 | #define LIBPOSTPROC_BUILD LIBPOSTPROC_VERSION_INT 42 | 43 | #define LIBPOSTPROC_IDENT "postproc" AV_STRINGIFY(LIBPOSTPROC_VERSION) 44 | 45 | #endif /* POSTPROC_POSTPROCESS_VERSION_H */ 46 | -------------------------------------------------------------------------------- /Client/include/libswresample/version.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Version macros. 3 | * 4 | * This file is part of libswresample 5 | * 6 | * libswresample is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * libswresample is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with libswresample; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef SWR_VERSION_H 22 | #define SWR_VERSION_H 23 | 24 | /** 25 | * @file 26 | * Libswresample version macros 27 | */ 28 | 29 | #include "libavutil/avutil.h" 30 | 31 | #define LIBSWRESAMPLE_VERSION_MAJOR 0 32 | #define LIBSWRESAMPLE_VERSION_MINOR 19 33 | #define LIBSWRESAMPLE_VERSION_MICRO 100 34 | 35 | #define LIBSWRESAMPLE_VERSION_INT AV_VERSION_INT(LIBSWRESAMPLE_VERSION_MAJOR, \ 36 | LIBSWRESAMPLE_VERSION_MINOR, \ 37 | LIBSWRESAMPLE_VERSION_MICRO) 38 | #define LIBSWRESAMPLE_VERSION AV_VERSION(LIBSWRESAMPLE_VERSION_MAJOR, \ 39 | LIBSWRESAMPLE_VERSION_MINOR, \ 40 | LIBSWRESAMPLE_VERSION_MICRO) 41 | #define LIBSWRESAMPLE_BUILD LIBSWRESAMPLE_VERSION_INT 42 | 43 | #define LIBSWRESAMPLE_IDENT "SwR" AV_STRINGIFY(LIBSWRESAMPLE_VERSION) 44 | 45 | #endif /* SWR_VERSION_H */ 46 | -------------------------------------------------------------------------------- /Client/include/libswscale/version.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of FFmpeg. 3 | * 4 | * FFmpeg is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * FFmpeg is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with FFmpeg; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #ifndef SWSCALE_VERSION_H 20 | #define SWSCALE_VERSION_H 21 | 22 | /** 23 | * @file 24 | * swscale version macros 25 | */ 26 | 27 | #include "libavutil/version.h" 28 | 29 | #define LIBSWSCALE_VERSION_MAJOR 2 30 | #define LIBSWSCALE_VERSION_MINOR 6 31 | #define LIBSWSCALE_VERSION_MICRO 100 32 | 33 | #define LIBSWSCALE_VERSION_INT AV_VERSION_INT(LIBSWSCALE_VERSION_MAJOR, \ 34 | LIBSWSCALE_VERSION_MINOR, \ 35 | LIBSWSCALE_VERSION_MICRO) 36 | #define LIBSWSCALE_VERSION AV_VERSION(LIBSWSCALE_VERSION_MAJOR, \ 37 | LIBSWSCALE_VERSION_MINOR, \ 38 | LIBSWSCALE_VERSION_MICRO) 39 | #define LIBSWSCALE_BUILD LIBSWSCALE_VERSION_INT 40 | 41 | #define LIBSWSCALE_IDENT "SwS" AV_STRINGIFY(LIBSWSCALE_VERSION) 42 | 43 | /** 44 | * FF_API_* defines may be placed below to indicate public API that will be 45 | * dropped at a future version bump. The defines themselves are not part of 46 | * the public API and may change, break or disappear at any time. 47 | */ 48 | 49 | #ifndef FF_API_SWS_GETCONTEXT 50 | #define FF_API_SWS_GETCONTEXT (LIBSWSCALE_VERSION_MAJOR < 3) 51 | #endif 52 | #ifndef FF_API_SWS_CPU_CAPS 53 | #define FF_API_SWS_CPU_CAPS (LIBSWSCALE_VERSION_MAJOR < 3) 54 | #endif 55 | #ifndef FF_API_SWS_FORMAT_NAME 56 | #define FF_API_SWS_FORMAT_NAME (LIBSWSCALE_VERSION_MAJOR < 3) 57 | #endif 58 | #ifndef FF_API_ARCH_BFIN 59 | #define FF_API_ARCH_BFIN (LIBSWSCALE_VERSION_MAJOR < 3) 60 | #endif 61 | 62 | #endif /* SWSCALE_VERSION_H */ 63 | -------------------------------------------------------------------------------- /Client/include/liveMedia/include/AC3AudioFileServerMediaSubsession.hh: -------------------------------------------------------------------------------- 1 | /********** 2 | This library is free software; you can redistribute it and/or modify it under 3 | the terms of the GNU Lesser General Public License as published by the 4 | Free Software Foundation; either version 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-2013 Live Networks, Inc. All rights reserved. 18 | // A 'ServerMediaSubsession' object that creates new, unicast, "RTPSink"s 19 | // on demand, from an AC3 audio file. 20 | // C++ header 21 | 22 | #ifndef _AC3_AUDIO_FILE_SERVER_MEDIA_SUBSESSION_HH 23 | #define _AC3_AUDIO_FILE_SERVER_MEDIA_SUBSESSION_HH 24 | 25 | #ifndef _FILE_SERVER_MEDIA_SUBSESSION_HH 26 | #include "FileServerMediaSubsession.hh" 27 | #endif 28 | 29 | class AC3AudioFileServerMediaSubsession: public FileServerMediaSubsession{ 30 | public: 31 | static AC3AudioFileServerMediaSubsession* 32 | createNew(UsageEnvironment& env, char const* fileName, Boolean reuseFirstSource); 33 | 34 | private: 35 | AC3AudioFileServerMediaSubsession(UsageEnvironment& env, 36 | char const* fileName, Boolean reuseFirstSource); 37 | // called only by createNew(); 38 | virtual ~AC3AudioFileServerMediaSubsession(); 39 | 40 | private: // redefined virtual functions 41 | virtual FramedSource* createNewStreamSource(unsigned clientSessionId, 42 | unsigned& estBitrate); 43 | virtual RTPSink* createNewRTPSink(Groupsock* rtpGroupsock, 44 | unsigned char rtpPayloadTypeIfDynamic, 45 | FramedSource* inputSource); 46 | }; 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /Client/include/liveMedia/include/AC3AudioRTPSink.hh: -------------------------------------------------------------------------------- 1 | /********** 2 | This library is free software; you can redistribute it and/or modify it under 3 | the terms of the GNU Lesser General Public License as published by the 4 | Free Software Foundation; either version 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-2013 Live Networks, Inc. All rights reserved. 18 | // RTP sink for AC3 audio 19 | // C++ header 20 | 21 | #ifndef _AC3_AUDIO_RTP_SINK_HH 22 | #define _AC3_AUDIO_RTP_SINK_HH 23 | 24 | #ifndef _AUDIO_RTP_SINK_HH 25 | #include "AudioRTPSink.hh" 26 | #endif 27 | 28 | class AC3AudioRTPSink: public AudioRTPSink { 29 | public: 30 | static AC3AudioRTPSink* createNew(UsageEnvironment& env, 31 | Groupsock* RTPgs, 32 | u_int8_t rtpPayloadFormat, 33 | u_int32_t rtpTimestampFrequency); 34 | 35 | protected: 36 | AC3AudioRTPSink(UsageEnvironment& env, Groupsock* RTPgs, 37 | u_int8_t rtpPayloadFormat, 38 | u_int32_t rtpTimestampFrequency); 39 | // called only by createNew() 40 | 41 | virtual ~AC3AudioRTPSink(); 42 | 43 | private: // redefined virtual functions: 44 | virtual Boolean frameCanAppearAfterPacketStart(unsigned char const* frameStart, 45 | unsigned numBytesInFrame) const; 46 | virtual void doSpecialFrameHandling(unsigned fragmentationOffset, 47 | unsigned char* frameStart, 48 | unsigned numBytesInFrame, 49 | struct timeval framePresentationTime, 50 | unsigned numRemainingBytes); 51 | virtual unsigned specialHeaderSize() const; 52 | 53 | private: 54 | unsigned char fTotNumFragmentsUsed; // used only if a frame gets fragmented across multiple packets 55 | }; 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /Client/include/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-2013 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 | -------------------------------------------------------------------------------- /Client/include/liveMedia/include/ADTSAudioFileServerMediaSubsession.hh: -------------------------------------------------------------------------------- 1 | /********** 2 | This library is free software; you can redistribute it and/or modify it under 3 | the terms of the GNU Lesser General Public License as published by the 4 | Free Software Foundation; either version 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-2013 Live Networks, Inc. All rights reserved. 18 | // A 'ServerMediaSubsession' object that creates new, unicast, "RTPSink"s 19 | // on demand, from an AAC audio file in ADTS format 20 | // C++ header 21 | 22 | #ifndef _ADTS_AUDIO_FILE_SERVER_MEDIA_SUBSESSION_HH 23 | #define _ADTS_AUDIO_FILE_SERVER_MEDIA_SUBSESSION_HH 24 | 25 | #ifndef _FILE_SERVER_MEDIA_SUBSESSION_HH 26 | #include "FileServerMediaSubsession.hh" 27 | #endif 28 | 29 | class ADTSAudioFileServerMediaSubsession: public FileServerMediaSubsession{ 30 | public: 31 | static ADTSAudioFileServerMediaSubsession* 32 | createNew(UsageEnvironment& env, char const* fileName, Boolean reuseFirstSource); 33 | 34 | protected: 35 | ADTSAudioFileServerMediaSubsession(UsageEnvironment& env, 36 | char const* fileName, Boolean reuseFirstSource); 37 | // called only by createNew(); 38 | virtual ~ADTSAudioFileServerMediaSubsession(); 39 | 40 | protected: // redefined virtual functions 41 | virtual FramedSource* createNewStreamSource(unsigned clientSessionId, 42 | unsigned& estBitrate); 43 | virtual RTPSink* createNewRTPSink(Groupsock* rtpGroupsock, 44 | unsigned char rtpPayloadTypeIfDynamic, 45 | FramedSource* inputSource); 46 | }; 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /Client/include/liveMedia/include/ADTSAudioFileSource.hh: -------------------------------------------------------------------------------- 1 | /********** 2 | This library is free software; you can redistribute it and/or modify it under 3 | the terms of the GNU Lesser General Public License as published by the 4 | Free Software Foundation; either version 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-2013 Live Networks, Inc. All rights reserved. 18 | // A source object for AAC audio files in ADTS format 19 | // C++ header 20 | 21 | #ifndef _ADTS_AUDIO_FILE_SOURCE_HH 22 | #define _ADTS_AUDIO_FILE_SOURCE_HH 23 | 24 | #ifndef _FRAMED_FILE_SOURCE_HH 25 | #include "FramedFileSource.hh" 26 | #endif 27 | 28 | class ADTSAudioFileSource: public FramedFileSource { 29 | public: 30 | static ADTSAudioFileSource* createNew(UsageEnvironment& env, 31 | char const* fileName); 32 | 33 | unsigned samplingFrequency() const { return fSamplingFrequency; } 34 | unsigned numChannels() const { return fNumChannels; } 35 | char const* configStr() const { return fConfigStr; } 36 | // returns the 'AudioSpecificConfig' for this stream (in ASCII form) 37 | 38 | private: 39 | ADTSAudioFileSource(UsageEnvironment& env, FILE* fid, u_int8_t profile, 40 | u_int8_t samplingFrequencyIndex, u_int8_t channelConfiguration); 41 | // called only by createNew() 42 | 43 | virtual ~ADTSAudioFileSource(); 44 | 45 | private: 46 | // redefined virtual functions: 47 | virtual void doGetNextFrame(); 48 | 49 | private: 50 | unsigned fSamplingFrequency; 51 | unsigned fNumChannels; 52 | unsigned fuSecsPerFrame; 53 | char fConfigStr[5]; 54 | }; 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /Client/include/liveMedia/include/AMRAudioFileServerMediaSubsession.hh: -------------------------------------------------------------------------------- 1 | /********** 2 | This library is free software; you can redistribute it and/or modify it under 3 | the terms of the GNU Lesser General Public License as published by the 4 | Free Software Foundation; either version 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-2013 Live Networks, Inc. All rights reserved. 18 | // A 'ServerMediaSubsession' object that creates new, unicast, "RTPSink"s 19 | // on demand, from an AMR audio file. 20 | // C++ header 21 | 22 | #ifndef _AMR_AUDIO_FILE_SERVER_MEDIA_SUBSESSION_HH 23 | #define _AMR_AUDIO_FILE_SERVER_MEDIA_SUBSESSION_HH 24 | 25 | #ifndef _FILE_SERVER_MEDIA_SUBSESSION_HH 26 | #include "FileServerMediaSubsession.hh" 27 | #endif 28 | 29 | class AMRAudioFileServerMediaSubsession: public FileServerMediaSubsession{ 30 | public: 31 | static AMRAudioFileServerMediaSubsession* 32 | createNew(UsageEnvironment& env, char const* fileName, Boolean reuseFirstSource); 33 | 34 | private: 35 | AMRAudioFileServerMediaSubsession(UsageEnvironment& env, 36 | char const* fileName, Boolean reuseFirstSource); 37 | // called only by createNew(); 38 | virtual ~AMRAudioFileServerMediaSubsession(); 39 | 40 | private: // redefined virtual functions 41 | virtual FramedSource* createNewStreamSource(unsigned clientSessionId, 42 | unsigned& estBitrate); 43 | virtual RTPSink* createNewRTPSink(Groupsock* rtpGroupsock, 44 | unsigned char rtpPayloadTypeIfDynamic, 45 | FramedSource* inputSource); 46 | }; 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /Client/include/liveMedia/include/AMRAudioFileSink.hh: -------------------------------------------------------------------------------- 1 | /********** 2 | This library is free software; you can redistribute it and/or modify it under 3 | the terms of the GNU Lesser General Public License as published by the 4 | Free Software Foundation; either version 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-2013 Live Networks, Inc. All rights reserved. 18 | // AMR Audio File Sinks 19 | // C++ header 20 | 21 | #ifndef _AMR_AUDIO_FILE_SINK_HH 22 | #define _AMR_AUDIO_FILE_SINK_HH 23 | 24 | #ifndef _FILE_SINK_HH 25 | #include "FileSink.hh" 26 | #endif 27 | 28 | class AMRAudioFileSink: public FileSink { 29 | public: 30 | static AMRAudioFileSink* createNew(UsageEnvironment& env, char const* fileName, 31 | unsigned bufferSize = 10000, 32 | Boolean oneFilePerFrame = False); 33 | // (See "FileSink.hh" for a description of these parameters.) 34 | 35 | protected: 36 | AMRAudioFileSink(UsageEnvironment& env, FILE* fid, unsigned bufferSize, 37 | char const* perFrameFileNamePrefix); 38 | // called only by createNew() 39 | virtual ~AMRAudioFileSink(); 40 | 41 | protected: // redefined virtual functions: 42 | virtual Boolean sourceIsCompatibleWithUs(MediaSource& source); 43 | virtual void afterGettingFrame(unsigned frameSize, 44 | unsigned numTruncatedBytes, 45 | struct timeval presentationTime); 46 | 47 | protected: 48 | Boolean fHaveWrittenHeader; 49 | }; 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /Client/include/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-2013 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 | -------------------------------------------------------------------------------- /Client/include/liveMedia/include/AMRAudioRTPSource.hh: -------------------------------------------------------------------------------- 1 | /********** 2 | This library is free software; you can redistribute it and/or modify it under 3 | the terms of the GNU Lesser General Public License as published by the 4 | Free Software Foundation; either version 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-2013 Live Networks, Inc. All rights reserved. 18 | // AMR Audio RTP Sources (RFC 4867) 19 | // C++ header 20 | 21 | #ifndef _AMR_AUDIO_RTP_SOURCE_HH 22 | #define _AMR_AUDIO_RTP_SOURCE_HH 23 | 24 | #ifndef _RTP_SOURCE_HH 25 | #include "RTPSource.hh" 26 | #endif 27 | #ifndef _AMR_AUDIO_SOURCE_HH 28 | #include "AMRAudioSource.hh" 29 | #endif 30 | 31 | class AMRAudioRTPSource { 32 | public: 33 | static AMRAudioSource* createNew(UsageEnvironment& env, 34 | Groupsock* RTPgs, 35 | RTPSource*& resultRTPSource, 36 | unsigned char rtpPayloadFormat, 37 | Boolean isWideband = False, 38 | unsigned numChannels = 1, 39 | Boolean isOctetAligned = True, 40 | unsigned interleaving = 0, 41 | // relevant only if "isOctetAligned" 42 | // The maximum # of frame-blocks in a group 43 | // 0 means: no interleaving 44 | Boolean robustSortingOrder = False, 45 | // relevant only if "isOctetAligned" 46 | Boolean CRCsArePresent = False 47 | // relevant only if "isOctetAligned" 48 | ); 49 | // This returns a source to read from, but "resultRTPSource" will 50 | // point to RTP-related state. 51 | }; 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /Client/include/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-2013 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 | -------------------------------------------------------------------------------- /Client/include/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-2013 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 | -------------------------------------------------------------------------------- /Client/include/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-2013 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 | -------------------------------------------------------------------------------- /Client/include/liveMedia/include/BasicUDPSink.hh: -------------------------------------------------------------------------------- 1 | /********** 2 | This library is free software; you can redistribute it and/or modify it under 3 | the terms of the GNU Lesser General Public License as published by the 4 | Free Software Foundation; either version 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-2013 Live Networks, Inc. All rights reserved. 18 | // A simple UDP sink (i.e., without RTP or other headers added); one frame per packet 19 | // C++ header 20 | 21 | #ifndef _BASIC_UDP_SINK_HH 22 | #define _BASIC_UDP_SINK_HH 23 | 24 | #ifndef _MEDIA_SINK_HH 25 | #include "MediaSink.hh" 26 | #endif 27 | #ifndef _GROUPSOCK_HH 28 | #include 29 | #endif 30 | 31 | class BasicUDPSink: public MediaSink { 32 | public: 33 | static BasicUDPSink* createNew(UsageEnvironment& env, Groupsock* gs, 34 | unsigned maxPayloadSize = 1450); 35 | protected: 36 | BasicUDPSink(UsageEnvironment& env, Groupsock* gs, unsigned maxPayloadSize); 37 | // called only by createNew() 38 | virtual ~BasicUDPSink(); 39 | 40 | private: // redefined virtual functions: 41 | virtual Boolean continuePlaying(); 42 | 43 | private: 44 | void continuePlaying1(); 45 | 46 | static void afterGettingFrame(void* clientData, unsigned frameSize, 47 | unsigned numTruncatedBytes, 48 | struct timeval presentationTime, 49 | unsigned durationInMicroseconds); 50 | void afterGettingFrame1(unsigned frameSize, unsigned numTruncatedBytes, 51 | unsigned durationInMicroseconds); 52 | 53 | static void sendNext(void* firstArg); 54 | 55 | private: 56 | Groupsock* fGS; 57 | unsigned fMaxPayloadSize; 58 | unsigned char* fOutputBuffer; 59 | struct timeval fNextSendTime; 60 | }; 61 | 62 | #endif 63 | -------------------------------------------------------------------------------- /Client/include/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-2013 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 | -------------------------------------------------------------------------------- /Client/include/liveMedia/include/BitVector.hh: -------------------------------------------------------------------------------- 1 | /********** 2 | This library is free software; you can redistribute it and/or modify it under 3 | the terms of the GNU Lesser General Public License as published by the 4 | Free Software Foundation; either version 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-2013 Live Networks, Inc. All rights reserved. 18 | // Bit Vector data structure 19 | // C++ header 20 | 21 | #ifndef _BIT_VECTOR_HH 22 | #define _BIT_VECTOR_HH 23 | 24 | #ifndef _BOOLEAN_HH 25 | #include "Boolean.hh" 26 | #endif 27 | 28 | class BitVector { 29 | public: 30 | BitVector(unsigned char* baseBytePtr, 31 | unsigned baseBitOffset, 32 | unsigned totNumBits); 33 | 34 | void setup(unsigned char* baseBytePtr, 35 | unsigned baseBitOffset, 36 | unsigned totNumBits); 37 | 38 | void putBits(unsigned from, unsigned numBits); // "numBits" <= 32 39 | void put1Bit(unsigned bit); 40 | 41 | unsigned getBits(unsigned numBits); // "numBits" <= 32 42 | unsigned get1Bit(); 43 | Boolean get1BitBoolean() { return get1Bit() != 0; } 44 | 45 | void skipBits(unsigned numBits); 46 | 47 | unsigned curBitIndex() const { return fCurBitIndex; } 48 | unsigned totNumBits() const { return fTotNumBits; } 49 | unsigned numBitsRemaining() const { return fTotNumBits - fCurBitIndex; } 50 | 51 | unsigned get_expGolomb(); 52 | // Returns the value of the next bits, assuming that they were encoded using an exponential-Golomb code of order 0 53 | 54 | private: 55 | unsigned char* fBaseBytePtr; 56 | unsigned fBaseBitOffset; 57 | unsigned fTotNumBits; 58 | unsigned fCurBitIndex; 59 | }; 60 | 61 | // A general bit copy operation: 62 | void shiftBits(unsigned char* toBasePtr, unsigned toBitOffset, 63 | unsigned char const* fromBasePtr, unsigned fromBitOffset, 64 | unsigned numBits); 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /Client/include/liveMedia/include/DVVideoFileServerMediaSubsession.hh: -------------------------------------------------------------------------------- 1 | /********** 2 | This library is free software; you can redistribute it and/or modify it under 3 | the terms of the GNU Lesser General Public License as published by the 4 | Free Software Foundation; either version 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-2013 Live Networks, Inc. All rights reserved. 18 | // A 'ServerMediaSubsession' object that creates new, unicast, "RTPSink"s 19 | // on demand, from a DV video file. 20 | // C++ header 21 | 22 | #ifndef _DV_VIDEO_FILE_SERVER_MEDIA_SUBSESSION_HH 23 | #define _DV_VIDEO_FILE_SERVER_MEDIA_SUBSESSION_HH 24 | 25 | #ifndef _FILE_SERVER_MEDIA_SUBSESSION_HH 26 | #include "FileServerMediaSubsession.hh" 27 | #endif 28 | 29 | class DVVideoFileServerMediaSubsession: public FileServerMediaSubsession{ 30 | public: 31 | static DVVideoFileServerMediaSubsession* 32 | createNew(UsageEnvironment& env, char const* fileName, Boolean reuseFirstSource); 33 | 34 | private: 35 | DVVideoFileServerMediaSubsession(UsageEnvironment& env, char const* fileName, Boolean reuseFirstSource); 36 | // called only by createNew(); 37 | virtual ~DVVideoFileServerMediaSubsession(); 38 | 39 | private: // redefined virtual functions 40 | virtual char const* getAuxSDPLine(RTPSink* rtpSink, FramedSource* inputSource); 41 | virtual void seekStreamSource(FramedSource* inputSource, double& seekNPT, double streamDuration, u_int64_t& numBytes); 42 | virtual FramedSource* createNewStreamSource(unsigned clientSessionId, unsigned& estBitrate); 43 | virtual RTPSink* createNewRTPSink(Groupsock* rtpGroupsock, unsigned char rtpPayloadTypeIfDynamic, FramedSource* inputSource); 44 | virtual float duration() const; 45 | 46 | private: 47 | float fFileDuration; // in seconds 48 | }; 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /Client/include/liveMedia/include/DVVideoRTPSink.hh: -------------------------------------------------------------------------------- 1 | /********** 2 | This library is free software; you can redistribute it and/or modify it under 3 | the terms of the GNU Lesser General Public License as published by the 4 | Free Software Foundation; either version 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-2013 Live Networks, Inc. All rights reserved. 18 | // RTP sink for DV video (RFC 3189) 19 | // (Thanks to Ben Hutchings for prototyping this.) 20 | // C++ header 21 | 22 | #ifndef _DV_VIDEO_RTP_SINK_HH 23 | #define _DV_VIDEO_RTP_SINK_HH 24 | 25 | #ifndef _VIDEO_RTP_SINK_HH 26 | #include "VideoRTPSink.hh" 27 | #endif 28 | #ifndef _DV_VIDEO_STREAM_FRAMER_HH 29 | #include "DVVideoStreamFramer.hh" 30 | #endif 31 | 32 | class DVVideoRTPSink: public VideoRTPSink { 33 | public: 34 | static DVVideoRTPSink* createNew(UsageEnvironment& env, Groupsock* RTPgs, unsigned char rtpPayloadFormat); 35 | char const* auxSDPLineFromFramer(DVVideoStreamFramer* framerSource); 36 | 37 | protected: 38 | DVVideoRTPSink(UsageEnvironment& env, Groupsock* RTPgs, unsigned char rtpPayloadFormat); 39 | // called only by createNew() 40 | 41 | virtual ~DVVideoRTPSink(); 42 | 43 | private: // redefined virtual functions: 44 | virtual Boolean sourceIsCompatibleWithUs(MediaSource& source); 45 | virtual void doSpecialFrameHandling(unsigned fragmentationOffset, 46 | unsigned char* frameStart, 47 | unsigned numBytesInFrame, 48 | struct timeval framePresentationTime, 49 | unsigned numRemainingBytes); 50 | virtual unsigned computeOverflowForNewFrame(unsigned newFrameSize) const; 51 | virtual char const* auxSDPLine(); 52 | 53 | private: 54 | char* fFmtpSDPLine; 55 | }; 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /Client/include/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-2013 Live Networks, Inc. All rights reserved. 18 | // DV Video RTP Sources 19 | // C++ header 20 | 21 | #ifndef _DV_VIDEOO_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 | -------------------------------------------------------------------------------- /Client/include/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-2013 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 | -------------------------------------------------------------------------------- /Client/include/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-2013 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 | -------------------------------------------------------------------------------- /Client/include/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-2013 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 | -------------------------------------------------------------------------------- /Client/include/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-2013 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 | -------------------------------------------------------------------------------- /Client/include/liveMedia/include/H261VideoRTPSource.hh: -------------------------------------------------------------------------------- 1 | /********** 2 | This library is free software; you can redistribute it and/or modify it under 3 | the terms of the GNU Lesser General Public License as published by the 4 | Free Software Foundation; either version 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-2013 Live Networks, Inc. All rights reserved. 18 | // H.261 Video RTP Sources 19 | // C++ header 20 | 21 | #ifndef _H261_VIDEO_RTP_SOURCE_HH 22 | #define _H261_VIDEO_RTP_SOURCE_HH 23 | 24 | #ifndef _MULTI_FRAMED_RTP_SOURCE_HH 25 | #include "MultiFramedRTPSource.hh" 26 | #endif 27 | 28 | class H261VideoRTPSource: public MultiFramedRTPSource { 29 | public: 30 | static H261VideoRTPSource* 31 | createNew(UsageEnvironment& env, Groupsock* RTPgs, 32 | unsigned char rtpPayloadFormat = 31, 33 | unsigned rtpTimestampFrequency = 90000); 34 | 35 | u_int32_t lastSpecialHeader() const {return fLastSpecialHeader;} 36 | 37 | protected: 38 | virtual ~H261VideoRTPSource(); 39 | 40 | private: 41 | H261VideoRTPSource(UsageEnvironment& env, Groupsock* RTPgs, 42 | unsigned char rtpPayloadFormat, 43 | unsigned rtpTimestampFrequency); 44 | // called only by createNew() 45 | 46 | private: 47 | // redefined virtual functions: 48 | virtual Boolean processSpecialHeader(BufferedPacket* packet, 49 | unsigned& resultSpecialHeaderSize); 50 | virtual char const* MIMEtype() const; 51 | 52 | private: 53 | u_int32_t fLastSpecialHeader; 54 | }; 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /Client/include/liveMedia/include/H263plusVideoFileServerMediaSubsession.hh: -------------------------------------------------------------------------------- 1 | /********** 2 | This library is free software; you can redistribute it and/or modify it under 3 | the terms of the GNU Lesser General Public License as published by the 4 | Free Software Foundation; either version 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-2013 Live Networks, Inc. All rights reserved. 18 | // A 'ServerMediaSubsession' object that creates new, unicast, "RTPSink"s 19 | // on demand, from a H.263 video file. 20 | // C++ header 21 | 22 | #ifndef _H263PLUS_VIDEO_FILE_SERVER_MEDIA_SUBSESSION_HH 23 | #define _H263PLUS_VIDEO_FILE_SERVER_MEDIA_SUBSESSION_HH 24 | 25 | #ifndef _FILE_SERVER_MEDIA_SUBSESSION_HH 26 | #include "FileServerMediaSubsession.hh" 27 | #endif 28 | 29 | class H263plusVideoFileServerMediaSubsession: public FileServerMediaSubsession{ 30 | public: 31 | static H263plusVideoFileServerMediaSubsession* 32 | createNew(UsageEnvironment& env, char const* fileName, Boolean reuseFirstSource); 33 | 34 | private: 35 | H263plusVideoFileServerMediaSubsession(UsageEnvironment& env, 36 | char const* fileName, Boolean reuseFirstSource); 37 | // called only by createNew(); 38 | virtual ~H263plusVideoFileServerMediaSubsession(); 39 | 40 | private: // redefined virtual functions 41 | virtual FramedSource* createNewStreamSource(unsigned clientSessionId, 42 | unsigned& estBitrate); 43 | virtual RTPSink* createNewRTPSink(Groupsock* rtpGroupsock, 44 | unsigned char rtpPayloadTypeIfDynamic, 45 | FramedSource* inputSource); 46 | }; 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /Client/include/liveMedia/include/H263plusVideoRTPSink.hh: -------------------------------------------------------------------------------- 1 | /********** 2 | This library is free software; you can redistribute it and/or modify it under 3 | the terms of the GNU Lesser General Public License as published by the 4 | Free Software Foundation; either version 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-2013 Live Networks, Inc. All rights reserved. 18 | // RTP sink for H.263+ video (RFC 4629) 19 | // C++ header 20 | 21 | #ifndef _H263_PLUS_VIDEO_RTP_SINK_HH 22 | #define _H263_PLUS_VIDEO_RTP_SINK_HH 23 | 24 | #ifndef _VIDEO_RTP_SINK_HH 25 | #include "VideoRTPSink.hh" 26 | #endif 27 | 28 | class H263plusVideoRTPSink: public VideoRTPSink { 29 | public: 30 | static H263plusVideoRTPSink* createNew(UsageEnvironment& env, Groupsock* RTPgs, 31 | unsigned char rtpPayloadFormat, 32 | u_int32_t rtpTimestampFrequency = 90000); 33 | 34 | protected: 35 | H263plusVideoRTPSink(UsageEnvironment& env, Groupsock* RTPgs, 36 | unsigned char rtpPayloadFormat, 37 | u_int32_t rtpTimestampFrequency); 38 | // called only by createNew() 39 | 40 | virtual ~H263plusVideoRTPSink(); 41 | 42 | private: // redefined virtual functions: 43 | virtual void doSpecialFrameHandling(unsigned fragmentationOffset, 44 | unsigned char* frameStart, 45 | unsigned numBytesInFrame, 46 | struct timeval framePresentationTime, 47 | unsigned numRemainingBytes); 48 | virtual 49 | Boolean frameCanAppearAfterPacketStart(unsigned char const* frameStart, 50 | unsigned numBytesInFrame) const; 51 | virtual unsigned specialHeaderSize() const; 52 | }; 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /Client/include/liveMedia/include/H263plusVideoRTPSource.hh: -------------------------------------------------------------------------------- 1 | /********** 2 | This library is free software; you can redistribute it and/or modify it under 3 | the terms of the GNU Lesser General Public License as published by the 4 | Free Software Foundation; either version 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-2013 Live Networks, Inc. All rights reserved. 18 | // H.263+ Video RTP Sources 19 | // C++ header 20 | 21 | #ifndef _H263_PLUS_VIDEO_RTP_SOURCE_HH 22 | #define _H263_PLUS_VIDEO_RTP_SOURCE_HH 23 | 24 | #ifndef _MULTI_FRAMED_RTP_SOURCE_HH 25 | #include "MultiFramedRTPSource.hh" 26 | #endif 27 | 28 | #define SPECIAL_HEADER_BUFFER_SIZE 1000 29 | 30 | class H263plusVideoRTPSource: public MultiFramedRTPSource { 31 | public: 32 | static H263plusVideoRTPSource* 33 | createNew(UsageEnvironment& env, Groupsock* RTPgs, 34 | unsigned char rtpPayloadFormat, 35 | unsigned rtpTimestampFrequency = 90000); 36 | 37 | // A data structure that stores copies of the special header bytes 38 | // from the most recent frame's RTP packets: 39 | unsigned char fNumSpecialHeaders; 40 | unsigned fSpecialHeaderBytesLength; 41 | unsigned char fSpecialHeaderBytes[SPECIAL_HEADER_BUFFER_SIZE]; 42 | unsigned fPacketSizes[256]; 43 | 44 | protected: 45 | virtual ~H263plusVideoRTPSource(); 46 | 47 | private: 48 | H263plusVideoRTPSource(UsageEnvironment& env, Groupsock* RTPgs, 49 | unsigned char rtpPayloadFormat, 50 | unsigned rtpTimestampFrequency); 51 | // called only by createNew() 52 | 53 | private: 54 | // redefined virtual functions: 55 | virtual Boolean processSpecialHeader(BufferedPacket* packet, 56 | unsigned& resultSpecialHeaderSize); 57 | virtual char const* MIMEtype() const; 58 | }; 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /Client/include/liveMedia/include/H263plusVideoStreamFramer.hh: -------------------------------------------------------------------------------- 1 | /********** 2 | This library is free software; you can redistribute it and/or modify it under 3 | the terms of the GNU Lesser General Public License as published by the 4 | Free Software Foundation; either version 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-2013 Live Networks, Inc. All rights reserved. 18 | // A filter that breaks up an H263 video elementary stream into frames. 19 | // Author Benhard Feiten 20 | 21 | #ifndef _H263PLUS_VIDEO_STREAM_FRAMER_HH 22 | #define _H263PLUS_VIDEO_STREAM_FRAMER_HH 23 | 24 | #ifndef _FRAMED_FILTER_HH 25 | #include "FramedFilter.hh" 26 | #endif 27 | 28 | 29 | class H263plusVideoStreamFramer: public FramedFilter { 30 | public: 31 | 32 | static H263plusVideoStreamFramer* createNew(UsageEnvironment& env, FramedSource* inputSource); 33 | 34 | Boolean& pictureEndMarker() { return fPictureEndMarker; } // a hack for implementing the RTP 'M' bit 35 | 36 | protected: 37 | // Constructor called only by createNew(), or by subclass constructors 38 | H263plusVideoStreamFramer(UsageEnvironment& env, 39 | FramedSource* inputSource, 40 | Boolean createParser = True); 41 | virtual ~H263plusVideoStreamFramer(); 42 | 43 | 44 | public: 45 | static void continueReadProcessing(void* clientData, 46 | unsigned char* ptr, unsigned size, 47 | struct timeval presentationTime); 48 | void continueReadProcessing(); 49 | 50 | private: 51 | virtual void doGetNextFrame(); 52 | virtual Boolean isH263plusVideoStreamFramer() const; 53 | 54 | protected: 55 | double fFrameRate; 56 | unsigned fPictureCount; // hack used to implement doGetNextFrame() ?? 57 | Boolean fPictureEndMarker; 58 | 59 | private: 60 | class H263plusVideoStreamParser* fParser; 61 | struct timeval fPresentationTimeBase; 62 | }; 63 | 64 | #endif 65 | -------------------------------------------------------------------------------- /Client/include/liveMedia/include/H264VideoFileSink.hh: -------------------------------------------------------------------------------- 1 | /********** 2 | This library is free software; you can redistribute it and/or modify it under 3 | the terms of the GNU Lesser General Public License as published by the 4 | Free Software Foundation; either version 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-2013 Live Networks, Inc. All rights reserved. 18 | // H.264 Video File Sinks 19 | // C++ header 20 | 21 | #ifndef _H264_VIDEO_FILE_SINK_HH 22 | #define _H264_VIDEO_FILE_SINK_HH 23 | 24 | #ifndef _FILE_SINK_HH 25 | #include "FileSink.hh" 26 | #endif 27 | 28 | class H264VideoFileSink: public FileSink { 29 | public: 30 | static H264VideoFileSink* createNew(UsageEnvironment& env, char const* fileName, 31 | char const* sPropParameterSetsStr = NULL, 32 | // An optional 'SDP format' string (comma-separated Base64-encoded) representing SPS and/or PPS NAL-units to prepend to the output 33 | unsigned bufferSize = 100000, 34 | Boolean oneFilePerFrame = False); 35 | // See "FileSink.hh" for a description of these parameters. 36 | 37 | protected: 38 | H264VideoFileSink(UsageEnvironment& env, FILE* fid, 39 | char const* sPropParameterSetsStr, 40 | unsigned bufferSize, char const* perFrameFileNamePrefix); 41 | // called only by createNew() 42 | virtual ~H264VideoFileSink(); 43 | 44 | protected: // redefined virtual functions: 45 | virtual void afterGettingFrame(unsigned frameSize, unsigned numTruncatedBytes, struct timeval presentationTime); 46 | 47 | private: 48 | char const* fSPropParameterSetsStr; 49 | Boolean fHaveWrittenFirstFrame; 50 | }; 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /Client/include/liveMedia/include/H264VideoStreamDiscreteFramer.hh: -------------------------------------------------------------------------------- 1 | /********** 2 | This library is free software; you can redistribute it and/or modify it under 3 | the terms of the GNU Lesser General Public License as published by the 4 | Free Software Foundation; either version 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-2013 Live Networks, Inc. All rights reserved. 18 | // A simplified version of "H264VideoStreamFramer" that takes only complete, 19 | // discrete frames (rather than an arbitrary byte stream) as input. 20 | // This avoids the parsing and data copying overhead of the full 21 | // "H264VideoStreamFramer". 22 | // C++ header 23 | 24 | #ifndef _H264_VIDEO_STREAM_DISCRETE_FRAMER_HH 25 | #define _H264_VIDEO_STREAM_DISCRETE_FRAMER_HH 26 | 27 | #ifndef _H264_VIDEO_STREAM_FRAMER_HH 28 | #include "H264VideoStreamFramer.hh" 29 | #endif 30 | 31 | class H264VideoStreamDiscreteFramer: public H264VideoStreamFramer { 32 | public: 33 | static H264VideoStreamDiscreteFramer* 34 | createNew(UsageEnvironment& env, FramedSource* inputSource); 35 | 36 | protected: 37 | H264VideoStreamDiscreteFramer(UsageEnvironment& env, 38 | FramedSource* inputSource); 39 | // called only by createNew() 40 | virtual ~H264VideoStreamDiscreteFramer(); 41 | 42 | protected: 43 | // redefined virtual functions: 44 | virtual void doGetNextFrame(); 45 | 46 | protected: 47 | static void afterGettingFrame(void* clientData, unsigned frameSize, 48 | unsigned numTruncatedBytes, 49 | struct timeval presentationTime, 50 | unsigned durationInMicroseconds); 51 | void afterGettingFrame1(unsigned frameSize, 52 | unsigned numTruncatedBytes, 53 | struct timeval presentationTime, 54 | unsigned durationInMicroseconds); 55 | }; 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /Client/include/liveMedia/include/JPEGVideoRTPSink.hh: -------------------------------------------------------------------------------- 1 | /********** 2 | This library is free software; you can redistribute it and/or modify it under 3 | the terms of the GNU Lesser General Public License as published by the 4 | Free Software Foundation; either version 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-2013 Live Networks, Inc. All rights reserved. 18 | // RTP sink for JPEG video (RFC 2435) 19 | // C++ header 20 | 21 | #ifndef _JPEG_VIDEO_RTP_SINK_HH 22 | #define _JPEG_VIDEO_RTP_SINK_HH 23 | 24 | #ifndef _VIDEO_RTP_SINK_HH 25 | #include "VideoRTPSink.hh" 26 | #endif 27 | 28 | class JPEGVideoRTPSink: public VideoRTPSink { 29 | public: 30 | static JPEGVideoRTPSink* createNew(UsageEnvironment& env, Groupsock* RTPgs); 31 | 32 | protected: 33 | JPEGVideoRTPSink(UsageEnvironment& env, Groupsock* RTPgs); 34 | // called only by createNew() 35 | 36 | virtual ~JPEGVideoRTPSink(); 37 | 38 | private: // redefined virtual functions: 39 | virtual Boolean sourceIsCompatibleWithUs(MediaSource& source); 40 | 41 | virtual void doSpecialFrameHandling(unsigned fragmentationOffset, 42 | unsigned char* frameStart, 43 | unsigned numBytesInFrame, 44 | struct timeval framePresentationTime, 45 | unsigned numRemainingBytes); 46 | virtual 47 | Boolean frameCanAppearAfterPacketStart(unsigned char const* frameStart, 48 | unsigned numBytesInFrame) const; 49 | virtual unsigned specialHeaderSize() const; 50 | }; 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /Client/include/liveMedia/include/JPEGVideoRTPSource.hh: -------------------------------------------------------------------------------- 1 | /********** 2 | This library is free software; you can redistribute it and/or modify it under 3 | the terms of the GNU Lesser General Public License as published by the 4 | Free Software Foundation; either version 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-2013 Live Networks, Inc. All rights reserved. 18 | // JPEG Video (RFC 2435) RTP Sources 19 | // C++ header 20 | 21 | #ifndef _JPEG_VIDEO_RTP_SOURCE_HH 22 | #define _JPEG_VIDEO_RTP_SOURCE_HH 23 | 24 | #ifndef _MULTI_FRAMED_RTP_SOURCE_HH 25 | #include "MultiFramedRTPSource.hh" 26 | #endif 27 | 28 | #define MAX_JPEG_HEADER_SIZE 1024 29 | 30 | class JPEGVideoRTPSource: public MultiFramedRTPSource { 31 | public: 32 | static JPEGVideoRTPSource* 33 | createNew(UsageEnvironment& env, Groupsock* RTPgs, 34 | unsigned char rtpPayloadFormat = 26, 35 | unsigned rtpPayloadFrequency = 90000, 36 | unsigned defaultWidth = 0, unsigned defaultHeight = 0); 37 | 38 | protected: 39 | virtual ~JPEGVideoRTPSource(); 40 | 41 | private: 42 | JPEGVideoRTPSource(UsageEnvironment& env, Groupsock* RTPgs, 43 | unsigned char rtpPayloadFormat, 44 | unsigned rtpTimestampFrequency, 45 | unsigned defaultWidth, unsigned defaultHeight); 46 | // called only by createNew() 47 | 48 | // Image dimensions from the SDP description, if any 49 | unsigned fDefaultWidth, fDefaultHeight; 50 | 51 | private: 52 | // redefined virtual functions: 53 | virtual Boolean processSpecialHeader(BufferedPacket* packet, 54 | unsigned& resultSpecialHeaderSize); 55 | 56 | virtual char const* MIMEtype() const; 57 | }; 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /Client/include/liveMedia/include/JPEGVideoSource.hh: -------------------------------------------------------------------------------- 1 | /********** 2 | This library is free software; you can redistribute it and/or modify it under 3 | the terms of the GNU Lesser General Public License as published by the 4 | Free Software Foundation; either version 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-2013 Live Networks, Inc. All rights reserved. 18 | // JPEG video sources 19 | // C++ header 20 | 21 | #ifndef _JPEG_VIDEO_SOURCE_HH 22 | #define _JPEG_VIDEO_SOURCE_HH 23 | 24 | #ifndef _FRAMED_SOURCE_HH 25 | #include "FramedSource.hh" 26 | #endif 27 | 28 | class JPEGVideoSource: public FramedSource { 29 | public: 30 | virtual u_int8_t type() = 0; 31 | virtual u_int8_t qFactor() = 0; 32 | virtual u_int8_t width() = 0; // # pixels/8 (or 0 for 2048 pixels) 33 | virtual u_int8_t height() = 0; // # pixels/8 (or 0 for 2048 pixels) 34 | 35 | virtual u_int8_t const* quantizationTables(u_int8_t& precision, 36 | u_int16_t& length); 37 | // If "qFactor()" returns a value >= 128, then this function is called 38 | // to tell us the quantization tables that are being used. 39 | // (The default implementation of this function just returns NULL.) 40 | // "precision" and "length" are as defined in RFC 2435, section 3.1.8. 41 | 42 | virtual u_int16_t restartInterval(); 43 | // If restart intervals are being used (i.e., 64 <= type() <= 127), then this function must be 44 | // redefined - by a subclass - to return a non-zero value. 45 | 46 | protected: 47 | JPEGVideoSource(UsageEnvironment& env); // abstract base class 48 | virtual ~JPEGVideoSource(); 49 | 50 | private: 51 | // redefined virtual functions: 52 | virtual Boolean isJPEGVideoSource() const; 53 | }; 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /Client/include/liveMedia/include/MP3ADURTPSink.hh: -------------------------------------------------------------------------------- 1 | /********** 2 | This library is free software; you can redistribute it and/or modify it under 3 | the terms of the GNU Lesser General Public License as published by the 4 | Free Software Foundation; either version 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-2013 Live Networks, Inc. All rights reserved. 18 | // RTP sink for 'ADUized' MP3 frames ("mpa-robust") 19 | // C++ header 20 | 21 | #ifndef _MP3_ADU_RTP_SINK_HH 22 | #define _MP3_ADU_RTP_SINK_HH 23 | 24 | #ifndef _AUDIO_RTP_SINK_HH 25 | #include "AudioRTPSink.hh" 26 | #endif 27 | 28 | class MP3ADURTPSink: public AudioRTPSink { 29 | public: 30 | static MP3ADURTPSink* createNew(UsageEnvironment& env, Groupsock* RTPgs, 31 | unsigned char RTPPayloadType); 32 | 33 | protected: 34 | virtual ~MP3ADURTPSink(); 35 | 36 | private: 37 | MP3ADURTPSink(UsageEnvironment& env, Groupsock* RTPgs, 38 | unsigned char RTPPayloadType); 39 | // called only by createNew() 40 | 41 | 42 | private: 43 | // Redefined virtual functions: 44 | virtual void doSpecialFrameHandling(unsigned fragmentationOffset, 45 | unsigned char* frameStart, 46 | unsigned numBytesInFrame, 47 | struct timeval framePresentationTime, 48 | unsigned numRemainingBytes); 49 | virtual unsigned specialHeaderSize() const; 50 | 51 | private: 52 | unsigned fCurADUSize; // used when fragmenting over multiple RTP packets 53 | }; 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /Client/include/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-2013 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 | -------------------------------------------------------------------------------- /Client/include/liveMedia/include/MP3ADUTranscoder.hh: -------------------------------------------------------------------------------- 1 | /********** 2 | This library is free software; you can redistribute it and/or modify it under 3 | the terms of the GNU Lesser General Public License as published by the 4 | Free Software Foundation; either version 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-2013 Live Networks, Inc. All rights reserved. 18 | // Transcoder for ADUized MP3 frames 19 | // C++ header 20 | 21 | #ifndef _MP3_ADU_TRANSCODER_HH 22 | #define _MP3_ADU_TRANSCODER_HH 23 | 24 | #ifndef _FRAMED_FILTER_HH 25 | #include "FramedFilter.hh" 26 | #endif 27 | 28 | class MP3ADUTranscoder: public FramedFilter { 29 | public: 30 | static MP3ADUTranscoder* createNew(UsageEnvironment& env, 31 | unsigned outBitrate /* in kbps */, 32 | FramedSource* inputSource); 33 | 34 | unsigned outBitrate() const { return fOutBitrate; } 35 | protected: 36 | MP3ADUTranscoder(UsageEnvironment& env, 37 | unsigned outBitrate /* in kbps */, 38 | FramedSource* inputSource); 39 | // called only by createNew() 40 | virtual ~MP3ADUTranscoder(); 41 | 42 | private: 43 | // redefined virtual functions: 44 | virtual void doGetNextFrame(); 45 | virtual void getAttributes() const; 46 | 47 | private: 48 | static void afterGettingFrame(void* clientData, 49 | unsigned numBytesRead, unsigned numTruncatedBytes, 50 | struct timeval presentationTime, 51 | unsigned durationInMicroseconds); 52 | void afterGettingFrame1(unsigned numBytesRead, unsigned numTruncatedBytes, 53 | struct timeval presentationTime, 54 | unsigned durationInMicroseconds); 55 | 56 | private: 57 | unsigned fOutBitrate; // in kbps 58 | unsigned fAvailableBytesForBackpointer; 59 | 60 | unsigned char* fOrigADU; 61 | // used to store incoming ADU prior to transcoding 62 | }; 63 | 64 | #endif 65 | -------------------------------------------------------------------------------- /Client/include/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-2013 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 | -------------------------------------------------------------------------------- /Client/include/liveMedia/include/MPEG1or2AudioRTPSink.hh: -------------------------------------------------------------------------------- 1 | /********** 2 | This library is free software; you can redistribute it and/or modify it under 3 | the terms of the GNU Lesser General Public License as published by the 4 | Free Software Foundation; either version 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-2013 Live Networks, Inc. All rights reserved. 18 | // RTP sink for MPEG audio (RFC 2250) 19 | // C++ header 20 | 21 | #ifndef _MPEG_1OR2_AUDIO_RTP_SINK_HH 22 | #define _MPEG_1OR2_AUDIO_RTP_SINK_HH 23 | 24 | #ifndef _AUDIO_RTP_SINK_HH 25 | #include "AudioRTPSink.hh" 26 | #endif 27 | 28 | class MPEG1or2AudioRTPSink: public AudioRTPSink { 29 | public: 30 | static MPEG1or2AudioRTPSink* createNew(UsageEnvironment& env, 31 | Groupsock* RTPgs); 32 | 33 | protected: 34 | MPEG1or2AudioRTPSink(UsageEnvironment& env, Groupsock* RTPgs); 35 | // called only by createNew() 36 | 37 | virtual ~MPEG1or2AudioRTPSink(); 38 | 39 | private: // redefined virtual functions: 40 | virtual void doSpecialFrameHandling(unsigned fragmentationOffset, 41 | unsigned char* frameStart, 42 | unsigned numBytesInFrame, 43 | struct timeval framePresentationTime, 44 | unsigned numRemainingBytes); 45 | virtual unsigned specialHeaderSize() const; 46 | }; 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /Client/include/liveMedia/include/MPEG1or2AudioRTPSource.hh: -------------------------------------------------------------------------------- 1 | /********** 2 | This library is free software; you can redistribute it and/or modify it under 3 | the terms of the GNU Lesser General Public License as published by the 4 | Free Software Foundation; either version 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-2013 Live Networks, Inc. All rights reserved. 18 | // MPEG-1 or MPEG-2 Audio RTP Sources 19 | // C++ header 20 | 21 | #ifndef _MPEG_1OR2_AUDIO_RTP_SOURCE_HH 22 | #define _MPEG_1OR2_AUDIO_RTP_SOURCE_HH 23 | 24 | #ifndef _MULTI_FRAMED_RTP_SOURCE_HH 25 | #include "MultiFramedRTPSource.hh" 26 | #endif 27 | 28 | class MPEG1or2AudioRTPSource: public MultiFramedRTPSource { 29 | public: 30 | static MPEG1or2AudioRTPSource* 31 | createNew(UsageEnvironment& env, Groupsock* RTPgs, 32 | unsigned char rtpPayloadFormat = 14, 33 | unsigned rtpTimestampFrequency = 90000); 34 | 35 | protected: 36 | virtual ~MPEG1or2AudioRTPSource(); 37 | 38 | private: 39 | MPEG1or2AudioRTPSource(UsageEnvironment& env, Groupsock* RTPgs, 40 | unsigned char rtpPayloadFormat, 41 | unsigned rtpTimestampFrequency); 42 | // called only by createNew() 43 | 44 | private: 45 | // redefined virtual functions: 46 | virtual Boolean processSpecialHeader(BufferedPacket* packet, 47 | unsigned& resultSpecialHeaderSize); 48 | virtual char const* MIMEtype() const; 49 | }; 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /Client/include/liveMedia/include/MPEG1or2VideoRTPSource.hh: -------------------------------------------------------------------------------- 1 | /********** 2 | This library is free software; you can redistribute it and/or modify it under 3 | the terms of the GNU Lesser General Public License as published by the 4 | Free Software Foundation; either version 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-2013 Live Networks, Inc. All rights reserved. 18 | // MPEG-1 or MPEG-2 Video RTP Sources 19 | // C++ header 20 | 21 | #ifndef _MPEG_1OR2_VIDEO_RTP_SOURCE_HH 22 | #define _MPEG_1OR2_VIDEO_RTP_SOURCE_HH 23 | 24 | #ifndef _MULTI_FRAMED_RTP_SOURCE_HH 25 | #include "MultiFramedRTPSource.hh" 26 | #endif 27 | 28 | class MPEG1or2VideoRTPSource: public MultiFramedRTPSource { 29 | public: 30 | static MPEG1or2VideoRTPSource* 31 | createNew(UsageEnvironment& env, Groupsock* RTPgs, 32 | unsigned char rtpPayloadFormat = 32, 33 | unsigned rtpPayloadFrequency = 90000); 34 | 35 | protected: 36 | virtual ~MPEG1or2VideoRTPSource(); 37 | 38 | private: 39 | MPEG1or2VideoRTPSource(UsageEnvironment& env, Groupsock* RTPgs, 40 | unsigned char rtpPayloadFormat, 41 | unsigned rtpTimestampFrequency); 42 | // called only by createNew() 43 | 44 | private: 45 | // redefined virtual functions: 46 | virtual Boolean processSpecialHeader(BufferedPacket* packet, 47 | unsigned& resultSpecialHeaderSize); 48 | virtual Boolean packetIsUsableInJitterCalculation(unsigned char* packet, 49 | unsigned packetSize); 50 | virtual char const* MIMEtype() const; 51 | }; 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /Client/include/liveMedia/include/MPEG1or2VideoStreamFramer.hh: -------------------------------------------------------------------------------- 1 | /********** 2 | This library is free software; you can redistribute it and/or modify it under 3 | the terms of the GNU Lesser General Public License as published by the 4 | Free Software Foundation; either version 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-2013 Live Networks, Inc. All rights reserved. 18 | // A filter that breaks up an MPEG 1 or 2 video elementary stream into 19 | // frames for: Video_Sequence_Header, GOP_Header, Picture_Header 20 | // C++ header 21 | 22 | #ifndef _MPEG_1OR2_VIDEO_STREAM_FRAMER_HH 23 | #define _MPEG_1OR2_VIDEO_STREAM_FRAMER_HH 24 | 25 | #ifndef _MPEG_VIDEO_STREAM_FRAMER_HH 26 | #include "MPEGVideoStreamFramer.hh" 27 | #endif 28 | 29 | class MPEG1or2VideoStreamFramer: public MPEGVideoStreamFramer { 30 | public: 31 | static MPEG1or2VideoStreamFramer* 32 | createNew(UsageEnvironment& env, FramedSource* inputSource, 33 | Boolean iFramesOnly = False, 34 | double vshPeriod = 5.0 35 | /* how often (in seconds) to inject a Video_Sequence_Header, 36 | if one doesn't already appear in the stream */); 37 | 38 | protected: 39 | MPEG1or2VideoStreamFramer(UsageEnvironment& env, 40 | FramedSource* inputSource, 41 | Boolean iFramesOnly, double vshPeriod, 42 | Boolean createParser = True); 43 | // called only by createNew(), or by subclass constructors 44 | virtual ~MPEG1or2VideoStreamFramer(); 45 | 46 | private: 47 | // redefined virtual functions: 48 | virtual Boolean isMPEG1or2VideoStreamFramer() const; 49 | 50 | private: 51 | double getCurrentPTS() const; 52 | 53 | friend class MPEG1or2VideoStreamParser; // hack 54 | }; 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /Client/include/liveMedia/include/MPEG2TransportStreamFromESSource.hh: -------------------------------------------------------------------------------- 1 | /********** 2 | This library is free software; you can redistribute it and/or modify it under 3 | the terms of the GNU Lesser General Public License as published by the 4 | Free Software Foundation; either version 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-2013 Live Networks, Inc. All rights reserved. 18 | // A filter for converting one or more MPEG Elementary Streams 19 | // to a MPEG-2 Transport Stream 20 | // C++ header 21 | 22 | #ifndef _MPEG2_TRANSPORT_STREAM_FROM_ES_SOURCE_HH 23 | #define _MPEG2_TRANSPORT_STREAM_FROM_ES_SOURCE_HH 24 | 25 | #ifndef _MPEG2_TRANSPORT_STREAM_MULTIPLEXOR_HH 26 | #include "MPEG2TransportStreamMultiplexor.hh" 27 | #endif 28 | 29 | class MPEG2TransportStreamFromESSource: public MPEG2TransportStreamMultiplexor { 30 | public: 31 | static MPEG2TransportStreamFromESSource* createNew(UsageEnvironment& env); 32 | 33 | void addNewVideoSource(FramedSource* inputSource, int mpegVersion); 34 | // Note: For MPEG-4 video, set "mpegVersion" to 4; for H.264 video, set "mpegVersion" to 5. 35 | void addNewAudioSource(FramedSource* inputSource, int mpegVersion); 36 | 37 | protected: 38 | MPEG2TransportStreamFromESSource(UsageEnvironment& env); 39 | // called only by createNew() 40 | virtual ~MPEG2TransportStreamFromESSource(); 41 | 42 | void addNewInputSource(FramedSource* inputSource, 43 | u_int8_t streamId, int mpegVersion); 44 | // used to implement addNew*Source() above 45 | 46 | private: 47 | // Redefined virtual functions: 48 | virtual void doStopGettingFrames(); 49 | virtual void awaitNewBuffer(unsigned char* oldBuffer); 50 | 51 | private: 52 | friend class InputESSourceRecord; 53 | class InputESSourceRecord* fInputSources; 54 | unsigned fVideoSourceCounter, fAudioSourceCounter; 55 | }; 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /Client/include/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-2013 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 | -------------------------------------------------------------------------------- /Client/include/liveMedia/include/MediaSource.hh: -------------------------------------------------------------------------------- 1 | /********** 2 | This library is free software; you can redistribute it and/or modify it under 3 | the terms of the GNU Lesser General Public License as published by the 4 | Free Software Foundation; either version 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-2013 Live Networks, Inc. All rights reserved. 18 | // Media Sources 19 | // C++ header 20 | 21 | #ifndef _MEDIA_SOURCE_HH 22 | #define _MEDIA_SOURCE_HH 23 | 24 | #ifndef _MEDIA_HH 25 | #include "Media.hh" 26 | #endif 27 | 28 | class MediaSource: public Medium { 29 | public: 30 | static Boolean lookupByName(UsageEnvironment& env, char const* sourceName, 31 | MediaSource*& resultSource); 32 | virtual void getAttributes() const; 33 | // attributes are returned in "env's" 'result message' 34 | 35 | // The MIME type of this source: 36 | virtual char const* MIMEtype() const; 37 | 38 | // Test for specific types of source: 39 | virtual Boolean isFramedSource() const; 40 | virtual Boolean isRTPSource() const; 41 | virtual Boolean isMPEG1or2VideoStreamFramer() const; 42 | virtual Boolean isMPEG4VideoStreamFramer() const; 43 | virtual Boolean isH264VideoStreamFramer() const; 44 | virtual Boolean isDVVideoStreamFramer() const; 45 | virtual Boolean isJPEGVideoSource() const; 46 | virtual Boolean isAMRAudioSource() const; 47 | 48 | protected: 49 | MediaSource(UsageEnvironment& env); // abstract base class 50 | virtual ~MediaSource(); 51 | 52 | private: 53 | // redefined virtual functions: 54 | virtual Boolean isSource() const; 55 | }; 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /Client/include/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-2013 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 | -------------------------------------------------------------------------------- /Client/include/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-2013 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 | -------------------------------------------------------------------------------- /Client/include/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-2013 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 | -------------------------------------------------------------------------------- /Client/include/liveMedia/include/VP8VideoRTPSink.hh: -------------------------------------------------------------------------------- 1 | /********** 2 | This library is free software; you can redistribute it and/or modify it under 3 | the terms of the GNU Lesser General Public License as published by the 4 | Free Software Foundation; either version 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-2013 Live Networks, Inc. All rights reserved. 18 | // RTP sink for VP8 video 19 | // C++ header 20 | 21 | #ifndef _VP8_VIDEO_RTP_SINK_HH 22 | #define _VP8_VIDEO_RTP_SINK_HH 23 | 24 | #ifndef _VIDEO_RTP_SINK_HH 25 | #include "VideoRTPSink.hh" 26 | #endif 27 | 28 | class VP8VideoRTPSink: public VideoRTPSink { 29 | public: 30 | static VP8VideoRTPSink* createNew(UsageEnvironment& env, Groupsock* RTPgs, unsigned char rtpPayloadFormat); 31 | 32 | protected: 33 | VP8VideoRTPSink(UsageEnvironment& env, Groupsock* RTPgs, unsigned char rtpPayloadFormat); 34 | // called only by createNew() 35 | 36 | virtual ~VP8VideoRTPSink(); 37 | 38 | private: // redefined virtual functions: 39 | virtual void doSpecialFrameHandling(unsigned fragmentationOffset, 40 | unsigned char* frameStart, 41 | unsigned numBytesInFrame, 42 | struct timeval framePresentationTime, 43 | unsigned numRemainingBytes); 44 | virtual 45 | Boolean frameCanAppearAfterPacketStart(unsigned char const* frameStart, 46 | unsigned numBytesInFrame) const; 47 | virtual unsigned specialHeaderSize() const; 48 | }; 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /Client/include/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-2013 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 | -------------------------------------------------------------------------------- /Client/include/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-2013 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 | -------------------------------------------------------------------------------- /Client/include/liveMedia/include/VorbisAudioRTPSource.hh: -------------------------------------------------------------------------------- 1 | /********** 2 | This library is free software; you can redistribute it and/or modify it under 3 | the terms of the GNU Lesser General Public License as published by the 4 | Free Software Foundation; either version 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-2013 Live Networks, Inc. All rights reserved. 18 | // Vorbis Audio RTP Sources 19 | // C++ header 20 | 21 | #ifndef _VORBIS_AUDIO_RTP_SOURCE_HH 22 | #define _VORBIS_AUDIO_RTP_SOURCE_HH 23 | 24 | #ifndef _MULTI_FRAMED_RTP_SOURCE_HH 25 | #include "MultiFramedRTPSource.hh" 26 | #endif 27 | 28 | class VorbisAudioRTPSource: public MultiFramedRTPSource { 29 | public: 30 | static VorbisAudioRTPSource* 31 | createNew(UsageEnvironment& env, Groupsock* RTPgs, 32 | unsigned char rtpPayloadFormat, 33 | unsigned rtpTimestampFrequency); 34 | 35 | u_int32_t curPacketIdent() const { return fCurPacketIdent; } // The current "Ident" field; only the low-order 24 bits are used 36 | 37 | protected: 38 | VorbisAudioRTPSource(UsageEnvironment& env, Groupsock* RTPgs, 39 | unsigned char rtpPayloadFormat, 40 | unsigned rtpTimestampFrequency); 41 | // called only by createNew() 42 | 43 | virtual ~VorbisAudioRTPSource(); 44 | 45 | protected: 46 | // redefined virtual functions: 47 | virtual Boolean processSpecialHeader(BufferedPacket* packet, 48 | unsigned& resultSpecialHeaderSize); 49 | virtual char const* MIMEtype() const; 50 | 51 | private: 52 | u_int32_t fCurPacketIdent; // only the low-order 24 bits are used 53 | }; 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /Client/include/liveMedia/include/liveMedia_version.hh: -------------------------------------------------------------------------------- 1 | // Version information for the "liveMedia" library 2 | // Copyright (c) 1996-2013 Live Networks, Inc. All rights reserved. 3 | 4 | #ifndef _LIVEMEDIA_VERSION_HH 5 | #define _LIVEMEDIA_VERSION_HH 6 | 7 | #define LIVEMEDIA_LIBRARY_VERSION_STRING "2013.11.15" 8 | #define LIVEMEDIA_LIBRARY_VERSION_INT 1384473600 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /Client/include/rtmp/http.h: -------------------------------------------------------------------------------- 1 | #ifndef __RTMP_HTTP_H__ 2 | #define __RTMP_HTTP_H__ 3 | /* 4 | * Copyright (C) 2010 Howard Chu 5 | * Copyright (C) 2010 Antti Ajanki 6 | * 7 | * This file is part of librtmp. 8 | * 9 | * librtmp is free software; you can redistribute it and/or modify 10 | * it under the terms of the GNU Lesser General Public License as 11 | * published by the Free Software Foundation; either version 2.1, 12 | * or (at your option) any later version. 13 | * 14 | * librtmp is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with librtmp see the file COPYING. If not, write to 21 | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 22 | * Boston, MA 02110-1301, USA. 23 | * http://www.gnu.org/copyleft/lgpl.html 24 | */ 25 | 26 | typedef enum { 27 | HTTPRES_OK, /* result OK */ 28 | HTTPRES_OK_NOT_MODIFIED, /* not modified since last request */ 29 | HTTPRES_NOT_FOUND, /* not found */ 30 | HTTPRES_BAD_REQUEST, /* client error */ 31 | HTTPRES_SERVER_ERROR, /* server reported an error */ 32 | HTTPRES_REDIRECTED, /* resource has been moved */ 33 | HTTPRES_LOST_CONNECTION /* connection lost while waiting for data */ 34 | } HTTPResult; 35 | 36 | struct HTTP_ctx { 37 | char *date; 38 | int size; 39 | int status; 40 | void *data; 41 | }; 42 | 43 | typedef size_t (HTTP_read_callback)(void *ptr, size_t size, size_t nmemb, void *stream); 44 | 45 | HTTPResult HTTP_get(struct HTTP_ctx *http, const char *url, HTTP_read_callback *cb); 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /Client/lib/avcodec.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sxcong/rttim/57cea98fd80e4a7aa9c62441c112cc621c6db884/Client/lib/avcodec.lib -------------------------------------------------------------------------------- /Client/lib/avdevice.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sxcong/rttim/57cea98fd80e4a7aa9c62441c112cc621c6db884/Client/lib/avdevice.lib -------------------------------------------------------------------------------- /Client/lib/avfilter.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sxcong/rttim/57cea98fd80e4a7aa9c62441c112cc621c6db884/Client/lib/avfilter.lib -------------------------------------------------------------------------------- /Client/lib/avformat.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sxcong/rttim/57cea98fd80e4a7aa9c62441c112cc621c6db884/Client/lib/avformat.lib -------------------------------------------------------------------------------- /Client/lib/avutil.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sxcong/rttim/57cea98fd80e4a7aa9c62441c112cc621c6db884/Client/lib/avutil.lib -------------------------------------------------------------------------------- /Client/lib/libBasicUsageEnvironment.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sxcong/rttim/57cea98fd80e4a7aa9c62441c112cc621c6db884/Client/lib/libBasicUsageEnvironment.lib -------------------------------------------------------------------------------- /Client/lib/libUsageEnvironment.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sxcong/rttim/57cea98fd80e4a7aa9c62441c112cc621c6db884/Client/lib/libUsageEnvironment.lib -------------------------------------------------------------------------------- /Client/lib/libgroupsock.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sxcong/rttim/57cea98fd80e4a7aa9c62441c112cc621c6db884/Client/lib/libgroupsock.lib -------------------------------------------------------------------------------- /Client/lib/libliveMedia.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sxcong/rttim/57cea98fd80e4a7aa9c62441c112cc621c6db884/Client/lib/libliveMedia.lib -------------------------------------------------------------------------------- /Client/lib/librtmp.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sxcong/rttim/57cea98fd80e4a7aa9c62441c112cc621c6db884/Client/lib/librtmp.lib -------------------------------------------------------------------------------- /Client/lib/librtmpd.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sxcong/rttim/57cea98fd80e4a7aa9c62441c112cc621c6db884/Client/lib/librtmpd.lib -------------------------------------------------------------------------------- /Client/lib/postproc.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sxcong/rttim/57cea98fd80e4a7aa9c62441c112cc621c6db884/Client/lib/postproc.lib -------------------------------------------------------------------------------- /Client/lib/pthread.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sxcong/rttim/57cea98fd80e4a7aa9c62441c112cc621c6db884/Client/lib/pthread.lib -------------------------------------------------------------------------------- /Client/lib/swresample.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sxcong/rttim/57cea98fd80e4a7aa9c62441c112cc621c6db884/Client/lib/swresample.lib -------------------------------------------------------------------------------- /Client/lib/swscale.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sxcong/rttim/57cea98fd80e4a7aa9c62441c112cc621c6db884/Client/lib/swscale.lib -------------------------------------------------------------------------------- /Client/readme: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sxcong/rttim/57cea98fd80e4a7aa9c62441c112cc621c6db884/Client/readme -------------------------------------------------------------------------------- /Client/res/Client.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sxcong/rttim/57cea98fd80e4a7aa9c62441c112cc621c6db884/Client/res/Client.ico -------------------------------------------------------------------------------- /Client/res/Client.rc2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sxcong/rttim/57cea98fd80e4a7aa9c62441c112cc621c6db884/Client/res/Client.rc2 -------------------------------------------------------------------------------- /Client/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by Client.rc 4 | // 5 | #define IDM_ABOUTBOX 0x0010 6 | #define IDD_ABOUTBOX 100 7 | #define IDS_ABOUTBOX 101 8 | #define IDD_CLIENT_DIALOG 102 9 | #define IDR_MAINFRAME 128 10 | #define IDD_VIDEO 129 11 | #define IDC_COMBO_VDEVICE 1000 12 | #define IDC_BUTTON_OPEN 1002 13 | #define IDC_BUTTON2 1003 14 | #define IDC_BUTTON_CLOSE 1003 15 | #define IDC_BUTTON1 1004 16 | #define IDC_EDIT1 1005 17 | #define IDC_EDIT_UID 1005 18 | 19 | // Next default values for new objects 20 | // 21 | #ifdef APSTUDIO_INVOKED 22 | #ifndef APSTUDIO_READONLY_SYMBOLS 23 | #define _APS_NEXT_RESOURCE_VALUE 130 24 | #define _APS_NEXT_COMMAND_VALUE 32771 25 | #define _APS_NEXT_CONTROL_VALUE 1006 26 | #define _APS_NEXT_SYMED_VALUE 101 27 | #endif 28 | #endif 29 | -------------------------------------------------------------------------------- /Client/stdafx.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sxcong/rttim/57cea98fd80e4a7aa9c62441c112cc621c6db884/Client/stdafx.cpp -------------------------------------------------------------------------------- /Client/stdafx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sxcong/rttim/57cea98fd80e4a7aa9c62441c112cc621c6db884/Client/stdafx.h -------------------------------------------------------------------------------- /Client/targetver.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sxcong/rttim/57cea98fd80e4a7aa9c62441c112cc621c6db884/Client/targetver.h -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | rttim 2 | ===== 3 | 4 | IM, video and voice chat 5 | 1 video cap
6 | http://blog.chinaunix.net/uid-15063109-id-4530994.html 7 | 8 | 2 video encode and decode
9 | http://blog.chinaunix.net/uid-15063109-id-4531903.html 10 | 11 | 12 | 3 udp send and recv
13 | http://blog.chinaunix.net/uid-15063109-id-4532768.html
14 | http://blog.chinaunix.net/uid-15063109-id-4536610.html
15 | http://blog.chinaunix.net/uid-15063109-id-4544203.html 16 | 17 | 4 stun server
18 | http://blog.chinaunix.net/uid-15063109-id-4548099.html 19 | 20 | 这个项目只是演示sip视频基础通话用的。要想做成完善产品还有很多细节需要做。 21 | 如果大家有问题请发到sxcong@163.com上,收到后会及时回复。 22 | -------------------------------------------------------------------------------- /Server/Server.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sxcong/rttim/57cea98fd80e4a7aa9c62441c112cc621c6db884/Server/Server.suo -------------------------------------------------------------------------------- /stun_server/makefile: -------------------------------------------------------------------------------- 1 | #C_FLAGS= -Wall -Wpointer-arith -O3 -pipe -g 2 | C_FLAGS= -Wall -g -DNDEBUG 3 | CXX= g++ 4 | 5 | INC= -I./run/include -I. 6 | 7 | LIB= -L./run/lib -lrun -lpthread 8 | 9 | SOURCES_FILES_CPP=$(wildcard *.cpp) 10 | EXE_FILE=$(SOURCES_FILES_CPP:%.cpp=%) 11 | 12 | $(EXE_FILE): 13 | for E in $(EXE_FILE) ; \ 14 | do \ 15 | echo "$(CXX) -g -o2 -o $$E $$E.cpp $(C_FLAGS) $(INC) $(LIB)"; \ 16 | $(CXX) -g -o2 -o $$E $$E.cpp $(C_FLAGS) $(INC) $(LIB);\ 17 | done 18 | # for E in $(EXE_FILE) ; \ 19 | do \ 20 | echo "strip ./$$E ";\ 21 | strip ./$$E ;\ 22 | done 23 | all:$(EXE_FILE) 24 | @echo "$(EXE_FILE)" 25 | clean: 26 | rm -f $(EXE_FILE) 27 | -------------------------------------------------------------------------------- /stun_server/run/include/UDPSession.h: -------------------------------------------------------------------------------- 1 | // RTPSession.h: interface for the RTPSession class. 2 | // 3 | ////////////////////////////////////////////////////////////////////// 4 | 5 | #if !defined(AFX_RTPSESSION_H__E0363A1C_703C_456A_9E3A_5FED274429BF__INCLUDED_) 6 | #define AFX_RTPSESSION_H__E0363A1C_703C_456A_9E3A_5FED274429BF__INCLUDED_ 7 | 8 | 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | using namespace std; 23 | 24 | #include "UDPSock.h" 25 | #include "global.h" 26 | 27 | #include "evbuffer.h" 28 | 29 | class CUDPSession 30 | { 31 | public: 32 | CUDPSession(); 33 | virtual ~CUDPSession(); 34 | int Open(uint16_t usLocalPort, udp_data_cb cb, void* param); 35 | int Close(); 36 | 37 | int SendRaw(char* pBuff, uint32_t nLen, uint32_t ip, uint16_t port); 38 | int Send(char* pBuff,uint32_t nLen,uint32_t ip,uint16_t port); 39 | 40 | uint32_t m_localUid; 41 | uint32_t m_destUid; 42 | uint32_t m_destIP; 43 | uint32_t m_destPort; 44 | uint32_t m_timestamp; 45 | 46 | udp_data_cb m_pCB; 47 | void* m_pParam; 48 | 49 | timeout_cb m_pTimeOutCB; 50 | 51 | struct evbuffer *m_buffer;; 52 | 53 | 54 | private: 55 | static void* EventLoop(void* lpParameter ); 56 | void ProcessEvent(); 57 | 58 | int Reassemble(CPackIn& pack, uint32_t ip, uint32_t port); 59 | int OnRecv(char* pBuff,uint32_t nLen, uint32_t ip,uint16_t port); 60 | int SendPacket(CPackOut* pPack, uint32_t ip, uint32_t port); 61 | void OnTimer(); 62 | 63 | 64 | bool m_bEventLoopStarted; 65 | CUDPSock m_udpIO; 66 | pthread_t m_tid; 67 | 68 | uint32_t m_nFrameIndex; 69 | uint32_t m_nRecvFrameIndex; 70 | 71 | 72 | int SplitData(char* pBuff, uint32_t nLen); 73 | }; 74 | 75 | #endif // !defined(AFX_RTPSESSION_H__E0363A1C_703C_456A_9E3A_5FED274429BF__INCLUDED_) 76 | -------------------------------------------------------------------------------- /stun_server/run/include/UDPSock.h: -------------------------------------------------------------------------------- 1 | // RTPSock.h: interface for the CRTPSock class. 2 | // 3 | ////////////////////////////////////////////////////////////////////// 4 | 5 | #if !defined(AFX_RTPSOCK_H__1190002F_8701_406A_8BEF_FD4053D18C20__INCLUDED_) 6 | #define AFX_RTPSOCK_H__1190002F_8701_406A_8BEF_FD4053D18C20__INCLUDED_ 7 | 8 | #if _MSC_VER > 1000 9 | #pragma once 10 | #endif // _MSC_VER > 1000 11 | 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | 22 | 23 | 24 | #define RUDP_RECV_BUFFER_SIZE 1500 25 | 26 | class CUDPSock 27 | { 28 | public: 29 | CUDPSock(); 30 | virtual ~CUDPSock(); 31 | 32 | int Open(int nPort); 33 | 34 | int Close(); 35 | 36 | int Send( const char* pBuf, size_t nLen, uint32_t ip, uint16_t port ) const; 37 | 38 | int Receive(char* pBuf, size_t nLen, uint32_t& ip, uint16_t& port) const; 39 | 40 | 41 | int m_handle; 42 | 43 | }; 44 | 45 | #endif // !defined(AFX_RTPSOCK_H__1190002F_8701_406A_8BEF_FD4053D18C20__INCLUDED_) 46 | -------------------------------------------------------------------------------- /stun_server/run/include/UserMgr.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | using namespace std; 15 | 16 | 17 | class CUser 18 | { 19 | public: 20 | CUser(uint32_t id, uint32_t ip, uint32_t port); 21 | ~CUser(); 22 | 23 | uint32_t m_uid; 24 | uint32_t m_ip; 25 | uint32_t m_port; 26 | }; 27 | 28 | 29 | class CUserMgr 30 | { 31 | public: 32 | CUserMgr(void); 33 | ~CUserMgr(void); 34 | 35 | static CUserMgr& Instance(); 36 | 37 | CUser* AddUser(uint32_t id, uint32_t ip, uint32_t port); 38 | CUser* FindUser(uint32_t uid); 39 | void RemoveUser(uint32_t uid); 40 | 41 | private: 42 | map m_UserMap; 43 | }; 44 | -------------------------------------------------------------------------------- /stun_server/run/include/XAgent.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | 15 | #include 16 | #include 17 | using namespace std; 18 | 19 | 20 | int get_key_value(char* input, char* key, char* output); 21 | 22 | char* get_item_value_from_file(char* file, char* key, char* value); 23 | class CXAgent 24 | { 25 | public: 26 | CXAgent(void); 27 | ~CXAgent(void); 28 | int m_nPort; 29 | 30 | int Run(char *name); 31 | 32 | private: 33 | pthread_t tid; 34 | 35 | 36 | private: 37 | //bool m_bLive; 38 | 39 | public: 40 | string m_progName; 41 | 42 | public: 43 | static CXAgent& Instance(); 44 | void init(); 45 | //void uninit(); 46 | }; 47 | -------------------------------------------------------------------------------- /stun_server/run/include/global.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | 4 | #define UDP_BLOCK_SIZE 1200 5 | 6 | enum 7 | { 8 | PACK_TYPE_REQ = 0, 9 | PACK_TYPE_DATA = 1, 10 | PACK_TYPE_REQACK = 2, 11 | PACK_TYPE_DATAACK = 3, 12 | PACK_TYPE_FINISH = 4, 13 | PACK_TYPE_ACK_DATAACK = 5, 14 | }; 15 | 16 | #define SEND_WINDOIW_SIZE 128 17 | #define ONCE_MAX_ACK_NUM 8 18 | #define MAX_NO_ACK_TIMEOUT 2000 19 | #define MAX_NO_DATA_TIMEOUT 1000 20 | #define MAX_PACK_SIZE 1024 21 | 22 | #define MAX_VIDEOFRAME_SIZE 1024000 23 | 24 | 25 | typedef void (*udp_data_cb)(int sockid, char *data, int len, int ip, int port, void* param); 26 | 27 | typedef void (*timeout_cb)(int sockid); 28 | 29 | class CPackIn 30 | { 31 | public: 32 | CPackIn(void); 33 | ~CPackIn(void); 34 | const CPackIn& operator>>(int& nData); 35 | const CPackIn& GetBuffer(char*& pBuffer, int& nSizeOut); 36 | void SetContent(char* pBuffer, int nLen); 37 | 38 | private: 39 | char* m_pBuf; 40 | int m_nReadPos; 41 | }; 42 | 43 | class CPackOut 44 | { 45 | public: 46 | CPackOut(void); 47 | ~CPackOut(void); 48 | const CPackOut& operator<<(int nData); 49 | const CPackOut& SetBuffer(char* pBuffer, int nSize); 50 | void GetContent(char*& pBuffer, int& nSizeOut); 51 | 52 | private: 53 | int m_nWritePos; 54 | char m_szBuffer[1500]; 55 | }; 56 | 57 | #define SAFE_RETURN(x) {HRESULT hr = (x); if(hr != S_OK) return hr;} 58 | #define SAFE_RELEASE(x) { if (x) x->Release(); x = NULL; } 59 | //#define SAFE_DELETE(x) { if (x) delete x; x = NULL; } 60 | 61 | 62 | #if defined(__WIN32__) || defined(_WIN32) 63 | // For Windoze, we need to implement our own gettimeofday() 64 | extern int gettimeofday(struct timeval*, int*); 65 | #endif -------------------------------------------------------------------------------- /stun_server/run/makefile: -------------------------------------------------------------------------------- 1 | #C_FLAGS= -Wall -Wpointer-arith -O3 -pipe -g 2 | C_FLAGS= -Wall -g -DNDEBUG #-D__DEBUG 3 | CXX = g++ 4 | AR = ar 5 | #LIBDIR=/root/fyt_server 6 | SOURCES_FILES_CPP=$(wildcard ./src/*.cpp) 7 | OBJECTS = $(patsubst %.cpp,obj/%.o,$(notdir $(SOURCES_FILES_CPP))) 8 | 9 | LIB_TARGET = lib/librun.a 10 | 11 | INC= -I./include -I/usr/local/include 12 | 13 | INC_DIR= include/ 14 | SRC_DIR= src/ 15 | OBJ_DIR= obj/ 16 | LIB_DIR= lib/ 17 | 18 | OBJ_EXT= .o 19 | CXXSRC_EXT= .cpp 20 | 21 | $(OBJ_DIR)%$(OBJ_EXT): $(SRC_DIR)%$(CXXSRC_EXT) 22 | # @echo 23 | # @echo "Compiling $< ==> $@" 24 | # @echo "mkdir -p $(OBJ_DIR) $(LIB_DIR)" 25 | # mkdir -p $(OBJ_DIR) $(LIB_DIR) 26 | $(CXX) $(INC) $(C_FLAGS) -c $< -o $@ 27 | 28 | $(LIB_TARGET): $(OBJECTS) 29 | # @echo 30 | # @echo "$(OBJECTS) ==> $@" 31 | $(AR) rcs $(LIB_TARGET) $(OBJECTS) 32 | 33 | all: $(LIB_TARGET) 34 | clean: 35 | rm -f $(LIB_TARGET) $(OBJECTS) 36 | -------------------------------------------------------------------------------- /stun_server/run/src/UserMgr.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "global.h" 3 | #include "UserMgr.h" 4 | #include 5 | using namespace std; 6 | 7 | #include 8 | class CFODeleteMap 9 | { 10 | public: 11 | template 12 | void operator() ( T& item ) 13 | { 14 | delete item.second; 15 | item.second = NULL; 16 | } 17 | }; 18 | 19 | class CFODelete 20 | { 21 | public: 22 | template 23 | void operator() ( T* pItem ) 24 | { 25 | delete pItem; 26 | pItem = NULL; 27 | } 28 | }; 29 | 30 | string ip_int2char(uint32_t ip) 31 | { 32 | sockaddr_in addr; 33 | memset(&addr, 0, sizeof(sockaddr_in)); 34 | addr.sin_addr.s_addr = ip; 35 | addr.sin_family = AF_INET; 36 | string temp = inet_ntoa(addr.sin_addr); 37 | return temp; 38 | } 39 | 40 | CUser::CUser(uint32_t id, uint32_t ip, uint32_t port) 41 | { 42 | m_uid = id; 43 | m_ip = ip; 44 | m_port = port; 45 | 46 | string ip1 = ip_int2char(ip); 47 | 48 | printf("ip:port = %s:%d \n", ip1.c_str(), port); 49 | 50 | //time(&m_lastTime); 51 | } 52 | 53 | CUser::~CUser() 54 | { 55 | } 56 | 57 | /////////// 58 | //user manager 59 | CUserMgr::CUserMgr(void) 60 | { 61 | 62 | } 63 | 64 | CUserMgr::~CUserMgr(void) 65 | { 66 | for_each(m_UserMap.begin(), m_UserMap.end(), CFODeleteMap()); 67 | } 68 | 69 | CUserMgr& CUserMgr::Instance() 70 | { 71 | static CUserMgr agent; 72 | return agent; 73 | } 74 | 75 | CUser* CUserMgr::AddUser(uint32_t id, uint32_t ip, uint32_t port) 76 | { 77 | CUser* pUser = NULL; 78 | map::iterator it = m_UserMap.find(id); 79 | if (it != m_UserMap.end()) 80 | { 81 | pUser = it->second; 82 | pUser->m_ip = ip; 83 | pUser->m_port = port; 84 | } 85 | else 86 | { 87 | pUser = new CUser(id, ip, port); 88 | m_UserMap[id] = pUser; 89 | } 90 | return pUser; 91 | } 92 | 93 | CUser* CUserMgr::FindUser(uint32_t uid) 94 | { 95 | map::iterator it = m_UserMap.find(uid); 96 | if (it != m_UserMap.end()) 97 | return it->second; 98 | return NULL; 99 | } 100 | 101 | void CUserMgr::RemoveUser(uint32_t uid) 102 | { 103 | map::iterator it = m_UserMap.find(uid); 104 | if (it != m_UserMap.end()) 105 | { 106 | delete it->second; 107 | it->second = NULL; 108 | m_UserMap.erase(it); 109 | } 110 | } -------------------------------------------------------------------------------- /stun_server/stun_server.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include "XAgent.h" 5 | 6 | 7 | int main(int argc, char** argv) 8 | { 9 | CXAgent::Instance().Run(argv[0]); 10 | return 0; 11 | } 12 | --------------------------------------------------------------------------------