DirectX高手请进(50分)

  • 主题发起人 主题发起人 dregs2003
  • 开始时间 开始时间
D

dregs2003

Unregistered / Unconfirmed
GUEST, unregistred user!
IAsyncReader.SyncReadAligned(IMediaSample),请问如何能够获得IMediaSample接口,
小弟不才,望高手指点一二!请尽量给代码,编译通过即给分!
 
高手请进,吓倒一大片,帮你UP。
 
谢谢xzh2000
 
http://www.delphibbs.com/delphibbs/dispq.asp?lid=1658662
 
IAsyncReader::SyncReadAligned
The SyncReadAligned method performs a synchronous read. The method blocks until the request is completed. The file positions and the buffer address must be aligned;
check the allocator properties for the required alignment.

Syntax

HRESULT SyncReadAligned(
IMediaSample *pSample
);

Parameters

pSample

Pointer to the IMediaSample interface of a media sample provided by the caller.

Return Values

Returns an HRESULT value. Possible values include the following.

Return code Description
VFW_E_BADALIGN Invalid alignment.
S_FALSE Retrieved fewer bytes than requested. (Probably the end of the file was reached.)
S_OK Success.


Remarks

Before calling this method, retrieve a media sample from the pin's allocator. Time stamp the sample with the byte offsets you are requesting, first and last inclusive, multiplied by 10,000,000. Byte offsets are relative to the start of the stream.

The start and stop positions should match the alignment that was decided when the pins connected. Otherwise, the method returns VFW_E_BADALIGN. If the agreed alignment is coarser than the actual alignment of the stream, the stop position might exceed the real duration. If so, the method rounds the stop positiondo
wn to the actual alignment.

This method performs an unbuffered read, so it might be faster than the IAsyncReader::SyncRead method.

 
吓倒一大片,哈哈。
关注。
 
后退
顶部