HTTPPlaybackService.cpp 756 B

12345678910111213141516171819202122232425262728
  1. #include "HTTPPlaybackService.h"
  2. #include "player/ifc_player.h"
  3. #include "player/ifc_playback.h"
  4. #include "HTTPPlayback.h"
  5. #include "nx/nxpath.h"
  6. #include "nswasabi/ReferenceCounted.h"
  7. int HTTPPlaybackService::PlaybackService_CreatePlayback(unsigned int pass, nx_uri_t filename, ifc_player *player, ifc_playback **out_playback_object)
  8. {
  9. if (NXPathProtocol(filename, "http") == NErr_Success)
  10. {
  11. HTTPPlayback *http_playback = new ReferenceCounted<HTTPPlayback>;
  12. if (!http_playback)
  13. return NErr_OutOfMemory;
  14. int ret = http_playback->Initialize(filename, player);
  15. if (ret != NErr_Success)
  16. {
  17. http_playback->ifc_playback::Release();
  18. return ret;
  19. }
  20. *out_playback_object = http_playback;
  21. return NErr_Success;
  22. }
  23. return NErr_False;
  24. }