golanggohlsrtmpwebrtcmedia-serverobs-studiortcprtmp-proxyrtmp-serverrtprtsprtsp-proxyrtsp-relayrtsp-serversrtstreamingwebrtc-proxy
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
567 B
27 lines
567 B
#include <stdio.h> |
|
#include <ctype.h> |
|
#include <stdlib.h> |
|
|
|
#include "sensor_mode.h" |
|
|
|
bool sensor_mode_load(const char *encoded, sensor_mode_t *mode) { |
|
char p; |
|
int n = sscanf(encoded, "%u:%u:%u:%c", &(mode->width), &(mode->height), &(mode->bit_depth), &p); |
|
if (n < 2) { |
|
return false; |
|
} |
|
|
|
if (n < 4) { |
|
mode->packed = true; |
|
} else if (toupper(p) == 'P') { |
|
mode->packed = true; |
|
} else if (toupper(p) == 'U') { |
|
mode->packed = false; |
|
} |
|
|
|
if (n < 3) { |
|
mode->bit_depth = 12; |
|
} |
|
|
|
return true; |
|
}
|
|
|