blob: c3b4393cf5b89a703da71f7d8e70edab832c4ccb [file] [log] [blame]
## -*- coding: utf-8 -*-
// Copyright 2022 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
/**
* ! Do not edit this file directly !
*
* Generated automatically from camera_metadata_tags.mojom.mako
*/
module cros.mojom;
/**
* Top level hierarchy definitions for camera metadata. *_INFO sections are for
* the static metadata that can be retrived without opening the camera device.
* New sections must be added right before ANDROID_SECTION_COUNT to maintain
* existing enumerations.
*/
enum CameraMetadataSection {
% for i, section in enumerate(find_all_sections(metadata)):
${path_name(section) | csym,ljust(30)} = ${'0x%X' % i},
% endfor
ANDROID_SECTION_COUNT = ${'0x%X' % len(list(find_all_sections(metadata)))},
VENDOR_SECTION = 0x8000
};
/**
* Hierarchy positions in enum space. All vendor extension tags must be
* defined with tag >= VENDOR_SECTION_START
*/
[Extensible]
enum CameraMetadataSectionStart {
% for i, section in enumerate(find_all_sections(metadata)):
${path_name(section) + '.start' | csym,ljust(30)} = ${'0x%X' % (i << 16)},
% endfor
// Mojom maps enum to int32_t in C++. This causes problem on the VENDOR_SECTION_START
// below as 0x80000000 would generate -Wc++11-narrowing warnings while compiling the
// generated C++ files. Until mojom supports mapping enum as uint32_t in C++ we need
// to omit VENDOR_SECTION_START here and set CameraMetadataSectionStart as extensible.
// VENDOR_SECTION_START = ${'0x%X' % (0x8000 << 16)}
};
/**
* Main enum for defining camera metadata tags. New entries must always go
* before the section _END tag to preserve existing enumeration values. In
* addition, the name and type of the tag needs to be added to
* system/media/camera/src/camera_metadata_tag_info.c
*/
[Extensible]
enum CameraMetadataTag {
% for i, section in enumerate(find_all_sections(metadata)):
% for idx, entry in enumerate(remove_synthetic(find_unique_entries(section))):
% if idx == 0:
${entry.name + " =" | csym,ljust(50)} ${'0x%X' % (i << 16)}, // ${path_name(find_parent_section(entry)) | csym}_START,
% else:
${entry.name + "," | csym}
% endif
% endfor
${path_name(section) | csym}_END,
%endfor
};
/**
* Enumeration definitions for the various entries that need them
*/
% for section in find_all_sections(metadata):
% for entry in remove_synthetic(find_unique_entries(section)):
% if entry.enum:
// ${entry.name | csym}
enum ${pascal_case(entry.name)} {
% for value in entry.enum.values:
% if value.id is None:
${'%s_%s' % (csym(entry.name), value.name)},
% else:
${'%s_%s' % (csym(entry.name), value.name) | pad(65)} = ${value.id},
% endif
% endfor
};
% endif
% endfor
%endfor