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-19 09:00:17 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
56e78bdf6f3699b61086843cb2e64b43a70df773
56e78bdf
1 parent
a323483b
add comments. refine naming
隐藏空白字符变更
内嵌
并排对比
正在显示
10 个修改的文件
包含
53 行增加
和
10 行删除
trunk/src/core/srs_core.hpp
trunk/src/core/srs_core_auto_free.hpp
trunk/src/core/srs_core_buffer.cpp
trunk/src/core/srs_core_buffer.hpp
trunk/src/core/srs_core_client.hpp
trunk/src/core/srs_core_conn.cpp
trunk/src/core/srs_core_protocol.hpp
trunk/src/core/srs_core_rtmp.hpp
trunk/src/core/srs_core_server.cpp
trunk/src/core/srs_core_socket.hpp
trunk/src/core/srs_core.hpp
查看文件 @
56e78bd
...
...
@@ -28,7 +28,11 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <srs_core.hpp>
*/
// user must include the srs_core.hpp before any header.
/**
* the core provides the common defined macros, utilities,
* user must include the srs_core.hpp before any header, or maybe
* build failed.
*/
// for int64_t print using PRId64 format.
#ifndef __STDC_FORMAT_MACROS
...
...
@@ -36,6 +40,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#endif
#include <assert.h>
#define
SrsA
ssert(expression) assert(expression)
#define
srs_a
ssert(expression) assert(expression)
#endif
\ No newline at end of file
...
...
trunk/src/core/srs_core_auto_free.hpp
查看文件 @
56e78bd
...
...
@@ -36,10 +36,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* auto free the instance in the current scope.
*/
#define SrsAutoFree(className, instance, is_array) \
c
__SrsAutoFree
<
className
>
_auto_free_
##
instance
(
&
instance
,
is_array
)
__SrsAutoFree
<
className
>
_auto_free_
##
instance
(
&
instance
,
is_array
)
template
<
class
T
>
class
c
__SrsAutoFree
class
__SrsAutoFree
{
private
:
T
**
ptr
;
...
...
@@ -49,12 +49,12 @@ public:
* auto delete the ptr.
* @is_array a bool value indicates whether the ptr is a array.
*/
c
__SrsAutoFree
(
T
**
_ptr
,
bool
_is_array
){
__SrsAutoFree
(
T
**
_ptr
,
bool
_is_array
){
ptr
=
_ptr
;
is_array
=
_is_array
;
}
virtual
~
c
__SrsAutoFree
(){
virtual
~
__SrsAutoFree
(){
if
(
ptr
==
NULL
||
*
ptr
==
NULL
)
{
return
;
}
...
...
trunk/src/core/srs_core_buffer.cpp
查看文件 @
56e78bd
...
...
@@ -22,3 +22,12 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <srs_core_buffer.hpp>
SrsBuffer
::
SrsBuffer
()
{
}
SrsBuffer
::~
SrsBuffer
()
{
}
...
...
trunk/src/core/srs_core_buffer.hpp
查看文件 @
56e78bd
...
...
@@ -30,4 +30,16 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <srs_core.hpp>
/**
* the buffer provices bytes cache for protocol. generally,
* protocol recv data from socket, put into buffer, decode to RTMP message.
* protocol encode RTMP message to bytes, put into buffer, send to socket.
*/
class
SrsBuffer
{
public
:
SrsBuffer
();
virtual
~
SrsBuffer
();
};
#endif
\ No newline at end of file
...
...
trunk/src/core/srs_core_client.hpp
查看文件 @
56e78bd
...
...
@@ -33,6 +33,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <srs_core_conn.hpp>
class
SrsRtmp
;
/**
* the client provides the main logic control for RTMP clients.
*/
class
SrsClient
:
public
SrsConnection
{
private
:
...
...
trunk/src/core/srs_core_conn.cpp
查看文件 @
56e78bd
...
...
@@ -83,7 +83,7 @@ void SrsConnection::cycle()
void
*
SrsConnection
::
cycle_thread
(
void
*
arg
)
{
SrsConnection
*
conn
=
(
SrsConnection
*
)
arg
;
SrsA
ssert
(
conn
!=
NULL
);
srs_a
ssert
(
conn
!=
NULL
);
conn
->
cycle
();
...
...
trunk/src/core/srs_core_protocol.hpp
查看文件 @
56e78bd
...
...
@@ -32,6 +32,11 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <st.h>
/**
* the protocol provides the rtmp-message-protocol services,
* to recv RTMP message from RTMP chunk stream,
* and to send out RTMP message over RTMP chunk stream.
*/
class
SrsProtocol
{
private
:
...
...
trunk/src/core/srs_core_rtmp.hpp
查看文件 @
56e78bd
...
...
@@ -34,13 +34,19 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <st.h>
class
SrsProtocol
;
struct
SrsApp
{
std
::
string
vhost
;
std
::
string
app
;
};
class
SrsProtocol
;
/**
* the rtmp provices rtmp-command-protocol services,
* a high level protocol, media stream oriented services,
* such as connect to vhost/app, play stream, get audio/video data.
*/
class
SrsRtmp
{
private
:
...
...
trunk/src/core/srs_core_server.cpp
查看文件 @
56e78bd
...
...
@@ -203,7 +203,7 @@ void SrsServer::listen_cycle()
void
*
SrsServer
::
listen_thread
(
void
*
arg
)
{
SrsServer
*
server
=
(
SrsServer
*
)
arg
;
SrsA
ssert
(
server
!=
NULL
);
srs_a
ssert
(
server
!=
NULL
);
server
->
listen_cycle
();
...
...
trunk/src/core/srs_core_socket.hpp
查看文件 @
56e78bd
...
...
@@ -32,7 +32,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <st.h>
// the socket base on st.
/**
* the socket provides TCP socket over st,
* that is, the sync socket mechanism.
*/
class
Socket
{
private
:
...
...
请
注册
或
登录
后发表评论