Click here to Skip to main content
15,891,033 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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?
Чесноков

QuestionRe: Why IMediaSeeking fails to seek while filter graph is already running? Pin
CPallini5-Nov-10 4:13
mveCPallini5-Nov-10 4:13 
AnswerRe: Why IMediaSeeking fails to seek while filter graph is already running? Pin
Chesnokov Yuriy5-Nov-10 5:50
professionalChesnokov Yuriy5-Nov-10 5:50 
QuestionProverbial good example of CTreeCtrl Pin
federico.strati4-Nov-10 23:56
federico.strati4-Nov-10 23:56 
AnswerRe: Proverbial good example of CTreeCtrl Pin
Sauro Viti5-Nov-10 1:41
professionalSauro Viti5-Nov-10 1:41 
GeneralRe: Proverbial good example of CTreeCtrl Pin
federico.strati5-Nov-10 2:51
federico.strati5-Nov-10 2:51 
GeneralRe: Proverbial good example of CTreeCtrl Pin
CPallini5-Nov-10 3:04
mveCPallini5-Nov-10 3:04 
GeneralRe: Proverbial good example of CTreeCtrl PinPopular
David Crow5-Nov-10 3:09
David Crow5-Nov-10 3:09 
GeneralRe: Proverbial good example of CTreeCtrl Pin
federico.strati5-Nov-10 3:38
federico.strati5-Nov-10 3:38 
JokeRe: Proverbial good example of CTreeCtrl Pin
CPallini5-Nov-10 3:46
mveCPallini5-Nov-10 3:46 
GeneralRe: Proverbial good example of CTreeCtrl Pin
federico.strati5-Nov-10 3:59
federico.strati5-Nov-10 3:59 
GeneralRe: Proverbial good example of CTreeCtrl Pin
David Crow5-Nov-10 4:03
David Crow5-Nov-10 4:03 
GeneralRe: Proverbial good example of CTreeCtrl Pin
CPallini5-Nov-10 4:12
mveCPallini5-Nov-10 4:12 
GeneralRe: Proverbial good example of CTreeCtrl Pin
Sauro Viti5-Nov-10 6:40
professionalSauro Viti5-Nov-10 6:40 
GeneralRe: Proverbial good example of CTreeCtrl Pin
David Crow5-Nov-10 4:00
David Crow5-Nov-10 4:00 
QuestionChanging initial directory on File Open Dialog in MFC Pin
Ed The C4-Nov-10 7:48
Ed The C4-Nov-10 7:48 
AnswerRe: Changing initial directory on File Open Dialog in MFC Pin
Code-o-mat4-Nov-10 8:12
Code-o-mat4-Nov-10 8:12 
AnswerRe: Changing initial directory on File Open Dialog in MFC Pin
«_Superman_»4-Nov-10 8:31
professional«_Superman_»4-Nov-10 8:31 

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.