diff options
author | Jef <jef@targetspot.com> | 2024-09-24 08:54:57 -0400 |
---|---|---|
committer | Jef <jef@targetspot.com> | 2024-09-24 08:54:57 -0400 |
commit | 20d28e80a5c861a9d5f449ea911ab75b4f37ad0d (patch) | |
tree | 12f17f78986871dd2cfb0a56e5e93b545c1ae0d0 /Src/libvp6/include/VPStreamData.hpp | |
parent | 537bcbc86291b32fc04ae4133ce4d7cac8ebe9a7 (diff) | |
download | winamp-20d28e80a5c861a9d5f449ea911ab75b4f37ad0d.tar.gz |
Initial community commit
Diffstat (limited to 'Src/libvp6/include/VPStreamData.hpp')
-rw-r--r-- | Src/libvp6/include/VPStreamData.hpp | 117 |
1 files changed, 117 insertions, 0 deletions
diff --git a/Src/libvp6/include/VPStreamData.hpp b/Src/libvp6/include/VPStreamData.hpp new file mode 100644 index 00000000..e1705020 --- /dev/null +++ b/Src/libvp6/include/VPStreamData.hpp @@ -0,0 +1,117 @@ +#if !defined(VPSTREAMDATA_HPP) +#define VPSTREAMDATA_HPP +//______________________________________________________________________________ +// +// VPStreamData.hpp +// + +//______________________________________________________________________________ +// Include Files and Forward Declarations + +#include "PlayerModel.hpp" +#include <vector> +#include <iosfwd> + +namespace on2vp +{ + +//______________________________________________________________________________ +// Macro, Enumeration, and Constant Definitions + +//______________________________________________________________________________ +// Type, Struct, and Class Definitions + + //-------------------------------------- + class StreamData + { + friend std::ostream& operator<<(std::ostream& os, const StreamData& sd); + + public: + + StreamData(); + StreamData(const unsigned char* const pData, unsigned long ulSize); + StreamData(const StreamData& sd); + ~StreamData(); + + StreamData& operator=(const StreamData& sd); + + unsigned long versionOrig() const; + unsigned long sizeOrig() const; + unsigned long version() const; + unsigned long size() const; + const unsigned char* data() const; + + int data(const unsigned char* pData, unsigned long ulSize); + + // Interpreted data + + const PlayerModel& playerModel() const; + PlayerModel& playerModel(); + + bool encrypted() const; + void encrypted(bool bEncrypted); + + private: + class VersionInfo + { + public: + VersionInfo(long lVersion, long lSize, bool bExtra) : + m_lVersion(lVersion), + m_lSize(lSize), + m_bExtra(bExtra) + { + } + + long version() const + { + return m_lVersion; + } + + long size() const + { + return m_lSize; + } + + bool extra() const + { + return m_bExtra; + } + + private: + long m_lVersion; + long m_lSize; + bool m_bExtra; + }; + + enum + { + VersionMax = 6 + }; + + void init_(); + int extract_(const unsigned char* pData, unsigned long ulSize); + void update_(); + + static std::vector<VersionInfo> m_vVersionInfo; + + unsigned long m_ulVersionOrig; + unsigned long m_ulSizeOrig; + + unsigned char* m_pData; + long m_lDataSize; + + // Interpreted data + + PlayerModel m_pm; + bool m_bEncrypted; + }; + +//______________________________________________________________________________ +// Object and Function Declarations + +//______________________________________________________________________________ +// Object and Function Definitions + +} // namespace on2vp + +#endif // VPSTREAMDATA_HPP |