恩~~~~~~没用过DXShow
我一直用DSPack 不过差不多,前一阵我改他里面的代码 发现他控制播放进度是用过
IMediaSeeking接口类型的变量实现的,而IMediaSeeking接口是DXSshow里定义的,像这样:
type //这是我在DirectShow9.pas里找到的
{$HPPEMIT 'typedef System:
elphiInterface<IMediaSeeking> _di_IMediaSeeking;'}
{$EXTERNALSYM IMediaSeeking}
IMediaSeeking = interface(IUnknown)
['{36B73880-C2C8-11CF-8B46-00805F6CEF60}']
(*** IMediaSeeking methods ***)
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;
FMediaSeeking: IMediaSeeking;
var
StopPosition, CurrentPosition: int64;
begin
if assigned(FMediaSeeking) then
begin
//CurrentPosition就是当前要播放的位置,数值应该是毫秒级的整数..具体是多少我没算过..-_-! 因为我用的都是按整个时间进度百分比算的,不过应该不难
FMediaSeeking.GetStopPosition(StopPosition);
FMediaSeeking.SetPositions(CurrentPosition,AM_SEEKING_AbsolutePositioning,
StopPosition , AM_SEEKING_NoPositioning);
end;
end;