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
2013-10-22 18:30:36 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
5af377e41d853dc9add1a52af31e75701586d092
5af377e4
1 parent
940d2f02
add shared ptr message
显示空白字符变更
内嵌
并排对比
正在显示
7 个修改的文件
包含
35 行增加
和
6 行删除
trunk/src/core/srs_core.hpp
trunk/src/core/srs_core_client.cpp
trunk/src/core/srs_core_protocol.cpp
trunk/src/core/srs_core_protocol.hpp
trunk/src/core/srs_core_rtmp.cpp
trunk/src/core/srs_core_source.cpp
trunk/src/core/srs_core_source.hpp
trunk/src/core/srs_core.hpp
查看文件 @
5af377e
...
...
@@ -61,4 +61,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
}
\
(
void
)
0
// server info.
#define RTMP_SIG_SRS_NAME "srs(simple rtmp server)"
#define RTMP_SIG_SRS_URL "https://github.com/winlinvip/simple-rtmp-server"
#define RTMP_SIG_SRS_VERSION "0.1"
#endif
\ No newline at end of file
...
...
trunk/src/core/srs_core_client.cpp
查看文件 @
5af377e
...
...
@@ -238,7 +238,7 @@ int SrsClient::streaming_publish(SrsSource* source)
SrsPacket
*
pkt
=
msg
->
get_packet
();
if
(
dynamic_cast
<
SrsOnMetaDataPacket
*>
(
pkt
))
{
SrsOnMetaDataPacket
*
metadata
=
dynamic_cast
<
SrsOnMetaDataPacket
*>
(
pkt
);
if
((
ret
=
source
->
on_meta_data
(
metadata
))
!=
ERROR_SUCCESS
)
{
if
((
ret
=
source
->
on_meta_data
(
m
sg
,
m
etadata
))
!=
ERROR_SUCCESS
)
{
srs_error
(
"process onMetaData message failed. ret=%d"
,
ret
);
return
ret
;
}
...
...
trunk/src/core/srs_core_protocol.cpp
查看文件 @
5af377e
...
...
@@ -1089,6 +1089,14 @@ int SrsMessage::encode_packet()
return
packet
->
encode
(
size
,
(
char
*&
)
payload
);
}
SrsSharedMessage
::
SrsSharedMessage
()
{
}
SrsSharedMessage
::~
SrsSharedMessage
()
{
}
SrsPacket
::
SrsPacket
()
{
}
...
...
trunk/src/core/srs_core_protocol.hpp
查看文件 @
5af377e
...
...
@@ -285,6 +285,17 @@ public:
};
/**
* shared ptr message.
* for audio/video/data message that need less memory copy.
*/
class
SrsSharedMessage
:
public
SrsMessage
{
public
:
SrsSharedMessage
();
virtual
~
SrsSharedMessage
();
};
/**
* the decoded message payload.
*/
class
SrsPacket
...
...
trunk/src/core/srs_core_rtmp.cpp
查看文件 @
5af377e
...
...
@@ -35,11 +35,11 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#define RTMP_SIG_FMS_VER "3,5,3,888"
#define RTMP_SIG_AMF0_VER 0
#define RTMP_SIG_SRS_NAME "srs(simple rtmp server)"
#define RTMP_SIG_SRS_URL "https://github.com/winlinvip/simple-rtmp-server"
#define RTMP_SIG_SRS_VERSION "0.1"
#define RTMP_SIG_CLIENT_ID "ASAICiss"
/**
* onStatus consts.
*/
#define StatusLevel "level"
#define StatusCode "code"
#define StatusDescription "description"
...
...
trunk/src/core/srs_core_source.cpp
查看文件 @
5af377e
...
...
@@ -25,6 +25,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <srs_core_log.hpp>
#include <srs_core_protocol.hpp>
#include <srs_core_amf0.hpp>
std
::
map
<
std
::
string
,
SrsSource
*>
SrsSource
::
pool
;
...
...
@@ -64,9 +65,13 @@ SrsSource::~SrsSource()
{
}
int
SrsSource
::
on_meta_data
(
SrsOnMetaDataPacket
*
metadata
)
int
SrsSource
::
on_meta_data
(
Srs
Message
*
msg
,
Srs
OnMetaDataPacket
*
metadata
)
{
int
ret
=
ERROR_SUCCESS
;
metadata
->
metadata
->
set
(
"server"
,
new
SrsAmf0String
(
RTMP_SIG_SRS_NAME
""
RTMP_SIG_SRS_VERSION
));
return
ret
;
}
...
...
trunk/src/core/srs_core_source.hpp
查看文件 @
5af377e
...
...
@@ -75,7 +75,7 @@ public:
SrsSource
(
std
::
string
_stream_url
);
virtual
~
SrsSource
();
public
:
virtual
int
on_meta_data
(
SrsOnMetaDataPacket
*
metadata
);
virtual
int
on_meta_data
(
Srs
Message
*
msg
,
Srs
OnMetaDataPacket
*
metadata
);
virtual
int
on_audio
(
SrsMessage
*
audio
);
virtual
int
on_video
(
SrsMessage
*
video
);
public
:
...
...
请
注册
或
登录
后发表评论