-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstream_puller.hh
39 lines (32 loc) · 1000 Bytes
/
stream_puller.hh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#ifndef STREAM_PULLER_HH
#define STREAM_PULLER_HH
#include "media_capture/camera_capture.hh"
#include "utils/blocking_queue.hh"
#include <string>
#include <boost/thread.hpp>
#include <QObject>
#include "media_capture/frame.hh"
#include "header.hh"
class StreamPullerListener {
public:
virtual void OnPullFrame(const std::string& user_id, MediaType media_type, std::shared_ptr<AVFRAME> frame) = 0;
};
class StreamPuller :
public QObject {
Q_OBJECT
public:
StreamPuller(const std::string& stream_id, const std::string& ip, int port, const std::string& user_id, MediaType media_type);
~StreamPuller();
int CodecFrameFromServer();
void RegisterListener(StreamPullerListener* listener);
void UnRegisterListener(StreamPullerListener* listener);
private:
std::string stream_id_;
std::string ip_;
int port_;
std::string user_id_;
MediaType media_type_;
std::unique_ptr<boost::thread> codec_thread_;
StreamPullerListener* listener_ = nullptr;
};
#endif // STREAM_PUSHER_HH