|
Have you built the filter base class library as outlined here[^]?
Once you build the lib(s) then add the appropriate (debug or non-debug) lib file to your project.
Mark
|
|
|
|
|
Hi Mark,
I am getting some serious linking errors, I followed the webpage you sent me, and I am getting linking errors.
I have put my project files up at http://www.ece.ubc.ca/~npatel/MemorySource.zip
It is the project file that I have copied Push Source into. It uses Visual C++ 2003 .NET
What am I doing wrong?
|
|
|
|
|
godspeed123 wrote: I am getting some serious linking errors
You are just missing atlsd.lib
Don't forget to change the "Filter name strings" in pushsource.h and generate your own GUIDs
to replace the ones in PushGuids.h
For your version you probably won't need any of the Dib stuff either since you already have a
source of video frames. But I'm getting ahead of yourself When this builds I would recommend
testing it out in graphedit - make sure it works like the sample is supposed to THEN alter
it for your needs
Mark
|
|
|
|
|
I tried adding atlsd.lib, still the same unresolved external symbols
There are the linking errors
Linking...
Creating library Debug/MemorySource.lib and object Debug/MemorySource.exp
PushSourceDesktop.obj : error LNK2019: unresolved external symbol "public: __thiscall CSourceStream::CSourceStream(unsigned short *,long *,class CSource *,unsigned short const *)" (??0CSourceStream@@QAE@PAGPAJPAVCSource@@PBG@Z) referenced in function "public: __thiscall CPushPinDesktop::CPushPinDesktop(long *,class CSource *)" (??0CPushPinDesktop@@QAE@PAJPAVCSource@@@Z)
PushSourceBitmap.obj : error LNK2001: unresolved external symbol "public: __thiscall CSourceStream::CSourceStream(unsigned short *,long *,class CSource *,unsigned short const *)" (??0CSourceStream@@QAE@PAGPAJPAVCSource@@PBG@Z)
PushSourceBitmapSet.obj : error LNK2019: unresolved external symbol "public: __thiscall CSourceStream::CSourceStream(unsigned short *,long *,class CSource *,unsigned short const *)" (??0CSourceStream@@QAE@PAGPAJPAVCSource@@PBG@Z) referenced in function "public: __thiscall CPushPinBitmapSet::CPushPinBitmapSet(long *,class CSource *)" (??0CPushPinBitmapSet@@QAE@PAJPAVCSource@@@Z)
PushSourceDesktop.obj : error LNK2019: unresolved external symbol "void __cdecl DbgLogInfo(unsigned long,unsigned long,unsigned short const *,...)" (?DbgLogInfo@@YAXKKPBGZZ) referenced in function "public: virtual __thiscall CPushPinDesktop::~CPushPinDesktop(void)" (??1CPushPinDesktop@@UAE@XZ)
PushSourceBitmap.obj : error LNK2001: unresolved external symbol "void __cdecl DbgLogInfo(unsigned long,unsigned long,unsigned short const *,...)" (?DbgLogInfo@@YAXKKPBGZZ)
PushSourceBitmapSet.obj : error LNK2001: unresolved external symbol "void __cdecl DbgLogInfo(unsigned long,unsigned long,unsigned short const *,...)" (?DbgLogInfo@@YAXKKPBGZZ)
PushSourceDesktop.obj : error LNK2019: unresolved external symbol "void __stdcall DbgAssert(unsigned short const *,unsigned short const *,int)" (?DbgAssert@@YGXPBG0H@Z) referenced in function "public: virtual long __thiscall CPushPinDesktop::DecideBufferSize(struct IMemAllocator *,struct _AllocatorProperties *)" (?DecideBufferSize@CPushPinDesktop@@UAEJPAUIMemAllocator@@PAU_AllocatorProperties@@@Z)
PushSourceBitmap.obj : error LNK2001: unresolved external symbol "void __stdcall DbgAssert(unsigned short const *,unsigned short const *,int)" (?DbgAssert@@YGXPBG0H@Z)
PushSourceBitmapSet.obj : error LNK2001: unresolved external symbol "void __stdcall DbgAssert(unsigned short const *,unsigned short const *,int)" (?DbgAssert@@YGXPBG0H@Z)
PushSourceDesktop.obj : error LNK2019: unresolved external symbol "public: __thiscall CSource::CSource(unsigned short *,struct IUnknown *,struct _GUID)" (??0CSource@@QAE@PAGPAUIUnknown@@U_GUID@@@Z) referenced in function "private: __thiscall CPushSourceDesktop::CPushSourceDesktop(struct IUnknown *,long *)" (??0CPushSourceDesktop@@AAE@PAUIUnknown@@PAJ@Z)
PushSourceBitmap.obj : error LNK2001: unresolved external symbol "public: __thiscall CSource::CSource(unsigned short *,struct IUnknown *,struct _GUID)" (??0CSource@@QAE@PAGPAUIUnknown@@U_GUID@@@Z)
PushSourceBitmapSet.obj : error LNK2001: unresolved external symbol "public: __thiscall CSource::CSource(unsigned short *,struct IUnknown *,struct _GUID)" (??0CSource@@QAE@PAGPAUIUnknown@@U_GUID@@@Z)
Debug/MemorySource.ax : fatal error LNK1120: 4 unresolved externals
|
|
|
|
|
It built for me. I just needed to add atlsd.lib and point to my own strmbasd.lib.
Those errors look like you haven't included strmbasd.lib
|
|
|
|
|
In the linker settings where you added strmbasd.lib (input/additional dependencies) you may need
to use the full path to strmbasd.lib.
ACK I didn't mean to reply to myself
|
|
|
|
|
In the linker settings where you added strmbasd.lib (input/additional dependencies) you may need
to use the full path to strmbasd.lib.
|
|
|
|
|
Hi Mark,
I redid the project on another machine and it works fine there. Yay !!! finally thanks to you I have it working.
So now once its compiled how does one go about finding a unique GUID, and loading this up in GraphEdit. My understanding is I have to register the dll with regsvr32.
Once again I thanks you for all the help.
|
|
|
|
|
Step 1) Generate new GUIDS. There's 3 of them in your project's pushguids.h.
You can use guidgen.exe (GUI) to create 1 at a time or uuidgen.exe to generate many sequential
GUIDs. Both utilities are in the platform SDK bin folder.
Step 2) modify those strings ("Filter name strings") in pushsource.h to your own names.
That will make your filter easier to find in graphedit.
Step 3) From a command prompt - "cd" to the folder your MemorySource.ax is in.
use "regsvr32 drive:\fullpath\MemorySource.ax" to register the com dll.
Step 4) Test in graphedit
-- modified at 21:10 Tuesday 26th December, 2006
|
|
|
|
|
Sweet its working!!!!!!!!!!!!!!!!
Last question hopefully
So if I have images being stored in memory, how do you pass that into this source filter since it has no input. All of these filters generate data internally, my data is sitting in memory all I want to do it pull that data into directshow.
|
|
|
|
|
godspeed123 wrote: Sweet its working!!!!!!!!!!!!!!!!
Cool
godspeed123 wrote: how do you pass that into this source filter since it has no input
The short answer: Any way you want!
A longer answer:
I would add a COM interface to the filter so you can add any methods you want to it and call them
just like you do the documented methods in Microsoft's DirectShow filters.
I'm no COM expert so if anyone wants to jump in and show how to do this better I'm all ears
(eyes?).
Example. There's 3 filters in your code. I'll use the CPushSourceBitmap class (PushSource
Bitmap Filter) as an example (I did it this way originally so I wouldn't mess up the original
class).
In pushsource.h define a COM interface class (you'll need another GUID for the interface)
Note that the GUID is defined here using standard IID_ naming convention and the same GUID, in
MIDL form, is used in the MIDL_INTERFACE macro.
DEFINE_GUID(IID_IMySource,
0x0aaaaaaa, 0xaaaa, 0xaaaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa);
MIDL_INTERFACE("0aaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa")
IMySourceFilter : public IUnknown
{
public:
};
Next derive CPushSourceBitmap from the new interface class (IMySourceFilter)
{ becomes
class CPushSourceBitmap : public CSource, public IMySourceFilter
{
public:
STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void ** ppv);
DECLARE_IUNKNOWN;
In pushsourcebitmap.cpp add the implementation for any new interface functions plus the
implementation of NonDelegatingQueryInterface() (note the use of the new GUID)
STDMETHODIMP CPushSourceBitmap::NonDelegatingQueryInterface( REFIID riid, void ** ppv)
{
CheckPointer(ppv,E_POINTER);
if(riid == IID_IMySource)
{
return GetInterface((IMySourceFilter *) this, ppv);
}
else
{
return CSource::NonDelegatingQueryInterface(riid, ppv);
}
}
Use regsvr32 like before except with the /u switch to uninstall the previous filter.
Then use regsvr32 to register the filter again (with the new interface).
Now your filter has a custom COM interface so you can control it from the outside, just like
any other filters. Use QueryInterface as usual to get an interface pointer:
IMySourceFilter *pifMySource = NULL;
pMyFilter->QueryInterface(IID_IMySource, (void **)&pifMySource);
Now you can add methods to send frames to the filter or whatever scheme you want to use - you
can also have the filter call a callback function to grab frames.
-- modified at 22:49 Tuesday 26th December, 2006
|
|
|
|
|
Very good responses from you. My wishes for you
*
|
|
|
|
|
Thanks Mark for all the information, I will try it all out.
Once agian I am grateful for all the help you have given me.
|
|
|
|
|
Hi,
So I finished adding everything that you said and I could load the new filter in graphEdit. I kept the name the same as the sample, I am updating CPushSourceDesktop.
So now I want to be able to go into another C++ program and set this filter up.
Is the declaration to get it instantiated as follows:
CPushSourceDesktop *pMyFilter;
and then do this
hr = CoCreateInstance(CLSID_PushSourceDesktop, NULL, CLSCTX_INPROC_SERVER,
IID_IBaseFilter, reinterpret_cast<void**>(&pMyFilter));
hr = pGraph->AddFilter(pMyFilter, L"PushSource Desktop Filter");
IMySourceFilter *pifMySource = NULL;
pMyFilter->QueryInterface(IID_IMySource, reinterpret_cast<void**>(&pifMySource));
Its giving me linking errors :
error LNK2001: unresolved external symbol _IID_IMySource
error LNK2001: unresolved external symbol _CLSID_PushSourceDesktop
I included everything
#include "Dshow.h"
#include "Qedit.h"
#include "Streams.h"
#include "PushGuids.h"
#include "PushSource.h"
and the lib I included Strmiids.lib Quartz.lib MemorySource.lib
Any help would be appreiciated
|
|
|
|
|
The underscores preceding the symbols are suspicious
Did you include this file (above your GUID definitions)
#include <initguid.h>
and use the DEFINE_GUID macro to define them?
// {AAAAAAAA-AAAA-AAAA-AAAA-AAAAAAAAAAAA}
DEFINE_GUID(CLSID_PushSourceDesktop,
0xaaaaaaaa, 0xaaaa, 0xaaaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa);
|
|
|
|
|
Hi,
Thanks for the response. I added the #include <initguid.h> and it compiled, but when I run the program and I have written
hr = CoCreateInstance(CLSID_PushSourceDesktop, NULL, CLSCTX_INPROC_SERVER,
IID_IBaseFilter, reinterpret_cast<void**>(&pMyFilter));
hr = pGraph->AddFilter(pMyFilter, L"PushSource Desktop Filter");
The program crashes with an error Module MemorySource.ax, 2 objects left active!
At line 316 of dllentry.cpp
And then the program aborts.
Does anyone know why this is happening
|
|
|
|
|
|
I can't figure out what's up.
If I substitute one of my known working filters then it works fine.
I tried to build a filter from scratch using your code and it fails (I'm not saying it's your
code - I mean just using your test hello() method).
If I see something or something comes to mind I'll let you know!
|
|
|
|
|
Which line does the crash occur on? CoCreateInstance()?
I can't test your code since it has the PVxx.h header file that's missing.
Mark
|
|
|
|
|
Hi,
Thanks for the response.
The error occurrs on the AddFilter line, the PVxx.h you can delete, I am not using it in the filter.
I was just fooling around with things trying to get it to work.
|
|
|
|
|
hello everyone,
i am trying to save some files and folders onto a FTP server. i can successfully create the tree structure of the files and folders onto an FTP running Windows. but the operation fails when i try to save the same tree structure onto an FTP server running Linux on it.
may be the CFtpConnection:: CreateDirectory() function works only on the FTP servers running windows Operation System on it, is it??? i am not sure. can anyone please help me.
Thanks..
vijay.
|
|
|
|
|
vijay7173 wrote: FTP server running Linux on it
There's your problem right there
Seriously, though, are you getting an error returned from CreateDirectory()?
Are you specifying a correct/appropriate path?
|
|
|
|
|
Mark Salsbery wrote: are you getting an error returned from CreateDirectory()?
yes sir.the CreateDirectory() returns 0. more over it returns with an error code of 12003 and i am not able to make out what exactly the error is about.
Mark Salsbery wrote: Are you specifying a correct/appropriate path?
yes, i am giving the correct path. the problem is that, i am sometimes successful in saving the tree to the FTP server with Linux running on it. but the Hierarchy is not preserved. i.e, the entire tree is saved at a same level. eg: a file with path, say, /root/folder1/folder2 the directory folder2 is created and saved under root folder, where as it should be saved in folder1 (which is in turn saved under root ). i have checked the path and i am sure that i am giving the right path. i even made sure to see that the path is not modified in between.
can i know what i should do to make my tree save to be saved onto the FTP server with Linux on it??? I am using the member functions of CFtpConnection class. should i use any alternatives(if there are any)??
vijay.
|
|
|
|
|
vijay7173 wrote: more over it returns with an error code of 12003 and i am not able to make out what exactly the error is about.
INFO: WinInet Error Codes (12001 through 12156)[^]
12003 ERROR_INTERNET_EXTENDED_ERROR
An extended error was returned from the server. This is
typically a string or buffer containing a verbose error
message. Call InternetGetLastResponseInfo to retrieve the
error text.
What is the current directory (use CFtpConnection::GetCurrentDirectory()) before you try to create
a directory?
|
|
|
|
|
Mark Salsbery wrote: What is the current directory (use CFtpConnection::GetCurrentDirectory()) before you try to create
a directory?
well sir, the server connected me to the Root Directory (i.e, '/'). and every time i use CFtpConnection::SetCurrentDirectory() to set the directory when i am supposed change it.
vijay.
|
|
|
|
|