Android-cuttlefish cvd tool
connection_observer.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2020 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
17#pragma once
18
19#include <map>
20#include <memory>
21
31
32namespace cuttlefish {
33
36 public:
38 InputConnector& input_connector,
39 KernelLogEventsHandler& kernel_log_events_handler,
40 webrtc_streaming::SensorsHandler& sensors_handler,
41 std::shared_ptr<webrtc_streaming::LightsObserver> lights_observer);
42 ~CfConnectionObserverFactory() override = default;
43
44 std::shared_ptr<webrtc_streaming::ConnectionObserver> CreateObserver()
45 override;
46
47 void AddCustomActionServer(SharedFD custom_action_server_fd,
48 const std::vector<std::string>& commands);
49
50 void SetDisplayHandler(std::weak_ptr<DisplayHandler> display_handler);
51
52 void SetCameraHandler(CameraController* controller);
53
54 private:
57 std::map<std::string, SharedFD>
59 std::weak_ptr<DisplayHandler> weak_display_handler_;
62 std::shared_ptr<webrtc_streaming::LightsObserver> lights_observer_;
63};
64
65} // namespace cuttlefish
Definition: camera_controller.h:24
Definition: connection_observer.h:35
std::weak_ptr< DisplayHandler > weak_display_handler_
Definition: connection_observer.h:59
void SetCameraHandler(CameraController *controller)
Definition: connection_observer.cpp:484
webrtc_streaming::SensorsHandler & sensors_handler_
Definition: connection_observer.h:61
cuttlefish::CameraController * camera_controller_
Definition: connection_observer.h:60
CfConnectionObserverFactory(InputConnector &input_connector, KernelLogEventsHandler &kernel_log_events_handler, webrtc_streaming::SensorsHandler &sensors_handler, std::shared_ptr< webrtc_streaming::LightsObserver > lights_observer)
Definition: connection_observer.cpp:451
void AddCustomActionServer(SharedFD custom_action_server_fd, const std::vector< std::string > &commands)
Definition: connection_observer.cpp:470
std::shared_ptr< webrtc_streaming::LightsObserver > lights_observer_
Definition: connection_observer.h:62
std::shared_ptr< webrtc_streaming::ConnectionObserver > CreateObserver() override
Definition: connection_observer.cpp:462
InputConnector & input_connector_
Definition: connection_observer.h:55
~CfConnectionObserverFactory() override=default
void SetDisplayHandler(std::weak_ptr< DisplayHandler > display_handler)
Definition: connection_observer.cpp:479
std::map< std::string, SharedFD > commands_to_custom_action_servers_
Definition: connection_observer.h:58
KernelLogEventsHandler & kernel_log_events_handler_
Definition: connection_observer.h:56
Definition: input_connector.h:38
Definition: shared_fd.h:129
Definition: connection_observer.h:112
Definition: alloc_utils.cpp:23
Definition: kernel_log_events_handler.h:33
Definition: sensors_handler.h:30