mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
rename SrsFastBuffer to SrsFastStream
This commit is contained in:
parent
4f3d2c8607
commit
d32632ee8a
18 changed files with 50 additions and 50 deletions
2
trunk/configure
vendored
2
trunk/configure
vendored
|
@ -158,7 +158,7 @@ MODULE_ID="PROTOCOL"
|
||||||
MODULE_DEPENDS=("CORE" "KERNEL")
|
MODULE_DEPENDS=("CORE" "KERNEL")
|
||||||
ModuleLibIncs=(${SRS_OBJS_DIR} ${LibSSLRoot})
|
ModuleLibIncs=(${SRS_OBJS_DIR} ${LibSSLRoot})
|
||||||
MODULE_FILES=("srs_rtmp_amf0" "srs_rtmp_io" "srs_rtmp_stack"
|
MODULE_FILES=("srs_rtmp_amf0" "srs_rtmp_io" "srs_rtmp_stack"
|
||||||
"srs_rtmp_handshake" "srs_rtmp_utility" "srs_rtmp_msg_array" "srs_protocol_buffer"
|
"srs_rtmp_handshake" "srs_rtmp_utility" "srs_rtmp_msg_array" "srs_protocol_stream"
|
||||||
"srs_raw_avc" "srs_rtsp_stack" "srs_http_stack" "srs_protocol_kbps" "srs_protocol_json"
|
"srs_raw_avc" "srs_rtsp_stack" "srs_http_stack" "srs_protocol_kbps" "srs_protocol_json"
|
||||||
"srs_kafka_stack")
|
"srs_kafka_stack")
|
||||||
PROTOCOL_INCS="src/protocol"; MODULE_DIR=${PROTOCOL_INCS} . auto/modules.sh
|
PROTOCOL_INCS="src/protocol"; MODULE_DIR=${PROTOCOL_INCS} . auto/modules.sh
|
||||||
|
|
|
@ -58,8 +58,8 @@ file
|
||||||
../../src/protocol/srs_raw_avc.cpp,
|
../../src/protocol/srs_raw_avc.cpp,
|
||||||
../../src/protocol/srs_rtmp_amf0.hpp,
|
../../src/protocol/srs_rtmp_amf0.hpp,
|
||||||
../../src/protocol/srs_rtmp_amf0.cpp,
|
../../src/protocol/srs_rtmp_amf0.cpp,
|
||||||
../../src/protocol/srs_protocol_buffer.hpp,
|
../../src/protocol/srs_protocol_stream.hpp,
|
||||||
../../src/protocol/srs_protocol_buffer.cpp,
|
../../src/protocol/srs_protocol_stream.cpp,
|
||||||
../../src/protocol/srs_protocol_json.hpp,
|
../../src/protocol/srs_protocol_json.hpp,
|
||||||
../../src/protocol/srs_protocol_json.cpp,
|
../../src/protocol/srs_protocol_json.cpp,
|
||||||
../../src/protocol/srs_rtmp_handshake.hpp,
|
../../src/protocol/srs_rtmp_handshake.hpp,
|
||||||
|
|
|
@ -122,7 +122,7 @@
|
||||||
<ClInclude Include="..\..\src\protocol\srs_http_stack.hpp" />
|
<ClInclude Include="..\..\src\protocol\srs_http_stack.hpp" />
|
||||||
<ClInclude Include="..\..\src\protocol\srs_raw_avc.hpp" />
|
<ClInclude Include="..\..\src\protocol\srs_raw_avc.hpp" />
|
||||||
<ClInclude Include="..\..\src\protocol\srs_rtmp_amf0.hpp" />
|
<ClInclude Include="..\..\src\protocol\srs_rtmp_amf0.hpp" />
|
||||||
<ClInclude Include="..\..\src\protocol\srs_protocol_buffer.hpp" />
|
<ClInclude Include="..\..\src\protocol\srs_protocol_stream.hpp" />
|
||||||
<ClInclude Include="..\..\src\protocol\srs_rtmp_handshake.hpp" />
|
<ClInclude Include="..\..\src\protocol\srs_rtmp_handshake.hpp" />
|
||||||
<ClInclude Include="..\..\src\protocol\srs_rtmp_io.hpp" />
|
<ClInclude Include="..\..\src\protocol\srs_rtmp_io.hpp" />
|
||||||
<ClInclude Include="..\..\src\protocol\srs_rtmp_msg_array.hpp" />
|
<ClInclude Include="..\..\src\protocol\srs_rtmp_msg_array.hpp" />
|
||||||
|
@ -205,7 +205,7 @@
|
||||||
<ClCompile Include="..\..\src\protocol\srs_http_stack.cpp" />
|
<ClCompile Include="..\..\src\protocol\srs_http_stack.cpp" />
|
||||||
<ClCompile Include="..\..\src\protocol\srs_raw_avc.cpp" />
|
<ClCompile Include="..\..\src\protocol\srs_raw_avc.cpp" />
|
||||||
<ClCompile Include="..\..\src\protocol\srs_rtmp_amf0.cpp" />
|
<ClCompile Include="..\..\src\protocol\srs_rtmp_amf0.cpp" />
|
||||||
<ClCompile Include="..\..\src\protocol\srs_protocol_buffer.cpp" />
|
<ClCompile Include="..\..\src\protocol\srs_protocol_stream.cpp" />
|
||||||
<ClCompile Include="..\..\src\protocol\srs_rtmp_handshake.cpp" />
|
<ClCompile Include="..\..\src\protocol\srs_rtmp_handshake.cpp" />
|
||||||
<ClCompile Include="..\..\src\protocol\srs_rtmp_io.cpp" />
|
<ClCompile Include="..\..\src\protocol\srs_rtmp_io.cpp" />
|
||||||
<ClCompile Include="..\..\src\protocol\srs_rtmp_msg_array.cpp" />
|
<ClCompile Include="..\..\src\protocol\srs_rtmp_msg_array.cpp" />
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
3C036B551B2D0AC10078E2E0 /* srs_app_http_static.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3C036B511B2D0AC10078E2E0 /* srs_app_http_static.cpp */; };
|
3C036B551B2D0AC10078E2E0 /* srs_app_http_static.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3C036B511B2D0AC10078E2E0 /* srs_app_http_static.cpp */; };
|
||||||
3C036B561B2D0AC10078E2E0 /* srs_app_http_stream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3C036B531B2D0AC10078E2E0 /* srs_app_http_stream.cpp */; };
|
3C036B561B2D0AC10078E2E0 /* srs_app_http_stream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3C036B531B2D0AC10078E2E0 /* srs_app_http_stream.cpp */; };
|
||||||
3C068D6A1B10149F00AA722C /* srs_protocol_kbps.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3C068D681B10149F00AA722C /* srs_protocol_kbps.cpp */; };
|
3C068D6A1B10149F00AA722C /* srs_protocol_kbps.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3C068D681B10149F00AA722C /* srs_protocol_kbps.cpp */; };
|
||||||
3C068D6D1B10175500AA722C /* srs_protocol_buffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3C068D6B1B10175500AA722C /* srs_protocol_buffer.cpp */; };
|
3C068D6D1B10175500AA722C /* srs_protocol_stream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3C068D6B1B10175500AA722C /* srs_protocol_stream.cpp */; };
|
||||||
3C0D422E1B87165900C2508B /* srs_protocol_json.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3C0D422C1B87165900C2508B /* srs_protocol_json.cpp */; };
|
3C0D422E1B87165900C2508B /* srs_protocol_json.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3C0D422C1B87165900C2508B /* srs_protocol_json.cpp */; };
|
||||||
3C0E1B8D1B0F5ADF003ADEF7 /* srs_http_stack.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3C0E1B8B1B0F5ADF003ADEF7 /* srs_http_stack.cpp */; };
|
3C0E1B8D1B0F5ADF003ADEF7 /* srs_http_stack.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3C0E1B8B1B0F5ADF003ADEF7 /* srs_http_stack.cpp */; };
|
||||||
3C1231F61AAE652D00CE8F6C /* srs_core_autofree.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3C1231F01AAE652C00CE8F6C /* srs_core_autofree.cpp */; };
|
3C1231F61AAE652D00CE8F6C /* srs_core_autofree.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3C1231F01AAE652C00CE8F6C /* srs_core_autofree.cpp */; };
|
||||||
|
@ -132,8 +132,8 @@
|
||||||
3C036B541B2D0AC10078E2E0 /* srs_app_http_stream.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = srs_app_http_stream.hpp; path = ../../../src/app/srs_app_http_stream.hpp; sourceTree = "<group>"; };
|
3C036B541B2D0AC10078E2E0 /* srs_app_http_stream.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = srs_app_http_stream.hpp; path = ../../../src/app/srs_app_http_stream.hpp; sourceTree = "<group>"; };
|
||||||
3C068D681B10149F00AA722C /* srs_protocol_kbps.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = srs_protocol_kbps.cpp; path = ../../../src/protocol/srs_protocol_kbps.cpp; sourceTree = "<group>"; };
|
3C068D681B10149F00AA722C /* srs_protocol_kbps.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = srs_protocol_kbps.cpp; path = ../../../src/protocol/srs_protocol_kbps.cpp; sourceTree = "<group>"; };
|
||||||
3C068D691B10149F00AA722C /* srs_protocol_kbps.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = srs_protocol_kbps.hpp; path = ../../../src/protocol/srs_protocol_kbps.hpp; sourceTree = "<group>"; };
|
3C068D691B10149F00AA722C /* srs_protocol_kbps.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = srs_protocol_kbps.hpp; path = ../../../src/protocol/srs_protocol_kbps.hpp; sourceTree = "<group>"; };
|
||||||
3C068D6B1B10175500AA722C /* srs_protocol_buffer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = srs_protocol_buffer.cpp; path = ../../../src/protocol/srs_protocol_buffer.cpp; sourceTree = "<group>"; };
|
3C068D6B1B10175500AA722C /* srs_protocol_stream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = srs_protocol_stream.cpp; path = ../../../src/protocol/srs_protocol_stream.cpp; sourceTree = "<group>"; };
|
||||||
3C068D6C1B10175500AA722C /* srs_protocol_buffer.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = srs_protocol_buffer.hpp; path = ../../../src/protocol/srs_protocol_buffer.hpp; sourceTree = "<group>"; };
|
3C068D6C1B10175500AA722C /* srs_protocol_stream.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = srs_protocol_stream.hpp; path = ../../../src/protocol/srs_protocol_stream.hpp; sourceTree = "<group>"; };
|
||||||
3C0D422C1B87165900C2508B /* srs_protocol_json.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = srs_protocol_json.cpp; path = ../../../src/protocol/srs_protocol_json.cpp; sourceTree = "<group>"; };
|
3C0D422C1B87165900C2508B /* srs_protocol_json.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = srs_protocol_json.cpp; path = ../../../src/protocol/srs_protocol_json.cpp; sourceTree = "<group>"; };
|
||||||
3C0D422D1B87165900C2508B /* srs_protocol_json.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = srs_protocol_json.hpp; path = ../../../src/protocol/srs_protocol_json.hpp; sourceTree = "<group>"; };
|
3C0D422D1B87165900C2508B /* srs_protocol_json.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = srs_protocol_json.hpp; path = ../../../src/protocol/srs_protocol_json.hpp; sourceTree = "<group>"; };
|
||||||
3C0E1B8B1B0F5ADF003ADEF7 /* srs_http_stack.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = srs_http_stack.cpp; path = ../../../src/protocol/srs_http_stack.cpp; sourceTree = "<group>"; };
|
3C0E1B8B1B0F5ADF003ADEF7 /* srs_http_stack.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = srs_http_stack.cpp; path = ../../../src/protocol/srs_http_stack.cpp; sourceTree = "<group>"; };
|
||||||
|
@ -512,8 +512,8 @@
|
||||||
3C0E1B8C1B0F5ADF003ADEF7 /* srs_http_stack.hpp */,
|
3C0E1B8C1B0F5ADF003ADEF7 /* srs_http_stack.hpp */,
|
||||||
3C82802A1BAFF8CC004A1794 /* srs_kafka_stack.cpp */,
|
3C82802A1BAFF8CC004A1794 /* srs_kafka_stack.cpp */,
|
||||||
3C82802B1BAFF8CC004A1794 /* srs_kafka_stack.hpp */,
|
3C82802B1BAFF8CC004A1794 /* srs_kafka_stack.hpp */,
|
||||||
3C068D6B1B10175500AA722C /* srs_protocol_buffer.cpp */,
|
3C068D6B1B10175500AA722C /* srs_protocol_stream.cpp */,
|
||||||
3C068D6C1B10175500AA722C /* srs_protocol_buffer.hpp */,
|
3C068D6C1B10175500AA722C /* srs_protocol_stream.hpp */,
|
||||||
3C0D422C1B87165900C2508B /* srs_protocol_json.cpp */,
|
3C0D422C1B87165900C2508B /* srs_protocol_json.cpp */,
|
||||||
3C0D422D1B87165900C2508B /* srs_protocol_json.hpp */,
|
3C0D422D1B87165900C2508B /* srs_protocol_json.hpp */,
|
||||||
3C068D681B10149F00AA722C /* srs_protocol_kbps.cpp */,
|
3C068D681B10149F00AA722C /* srs_protocol_kbps.cpp */,
|
||||||
|
@ -955,7 +955,7 @@
|
||||||
3C28EDDF1AF5C43F00A3AEAC /* srs_app_caster_flv.cpp in Sources */,
|
3C28EDDF1AF5C43F00A3AEAC /* srs_app_caster_flv.cpp in Sources */,
|
||||||
3C1232241AAE814D00CE8F6C /* srs_kernel_error.cpp in Sources */,
|
3C1232241AAE814D00CE8F6C /* srs_kernel_error.cpp in Sources */,
|
||||||
3C036B561B2D0AC10078E2E0 /* srs_app_http_stream.cpp in Sources */,
|
3C036B561B2D0AC10078E2E0 /* srs_app_http_stream.cpp in Sources */,
|
||||||
3C068D6D1B10175500AA722C /* srs_protocol_buffer.cpp in Sources */,
|
3C068D6D1B10175500AA722C /* srs_protocol_stream.cpp in Sources */,
|
||||||
3C1232441AAE81A400CE8F6C /* srs_rtmp_handshake.cpp in Sources */,
|
3C1232441AAE81A400CE8F6C /* srs_rtmp_handshake.cpp in Sources */,
|
||||||
3C1232291AAE814D00CE8F6C /* srs_kernel_buffer.cpp in Sources */,
|
3C1232291AAE814D00CE8F6C /* srs_kernel_buffer.cpp in Sources */,
|
||||||
3C663F181AB0155100286D8B /* srs_play.c in Sources */,
|
3C663F181AB0155100286D8B /* srs_play.c in Sources */,
|
||||||
|
|
|
@ -46,7 +46,7 @@ using namespace std;
|
||||||
#include <srs_kernel_utility.hpp>
|
#include <srs_kernel_utility.hpp>
|
||||||
#include <srs_kernel_codec.hpp>
|
#include <srs_kernel_codec.hpp>
|
||||||
#include <srs_kernel_file.hpp>
|
#include <srs_kernel_file.hpp>
|
||||||
#include <srs_protocol_buffer.hpp>
|
#include <srs_protocol_stream.hpp>
|
||||||
#include <srs_kernel_ts.hpp>
|
#include <srs_kernel_ts.hpp>
|
||||||
#include <srs_app_utility.hpp>
|
#include <srs_app_utility.hpp>
|
||||||
#include <srs_app_http_hooks.hpp>
|
#include <srs_app_http_hooks.hpp>
|
||||||
|
|
|
@ -33,7 +33,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
#include <srs_protocol_buffer.hpp>
|
#include <srs_protocol_stream.hpp>
|
||||||
#include <srs_rtmp_utility.hpp>
|
#include <srs_rtmp_utility.hpp>
|
||||||
#include <srs_kernel_log.hpp>
|
#include <srs_kernel_log.hpp>
|
||||||
#include <srs_kernel_error.hpp>
|
#include <srs_kernel_error.hpp>
|
||||||
|
@ -317,7 +317,7 @@ SrsHttpResponseReader::~SrsHttpResponseReader()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
int SrsHttpResponseReader::initialize(SrsFastBuffer* body)
|
int SrsHttpResponseReader::initialize(SrsFastStream* body)
|
||||||
{
|
{
|
||||||
int ret = ERROR_SUCCESS;
|
int ret = ERROR_SUCCESS;
|
||||||
|
|
||||||
|
@ -512,7 +512,7 @@ SrsHttpMessage::~SrsHttpMessage()
|
||||||
srs_freep(_http_ts_send_buffer);
|
srs_freep(_http_ts_send_buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
int SrsHttpMessage::update(string url, bool allow_jsonp, http_parser* header, SrsFastBuffer* body, vector<SrsHttpHeaderField>& headers)
|
int SrsHttpMessage::update(string url, bool allow_jsonp, http_parser* header, SrsFastStream* body, vector<SrsHttpHeaderField>& headers)
|
||||||
{
|
{
|
||||||
int ret = ERROR_SUCCESS;
|
int ret = ERROR_SUCCESS;
|
||||||
|
|
||||||
|
@ -845,7 +845,7 @@ bool SrsHttpMessage::is_jsonp()
|
||||||
|
|
||||||
SrsHttpParser::SrsHttpParser()
|
SrsHttpParser::SrsHttpParser()
|
||||||
{
|
{
|
||||||
buffer = new SrsFastBuffer();
|
buffer = new SrsFastStream();
|
||||||
}
|
}
|
||||||
|
|
||||||
SrsHttpParser::~SrsHttpParser()
|
SrsHttpParser::~SrsHttpParser()
|
||||||
|
|
|
@ -63,7 +63,7 @@ class SrsHttpHandler;
|
||||||
class SrsMessageQueue;
|
class SrsMessageQueue;
|
||||||
class SrsSharedPtrMessage;
|
class SrsSharedPtrMessage;
|
||||||
class SrsRequest;
|
class SrsRequest;
|
||||||
class SrsFastBuffer;
|
class SrsFastStream;
|
||||||
class SrsHttpUri;
|
class SrsHttpUri;
|
||||||
class SrsConnection;
|
class SrsConnection;
|
||||||
class SrsHttpMessage;
|
class SrsHttpMessage;
|
||||||
|
@ -122,7 +122,7 @@ class SrsHttpResponseReader : virtual public ISrsHttpResponseReader
|
||||||
private:
|
private:
|
||||||
SrsStSocket* skt;
|
SrsStSocket* skt;
|
||||||
SrsHttpMessage* owner;
|
SrsHttpMessage* owner;
|
||||||
SrsFastBuffer* buffer;
|
SrsFastStream* buffer;
|
||||||
bool is_eof;
|
bool is_eof;
|
||||||
// the left bytes in chunk.
|
// the left bytes in chunk.
|
||||||
int nb_left_chunk;
|
int nb_left_chunk;
|
||||||
|
@ -137,7 +137,7 @@ public:
|
||||||
/**
|
/**
|
||||||
* initialize the response reader with buffer.
|
* initialize the response reader with buffer.
|
||||||
*/
|
*/
|
||||||
virtual int initialize(SrsFastBuffer* buffer);
|
virtual int initialize(SrsFastStream* buffer);
|
||||||
// interface ISrsHttpResponseReader
|
// interface ISrsHttpResponseReader
|
||||||
public:
|
public:
|
||||||
virtual bool eof();
|
virtual bool eof();
|
||||||
|
@ -215,7 +215,7 @@ public:
|
||||||
* set the original messages, then update the message.
|
* set the original messages, then update the message.
|
||||||
*/
|
*/
|
||||||
virtual int update(std::string url, bool allow_jsonp, http_parser* header,
|
virtual int update(std::string url, bool allow_jsonp, http_parser* header,
|
||||||
SrsFastBuffer* body, std::vector<SrsHttpHeaderField>& headers
|
SrsFastStream* body, std::vector<SrsHttpHeaderField>& headers
|
||||||
);
|
);
|
||||||
public:
|
public:
|
||||||
virtual SrsConnection* connection();
|
virtual SrsConnection* connection();
|
||||||
|
@ -303,7 +303,7 @@ private:
|
||||||
http_parser_settings settings;
|
http_parser_settings settings;
|
||||||
http_parser parser;
|
http_parser parser;
|
||||||
// the global parse buffer.
|
// the global parse buffer.
|
||||||
SrsFastBuffer* buffer;
|
SrsFastStream* buffer;
|
||||||
// whether allow jsonp parse.
|
// whether allow jsonp parse.
|
||||||
bool jsonp;
|
bool jsonp;
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -33,7 +33,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
#include <srs_protocol_buffer.hpp>
|
#include <srs_protocol_stream.hpp>
|
||||||
#include <srs_rtmp_utility.hpp>
|
#include <srs_rtmp_utility.hpp>
|
||||||
#include <srs_kernel_log.hpp>
|
#include <srs_kernel_log.hpp>
|
||||||
#include <srs_kernel_error.hpp>
|
#include <srs_kernel_error.hpp>
|
||||||
|
|
|
@ -35,7 +35,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
#include <srs_protocol_buffer.hpp>
|
#include <srs_protocol_stream.hpp>
|
||||||
#include <srs_rtmp_utility.hpp>
|
#include <srs_rtmp_utility.hpp>
|
||||||
#include <srs_kernel_log.hpp>
|
#include <srs_kernel_log.hpp>
|
||||||
#include <srs_kernel_error.hpp>
|
#include <srs_kernel_error.hpp>
|
||||||
|
|
|
@ -26,7 +26,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
#include <srs_rtmp_stack.hpp>
|
#include <srs_rtmp_stack.hpp>
|
||||||
#include <srs_rtmp_stack.hpp>
|
#include <srs_rtmp_stack.hpp>
|
||||||
#include <srs_app_rtmp_conn.hpp>
|
#include <srs_app_rtmp_conn.hpp>
|
||||||
#include <srs_protocol_buffer.hpp>
|
#include <srs_protocol_stream.hpp>
|
||||||
#include <srs_kernel_utility.hpp>
|
#include <srs_kernel_utility.hpp>
|
||||||
#include <srs_core_performance.hpp>
|
#include <srs_core_performance.hpp>
|
||||||
#include <srs_app_config.hpp>
|
#include <srs_app_config.hpp>
|
||||||
|
|
|
@ -33,7 +33,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include <srs_app_thread.hpp>
|
#include <srs_app_thread.hpp>
|
||||||
#include <srs_protocol_buffer.hpp>
|
#include <srs_protocol_stream.hpp>
|
||||||
#include <srs_core_performance.hpp>
|
#include <srs_core_performance.hpp>
|
||||||
#include <srs_app_reload.hpp>
|
#include <srs_app_reload.hpp>
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <srs_protocol_buffer.hpp>
|
#include <srs_protocol_stream.hpp>
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ IMergeReadHandler::~IMergeReadHandler()
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
SrsFastBuffer::SrsFastBuffer()
|
SrsFastStream::SrsFastStream()
|
||||||
{
|
{
|
||||||
#ifdef SRS_PERF_MERGED_READ
|
#ifdef SRS_PERF_MERGED_READ
|
||||||
merged_read = false;
|
merged_read = false;
|
||||||
|
@ -64,23 +64,23 @@ SrsFastBuffer::SrsFastBuffer()
|
||||||
p = end = buffer;
|
p = end = buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
SrsFastBuffer::~SrsFastBuffer()
|
SrsFastStream::~SrsFastStream()
|
||||||
{
|
{
|
||||||
free(buffer);
|
free(buffer);
|
||||||
buffer = NULL;
|
buffer = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
int SrsFastBuffer::size()
|
int SrsFastStream::size()
|
||||||
{
|
{
|
||||||
return (int)(end - p);
|
return (int)(end - p);
|
||||||
}
|
}
|
||||||
|
|
||||||
char* SrsFastBuffer::bytes()
|
char* SrsFastStream::bytes()
|
||||||
{
|
{
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SrsFastBuffer::set_buffer(int buffer_size)
|
void SrsFastStream::set_buffer(int buffer_size)
|
||||||
{
|
{
|
||||||
// never exceed the max size.
|
// never exceed the max size.
|
||||||
if (buffer_size > SRS_MAX_SOCKET_BUFFER) {
|
if (buffer_size > SRS_MAX_SOCKET_BUFFER) {
|
||||||
|
@ -106,13 +106,13 @@ void SrsFastBuffer::set_buffer(int buffer_size)
|
||||||
end = p + nb_bytes;
|
end = p + nb_bytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
char SrsFastBuffer::read_1byte()
|
char SrsFastStream::read_1byte()
|
||||||
{
|
{
|
||||||
srs_assert(end - p >= 1);
|
srs_assert(end - p >= 1);
|
||||||
return *p++;
|
return *p++;
|
||||||
}
|
}
|
||||||
|
|
||||||
char* SrsFastBuffer::read_slice(int size)
|
char* SrsFastStream::read_slice(int size)
|
||||||
{
|
{
|
||||||
srs_assert(size >= 0);
|
srs_assert(size >= 0);
|
||||||
srs_assert(end - p >= size);
|
srs_assert(end - p >= size);
|
||||||
|
@ -124,14 +124,14 @@ char* SrsFastBuffer::read_slice(int size)
|
||||||
return ptr;
|
return ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SrsFastBuffer::skip(int size)
|
void SrsFastStream::skip(int size)
|
||||||
{
|
{
|
||||||
srs_assert(end - p >= size);
|
srs_assert(end - p >= size);
|
||||||
srs_assert(p + size >= buffer);
|
srs_assert(p + size >= buffer);
|
||||||
p += size;
|
p += size;
|
||||||
}
|
}
|
||||||
|
|
||||||
int SrsFastBuffer::grow(ISrsBufferReader* reader, int required_size)
|
int SrsFastStream::grow(ISrsBufferReader* reader, int required_size)
|
||||||
{
|
{
|
||||||
int ret = ERROR_SUCCESS;
|
int ret = ERROR_SUCCESS;
|
||||||
|
|
||||||
|
@ -205,7 +205,7 @@ int SrsFastBuffer::grow(ISrsBufferReader* reader, int required_size)
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef SRS_PERF_MERGED_READ
|
#ifdef SRS_PERF_MERGED_READ
|
||||||
void SrsFastBuffer::set_merge_read(bool v, IMergeReadHandler* handler)
|
void SrsFastStream::set_merge_read(bool v, IMergeReadHandler* handler)
|
||||||
{
|
{
|
||||||
merged_read = v;
|
merged_read = v;
|
||||||
_handler = handler;
|
_handler = handler;
|
||||||
|
|
|
@ -21,11 +21,11 @@ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef SRS_PROTOCOL_BUFFER_HPP
|
#ifndef SRS_PROTOCOL_STREAM_HPP
|
||||||
#define SRS_PROTOCOL_BUFFER_HPP
|
#define SRS_PROTOCOL_STREAM_HPP
|
||||||
|
|
||||||
/*
|
/*
|
||||||
#include <srs_protocol_buffer.hpp>
|
#include <srs_protocol_stream.hpp>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <srs_core.hpp>
|
#include <srs_core.hpp>
|
||||||
|
@ -61,13 +61,13 @@ public:
|
||||||
* protocol recv data from socket, put into buffer, decode to RTMP message.
|
* protocol recv data from socket, put into buffer, decode to RTMP message.
|
||||||
* Usage:
|
* Usage:
|
||||||
* ISrsBufferReader* r = ......;
|
* ISrsBufferReader* r = ......;
|
||||||
* SrsFastBuffer* fb = ......;
|
* SrsFastStream* fb = ......;
|
||||||
* fb->grow(r, 1024);
|
* fb->grow(r, 1024);
|
||||||
* char* header = fb->read_slice(100);
|
* char* header = fb->read_slice(100);
|
||||||
* char* payload = fb->read_payload(924);
|
* char* payload = fb->read_payload(924);
|
||||||
*/
|
*/
|
||||||
// TODO: FIXME: add utest for it.
|
// TODO: FIXME: add utest for it.
|
||||||
class SrsFastBuffer
|
class SrsFastStream
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
#ifdef SRS_PERF_MERGED_READ
|
#ifdef SRS_PERF_MERGED_READ
|
||||||
|
@ -88,8 +88,8 @@ private:
|
||||||
// the size of buffer.
|
// the size of buffer.
|
||||||
int nb_buffer;
|
int nb_buffer;
|
||||||
public:
|
public:
|
||||||
SrsFastBuffer();
|
SrsFastStream();
|
||||||
virtual ~SrsFastBuffer();
|
virtual ~SrsFastStream();
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
* get the size of current bytes in buffer.
|
* get the size of current bytes in buffer.
|
||||||
|
|
|
@ -28,7 +28,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
#include <srs_kernel_buffer.hpp>
|
#include <srs_kernel_buffer.hpp>
|
||||||
#include <srs_core_autofree.hpp>
|
#include <srs_core_autofree.hpp>
|
||||||
#include <srs_kernel_utility.hpp>
|
#include <srs_kernel_utility.hpp>
|
||||||
#include <srs_protocol_buffer.hpp>
|
#include <srs_protocol_stream.hpp>
|
||||||
#include <srs_rtmp_utility.hpp>
|
#include <srs_rtmp_utility.hpp>
|
||||||
#include <srs_rtmp_handshake.hpp>
|
#include <srs_rtmp_handshake.hpp>
|
||||||
|
|
||||||
|
@ -216,7 +216,7 @@ SrsProtocol::AckWindowSize::AckWindowSize()
|
||||||
|
|
||||||
SrsProtocol::SrsProtocol(ISrsProtocolReaderWriter* io)
|
SrsProtocol::SrsProtocol(ISrsProtocolReaderWriter* io)
|
||||||
{
|
{
|
||||||
in_buffer = new SrsFastBuffer();
|
in_buffer = new SrsFastStream();
|
||||||
skt = io;
|
skt = io;
|
||||||
|
|
||||||
in_chunk_size = SRS_CONSTS_RTMP_PROTOCOL_CHUNK_SIZE;
|
in_chunk_size = SRS_CONSTS_RTMP_PROTOCOL_CHUNK_SIZE;
|
||||||
|
|
|
@ -46,7 +46,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
#include <srs_kernel_flv.hpp>
|
#include <srs_kernel_flv.hpp>
|
||||||
|
|
||||||
class ISrsProtocolReaderWriter;
|
class ISrsProtocolReaderWriter;
|
||||||
class SrsFastBuffer;
|
class SrsFastStream;
|
||||||
class SrsPacket;
|
class SrsPacket;
|
||||||
class SrsBuffer;
|
class SrsBuffer;
|
||||||
class SrsAmf0Object;
|
class SrsAmf0Object;
|
||||||
|
@ -222,7 +222,7 @@ private:
|
||||||
/**
|
/**
|
||||||
* bytes buffer cache, recv from skt, provide services for stream.
|
* bytes buffer cache, recv from skt, provide services for stream.
|
||||||
*/
|
*/
|
||||||
SrsFastBuffer* in_buffer;
|
SrsFastStream* in_buffer;
|
||||||
/**
|
/**
|
||||||
* input chunk size, default to 128, set by peer packet.
|
* input chunk size, default to 128, set by peer packet.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -267,7 +267,7 @@ VOID TEST(KernelBufferTest, EraseBytes)
|
||||||
|
|
||||||
VOID TEST(KernelFastBufferTest, Grow)
|
VOID TEST(KernelFastBufferTest, Grow)
|
||||||
{
|
{
|
||||||
SrsFastBuffer b;
|
SrsFastStream b;
|
||||||
MockBufferReader r("winlin");
|
MockBufferReader r("winlin");
|
||||||
|
|
||||||
b.grow(&r, 1);
|
b.grow(&r, 1);
|
||||||
|
|
|
@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <srs_kernel_file.hpp>
|
#include <srs_kernel_file.hpp>
|
||||||
#include <srs_protocol_buffer.hpp>
|
#include <srs_protocol_stream.hpp>
|
||||||
|
|
||||||
class MockBufferReader: public ISrsBufferReader
|
class MockBufferReader: public ISrsBufferReader
|
||||||
{
|
{
|
||||||
|
|
|
@ -34,7 +34,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
#include <srs_rtmp_stack.hpp>
|
#include <srs_rtmp_stack.hpp>
|
||||||
#include <srs_rtmp_handshake.hpp>
|
#include <srs_rtmp_handshake.hpp>
|
||||||
#include <srs_protocol_buffer.hpp>
|
#include <srs_protocol_stream.hpp>
|
||||||
|
|
||||||
#ifdef SRS_AUTO_SSL
|
#ifdef SRS_AUTO_SSL
|
||||||
using namespace _srs_internal;
|
using namespace _srs_internal;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue