winlin

add kafka protocol files.

@@ -159,7 +159,8 @@ MODULE_DEPENDS=("CORE" "KERNEL") @@ -159,7 +159,8 @@ MODULE_DEPENDS=("CORE" "KERNEL")
159 ModuleLibIncs=(${SRS_OBJS_DIR} ${LibSSLRoot}) 159 ModuleLibIncs=(${SRS_OBJS_DIR} ${LibSSLRoot})
160 MODULE_FILES=("srs_rtmp_amf0" "srs_rtmp_io" "srs_rtmp_stack" 160 MODULE_FILES=("srs_rtmp_amf0" "srs_rtmp_io" "srs_rtmp_stack"
161 "srs_rtmp_handshake" "srs_rtmp_utility" "srs_rtmp_msg_array" "srs_protocol_buffer" 161 "srs_rtmp_handshake" "srs_rtmp_utility" "srs_rtmp_msg_array" "srs_protocol_buffer"
162 - "srs_raw_avc" "srs_rtsp_stack" "srs_http_stack" "srs_protocol_kbps" "srs_protocol_json") 162 + "srs_raw_avc" "srs_rtsp_stack" "srs_http_stack" "srs_protocol_kbps" "srs_protocol_json"
  163 + "srs_kafka_stack")
163 PROTOCOL_INCS="src/protocol"; MODULE_DIR=${PROTOCOL_INCS} . auto/modules.sh 164 PROTOCOL_INCS="src/protocol"; MODULE_DIR=${PROTOCOL_INCS} . auto/modules.sh
164 PROTOCOL_OBJS="${MODULE_OBJS[@]}" 165 PROTOCOL_OBJS="${MODULE_OBJS[@]}"
165 # 166 #
@@ -50,6 +50,8 @@ file @@ -50,6 +50,8 @@ file
50 protocol readonly separator, 50 protocol readonly separator,
51 ../../src/protocol/srs_http_stack.hpp, 51 ../../src/protocol/srs_http_stack.hpp,
52 ../../src/protocol/srs_http_stack.cpp, 52 ../../src/protocol/srs_http_stack.cpp,
  53 + ../../src/protocol/srs_kafka_stack.hpp,
  54 + ../../src/protocol/srs_kafka_stack.cpp,
53 ../../src/protocol/srs_protocol_kbps.hpp, 55 ../../src/protocol/srs_protocol_kbps.hpp,
54 ../../src/protocol/srs_protocol_kbps.cpp, 56 ../../src/protocol/srs_protocol_kbps.cpp,
55 ../../src/protocol/srs_raw_avc.hpp, 57 ../../src/protocol/srs_raw_avc.hpp,
@@ -101,6 +101,7 @@ @@ -101,6 +101,7 @@
101 3C689F9F1AB6AAC800C9CEEE /* sched.c in Sources */ = {isa = PBXBuildFile; fileRef = 3C689F9B1AB6AAC800C9CEEE /* sched.c */; }; 101 3C689F9F1AB6AAC800C9CEEE /* sched.c in Sources */ = {isa = PBXBuildFile; fileRef = 3C689F9B1AB6AAC800C9CEEE /* sched.c */; };
102 3C689FA01AB6AAC800C9CEEE /* stk.c in Sources */ = {isa = PBXBuildFile; fileRef = 3C689F9C1AB6AAC800C9CEEE /* stk.c */; }; 102 3C689FA01AB6AAC800C9CEEE /* stk.c in Sources */ = {isa = PBXBuildFile; fileRef = 3C689F9C1AB6AAC800C9CEEE /* stk.c */; };
103 3C689FA11AB6AAC800C9CEEE /* sync.c in Sources */ = {isa = PBXBuildFile; fileRef = 3C689F9D1AB6AAC800C9CEEE /* sync.c */; }; 103 3C689FA11AB6AAC800C9CEEE /* sync.c in Sources */ = {isa = PBXBuildFile; fileRef = 3C689F9D1AB6AAC800C9CEEE /* sync.c */; };
  104 + 3C82802C1BAFF8CC004A1794 /* srs_kafka_stack.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3C82802A1BAFF8CC004A1794 /* srs_kafka_stack.cpp */; };
