You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

143 lines
3.3KB

  1. /*
  2. * VDA HW acceleration
  3. *
  4. * copyright (c) 2011 Sebastien Zwickert
  5. *
  6. * This file is part of Libav.
  7. *
  8. * Libav is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU Lesser General Public
  10. * License as published by the Free Software Foundation; either
  11. * version 2.1 of the License, or (at your option) any later version.
  12. *
  13. * Libav is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. * Lesser General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU Lesser General Public
  19. * License along with Libav; if not, write to the Free Software
  20. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  21. */
  22. #ifndef AVCODEC_VDA_H
  23. #define AVCODEC_VDA_H
  24. /**
  25. * @file
  26. * @ingroup lavc_codec_hwaccel_vda
  27. * Public libavcodec VDA header.
  28. */
  29. #include "libavcodec/version.h"
  30. #include <stdint.h>
  31. // emmintrin.h is unable to compile with -std=c99 -Werror=missing-prototypes
  32. // http://openradar.appspot.com/8026390
  33. #undef __GNUC_STDC_INLINE__
  34. #define Picture QuickdrawPicture
  35. #include <VideoDecodeAcceleration/VDADecoder.h>
  36. #undef Picture
  37. /**
  38. * @defgroup lavc_codec_hwaccel_vda VDA
  39. * @ingroup lavc_codec_hwaccel
  40. *
  41. * @{
  42. */
  43. /**
  44. * This structure is used to provide the necessary configurations and data
  45. * to the VDA Libav HWAccel implementation.
  46. *
  47. * The application must make it available as AVCodecContext.hwaccel_context.
  48. */
  49. struct vda_context {
  50. /**
  51. * VDA decoder object.
  52. *
  53. * - encoding: unused
  54. * - decoding: Set/Unset by libavcodec.
  55. */
  56. VDADecoder decoder;
  57. /**
  58. * The Core Video pixel buffer that contains the current image data.
  59. *
  60. * encoding: unused
  61. * decoding: Set by libavcodec. Unset by user.
  62. */
  63. CVPixelBufferRef cv_buffer;
  64. /**
  65. * Use the hardware decoder in synchronous mode.
  66. *
  67. * encoding: unused
  68. * decoding: Set by user.
  69. */
  70. int use_sync_decoding;
  71. /**
  72. * The frame width.
  73. *
  74. * - encoding: unused
  75. * - decoding: Set/Unset by user.
  76. */
  77. int width;
  78. /**
  79. * The frame height.
  80. *
  81. * - encoding: unused
  82. * - decoding: Set/Unset by user.
  83. */
  84. int height;
  85. /**
  86. * The frame format.
  87. *
  88. * - encoding: unused
  89. * - decoding: Set/Unset by user.
  90. */
  91. int format;
  92. /**
  93. * The pixel format for output image buffers.
  94. *
  95. * - encoding: unused
  96. * - decoding: Set/Unset by user.
  97. */
  98. OSType cv_pix_fmt_type;
  99. /**
  100. * The current bitstream buffer.
  101. */
  102. uint8_t *priv_bitstream;
  103. /**
  104. * The current size of the bitstream.
  105. */
  106. int priv_bitstream_size;
  107. /**
  108. * The reference size used for fast reallocation.
  109. */
  110. int priv_allocated_size;
  111. };
  112. /** Create the video decoder. */
  113. int ff_vda_create_decoder(struct vda_context *vda_ctx,
  114. uint8_t *extradata,
  115. int extradata_size);
  116. /** Destroy the video decoder. */
  117. int ff_vda_destroy_decoder(struct vda_context *vda_ctx);
  118. /**
  119. * @}
  120. */
  121. #endif /* AVCODEC_VDA_H */