// RTPAudioSource.h: interface for the RTPAudioSource class. // ////////////////////////////////////////////////////////////////////// #ifndef AFX_RTPAUDIOSOURCE_H__9A0DE2C0_90A9_4F86_B13C_58D1181EB505__INCLUDED_ #define AFX_RTPAUDIOSOURCE_H__9A0DE2C0_90A9_4F86_B13C_58D1181EB505__INCLUDED_ #include "AudioSource.h" #include "Parameters.h" enum Modes {ACTIVE_MODE=0, PASSIVE_MODE}; class RTPAudioSource : public AudioSource { public: RTPAudioSource(); virtual ~RTPAudioSource(); int SetReceivePort(unsigned short receivePort); int GetReceivePort(unsigned short *receivePort); // returns the currently bound receive port int SourceStarted(); int SourceStopped(); int SourceThreadStarted(HANDLE sourceThreadHandle, DWORD sourceThreadID); int SourceThreadStopped(HANDLE sourceThreadHandle, DWORD sourceThreadID); int UnprepareSource(); // if the filter is in ACTIVE_MODE, then it waits on a socket // so user needs to call UnprepareSource (which closes the socket) // before the SourceThreadProc can end. Hence this method is public protected: int GenerateData(AudioSample **ppAudioSample); int SetTraceLevel(); private: int CreateSockets(); int CloseSockets(); int PrepareSource(); int ReceiveUDPPacket(); int BindSocketToPort(SOCKET socket, unsigned short port); private: SOCKET rtpSocket; SOCKET rtcpSocket; unsigned short receivePort; unsigned short boundReceivePort; char receiveBuffer[RTPAUDIOSOURCE_RECEIVEBUFFER_SIZE]; int mode; bool bRunning; CRITICAL_SECTION filterMutex; }; #endif // !defined(AFX_RTPAUDIOSOURCE_H__9A0DE2C0_90A9_4F86_B13C_58D1181EB505__INCLUDED_)