3rdparty/licenseReport: Add seperate LGPL checks
[haiku.git] / src / add-ons / media / plugins / rtsp_streamer / RTSPMediaIO.h
blobee79dbddac3665f46f75497d7741a8f30e1bc794
1 /*
2 * Copyright 2016, Dario Casalinuovo. All rights reserved.
3 * Distributed under the terms of the MIT License.
4 */
5 #ifndef _RTSP_MEDIA_IO_H
6 #define _RTSP_MEDIA_IO_H
9 #include <AdapterIO.h>
10 #include <Url.h>
12 #include "rtsp.h"
15 class HaikuRTSPClient;
18 class RTSPMediaIO : public BAdapterIO
20 public:
21 RTSPMediaIO(BUrl ourUrl);
22 virtual ~RTSPMediaIO();
24 virtual ssize_t WriteAt(off_t position,
25 const void* buffer,
26 size_t size);
28 virtual status_t SetSize(off_t size);
30 virtual status_t Open();
32 void LoopThread();
33 void ShutdownLoop();
34 private:
35 static int32 _LoopThread(void* data);
37 BUrl fUrl;
39 HaikuRTSPClient* fClient;
40 UsageEnvironment* fEnv;
41 TaskScheduler* fScheduler;
43 char fLoopWatchVariable;
44 thread_id fLoopThread;
48 class HaikuRTSPClient : public RTSPClient
50 public:
51 HaikuRTSPClient(UsageEnvironment& env,
52 char const* rtspURL,
53 portNumBits tunnelOverHTTPPortNum,
54 RTSPMediaIO* fInputAdapter);
56 void Close();
58 BInputAdapter* GetInputAdapter() const;
60 status_t WaitForInit(bigtime_t timeout);
62 void NotifyError();
63 void NotifySucces();
65 protected:
67 virtual ~HaikuRTSPClient();
68 public:
69 MediaSubsessionIterator* iter;
70 MediaSession* session;
71 MediaSubsession* subsession;
72 TaskToken streamTimerTask;
73 double duration;
75 private:
76 RTSPMediaIO* fInterface;
78 port_id fInitPort;
81 #endif