Msnd description of getcurrentimage

Source: Internet
Author: User

Ibasicvideo: getcurrentimage

Microsoft DirectShow 9.0

Ibasicvideo: getcurrentimage

TheGetcurrentimageMethod retrieves the current image waiting at the Renderer.

Syntax

HRESULT GetCurrentImage(  long *pBufferSize,  long *pDIBImage);

Parameters

Pbuffersize

[In, out] pointer to a variable that contains the size of the buffer that the caller is passing in. IfPdibimageIs null, this parameter has es the required buffer size.

Pdibimage

[Out] pointer to a buffer where the complete image will be stored in device-independent Bitmap (DIB) format. Cast the pointer to a long pointer type.

Return values

ReturnsHresultValue.

Remarks

The video Renderer Filter and the video mixing Renderer (vmr) implement this method differently.

Video Renderer only:

This method fails if the Renderer is using DirectDraw acceleration. Unfortunately, this depends on the end-user's hardware configuration, so in practice this method is not reliable.

Pause the video Renderer before calling this method. Otherwise, the method returns vfw_e_not_paused. Make sure that the pause operation has completed by callingImediacontrol: getstate; If the pause operation has not completed,GetcurrentimageMethod returns e_unexpected. Depending on what data the source filter has available, the video Renderer is not guaranteed to service this request. If no image is available, it returns e_fail.

Video mixing Renderer only:

This method is reliable regardless of whether the vmr is using DirectDraw acceleration and regardless of the current graph state (running, stopped, or paused ).

Video Renderer and video mixing Renderer:

To obtain the required buffer size to hold the image, call this method with a null pointer inPdibimageParameter. The method returns the required buffer size inPbuffersizeParameter. Allocate a buffer of that size and call the method again,PdibimagePointing to the buffer. On the second call, usePbuffersizeTo specify the buffer size. If the buffer is too small to hold the complete image, the method returns e_outofmemory.

If the method succeeds, the buffer is filled with the entire DIB image, includingBitmapinfoheaderStructure, plus any palette entries and bit masks as defined in the Win32BitmapinfoStructure. The format of the image depends on the type provided by the source filter, and cannot be specified in advance.

Requirements

Header:Dshow. h.

Library:Quartz. dll

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.