1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

Add kernel utility utest

This commit is contained in:
winlin 2019-01-01 20:19:44 +08:00
parent 6e44aa4a4f
commit a2d6566019
2 changed files with 270 additions and 0 deletions

View file

@ -436,6 +436,11 @@ vector<string> srs_string_split(string str, string flag)
{
vector<string> arr;
if (flag.empty()) {
arr.push_back(str);
return arr;
}
size_t pos;
string s = str;
@ -457,6 +462,10 @@ string srs_string_min_match(string str, vector<string> flags)
{
string match;
if (flags.empty()) {
return str;
}
size_t min_pos = string::npos;
for (vector<string>::iterator it = flags.begin(); it != flags.end(); ++it) {
string flag = *it;
@ -650,6 +659,10 @@ string srs_path_filext(string path)
bool srs_avc_startswith_annexb(SrsBuffer* stream, int* pnb_start_code)
{
if (!stream) {
return false;
}
char* bytes = stream->data() + stream->pos();
char* p = bytes;
@ -679,6 +692,10 @@ bool srs_avc_startswith_annexb(SrsBuffer* stream, int* pnb_start_code)
bool srs_aac_startswith_adts(SrsBuffer* stream)
{
if (!stream) {
return false;
}
char* bytes = stream->data() + stream->pos();
char* p = bytes;