aboutsummaryrefslogtreecommitdiff
path: root/Src/h264/h264_mp4_decoder.h
diff options
context:
space:
mode:
authorJef <jef@targetspot.com>2024-09-24 08:54:57 -0400
committerJef <jef@targetspot.com>2024-09-24 08:54:57 -0400
commit20d28e80a5c861a9d5f449ea911ab75b4f37ad0d (patch)
tree12f17f78986871dd2cfb0a56e5e93b545c1ae0d0 /Src/h264/h264_mp4_decoder.h
parent537bcbc86291b32fc04ae4133ce4d7cac8ebe9a7 (diff)
downloadwinamp-20d28e80a5c861a9d5f449ea911ab75b4f37ad0d.tar.gz
Initial community commit
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