Comments (4)
A prototype implemented: transparent encoding/decoding from/to base64 inside XMPDataSource.
See rv/compression_prototype branch for details.
from vmf.
Design proposal
-
Each compression method should be implemented as a class implementing ICompressor interface:
void compress(const string& in, string& out);
void decompress(const string& in, string& out);
string getId();
If user wants to use his own compression method, the function
vmf::registerCompressor(ICompressor*)
should be called before that. -
Exporting metadata to separate file is performed now using
IReader
andIWriter
interfaces.
I propose to createCompressionReader
class derived fromIReader
interface.It should use the following user-provided instances of interfaces:
ICompressor
to decompress dataIReader
to parse data
The same for
CompressionWriter
class. -
To write metadata to video file a user now calls the method
vmf::MetadataStream::save()
orsaveTo(string)
.
I propose to add the optional argumentICompressor*
to the methods.Implementation of the in-video metadata compression should be the following:
- create methods
XMPDataSource::loadXMPStructs()
andXMPDataSource::saveXMPStructs()
as an intermediate layer - reimplement them in derived class
CompressedXMPDataSource
takingICompressor*
as the constructor argument - this class should perform encoding to and decoding from base64
- create methods
from vmf.
I suggest
class ICompressor
{
public:
void compress(const std::string& in, vmf_rawbuffer& out);
void decompress(const vmf_rawbuffer& in, std::string& out);
const std::string& getID();
};
since VMF uses vmf_rawbuffer
type for arbitrary binary data (BTW, vmf_rawbuffer
implementation can be improved).
Also vmf::registerCompressor(std::shared_ptr<ICompressor> compressor)
is much safer than use of naked pointer.
I'm not sure we really need CompressedXMPDataSource
as an inheritor of XMPDataSource
for compression support - please consider possibility of adding compression-related code directly into XMPDataSource
. (Same for IReader
and IWriter
.)
from vmf.
#10 is merged
from vmf.
Related Issues (18)
- Java bindings HOT 2
- Missing classes in VMF ref man HOT 2
- Enable CI HOT 3
- Use of STL classes in VMF API produces problems on Windows in DLL case HOT 1
- vmf::Variant::Type values are changed in new vmf_rawbuffer - needs to be restored
- queryByReference(...) functions are confusing
- New VMF 3.0 API ideas HOT 1
- Impossible to get value of single-value metadata HOT 1
- Encryption feature HOT 3
- Incorrect saving metadata sequence HOT 1
- MetadataDesc constructor adds unnamed ReferenceDesc to class field even if it already exists. HOT 1
- Test code coverage HOT 8
- Statistics object HOT 1
- class `MetadataStream::VideoSegment` is not documented. HOT 1
- Need to remove MetaString type
- Work of Metadata::addReference() method is not as expected in case unique references. HOT 1
- vmf_rawbuffer::operator=(): size member is not assigned HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vmf.