mirror of
https://gitlab.com/mbunkus/mkvtoolnix.git
synced 2025-02-17 17:24:54 +00:00
Helper function for stringifying a FourCC
This commit is contained in:
parent
fb7b44517a
commit
350ad93b10
@ -14,6 +14,7 @@
|
||||
#include "common/common_pch.h"
|
||||
|
||||
#include "common/ebml.h"
|
||||
#include "common/endian.h"
|
||||
#include "common/mm_io.h"
|
||||
#include "common/locale.h"
|
||||
#include "common/output.h"
|
||||
@ -287,3 +288,14 @@ dump_ebml_elements(EbmlElement *element,
|
||||
dump_ebml_elements((*master)[i], with_values, level + 1);
|
||||
}
|
||||
|
||||
std::string
|
||||
fourcc_to_string(uint32_t fourcc) {
|
||||
unsigned char buffer[4], idx;
|
||||
|
||||
put_uint32_be(buffer, fourcc);
|
||||
for (idx = 0; 4 > idx; ++idx)
|
||||
if (buffer[idx] < ' ')
|
||||
buffer[idx] = ' ';
|
||||
|
||||
return std::string(reinterpret_cast<char *>(buffer), 4);
|
||||
}
|
||||
|
@ -133,4 +133,6 @@ void MTX_DLL_API mxhexdump(unsigned int level, const void *buffer_to_dump, size_
|
||||
|
||||
void MTX_DLL_API dump_ebml_elements(EbmlElement *element, bool with_values = false, unsigned int level = 0);
|
||||
|
||||
std::string fourcc_to_string(uint32_t fourcc);
|
||||
|
||||
#endif // __MTX_COMMON_OUTPUT_H
|
||||
|
Loading…
Reference in New Issue
Block a user