|
You don't need the 'CodecH263CE.lib' reference, you can take it out.
|
|
|
|
|
But how to take it out!I could not use the "CodecH263CE.lib" file on my project!
|
|
|
|
|
Can someone please profide me the CameraCaptureDll?
I'm unable to build the C++ solution. don't know why, still trying to find out.
But it would be very handy if I already have the dll,
someone? Jeffthepirate[AT]gmail.com
Thnx in Advance
|
|
|
|
|
Hello Angel
I have compiled the SampleGrabberFilter.DLL and try to use it in my own DirectShow application, where I want to analyze the Frames of the VideoStream from the embedded Camera.
I'm not so good in C++ programming and begin with DirectShow, that's why I'm working with a bit brute force , and use all what I read in the forum on this webside.
So I adopted SampleGrabber.h and Resources.h into my project from SampleGrabberFilter Project and added in my stdafx.h the following lines:
// {AD5DB5B4-D1AB-4f37-A60D-215154B4ECC1}
DEFINE_GUID(CLSID_SampleGrabber,
0xad5db5b4, 0xd1ab, 0x4f37, 0xa6, 0xd, 0x21, 0x51, 0x54, 0xb4, 0xec, 0xc1);
// {04951BFF-696A-4ade-828D-42A5F1EDB631}
DEFINE_GUID(IID_ISampleGrabber,
0x4951bff, 0x696a, 0x4ade, 0x82, 0x8d, 0x42, 0xa5, 0xf1, 0xed, 0xb6, 0x31);
typedef interface ISampleGrabber ISampleGrabber;
Then I copied SampleGrabberFilter.dll and SampleGrabberFilter.lib, which I got after the compilation of SampleGrabberFilter Project, into my Project Folder and connected them statically with:
#pragma comment(lib, "SampleGrabberFilter.lib").
I also assumed C:\WINCE50\PUBLIC\DIRECTX\SDK\SAMPLES\DSHOW\BASECLASSES;
C:\WINCE50\PUBLIC\DIRECTX\SDK\INC;
C:\Program Files\Windows Mobile 6 SDK\PocketPC\Include\Armv4i into the Project options.
I don't know, did I everything right or did I miss something.
But if I try to instantiate the SampleGrabberFilter with the following code:
CoCreateInstance( CLSID_SampleGrabber, NULL, CLSCTX_INPROC, IID_IBaseFilter, (void**)&pSampleGrabber);
hr = pFilterGraph->AddFilter(pSampleGrabber, L"SampleGrabberFilter");
pSampleGrabber->QueryInterface( IID_ISampleGrabber, (void**)&m_pISampleGrabber );
I get these errors:
error LNK2001: unresolved external symbol "CLSID_SampleGrabber".
error LNK2001: unresolved external symbol "IID_ISampleGrabber".
I have no more ideas how to resolve these errors,
could you help me please?
Thanks in advance,
Andreas
modified on Wednesday, February 25, 2009 2:51 PM
|
|
|
|
|
Just try to define CLSID_SampleGrabber and IID_ISampleGrabber once again in the .cpp file where you are refenrencing them. There might be other stuff, but just try that and see if it compiles.
|
|
|
|
|
Hello
Thank you for your fast answer
I added these lines
// {AD5DB5B4-D1AB-4f37-A60D-215154B4ECC1}
DEFINE_GUID(CLSID_SampleGrabber,
0xad5db5b4, 0xd1ab, 0x4f37, 0xa6, 0xd, 0x21, 0x51, 0x54, 0xb4, 0xec, 0xc1);
// {04951BFF-696A-4ade-828D-42A5F1EDB631}
DEFINE_GUID(IID_ISampleGrabber,
0x4951bff, 0x696a, 0x4ade, 0x82, 0x8d, 0x42, 0xa5, 0xf1, 0xed, 0xb6, 0x31);
typedef interface ISampleGrabber ISampleGrabber;
into my .cpp file, where I tried to instantiate the SampleGrabberFilter,
but it doesn't work .
I get the same errors.
Have you any other ideas?
Andreas
|
|
|
|
|
Hi Andreas_1983,
OK, so you want to use the filter in your own application.
First, download the second source sample:
Download sample C# client project with modified CameraCaptureDLL - 32.91 KB
The first one is old and you don't need it.
There are two projects, the filter DLL and a C# client. You can ignore the .NET project. To use the filter in your application, you have to copy over all files from the DLL project except for
CameraCaptureDLL.cpp
graphmanager.cpp
graphmanager.h
Look at graphmanager.cpp to see an example on how the filter is used. You don't need to copy CLSID_SampleGrabber and IID_ISampleGrabber in stdafx.h, but you might need to define them in the .cpp file where you are using the filter.
Also, you shouldn't copy any .DLL or .lib files!
It's always better and faster to try understand how things work, instead of using brute force. You might spend a lot less time this way. Keep in mind, this is for experienced c++ developers.
|
|
|
|
|
Hello,
I've a problem on some devices it's work really fine for the HTC TyTN2 and HTC S710 (both on WM6 and one in Standard version)
But I've two other devices where there is nothing on the screen (Toshiba G710 and HTC P3300) and the application block at the invokation of the Start method but I can't debug the native DLL so I've no more informations.
If I try to launch the default camera application when your CameraCapture is running, I've an error, because the camera is in use, but I haven't any preview on the screen...
Does anyone already have this problem?
Thanks in advance!
modified on Monday, February 16, 2009 9:24 AM
|
|
|
|
|
For this, you will probably need to debug the native code and see if the camera is initialized correctly, other than that I have no ideas.
|
|
|
|
|
Thanks for your response, the camera is correctly initialized it found CAM1:. I try the Microsoft CameraCapture sample and it works fine, I think there is a problem with the refresh on these devices.
I try with the HTC Touch 3G (WM6.1) today and I've a blank screen too, but it work on the HTC Diamond (WM6.1)
Where can I look in the code to view if there is a problem?
Thanks in advance.
|
|
|
|
|
First check the managed callback and see if you are getting any data. Then see, if the picturebox control is updated.
Angel
|
|
|
|
|
Hello Angel, first all I'd like to thank you to share the code, I appreciate very much, thank you
I'm having the same problem using Samsung Omnia SGH-i900 WM6.1 and Palm Treo 750 WM6.1. The callbacks are registered, but the code didn't call them. I debug DLL with log and saw that the Thread (CGraphManager::ThreadProc) isn't called. The CreateThread in CGraphManager::Init created it and return a pointer, but the ThreadProc isn't called. Do you have any idea about that?
Thanks,
Fabio Ribeiro
|
|
|
|
|
Hi Fabio,
I bought the Omnia too and am having some problems myself getting the code to work on this device. I will post more here when I have some progress on the issue.
All best,
Angel
|
|
|
|
|
Hi Angel,
I have debugged the code, but the problem isn't the thread, as I thought. It is because I have created a callback log that was called from DLL to put messages in a textbox on C#, and the log calls made from inside the thread didn't work. Because this I thought that thread was the problem, but I created a static int that was written in the thread, and other DLL function return it, this work.
With this I saw that the problem is the function m_pMediaControl->Run() that returns an error in CGraphManager::StartCaptureFramesInternal().
I will continue trying to resolve the problem. I'll update you, ok?
Thanks,
Fabio Ribeiro
|
|
|
|
|
Hi Angel,
I win heheheheh
It works in Omnia. I just changed this line in code. On monday I will send the complete project to you.
before:
CHK( m_pCaptureGraphBuilder->RenderStream( &PIN_CATEGORY_PREVIEW, &MEDIATYPE_Video, m_pVideoCaptureFilter, pH263Transform, NULL ) );
after:
CHK( m_pCaptureGraphBuilder->RenderStream( &PIN_CATEGORY_PREVIEW, &MEDIATYPE_Video, m_pVideoCaptureFilter, NULL, NULL ) );
Thanks very much,
Fabio Ribeiro
|
|
|
|
|
Hi Fabio,
yes, but that way you have disabled the sample grabber filter and cannot access the video frames. The preview windows will be visible, because it is created from the directshow graph.
This shows we have to see what is wrong with the filter, as it causes the graph to crash.
Thanks a lot
Angel
|
|
|
|
|
Hi Angel,
Now it works. Its because Samsung Omnia didn't work with RGB24, has to change to RGB565 in CSampleGrabber::CheckInputType and SampleGrabber::SetMediaType from MEDIASUBTYPE_RGB24 to MEDIASUBTYPE_RGB565. And change in C# from Format24bppRgb to Format16bppRgb565 in CreateBitmap and OnMediaTypeSet.
Thanks very much,
Fabio Ribeiro
|
|
|
|
|
Hi Fabio,
great work! I will try it out on my omnia this weekend
All best,
Angel
|
|
|
|
|
Hello everybody,
I've tried to run the c# client step by step and I've noticed a strange behavior. Each time CreateBitmap() function is called there's the following first chance exception:
A first chance exception of type 'System.OutOfMemoryException' occurred in System.Drawing.dll
The thread '<no name="">' (0xdead42a2) has exited with code 0 (0x0).
when execution reaches line:
Bitmap image = new Bitmap(m_Width, m_Height, System.Drawing.Imaging.PixelFormat.Format16bppRgb565);
As a result no bitmap is copied from the source to the destination buffer and into the picturebox.
Any idea on how to solve this problem?
I am using WM6 professional device emulator with 256 MB of memory
Thanks in advance,
Kostas
|
|
|
|
|
I don't understand, what is the problem exactly? If the image is copied, do you see it in the picturebox?
The first line says that there has been an exception (probably in the Bitmap constructor) which has been cought. The second line informs you that a thread has been terminated, which is what should happen since the UI access is executed on a separate thread each time new frame is received.
Angel
|
|
|
|
|
Hello Angel,
I can not get the BaseClasses from Windows CE 5.0 Platform builder. My Windows XP doesn't want to install Windows CE 5.0 and Windows CE 5.0 Platform builder, which contain the BaseClasses library.
If I try to install Microsoft® Windows® CE 5.0 Evaluation Edition (link that you gave in the Setting Up-Part) I'll get an error message "Setup requires the .NET Framework 1.1 to be installed. Please install the .NET Framework 1.1. and then run Setup. Setup will now exit.", but Microsoft .NET Compact Framework 2.0 SP2 and 3.5 , .NET Framework 2.0, 3.0 , 3.5 with Service Packs are already installed on my machine. All these .NET Frameworks were installed automatically with my MS Visual Studio 2008.
And if I try to install Windows CE 5.0 Platform Builder - Cumulative Product Update Rollup Package (more exactly WinCEPB50-071231-Product-Update-Rollup-Armv4I.msi 232.5 MB ) I'll get an error message "Setup requires Microsoft Windows CE 5.0 to be installed. Please install Microsoft Windows CE 5.0. Setup will now exit." It's a kind of closed cricle. I don't know, maybe your links aren't actual any more. That's why I can't compile it by myself.
Could you explain please, how did YOU install this Platform Builder?, Or post please a compiled SampleGrabberFilter.lib library.
Thanks a lot in advance! I really appreciate your help.
|
|
|
|
|
You just have to manually install .NET Framework 1.1. Then install Windows CE, Platform Builder and you are good to go.
|
|
|
|
|
Hello Angel,
thank you for your last answer. I installed Windows CE and Platform Builder on my machine.
Now I'm trying to compile SampleGrabberFilter.lib by using the source code, that you had posted.
But I don't understand, what do you mean in Setting Up-Part with "You also need to add the header files from the Windows Mobile SDK and Platform Builder to your include path."
In the C:\WINCE500\PUBLIC\DIRECTX\SDK\SAMPLES\DSHOW\BASECLASSES directory I have only .cpp and no .h files. I have never dealt with such complicated projects. Please, could you give a path example, which I need to add into Visual Studio project? In Debug Mode I have "dmoguids.lib strmiids.lib uuid.lib mmtimer.lib strmbase.lib" in the Linker Input Options field and in Release Mode this field is empty. I'm not sure, in which Mode do I have to compile the project, in Debug or in Release one?
Thanks in advance,
Andreas
|
|
|
|
|
Hi Andreas,
Sorry for the error on my part, I meant you need to set the build environment, that is go to the compiler and linker options in your visual studio project and update the include and linker paths to point to your windows mobile sdk and platformbuiler installations. You have correctly identified the
C:\WINCE500\PUBLIC\DIRECTX\SDK\SAMPLES\DSHOW\BASECLASSES directory, it has to be included to the include paths for the compiler. The same for Windows Mobile SDK. Just go through the project options and check all paths and see if they are valid on your machine, if not, change them to whereever have you installed the libraries.
Angel
|
|
|
|
|
Please help me angel…
I am using your code on VS2008. I right click and open the TimedCameraCapture C# project file and it opens in Debug mode and mixed platform...I get 2 linking errors
First Error:
error LNK2001: unresolved external symbol “public: virtual unsigned long __cdecl CBaseFilter::NonDelegatingRelease(void)” (?NonDelegatingRelease@CBaseFilter@@UAAKXZ)
in file:SampleGrabber.obj
in project: CameraCaptureDLL
Second Error:
Fatal error LNK1120: 1 unresolved externals
in file : CameraCaptureDLLD
in project: CameraCaptureDLL
Please guide me…
In Release Mode,the build succeeds but on deployment following is the error:
MissingMethodExceptionUnhandled.
Cant find PInvoke DLL..
Pl help me angel. I am in the middle of my internship and i need your help to clear my semester. Reply as soon as possible..
mail me on mansibalapuria@gmail.com
|
|
|
|
|