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-06-07 13:44:46 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
373f92551d8c5c510eb67f851d7e318662a105ab
373f9255
1 parent
48adeeb1
refine librtmp, remove the ssl functoins, refine the type2string memory alloc to static
隐藏空白字符变更
内嵌
并排对比
正在显示
2 个修改的文件
包含
12 行增加
和
21 行删除
trunk/src/libs/srs_librtmp.cpp
trunk/src/libs/srs_librtmp.hpp
trunk/src/libs/srs_librtmp.cpp
查看文件 @
373f925
...
...
@@ -239,14 +239,19 @@ int srs_publish_stream(srs_rtmp_t rtmp)
const
char
*
srs_type2string
(
int
type
)
{
static
const
char
*
audio
=
"Audio"
;
static
const
char
*
video
=
"Video"
;
static
const
char
*
data
=
"Data"
;
static
const
char
*
unknown
=
"Unknown"
;
switch
(
type
)
{
case
SRS_RTMP_TYPE_AUDIO
:
return
"Audio"
;
case
SRS_RTMP_TYPE_VIDEO
:
return
"Video"
;
case
SRS_RTMP_TYPE_SCRIPT
:
return
"Data"
;
default
:
return
"Unknown"
;
case
SRS_RTMP_TYPE_AUDIO
:
return
audio
;
case
SRS_RTMP_TYPE_VIDEO
:
return
video
;
case
SRS_RTMP_TYPE_SCRIPT
:
return
data
;
default
:
return
unknown
;
}
return
"Unknown"
;
return
unknown
;
}
int
srs_read_packet
(
srs_rtmp_t
rtmp
,
int
*
type
,
u_int32_t
*
timestamp
,
char
**
data
,
int
*
size
)
...
...
@@ -355,14 +360,6 @@ int srs_write_packet(srs_rtmp_t rtmp, int type, u_int32_t timestamp, char* data,
return
ret
;
}
int
srs_ssl_enabled
()
{
#ifndef SRS_AUTO_SSL
return
false
;
#endif
return
true
;
}
int
srs_version_major
()
{
return
::
atoi
(
VERSION_MAJOR
);
...
...
trunk/src/libs/srs_librtmp.hpp
查看文件 @
373f925
...
...
@@ -109,6 +109,8 @@ int srs_publish_stream(srs_rtmp_t rtmp);
* SRS_RTMP_TYPE_VIDEO to "Video"
* SRS_RTMP_TYPE_SCRIPT to "Data"
* otherwise, "Unknown"
* @remark user never free the return char*,
* it's static shared const string.
*/
const
char
*
srs_type2string
(
int
type
);
/**
...
...
@@ -132,14 +134,6 @@ int srs_read_packet(srs_rtmp_t rtmp, int* type, u_int32_t* timestamp, char** dat
int
srs_write_packet
(
srs_rtmp_t
rtmp
,
int
type
,
u_int32_t
timestamp
,
char
*
data
,
int
size
);
/**
* whether srs is compiled with ssl,
* that is, compile srs with ssl: ./configure --with-ssl,.
* if no ssl, complex handshake always error.
* @return 0 for false, otherwise, true.
*/
int
srs_ssl_enabled
();
/**
* get protocol stack version
*/
int
srs_version_major
();
...
...
请
注册
或
登录
后发表评论