Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
21st August 2005, 10:42 | #41 | Link |
Registered User
Join Date: Mar 2002
Posts: 1,075
|
It isnt that I was suggesting that filters directly access the userdata directly through the pointer, you just need some way to associate the user data with the videoframe object. The entirety of PVideoFrame is implemented in the header, can't do nothing with that. Usually you would store a pointer in the private data of VideoFrame, but since you are trying to retain binary compatibility and that is not possible just tacking it onto vfb->data seems the easiest route. You either need to store the data with the object, or have some identifier for the videoframe object which you can use with a lookup table to find the user data (and the only identifiers available are pointers, and that is far fuglier than adding it directly to vfb->data).
Sure in principle the vfb->data pointer is readily exposed to filters, it is private though, but the syntactic suger in C++ never really hides anything ... privacy is a matter of manners in C++, nothing more. Why do you want to implement it with virtual functions? Normal functions can be added without breaking compatibility without needing any tricks, and the implementation can still be in avisynth.cpp so they are still opaque/non-inlined. Implementing it with virtual functions seems a little roundabout ... when would you ever want to inherit VideoFrame and override those functions? Last edited by MfA; 21st August 2005 at 14:11. |
21st August 2005, 11:17 | #42 | Link |
Clouded
Join Date: Jul 2003
Location: Cambridge, UK
Posts: 1,148
|
I think we ought to leave sometime for thought and discussion before throwing in the associated-values. There are several issues to resolve. For example, what about namespace clashes? Are we going to give each DLL its own namespace or are they all going to share one? If the former, does a DLL have a mechanism to access information from the namespace of another DLL? Etc.
@MfA, Could I ask what in particular you are intending to use the associated values for?
__________________
a.k.a. Clouded. Come and help by making sure your favourite AVISynth filters and scripts are listed. |
21st August 2005, 12:29 | #44 | Link |
Clouded
Join Date: Jul 2003
Location: Cambridge, UK
Posts: 1,148
|
Sorry, I meant namespace for keys. So if two different plug-ins both try and attach a value with a a key called, say, "size" to a frame then are they accessing the same value or different values?
__________________
a.k.a. Clouded. Come and help by making sure your favourite AVISynth filters and scripts are listed. |
21st August 2005, 12:48 | #45 | Link | |
Registered User
Join Date: Mar 2002
Posts: 1,075
|
Quote:
As I said, Id use a GUID for a key ... a little less user friendly, filters who want to cooperate need to get the appropriate GUID from some higher level, but no chance of interference. Last edited by MfA; 21st August 2005 at 13:25. |
|
21st August 2005, 14:00 | #47 | Link |
Avisynth Developer
Join Date: Jan 2003
Location: Melbourne, Australia
Posts: 3,167
|
@MfA,
By implementing it with virtual functions and then deriving new classes we can support any differing requirements with different child classes. It's about providing the maximum scope for the future and it needs to be analysed on a case by case basis, for some cases normal methods may be preferable to virtual methods. If done correctly then 2.6 api plugins should be loadable in any future version. Don't let my forthright opinions stop you pushing the envelope, only by chalanging ideas can we beat bugs out of them before we code them. @mg262, There are many methods for both avoiding and allowing collisions, i.e the way HANDLES work in windows, note I'm not saying we need something this perverse, but it is an example. The 2 cases I see are A) 2 separate instance of the same filter each wanting their own unique data set and B) a set of filters that want to pass data tags up the GetFrame chain between themselves. And of course there is the amalgum of the 2. Things like the "this" pointer make good unique values. And the environment variables provide a method for sharing key information. IanB |
21st August 2005, 14:35 | #48 | Link |
Avisynth 3.0 Developer
Join Date: Jan 2002
Location: France
Posts: 639
|
Here are what I use (simplified) in 3.0 :
Code:
class Key { public: //structors Key() { } virtual ~Key() { } public: //Key interface virtual bool operator==(Key const& other) const { return &other == this; } }; class Property { public: //structors Property() { } virtual ~Property() { } public: //Property interface virtual PKey GetKey() const = 0; }; This can handle your A) and B) |
21st August 2005, 15:04 | #49 | Link |
Clouded
Join Date: Jul 2003
Location: Cambridge, UK
Posts: 1,148
|
This all seems very sensible. But I was trying (not very well) to say this: sh0dan very sensibly put forward a set of additions for 2.6 which it was very clear how to implement, and this one, much as I would like it, seems to me to need a lot more thought and clarification than the others. Namespaces were meant to be an example.
Or is it that they are coming up now not because we want implement them immediately, but because we want to make sure we don't break anything in doing so (which to some extent is something that can be applied to any feature)?
__________________
a.k.a. Clouded. Come and help by making sure your favourite AVISynth filters and scripts are listed. |
21st August 2005, 15:44 | #50 | Link |
Registered User
Join Date: Mar 2002
Posts: 1,075
|
IanB : Well VideoFrame is an everything and the kitchen sink object, every type of videoframe you want is enumerated and stored in there ... it's as anti-inheritance as it gets, seems futile to start adding virtual functions now. If in the future the needs change, add a new enum
Anyway, an extra lookup doesnt matter much I guess (using the this pointer of the VideoFrame object as an index). all that pointer chasing which will be necessary to search the user data through a dynamically sized two dimensional lookup table isn't pretty, but compared to the actual work a filter does it isnt really relevant. mg262, the changes to the API are relatively small for what I ask. Just two new public methods for VideoFrame, using something like Bidoches classes it would be something like void AddProperty(PProperty) and PProperty GetProperty(PKey). Now Im not big on OO design, but I dont think it should be too hard for those who are to agree on the interface (and implementation is relatively easy). Last edited by MfA; 21st August 2005 at 16:20. |
21st August 2005, 16:53 | #51 | Link |
Clouded
Join Date: Jul 2003
Location: Cambridge, UK
Posts: 1,148
|
If it's just interface, then that seems very sensible to me!
__________________
a.k.a. Clouded. Come and help by making sure your favourite AVISynth filters and scripts are listed. |
25th August 2005, 12:05 | #52 | Link |
Angel of Night
Join Date: Nov 2004
Location: Tangled in the silks
Posts: 9,559
|
(Love the sideband data push, even if it might have to get shelved for 2.7.x it's still awesome.)
I'm not sure if this should be a 2.5.x or a 2.6 request, but I was wondering if changing the cropping options for resize filters was on the map. The right/bottom parameters aren't currently compatible with the negative offsets regular crop can use. Edit: I just noticed that it was committed to 2.5.6 CVS shortly before my request. Sorry. Last edited by foxyshadis; 30th August 2005 at 03:29. |
28th August 2005, 22:41 | #53 | Link |
developer wannabe
Join Date: Nov 2001
Location: Brooklyn, NY
Posts: 1,211
|
I just noticed that Avery Lee made a very extensive post on a next-gen filter interface. I think you guys need to talk to him -- not only is he a really smart & helpful video guy, but if both platforms are going to be changing at the same time then it makes sense to build in better compatibility. After all, most AVS users still use VDub every day, and vice versa.
MS keeps me pretty busy, but let me know if there's anything I can do to help -- if you find bugs in DirectShow, for example, that helps us too. (I work on Visual Studio, so developers are literally my customers). I think you'll find the C++ features in Whidbey are much improved, even if you don't use C++/CLI. |
4th September 2005, 21:07 | #54 | Link | |
Retired AviSynth Dev ;)
Join Date: Nov 2001
Location: Dark Side of the Moon
Posts: 3,480
|
I created a branch for 2.6. Called "avisynth_2_6":
http://cvs.sourceforge.net/viewcvs.p...g=avisynth_2_6 (New files not reflected there yet) I committed my first changes: Quote:
__________________
Regards, sh0dan // VoxPod Last edited by sh0dan; 4th September 2005 at 21:33. |
|
4th September 2005, 23:22 | #55 | Link |
Registered User
Join Date: Aug 2004
Location: Denmark
Posts: 807
|
I made some changes to make avisynth more threadsafe. You might want to add some of those.
__________________
Get my avisynth filters @ http://www.avisynth.org/tsp/ |
5th September 2005, 04:10 | #56 | Link |
Registered User
Join Date: Nov 2001
Posts: 291
|
Code:
bool sse3sup() { bool sse3prt=false; _asm{ pushad sub eax,eax cpuid mov eax,1 cpuid and ecx,00000000000000000000000000000001b //bit0 jz noexistesse3 mov [sse3prt],1 align 16 noexistesse3: sub eax,eax cpuid popad }; return sse3prt; } I hope this could be useful Luck with all this new work. ARDA Last edited by ARDA; 5th September 2005 at 04:20. |
5th September 2005, 04:49 | #57 | Link | |
Avisynth Developer
Join Date: Jan 2003
Location: Melbourne, Australia
Posts: 3,167
|
Quote:
I had a thought about introducing virtual edges to the API where frames can have junk around the edges to keep the alignment and virtual width and height. Would also mean all the power of 2 width/height restriction could just go. Only filters that care to notice the the true width and height need make of it. From the core point of view, the output blitter will need to know and I guess the resizers could make efffective use. IanB |
|
5th September 2005, 08:37 | #58 | Link | |
Retired AviSynth Dev ;)
Join Date: Nov 2001
Location: Dark Side of the Moon
Posts: 3,480
|
Quote:
@ARDA: Looks like the code I put in. Code is here: http://cvs.sourceforge.net/viewcvs.p..._with_tag=MAIN @tsp: I thought the thread safety had been implemented already, but I see it hasn't. I'll apply it ASAP. @all: Just saw I accidently committed the code to MAIN. I'll correct this back when I get home tonight. Sorry.
__________________
Regards, sh0dan // VoxPod Last edited by sh0dan; 5th September 2005 at 09:02. |
|
5th September 2005, 09:52 | #59 | Link |
Registered User
Join Date: Feb 2002
Posts: 407
|
sorry if this sound dumb, but while i'm reading your very interesting discussion about the design of avisynth, there is one thing i don't understand : what's the "baked code" ? I'm pretty sure that a litteral translation can't apply here
|
5th September 2005, 10:31 | #60 | Link |
Registered User
Join Date: Aug 2004
Location: Denmark
Posts: 807
|
sh0dan: The source changes I made include both the neccesary changes to make avisynth threadsafe (mainly in the avisynth.cpp, cache.cpp and internal.h) and a filter to actually run avisynth multithreaded (although it's not completly done yet). I don't know if you want both thing in 2.60.
__________________
Get my avisynth filters @ http://www.avisynth.org/tsp/ |
|
|