playback.h 711 B

1234567891011121314151617181920
  1. #ifndef PLAYBACK_H
  2. #define PLAYBACK_H
  3. #include "common.h"
  4. #include "isup_sdk.h"
  5. typedef enum { PB_STOPPED=0, PB_PLAYING, PB_PAUSED, PB_FINISHED } PlayState;
  6. typedef struct {
  7. int used; int id; int channel; char file[256];
  8. PlayState state; int64_t begin_ms,end_ms,cur_ms;
  9. uint64_t bytes_sent; void*sdk_handle; pthread_mutex_t lock;
  10. } PlaybackSession;
  11. int playback_init(void);
  12. int playback_start_listen(void);
  13. int playback_stop_listen(void);
  14. int playback_start(int channel,const char*file,int64_t begin,int64_t end,int*out_id);
  15. int playback_pause(int id);
  16. int playback_resume(int id);
  17. int playback_stop(int id);
  18. PlaybackSession* playback_get_session(int id);
  19. void playback_cleanup(void);
  20. #endif