104 3CC52DD81ACE4023006FEB01 /* srs_utest_amf0.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3CC52DCA1ACE4023006FEB01 /* srs_utest_amf0.cpp */; }; 105 3CC52DD81ACE4023006FEB01 /* srs_utest_amf0.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3CC52DCA1ACE4023006FEB01 /* srs_utest_amf0.cpp */; };
105 3CC52DD91ACE4023006FEB01 /* srs_utest_config.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3CC52DCC1ACE4023006FEB01 /* srs_utest_config.cpp */; }; 106 3CC52DD91ACE4023006FEB01 /* srs_utest_config.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3CC52DCC1ACE4023006FEB01 /* srs_utest_config.cpp */; };
106 3CC52DDA1ACE4023006FEB01 /* srs_utest_core.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3CC52DCE1ACE4023006FEB01 /* srs_utest_core.cpp */; }; 107 3CC52DDA1ACE4023006FEB01 /* srs_utest_core.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3CC52DCE1ACE4023006FEB01 /* srs_utest_core.cpp */; };
@@ -359,6 +360,14 @@ @@ -359,6 +360,14 @@
359 3C689F9B1AB6AAC800C9CEEE /* sched.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = sched.c; path = "../../objs/st-1.9/sched.c"; sourceTree = "<group>"; }; 360 3C689F9B1AB6AAC800C9CEEE /* sched.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = sched.c; path = "../../objs/st-1.9/sched.c"; sourceTree = "<group>"; };
360 3C689F9C1AB6AAC800C9CEEE /* stk.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = stk.c; path = "../../objs/st-1.9/stk.c"; sourceTree = "<group>"; }; 361 3C689F9C1AB6AAC800C9CEEE /* stk.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = stk.c; path = "../../objs/st-1.9/stk.c"; sourceTree = "<group>"; };
361 3C689F9D1AB6AAC800C9CEEE /* sync.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = sync.c; path = "../../objs/st-1.9/sync.c"; sourceTree = "<group>"; }; 362 3C689F9D1AB6AAC800C9CEEE /* sync.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = sync.c; path = "../../objs/st-1.9/sync.c"; sourceTree = "<group>"; };
  363 + 3C8280241BAFF896004A1794 /* compatible.conf */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = compatible.conf; path = ../../../conf/compatible.conf; sourceTree = "<group>"; };
  364 + 3C8280251BAFF896004A1794 /* full.one.vhost.conf */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = full.one.vhost.conf; path = ../../../conf/full.one.vhost.conf; sourceTree = "<group>"; };
  365 + 3C8280261BAFF896004A1794 /* http.flv.live.edge1.conf */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = http.flv.live.edge1.conf; path = ../../../conf/http.flv.live.edge1.conf; sourceTree = "<group>"; };
  366 + 3C8280271BAFF896004A1794 /* http.flv.live.edge2.conf */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = http.flv.live.edge2.conf; path = ../../../conf/http.flv.live.edge2.conf; sourceTree = "<group>"; };
  367 + 3C8280281BAFF896004A1794 /* push.flv.conf */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = push.flv.conf; path = ../../../conf/push.flv.conf; sourceTree = "<group>"; };
  368 + 3C8280291BAFF896004A1794 /* transform.edge.conf */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = transform.edge.conf; path = ../../../conf/transform.edge.conf; sourceTree = "<group>"; };
  369 + 3C82802A1BAFF8CC004A1794 /* srs_kafka_stack.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = srs_kafka_stack.cpp; path = ../../../src/protocol/srs_kafka_stack.cpp; sourceTree = "<group>"; };
  370 + 3C82802B1BAFF8CC004A1794 /* srs_kafka_stack.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = srs_kafka_stack.hpp; path = ../../../src/protocol/srs_kafka_stack.hpp; sourceTree = "<group>"; };
362 3CC52DCA1ACE4023006FEB01 /* srs_utest_amf0.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = srs_utest_amf0.cpp; path = ../../src/utest/srs_utest_amf0.cpp; sourceTree = "<group>"; }; 371 3CC52DCA1ACE4023006FEB01 /* srs_utest_amf0.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = srs_utest_amf0.cpp; path = ../../src/utest/srs_utest_amf0.cpp; sourceTree = "<group>"; };
363 3CC52DCB1ACE4023006FEB01 /* srs_utest_amf0.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = srs_utest_amf0.hpp; path = ../../src/utest/srs_utest_amf0.hpp; sourceTree = "<group>"; }; 372 3CC52DCB1ACE4023006FEB01 /* srs_utest_amf0.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = srs_utest_amf0.hpp; path = ../../src/utest/srs_utest_amf0.hpp; sourceTree = "<group>"; };
364 3CC52DCC1ACE4023006FEB01 /* srs_utest_config.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = srs_utest_config.cpp; path = ../../src/utest/srs_utest_config.cpp; sourceTree = "<group>"; }; 373 3CC52DCC1ACE4023006FEB01 /* srs_utest_config.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = srs_utest_config.cpp; path = ../../src/utest/srs_utest_config.cpp; sourceTree = "<group>"; };
@@ -501,6 +510,8 @@ @@ -501,6 +510,8 @@
501 children = ( 510 children = (
502 3C0E1B8B1B0F5ADF003ADEF7 /* srs_http_stack.cpp */, 511 3C0E1B8B1B0F5ADF003ADEF7 /* srs_http_stack.cpp */,
503 3C0E1B8C1B0F5ADF003ADEF7 /* srs_http_stack.hpp */, 512 3C0E1B8C1B0F5ADF003ADEF7 /* srs_http_stack.hpp */,
  513 + 3C82802A1BAFF8CC004A1794 /* srs_kafka_stack.cpp */,
  514 + 3C82802B1BAFF8CC004A1794 /* srs_kafka_stack.hpp */,
