Android-cuttlefish cvd tool
tuner_state.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 <cstdint>
20#include <mutex>
21
22#include "cuttlefish/host/commands/virtual_tuner_daemon/VirtualTuner.pb.h"
23
24namespace cuttlefish {
25namespace virtualtuner {
26
28 RadioBand band = RadioBand::FM;
29 uint32_t frequency_hz = 0;
30 uint32_t hd_subchannel = 0;
31 bool is_playing = false;
32};
33
35 public:
36 TunerState() = default;
37
38 void SetTune(RadioBand band, uint32_t frequency_hz, uint32_t hd_subchannel);
39 void Stop();
40
42 uint32_t GetFrequency() const;
43 RadioBand GetBand() const;
44 uint32_t GetSubchannel() const;
45 bool IsPlaying() const;
46
47 private:
48 mutable std::mutex mutex_;
50};
51
52} // namespace virtualtuner
53} // namespace cuttlefish
Definition: tuner_state.h:34
TunerStateSnapshot GetSnapshot() const
Definition: tuner_state.cpp:42
void SetTune(RadioBand band, uint32_t frequency_hz, uint32_t hd_subchannel)
Definition: tuner_state.cpp:27
bool IsPlaying() const
Definition: tuner_state.cpp:62
uint32_t GetSubchannel() const
Definition: tuner_state.cpp:57
TunerStateSnapshot state_
Definition: tuner_state.h:49
uint32_t GetFrequency() const
Definition: tuner_state.cpp:47
void Stop()
Definition: tuner_state.cpp:36
RadioBand GetBand() const
Definition: tuner_state.cpp:52
std::mutex mutex_
Definition: tuner_state.h:48
Definition: alloc_driver.h:20
__u8 band
Definition: nl80211.h:0
RadioBand band
Definition: tuner_state.h:28
uint32_t hd_subchannel
Definition: tuner_state.h:30
bool is_playing
Definition: tuner_state.h:31
uint32_t frequency_hz
Definition: tuner_state.h:29