Created
November 13, 2019 07:59
-
-
Save ElfSundae/72ce6dca3c4df46e53928ffbc2c18d66 to your computer and use it in GitHub Desktop.
FourCharCode to String
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://developer.apple.com/documentation/avfoundation/avassettrack/1386694-formatdescriptions?language=objc | |
static NSString * FourCCString(FourCharCode code) { | |
NSString *result = [NSString stringWithFormat:@"%c%c%c%c", | |
(code >> 24) & 0xff, | |
(code >> 16) & 0xff, | |
(code >> 8) & 0xff, | |
code & 0xff]; | |
NSCharacterSet *characterSet = [NSCharacterSet whitespaceCharacterSet]; | |
return [result stringByTrimmingCharactersInSet:characterSet]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment