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/Plugins/Input/in_flv/FLVReader.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/Plugins/Input/in_flv/FLVReader.h')
-rw-r--r-- | Src/Plugins/Input/in_flv/FLVReader.h | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/Src/Plugins/Input/in_flv/FLVReader.h b/Src/Plugins/Input/in_flv/FLVReader.h new file mode 100644 index 00000000..27e68183 --- /dev/null +++ b/Src/Plugins/Input/in_flv/FLVReader.h @@ -0,0 +1,49 @@ +#ifndef NULLSOFT_IN_FLV_FLVREADER_H +#define NULLSOFT_IN_FLV_FLVREADER_H + +#include <windows.h> +#include <bfc/platform/types.h> +#include "FLVStreamheader.h" +#include "../nu/AutoLock.h" +#include "BackgroundDownloader.h" +#include "FLVProcessor.h" + +class FLVReader : private Downloader::DownloadCallback +{ +public: + FLVReader(const wchar_t *_url); + ~FLVReader(); + + bool GetFrame(size_t frameIndex, FrameData &frameData); + bool GetPosition(int time_in_ms, size_t *frameIndex, bool needVideoKeyFrame); + uint64_t Seek(uint64_t position); + size_t Read(void *data, size_t bytes); + void Kill(); + void SignalKill(); + bool IsEOF(); + uint32_t GetMaxTimestamp(); + uint64_t GetProcessedPosition(); + bool IsStreaming(); + FLVHeader *GetHeader(); +private: + void ProcessFile(); + int OnConnect(api_httpreceiver *http); + int OnData(void *data, size_t datalen); + int Process(); + DWORD CALLBACK ParserThread(); + static DWORD CALLBACK ParserThreadStub(LPVOID param) { return ((FLVReader *)param)->ParserThread(); } + +private: + bool killswitch; + + HANDLE flvThread; + bool end_of_stream; + wchar_t *url; + + /* because we won't know until after opening the stream whether it's progressive download + or a real-time stream, we need have a pointer to a virtual base class to do the processing + we'll create a different one depending on what kind of stream */ + FLVProcessor *processor; +}; + +#endif
\ No newline at end of file |