Files
One-KVM/libs/hwcodec/cpp/amf/amf_common.cpp
mofeng-git d143d158e4 init
2025-12-28 18:19:16 +08:00

35 lines
819 B
C++

#include "common.h"
#include <iostream>
#include <public/common/TraceAdapter.h>
#include <stdio.h>
#ifndef AMF_FACILITY
#define AMF_FACILITY L"AMFCommon"
#endif
static bool convert_api(amf::AMF_MEMORY_TYPE &rhs) {
// Always use DX11 since it's the only supported API
rhs = amf::AMF_MEMORY_DX11;
return true;
}
static bool convert_surface_format(SurfaceFormat lhs,
amf::AMF_SURFACE_FORMAT &rhs) {
switch (lhs) {
case SURFACE_FORMAT_NV12:
rhs = amf::AMF_SURFACE_NV12;
break;
case SURFACE_FORMAT_RGBA:
rhs = amf::AMF_SURFACE_RGBA;
break;
case SURFACE_FORMAT_BGRA:
rhs = amf::AMF_SURFACE_BGRA;
break;
default:
std::cerr << "unsupported surface format: " << static_cast<int>(lhs)
<< "\n";
return false;
}
return true;
}