Windows platform Anychat Video display

Source: Internet
Author: User

1. How to display local video, or other video on the computer?

A) The client of Anychat must initialize, log into the system, enter the room successfully, to display the local video or other user's video, the detailed process can refer to: 193. Anychat Development process Guide;

b) Anychat There are two ways to display video, namely: Auto Display (BRAC_FUNC_VIDEO_AUTODISP), callback video data (Brac_func_video_cbdata), the application needs to be initialized (brac_ INITSDK), set the relevant flags to tell anychat how to handle the display of the video.

When auto-display (BRAC_FUNC_VIDEO_AUTODISP) is set, the application needs to set the video display location (Brac_setvideopos), when the local user's video is opened, or when the remote user's video is requested, The anychat will automatically display the video in the specified location;

If the auto-display flag is not set and the callback video data (BRAC_FUNC_VIDEO_CBDATA) flag is set only, the video is not displayed inside the Anychat, but the video data is passed through the callback (130. Video data callback function) submitted to the application, drawn by the application itself;

c) When the user uses the API interface (Brac_usercameracontrol) to open the local camera, the local computer video can be displayed;

d) When users use the API interface (Brac_usercameracontrol) to request video data from other users, the local computer can receive video from the other user only after the user has opened his or her webcam;

2, what is the video display driver, how to choose?

The Windows platform has several ways to achieve video display, common with GDI drawing and DirectShow two modes. When setting Anychat to automatically display the video logo, the application can choose between the two modes, the video display driver selection needs to be set after initialization (BRAC_INITSDK) succeeds, the following code demonstrates the selection of the DirectShow display driver:

1. // 选择AnyChat显示驱动 2. DWORD  dwVideoDriver = BRAC_VSD_DIRECTSHOW; 3. brac_setsdkoption (Brac_so_videoshow_driverctrl, ( const   char   sizeof ( dword

Anychat in order to simplify the application development process, but also in order to be compatible with earlier versions, the default is to use GDI graphics to display video, GDI drawing method suitable for resolution not more than CIF (352x288), while the frame rate of less than 20FPS video display The DirectShow display mode is suitable for high-resolution video display with higher frame rate.

DirectShow display mode saves resources in high video quality;

(* Note: The video display driver selection feature is new for Anychat Platform Core SDK V4.0 version)

3, how to display the video some deformation, how to set?

When the size of the video display area is not proportional to the original size of the video, the displayed video will deform, so to ensure that the displayed video is not deformed, you must ensure that the video display area is proportional to the original size of the video;

With the WM_GV_VIDEOSIZECHG message (added in the V4.0 version) you can know the size of each user's current original video, the application can determine the size of the video display area based on the size of the original video, or through the API (BRAC_ Queryuserstate) to obtain the user's current video size;

When the user enters the room, the anychat inside will trigger a WM_GV_VIDEOSIZECHG message for each online user;

When the user modifies the video acquisition resolution, all users in the room will receive the user's WM_GV_VIDEOSIZECHG message;

4, why sometimes the video is covered by other windows, or minimized after the video is obscured, not automatically refresh?

This mainly occurs in DirectShow display mode, mainly because after the application interface is redrawn, the underlying DirectShow does not get a redraw message notification, which causes the video to be obscured, the solution is to respond to the WM_PAINT message of the window, and is called in the message handler function brac_ Repaintvideo to redraw the video.

Anychat the default GDI drawing mode, the problem does not exist.

Anychat the bottom of the DirectShow is the VMR windowless mode for video display, detailed information about this issue can refer to the official Microsoft Development Documentation: HTTP://MSDN.MICROSOFT.COM/EN-US/LIBRARY/DD407299

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.