Android-cuttlefish cvd tool
media.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#pragma once
17
18#include <fruit/fruit.h>
19
20#include <string>
21#include <vector>
22
26
27namespace cuttlefish {
28
29// Component to share data between MediaConfigsFlag and MediaConfigsFragment
31 public:
32 virtual ~MediaConfigs() = default;
33
34 virtual std::string Name() const = 0;
35
36 virtual const std::vector<CuttlefishConfig::MediaConfig>& GetConfigs()
37 const = 0;
38 virtual void SetConfigs(
39 const std::vector<CuttlefishConfig::MediaConfig>& configs) = 0;
40};
41
42// Component to parse the --media command line flag and update the
43// MediaConfigs.
44class MediaConfigsFlag : public FlagFeature {};
45
46// Component to serialize and deserialize the MediaConfigs to/from Json.
48
49fruit::Component<MediaConfigs> MediaConfigsComponent();
50
51fruit::Component<fruit::Required<MediaConfigs, ConfigFlag>, MediaConfigsFlag>
53
54fruit::Component<fruit::Required<MediaConfigs>, MediaConfigsFragment>
56
57} // namespace cuttlefish
Definition: config_fragment.h:24
Definition: feature.h:114
Definition: media.h:44
Definition: media.h:47
Definition: media.h:30
virtual ~MediaConfigs()=default
virtual std::string Name() const =0
virtual const std::vector< CuttlefishConfig::MediaConfig > & GetConfigs() const =0
virtual void SetConfigs(const std::vector< CuttlefishConfig::MediaConfig > &configs)=0
Definition: alloc_driver.h:20
fruit::Component< fruit::Required< MediaConfigs >, MediaConfigsFragment > MediaConfigsFragmentComponent()
Definition: media.cpp:159
fruit::Component< MediaConfigs > MediaConfigsComponent()
Definition: media.cpp:63
fruit::Component< fruit::Required< MediaConfigs, ConfigFlag >, MediaConfigsFlag > MediaConfigsFlagComponent()
Definition: media.cpp:101