請問關於DSPack使用的問題 |
答題得分者是:cmf
|
Ricky_567
一般會員 發表:34 回覆:38 積分:19 註冊:2006-11-09 發送簡訊給我 |
各位大大:
小弟經 cmf大大指導後用DSPack來抓影像但下面這個函式(指定視訊來源)傳入的1,2參數還是失敗ShowFilterPropertyPage(xx,xx,ppVFWCapSource)原型如下:
HRESULT ShowFilterPropertyPage(THandle parent,IBaseFilter Filter,
TPropertyPage PropertyPage); 以下是小弟的程式,懇請知道的人能幫我解答,謝謝。 用了DSPack的四個元件 TFilter,TFilterGraph,TSampleGrabber,TVideoWindow
//--------------------------------------------------------------------
#include
|
cmf
尊榮會員 發表:84 回覆:918 積分:1032 註冊:2002-06-26 發送簡訊給我 |
HRESULT ShowFilterPropertyPage(THandle parent,IBaseFilter Filter,
TPropertyPage PropertyPage); 第一個參數 請加入 Form2->Handle;
第二個參數 請加入 SourceFilter ; Filter->BaseFilter->Moniker = SysDev->GetMoniker(((TComboBox *)Sender)->ItemIndex);
Filter->BaseFilter->Moniker->BindToObject(NULL,NULL,IBaseFilter, (void**)&SourceFilter);
------
︿︿ |
Ricky_567
一般會員 發表:34 回覆:38 積分:19 註冊:2006-11-09 發送簡訊給我 |
引言: HRESULT ShowFilterPropertyPage(THandle parent,IBaseFilter Filter, TPropertyPage PropertyPage); 第一個參數 請加入 Form2->Handle; 第二個參數 請加入 SourceFilter ; Filter->BaseFilter->Moniker = SysDev->GetMoniker(((TComboBox *)Sender)->ItemIndex); Filter->BaseFilter->Moniker->BindToObject(NULL,NULL,IBaseFilter, (void**)&SourceFilter);請問 cmf大大: 第一個參數我昨天也是傳入Form2->Handle但出現以下錯誤: Cannot convert 'void *' to 'unsigned int' Type mismatch in parameter 'parent' (wanted 'unsigned int', got 'void *') 再請教另一個問題: 小弟在Project->Options->Packages頁內Runtime packages的Build with runtime packages選項若是不勾選,發行時則必須加入很多DLL檔,是不是我少include或少加入那些檔案。 目前專案的設定: (1)有加入wmvcore.lib,quartz.lib,amstrmid.lib,d3d9.lib 四個Lib 若不加入d3d9.lib 則Build with runtime packages選項必須要勾選且要加入DirectX9_BCB6.bpl ---------> 資質愚眛一直搞不懂 ( > 非常感謝 |
cmf
尊榮會員 發表:84 回覆:918 積分:1032 註冊:2002-06-26 發送簡訊給我 |
|
Ricky_567
一般會員 發表:34 回覆:38 積分:19 註冊:2006-11-09 發送簡訊給我 |
|
cmf
尊榮會員 發表:84 回覆:918 積分:1032 註冊:2002-06-26 發送簡訊給我 |
|
Ricky_567
一般會員 發表:34 回覆:38 積分:19 註冊:2006-11-09 發送簡訊給我 |
cmf大大您好:
(1)
小弟改用ppDefault有一Dlg畫面:
但小弟用ppVFWCapSource則無畫面,
cmf大大您所謂的【判斷SourceFilter是否提供ppVFWCapSource】是什塺意思?
難道是卡的問題(亞邁V-Gear)?但用vfw API或JLCVideo元件搭配的方式可以顯示畫面如下:
void __fastcall TForm2::Video1Click(TObject *Sender) { FilterGraph->ClearGraph(); FilterGraph->Active = false; JLCVideo1->Activo = true; JLCVideo1->SeleccionarFuente();//JLCVideo元件的方式--->視訊來源 JLCVideo1->Activo = false; FilterGraph->Active = true; CheckDSError(FilterGraph->QueryInterface(IID_ICaptureGraphBuilder2, &Graph)); CheckDSError(VideoWindow->QueryInterface(IID_IBaseFilter, &VideoFilter)); CheckDSError(Filter->QueryInterface(IID_IBaseFilter, &SourceFilter)); Graph->RenderStream(&PIN_CATEGORY_PREVIEW, NULL, SourceFilter, NULL, VideoFilter); FilterGraph->Play(); Graph->Release(); VideoFilter->Release(); SourceFilter->Release(); }(2) 小弟引用 Filter->BaseFilter->Moniker->BindToObject(NULL,NULL,IID_IBaseFilter,(void**)&SourceFilter); 當程式關閉時會出現如下錯誤畫面,不用就不會,這是什麼原因呢? 所顯示的路徑很奇怪????? (3) BindToObject 這個用法小弟在Help及Samples裡怎麼都查不到使用方法呢? 謝謝!!! |
cmf
尊榮會員 發表:84 回覆:918 積分:1032 註冊:2002-06-26 發送簡訊給我 |
Display VFW Capture Dialog Boxes // Query the capture filter for the IAMVfwCaptureDialogs interface.
IAMVfwCaptureDialogs *pVfw = 0;
hr = SourceFilter->QueryInterface(IID_IAMVfwCaptureDialogs, (void**)&pVfw);
if (SUCCEEDED(hr))
{
// Check if the device supports this dialog box.
if (S_OK == SourceFilter->HasDialog(VfwCaptureDialog_Source))
{
// Show the dialog box.
hr = SourceFilter->ShowDialog(VfwCaptureDialog_Source, Handle);
}
} 發表人 - cmf 於 2003/08/14 13:56:28
------
︿︿ |
Ricky_567
一般會員 發表:34 回覆:38 積分:19 註冊:2006-11-09 發送簡訊給我 |
引言: Display VFW Capture Dialog Boxes // Query the capture filter for the IAMVfwCaptureDialogs interface. IAMVfwCaptureDialogs *pVfw = 0; hr = SourceFilter->QueryInterface(IID_IAMVfwCaptureDialogs, (void**)&pVfw); if (SUCCEEDED(hr)) { // Check if the device supports this dialog box. if (S_OK == pVfw->HasDialog(VfwCaptureDialog_Source)) { // Show the dialog box. hr = pVfw->ShowDialog(VfwCaptureDialog_Source, Handle); } } 發表人 - cmf 於 2003/08/14 13:56:28小弟之前也試過QueryInterface(xxxx), FindInterface(xxxx); 還是不行。 先結案了 非常感謝 cmf大大。 |
cmf
尊榮會員 發表:84 回覆:918 積分:1032 註冊:2002-06-26 發送簡訊給我 |
如果你的是 WDM 擷取卡的話 在 DIRECTSHOW 裡是無法顯示 VfwCaptureDialog_Source DLG 必須使用 IAMCrossbar interface 選擇 VIDEO INPUT // Helper function to associate a name with the type.
const char * GetPhysicalPinName(long lType)
{
switch (lType)
{
case PhysConn_Video_Tuner: return "Video Tuner";
case PhysConn_Video_Composite: return "Video Composite";
case PhysConn_Video_SVideo: return "S-Video";
case PhysConn_Video_RGB: return "Video RGB";
case PhysConn_Video_YRYBY: return "Video YRYBY";
case PhysConn_Video_SerialDigital: return "Video Serial Digital";
case PhysConn_Video_ParallelDigital: return "Video Parallel Digital";
case PhysConn_Video_SCSI: return "Video SCSI";
case PhysConn_Video_AUX: return "Video AUX";
case PhysConn_Video_1394: return "Video 1394";
case PhysConn_Video_USB: return "Video USB";
case PhysConn_Video_VideoDecoder: return "Video Decoder";
case PhysConn_Video_VideoEncoder: return "Video Encoder";
case PhysConn_Audio_Tuner: return "Audio Tuner";
case PhysConn_Audio_Line: return "Audio Line";
case PhysConn_Audio_Mic: return "Audio Microphone";
case PhysConn_Audio_AESDigital: return "Audio AES/EBU Digital";
case PhysConn_Audio_SPDIFDigital: return "Audio S/PDIF";
case PhysConn_Audio_SCSI: return "Audio SCSI";
case PhysConn_Audio_AUX: return "Audio AUX";
case PhysConn_Audio_1394: return "Audio 1394";
case PhysConn_Audio_USB: return "Audio USB";
case PhysConn_Audio_AudioDecoder: return "Audio Decoder";
default: return "Unknown Type";
}
} void DisplayCrossbarInfo(IAMCrossbar *pXBar)
{
HRESULT hr;
long cOutput = -1, cInput = -1;
hr = pXBar->get_PinCounts(&cOutput, &cInput); for (long i = 0; i < cOutput; i )
{
long lRelated = -1, lType = -1, lRouted = -1; hr = pXBar->get_CrossbarPinInfo(FALSE, i, &lRelated, &lType);
hr = pXBar->get_IsRouted(i, &lRouted); printf("Output pin %d: %s\n", i, GetPhysicalPinName(lType));
printf("\tRelated out: %d, Routed in: %d\n", lRelated, lRouted);
printf("\tSwitching Matrix: "); for (long j = 0; j < cInput; j )
{
hr = pXBar->CanRoute(i, j);
printf("%d-%s", j, (S_OK == hr ? "Yes" : "No"));
}
printf("\n\n");
} for (i = 0; i < cInput; i )
{
long lRelated = -1, lType = -1; hr = pXBar->get_CrossbarPinInfo(TRUE, i, &lRelated, &lType); printf("Input pin %d - %s\n", i, GetPhysicalPinName(lType));
printf("\tRelated in: %d\n", lRelated);
}
}
------
︿︿ |
Ricky_567
一般會員 發表:34 回覆:38 積分:19 註冊:2006-11-09 發送簡訊給我 |
引言: 如果你的是 WDM 擷取卡的話 在 DIRECTSHOW 裡是無法顯示 VfwCaptureDialog_Source DLG 必須使用 IAMCrossbar interface 選擇 VIDEO INPUT // Helper function to associate a name with the type. const char * GetPhysicalPinName(long lType) { switch (lType) { case PhysConn_Video_Tuner: return "Video Tuner"; case PhysConn_Video_Composite: return "Video Composite"; case PhysConn_Video_SVideo: return "S-Video"; case PhysConn_Video_RGB: return "Video RGB"; case PhysConn_Video_YRYBY: return "Video YRYBY"; case PhysConn_Video_SerialDigital: return "Video Serial Digital"; case PhysConn_Video_ParallelDigital: return "Video Parallel Digital"; case PhysConn_Video_SCSI: return "Video SCSI"; case PhysConn_Video_AUX: return "Video AUX"; case PhysConn_Video_1394: return "Video 1394"; case PhysConn_Video_USB: return "Video USB"; case PhysConn_Video_VideoDecoder: return "Video Decoder"; case PhysConn_Video_VideoEncoder: return "Video Encoder"; case PhysConn_Audio_Tuner: return "Audio Tuner"; case PhysConn_Audio_Line: return "Audio Line"; case PhysConn_Audio_Mic: return "Audio Microphone"; case PhysConn_Audio_AESDigital: return "Audio AES/EBU Digital"; case PhysConn_Audio_SPDIFDigital: return "Audio S/PDIF"; case PhysConn_Audio_SCSI: return "Audio SCSI"; case PhysConn_Audio_AUX: return "Audio AUX"; case PhysConn_Audio_1394: return "Audio 1394"; case PhysConn_Audio_USB: return "Audio USB"; case PhysConn_Audio_AudioDecoder: return "Audio Decoder"; default: return "Unknown Type"; } } void DisplayCrossbarInfo(IAMCrossbar *pXBar) { HRESULT hr; long cOutput = -1, cInput = -1; hr = pXBar->get_PinCounts(&cOutput, &cInput); for (long i = 0; i < cOutput; i++) { long lRelated = -1, lType = -1, lRouted = -1; hr = pXBar->get_CrossbarPinInfo(FALSE, i, &lRelated, &lType); hr = pXBar->get_IsRouted(i, &lRouted); printf("Output pin %d: %s\n", i, GetPhysicalPinName(lType)); printf("\tRelated out: %d, Routed in: %d\n", lRelated, lRouted); printf("\tSwitching Matrix: "); for (long j = 0; j < cInput; j++) { hr = pXBar->CanRoute(i, j); printf("%d-%s", j, (S_OK == hr ? "Yes" : "No")); } printf("\n\n"); } for (i = 0; i < cInput; i++) { long lRelated = -1, lType = -1; hr = pXBar->get_CrossbarPinInfo(TRUE, i, &lRelated, &lType); printf("Input pin %d - %s\n", i, GetPhysicalPinName(lType)); printf("\tRelated in: %d\n", lRelated); } }請問 cmf大大: 那如何指定視訊來源為S-Video。 謝謝!! void __fastcall TForm2::Video3Click(TObject *Sender) { HRESULT hr; IAMCrossbar *pXBar1 = NULL; hr = Graph->FindInterface(&LOOK_UPSTREAM_ONLY, NULL, SourceFilter, IID_IAMCrossbar, (void**)&pXBar1); if (SUCCEEDED(hr)) { DisplayCrossbarInfo(pXBar1); pXBar1->Release(); } } |
cmf
尊榮會員 發表:84 回覆:918 積分:1032 註冊:2002-06-26 發送簡訊給我 |
|
Ricky_567
一般會員 發表:34 回覆:38 積分:19 註冊:2006-11-09 發送簡訊給我 |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |