1:
#define KEY_NAME "name"
#define PARAM_STRING_APPEND(s, s1, s2) s.append(s1 "=").append(s2).append("\n")
#define PARAM_STRING_APPEND_TO(s, s1, s2) \
s.append(s1 "=").append(std::to_string(s2)).append("\n")
#define PARAM_STRING_APPEND_PARAM_STRING(p1, p2) p1.append(" ").append(p2)
用法:
std::string flow_name = "output_stream";
std::string flow_param = "";
PARAM_STRING_APPEND(flow_param, KEY_NAME, "drm_output_stream");
std::string flow_param结果为:
"name=drm_output_stream"
用法:
std::string flow_param = "";
PARAM_STRING_APPEND_TO(stream_param, "crtc_id", pstAttr->u16CrtcIdx);
std::string flow_param结果为:
"crtc_id=1080"
2: