ijksdl_codec_android_mediacodec_internal.h 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*****************************************************************************
  2. * ijksdl_codec_android_mediacodec_internal.h
  3. *****************************************************************************
  4. *
  5. * Copyright (c) 2014 Bilibili
  6. * copyright (c) 2014 Zhang Rui <bbcallen@gmail.com>
  7. *
  8. * This file is part of ijkPlayer.
  9. *
  10. * ijkPlayer is free software; you can redistribute it and/or
  11. * modify it under the terms of the GNU Lesser General Public
  12. * License as published by the Free Software Foundation; either
  13. * version 2.1 of the License, or (at your option) any later version.
  14. *
  15. * ijkPlayer is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  18. * Lesser General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU Lesser General Public
  21. * License along with ijkPlayer; if not, write to the Free Software
  22. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  23. */
  24. #ifndef IJKSDL_ANDROID__ANDROID_CODEC_ANDROID_MEDIACODEC_INTERNAL_H
  25. #define IJKSDL_ANDROID__ANDROID_CODEC_ANDROID_MEDIACODEC_INTERNAL_H
  26. #include "ijksdl_codec_android_mediacodec.h"
  27. SDL_AMediaCodec *SDL_AMediaCodec_CreateInternal(size_t opaque_size);
  28. void SDL_AMediaCodec_FreeInternal(SDL_AMediaCodec *acodec);
  29. #define FAKE_BUFFER_QUEUE_SIZE 5
  30. typedef struct SDL_AMediaCodec_FakeFrame {
  31. size_t index;
  32. SDL_AMediaCodecBufferInfo info;
  33. } SDL_AMediaCodec_FakeFrame;
  34. typedef struct SDL_AMediaCodec_FakeFifo {
  35. SDL_AMediaCodec_FakeFrame fakes[FAKE_BUFFER_QUEUE_SIZE];
  36. int begin;
  37. int end;
  38. int size;
  39. int should_abort;
  40. SDL_mutex *mutex;
  41. SDL_cond *wakeup_enqueue_cond;
  42. SDL_cond *wakeup_dequeue_cond;
  43. } SDL_AMediaCodec_FakeFifo;
  44. sdl_amedia_status_t SDL_AMediaCodec_FakeFifo_init(SDL_AMediaCodec_FakeFifo *fifo);
  45. void SDL_AMediaCodec_FakeFifo_abort(SDL_AMediaCodec_FakeFifo *fifo);
  46. void SDL_AMediaCodec_FakeFifo_destroy(SDL_AMediaCodec_FakeFifo *fifo);
  47. ssize_t SDL_AMediaCodec_FakeFifo_dequeueInputBuffer(SDL_AMediaCodec_FakeFifo* fifo, int64_t timeoutUs);
  48. sdl_amedia_status_t SDL_AMediaCodec_FakeFifo_queueInputBuffer(SDL_AMediaCodec_FakeFifo *fifo, size_t idx, off_t offset, size_t size, uint64_t time, uint32_t flags);
  49. ssize_t SDL_AMediaCodec_FakeFifo_dequeueOutputBuffer(SDL_AMediaCodec_FakeFifo *fifo, SDL_AMediaCodecBufferInfo *info, int64_t timeoutUs);
  50. void SDL_AMediaCodec_FakeFifo_flush(SDL_AMediaCodec_FakeFifo *fifo);
  51. int SDL_AMediaCodec_FakeFifo_size(SDL_AMediaCodec_FakeFifo *fifo);
  52. #endif