📄 h323.h
字号:
virtual void OnWelcomeStateChanged();
// Called by OnOutgoingAudio to process the current welcome
// state, even if the member is already joined to a conference.
virtual void OnWelcomeProcessing();
// Called when the currently playing wave file has ended. This
// is not called if the state changed before the wave file
// stopped. Use welcomeState to know the current state.
virtual void OnWelcomeWaveEnded();
PString remoteName;
// Wave file played during the welcome procedure.
OpalWAVFile playFile;
// optional record file used during the welcome procedure
OpalWAVFile recordFile;
unsigned int recordSilenceCount;
unsigned int recordSilenceThreshold;
unsigned int recordDuration;
unsigned int recordLimit;
void StartRecording(
const PFilePath & filename,
unsigned int recordLimit = 5,
unsigned int recordSilenceThreshold = 1
);
virtual void OnFinishRecording();
//PAdaptiveDelay playDelay;
// True if the state has not changed since the wave file started.
BOOL wavePlayingInSameState;
PString audioTransmitCodecName;
PString audioReceiveCodecName;
BOOL isMCU;
#if OPENMCU_VIDEO
PVideoInputDevice_OpenMCU * videoGrabber;
PVideoOutputDevice_OpenMCU * videoDisplay;
PString videoTransmitCodecName;
PString videoReceiveCodecName;
#endif
};
////////////////////////////////////////////////////
class H323Connection_ConferenceConnection : public ConferenceConnection
{
PCLASSINFO(H323Connection_ConferenceConnection, ConferenceConnection);
public:
H323Connection_ConferenceConnection(void * id)
: ConferenceConnection(id)
{ conn = (OpenMCUH323Connection *)id; }
virtual PString GetName() const
{ return conn->GetCallToken(); }
protected:
OpenMCUH323Connection * conn;
};
class H323Connection_ConferenceMember : public ConferenceMember
{
PCLASSINFO(H323Connection_ConferenceMember, ConferenceMember);
public:
H323Connection_ConferenceMember(Conference * _conference, OpenMCUH323EndPoint & _ep, const PString & _h323Token, ConferenceMemberId _id, BOOL isMCU);
~H323Connection_ConferenceMember();
virtual ConferenceConnection * CreateConnection()
{
H323Connection * conn = ep.FindConnectionWithLock(h323Token);
if (conn == NULL)
return NULL;
H323Connection_ConferenceConnection * confConn = new H323Connection_ConferenceConnection(conn);
conn->Unlock();
return confConn;
}
virtual void Close();
virtual PString GetH323Token() const
{ return h323Token; }
virtual PString GetTitle() const;
PString GetMonitorInfo(const PString & hdr);
void OnReceivedUserInputIndication(const PString & str)
{
H323Connection * conn = ep.FindConnectionWithLock(h323Token);
if (conn != NULL)
conn->SendUserInput(str);
conn->Unlock();
}
protected:
OpenMCUH323EndPoint & ep;
PString h323Token;
};
////////////////////////////////////////////////////
#if OPENMCU_VIDEO
#include <ptlib/vconvert.h>
class PVideoInputDevice_OpenMCU : public PVideoInputDevice
{
PCLASSINFO(PVideoInputDevice_OpenMCU, PVideoInputDevice);
public:
/** Create a new MCU video input device.
*/
PVideoInputDevice_OpenMCU(OpenMCUH323Connection & conn);
/**Open the device given the device name.
*/
BOOL Open(
const PString & title, /// Device name to open
BOOL startImmediate = TRUE /// Immediately start device
);
/**Determine of the device is currently open.
*/
BOOL IsOpen() ;
/**Close the device.
*/
BOOL Close();
/**Start the video device I/O.
*/
BOOL Start();
/**Stop the video device I/O capture.
*/
BOOL Stop();
/**Determine if the video device I/O capture is in progress.
*/
BOOL IsCapturing();
/**Get a list of all of the drivers available.
*/
static PStringList GetInputDeviceNames();
virtual PStringList GetDeviceNames() const
{ return GetInputDeviceNames(); }
/**Get the maximum frame size in bytes.
Note a particular device may be able to provide variable length
frames (eg motion JPEG) so will be the maximum size of all frames.
*/
virtual PINDEX GetMaxFrameBytes();
/**Grab a frame.
There will be a delay in returning, as specified by frame rate.
*/
virtual BOOL GetFrameData(
BYTE * buffer, /// Buffer to receive frame
PINDEX * bytesReturned = NULL /// Optional bytes returned.
);
/**Grab a frame.
Do not delay according to the current frame rate.
*/
virtual BOOL GetFrameDataNoDelay(
BYTE * buffer, /// Buffer to receive frame
PINDEX * bytesReturned = NULL /// OPtional bytes returned.
);
/**Generate a static image, containing a constant field of grey.
*/
void GrabBlankImage(BYTE *resFrame);
/**Set the video format to be used.
Default behaviour sets the value of the videoFormat variable and then
returns the IsOpen() status.
*/
virtual BOOL SetVideoFormat(
VideoFormat videoFormat /// New video format
);
/**Get the number of video channels available on the device.
Default behaviour returns 1.
*/
virtual int GetNumChannels() ;
/**Set the video channel to be used on the device.
*/
virtual BOOL SetChannel(
int channelNumber /// New channel number for device.
);
/**Set the colour format to be used.
Default behaviour sets the value of the colourFormat variable and then
returns the IsOpen() status.
*/
virtual BOOL SetColourFormat(
const PString & colourFormat // New colour format for device.
);
/**Set the video frame rate to be used on the device.
Default behaviour sets the value of the frameRate variable and then
return the IsOpen() status.
*/
virtual BOOL SetFrameRate(
unsigned rate /// Frames per second
);
/**Get the minimum & maximum size of a frame on the device.
Default behaviour returns the value 1 to UINT_MAX for both and returns
FALSE.
*/
virtual BOOL GetFrameSizeLimits(
unsigned & minWidth, /// Variable to receive minimum width
unsigned & minHeight, /// Variable to receive minimum height
unsigned & maxWidth, /// Variable to receive maximum width
unsigned & maxHeight /// Variable to receive maximum height
) ;
/**Set the frame size to be used.
Default behaviour sets the frameWidth and frameHeight variables and
returns the IsOpen() status.
*/
virtual BOOL SetFrameSize(
unsigned width, /// New width of frame
unsigned height /// New height of frame
);
void ClearMapping() { return ; }
/**Try all known video formats & see which ones are accepted by the video driver
*/
virtual BOOL TestAllFormats()
{ return TRUE; }
protected:
OpenMCUH323Connection & mcuConnection;
unsigned grabCount;
PINDEX videoFrameSize;
PINDEX scanLineWidth;
PAdaptiveDelay grabDelay;
};
class PVideoOutputDevice_OpenMCU : public PVideoOutputDevice
{
PCLASSINFO(PVideoOutputDevice_OpenMCU, PVideoOutputDevice);
public:
/** Create a new video output device.
*/
PVideoOutputDevice_OpenMCU(OpenMCUH323Connection & _mcuConnection);
/**Get a list of all of the drivers available.
*/
static PStringList GetOutputDeviceNames();
virtual PStringList GetDeviceNames() const
{ return GetOutputDeviceNames(); }
/**Open the device given the device name.
*/
virtual BOOL Open(
const PString & deviceName, /// Device name to open
BOOL startImmediate = TRUE /// Immediately start device
);
/**Start the video device I/O.
*/
BOOL Start();
/**Stop the video device I/O capture.
*/
BOOL Stop();
/**Close the device.
*/
virtual BOOL Close();
/**Determine if the device is currently open.
*/
virtual BOOL IsOpen();
/**Get the maximum frame size in bytes.
Note a particular device may be able to provide variable length
frames (eg motion JPEG) so will be the maximum size of all frames.
*/
virtual PINDEX GetMaxFrameBytes();
/**Set a section of the output frame buffer.
*/
virtual BOOL SetFrameData(
unsigned x,
unsigned y,
unsigned width,
unsigned height,
const BYTE * data,
BOOL endFrame = TRUE
);
/**Indicate frame may be displayed.
*/
virtual BOOL EndFrame();
protected:
OpenMCUH323Connection & mcuConnection;
};
#endif // OPENMCU_VIDEO
#endif //_OpenMCU_H323_H
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -