SkyWay Linux SDK
読み取り中…
検索中…
一致する文字列を見つけられません
local_data_stream.hpp
1#ifndef SKYWAY_MEDIA_STREAM_LOCAL_LOCAL_DATA_STREAM_HPP_
2#define SKYWAY_MEDIA_STREAM_LOCAL_LOCAL_DATA_STREAM_HPP_
3
4#include <mutex>
5
6#include <skyway/core/stream/local/data_stream.hpp>
7
8#include "skyway/media/stream/abstract/stream_base.hpp"
9#include "skyway/media/stream/interface/local/local_data_stream.hpp"
10
11namespace skyway {
12namespace media {
13namespace stream {
14namespace local {
15
16class LocalDataStream : public abstract::StreamBase<interface::local::LocalDataStream,
17 skyway::core::interface::LocalStream,
18 skyway::core::stream::local::LocalDataStream> {
19public:
22 LocalDataStream(std::shared_ptr<skyway::core::stream::local::LocalDataStream> core);
24 ~LocalDataStream() override;
25
26 bool Write(const std::string& data) const override;
27 bool Write(const uint8_t* data, size_t length) const override;
28
30 void RemoveListener() override;
31
32private:
33 class CoreEventListenerAdapter : public skyway::core::stream::local::LocalDataStream::Listener {
34 public:
35 explicit CoreEventListenerAdapter(interface::local::LocalDataStream::Listener* listener);
36 void OnWritable(
37 const skyway::core::stream::local::DataStreamSubscriber& subscriber) override;
38 void OnUnwritable(
39 const skyway::core::stream::local::DataStreamSubscriber& subscriber) override;
40
41 private:
43 };
44
45 std::mutex listener_adapter_mtx_;
46 std::shared_ptr<CoreEventListenerAdapter> listener_adapter_;
47};
48
49} // namespace local
50} // namespace stream
51} // namespace media
52} // namespace skyway
53
54#endif // SKYWAY_MEDIA_STREAM_LOCAL_LOCAL_DATA_STREAM_HPP_
Definition stream_base.hpp:15
データ送信可否イベントリスナ
Definition local_data_stream.hpp:28
Definition local_data_stream.hpp:18
bool Write(const std::string &data) const override
文字列を送信します。
void RemoveListener() override
イベントリスナーの登録を解除します。
bool Write(const uint8_t *data, size_t length) const override
バイト列を送信します。
void AddListener(interface::local::LocalDataStream::Listener *listener) override
LocalDataStream::Listenerを登録します。