Android-cuttlefish cvd tool
virtual_tuner_server.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2026 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 <optional>
20#include <string>
21
26
27namespace cuttlefish {
28
29// Returns true if audio is enabled and the guest audio config declares a
30// virtual_tuner stream on any PCM device.
31bool HasVirtualTunerStream(const CuttlefishConfig::InstanceSpecific& instance);
32
33// Returns the path of the host-local socket that carries tuner PCM from
34// virtual_tuner_daemon to webRTC. Both ends are host processes, so it lives in
35// the instance's internal UDS directory.
37 const CuttlefishConfig::InstanceSpecific& instance);
38
39// Returns the command that starts virtual_tuner_daemon, or nullopt if the
40// guest has no virtual_tuner stream. Creates the PCM listening socket that
41// webRTC connects to and registers the host-only gRPC control socket for
42// `cvd env`.
43Result<std::optional<MonitorCommand>> VirtualTunerServer(
44 const CuttlefishConfig::InstanceSpecific& instance,
45 GrpcSocketCreator& grpc_socket);
46
47} // namespace cuttlefish
Definition: alloc_driver.h:21
Result< std::optional< MonitorCommand > > VirtualTunerServer(const CuttlefishConfig::InstanceSpecific &instance, GrpcSocketCreator &grpc_socket)
Definition: virtual_tuner_server.cpp:83
std::string VirtualTunerPcmSocketPath(const CuttlefishConfig::InstanceSpecific &instance)
Definition: virtual_tuner_server.cpp:78
bool HasVirtualTunerStream(const CuttlefishConfig::InstanceSpecific &instance)
Definition: virtual_tuner_server.cpp:74