summaryrefslogtreecommitdiff
path: root/src/ipa/raspberrypi/data
diff options
context:
space:
mode:
authorDavid Plowman <david.plowman@raspberrypi.com>2021-01-25 18:48:55 +0000
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2021-01-26 10:46:06 +0200
commitb2186c2b89d762475e45935c835dc900ff5a7149 (patch)
tree0926beeb4007452c3b00955a14901f64f0c6189e /src/ipa/raspberrypi/data
parent15d3970c0ce8a21e1344cc9f4d60bb5928ce293d (diff)
ipa: raspberrypi: alsc: Replace Raspberry Pi debug with libcamera debug
Some unhelpful debug messages have been removed. Signed-off-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src/ipa/raspberrypi/data')
0 files changed, 0 insertions, 0 deletions
lc"># Copyright (C) 2020, Google Inc. # # Author: Laurent Pinchart <laurent.pinchart@ideasonboard.com> # # gen-formats.py - Generate formats definitions from YAML import argparse import re import string import sys import yaml class DRMFourCC(object): format_regex = re.compile(r"#define (DRM_FORMAT_[A-Z0-9_]+)[ \t]+fourcc_code\(('.', '.', '.', '.')\)") mod_vendor_regex = re.compile(r"#define DRM_FORMAT_MOD_VENDOR_([A-Z0-9_]+)[ \t]+([0-9a-fA-Fx]+)") mod_regex = re.compile(r"#define ([A-Za-z0-9_]+)[ \t]+fourcc_mod_code\(([A-Z0-9_]+), ([0-9a-fA-Fx]+)\)") def __init__(self, filename): self.formats = {} self.vendors = {} self.mods = {} for line in open(filename, 'rb').readlines(): line = line.decode('utf-8') match = DRMFourCC.format_regex.match(line) if match: format, fourcc = match.groups() self.formats[format] = fourcc continue match = DRMFourCC.mod_vendor_regex.match(line) if match: vendor, value = match.groups() self.vendors[vendor] = int(value, 0) continue match = DRMFourCC.mod_regex.match(line) if match: mod, vendor, value = match.groups() self.mods[mod] = (vendor, int(value, 0)) continue def fourcc(self, name): return self.formats[name] def mod(self, name): vendor, value = self.mods[name] return self.vendors[vendor], value def generate_h(formats, drm_fourcc): template = string.Template('constexpr PixelFormat ${name}{ __fourcc(${fourcc}), __mod(${mod}) };') fmts = [] for format in formats: name, format = format.popitem() data = { 'name': name, 'fourcc': drm_fourcc.fourcc(format['fourcc']), 'mod': '0, 0', } mod = format.get('mod') if mod: data['mod'] = '%u, %u' % drm_fourcc.mod(mod) fmts.append(template.substitute(data)) return {'formats': '\n'.join(fmts)} def fill_template(template, data): template = open(template, 'rb').read() template = template.decode('utf-8') template = string.Template(template) return template.substitute(data) def main(argv): # Parse command line arguments parser = argparse.ArgumentParser() parser.add_argument('-o', dest='output', metavar='file', type=str,