vp9_frame_buffers.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*
  2. * Copyright (c) 2014 The WebM project authors. All Rights Reserved.
  3. *
  4. * Use of this source code is governed by a BSD-style license
  5. * that can be found in the LICENSE file in the root of the source
  6. * tree. An additional intellectual property rights grant can be found
  7. * in the file PATENTS. All contributing project authors may
  8. * be found in the AUTHORS file in the root of the source tree.
  9. */
  10. #ifndef VP9_COMMON_VP9_FRAME_BUFFERS_H_
  11. #define VP9_COMMON_VP9_FRAME_BUFFERS_H_
  12. #include "vpx/vpx_frame_buffer.h"
  13. #include "vpx/vpx_integer.h"
  14. #ifdef __cplusplus
  15. extern "C" {
  16. #endif
  17. typedef struct InternalFrameBuffer {
  18. uint8_t *data;
  19. size_t size;
  20. int in_use;
  21. } InternalFrameBuffer;
  22. typedef struct InternalFrameBufferList {
  23. int num_internal_frame_buffers;
  24. InternalFrameBuffer *int_fb;
  25. } InternalFrameBufferList;
  26. // Initializes |list|. Returns 0 on success.
  27. int vp9_alloc_internal_frame_buffers(InternalFrameBufferList *list);
  28. // Free any data allocated to the frame buffers.
  29. void vp9_free_internal_frame_buffers(InternalFrameBufferList *list);
  30. // Callback used by libvpx to request an external frame buffer. |cb_priv|
  31. // Callback private data, which points to an InternalFrameBufferList.
  32. // |min_size| is the minimum size in bytes needed to decode the next frame.
  33. // |fb| pointer to the frame buffer.
  34. int vp9_get_frame_buffer(void *cb_priv, size_t min_size,
  35. vpx_codec_frame_buffer_t *fb);
  36. // Callback used by libvpx when there are no references to the frame buffer.
  37. // |cb_priv| is not used. |fb| pointer to the frame buffer.
  38. int vp9_release_frame_buffer(void *cb_priv, vpx_codec_frame_buffer_t *fb);
  39. #ifdef __cplusplus
  40. } // extern "C"
  41. #endif
  42. #endif // VP9_COMMON_VP9_FRAME_BUFFERS_H_