From 1554218bb0407e67a945f4fc9fc30686e34732f1 Mon Sep 17 00:00:00 2001 From: voluntas Date: Fri, 16 Nov 2018 18:30:24 +0900 Subject: [PATCH 1/8] =?UTF-8?q?=E3=82=B5=E3=83=96=E3=83=A2=E3=82=B8?= =?UTF-8?q?=E3=83=A5=E3=83=BC=E3=83=AB=E3=81=8B=E3=82=89=20websocketpp=20?= =?UTF-8?q?=E3=81=A8=20civetweb=20=E3=82=92=E5=89=8A=E9=99=A4=E3=81=99?= =?UTF-8?q?=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/DEV.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/doc/DEV.md b/doc/DEV.md index fa11a158..b5b07e39 100644 --- a/doc/DEV.md +++ b/doc/DEV.md @@ -24,7 +24,5 @@ $ make armv8 BUILD_MODE=pkg ``` $ git submodule status da901cca542612a133efcb04e8e78080186991e4 libs/CLI11 (v1.6.1-8-gda901cc) - 0f1b43536d97d9311c73b658b86a9d44be9e5e82 libs/civetweb (v1.10) d2dd27dc3b8472dbaa7d66f83619b3ebcd9185fe libs/json (v3.1.2) - c6d7e295bf5a0ab9b5f896720cc1a0e0fdc397a7 libs/websocketpp (0.3.0-395-gc6d7e29) ``` From 546b028ab6bfd18f94bdf6fc7a265f9e75d07054 Mon Sep 17 00:00:00 2001 From: Yoshida Hiroshi Date: Fri, 16 Nov 2018 16:17:44 +0900 Subject: [PATCH 2/8] =?UTF-8?q?=E8=A7=A3=E5=83=8F=E5=BA=A6=E3=82=92?= =?UTF-8?q?=E5=9B=BA=E5=AE=9A=E3=81=99=E3=82=8B=E3=82=AA=E3=83=97=E3=82=B7?= =?UTF-8?q?=E3=83=A7=E3=83=B3=E3=82=92=E8=BF=BD=E5=8A=A0=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/connection_settings.h | 2 ++ src/main.cpp | 1 + src/rtc/manager.cpp | 4 ++++ 3 files changed, 7 insertions(+) diff --git a/src/connection_settings.h b/src/connection_settings.h index 04dbddae..701b0e32 100644 --- a/src/connection_settings.h +++ b/src/connection_settings.h @@ -17,6 +17,7 @@ struct ConnectionSettings int audio_bitrate = 0; std::string resolution = "VGA"; int framerate = 0; + bool fixed_resolution = false; std::string priority = "BALANCE"; std::string sora_signaling_host = "wss://example.com/signaling"; @@ -72,6 +73,7 @@ struct ConnectionSettings os << "audio_bitrate: " << cs.audio_bitrate << "\n"; os << "resolution: " << cs.resolution << "\n"; os << "framerate: " << cs.framerate << "\n"; + os << "fixed_resolution: " << (cs.fixed_resolution ? "true" : "false") << "\n"; os << "priority: " << cs.priority << "\n"; os << "sora_signaling_host: " << cs.sora_signaling_host << "\n"; os << "sora_channel_id: " << cs.sora_channel_id << "\n"; diff --git a/src/main.cpp b/src/main.cpp index f4509f48..d0f28483 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -115,6 +115,7 @@ int main(int argc, char* argv[]) app.add_option("--audio-bitrate", cs.audio_bitrate, "オーディオのビットレート")->check(CLI::Range(6, 510)); app.add_option("--resolution", cs.resolution, "解像度")->check(Enum({"QVGA", "VGA", "HD", "FHD", "4K"})); app.add_option("--framerate", cs.framerate, "フレームレート")->check(CLI::Range(1, 60)); + app.add_flag("--fixed-resolution", cs.fixed_resolution, "固定解像度"); app.add_option("--priority", cs.priority, "優先設定 (Experimental)")->check(Enum({"BALANCE", "FRAMERATE", "RESOLUTION"})); app.add_flag("--daemon", is_daemon, "デーモン化する"); app.add_flag("--version", version, "バージョン情報の表示"); diff --git a/src/rtc/manager.cpp b/src/rtc/manager.cpp index e4017595..1b79fc34 100644 --- a/src/rtc/manager.cpp +++ b/src/rtc/manager.cpp @@ -159,6 +159,10 @@ std::shared_ptr RTCManager::createConnection( _factory->CreateVideoTrack(Util::generateRundomChars(), _video_source)); if (video_track) { + if (_conn_settings.fixed_resolution) { + video_track->set_content_hint(webrtc::VideoTrackInterface::ContentHint::kText); + } + rtc::scoped_refptr video_sender( connection->CreateSender(webrtc::MediaStreamTrackInterface::kVideoKind, Util::generateRundomChars())); webrtc::RtpParameters parameters = video_sender->GetParameters(); From 0593e97834af0b1f603fa9ca8f1cebba14958423 Mon Sep 17 00:00:00 2001 From: Yoshida Hiroshi Date: Mon, 19 Nov 2018 16:50:27 +0900 Subject: [PATCH 3/8] =?UTF-8?q?=E5=A4=89=E6=9B=B4=E5=B1=A5=E6=AD=B4?= =?UTF-8?q?=E3=82=92=E6=9B=B4=E6=96=B0=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGES.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index 492edeef..bd57e0c4 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -11,6 +11,8 @@ ## develop +- [ADD] 解像度を固定するオプションを追加する + ## 18.10.1 - [UPDATE] 利用している libwebrtc のライブラリを M71 にする From 09c666cada28a31b130263175056f666fb936689 Mon Sep 17 00:00:00 2001 From: melpon Date: Fri, 23 Nov 2018 19:22:12 +0900 Subject: [PATCH 4/8] =?UTF-8?q?WebSocket=20=E3=81=AE=E5=88=86=E3=81=8B?= =?UTF-8?q?=E3=82=8C=E3=81=A6=E3=81=84=E3=82=8B=E3=81=B9=E3=81=8D=E3=83=95?= =?UTF-8?q?=E3=83=AC=E3=83=BC=E3=83=A0=E3=81=8C=E3=81=8F=E3=81=A3=E3=81=A4?= =?UTF-8?q?=E3=81=84=E3=81=A6=E3=81=84=E3=81=9F=E3=81=AE=E3=82=92=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ws/websocket.cpp | 18 +++++++++++------- src/ws/websocket.h | 2 +- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/ws/websocket.cpp b/src/ws/websocket.cpp index 306a62e2..f5cd9faa 100644 --- a/src/ws/websocket.cpp +++ b/src/ws/websocket.cpp @@ -91,10 +91,13 @@ void Websocket::sendText(std::string text) { void Websocket::doSendText(std::string text) { RTC_LOG(LS_INFO) << __FUNCTION__ << ": " << text; - bool empty = write_buffer_.size() == 0; + bool empty = write_buffer_.empty(); + boost::beast::flat_buffer buffer; - const auto n = boost::asio::buffer_copy(write_buffer_.prepare(text.size()), boost::asio::buffer(text)); - write_buffer_.commit(n); + const auto n = boost::asio::buffer_copy(buffer.prepare(text.size()), boost::asio::buffer(text)); + buffer.commit(n); + + write_buffer_.push_back(std::move(buffer)); if (empty) { doWrite(); @@ -103,10 +106,11 @@ void Websocket::doSendText(std::string text) { void Websocket::doWrite() { RTC_LOG(LS_INFO) << __FUNCTION__; + auto& buffer = write_buffer_.front(); if (isSSL()) { wss_->text(true); wss_->async_write( - write_buffer_.data(), + buffer.data(), boost::asio::bind_executor( strand_, std::bind( @@ -117,7 +121,7 @@ void Websocket::doWrite() { } else { ws_->text(true); ws_->async_write( - write_buffer_.data(), + buffer.data(), boost::asio::bind_executor( strand_, std::bind( @@ -141,9 +145,9 @@ void Websocket::onWrite(boost::system::error_code ec, std::size_t bytes_transfer if (ec) return MOMO_BOOST_ERROR(ec, "onWrite"); - write_buffer_.consume(bytes_transferred); + write_buffer_.erase(write_buffer_.begin()); - if (write_buffer_.size() != 0) + if (!write_buffer_.empty()) { doWrite(); } diff --git a/src/ws/websocket.h b/src/ws/websocket.h index a6bfab55..7bb26728 100644 --- a/src/ws/websocket.h +++ b/src/ws/websocket.h @@ -31,7 +31,7 @@ class Websocket : public std::enable_shared_from_this boost::asio::strand strand_; boost::beast::multi_buffer read_buffer_; - boost::beast::multi_buffer write_buffer_; + std::vector write_buffer_; public: // 非SSL From 52c463fbad31a3f5b46352c9163fa6193d7977cf Mon Sep 17 00:00:00 2001 From: Yoshida Hiroshi Date: Mon, 26 Nov 2018 14:13:21 +0900 Subject: [PATCH 5/8] =?UTF-8?q?=E5=A4=89=E6=9B=B4=E5=B1=A5=E6=AD=B4?= =?UTF-8?q?=E3=82=92=E6=9B=B4=E6=96=B0=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.md b/CHANGES.md index bd57e0c4..96a68ec4 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -12,6 +12,7 @@ ## develop - [ADD] 解像度を固定するオプションを追加する +- [FIX] WebSocket の分かれているべきフレームがくっついていたのを修正した ## 18.10.1 From dc64fb1c496bdcef3afd3b9a23d84354b79863a9 Mon Sep 17 00:00:00 2001 From: Yoshida Hiroshi Date: Fri, 30 Nov 2018 14:42:29 +0900 Subject: [PATCH 6/8] =?UTF-8?q?18.10.2=20=E3=81=AB=E3=83=90=E3=83=BC?= =?UTF-8?q?=E3=82=B8=E3=83=A7=E3=83=B3=E3=82=92=E4=B8=8A=E3=81=92=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/Makefile b/build/Makefile index edbe0246..1a120348 100644 --- a/build/Makefile +++ b/build/Makefile @@ -1,6 +1,6 @@ BUILD_NUMBER=$(shell date +"%Y%m%d%H%M%S") WEBRTC_VERSION=71 -MOMO_VERSION=18.10.1 +MOMO_VERSION=18.10.2 TARGET=$@ From 63b0dbde67513db04eb61edb0678de00a04b53c4 Mon Sep 17 00:00:00 2001 From: Yoshida Hiroshi Date: Fri, 30 Nov 2018 14:42:57 +0900 Subject: [PATCH 7/8] =?UTF-8?q?=E5=A4=89=E6=9B=B4=E5=B1=A5=E6=AD=B4?= =?UTF-8?q?=E3=82=92=E6=9B=B4=E6=96=B0=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGES.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index 96a68ec4..2d517c9e 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -11,6 +11,8 @@ ## develop +## 18.10.2 + - [ADD] 解像度を固定するオプションを追加する - [FIX] WebSocket の分かれているべきフレームがくっついていたのを修正した From 3b222ce0b8b0e472f452157e3b090432cf6e20ee Mon Sep 17 00:00:00 2001 From: Yoshida Hiroshi Date: Mon, 3 Dec 2018 11:16:09 +0900 Subject: [PATCH 8/8] =?UTF-8?q?USE.md=20=E3=82=92=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/USE.md | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/doc/USE.md b/doc/USE.md index 0c2c0878..fb14d52d 100644 --- a/doc/USE.md +++ b/doc/USE.md @@ -67,6 +67,12 @@ $ sudo apt-get install libx11-6 libxau6 libxdmcp6 libxcb1 libnspr4 libexpat1 lib - arm 系でも指定はできるようになっていますが、マシンリソースが足らず動作しません - ロジクールの BRIO 4K 動作確認しています +### プレビュー版の機能 + +下記はプレビュー版の機能です + +- --fixed-resolution 固定解像度 + ## 利用方法 Momo はモードを 2 つ持っています。一つが P2P モードで Momo 自体がシグナリングサーバの機能も持つモードです。 @@ -77,14 +83,14 @@ Momo はモードを 2 つ持っています。一つが P2P モードで Momo ```shell $ momo --version -WebRTC Native Client Momo version 18.10.0 +WebRTC Native Client Momo version 18.10.2 ``` ### P2P で動作を確認する ```shell $ momo --no-audio --video-codec H264 --video-bitrate 800 \ - p2p --port 8080 + p2p --port 8080 ``` http://[momo の IP アドレス]:8080/html/p2p.html にアクセスしてください。 @@ -102,7 +108,7 @@ $ momo --no-audio --video-codec VP8 --video-bitrate 500 \ ``` $ ./momo --version -WebRTC Native Client Momo 18.10.0 +WebRTC Native Client Momo 18.10.2 ``` ``` @@ -125,6 +131,7 @@ Options: --resolution STR in [QVGA,VGA,HD,FHD,4K] 解像度 --framerate INT in [1 - 60] フレームレート + --fixed-resolution 固定解像度 --priority STR in [BALANCE,FRAMERATE,RESOLUTION] 優先設定 --daemon デーモン化する