ijksdl_codec_android_mediaformat.c 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*****************************************************************************
  2. * ijksdl_codec_android_mediaformat.c
  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. #include "ijksdl_codec_android_mediaformat.h"
  25. #include <assert.h>
  26. // FIXME: release SDL_AMediaFormat
  27. sdl_amedia_status_t SDL_AMediaFormat_delete(SDL_AMediaFormat* aformat)
  28. {
  29. if (!aformat)
  30. return SDL_AMEDIA_OK;
  31. assert(aformat->func_delete);
  32. return aformat->func_delete(aformat);
  33. }
  34. sdl_amedia_status_t SDL_AMediaFormat_deleteP(SDL_AMediaFormat** aformat)
  35. {
  36. if (!aformat)
  37. return SDL_AMEDIA_OK;
  38. sdl_amedia_status_t amc_ret = SDL_AMediaFormat_delete(*aformat);
  39. *aformat = NULL;
  40. return amc_ret;
  41. }
  42. bool SDL_AMediaFormat_getInt32(SDL_AMediaFormat* aformat, const char* name, int32_t *out)
  43. {
  44. assert(aformat->func_getInt32);
  45. return aformat->func_getInt32(aformat, name, out);
  46. }
  47. void SDL_AMediaFormat_setInt32(SDL_AMediaFormat* aformat, const char* name, int32_t value)
  48. {
  49. assert(aformat->func_setInt32);
  50. aformat->func_setInt32(aformat, name, value);
  51. }
  52. void SDL_AMediaFormat_setBuffer(SDL_AMediaFormat* aformat, const char* name, void* data, size_t size)
  53. {
  54. assert(aformat->func_setInt32);
  55. aformat->func_setBuffer(aformat, name, data, size);
  56. }