Closed roman380 closed 8 years ago
Interesting idea. I like the idea of the data being more readable. Some of my filters write Unicode String data to properties which is editable in GRF in a hex editor but not in GRFX ironically because of the base64 encoding. If it was encoding as something like UTF8 then that would be much easier to read and edit.
How would property bag support work at the filter level? Would this require the filter to support this style of persistence by querying for the IPersistPropertyBag interface and using that instead of IStream?
This is fully COM compliant. I have a filter that implements both IPersistStream
and IPersistPropertyBag
(well, actually I have lots of such since with ATL this is straightforward) and the commit I made already does everything necessary:
ipersistpropertybag
branchIPropertyBag
backed by contents of ipersistpropertybag
nodeIPersistPropertyBag::Load
call invites the object to load the properties it wantsNow your question about property page. This has zero interference with property page. Property page still talks to object via interfaces, updates the same properties from code. Loading from stream or bad makes no difference, saving makes no difference either.
An addon possible is a new property page: when GSN sees IPersistPropertyBag
, it can invite to save to in-memory bag, then display the properties visually. That would also be a nice thing.
When saving, GSN can detect availability of IPersistStream and IPersistPropertyBag and write both into XML. Why not? Binary stream + human readable data redundantly duplicated.
There is a question of string conversion, Property values are variants, they might not have string conversion OR strings conversion might get incompatible when regional settings change. It is more reliable to load from binary data rather than from properties. What makes sense to me is to give priority to load from stream. If developer wants the bag, he can edit the XML and delete ipersiststream
fragment so that ipersistpropertybag
has effect.
Sorry for chaotic notes :)
Filter data is currently stored as Base64 encoded persistent stream data, which is good.
For development purposes, it might be convenient to store property bag instead, so that it's easily editable. For example stream and bag:
Basically saving to bag makes also sense as an option, but stream is more reliable. It might make sense to save both and load from stream, or bag as a second chance. Anyway, I am going to add load from bag now, and the rest might be not worth the effort.