mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-24 10:22:05 -05:00
LibAudio: Allow adding metadata to encoders
This commit is contained in:
parent
b4b411b8a3
commit
1e291753b0
1 changed files with 5 additions and 0 deletions
|
@ -8,6 +8,7 @@
|
|||
|
||||
#include <AK/Error.h>
|
||||
#include <AK/Span.h>
|
||||
#include <LibAudio/Forward.h>
|
||||
#include <LibAudio/Sample.h>
|
||||
|
||||
namespace Audio {
|
||||
|
@ -25,6 +26,10 @@ public:
|
|||
// This method is called in the destructor, but since this can error, you should call this function yourself before disposing of the decoder.
|
||||
virtual ErrorOr<void> finalize() = 0;
|
||||
|
||||
// Sets the metadata for this audio file.
|
||||
// Not all encoders support this, and metadata may not be writeable after starting to write samples.
|
||||
virtual ErrorOr<void> set_metadata([[maybe_unused]] Metadata const& metadata) { return {}; }
|
||||
|
||||
// Provides a hint about the total number of samples to the encoder, improving some encoder's performance in various aspects.
|
||||
// Note that the hint does not have to be fully correct; wrong hints never cause errors, not even indirectly.
|
||||
virtual void sample_count_hint([[maybe_unused]] size_t sample_count) { }
|
||||
|
|
Loading…
Add table
Reference in a new issue