videotoolbox.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /*
  2. * Videotoolbox hardware acceleration
  3. *
  4. * copyright (c) 2012 Sebastien Zwickert
  5. *
  6. * This file is part of FFmpeg.
  7. *
  8. * FFmpeg 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. * FFmpeg 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 FFmpeg; if not, write to the Free Software
  20. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  21. */
  22. #ifndef AVCODEC_VIDEOTOOLBOX_H
  23. #define AVCODEC_VIDEOTOOLBOX_H
  24. /**
  25. * @file
  26. * @ingroup lavc_codec_hwaccel_videotoolbox
  27. * Public libavcodec Videotoolbox header.
  28. */
  29. /**
  30. * @defgroup lavc_codec_hwaccel_videotoolbox VideoToolbox Decoder
  31. * @ingroup lavc_codec_hwaccel
  32. *
  33. * Hardware accelerated decoding using VideoToolbox on Apple Platforms
  34. *
  35. * @{
  36. */
  37. #include <stdint.h>
  38. #define Picture QuickdrawPicture
  39. #include <VideoToolbox/VideoToolbox.h>
  40. #undef Picture
  41. #include "libavcodec/avcodec.h"
  42. #include "libavutil/attributes.h"
  43. /**
  44. * This struct holds all the information that needs to be passed
  45. * between the caller and libavcodec for initializing Videotoolbox decoding.
  46. * Its size is not a part of the public ABI, it must be allocated with
  47. * av_videotoolbox_alloc_context() and freed with av_free().
  48. */
  49. typedef struct AVVideotoolboxContext {
  50. /**
  51. * Videotoolbox decompression session object.
  52. */
  53. VTDecompressionSessionRef session;
  54. /**
  55. * CVPixelBuffer Format Type that Videotoolbox will use for decoded frames.
  56. * set by the caller. If this is set to 0, then no specific format is
  57. * requested from the decoder, and its native format is output.
  58. */
  59. OSType cv_pix_fmt_type;
  60. /**
  61. * CoreMedia Format Description that Videotoolbox will use to create the decompression session.
  62. */
  63. CMVideoFormatDescriptionRef cm_fmt_desc;
  64. /**
  65. * CoreMedia codec type that Videotoolbox will use to create the decompression session.
  66. */
  67. int cm_codec_type;
  68. } AVVideotoolboxContext;
  69. /**
  70. * @}
  71. */
  72. #endif /* AVCODEC_VIDEOTOOLBOX_H */