ijksdl_vout.h 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /*****************************************************************************
  2. * ijksdl_vout.h
  3. *****************************************************************************
  4. *
  5. * Copyright (c) 2013 Bilibili
  6. * copyright (c) 2013 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__IJKSDL_VOUT_H
  25. #define IJKSDL__IJKSDL_VOUT_H
  26. #include "ijksdl_stdinc.h"
  27. #include "ijksdl_class.h"
  28. #include "ijksdl_mutex.h"
  29. #include "ijksdl_video.h"
  30. #include "ffmpeg/ijksdl_inc_ffmpeg.h"
  31. typedef struct SDL_VoutOverlay_Opaque SDL_VoutOverlay_Opaque;
  32. typedef struct SDL_VoutOverlay SDL_VoutOverlay;
  33. struct SDL_VoutOverlay {
  34. int w; /**< Read-only */
  35. int h; /**< Read-only */
  36. Uint32 format; /**< Read-only */
  37. int planes; /**< Read-only */
  38. Uint16 *pitches; /**< in bytes, Read-only */
  39. Uint8 **pixels; /**< Read-write */
  40. int is_private;
  41. int sar_num;
  42. int sar_den;
  43. SDL_Class *opaque_class;
  44. SDL_VoutOverlay_Opaque *opaque;
  45. void (*free_l)(SDL_VoutOverlay *overlay);
  46. int (*lock)(SDL_VoutOverlay *overlay);
  47. int (*unlock)(SDL_VoutOverlay *overlay);
  48. void (*unref)(SDL_VoutOverlay *overlay);
  49. int (*func_fill_frame)(SDL_VoutOverlay *overlay, const AVFrame *frame);
  50. };
  51. typedef struct SDL_Vout_Opaque SDL_Vout_Opaque;
  52. typedef struct SDL_Vout SDL_Vout;
  53. struct SDL_Vout {
  54. SDL_mutex *mutex;
  55. SDL_Class *opaque_class;
  56. SDL_Vout_Opaque *opaque;
  57. SDL_VoutOverlay *(*create_overlay)(int width, int height, int frame_format, SDL_Vout *vout);
  58. void (*free_l)(SDL_Vout *vout);
  59. int (*display_overlay)(SDL_Vout *vout, SDL_VoutOverlay *overlay);
  60. Uint32 overlay_format;
  61. };
  62. void SDL_VoutFree(SDL_Vout *vout);
  63. void SDL_VoutFreeP(SDL_Vout **pvout);
  64. int SDL_VoutDisplayYUVOverlay(SDL_Vout *vout, SDL_VoutOverlay *overlay);
  65. int SDL_VoutSetOverlayFormat(SDL_Vout *vout, Uint32 overlay_format);
  66. SDL_VoutOverlay *SDL_Vout_CreateOverlay(int width, int height, int frame_format, SDL_Vout *vout);
  67. int SDL_VoutLockYUVOverlay(SDL_VoutOverlay *overlay);
  68. int SDL_VoutUnlockYUVOverlay(SDL_VoutOverlay *overlay);
  69. void SDL_VoutFreeYUVOverlay(SDL_VoutOverlay *overlay);
  70. void SDL_VoutUnrefYUVOverlay(SDL_VoutOverlay *overlay);
  71. int SDL_VoutFillFrameYUVOverlay(SDL_VoutOverlay *overlay, const AVFrame *frame);
  72. #endif