fixbug[play packet decode bug: srs only read bool type play reset value, actuall…
…y this value can be bool or number]
正在显示
25 个修改的文件
包含
1 行增加
和
277 行删除
trunk/research/ffempty/Makefile
100644 → 100755
trunk/research/ffempty/ffempty.cc
100644 → 100755
trunk/research/hls/Makefile
100644 → 100755
trunk/research/hls/ts_info.cc
100644 → 100755
trunk/research/players/crossdomain.xml
100644 → 100755
trunk/research/players/img/tooltip.png
100644 → 100755
trunk/research/players/js/AdobeFlashPlayerInstall.swf
100644 → 100755
不能预览此文件类型
trunk/research/players/js/StrobeMediaPlayback.swf
100644 → 100755
不能预览此文件类型
trunk/research/players/js/bootstrap.min.js
100644 → 100755
trunk/research/players/js/jquery-1.10.2.min.js
100644 → 100755
trunk/research/players/js/jquery-1.10.2.min.map
100644 → 100755
trunk/research/players/js/jwplayer.flash.swf
100644 → 100755
不能预览此文件类型
trunk/research/players/js/jwplayer.html5.js
100644 → 100755
trunk/research/players/js/jwplayer.js
100644 → 100755
| 1 | -<<<<<<< HEAD | ||
| 2 | -// for bw to init url | ||
| 3 | -// url: scheme://host:port/path?query#fragment | ||
| 4 | -function srs_init_bwt(rtmp_url, hls_url) { | ||
| 5 | - update_nav(); | ||
| 6 | - | ||
| 7 | - if (rtmp_url) { | ||
| 8 | - //var query = parse_query_string(); | ||
| 9 | - var search_filed = String(window.location.search).replace(" ", "").split("?")[1]; | ||
| 10 | - $(rtmp_url).val("rtmp://" + window.location.host + ":" + 1935 + "/app?" + search_filed); | ||
| 11 | - } | ||
| 12 | - if (hls_url) { | ||
| 13 | - $(hls_url).val(build_default_hls_url()); | ||
| 14 | - } | ||
| 15 | -} | ||
| 16 | - | ||
| 17 | -function srs_bwt_check_url(url) { | ||
| 18 | - if (url.indexOf("key") != -1 && url.indexOf("vhost") != -1) { | ||
| 19 | - return true; | ||
| 20 | - } | ||
| 21 | - | ||
| 22 | - return false; | ||
| 23 | -} | ||
| 24 | - | ||
| 25 | -function srs_bwt_build_default_url() { | ||
| 26 | - var url_default = "rtmp://" + window.location.host + ":" + 1935 + "/app?key=35c9b402c12a7246868752e2878f7e0e&vhost=bandcheck.srs.com"; | ||
| 27 | - return url_default; | ||
| 28 | -======= | ||
| 29 | /** | 1 | /** |
| 30 | * the SrsBandwidth object. | 2 | * the SrsBandwidth object. |
| 31 | * @param container the html container id. | 3 | * @param container the html container id. |
| @@ -161,5 +133,4 @@ function __srs_on_update_status(id, status) { | @@ -161,5 +133,4 @@ function __srs_on_update_status(id, status) { | ||
| 161 | var bandwidth = __srs_find_bandwidth(id); | 133 | var bandwidth = __srs_find_bandwidth(id); |
| 162 | bandwidth.status = status; | 134 | bandwidth.status = status; |
| 163 | bandwidth.on_update_status(status); | 135 | bandwidth.on_update_status(status); |
| 164 | ->>>>>>> upstream/master | ||
| 165 | } | 136 | } |
trunk/research/players/js/swfobject.js
100644 → 100755
| @@ -57,7 +57,7 @@ | @@ -57,7 +57,7 @@ | ||
| 57 | // get the vhost and port to set the default url. | 57 | // get the vhost and port to set the default url. |
| 58 | // for example: http://192.168.1.213/players/jwplayer6.html?port=1935&vhost=demo | 58 | // for example: http://192.168.1.213/players/jwplayer6.html?port=1935&vhost=demo |
| 59 | // url set to: rtmp://demo:1935/live/livestream | 59 | // url set to: rtmp://demo:1935/live/livestream |
| 60 | - //srs_init("#txt_url", null, "#main_modal"); | 60 | + srs_init("#txt_url", null, "#main_modal"); |
| 61 | 61 | ||
| 62 | $("#main_modal").on("hide", function(){ | 62 | $("#main_modal").on("hide", function(){ |
| 63 | osmf_play("http://localhost"); | 63 | osmf_play("http://localhost"); |
| @@ -12,119 +12,12 @@ | @@ -12,119 +12,12 @@ | ||
| 12 | <script type="text/javascript" src="js/srs.player.js"></script> | 12 | <script type="text/javascript" src="js/srs.player.js"></script> |
| 13 | <script type="text/javascript" src="js/srs.publisher.js"></script> | 13 | <script type="text/javascript" src="js/srs.publisher.js"></script> |
| 14 | <script type="text/javascript" src="js/srs.utility.js"></script> | 14 | <script type="text/javascript" src="js/srs.utility.js"></script> |
| 15 | -<<<<<<< HEAD | ||
| 16 | - <script type="text/javascript" src="js/srs.utility.js"></script> | ||
| 17 | - <script type="text/javascript" src="js/srs.bandwidth.js"></script> | ||
| 18 | -======= | ||
| 19 | <script type="text/javascript" src="js/srs.bandwidth.js"></script> | 15 | <script type="text/javascript" src="js/srs.bandwidth.js"></script> |
| 20 | ->>>>>>> upstream/master | ||
| 21 | <style> | 16 | <style> |
| 22 | body{ | 17 | body{ |
| 23 | padding-top: 55px; | 18 | padding-top: 55px; |
| 24 | } | 19 | } |
| 25 | #main_modal { | 20 | #main_modal { |
| 26 | -<<<<<<< HEAD | ||
| 27 | - width: 600px; | ||
| 28 | - margin-left: -300px; | ||
| 29 | - } | ||
| 30 | - #check_status { | ||
| 31 | - margin-left: 20px; | ||
| 32 | - margin-top: -55px; | ||
| 33 | - } | ||
| 34 | - #pb_buffer_bg { | ||
| 35 | - margin-top: 40px; | ||
| 36 | - margin-bottom: 10px; | ||
| 37 | - } | ||
| 38 | - </style> | ||
| 39 | - <script type="text/javascript"> | ||
| 40 | - | ||
| 41 | - function update_progress(percent) { | ||
| 42 | - $("#progress_bar").width(percent); | ||
| 43 | - } | ||
| 44 | - | ||
| 45 | - function progress_reset() { | ||
| 46 | - $("#progress_bar").width("0%"); | ||
| 47 | - } | ||
| 48 | - | ||
| 49 | - function update_status(text) { | ||
| 50 | - $("#check_status").text(text); | ||
| 51 | - } | ||
| 52 | - | ||
| 53 | - function get_swf_width() { | ||
| 54 | - return 1; | ||
| 55 | - } | ||
| 56 | - | ||
| 57 | - function get_swf_height() { | ||
| 58 | - return 1; | ||
| 59 | - } | ||
| 60 | - | ||
| 61 | - function show_modal() { | ||
| 62 | - $("#main_modal").modal({show:true, keyboard:false}); | ||
| 63 | - } | ||
| 64 | - | ||
| 65 | - function band_check(url) { | ||
| 66 | - | ||
| 67 | - // remove flash contet | ||
| 68 | - var bw_div = $("<div/>"); | ||
| 69 | - $(bw_div).attr("id", "bw_div"); | ||
| 70 | - $("#bw_center").append(bw_div); | ||
| 71 | - | ||
| 72 | - var flashvars = {}; | ||
| 73 | - flashvars.url = url; | ||
| 74 | - flashvars.update_progress = "update_progress"; | ||
| 75 | - flashvars.progress_reset = "progress_reset"; | ||
| 76 | - flashvars.update_status = "update_status"; | ||
| 77 | - | ||
| 78 | - var params = {}; | ||
| 79 | - params.allowFullScreen = true; | ||
| 80 | - | ||
| 81 | - var attributes = {}; | ||
| 82 | - | ||
| 83 | - swfobject.embedSWF( | ||
| 84 | - "srs_bwt/release/srs_bwt.swf", "bw_div", | ||
| 85 | - get_swf_width(), get_swf_height(), | ||
| 86 | - "11.1.0", "js/AdobeFlashPlayerInstall.swf", | ||
| 87 | - flashvars, params, attributes | ||
| 88 | - ); | ||
| 89 | - } | ||
| 90 | - | ||
| 91 | - $(function(){ | ||
| 92 | - update_nav(); | ||
| 93 | - srs_init_bwt("#txt_url"); | ||
| 94 | - | ||
| 95 | - var txt_input = $("#txt_url").val(); | ||
| 96 | - // if valid ? | ||
| 97 | - if (!srs_bwt_check_url(txt_input)) { | ||
| 98 | - $("#txt_url").val(srs_bwt_build_default_url()); | ||
| 99 | - } | ||
| 100 | - | ||
| 101 | - $("#main_modal").on( | ||
| 102 | - "show", | ||
| 103 | - function() | ||
| 104 | - { | ||
| 105 | - progress_reset(); | ||
| 106 | - update_status(""); | ||
| 107 | - var url = $("#txt_url").val(); | ||
| 108 | - /*! | ||
| 109 | - url encode | ||
| 110 | - */ | ||
| 111 | - url = escape(url); | ||
| 112 | - band_check(url); | ||
| 113 | - } | ||
| 114 | - ); | ||
| 115 | - | ||
| 116 | - $("#main_modal").on("hide", function(){ | ||
| 117 | - $("#bw_div").remove(); | ||
| 118 | - }); | ||
| 119 | - | ||
| 120 | - $("#btn_play").click( | ||
| 121 | - function() | ||
| 122 | - { | ||
| 123 | - $("#main_modal").modal({show:true, keyboard:false}); | ||
| 124 | - } | ||
| 125 | - ); | ||
| 126 | - }); | ||
| 127 | -======= | ||
| 128 | width: 700px; | 21 | width: 700px; |
| 129 | margin-left: -350px; | 22 | margin-left: -350px; |
| 130 | } | 23 | } |
| @@ -173,7 +66,6 @@ | @@ -173,7 +66,6 @@ | ||
| 173 | function on_stop_bandwidth_test() { | 66 | function on_stop_bandwidth_test() { |
| 174 | bandwidth.stop(); | 67 | bandwidth.stop(); |
| 175 | } | 68 | } |
| 176 | ->>>>>>> upstream/master | ||
| 177 | </script> | 69 | </script> |
| 178 | </head> | 70 | </head> |
| 179 | <body> | 71 | <body> |
| @@ -196,31 +88,6 @@ | @@ -196,31 +88,6 @@ | ||
| 196 | </div> | 88 | </div> |
| 197 | </div> | 89 | </div> |
| 198 | <div class="container"> | 90 | <div class="container"> |
| 199 | -<<<<<<< HEAD | ||
| 200 | - | ||
| 201 | - <div class="form-inline"> | ||
| 202 | - URL: | ||
| 203 | - <input type="text" id="txt_url" class="input-xxlarge" value="" placeholder="例如:rtmp://host:port/app?key=xx&vhost=yy"></input> | ||
| 204 | - <button class="btn btn-primary" id="btn_play">开始测速</button> | ||
| 205 | - </div> | ||
| 206 | - | ||
| 207 | - <div id="main_modal" class="modal hide fade"> | ||
| 208 | - <div class="modal-header"> | ||
| 209 | - <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> | ||
| 210 | - <h3>SRS Band Check</h3> | ||
| 211 | - </div> | ||
| 212 | - <div class="modal-body"> | ||
| 213 | - <div id="player"></div> | ||
| 214 | - <div class="progress progress-striped active" id="pb_buffer_bg"> | ||
| 215 | - <div class="bar" style="width: 50%;" id="progress_bar"></div> | ||
| 216 | - </div> | ||
| 217 | - </div> | ||
| 218 | - | ||
| 219 | - <div class="modal-body" id="bw_center"> | ||
| 220 | - </div> | ||
| 221 | - <span id="check_status1"><font ><strong id="check_status">status</strong></font> </span> | ||
| 222 | - | ||
| 223 | -======= | ||
| 224 | <div class="alert alert-info fade in"> | 91 | <div class="alert alert-info fade in"> |
| 225 | <button type="button" class="close" data-dismiss="alert">×</button> | 92 | <button type="button" class="close" data-dismiss="alert">×</button> |
| 226 | <strong><span>Usage:</span></strong> <span>点击“开始测速”即可测带宽,最大可测试带宽由服务器限制</span> | 93 | <strong><span>Usage:</span></strong> <span>点击“开始测速”即可测带宽,最大可测试带宽由服务器限制</span> |
| @@ -247,15 +114,10 @@ | @@ -247,15 +114,10 @@ | ||
| 247 | </div> | 114 | </div> |
| 248 | <span id="check_status">status</span> | 115 | <span id="check_status">status</span> |
| 249 | </div> | 116 | </div> |
| 250 | ->>>>>>> upstream/master | ||
| 251 | <div class="modal-footer"> | 117 | <div class="modal-footer"> |
| 252 | <button class="btn btn-primary" data-dismiss="modal" aria-hidden="true"> 关闭 </button> | 118 | <button class="btn btn-primary" data-dismiss="modal" aria-hidden="true"> 关闭 </button> |
| 253 | </div> | 119 | </div> |
| 254 | </div> | 120 | </div> |
| 255 | -<<<<<<< HEAD | ||
| 256 | - | ||
| 257 | -======= | ||
| 258 | ->>>>>>> upstream/master | ||
| 259 | <hr> | 121 | <hr> |
| 260 | <footer> | 122 | <footer> |
| 261 | <p><a href="https://github.com/winlinvip/simple-rtmp-server">SRS Team © 2013</a></p> | 123 | <p><a href="https://github.com/winlinvip/simple-rtmp-server">SRS Team © 2013</a></p> |
| 1 | <?xml version="1.0" encoding="UTF-8" standalone="no"?> | 1 | <?xml version="1.0" encoding="UTF-8" standalone="no"?> |
| 2 | <actionScriptProperties analytics="false" mainApplicationPath="srs_bwt.as" projectUUID="00251213-e6a2-4dd5-a033-125cc78f843c" version="10"> | 2 | <actionScriptProperties analytics="false" mainApplicationPath="srs_bwt.as" projectUUID="00251213-e6a2-4dd5-a033-125cc78f843c" version="10"> |
| 3 | -<<<<<<< HEAD | ||
| 4 | - <compiler additionalCompilerArguments="-locale en_US" autoRSLOrdering="true" copyDependentFiles="true" fteInMXComponents="false" generateAccessible="true" htmlExpressInstall="true" htmlGenerate="true" htmlHistoryManagement="true" htmlPlayerVersionCheck="true" includeNetmonSwc="false" outputFolderPath="bin-debug" removeUnusedRSL="true" sourceFolderPath="src" strict="true" targetPlayerVersion="0.0.0" useApolloConfig="false" useDebugRSLSwfs="true" verifyDigests="true" warn="true"> | ||
| 5 | -======= | ||
| 6 | <compiler additionalCompilerArguments="-locale en_US" autoRSLOrdering="true" copyDependentFiles="true" fteInMXComponents="false" generateAccessible="true" htmlExpressInstall="true" htmlGenerate="false" htmlHistoryManagement="true" htmlPlayerVersionCheck="true" includeNetmonSwc="false" outputFolderPath="release" removeUnusedRSL="true" sourceFolderPath="src" strict="true" targetPlayerVersion="0.0.0" useApolloConfig="false" useDebugRSLSwfs="true" verifyDigests="true" warn="true"> | 3 | <compiler additionalCompilerArguments="-locale en_US" autoRSLOrdering="true" copyDependentFiles="true" fteInMXComponents="false" generateAccessible="true" htmlExpressInstall="true" htmlGenerate="false" htmlHistoryManagement="true" htmlPlayerVersionCheck="true" includeNetmonSwc="false" outputFolderPath="release" removeUnusedRSL="true" sourceFolderPath="src" strict="true" targetPlayerVersion="0.0.0" useApolloConfig="false" useDebugRSLSwfs="true" verifyDigests="true" warn="true"> |
| 7 | ->>>>>>> upstream/master | ||
| 8 | <compilerSourcePath/> | 4 | <compilerSourcePath/> |
| 9 | <libraryPath defaultLinkType="0"> | 5 | <libraryPath defaultLinkType="0"> |
| 10 | <libraryPathEntry kind="4" path=""> | 6 | <libraryPathEntry kind="4" path=""> |
| @@ -21,15 +17,6 @@ | @@ -21,15 +17,6 @@ | ||
| 21 | <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/spark.swc" useDefaultLinkType="false"/> | 17 | <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/spark.swc" useDefaultLinkType="false"/> |
| 22 | <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/sparkskins.swc" useDefaultLinkType="false"/> | 18 | <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/sparkskins.swc" useDefaultLinkType="false"/> |
| 23 | <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/rpc.swc" useDefaultLinkType="false"/> | 19 | <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/rpc.swc" useDefaultLinkType="false"/> |
| 24 | -<<<<<<< HEAD | ||
| 25 | - <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/videoPlayer.swc" useDefaultLinkType="false"/> | ||
| 26 | - <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/qtp_air.swc" useDefaultLinkType="false"/> | ||
| 27 | - <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/datavisualization.swc" useDefaultLinkType="false"/> | ||
| 28 | - <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/spark_dmv.swc" useDefaultLinkType="false"/> | ||
| 29 | - <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/automation.swc" useDefaultLinkType="false"/> | ||
| 30 | - <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/flash-integration.swc" useDefaultLinkType="false"/> | ||
| 31 | - <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/automation_dmv.swc" useDefaultLinkType="false"/> | ||
| 32 | -======= | ||
| 33 | <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/datavisualization.swc" useDefaultLinkType="false"/> | 20 | <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/datavisualization.swc" useDefaultLinkType="false"/> |
| 34 | <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/qtp_air.swc" useDefaultLinkType="false"/> | 21 | <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/qtp_air.swc" useDefaultLinkType="false"/> |
| 35 | <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/videoPlayer.swc" useDefaultLinkType="false"/> | 22 | <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/videoPlayer.swc" useDefaultLinkType="false"/> |
| @@ -37,7 +24,6 @@ | @@ -37,7 +24,6 @@ | ||
| 37 | <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/automation.swc" useDefaultLinkType="false"/> | 24 | <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/automation.swc" useDefaultLinkType="false"/> |
| 38 | <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/automation_dmv.swc" useDefaultLinkType="false"/> | 25 | <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/automation_dmv.swc" useDefaultLinkType="false"/> |
| 39 | <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/flash-integration.swc" useDefaultLinkType="false"/> | 26 | <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/flash-integration.swc" useDefaultLinkType="false"/> |
| 40 | ->>>>>>> upstream/master | ||
| 41 | <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/automation_flashflexkit.swc" useDefaultLinkType="false"/> | 27 | <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/automation_flashflexkit.swc" useDefaultLinkType="false"/> |
| 42 | <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/automation_agent.swc" useDefaultLinkType="false"/> | 28 | <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/automation_agent.swc" useDefaultLinkType="false"/> |
| 43 | </excludedEntries> | 29 | </excludedEntries> |
| @@ -20,12 +20,6 @@ package | @@ -20,12 +20,6 @@ package | ||
| 20 | 20 | ||
| 21 | public class srs_bwt extends Sprite | 21 | public class srs_bwt extends Sprite |
| 22 | { | 22 | { |
| 23 | -<<<<<<< HEAD | ||
| 24 | - private var connection:NetConnection; | ||
| 25 | - | ||
| 26 | - private var updatePlayProgressTimer:Timer; | ||
| 27 | - private var elapTimer:SrsElapsedTimer; | ||
| 28 | -======= | ||
| 29 | private var connection:NetConnection = null; | 23 | private var connection:NetConnection = null; |
| 30 | 24 | ||
| 31 | private var updatePlayProgressTimer:Timer = null; | 25 | private var updatePlayProgressTimer:Timer = null; |
| @@ -35,7 +29,6 @@ package | @@ -35,7 +29,6 @@ package | ||
| 35 | private var js_id:String = null; | 29 | private var js_id:String = null; |
| 36 | // play param url. | 30 | // play param url. |
| 37 | private var user_url:String = null; | 31 | private var user_url:String = null; |
| 38 | ->>>>>>> upstream/master | ||
| 39 | 32 | ||
| 40 | // server ip get from server | 33 | // server ip get from server |
| 41 | private var server_ip:String; | 34 | private var server_ip:String; |
| @@ -44,13 +37,8 @@ package | @@ -44,13 +37,8 @@ package | ||
| 44 | private var stop_pub:Boolean = false; | 37 | private var stop_pub:Boolean = false; |
| 45 | 38 | ||
| 46 | // js interface | 39 | // js interface |
| 47 | -<<<<<<< HEAD | ||
| 48 | - private var js_update_progress:String; | ||
| 49 | - private var js_progress_reset:String; | ||
| 50 | -======= | ||
| 51 | private var js_on_player_ready:String; | 40 | private var js_on_player_ready:String; |
| 52 | private var js_update_progress:String; | 41 | private var js_update_progress:String; |
| 53 | ->>>>>>> upstream/master | ||
| 54 | private var js_update_status:String; | 42 | private var js_update_status:String; |
| 55 | 43 | ||
| 56 | private var value_progressbar:Number = 0; | 44 | private var value_progressbar:Number = 0; |
| @@ -61,8 +49,6 @@ package | @@ -61,8 +49,6 @@ package | ||
| 61 | 49 | ||
| 62 | public function srs_bwt() | 50 | public function srs_bwt() |
| 63 | { | 51 | { |
| 64 | -<<<<<<< HEAD | ||
| 65 | -======= | ||
| 66 | if (!this.stage) { | 52 | if (!this.stage) { |
| 67 | this.addEventListener(Event.ADDED_TO_STAGE, this.system_on_add_to_stage); | 53 | this.addEventListener(Event.ADDED_TO_STAGE, this.system_on_add_to_stage); |
| 68 | } else { | 54 | } else { |
| @@ -75,23 +61,10 @@ package | @@ -75,23 +61,10 @@ package | ||
| 75 | * the main function. | 61 | * the main function. |
| 76 | */ | 62 | */ |
| 77 | private function system_on_add_to_stage(evt:Event):void { | 63 | private function system_on_add_to_stage(evt:Event):void { |
| 78 | ->>>>>>> upstream/master | ||
| 79 | this.stage.scaleMode = StageScaleMode.NO_SCALE; | 64 | this.stage.scaleMode = StageScaleMode.NO_SCALE; |
| 80 | this.stage.align = StageAlign.TOP_LEFT; | 65 | this.stage.align = StageAlign.TOP_LEFT; |
| 81 | 66 | ||
| 82 | var flashvars:Object = this.root.loaderInfo.parameters; | 67 | var flashvars:Object = this.root.loaderInfo.parameters; |
| 83 | -<<<<<<< HEAD | ||
| 84 | - this.js_update_progress = flashvars.update_progress; | ||
| 85 | - this.js_progress_reset = flashvars.progress_reset; | ||
| 86 | - this.js_update_status = flashvars.update_status; | ||
| 87 | - | ||
| 88 | - // init context menu, add action "Srs 带宽测试工具 0.1" | ||
| 89 | - var myMenu:ContextMenu = new ContextMenu(); | ||
| 90 | - myMenu.hideBuiltInItems(); | ||
| 91 | - myMenu.customItems.push(new ContextMenuItem("Srs 带宽测试工具 0.1", true)); | ||
| 92 | - this.contextMenu = myMenu; | ||
| 93 | - | ||
| 94 | -======= | ||
| 95 | 68 | ||
| 96 | if (!flashvars.hasOwnProperty("id")) { | 69 | if (!flashvars.hasOwnProperty("id")) { |
| 97 | throw new Error("must specifies the id"); | 70 | throw new Error("must specifies the id"); |
| @@ -131,16 +104,11 @@ package | @@ -131,16 +104,11 @@ package | ||
| 131 | private function js_call_check_bandwidth(url:String):void { | 104 | private function js_call_check_bandwidth(url:String):void { |
| 132 | js_call_stop(); | 105 | js_call_stop(); |
| 133 | 106 | ||
| 134 | ->>>>>>> upstream/master | ||
| 135 | // init connection | 107 | // init connection |
| 136 | connection = new NetConnection; | 108 | connection = new NetConnection; |
| 137 | connection.client = this; | 109 | connection.client = this; |
| 138 | connection.addEventListener(NetStatusEvent.NET_STATUS, onStatus); | 110 | connection.addEventListener(NetStatusEvent.NET_STATUS, onStatus); |
| 139 | -<<<<<<< HEAD | ||
| 140 | - connection.connect(flashvars.url); | ||
| 141 | -======= | ||
| 142 | connection.connect(url); | 111 | connection.connect(url); |
| 143 | ->>>>>>> upstream/master | ||
| 144 | //connection.connect("rtmp://192.168.8.234:1935/app?key=35c9b402c12a7246868752e2878f7e0e&vhost=bandcheck.srs.com"); | 112 | //connection.connect("rtmp://192.168.8.234:1935/app?key=35c9b402c12a7246868752e2878f7e0e&vhost=bandcheck.srs.com"); |
| 145 | 113 | ||
| 146 | // for play to update progress bar | 114 | // for play to update progress bar |
| @@ -151,12 +119,6 @@ package | @@ -151,12 +119,6 @@ package | ||
| 151 | updatePlayProgressTimer.addEventListener(TimerEvent.TIMER, onTimerTimeout); | 119 | updatePlayProgressTimer.addEventListener(TimerEvent.TIMER, onTimerTimeout); |
| 152 | updatePlayProgressTimer.start(); | 120 | updatePlayProgressTimer.start(); |
| 153 | } | 121 | } |
| 154 | -<<<<<<< HEAD | ||
| 155 | - | ||
| 156 | - // get NetConnection NetStatusEvent | ||
| 157 | - public function onStatus(evt:NetStatusEvent) : void{ | ||
| 158 | - trace(evt.info.code); | ||
| 159 | -======= | ||
| 160 | private function js_call_stop():void { | 122 | private function js_call_stop():void { |
| 161 | if (connection) { | 123 | if (connection) { |
| 162 | connection.close(); | 124 | connection.close(); |
| @@ -187,7 +149,6 @@ package | @@ -187,7 +149,6 @@ package | ||
| 187 | contextMenu.customItems = customItems; | 149 | contextMenu.customItems = customItems; |
| 188 | } | 150 | } |
| 189 | 151 | ||
| 190 | ->>>>>>> upstream/master | ||
| 191 | switch(evt.info.code){ | 152 | switch(evt.info.code){ |
| 192 | case "NetConnection.Connect.Failed": | 153 | case "NetConnection.Connect.Failed": |
| 193 | updateState("连接服务器失败!"); | 154 | updateState("连接服务器失败!"); |
| @@ -203,10 +164,6 @@ package | @@ -203,10 +164,6 @@ package | ||
| 203 | //updateState("连接已断开!"); | 164 | //updateState("连接已断开!"); |
| 204 | break; | 165 | break; |
| 205 | } | 166 | } |
| 206 | -<<<<<<< HEAD | ||
| 207 | - | ||
| 208 | - } | ||
| 209 | -======= | ||
| 210 | } | 167 | } |
| 211 | 168 | ||
| 212 | public function onTimerTimeout(evt:TimerEvent):void | 169 | public function onTimerTimeout(evt:TimerEvent):void |
| @@ -214,7 +171,6 @@ package | @@ -214,7 +171,6 @@ package | ||
| 214 | value_progressbar = elapTimer.elapsed(); | 171 | value_progressbar = elapTimer.elapsed(); |
| 215 | updateProgess(value_progressbar, max_progressbar); | 172 | updateProgess(value_progressbar, max_progressbar); |
| 216 | } | 173 | } |
| 217 | ->>>>>>> upstream/master | ||
| 218 | 174 | ||
| 219 | /** | 175 | /** |
| 220 | * NetConnection callback this function, when recv server call "onSrsBandCheckStartPlayBytes" | 176 | * NetConnection callback this function, when recv server call "onSrsBandCheckStartPlayBytes" |
| @@ -225,27 +181,13 @@ package | @@ -225,27 +181,13 @@ package | ||
| 225 | var interval_ms:Number = evt.interval_ms; | 181 | var interval_ms:Number = evt.interval_ms; |
| 226 | 182 | ||
| 227 | connection.call("onSrsBandCheckStartingPlayBytes", null); | 183 | connection.call("onSrsBandCheckStartingPlayBytes", null); |
| 228 | -<<<<<<< HEAD | ||
| 229 | - updateState("测试下行带宽(" + server_ip + ")"); | ||
| 230 | -======= | ||
| 231 | updateState("开始测试下行带宽,服务器IP:" + server_ip); | 184 | updateState("开始测试下行带宽,服务器IP:" + server_ip); |
| 232 | ->>>>>>> upstream/master | ||
| 233 | 185 | ||
| 234 | // we suppose play duration_ms = pub duration_ms | 186 | // we suppose play duration_ms = pub duration_ms |
| 235 | max_progressbar = duration_ms * 2; | 187 | max_progressbar = duration_ms * 2; |
| 236 | } | 188 | } |
| 237 | 189 | ||
| 238 | public function onSrsBandCheckPlaying(evt:Object):void{ | 190 | public function onSrsBandCheckPlaying(evt:Object):void{ |
| 239 | -<<<<<<< HEAD | ||
| 240 | - | ||
| 241 | - } | ||
| 242 | - | ||
| 243 | - public function onTimerTimeout(evt:TimerEvent):void | ||
| 244 | - { | ||
| 245 | - value_progressbar = elapTimer.elapsed(); | ||
| 246 | - updateProgess(value_progressbar, max_progressbar); | ||
| 247 | -======= | ||
| 248 | ->>>>>>> upstream/master | ||
| 249 | } | 191 | } |
| 250 | 192 | ||
| 251 | public function onSrsBandCheckStopPlayBytes(evt:Object):void{ | 193 | public function onSrsBandCheckStopPlayBytes(evt:Object):void{ |
| @@ -261,10 +203,7 @@ package | @@ -261,10 +203,7 @@ package | ||
| 261 | kbps = (int(kbps * 10))/10.0; | 203 | kbps = (int(kbps * 10))/10.0; |
| 262 | 204 | ||
| 263 | flash.utils.setTimeout(stopPlayTest, 0); | 205 | flash.utils.setTimeout(stopPlayTest, 0); |
| 264 | -<<<<<<< HEAD | ||
| 265 | -======= | ||
| 266 | updateState("下行带宽测试完毕,服务器: " + server_ip + "," + kbps + "kbps,开始测试上行带宽。"); | 206 | updateState("下行带宽测试完毕,服务器: " + server_ip + "," + kbps + "kbps,开始测试上行带宽。"); |
| 267 | ->>>>>>> upstream/master | ||
| 268 | } | 207 | } |
| 269 | 208 | ||
| 270 | private function stopPlayTest():void{ | 209 | private function stopPlayTest():void{ |
| @@ -276,10 +215,6 @@ package | @@ -276,10 +215,6 @@ package | ||
| 276 | var interval_ms:Number = evt.interval_ms; | 215 | var interval_ms:Number = evt.interval_ms; |
| 277 | 216 | ||
| 278 | connection.call("onSrsBandCheckStartingPublishBytes", null); | 217 | connection.call("onSrsBandCheckStartingPublishBytes", null); |
| 279 | -<<<<<<< HEAD | ||
| 280 | - updateState("测试上行带宽(" + server_ip + ")"); | ||
| 281 | -======= | ||
| 282 | ->>>>>>> upstream/master | ||
| 283 | 218 | ||
| 284 | flash.utils.setTimeout(publisher, 0); | 219 | flash.utils.setTimeout(publisher, 0); |
| 285 | } | 220 | } |
| @@ -343,35 +278,19 @@ package | @@ -343,35 +278,19 @@ package | ||
| 343 | connection.call("finalClientPacket", null); | 278 | connection.call("finalClientPacket", null); |
| 344 | } | 279 | } |
| 345 | 280 | ||
| 346 | -<<<<<<< HEAD | ||
| 347 | - public function onBWDone():void{ | ||
| 348 | - // do nothing | ||
| 349 | - } | ||
| 350 | - | ||
| 351 | - // update progressBar's value | ||
| 352 | - private function updateProgess(value:Number, maxValue:Number):void{ | ||
| 353 | - flash.external.ExternalInterface.call(this.js_update_progress, value * 100 / maxValue + "%"); | ||
| 354 | -======= | ||
| 355 | // update progressBar's value | 281 | // update progressBar's value |
| 356 | private function updateProgess(value:Number, maxValue:Number):void{ | 282 | private function updateProgess(value:Number, maxValue:Number):void{ |
| 357 | flash.external.ExternalInterface.call(this.js_update_progress, this.js_id, value * 100 / maxValue); | 283 | flash.external.ExternalInterface.call(this.js_update_progress, this.js_id, value * 100 / maxValue); |
| 358 | ->>>>>>> upstream/master | ||
| 359 | trace(value + "-" + maxValue + "-" + value * 100 / maxValue + "%"); | 284 | trace(value + "-" + maxValue + "-" + value * 100 / maxValue + "%"); |
| 360 | } | 285 | } |
| 361 | 286 | ||
| 362 | // update checking status | 287 | // update checking status |
| 363 | private function updateState(text:String):void{ | 288 | private function updateState(text:String):void{ |
| 364 | -<<<<<<< HEAD | ||
| 365 | - flash.external.ExternalInterface.call(this.js_update_status, text); | ||
| 366 | - trace(text); | ||
| 367 | - } | ||
| 368 | -======= | ||
| 369 | flash.external.ExternalInterface.call(this.js_update_status, this.js_id, text); | 289 | flash.external.ExternalInterface.call(this.js_update_status, this.js_id, text); |
| 370 | trace(text); | 290 | trace(text); |
| 371 | } | 291 | } |
| 372 | 292 | ||
| 373 | public function onBWDone():void{ | 293 | public function onBWDone():void{ |
| 374 | } | 294 | } |
| 375 | ->>>>>>> upstream/master | ||
| 376 | } | 295 | } |
| 377 | } | 296 | } |
| @@ -449,16 +449,6 @@ int SrsRtmpClient::publish(string stream, int stream_id) | @@ -449,16 +449,6 @@ int SrsRtmpClient::publish(string stream, int stream_id) | ||
| 449 | return ret; | 449 | return ret; |
| 450 | } | 450 | } |
| 451 | 451 | ||
| 452 | -SrsProtocol *SrsRtmpClient::get_protocol() | ||
| 453 | -{ | ||
| 454 | - return protocol; | ||
| 455 | -} | ||
| 456 | - | ||
| 457 | -st_netfd_t SrsRtmpClient::get_st_fd() | ||
| 458 | -{ | ||
| 459 | - return stfd; | ||
| 460 | -} | ||
| 461 | - | ||
| 462 | SrsRtmp::SrsRtmp(st_netfd_t client_stfd) | 452 | SrsRtmp::SrsRtmp(st_netfd_t client_stfd) |
| 463 | { | 453 | { |
| 464 | protocol = new SrsProtocol(client_stfd); | 454 | protocol = new SrsProtocol(client_stfd); |
| @@ -131,10 +131,6 @@ public: | @@ -131,10 +131,6 @@ public: | ||
| 131 | virtual int create_stream(int& stream_id); | 131 | virtual int create_stream(int& stream_id); |
| 132 | virtual int play(std::string stream, int stream_id); | 132 | virtual int play(std::string stream, int stream_id); |
| 133 | virtual int publish(std::string stream, int stream_id); | 133 | virtual int publish(std::string stream, int stream_id); |
| 134 | - | ||
| 135 | -protected: | ||
| 136 | - SrsProtocol* get_protocol(); | ||
| 137 | - st_netfd_t get_st_fd(); | ||
| 138 | }; | 134 | }; |
| 139 | 135 | ||
| 140 | /** | 136 | /** |
trunk/src/main/srs_main_server.cpp
100644 → 100755
trunk/src/srs/init
100644 → 100755
-
请 注册 或 登录 后发表评论