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 19:45:02 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
d8a99dde5276e1aae47d2a194fe51473944f66da
d8a99dde
1 parent
cdd843a6
rename SrsSharedMessage to SrsSharedPtrMessage
隐藏空白字符变更
内嵌
并排对比
正在显示
2 个修改的文件
包含
14 行增加
和
14 行删除
trunk/src/core/srs_core_protocol.cpp
trunk/src/core/srs_core_protocol.hpp
trunk/src/core/srs_core_protocol.cpp
查看文件 @
d8a99dd
...
...
@@ -1112,7 +1112,7 @@ int SrsCommonMessage::encode_packet()
return
packet
->
encode
(
size
,
(
char
*&
)
payload
);
}
SrsSharedMessage
::
SrsSharedPtr
::
SrsSharedPtr
()
SrsShared
Ptr
Message
::
SrsSharedPtr
::
SrsSharedPtr
()
{
payload
=
NULL
;
size
=
0
;
...
...
@@ -1120,21 +1120,21 @@ SrsSharedMessage::SrsSharedPtr::SrsSharedPtr()
shared_count
=
0
;
}
SrsSharedMessage
::
SrsSharedPtr
::~
SrsSharedPtr
()
SrsShared
Ptr
Message
::
SrsSharedPtr
::~
SrsSharedPtr
()
{
srs_freepa
(
payload
);
}
SrsShared
Message
::
SrsShared
Message
()
SrsShared
PtrMessage
::
SrsSharedPtr
Message
()
{
ptr
=
NULL
;
}
SrsShared
Message
::~
SrsShared
Message
()
SrsShared
PtrMessage
::~
SrsSharedPtr
Message
()
{
}
void
SrsSharedMessage
::
free_payload
()
void
SrsShared
Ptr
Message
::
free_payload
()
{
if
(
ptr
)
{
if
(
ptr
->
shared_count
==
0
)
{
...
...
@@ -1145,7 +1145,7 @@ void SrsSharedMessage::free_payload()
}
}
int
SrsSharedMessage
::
initialize
(
SrsMessageHeader
*
header
,
char
*
payload
,
int
size
,
int
perfer_cid
)
int
SrsShared
Ptr
Message
::
initialize
(
SrsMessageHeader
*
header
,
char
*
payload
,
int
size
,
int
perfer_cid
)
{
int
ret
=
ERROR_SUCCESS
;
...
...
@@ -1170,7 +1170,7 @@ int SrsSharedMessage::initialize(SrsMessageHeader* header, char* payload, int si
return
ret
;
}
SrsShared
Message
*
SrsShared
Message
::
copy
()
SrsShared
PtrMessage
*
SrsSharedPtr
Message
::
copy
()
{
if
(
!
ptr
)
{
srs_error
(
"invoke initialize to initialize the ptr."
);
...
...
@@ -1178,7 +1178,7 @@ SrsSharedMessage* SrsSharedMessage::copy()
return
NULL
;
}
SrsShared
Message
*
copy
=
new
SrsShared
Message
();
SrsShared
PtrMessage
*
copy
=
new
SrsSharedPtr
Message
();
copy
->
ptr
=
ptr
;
ptr
->
shared_count
++
;
...
...
@@ -1188,7 +1188,7 @@ SrsSharedMessage* SrsSharedMessage::copy()
return
copy
;
}
int
SrsSharedMessage
::
get_perfer_cid
()
int
SrsShared
Ptr
Message
::
get_perfer_cid
()
{
if
(
!
ptr
)
{
return
0
;
...
...
@@ -1197,7 +1197,7 @@ int SrsSharedMessage::get_perfer_cid()
return
ptr
->
perfer_cid
;
}
int
SrsSharedMessage
::
encode_packet
()
int
SrsShared
Ptr
Message
::
encode_packet
()
{
srs_verbose
(
"shared message ignore the encode method."
);
return
ERROR_SUCCESS
;
...
...
trunk/src/core/srs_core_protocol.hpp
查看文件 @
d8a99dd
...
...
@@ -324,7 +324,7 @@ public:
* for audio/video/data message that need less memory copy.
* and only for output.
*/
class
SrsSharedMessage
:
public
SrsOutputableMessage
class
SrsShared
Ptr
Message
:
public
SrsOutputableMessage
{
private
:
typedef
SrsOutputableMessage
super
;
...
...
@@ -341,8 +341,8 @@ private:
};
SrsSharedPtr
*
ptr
;
public
:
SrsSharedMessage
();
virtual
~
SrsSharedMessage
();
SrsSharedPtrMessage
();
virtual
~
SrsSharedPtrMessage
();
protected
:
virtual
void
free_payload
();
public
:
...
...
@@ -350,7 +350,7 @@ public:
* set the shared payload.
*/
virtual
int
initialize
(
SrsMessageHeader
*
header
,
char
*
payload
,
int
size
,
int
perfer_cid
);
virtual
SrsSharedMessage
*
copy
();
virtual
SrsShared
Ptr
Message
*
copy
();
public
:
/**
* get the perfered cid(chunk stream id) which sendout over.
...
...
请
注册
或
登录
后发表评论