mirror of
https://gitlab.freedesktop.org/emersion/libdisplay-info.git
synced 2024-11-16 19:48:30 +01:00
40b7b46a5c
Returns a low-level struct di_edid from a high-level struct di_info. Signed-off-by: Simon Ser <contact@emersion.fr>
38 lines
550 B
C
38 lines
550 B
C
#include <stdlib.h>
|
|
|
|
#include "edid.h"
|
|
#include "info.h"
|
|
|
|
struct di_info *
|
|
di_info_parse_edid(const void *data, size_t size)
|
|
{
|
|
struct di_edid *edid;
|
|
struct di_info *info;
|
|
|
|
edid = di_edid_parse(data, size);
|
|
if (!edid)
|
|
return NULL;
|
|
|
|
info = calloc(1, sizeof(*info));
|
|
if (!info) {
|
|
di_edid_destroy(edid);
|
|
return NULL;
|
|
}
|
|
|
|
info->edid = edid;
|
|
|
|
return info;
|
|
}
|
|
|
|
void
|
|
di_info_destroy(struct di_info *info)
|
|
{
|
|
di_edid_destroy(info->edid);
|
|
free(info);
|
|
}
|
|
|
|
const struct di_edid *
|
|
di_info_get_edid(const struct di_info *info)
|
|
{
|
|
return info->edid;
|
|
}
|