forked from paullouisageneau/libdatachannel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtrack.hpp
63 lines (45 loc) · 1.6 KB
/
track.hpp
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/**
* Copyright (c) 2020 Paul-Louis Ageneau
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
#ifndef RTC_TRACK_H
#define RTC_TRACK_H
#include "channel.hpp"
#include "common.hpp"
#include "description.hpp"
#include "mediahandler.hpp"
namespace rtc {
namespace impl {
class Track;
} // namespace impl
class RTC_CPP_EXPORT Track final : private CheshireCat<impl::Track>, public Channel {
public:
Track(impl_ptr<impl::Track> impl);
~Track() override;
string mid() const;
Description::Direction direction() const;
Description::Media description() const;
void setDescription(Description::Media description);
void close(void) override;
bool send(message_variant data) override;
bool send(const byte *data, size_t size) override;
bool isOpen(void) const override;
bool isClosed(void) const override;
size_t maxMessageSize() const override;
void onFrame(std::function<void(binary data, FrameInfo frame)> callback);
bool requestKeyframe();
bool requestBitrate(unsigned int bitrate);
void setMediaHandler(shared_ptr<MediaHandler> handler);
void chainMediaHandler(shared_ptr<MediaHandler> handler);
shared_ptr<MediaHandler> getMediaHandler();
// Deprecated, use setMediaHandler() and getMediaHandler()
inline void setRtcpHandler(shared_ptr<MediaHandler> handler) { setMediaHandler(handler); }
inline shared_ptr<MediaHandler> getRtcpHandler() { return getMediaHandler(); }
private:
using CheshireCat<impl::Track>::impl;
};
} // namespace rtc
#endif