Plane.h 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. //
  2. // Notice Regarding Standards. AMD does not provide a license or sublicense to
  3. // any Intellectual Property Rights relating to any standards, including but not
  4. // limited to any audio and/or video codec technologies such as MPEG-2, MPEG-4;
  5. // AVC/H.264; HEVC/H.265; AAC decode/FFMPEG; AAC encode/FFMPEG; VC-1; and MP3
  6. // (collectively, the "Media Technologies"). For clarity, you will pay any
  7. // royalties due for such third party technologies, which may include the Media
  8. // Technologies that are owed as a result of AMD providing the Software to you.
  9. //
  10. // MIT license
  11. //
  12. // Copyright (c) 2018 Advanced Micro Devices, Inc. All rights reserved.
  13. //
  14. // Permission is hereby granted, free of charge, to any person obtaining a copy
  15. // of this software and associated documentation files (the "Software"), to deal
  16. // in the Software without restriction, including without limitation the rights
  17. // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  18. // copies of the Software, and to permit persons to whom the Software is
  19. // furnished to do so, subject to the following conditions:
  20. //
  21. // The above copyright notice and this permission notice shall be included in
  22. // all copies or substantial portions of the Software.
  23. //
  24. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  25. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  26. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  27. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  28. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  29. // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  30. // THE SOFTWARE.
  31. //
  32. #ifndef AMF_Plane_h
  33. #define AMF_Plane_h
  34. #pragma once
  35. #include "Interface.h"
  36. #if defined(__cplusplus)
  37. namespace amf
  38. {
  39. #endif
  40. //---------------------------------------------------------------------------------------------
  41. typedef enum AMF_PLANE_TYPE
  42. {
  43. AMF_PLANE_UNKNOWN = 0,
  44. AMF_PLANE_PACKED = 1, // for all packed formats: BGRA, YUY2, etc
  45. AMF_PLANE_Y = 2,
  46. AMF_PLANE_UV = 3,
  47. AMF_PLANE_U = 4,
  48. AMF_PLANE_V = 5,
  49. } AMF_PLANE_TYPE;
  50. //---------------------------------------------------------------------------------------------
  51. // AMFPlane interface
  52. //---------------------------------------------------------------------------------------------
  53. #if defined(__cplusplus)
  54. class AMF_NO_VTABLE AMFPlane : public AMFInterface
  55. {
  56. public:
  57. AMF_DECLARE_IID(0xbede1aa6, 0xd8fa, 0x4625, 0x94, 0x65, 0x6c, 0x82, 0xc4, 0x37, 0x71, 0x2e)
  58. virtual AMF_PLANE_TYPE AMF_STD_CALL GetType() = 0;
  59. virtual void* AMF_STD_CALL GetNative() = 0;
  60. virtual amf_int32 AMF_STD_CALL GetPixelSizeInBytes() = 0;
  61. virtual amf_int32 AMF_STD_CALL GetOffsetX() = 0;
  62. virtual amf_int32 AMF_STD_CALL GetOffsetY() = 0;
  63. virtual amf_int32 AMF_STD_CALL GetWidth() = 0;
  64. virtual amf_int32 AMF_STD_CALL GetHeight() = 0;
  65. virtual amf_int32 AMF_STD_CALL GetHPitch() = 0;
  66. virtual amf_int32 AMF_STD_CALL GetVPitch() = 0;
  67. virtual bool AMF_STD_CALL IsTiled() = 0;
  68. };
  69. //----------------------------------------------------------------------------------------------
  70. // smart pointer
  71. //----------------------------------------------------------------------------------------------
  72. typedef AMFInterfacePtr_T<AMFPlane> AMFPlanePtr;
  73. //----------------------------------------------------------------------------------------------
  74. #else // #if defined(__cplusplus)
  75. AMF_DECLARE_IID(AMFPlane, 0xbede1aa6, 0xd8fa, 0x4625, 0x94, 0x65, 0x6c, 0x82, 0xc4, 0x37, 0x71, 0x2e)
  76. typedef struct AMFPlane AMFPlane;
  77. typedef struct AMFPlaneVtbl
  78. {
  79. // AMFInterface interface
  80. amf_long (AMF_STD_CALL *Acquire)(AMFPlane* pThis);
  81. amf_long (AMF_STD_CALL *Release)(AMFPlane* pThis);
  82. enum AMF_RESULT (AMF_STD_CALL *QueryInterface)(AMFPlane* pThis, const struct AMFGuid *interfaceID, void** ppInterface);
  83. // AMFPlane interface
  84. AMF_PLANE_TYPE (AMF_STD_CALL *GetType)(AMFPlane* pThis);
  85. void* (AMF_STD_CALL *GetNative)(AMFPlane* pThis);
  86. amf_int32 (AMF_STD_CALL *GetPixelSizeInBytes)(AMFPlane* pThis);
  87. amf_int32 (AMF_STD_CALL *GetOffsetX)(AMFPlane* pThis);
  88. amf_int32 (AMF_STD_CALL *GetOffsetY)(AMFPlane* pThis);
  89. amf_int32 (AMF_STD_CALL *GetWidth)(AMFPlane* pThis);
  90. amf_int32 (AMF_STD_CALL *GetHeight)(AMFPlane* pThis);
  91. amf_int32 (AMF_STD_CALL *GetHPitch)(AMFPlane* pThis);
  92. amf_int32 (AMF_STD_CALL *GetVPitch)(AMFPlane* pThis);
  93. amf_bool (AMF_STD_CALL *IsTiled)(AMFPlane* pThis);
  94. } AMFPlaneVtbl;
  95. struct AMFPlane
  96. {
  97. const AMFPlaneVtbl *pVtbl;
  98. };
  99. #endif // #if defined(__cplusplus)
  100. #if defined(__cplusplus)
  101. } // namespace amf
  102. #endif
  103. #endif //#ifndef AMF_Plane_h