summaryrefslogtreecommitdiff
path: root/common/xv_image_format.c
blob: 10d81bb1966262009eee8734845fdc188c093537 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include "xv_image_format.h"

const struct xv_image_format *xv_image_xvfourcc(
	const struct xv_image_format *tbl, size_t nent, int fmt)
{
	size_t i;

	for (i = 0; i < nent; i++)
		if (tbl[i].xv_image.id == fmt)
			return &tbl[i];

	return NULL;
}

const struct xv_image_format *xv_image_drm(
	const struct xv_image_format *tbl, size_t nent, uint32_t fmt)
{
	size_t i;

	for (i = 0; i < nent; i++)
		if (tbl[i].u.drm_format == fmt)
			return &tbl[i];

	return NULL;
}