Toggle navigation
Toggle navigation
此项目
正在载入...
Sign in
胡斌
/
srs
转到一个项目
Toggle navigation
项目
群组
代码片段
帮助
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
winlin
2014-03-19 10:38:02 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
2eeb289c2f42d2a48e63f77dfc423a4d5fc67548
2eeb289c
1 parent
b58ab508
assert system is little-endian
隐藏空白字符变更
内嵌
并排对比
正在显示
4 个修改的文件
包含
27 行增加
和
0 行删除
trunk/src/core/srs_core.cpp
trunk/src/core/srs_core.hpp
trunk/src/kernel/srs_kernel_stream.cpp
trunk/src/main/srs_main_server.cpp
trunk/src/core/srs_core.cpp
查看文件 @
2eeb289
...
...
@@ -85,3 +85,22 @@ std::string srs_dns_resolve(std::string host)
return
ipv4
;
}
bool
srs_is_little_endian
()
{
// convert to network(big-endian) order, if not equals,
// the system is little-endian, so need to convert the int64
static
int
little_endian_check
=
-
1
;
if
(
little_endian_check
==
-
1
)
{
union
{
int32_t
i
;
int8_t
c
;
}
little_check_union
;
little_check_union
.
i
=
0x01
;
little_endian_check
=
little_check_union
.
c
;
}
return
(
little_endian_check
==
1
);
}
...
...
trunk/src/core/srs_core.hpp
查看文件 @
2eeb289
...
...
@@ -99,6 +99,8 @@ extern void srs_update_system_time_ms();
extern
std
::
string
srs_replace
(
std
::
string
str
,
std
::
string
old_str
,
std
::
string
new_str
);
// dns resolve utility, return the resolved ip address.
extern
std
::
string
srs_dns_resolve
(
std
::
string
host
);
// whether system is little endian
extern
bool
srs_is_little_endian
();
/**
* disable copy constructor of class
...
...
trunk/src/kernel/srs_kernel_stream.cpp
查看文件 @
2eeb289
...
...
@@ -30,6 +30,9 @@ SrsStream::SrsStream()
{
p
=
bytes
=
NULL
;
size
=
0
;
// TODO: support both little and big endian.
srs_assert
(
srs_is_little_endian
());
}
SrsStream
::~
SrsStream
()
...
...
trunk/src/main/srs_main_server.cpp
查看文件 @
2eeb289
...
...
@@ -53,6 +53,9 @@ void handler(int signo)
int
main
(
int
argc
,
char
**
argv
)
{
int
ret
=
ERROR_SUCCESS
;
// TODO: support both little and big endian.
srs_assert
(
srs_is_little_endian
());
#ifdef SRS_GPERF_MP
HeapProfilerStart
(
"gperf.srs.gmp"
);
...
...
请
注册
或
登录
后发表评论