DRMInfo.hpp 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. #if !defined(DRMINFO_HPP)
  2. #define DRMINFO_HPP
  3. //______________________________________________________________________________
  4. //
  5. // DRMInfo.hpp
  6. //
  7. //______________________________________________________________________________
  8. // Include Files and Forward Declarations
  9. #include <string>
  10. #include <exception>
  11. #include <iosfwd>
  12. #include "FourCC.hpp"
  13. namespace on2vp
  14. {
  15. //______________________________________________________________________________
  16. // Macro, Enumeration, and Constant Definitions
  17. //______________________________________________________________________________
  18. // Type, Struct, and Class Definitions
  19. //--------------------------------------
  20. class DRMInfo
  21. {
  22. friend std::ostream& operator<<(std::ostream& os, const DRMInfo& drmi);
  23. public:
  24. class Exception : public std::exception
  25. {
  26. public:
  27. Exception(const std::string& strText);
  28. ~Exception() throw();
  29. const char* what() const throw();
  30. private:
  31. std::string m_strText;
  32. };
  33. DRMInfo();
  34. DRMInfo(const DRMInfo& drmi);
  35. ~DRMInfo();
  36. DRMInfo& operator=(const DRMInfo& drmi);
  37. const FourCC scheme() const;
  38. long scope() const;
  39. long amount() const;
  40. const unsigned char* data() const;
  41. long dataSize() const;
  42. const unsigned char* drmx() const;
  43. long drmxSize() const;
  44. void scheme(FourCC fccScheme);
  45. void scope(long lScope);
  46. void amount(long lAmount);
  47. void data(const unsigned char* pData, long lDataSize);
  48. void init(FourCC fccScheme, long lScope, long lAmount, const unsigned char* pData, long lDataSize);
  49. void drmx(const unsigned char* pDRMX, long lDRMXSize);
  50. private:
  51. enum
  52. {
  53. DRMXHeaderSize = 16
  54. };
  55. FourCC m_fccScheme;
  56. long m_lScope;
  57. long m_lAmount;
  58. unsigned char* m_pData;
  59. long m_lDataSize;
  60. mutable unsigned char* m_pDRMX;
  61. long m_lDRMXSize;
  62. };
  63. //______________________________________________________________________________
  64. // Object and Function Declarations
  65. //______________________________________________________________________________
  66. // Object and Function Definitions
  67. } // namespace on2vp
  68. #endif // DRMINFO_HPP