504 3C068D6B1B10175500AA722C /* srs_protocol_buffer.cpp */, 515 3C068D6B1B10175500AA722C /* srs_protocol_buffer.cpp */,
505 3C068D6C1B10175500AA722C /* srs_protocol_buffer.hpp */, 516 3C068D6C1B10175500AA722C /* srs_protocol_buffer.hpp */,
506 3C0D422C1B87165900C2508B /* srs_protocol_json.cpp */, 517 3C0D422C1B87165900C2508B /* srs_protocol_json.cpp */,
@@ -682,8 +693,8 @@ @@ -682,8 +693,8 @@
682 3C1EE6AF1AB107EE00576EE9 /* conf */ = { 693 3C1EE6AF1AB107EE00576EE9 /* conf */ = {
683 isa = PBXGroup; 694 isa = PBXGroup;
684 children = ( 695 children = (
685 - 3C4AB9341B8C9FF9006627D3 /* exec.conf */,  
686 3C1EE6B01AB1080900576EE9 /* bandwidth.conf */, 696 3C1EE6B01AB1080900576EE9 /* bandwidth.conf */,
  697 + 3C8280241BAFF896004A1794 /* compatible.conf */,
687 3C1EE6B11AB1080900576EE9 /* console.conf */, 698 3C1EE6B11AB1080900576EE9 /* console.conf */,
688 3C1EE6B21AB1080900576EE9 /* demo.19350.conf */, 699 3C1EE6B21AB1080900576EE9 /* demo.19350.conf */,
689 3C1EE6B31AB1080900576EE9 /* demo.conf */, 700 3C1EE6B31AB1080900576EE9 /* demo.conf */,
@@ -692,14 +703,18 @@ @@ -692,14 +703,18 @@
692 3C1EE6B61AB1080900576EE9 /* dvr.session.conf */, 703 3C1EE6B61AB1080900576EE9 /* dvr.session.conf */,
693 3C1EE6B71AB1080900576EE9 /* edge.conf */, 704 3C1EE6B71AB1080900576EE9 /* edge.conf */,
694 3C1EE6B81AB1080900576EE9 /* edge.token.traverse.conf */, 705 3C1EE6B81AB1080900576EE9 /* edge.token.traverse.conf */,
  706 + 3C4AB9341B8C9FF9006627D3 /* exec.conf */,
695 3C1EE6B91AB1080900576EE9 /* ffmpeg.transcode.conf */, 707 3C1EE6B91AB1080900576EE9 /* ffmpeg.transcode.conf */,
696 3C1EE6BA1AB1080900576EE9 /* forward.master.conf */, 708 3C1EE6BA1AB1080900576EE9 /* forward.master.conf */,
697 3C1EE6BB1AB1080900576EE9 /* forward.slave.conf */, 709 3C1EE6BB1AB1080900576EE9 /* forward.slave.conf */,
698 3C1EE6BC1AB1080900576EE9 /* full.conf */, 710 3C1EE6BC1AB1080900576EE9 /* full.conf */,
  711 + 3C8280251BAFF896004A1794 /* full.one.vhost.conf */,
699 3C1EE6BD1AB1080900576EE9 /* hds.conf */, 712 3C1EE6BD1AB1080900576EE9 /* hds.conf */,
700 3C1EE6BE1AB1080900576EE9 /* hls.conf */, 713 3C1EE6BE1AB1080900576EE9 /* hls.conf */,
701 3C1EE6BF1AB1080900576EE9 /* http.aac.live.conf */, 714 3C1EE6BF1AB1080900576EE9 /* http.aac.live.conf */,
702 3C1EE6C01AB1080900576EE9 /* http.flv.live.conf */, 715 3C1EE6C01AB1080900576EE9 /* http.flv.live.conf */,
  716 + 3C8280261BAFF896004A1794 /* http.flv.live.edge1.conf */,
  717 + 3C8280271BAFF896004A1794 /* http.flv.live.edge2.conf */,
703 3C1EE6C11AB1080900576EE9 /* http.heartbeat.conf */, 718 3C1EE6C11AB1080900576EE9 /* http.heartbeat.conf */,
704 3C1EE6C21AB1080900576EE9 /* http.hls.conf */, 719 3C1EE6C21AB1080900576EE9 /* http.hls.conf */,
705 3C1EE6C31AB1080900576EE9 /* http.hooks.callback.conf */, 720 3C1EE6C31AB1080900576EE9 /* http.hooks.callback.conf */,
@@ -709,6 +724,7 @@ @@ -709,6 +724,7 @@
709 3C1EE6C71AB1080900576EE9 /* ingest.conf */, 724 3C1EE6C71AB1080900576EE9 /* ingest.conf */,
710 3C1EE6C81AB1080900576EE9 /* mac.dev.conf */, 725 3C1EE6C81AB1080900576EE9 /* mac.dev.conf */,
711 3C1EE6C91AB1080900576EE9 /* origin.conf */, 726 3C1EE6C91AB1080900576EE9 /* origin.conf */,
  727 + 3C8280281BAFF896004A1794 /* push.flv.conf */,
712 3C1EE6CA1AB1080900576EE9 /* push.mpegts.over.udp.conf */, 728 3C1EE6CA1AB1080900576EE9 /* push.mpegts.over.udp.conf */,
713 3C1EE6CB1AB1080900576EE9 /* push.rtsp.conf */, 729 3C1EE6CB1AB1080900576EE9 /* push.rtsp.conf */,
714 3C1EE6CC1AB1080900576EE9 /* ram.hls.conf */, 730 3C1EE6CC1AB1080900576EE9 /* ram.hls.conf */,
@@ -717,6 +733,7 @@ @@ -717,6 +733,7 @@
717 3C1EE6CF1AB1080900576EE9 /* security.deny.publish.conf */, 733 3C1EE6CF1AB1080900576EE9 /* security.deny.publish.conf */,
718 3C1EE6D01AB1080900576EE9 /* srs.conf */, 734 3C1EE6D01AB1080900576EE9 /* srs.conf */,
719 3C1EE6D11AB1080900576EE9 /* transcode2hls.audio.only.conf */, 735 3C1EE6D11AB1080900576EE9 /* transcode2hls.audio.only.conf */,
  736 + 3C8280291BAFF896004A1794 /* transform.edge.conf */,
720 ); 737 );
721 name = conf; 738 name = conf;
722 sourceTree = "<group>"; 739 sourceTree = "<group>";
@@ -901,6 +918,7 @@ @@ -901,6 +918,7 @@
901 3C1231F61AAE652D00CE8F6C /* srs_core_autofree.cpp in Sources */, 918 3C1231F61AAE652D00CE8F6C /* srs_core_autofree.cpp in Sources */,
902 3C5265B41B241BF0009CA186 /* srs_core_mem_watch.cpp in Sources */, 919 3C5265B41B241BF0009CA186 /* srs_core_mem_watch.cpp in Sources */,
903 3C1EE6D71AB1367D00576EE9 /* README.md in Sources */, 920 3C1EE6D71AB1367D00576EE9 /* README.md in Sources */,
  921 + 3C82802C1BAFF8CC004A1794 /* srs_kafka_stack.cpp in Sources */,
904 3C1232411AAE81A400CE8F6C /* srs_raw_avc.cpp in Sources */, 922 3C1232411AAE81A400CE8F6C /* srs_raw_avc.cpp in Sources */,
905 3C1232491AAE81A400CE8F6C /* srs_rtmp_utility.cpp in Sources */, 923 3C1232491AAE81A400CE8F6C /* srs_rtmp_utility.cpp in Sources */,
906 3C663F191AB0155100286D8B /* srs_publish.c in Sources */, 924 3C663F191AB0155100286D8B /* srs_publish.c in Sources */,
@@ -25,8 +25,8 @@ @@ -25,8 +25,8 @@
25 #define SRS_PROTOCOL_HTTP_HPP 25 #define SRS_PROTOCOL_HTTP_HPP
26 26
27 /* 27 /*
28 - #include <srs_http_stack.hpp>  
29 - */ 28 +#include <srs_http_stack.hpp>
  29 +*/
30 #include <srs_core.hpp> 30 #include <srs_core.hpp>
31 31
32 #include <map> 32 #include <map>
  1 +/*
  2 + The MIT License (MIT)
  3 +
  4 + Copyright (c) 2013-2015 SRS(simple-rtmp-server)
  5 +
  6 + Permission is hereby granted, free of charge, to any person obtaining a copy of
  7 + this software and associated documentation files (the "Software"), to deal in
  8 + the Software without restriction, including without limitation the rights to
  9 + use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
  10 + the Software, and to permit persons to whom the Software is furnished to do so,
  11 + subject to the following conditions:
  12 +
  13 + The above copyright notice and this permission notice shall be included in all
  14 + copies or substantial portions of the Software.
  15 +
  16 + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  17 + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
  18 + FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
  19 + COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
  20 + IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  21 + CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  22 + */
  23 +
  24 +#include <srs_kafka_stack.hpp>
  25 +
  1 +/*
  2 + The MIT License (MIT)
  3 +
  4 + Copyright (c) 2013-2015 SRS(simple-rtmp-server)
  5 +
  6 + Permission is hereby granted, free of charge, to any person obtaining a copy of
  7 + this software and associated documentation files (the "Software"), to deal in
  8 + the Software without restriction, including without limitation the rights to
  9 + use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
  10 + the Software, and to permit persons to whom the Software is furnished to do so,
  11 + subject to the following conditions:
  12 +
  13 + The above copyright notice and this permission notice shall be included in all
  14 + copies or substantial portions of the Software.
  15 +
  16 + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  17 + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
  18 + FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
  19 + COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
  20 + IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  21 + CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  22 + */
  23 +
  24 +#ifndef SRS_PROTOCOL_KAFKA_HPP
  25 +#define SRS_PROTOCOL_KAFKA_HPP
  26 +
  27 +/*
  28 +#include <srs_kafka_stack.hpp>
  29 +*/
  30 +#include <srs_core.hpp>
  31 +
  32 +#endif
  33 +