TeamTalk 5 .NET DLL Version 5.15A
|
This section explains how to detect and configure video capture devices. More...
Classes | |
struct | BearWare.VideoFormat |
A struct containing the properties of a video capture format. More... | |
struct | BearWare.VideoFrame |
A RGB32 image where the pixels can be accessed directly in an allocated imageBuffer. More... | |
struct | BearWare.VideoCaptureDevice |
A struct containing the properties of a video capture device. More... | |
Enumerations | |
enum | BearWare.FourCC : uint { BearWare.FourCC.FOURCC_NONE = 0 , BearWare.FourCC.FOURCC_I420 = 100 , BearWare.FourCC.FOURCC_YUY2 = 101 , BearWare.FourCC.FOURCC_RGB32 = 102 } |
The picture format used by a capture device. More... | |
Functions | |
static bool | BearWare.TeamTalkBase.GetVideoCaptureDevices (out VideoCaptureDevice[] lpVideoDevices) |
Get the list of devices available for video capture. | |
bool | BearWare.TeamTalkBase.InitVideoCaptureDevice (string szDeviceID, VideoFormat lpVideoFormat) |
Initialize a video capture device. | |
bool | BearWare.TeamTalkBase.CloseVideoCaptureDevice () |
Close a video capture device. | |
bool | BearWare.TeamTalkBase.PaintVideoFrame (int nUserID, System.IntPtr hDC, int XDest, int YDest, int nDestWidth, int nDestHeight, ref VideoFrame lpVideoFrame) |
Paint user's video frame using a Windows' DC (device context). | |
bool | BearWare.TeamTalkBase.PaintVideoFrameEx (int nUserID, System.IntPtr hDC, int XDest, int YDest, int nDestWidth, int nDestHeight, int XSrc, int YSrc, int nSrcWidth, int nSrcHeight, ref VideoFrame lpVideoFrame) |
Paint user's video frame using a Windows' DC (device context). | |
VideoFrame | BearWare.TeamTalkBase.AcquireUserVideoCaptureFrame (int nUserID, out Bitmap bmp) |
Extract a user's video frame for display. | |
bool | BearWare.TeamTalkBase.ReleaseUserVideoCaptureFrame (VideoFrame lpVideoFrame) |
Delete a user's video frame, acquired through TeamTalkBase.AcquireUserVideoCaptureFrame(), so its allocated resources can be released. | |
Variables | |
const int | BearWare.TeamTalkBase.TT_VIDEOFORMATS_MAX = 1024 |
This section explains how to detect and configure video capture devices.
The client is able to capture video and present them to the user application in RGB32-format and transmit the image in encoded format to other users.
Sections:
To capture video the user application must first query the available capture devices by calling TeamTalkBase.GetVideoCaptureDevices(). A BearWare.VideoCaptureDevice supports a certain number of capture formats each described in the videoFormats member of BearWare.VideoFormat.
Once a device has been chosen the TeamTalkBase.InitVideoCaptureDevice() must be called for the client instance to start capturing video frames. Use the szDevice member of BearWare.VideoCaptureDevice as the device identifier for the video capture device and pass a BearWare.VideoFormat from the videoFormats array of BearWare.VideoCaptureDevice. Check out section Audio and Video Codecs on how to configure the video codec.
When a video frame becomes available the event TeamTalkBase.OnUserVideoCapture() is posted to the application and TeamTalkBase.GetUserVideoFrame() can be used to extract the RGB32 image. On Windows it's also possible to call TeamTalkBase.PaintVideoFrame() to make the client instance paint on a HWND
by getting its HDC.
enum BearWare.FourCC : uint |
The picture format used by a capture device.
Definition at line 601 of file TeamTalk.cs.
|
static |
Get the list of devices available for video capture.
lpVideoDevices | An output array of BearWare.VideoCaptureDevice-stucts which will receive the available video capture devices |
Definition at line 5729 of file TeamTalk.cs.
bool BearWare.TeamTalkBase.InitVideoCaptureDevice | ( | string | szDeviceID, |
VideoFormat | lpVideoFormat | ||
) |
Initialize a video capture device.
To transmit video capture data to a channel call TeamTalkBase.StartVideoCaptureTransmission()
szDeviceID | The device idenfier szDeviceID of BearWare.VideoCaptureDevice. |
lpVideoFormat | The capture format to use, i.e. frame-rate, resolution and picture format. |
Definition at line 5757 of file TeamTalk.cs.
bool BearWare.TeamTalkBase.CloseVideoCaptureDevice | ( | ) |
Close a video capture device.
Definition at line 5766 of file TeamTalk.cs.
bool BearWare.TeamTalkBase.PaintVideoFrame | ( | int | nUserID, |
System::IntPtr | hDC, | ||
int | XDest, | ||
int | YDest, | ||
int | nDestWidth, | ||
int | nDestHeight, | ||
ref VideoFrame | lpVideoFrame | ||
) |
Paint user's video frame using a Windows' DC (device context).
Same as calling TeamTalkBase.PaintVideoFrameEx() like this:
ttclient.PaintVideoFrameEx(nUserID, hDC, XDest, YDest, nDestWidth, nDestHeight, 0, 0, src_bmp_width, src_bmp_height);
src_bmp_width
and src_bmp_height
are extracted internally from the source image.
Definition at line 5784 of file TeamTalk.cs.
bool BearWare.TeamTalkBase.PaintVideoFrameEx | ( | int | nUserID, |
System::IntPtr | hDC, | ||
int | XDest, | ||
int | YDest, | ||
int | nDestWidth, | ||
int | nDestHeight, | ||
int | XSrc, | ||
int | YSrc, | ||
int | nSrcWidth, | ||
int | nSrcHeight, | ||
ref VideoFrame | lpVideoFrame | ||
) |
Paint user's video frame using a Windows' DC (device context).
An application can either paint using TeamTalkBase.AcquireUserVideoCaptureFrame() which provides a raw RGB32 array of the image or the application can ask the client instance to paint the image using this function.
Typically this paint operation will be called in the WM_PAINT message. Here is how the client instance paints internally:
StretchDIBits(hDC, nPosX, nPosY, nWidth, nHeight, XSrc, YSrc, nSrcWidth, nSrcHeight, frame_buf, &bmi, DIB_RGB_COLORS, SRCCOPY);
nUserID | The user's ID. 0 for local user. |
hDC | The handle to the Windows device context. |
XDest | Coordinate of left corner where to start painting. |
YDest | Coordinate or top corner where to start painting. |
nDestWidth | The width of the image. |
nDestHeight | The height of the image. |
XSrc | The left coordinate in the source bitmap of where to start reading. |
YSrc | The top left coordinate in the source bitmap of where to start reading. |
nSrcWidth | The number of width pixels to read from source bitmap. |
nSrcHeight | The number of height pixels to read from source bitmap. |
lpVideoFrame | Video frame retrieved by TeamTalkBase.AcquireUserVideoCaptureFrame() |
Definition at line 5827 of file TeamTalk.cs.
VideoFrame BearWare.TeamTalkBase.AcquireUserVideoCaptureFrame | ( | int | nUserID, |
out Bitmap | bmp | ||
) |
Extract a user's video frame for display.
The BearWare.VideoFrame extracted from the client instance will contain a pointer to the image's frame buffer, so a RGB32 bitmap can be displayed in a window control.
To release the acquired BearWare.VideoFrame call TeamTalkBase.ReleaseUserVideoCaptureFrame().
A video capture frame comes from a user's BearWare.StreamType.STREAMTYPE_VIDEOCAPTURE.
nUserID | The user's ID. 0 for local user. |
bmp | A bitmap created from the BearWare.VideoFrame's data. |
Definition at line 5862 of file TeamTalk.cs.
bool BearWare.TeamTalkBase.ReleaseUserVideoCaptureFrame | ( | VideoFrame | lpVideoFrame | ) |
Delete a user's video frame, acquired through TeamTalkBase.AcquireUserVideoCaptureFrame(), so its allocated resources can be released.
lpVideoFrame | Pointer to BearWare.VideoFrame which should be deallocated. |
Definition at line 5886 of file TeamTalk.cs.
|
static |
The maximum number of video formats which will be queried for a BearWare.VideoCaptureDevice.
Definition at line 4224 of file TeamTalk.cs.