diff options
author | Jean-Francois Mauguit <jfmauguit@mac.com> | 2024-09-24 09:03:25 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-24 09:03:25 -0400 |
commit | bab614c421ed7ae329d26bf028c4a3b1d2450f5a (patch) | |
tree | 12f17f78986871dd2cfb0a56e5e93b545c1ae0d0 /Src/replicant/mp4/ifc_mp4audiodecoder.h | |
parent | 4bde6044fddf053f31795b9eaccdd2a5a527d21f (diff) | |
parent | 20d28e80a5c861a9d5f449ea911ab75b4f37ad0d (diff) | |
download | winamp-bab614c421ed7ae329d26bf028c4a3b1d2450f5a.tar.gz |
Merge pull request #5 from WinampDesktop/community
Merge to main
Diffstat (limited to 'Src/replicant/mp4/ifc_mp4audiodecoder.h')
-rw-r--r-- | Src/replicant/mp4/ifc_mp4audiodecoder.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/Src/replicant/mp4/ifc_mp4audiodecoder.h b/Src/replicant/mp4/ifc_mp4audiodecoder.h new file mode 100644 index 00000000..7c1ffa65 --- /dev/null +++ b/Src/replicant/mp4/ifc_mp4audiodecoder.h @@ -0,0 +1,32 @@ +#pragma once +#include "foundation/dispatch.h" +#include "ifc_mp4file.h" +#include "audio/ifc_audioout.h" + +class ifc_mp4audiodecoder : public Wasabi2::Dispatchable +{ + protected: + ifc_mp4audiodecoder() : Dispatchable(DISPATCHABLE_VERSION) {} + ~ifc_mp4audiodecoder() {} +public: + int FillAudioParameters(ifc_audioout::Parameters *parameters) { return MP4AudioDecoder_FillAudioParameters(parameters); } + int Decode(const void **output_buffer, size_t *output_buffer_bytes, double *start_position, double *end_position) { return MP4AudioDecoder_Decode(output_buffer, output_buffer_bytes, start_position, end_position); } + int Seek(ifc_mp4file::SampleID sample_number) { return MP4AudioDecoder_Seek(sample_number); } + int SeekSeconds(double *seconds) { return MP4AudioDecoder_SeekSeconds(seconds); } + int ConnectFile(ifc_mp4file *new_file) { return MP4AudioDecoder_ConnectFile(new_file); } + + enum + { + DISPATCHABLE_VERSION, + }; +private: + /* sizeof_parameters will already be filled out for you */ + virtual int WASABICALL MP4AudioDecoder_FillAudioParameters(ifc_audioout::Parameters *parameters)=0; + virtual int WASABICALL MP4AudioDecoder_Decode(const void **output_buffer, size_t *output_buffer_bytes, double *start_position, double *end_position)=0; + virtual int WASABICALL MP4AudioDecoder_Seek(ifc_mp4file::SampleID sample_number) = 0; + /* fill in with the actual seconds you'll resume playback at */ + virtual int WASABICALL MP4AudioDecoder_SeekSeconds(double *seconds) = 0; + /* this is an unfortunate wart in the API. In order to support editing metadata on an actively playing file, we have to re-open the file which will generate a new ifc_mp4file object. + do _not_ reset the decoder or change the sample number. You should assume the file is identical from a playback point-of-view, just release your old object and retain/assign the new one */ + virtual int WASABICALL MP4AudioDecoder_ConnectFile(ifc_mp4file *new_file)=0; +}; |