mirror of
https://github.com/hyprwm/aquamarine.git
synced 2024-11-17 10:46:00 +01:00
2a3ff6a61d
store format name in a std::string and free the char ptr to ensure we dont leak on each call to drmGetFormatName.
10 lines
252 B
C++
10 lines
252 B
C++
#include "FormatUtils.hpp"
|
|
#include <drm_fourcc.h>
|
|
#include <xf86drm.h>
|
|
|
|
std::string fourccToName(uint32_t drmFormat) {
|
|
auto fmt = drmGetFormatName(drmFormat);
|
|
std::string name = fmt ? fmt : "unknown";
|
|
free(fmt);
|
|
return name;
|
|
}
|