PDA

View Full Version : Capturing to my own buffer without display



PjotrvA
May 1, 2007, 14:28:05
Hi,

I would like to use two DFG/1394-1e devices as low level framegrabbers.

I now use a Grabber and a GgrabberListener, but my Listener never gets called..
Is use the following code to register my Listener:


if(m_grabber.addListener(this, DShowLib::GrabberListener::eFRAMEREADY)) {
return m_grabber.isListenerRegistered(this, DShowLib::GrabberListener::eFRAMEREADY);
};


this returns true, so I asume my Listener's function (frameReady) should get called?
I can see the grabber working because it is displaying input in some sort of overlay on my screen.

I would also like to disable the rendering of video on my screen and only copy imagebuffers into my own buffers....

How do I achieve this?

gr. Pjotr

Stefan Geissler
May 2, 2007, 10:03:05
Hi Pjotr,

What point "this" to?

The frameReady is called, if a sink has been created. Please refer to the "callback" sample in the IC Imaging Control "samples\vc*" directory.
http://www.imagingcontrol.com/support/documentation/class/Callback.htm

The sink can be created as follows:

smart_ptr pSink = FrameHandlerSink::create( DShowLib:eRGB24, 5 );

You should set
// enable grab mode (formerly tFrameGrabberMode::eSNAP).
pSink->setSnapMode( false);
if you want to have frameReady() to be called continuously.


If you do not want to see the live video, then call "startLive(false)":
http://www.imagingcontrol.com/support/documentation/class/meth_descGrabber_startLive.htm

PjotrvA
May 2, 2007, 10:57:25
Hi Stefan,

the this pointer points to a class derived from GrabberListener, which has a grabber as member.



class CImagingSource1394 : public DShowLib::GrabberListener



startLive(false) solved the problem of the displayed video.

After I inseterd the code for the FrameHandlerSink, I got some linking errors.


error LNK2001: unresolved external symbol "__declspec(dllimport) public: static class smart_ptr<class DShowLib::FrameHandlerSink,class refcount_ptr<class DShowLib::FrameHandlerSink> > __stdcall DShowLib::FrameHandlerSink::create(struct DShowLib::FrameTypeInfo const &,unsigned int)" (__imp_?create@FrameHandlerSink@DShowLib@@SG?AV?$s mart_ptr@VFrameHandlerSink@DShowLib@@V?$refcount_p tr@VFrameHandlerSink@DShowLib@@@@@@ABUFrameTypeInf o@2@I@Z)
error LNK2001: unresolved external symbol "__declspec(dllimport) struct _GUID __stdcall DShowLib::getSubtypeFromColorformat(enum DShowLib::tColorformatEnum)" (__imp_?getSubtypeFromColorformat@DShowLib@@YG?AU_ GUID@@W4tColorformatEnum@1@@Z)


I already included TIS_UDSHL07_vc8d.lib to my input libraries. Which other library do I need to include in the project?

thnx, Pjotr

Stefan Geissler
May 2, 2007, 11:02:24
Pjotr,

No extra libraries are necessary. If this link error is shown, then there must be something different incorrect. Where did you insert the code?

Also seems not to be a good idea to add the listener inside itself to the grabber, I never did this on my own.

Does the "Callback" or the "Demoapp" sample compile and link on your computer?

You may also zip your project and send it to support@imagingcontrol.com. Thus I could have a look on it an try to fix the linker error.

PjotrvA
May 2, 2007, 11:17:00
Hi Stefan,

I inserted the code into the following function:


bool CImagingSource1394::InitializeImagingSource(__int6 4 iSerial)
{
if(m_grabber.openDev(iSerial))
{
if(m_grabber.addListener(this, DShowLib::GrabberListener::eFRAMEREADY)) {
smart_ptr<FrameHandlerSink> pSink = FrameHandlerSink::create( DShowLib::eRGB8, 1);
pSink->setSnapMode(false);
return m_grabber.isListenerRegistered(this, DShowLib::GrabberListener::eFRAMEREADY);
};
}
return false;
}

This compiled untill I added the 2 lines of code for the FrameHandlerSink.
I only exlude libcmtd.lib from the default libraries in VS2005...

The project callback compiles, but the DemoApp_vc8 does not compile and also complains about a link error:


error LNK2019: unresolved external symbol "__declspec(dllimport) void __cdecl showVideoCaptureDialog(class DShowLib::Grabber &,struct HWND__ *)" (__imp_?showVideoCaptureDialog@@YAXAAVGrabber@DSho wLib@@PAUHWND__@@@Z) referenced in function "protected: void __thiscall CMainFrame::OnFileWriteavi(void)" (?OnFileWriteavi@CMainFrame@@IAEXXZ)
1>.


thnx, Pjotr

Stefan Geissler
May 2, 2007, 14:01:20
Pjotr,

The "showVideoCaptureDialog" is located in the "Dialogs" sample, that also resides in the samples directory. I suppose you have opened the demoapp project, not the solution. Thus dependencies are missing.

PjotrvA
May 3, 2007, 14:12:51
Hi Stefan,

You are correct, with the soluton opened, they both compile.

I still cannot compile the code.

Correction, I can compile the code, but am not able to link it correctly.....

Could it be a WINVER problem?

thnx, Pjotr

PjotrvA
May 3, 2007, 15:06:01
Hi,

Found the error.
The Calling convention has to be set to:
__cdecl (/Gd)

gr. Pjotr

Stefan Geissler
May 4, 2007, 09:17:15
Pjotr,

Thank you for your feedback.