Android-cuttlefish cvd tool
webrtc_controller.h
Go to the documentation of this file.
1//
2// Copyright (C) 2023 The Android Open Source Project
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8// http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15
16#pragma once
17
18#include "fruit/fruit.h"
19
24
25namespace cuttlefish {
26
28 public:
30 std::string Name() const override { return "WebRtcController"; }
31 Result<void> ResultSetup() override;
32
37 const std::string& screenshot_path);
38
39 protected:
41 std::optional<WebrtcClientCommandChannel> command_channel_;
42
43 private:
44 std::unordered_set<SetupFeature*> Dependencies() const override { return {}; }
45};
46
47fruit::Component<WebRtcController> WebRtcControllerComponent();
48
49} // namespace cuttlefish
Definition: feature.h:48
Definition: shared_fd.h:124
Definition: webrtc_controller.h:27
SharedFD GetClientSocket() const
Definition: webrtc_controller.cpp:59
std::string Name() const override
Definition: webrtc_controller.h:30
Result< void > SendStartRecordingCommand()
Definition: webrtc_controller.cpp:61
Result< void > ResultSetup() override
Definition: webrtc_controller.cpp:48
std::unordered_set< SetupFeature * > Dependencies() const override
Definition: webrtc_controller.h:44
std::optional< WebrtcClientCommandChannel > command_channel_
Definition: webrtc_controller.h:41
INJECT(WebRtcController())
Definition: webrtc_controller.h:29
Result< void > SendStopRecordingCommand()
Definition: webrtc_controller.cpp:71
Result< void > SendScreenshotDisplayCommand(int display_number, const std::string &screenshot_path)
Definition: webrtc_controller.cpp:81
SharedFD client_socket_
Definition: webrtc_controller.h:40
Definition: alloc_driver.h:20
fruit::Component< WebRtcController > WebRtcControllerComponent()
Definition: webrtc_controller.cpp:94
tl::expected< T, StackTraceError > Result
Definition: result_type.h:30