summaryrefslogtreecommitdiff
path: root/test/gstreamer
AgeCommit message (Expand)Author
2022-10-07test: meson: Use dictionaries instead of arrays to store test informationLaurent Pinchart
2022-10-07test: Rename 't' to 'test' in meson.buildLaurent Pinchart
2022-09-12test: gstreamer: gstreamer_test: Remove redundant wordRishikesh Donadkar
2022-09-12test: gstreamer: Fix failure of gstreamer_multistream_testVedant Paranjape
2022-07-24test: gstreamer: Check availability of cameras before runningUmang Jain
2022-07-24test: gstreamer: Drop internal header from base classUmang Jain
2021-12-01test: gstreamer: Avoid call to deprecated gst_element_get_request_pad()Xavier Roumegue
2021-11-24test: Convert to pragma onceKieran Bingham
2021-10-15test: Remove using namespace in header filesHirokazu Honda
2021-10-04test: gstreamer: Remove unnecessary header file includesVedant Paranjape
2021-09-24test: gstreamer: Add a test for gstreamer multi streamVedant Paranjape
2021-09-23test: gstreamer: Simplify elements' ownershipsVedant Paranjape
2021-09-23test: gstreamer: Simplify single stream test using functions from GstUtilsVedant Paranjape
2021-09-23test: gstreamer_single_stream_test: Fix memory leakVedant Paranjape
2021-09-09test: gstreamer: Fix the destructor of GstreamerTest base classVedant Paranjape
2021-09-08test: gstreamer: Factor out code into a base classVedant Paranjape
2021-08-26test: gstreamer: Disable gstreamer registry forksVedant Paranjape
2021-08-26test: gstreamer: Clean up memory managementVedant Paranjape
2021-08-14test: gstreamer: Add test for gstreamer single streamVedant Paranjape
n>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() fourcc = drm_fourcc.fourcc(format['fourcc']) if format.get('big-endian'): fourcc += '| DRM_FORMAT_BIG_ENDIAN' data = { 'name': name, 'fourcc': 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, help='Output file name. Defaults to standard output if not specified.') parser.add_argument('input', type=str, help='Input file name.') parser.add_argument('template', type=str, help='Template file name.') parser.add_argument('drm_fourcc', type=str, help='Path to drm_fourcc.h.') args = parser.parse_args(argv[1:]) data = open(args.input, 'rb').read() formats = yaml.safe_load(data)['formats'] drm_fourcc = DRMFourCC(args.drm_fourcc) data = generate_h(formats, drm_fourcc) data = fill_template(args.template, data) if args.output: output = open(args.output, 'wb') output.write(data.encode('utf-8')) output.close() else: sys.stdout.write(data) return 0 if __name__ == '__main__': sys.exit(main(sys.argv))