aboutsummaryrefslogtreecommitdiff
path: root/Src/h264/h264_mp4_decoder.h
diff options
context:
space:
mode:
authorJean-Francois Mauguit <jfmauguit@mac.com>2024-09-24 09:03:25 -0400
committerGitHub <noreply@github.com>2024-09-24 09:03:25 -0400
commitbab614c421ed7ae329d26bf028c4a3b1d2450f5a (patch)
tree12f17f78986871dd2cfb0a56e5e93b545c1ae0d0 /Src/h264/h264_mp4_decoder.h
parent4bde6044fddf053f31795b9eaccdd2a5a527d21f (diff)
parent20d28e80a5c861a9d5f449ea911ab75b4f37ad0d (diff)
downloadwinamp-bab614c421ed7ae329d26bf028c4a3b1d2450f5a.tar.gz
Merge pull request #5 from WinampDesktop/community
Merge to main
Diffstat (limited to 'Src/h264/h264_mp4_decoder.h')
-rw-r--r--Src/h264/h264_mp4_decoder.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/Src/h264/h264_mp4_decoder.h b/Src/h264/h264_mp4_decoder.h
new file mode 100644
index 00000000..81f04b81
--- /dev/null
+++ b/Src/h264/h264_mp4_decoder.h
@@ -0,0 +1,37 @@
+#pragma once
+#include "../Plugins/Input/in_mp4/mpeg4video.h"
+#include "MFTDecoder.h"
+#include <vector>
+
+// {F13CB206-E8F2-4353-B8B9-587D02CB701C}
+static const GUID mp4_h264_guid =
+{ 0xf13cb206, 0xe8f2, 0x4353, { 0xb8, 0xb9, 0x58, 0x7d, 0x2, 0xcb, 0x70, 0x1c } };
+
+class H264MP4Decoder : public MP4VideoDecoder
+{
+public:
+ static const char *getServiceName() { return "H.264 MP4 Decoder"; }
+ static GUID getServiceGuid() { return mp4_h264_guid; }
+ H264MP4Decoder();
+ ~H264MP4Decoder();
+
+private:
+ /* mpeg4video interface */
+ int Open(MP4FileHandle mp4_file, MP4TrackId mp4_track);
+ int GetOutputFormat(int *x, int *y, int *color_format, double *aspect_ratio);
+ int DecodeSample(const void *inputBuffer, size_t inputBufferBytes, MP4Timestamp timestamp);
+ void Flush();
+ void Close();
+ int CanHandleCodec(const char *codecName);
+ int GetPicture(void **data, void **decoder_data, MP4Timestamp *timestamp);
+ void FreePicture(void *data, void *decoder_data);
+ void HurryUp(int state);
+ MFTDecoder decoder;
+ uint32_t nalu_size_bytes;
+ UINT width, height;
+ MP4FileHandle mp4_file;
+ MP4TrackId mp4_track;
+ std::vector<nullsoft_h264_frame_data> buffered_frames;
+protected:
+ RECVS_DISPATCH;
+}; \ No newline at end of file