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
17#include <optional>
18#include <string>
19
22
23namespace cuttlefish {
24
25constexpr const char kMediaFlag[] = "media";
26constexpr const char kMediaHelp[] =
27 "Colon separated media device properties: "
28 "\"[type]:[key1]=[val1]:[key2]=[val2]\". "
29 "Supported types:\n"
30 " 'v4l2_emulated_camera_splane': emulated media capture device "
31 "(single-plane)\n"
32 " 'v4l2_emulated_camera_mplane': emulated media capture device "
33 "(multi-plane)\n"
34 " 'v4l2_proxy': proxy a host V4L2 device into the guest\n"
35 " 'v4l2_stream_proxy': stream video from a host named pipe into the "
36 "guest\n\n"
37 "v4l2_stream_proxy properties:\n"
38 " 'input_path': path to the host named pipe\n"
39 " 'input_width': width of the video stream in pixels\n"
40 " 'input_height': height of the video stream in pixels\n"
41 " 'input_fps': frames per second (e.g., 30 or 30000/1001)\n\n"
42 "Supported keys:\n"
43 " 'lens_facing': optional, supported values: 'FRONT', 'BACK', "
44 "'EXTERNAL'\n\n"
45 "Example usage:\n"
46 " --media=v4l2_emulated_camera_mplane:lens_facing=BACK\n"
47 " --media=v4l2_stream_proxy:input_path=/tmp/fifo:"
48 "input_width=640:input_height=480:input_fps=30\n";
49
51 const std::string& flag);
52
54 std::vector<std::string>& args);
55
56} // namespace cuttlefish
Definition: alloc_driver.h:20
Result< std::optional< CuttlefishConfig::MediaConfig > > ParseMediaConfig(const std::string &flag)
Definition: media.cpp:43
Result< std::vector< CuttlefishConfig::MediaConfig > > ParseMediaConfigsFromArgs(std::vector< std::string > &args)
Definition: media.cpp:125
tl::expected< T, StackTraceError > Result
Definition: result_type.h:30
constexpr const char kMediaHelp[]
Definition: media.h:26
constexpr const char kMediaFlag[]
Definition: media.h:25