vt_internal.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /*
  2. * This file is part of FFmpeg.
  3. *
  4. * FFmpeg is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU Lesser General Public
  6. * License as published by the Free Software Foundation; either
  7. * version 2.1 of the License, or (at your option) any later version.
  8. *
  9. * FFmpeg is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. * Lesser General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU Lesser General Public
  15. * License along with FFmpeg; if not, write to the Free Software
  16. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  17. */
  18. #ifndef AVCODEC_VT_INTERNAL_H
  19. #define AVCODEC_VT_INTERNAL_H
  20. typedef struct VTContext {
  21. // The current bitstream buffer.
  22. uint8_t *bitstream;
  23. // The current size of the bitstream.
  24. int bitstream_size;
  25. // The reference size used for fast reallocation.
  26. int allocated_size;
  27. // The core video buffer
  28. CVImageBufferRef frame;
  29. // Current dummy frames context (depends on exact CVImageBufferRef params).
  30. struct AVBufferRef *cached_hw_frames_ctx;
  31. // Non-NULL if the new hwaccel API is used. This is only a separate struct
  32. // to ease compatibility with the old API.
  33. struct AVVideotoolboxContext *vt_ctx;
  34. // Current H264 parameters (used to trigger decoder restart on SPS changes).
  35. uint8_t sps[3];
  36. bool reconfig_needed;
  37. } VTContext;
  38. int ff_videotoolbox_alloc_frame(AVCodecContext *avctx, AVFrame *frame);
  39. int ff_videotoolbox_uninit(AVCodecContext *avctx);
  40. int ff_videotoolbox_h264_start_frame(AVCodecContext *avctx,
  41. const uint8_t *buffer,
  42. uint32_t size);
  43. int ff_videotoolbox_h264_decode_slice(AVCodecContext *avctx,
  44. const uint8_t *buffer,
  45. uint32_t size);
  46. CFDataRef ff_videotoolbox_avcc_extradata_create(AVCodecContext *avctx);
  47. CFDataRef ff_videotoolbox_hvcc_extradata_create(AVCodecContext *avctx);
  48. #endif /* AVCODEC_VT_INTERNAL_H */