mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-14 00:14:11 +09:00
[core,codecs] add stringify helper
add freerdp_codec_id_to_str to get a string representation of a given codec id
This commit is contained in:
@@ -95,6 +95,13 @@ extern "C"
|
|||||||
FREERDP_API rdpCodecs* codecs_new(rdpContext* context));
|
FREERDP_API rdpCodecs* codecs_new(rdpContext* context));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/** @brief return a string representation of the given codecid
|
||||||
|
* * @param id The codec to stringify
|
||||||
|
* @return The name of the codecid
|
||||||
|
* @since version 3.18.0
|
||||||
|
*/
|
||||||
|
FREERDP_API const char* freerdp_codec_id_to_str(enum RDP_CODEC_ID id);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -276,3 +276,21 @@ void freerdp_client_codecs_free(rdpCodecs* codecs)
|
|||||||
|
|
||||||
free(codecs);
|
free(codecs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char* freerdp_codec_id_to_str(enum RDP_CODEC_ID id)
|
||||||
|
{
|
||||||
|
#define ENTRY(x) \
|
||||||
|
case x: \
|
||||||
|
return #x
|
||||||
|
switch (id)
|
||||||
|
{
|
||||||
|
ENTRY(RDP_CODEC_ID_NONE);
|
||||||
|
ENTRY(RDP_CODEC_ID_NSCODEC);
|
||||||
|
ENTRY(RDP_CODEC_ID_JPEG);
|
||||||
|
ENTRY(RDP_CODEC_ID_REMOTEFX);
|
||||||
|
ENTRY(RDP_CODEC_ID_IMAGE_REMOTEFX);
|
||||||
|
default:
|
||||||
|
return "RDP_CODEC_ID_UNKNOWN";
|
||||||
|
}
|
||||||
|
#undef ENTRY
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user