http_avi_reader.h 861 B

12345678910111213141516171819202122232425262728293031
  1. #pragma once
  2. #include "../nsavi/avi_reader.h"
  3. #include "../../..\Components\wac_network\wac_network_http_receiver_api.h"
  4. class AVIReaderHTTP : public nsavi::avi_reader
  5. {
  6. public:
  7. AVIReaderHTTP(HANDLE killswitch, HANDLE seek_event);
  8. int Open(const wchar_t *url);
  9. void Close();
  10. int Connect();
  11. int Buffer();
  12. /* avi_reader implementation */
  13. int Read(void *buffer, uint32_t read_length, uint32_t *bytes_read);
  14. int Peek(void *buffer, uint32_t read_length, uint32_t *bytes_read);
  15. //void OverlappedHint(uint32_t read_length);
  16. int Seek(uint64_t position);
  17. uint64_t Tell();
  18. int Skip(uint32_t skip_bytes);
  19. uint64_t GetContentLength();
  20. void GetFilename(wchar_t *fn, size_t len);
  21. private:
  22. /* internal methods */
  23. int Open(const char *url, uint64_t start_offset=0);
  24. private:
  25. api_httpreceiver *http;
  26. uint64_t position;
  27. bool seekable;
  28. HANDLE handles[2];
  29. };