Форум: "Media";
Текущий архив: 2004.02.13;
Скачать: [xml.tar.bz2];
ВнизДиалоги выбора источника видео и кодеков (с их свойствами) Найти похожие ветки
← →
Миша (2003-10-12 04:00) [0]Так вот как эти самые диалоги вызвать? Пожалуйста, помогите
глупому!
← →
крот (2003-10-12 11:41) [1]В принципе, некоторые кодеки выполняют интерфейс ISpecifyPropertyPages. Как им воспользоваться, очень подробно объясняется в статье Displaying a Filter"s Property Pages
Это DirectX SDK->DirectShow->DirectShow Tutorials
И есть еще один способ (во всяком случае для видео компрессоров)
Можно вытащить окно свойст используя Video for Windows.
Есть такой макрос (не знаю, доступен ли он в Delphi) ICConfigure
Вот он это окно и отображает. Вкратце так.
← →
Миша (2003-10-12 15:33) [2]Есть подозрение, что это пишется через одно место - wdm драйвер, и нужно послать нечто вроде WM_CAP_DLG_VIDEOSOURCE (смотри исходники компонента tscap32). Но как это правильно оформить, например на нажатие кнопки (и хорошо бы без подключения к драйверу)?
← →
NailMan (2003-10-13 12:39) [3]Я сделал так
const
IID_ISpecifyPropertyPages : TGUID = "{B196B28B-BAB4-101A-B69C-00AA00341D07}";
Procedure ShowPropertyPageByCLSID(CLSID:TGUID);
Var
hr:HRESULT;
pFilter:IBaseFilter;
pSpecify:ISpecifyPropertyPages;
FilterInfo:TFILTERINFO;
caGUID:tagCAUUID;
begin
// If not checkSelect then exit;
pFilter:=nil;
pFilter:= FindFilterFromCLSID(CLSID);
If not assigned(pFilter) then exit;
hr := pFilter.QueryInterface(IID_ISpecifyPropertyPages, pSpecify);
if not failed(hr) then
repeat
hr:= pFilter.QueryFilterInfo(FilterInfo);
if (FAILED(hr)) then exit;
hr := pSpecify.GetPages(caGUID);
if (FAILED(hr)) then exit;
pSpecify:=nil;
// Display the filter"s property page
OleCreatePropertyFrame(
MainForm.Handle, // Parent window
0, // x (Reserved)
0, // y (Reserved)
FilterInfo.achName, // Caption for the dialog box
1, // Number of filters
@pFilter, // Pointer to the filter
caGUID.cElems, // Number of property pages
caGUID.pElems, // Pointer to property page CLSIDs
0, // Locale identifier
0, // Reserved
NiL // Reserved
);
CoTaskMemFree(caGUID.pElems);
FilterInfo.pGraph:=nil;
until 0=0;
pFilter:=nil;
end;
Function SupportsPropertyPage(pFilter:IBaseFilter):Boolean;
Var
hr:HRESULT;
ws:widestring;
pSpecify:ISpecifyPropertyPages;
begin
// Read the current filter name from the list box
ws:=widestring(FIForm.list.Items.Strings[FIForm.list.ItemIndex]);
// Discover if this filter contains a property page
hr := pFilter.QueryInterface(IID_ISpecifyPropertyPages, pSpecify);
if (SUCCEEDED(hr)) then
begin
pSpecify:=nil;
result:=TRUE;
end
else
result:= FALSE;
end;
Function FindFilterFromCLSID(CLSID:TGUID): IBaseFilter;
Label _Exit;
var
hr:HRESULT;
pEnum : IEnumFilters;
pFilter :IBaseFilter;
cFetched : dword;
bFound :boolean;
CL:TGUID;
begin
// Get filter enumerator
hr:= dsGraphBuilder.EnumFilters(pEnum);
if FAILED(hr) then begin result:=nil;exit;end;
bFound:=false;
// Enumerate all filters in the graph
while pEnum.Next(1, pFilter, cFetched) = S_OK do
begin
pFilter.GetClassID(CL);
if IsEqualGUID(CL,CLSID) then bFound := TRUE;
// If we found the right filter, don"t release its interface.
// The caller will use it and release it later.
if bFound then Goto _Exit else
pFilter:=nil;
end;
pFilter:=nil;
_Exit:
pEnum:=nil;
result:= pFilter;
end;
Главное указать CLSID нужного фильтра. Как его получить думай сам - аналогично FindFilterFromCLSID с точностью наоборот.
← →
Миша (2003-10-14 01:26) [4]Зачем изобретать Windows? Это всё уже есть (даже знаю где - kswdmcap.ax, vfwwdm32.dll), НО КАК ЭТО ЗАПУСТИТЬ???
Страницы: 1 вся ветка
Форум: "Media";
Текущий архив: 2004.02.13;
Скачать: [xml.tar.bz2];
Память: 0.46 MB
Время: 0.009 c