使用direct show 开发VCD播放软件中出现的问题!(100分)

  • 主题发起人 主题发起人 lxmzm
  • 开始时间 开始时间
L

lxmzm

Unregistered / Unconfirmed
GUEST, unregistred user!
1:系统已经正常安装了directx8
2:在directx8中direct show 的delphi文档如下(部分):
const
AM_SEEKING_NoPositioning = 0;
AM_SEEKING_AbsolutePositioning = $1;
AM_SEEKING_RelativePositioning = $2;
AM_SEEKING_IncrementalPositioning = $3;
AM_SEEKING_PositioningBitsMask = $3;
AM_SEEKING_SeekToKeyFrame = $4;
AM_SEEKING_ReturnTime = $8;
AM_SEEKING_Segment = $10;
AM_SEEKING_NoFlush = $20;
AM_SEEKING_CanSeekAbsolute = $1;
AM_SEEKING_CanSeekForwards = $2;
AM_SEEKING_CanSeekBackwards = $4;
AM_SEEKING_CanGetCurrentPos = $8;
AM_SEEKING_CanGetStopPos = $10;
AM_SEEKING_CanGetDuration = $20;
AM_SEEKING_CanPlayBackwards = $40;
AM_SEEKING_CanDoSegments = $80;
AM_SEEKING_Source = $100;
//lookat
type
IMediaSeeking = interface(IUnknown)
['{36B73880-C2C8-11CF-8B46-00805F6CEF60}']
function GetCapabilities(out pCapabilities: DWORD): HRESULT;
stdcall;
function CheckCapabilities(var pCapabilities: DWORD): HRESULT;
stdcall;
function IsFormatSupported(const pFormat: TGUID): HRESULT;
stdcall;
function QueryPreferredFormat(out pFormat: TGUID): HRESULT;
stdcall;
function GetTimeFormat(out pFormat: TGUID): HRESULT;
stdcall;
function IsUsingTimeFormat(const pFormat: TGUID): HRESULT;
stdcall;
function SetTimeFormat(const pFormat: TGUID): HRESULT;
stdcall;
function GetDuration(out pDuration: int64): HRESULT;
stdcall;
function GetStopPosition(out pStop: int64): HRESULT;
stdcall;
function GetCurrentPosition(out pCurrent: int64): HRESULT;
stdcall;
function ConvertTimeFormat(out pTarget: int64;
pTargetFormat: PGUID;
Source: int64;
pSourceFormat: PGUID): HRESULT;
stdcall;
function SetPositions(var pCurrent: int64;
dwCurrentFlags: DWORD;
var pStop: int64;
dwStopFlags: DWORD): HRESULT;
stdcall;
function GetPositions(out pCurrent, pStop: int64): HRESULT;
stdcall;
function GetAvailable(out pEarliest, pLatest: int64): HRESULT;
stdcall;
function SetRate(dRate:do
uble): HRESULT;
stdcall;
function GetRate(out pdRate:do
uble): HRESULT;
stdcall;
function GetPreroll(out pllPreroll: int64): HRESULT;
stdcall;
end;

3:程序中声明:
g_pGraphBuilder : IGraphBuilder = NIL;
g_pMediaControl : IMediaControl = NIL;
// Play, Stop, Pause.
g_pMediaSeeking : IMediaSeeking = NIL;
// Set position.
g_pAudioControl : IBasicAudio = NIL;
// Volume/Balance control.
g_pSourceNext : IBaseFilter = NIL;
g_pSourceCurrent : IBaseFilter = NIL;
但在进行编译时,语句:
_llPos := 0;
_hr := g_pMediaSeeking.SetPositions(0,AM_SEEKING_AbsolutePositioning,0,AM_SEEKING_NoPositioning);
不通过:出现[Error] Unit1.pas(186): Types of actual and formal var parameters must be identical
以上不知道啥原因,请大虾门指教!thanks!
 
var(址传递)参数必须为变量,不能用常量.
声明两个变量,再赋值.
 
LeeChange:
我知道错在哪了
在实现播放过程中对当前视频图象进行图片的截获是利用IBasicVideo::GetCurrentImage吗?
它与IGraphBuilder , IMediaControl之间有何联系?
 
一般在Directdraw编程中设计以下几种概念:
IBasicVideo 获取视频的基本信息
IGraphBuilder 创建画布 往往是第一步 就像大楼的地基
IMediaControl 控制接口 一般是第二步或者第三步 可以播放、停止视频
IVideoWindow 设置视频窗体 接下来用RenderFile就可以播放AVI等视频文件了
IMediaEventEx 事件消息响应 接收例如WM_P_GRAPHNOTIFY等消息来响应事件
更详细具体的去微软老巢看DirectX文档!
 
多人接受答案了。
 
后退
顶部