Click here to Skip to main content
15,900,511 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to use get the image's URL from web page Pin
yu-jian7-Nov-10 16:44
yu-jian7-Nov-10 16:44 
QuestionCopying Variants Pin
softwaremonkey5-Nov-10 23:59
softwaremonkey5-Nov-10 23:59 
AnswerRe: Copying Variants Pin
softwaremonkey6-Nov-10 0:42
softwaremonkey6-Nov-10 0:42 
QuestionRegEnumValue not return the correct values Pin
Arnon A5-Nov-10 12:39
Arnon A5-Nov-10 12:39 
AnswerRe: RegEnumValue not return the correct values Pin
«_Superman_»5-Nov-10 14:41
professional«_Superman_»5-Nov-10 14:41 
AnswerRe: RegEnumValue not return the correct values Pin
krmed6-Nov-10 3:50
krmed6-Nov-10 3:50 
GeneralRe: RegEnumValue not return the correct values Pin
Arnon A7-Nov-10 21:25
Arnon A7-Nov-10 21:25 
QuestionRe: RegEnumValue not return the correct values Pin
David Crow6-Nov-10 17:58
David Crow6-Nov-10 17:58 
QuestionCompiler Error in Template Functions...? [modified] Pin
Joseph Dempsey5-Nov-10 7:41
Joseph Dempsey5-Nov-10 7:41 
AnswerRe: Compiler Error in Template Functions...? Pin
«_Superman_»5-Nov-10 7:52
professional«_Superman_»5-Nov-10 7:52 
GeneralRe: Compiler Error in Template Functions...? Pin
Joseph Dempsey5-Nov-10 8:01
Joseph Dempsey5-Nov-10 8:01 
GeneralRe: Compiler Error in Template Functions...? Pin
«_Superman_»5-Nov-10 8:02
professional«_Superman_»5-Nov-10 8:02 
GeneralRe: Compiler Error in Template Functions...? Pin
Joseph Dempsey5-Nov-10 8:17
Joseph Dempsey5-Nov-10 8:17 
GeneralRe: Compiler Error in Template Functions...? Pin
«_Superman_»5-Nov-10 8:56
professional«_Superman_»5-Nov-10 8:56 
GeneralRe: Compiler Error in Template Functions...? Pin
Aescleal5-Nov-10 9:12
Aescleal5-Nov-10 9:12 
AnswerRe: Compiler Error in Template Functions...? [modified] Pin
Aescleal5-Nov-10 9:08
Aescleal5-Nov-10 9:08 
AnswerRe: Compiler Error in Template Functions...? [modified] Pin
Paul Michalik6-Nov-10 1:42
Paul Michalik6-Nov-10 1:42 
QuestionUsing a Message-Only Window to Receive Device Change Notification Messages [modified] Pin
Jim Fell5-Nov-10 5:11
Jim Fell5-Nov-10 5:11 
AnswerRe: Using a Message-Only Window to Receive Device Change Notification Messages Pin
Luc Pattyn5-Nov-10 5:32
sitebuilderLuc Pattyn5-Nov-10 5:32 
GeneralRe: Using a Message-Only Window to Receive Device Change Notification Messages Pin
Jim Fell5-Nov-10 5:41
Jim Fell5-Nov-10 5:41 
GeneralRe: Using a Message-Only Window to Receive Device Change Notification Messages Pin
Luc Pattyn5-Nov-10 5:49
sitebuilderLuc Pattyn5-Nov-10 5:49 
AnswerRe: Using a Message-Only Window to Receive Device Change Notification Messages Pin
Luc Pattyn8-Nov-10 12:17
sitebuilderLuc Pattyn8-Nov-10 12:17 
QuestionWhy IMediaSeeking fails to seek while filter graph is already running? Pin
Chesnokov Yuriy5-Nov-10 2:17
professionalChesnokov Yuriy5-Nov-10 2:17 
QuestionRe: Why IMediaSeeking fails to seek while filter graph is already running? Pin
CPallini5-Nov-10 3:32
mveCPallini5-Nov-10 3:32 
AnswerRe: Why IMediaSeeking fails to seek while filter graph is already running? Pin
Chesnokov Yuriy5-Nov-10 3:55
professionalChesnokov Yuriy5-Nov-10 3:55 
There are no errors. All HRESULTS are OK.

Initially I wanted to seek to specific location in video file, then run the graph, wait for completion and get buffer.

Seeking function

<br />
m_pPosition = (1000000 * (LONGLONG)millisecond) / 100;<br />
hr = m_pSeeking->SetPositions(&m_pPosition, AM_SEEKING_AbsolutePositioning, &m_pStop, AM_SEEKING_AbsolutePositioning);<br />
if (FAILED(hr))                 <br />
        return -2;<br />
hr = m_pSeeking->GetCurrentPosition(&m_pPosition);<br />
if (FAILED(hr))                 <br />
        return -3;<br />


Grabbing function

<br />
hr = m_pMC->Run();<br />
if (FAILED(hr)) <br />
        return -2;                <br />
long evCode;<br />
//! wait for completion<br />
hr = m_pEvent->WaitForCompletion(m_TimeOut, &evCode);<br />
if (FAILED(hr)) <br />
        return -3;<br />
//! sample grabber does not stop the graph even it is set with one shot mode<br />
hr = m_pMC->Stop();<br />
if (FAILED(hr)) <br />
        return -4;<br />
//! grab frame<br />
hr = m_pGrabber->GetCurrentBuffer((long *)&m_BmiHeader.biSizeImage, (long *)pFrameData);<br />
if (FAILED(hr))<br />
        return -5;<br />


I used SetOneShot(TRUE); during sample grabber setup to make sure graph filter stops after single grabbing.

But that resulted in significantly slower grabbing due to filter graph run/stop operation.

I realized that it is possible to seek to any location while filter graph is already running as specified in documentation so I used SetOneShot(FALSE) and moved graph running and stopping from grabbing function.

But with SetOneShot false WaitForCompletion returns 0x80004004 if wait interval is specified or never returns with INFINITE wait period.


Is there fast seeking approach to grab raw image data with sample buffer?
Чесноков

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.