Git Product home page Git Product logo

Comments (4)

savuor avatar savuor commented on June 26, 2024

A prototype implemented: transparent encoding/decoding from/to base64 inside XMPDataSource.
See rv/compression_prototype branch for details.

from vmf.

savuor avatar savuor commented on June 26, 2024

Design proposal

  1. 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.

  2. Exporting metadata to separate file is performed now using IReader and IWriter interfaces.
    I propose to create CompressionReader class derived from IReader interface.

    It should use the following user-provided instances of interfaces:

    • ICompressor to decompress data
    • IReader to parse data

    The same for CompressionWriter class.

  3. To write metadata to video file a user now calls the method vmf::MetadataStream::save() or saveTo(string).
    I propose to add the optional argument ICompressor* to the methods.

    Implementation of the in-video metadata compression should be the following:

    • create methods XMPDataSource::loadXMPStructs() and XMPDataSource::saveXMPStructs() as an intermediate layer
    • reimplement them in derived class CompressedXMPDataSource taking ICompressor* as the constructor argument
    • this class should perform encoding to and decoding from base64

from vmf.

apavlenko avatar apavlenko commented on June 26, 2024

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.

apavlenko avatar apavlenko commented on June 26, 2024

#10 is merged

from vmf.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.