【C#】DirectShow.net + LogicoolのカメラでサンプルDxSnapがうまく動かない!
関連記事
- 不具合解析オワタ デバイスドライバの不具合じゃねぇ~か(汗 【2015年03月13日(金)】
- DirectShowシステムを休出にて構築中 【2009年04月18日(土)】
- 出来た! 【2007年11月29日(木)】
- IBaseFilter 【2007年11月28日(水)】
- ぴ~~~~んち! 【2007年11月28日(水)】
のでありました
いやぁ~原因調査にえらいかかった
いや,原因は
Logicoolカメラデバイスに,スティル機能があるみたいなんじゃけど,そのスティルピン,どうも,調子が悪いっぽい
ってことで,そのスティル出力ピンと,サンプルグラバー(SampleGrabber)の入力ピンを直接接続しようとすると不具合が出る模様
コードの流れを追っかけて,いまいち,わけわからん!
結局,grapheditを起動して,全体の流れがやっと解って
こんな感じで,繋がないといけない模様
Smart Teeにて,出力を2つに分けたら,問題なし(まぁ,普通はこの流れじゃなぁ)
ってことで,該当のソースを修正してみた
修正は,Capture.cs
/// <summary> build the capture graph for grabber. </summary> private void SetupGraph(DsDevice dev, int iWidth, int iHeight, short iBPP, Control hControl) { int hr; ISampleGrabber sampGrabber = null; IBaseFilter capFilter = null; IPin pCaptureOut = null; IPin pSampleIn = null; IPin pRenderIn = null; // Get the graphbuilder object m_FilterGraph = new FilterGraph() as IFilterGraph2; try { #if DEBUG m_rot = new DsROTEntry(m_FilterGraph); #endif // add the video input device hr = m_FilterGraph.AddSourceFilterForMoniker(dev.Mon, null, dev.Name, out capFilter); DsError.ThrowExceptionForHR( hr ); // Find the still pin //m_pinStill = DsFindPin.ByCategory(capFilter, PinCategory.Still, 0); //コメントにしてね // Didn't find one. Is there a preview pin? //if (m_pinStill == null) //コメントにしてね //{ //コメントにしてね // m_pinStill = DsFindPin.ByCategory(capFilter, PinCategory.Preview, 0); //コメントにしてね //} //コメントにしてね // Still haven't found one. Need to put a splitter in so we have // one stream to capture the bitmap from, and one to display. Ok, we // don't *have* to do it that way, but we are going to anyway. if (m_pinStill == null) //この条件が成り立つようになる { IPin pRaw = null; IPin pSmart = null; // There is no still pin m_VidControl = null; // Add a splitter IBaseFilter iSmartTee = (IBaseFilter)new SmartTee();コメントにしてね辺りをコメントにすると,直下のif文が成り立つようになって,SmartTeeでの,映像分岐が行われるようになりまする
参考にドゾー
コメント
九州自動車道 トンネル内で大型トレーラーから出火 人吉~八代間で通行止め(24/7/26)
【#ご到着シリーズ】冷凍かしわ飯&冷凍かしわうどんセットに当選したモルモルモル
【#破局噴火】イエローストーンで大規模な水蒸気爆発が発生
暑すぎてダレてる.なんのやる気も起こらんドロドロドロ
【#Windows #CrowdStrike】セキュリティーソフト世界シェア1位があだ…ウィンドウズ障害、「過去最大規模」の見方も
3連休,らしい.これといって予定はない(爆
【#trump #shooting】トランプ暗殺未遂:トランプ氏 集会で発砲音「前大統領は無事」死者も
【#線状降水帯】九州北部山口県に線状降水帯発生予測情報発令(24/7/13)
【#落雷】今朝の雷,すごかったー 清武城かお隣のマンションに落雷したー共用部の電源落ちてるテレビが映らない!
【#彗星】紫金山アトラス彗星(C/2023 A3)がぶっ壊れた!今秋,見れると思ってたのにピエン