Welcome Guest ( Log In | Register )


Important

The forums will be closing permanently the weekend of March 15th. Please see the notice in the announcements forum for details.

 
Input Filename To Filters, feature addon
« Next Oldest | Next Newest » Track this topic | Email this topic | Print this topic
Drakon Rider
Posted: Aug 6 2010, 05:38 PM


Member


Group: Members
Posts: 10
Member No.: 26671
Joined: 26-December 09



I made a quality-check filter that used with VirtualDub as avi-reading application.
For output log I was needed an input filename because I start VirtualDub in batch mode for processing all files in folder.

Currently made my own custom build of VD 1.9.7 with changes:

in vdvideofilt.h
CODE

// VDXFilterActivation: This is what is actually passed to filters at runtime.

class VDXFilterActivation {
public:
const VDXFilterDefinition *filter;  //
void *filter_data;
VDXFBitmap& dst;
VDXFBitmap& src;
VDXFBitmap *_reserved0;
VDXFBitmap *const last;
uint32  x1;
uint32  y1;
uint32  x2;
uint32  y2;

VDXFilterStateInfo *pfsi;
IVDXFilterPreview *ifp;
IVDXFilterPreview2 *ifp2;   // (V11+)

uint32  mSourceFrameCount;  // (V14+)
VDXFBitmap *const *mpSourceFrames; // (V14+)
VDXFBitmap *const *mpOutputFrames; // (V14+)
               
               // ADDED
wchar_t szInputAVIFile[MAX_PATH];

IVDXAContext *mpVDXA;   // (V15+)

};


in FilterInstance.h
CODE

class VDFilterActivationImpl {  // clone of VDXFilterActivation
VDFilterActivationImpl(const VDFilterActivationImpl&);
VDFilterActivationImpl& operator=(const VDFilterActivationImpl&);
public:
VDFilterActivationImpl(VDXFBitmap& _dst, VDXFBitmap& _src, VDXFBitmap *_last);

const VDXFilterDefinition *filter;
void *filter_data;
VDXFBitmap& dst;
VDXFBitmap& src;
VDXFBitmap *_reserved0;
VDXFBitmap *const last;
uint32  x1;
uint32  y1;
uint32  x2;
uint32  y2;

VDXFilterStateInfo *pfsi;
IVDXFilterPreview *ifp;
IVDXFilterPreview2 *ifp2;   // (V11+)

uint32  mSourceFrameCount;
VDXFBitmap *const *mpSourceFrames; // (V14+)
VDXFBitmap *const *mpOutputFrames; // (V14+)

               // ADDED
wchar_t szInputAVIFile[MAX_PATH];

IVDXAContext *mpVDXA;   // (V15+)



private:
char mSizeCheckSentinel;

VDXFBitmap *mOutputFrameArray[1];
};


in FilterInstance.cpp
CODE

// ADDED
extern wchar_t g_szInputAVIFile[];

FilterInstance::FilterInstance(FilterDefinitionInstance *fdi)
{skipped}
{
filter = const_cast<FilterDefinition *>(&fdi->Attach());
src.hdc = NULL;
dst.hdc = NULL;
last->hdc = NULL;
x1 = 0;
y1 = 0;
x2 = 0;
y2 = 0;

               // ADDED
 wcscpy(szInputAVIFile, g_szInputAVIFile);



That allows filter to get input filename as szInputAVIFile member of FilterActivation structure. Can you add this feature in official releases ?

Or may be other way of getting input filename for the filter already exist ?
 
     Top
phaeron
Posted: Aug 8 2010, 05:34 AM


Virtualdub Developer


Group: Administrator
Posts: 7773
Member No.: 61
Joined: 30-July 02



Sorry, but I'll have to decline. Video filters deliberately don't have access to this information, because they're not supposed to know about the source file, only the source stream. For instance, it doesn't make sense in capture mode, if the stream is dynamically generated, or if there are multiple source files.
 
    Top
Drakon Rider
Posted: Aug 8 2010, 07:50 AM


Member


Group: Members
Posts: 10
Member No.: 26671
Joined: 26-December 09



Well - what other ways of getting input filename officially available ?

May be getting list of file handles opened by the process with current Process ID and filtering out all files in the VirtualDub's folder and lower ?
 
     Top
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:
2 replies since Aug 6 2010, 05:38 PM Track this topic | Email this topic | Print this topic

<< Back to VirtualDub Development Forum