|
Hi, firstly, I would like to thank you for this amazing post coz it is part of my graduation project . secondly, I have managed to make the project compile very fine, but the problem is tht I wanna try it on WM5 and when I connect my PPC and run the application it gives me deploy errors, even after I changed the project's platform to WM5 SDK and I even can not watch the deploy error, so how can I make it run on WM5, or what is the changes I should make?.
Thanks
|
|
|
|
|
Hey, I have managed to get the error from the output window, but it still couldn't solve it. Thanks for ur help
//Output when deploy on WM5 device
Registering file...
Deployment and/or registration failed with error: 0x8973190e. Error writing file '%CSIDL_PROGRAM_FILES%\TimedCamera\CameraCaptureDLLD.dll'. Error 0x80450001: (null)
------ Deploy started: Project: TestCameraCapture, Configuration: Debug Any CPU ------
========== Build: 2 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
========== Deploy: 1 succeeded, 1 failed, 0 skipped ==========
|
|
|
|
|
Check all dependencies. Are you compiling with the WM5 SDK?
|
|
|
|
|
yea, I am compiling using WM5 SDK, but it also gives me this compiling error
Error 1 error LNK2001: unresolved external symbol "public: virtual unsigned long __cdecl CBaseFilter::NonDelegatingRelease(void)" (?NonDelegatingRelease@CBaseFilter@@UAAKXZ) SampleGrabber.obj CameraCaptureDLL
|
|
|
|
|
Look at the comments where people had the same problem.
Either compile debug version or define the function at your filter.
|
|
|
|
|
Hi angel,
This might be very easy for you but its very important for me to know. I have installed Windows CE 5.0, Windows Mobile 6 SDK, and Platform Builder 5.0...Following is what the libraries point to::
Properties-->
C/C++-->General-->
Decoder,
Encoder,
C:\Program Files\Windows Mobile 6 SDK\PocketPC\Include\Armv4i
..\include,
C:\WINCE500\PUBLIC\DIRECTX\SDK\INC,
C:\WINCE50\PUBLIC\DIRECTX\SDK\SAMPLES\DSHOW\BASECLASSES,
LINKER -->
Additional Library Directories--->C:\Program Files\Windows CE Tools\wce500\Windows Mobile 5.0 Pocket PC SDK\Lib\ARMV4I
[Here when i search C:\WINCE500\PUBLIC\DIRECTX\SDK\LIB\ARMV4I\DEBUG i found only X86 and no ARMV4I]
What should I do to run the code...???
|
|
|
|
|
Hi angel...
First of all..the code is amazing..I have got
cannot open input file 'CodecH263CE.lib'..I get this error.I have Windows CE 5, Platform builder 5 (X-86) installed and also Windows Mobile 5 SDK...The Properties->Linker->General->Additional Library Dependencies points to --C:\WINCE500\PUBLIC\DIRECTX\SDK\LIB\X86\DEBUG ...Properties Configuration -Active (Debug) Platform-Active (Windows Mobile 5.0 Pocket PC ARMV4I)
Please guide me...
I could not install Platform Builder for ArmV4I-->It gave error Target Processor is not installed.
|
|
|
|
|
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
|
|
|
|
|