Haxe Lib Datachannel

This commit is contained in:
2026-10-04 17:14:28 -07:00
parent 860b73a8f4
commit 9fee67d231
164 changed files with 61432 additions and 0 deletions

View File

@ -0,0 +1,70 @@
/**
* 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"
#include <vector>
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 sendFrame(binary data, FrameInfo info);
void sendFrame(const byte *data, size_t size, FrameInfo info);
void onFrame(std::function<void(binary data, FrameInfo info)> callback);
bool requestKeyframe(SSRC ssrc=0, bool retransmit=false);
bool requestKeyframe(const std::vector<SSRC>& targetSSRCs, bool retransmit=false);
bool requestBitrate(unsigned int bitrate);
bool sendRtcpApp(uint32_t ssrc, const RtcpAppName &name, uint8_t subtype,
const binary &data = binary{});
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