1
0

HTTPPlayback.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. #pragma once
  2. #include "nx/nxonce.h"
  3. #include "jnetlib/jnetlib.h"
  4. #include "http/ifc_http_demuxer.h"
  5. #include "http/ifc_http.h"
  6. #include "nswasabi/PlaybackBase.h"
  7. class HTTPPlayback : public PlaybackBase, public ifc_http
  8. {
  9. public:
  10. HTTPPlayback();
  11. ~HTTPPlayback();
  12. int Initialize(nx_uri_t url, ifc_player *player);
  13. /* ifc_http implementation */
  14. int WASABICALL HTTP_Wake(int mask);
  15. int WASABICALL HTTP_Check(int mask);
  16. int WASABICALL HTTP_Wait(unsigned int milliseconds, int mask);
  17. int WASABICALL HTTP_Sleep(int milliseconds, int mask);
  18. Agave_Seek *WASABICALL HTTP_GetSeek();
  19. void WASABICALL HTTP_FreeSeek(Agave_Seek *seek);
  20. int WASABICALL HTTP_Seek(uint64_t byte_position);
  21. int WASABICALL HTTP_Seekable();
  22. int WASABICALL HTTP_AudioOpen(const ifc_audioout::Parameters *format, ifc_audioout **out_output);
  23. private:
  24. int Internal_Connect(uint64_t byte_position);
  25. ifc_http_demuxer *demuxer;
  26. volatile int paused;
  27. volatile int stopped;
  28. jnl_http_t http;
  29. int Init();
  30. nx_thread_return_t NXTHREADCALL DecodeLoop();
  31. static nx_thread_return_t NXTHREADCALL HTTPPlayerThreadFunction(nx_thread_parameter_t param);
  32. };