videoplayer.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #ifndef VIDEOPLAYER_H
  2. #define VIDEOPLAYER_H
  3. #pragma once
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7. #include "videoutil.h"
  8. #ifndef VIDEOPLAYER_FLAG_DOUBLESIZE
  9. #define VIDEOPLAYER_FLAG_DOUBLESIZE 0x01
  10. #endif
  11. #ifndef VIDEOPLAYER_FLAG_NOTIMER
  12. #define VIDEOPLAYER_FLAG_NOTIMER 0x02
  13. #endif
  14. #ifndef VIDEOPLAYER_FLAG_PUSH
  15. #define VIDEOPLAYER_FLAG_PUSH 0x04
  16. #endif
  17. #ifndef VIDEOPLAYER_FLAG_PULL
  18. #define VIDEOPLAYER_FLAG_PULL 0x08
  19. #endif
  20. #ifndef VIDEOPLAYER_FLAG_CHECKTOP
  21. #define VIDEOPLAYER_FLAG_CHECKTOP 0x10
  22. #endif
  23. #ifndef VIDEOPLAYER_FLAG_ZOOMOUTSIZE
  24. #define VIDEOPLAYER_FLAG_ZOOMOUTSIZE 0x100
  25. #endif
  26. typedef struct videoplayer_t videoplayer_t;
  27. typedef int (*videoplayer_on_pull)(videoplayer_t *player, void *user_data, video_frame **frame);
  28. typedef void (*videoplayer_free_frame)(videoplayer_t *player, void *user_data, video_frame *frame);
  29. // must call at ui thread
  30. int videoplayer_create(HWND hWndVideo,
  31. int x, int y, int cx, int cy,
  32. int fps_num,int fps_den,
  33. int width, int height,
  34. int flags,
  35. const char *name,
  36. videoplayer_on_pull on_pull,
  37. videoplayer_free_frame free_frame,
  38. void *user_data,
  39. videoplayer_t **p_player);
  40. // must call at ui thread
  41. void videoplayer_destroy(videoplayer_t *player);
  42. int videoplayer_queue_frame(videoplayer_t *player, video_frame *frame, videoplayer_free_frame free_frame, void *user_data);
  43. #ifdef __cplusplus
  44. }//extern "C" {
  45. #endif
  46. #endif // VIDEOPLAYER_H