正在显示
6 个修改的文件
包含
65 行增加
和
54 行删除
| @@ -3,6 +3,9 @@ | @@ -3,6 +3,9 @@ | ||
| 3 | # @see full.conf for detail config. | 3 | # @see full.conf for detail config. |
| 4 | 4 | ||
| 5 | listen 1935; | 5 | listen 1935; |
| 6 | +pid ./objs/srs.master.pid; | ||
| 7 | +srs_log_tank file; | ||
| 8 | +srs_log_file ./objs/srs.master.log; | ||
| 6 | vhost __defaultVhost__ { | 9 | vhost __defaultVhost__ { |
| 7 | forward 127.0.0.1:19350; | 10 | forward 127.0.0.1:19350; |
| 8 | } | 11 | } |
| @@ -89,6 +89,7 @@ vhost __defaultVhost__ { | @@ -89,6 +89,7 @@ vhost __defaultVhost__ { | ||
| 89 | gop_cache on; | 89 | gop_cache on; |
| 90 | http { | 90 | http { |
| 91 | enabled on; | 91 | enabled on; |
| 92 | + mount /; | ||
| 92 | dir ./objs/nginx/html; | 93 | dir ./objs/nginx/html; |
| 93 | } | 94 | } |
| 94 | } | 95 | } |
| @@ -100,9 +101,11 @@ vhost http.srs.com { | @@ -100,9 +101,11 @@ vhost http.srs.com { | ||
| 100 | # whether enable the http streaming service for vhost. | 101 | # whether enable the http streaming service for vhost. |
| 101 | # default: off | 102 | # default: off |
| 102 | enabled on; | 103 | enabled on; |
| 104 | + # the virtual directory root for this vhost to mount at | ||
| 105 | + # for example, if mount to /hls, user access by http://server/hls | ||
| 106 | + mount /hls; | ||
| 103 | # main dir of vhost, | 107 | # main dir of vhost, |
| 104 | # to delivery HTTP stream of this vhost. | 108 | # to delivery HTTP stream of this vhost. |
| 105 | - # default: ./objs/nginx/html; | ||
| 106 | dir ./objs/nginx/html; | 109 | dir ./objs/nginx/html; |
| 107 | } | 110 | } |
| 108 | } | 111 | } |
| @@ -1266,54 +1266,6 @@ string SrsConfig::get_engine_output(SrsConfDirective* engine) | @@ -1266,54 +1266,6 @@ string SrsConfig::get_engine_output(SrsConfDirective* engine) | ||
| 1266 | return conf->arg0(); | 1266 | return conf->arg0(); |
| 1267 | } | 1267 | } |
| 1268 | 1268 | ||
| 1269 | -string SrsConfig::get_ffmpeg_log_dir() | ||
| 1270 | -{ | ||
| 1271 | - srs_assert(root); | ||
| 1272 | - | ||
| 1273 | - SrsConfDirective* conf = root->get("ff_log_dir"); | ||
| 1274 | - if (!conf || conf->arg0().empty()) { | ||
| 1275 | - return "./objs/logs"; | ||
| 1276 | - } | ||
| 1277 | - | ||
| 1278 | - return conf->arg0(); | ||
| 1279 | -} | ||
| 1280 | - | ||
| 1281 | -string SrsConfig::get_srs_log_file() | ||
| 1282 | -{ | ||
| 1283 | - srs_assert(root); | ||
| 1284 | - | ||
| 1285 | - SrsConfDirective* conf = root->get("srs_log_file"); | ||
| 1286 | - if (!conf || conf->arg0().empty()) { | ||
| 1287 | - return "./objs/srs.log"; | ||
| 1288 | - } | ||
| 1289 | - | ||
| 1290 | - return conf->arg0(); | ||
| 1291 | -} | ||
| 1292 | - | ||
| 1293 | -string SrsConfig::get_srs_log_level() | ||
| 1294 | -{ | ||
| 1295 | - srs_assert(root); | ||
| 1296 | - | ||
| 1297 | - SrsConfDirective* conf = root->get("srs_log_level"); | ||
| 1298 | - if (!conf || conf->arg0().empty()) { | ||
| 1299 | - return "trace"; | ||
| 1300 | - } | ||
| 1301 | - | ||
| 1302 | - return conf->arg0(); | ||
| 1303 | -} | ||
| 1304 | - | ||
| 1305 | -bool SrsConfig::get_srs_log_tank_file() | ||
| 1306 | -{ | ||
| 1307 | - srs_assert(root); | ||
| 1308 | - | ||
| 1309 | - SrsConfDirective* conf = root->get("srs_log_tank"); | ||
| 1310 | - if (conf && conf->arg0() == "console") { | ||
| 1311 | - return false; | ||
| 1312 | - } | ||
| 1313 | - | ||
| 1314 | - return true; | ||
| 1315 | -} | ||
| 1316 | - | ||
| 1317 | bool SrsConfig::get_deamon() | 1269 | bool SrsConfig::get_deamon() |
| 1318 | { | 1270 | { |
| 1319 | srs_assert(root); | 1271 | srs_assert(root); |
| @@ -1397,6 +1349,54 @@ SrsConfDirective* SrsConfig::get_forward(string vhost) | @@ -1397,6 +1349,54 @@ SrsConfDirective* SrsConfig::get_forward(string vhost) | ||
| 1397 | return conf->get("forward"); | 1349 | return conf->get("forward"); |
| 1398 | } | 1350 | } |
| 1399 | 1351 | ||
| 1352 | +string SrsConfig::get_srs_log_file() | ||
| 1353 | +{ | ||
| 1354 | + srs_assert(root); | ||
| 1355 | + | ||
| 1356 | + SrsConfDirective* conf = root->get("srs_log_file"); | ||
| 1357 | + if (!conf || conf->arg0().empty()) { | ||
| 1358 | + return "./objs/srs.log"; | ||
| 1359 | + } | ||
| 1360 | + | ||
| 1361 | + return conf->arg0(); | ||
| 1362 | +} | ||
| 1363 | + | ||
| 1364 | +string SrsConfig::get_ffmpeg_log_dir() | ||
| 1365 | +{ | ||
| 1366 | + srs_assert(root); | ||
| 1367 | + | ||
| 1368 | + SrsConfDirective* conf = root->get("ff_log_dir"); | ||
| 1369 | + if (!conf || conf->arg0().empty()) { | ||
| 1370 | + return "./objs/logs"; | ||
| 1371 | + } | ||
| 1372 | + | ||
| 1373 | + return conf->arg0(); | ||
| 1374 | +} | ||
| 1375 | + | ||
| 1376 | +string SrsConfig::get_srs_log_level() | ||
| 1377 | +{ | ||
| 1378 | + srs_assert(root); | ||
| 1379 | + | ||
| 1380 | + SrsConfDirective* conf = root->get("srs_log_level"); | ||
| 1381 | + if (!conf || conf->arg0().empty()) { | ||
| 1382 | + return "trace"; | ||
| 1383 | + } | ||
| 1384 | + | ||
| 1385 | + return conf->arg0(); | ||
| 1386 | +} | ||
| 1387 | + | ||
| 1388 | +bool SrsConfig::get_srs_log_tank_file() | ||
| 1389 | +{ | ||
| 1390 | + srs_assert(root); | ||
| 1391 | + | ||
| 1392 | + SrsConfDirective* conf = root->get("srs_log_tank"); | ||
| 1393 | + if (conf && conf->arg0() == "console") { | ||
| 1394 | + return false; | ||
| 1395 | + } | ||
| 1396 | + | ||
| 1397 | + return true; | ||
| 1398 | +} | ||
| 1399 | + | ||
| 1400 | SrsConfDirective* SrsConfig::get_hls(string vhost) | 1400 | SrsConfDirective* SrsConfig::get_hls(string vhost) |
| 1401 | { | 1401 | { |
| 1402 | SrsConfDirective* conf = get_vhost(vhost); | 1402 | SrsConfDirective* conf = get_vhost(vhost); |
| @@ -147,16 +147,18 @@ public: | @@ -147,16 +147,18 @@ public: | ||
| 147 | virtual int get_engine_achannels(SrsConfDirective* engine); | 147 | virtual int get_engine_achannels(SrsConfDirective* engine); |
| 148 | virtual void get_engine_aparams(SrsConfDirective* engine, std::vector<std::string>& aparams); | 148 | virtual void get_engine_aparams(SrsConfDirective* engine, std::vector<std::string>& aparams); |
| 149 | virtual std::string get_engine_output(SrsConfDirective* engine); | 149 | virtual std::string get_engine_output(SrsConfDirective* engine); |
| 150 | - virtual std::string get_ffmpeg_log_dir(); | ||
| 151 | - virtual bool get_srs_log_tank_file(); | ||
| 152 | - virtual std::string get_srs_log_level(); | ||
| 153 | - virtual std::string get_srs_log_file(); | ||
| 154 | virtual bool get_deamon(); | 150 | virtual bool get_deamon(); |
| 155 | virtual int get_max_connections(); | 151 | virtual int get_max_connections(); |
| 156 | virtual bool get_gop_cache(std::string vhost); | 152 | virtual bool get_gop_cache(std::string vhost); |
| 157 | virtual bool get_atc(std::string vhost); | 153 | virtual bool get_atc(std::string vhost); |
| 158 | virtual double get_queue_length(std::string vhost); | 154 | virtual double get_queue_length(std::string vhost); |
| 159 | virtual SrsConfDirective* get_forward(std::string vhost); | 155 | virtual SrsConfDirective* get_forward(std::string vhost); |
| 156 | +// log section | ||
| 157 | +public: | ||
| 158 | + virtual bool get_srs_log_tank_file(); | ||
| 159 | + virtual std::string get_srs_log_level(); | ||
| 160 | + virtual std::string get_srs_log_file(); | ||
| 161 | + virtual std::string get_ffmpeg_log_dir(); | ||
| 160 | // hls section | 162 | // hls section |
| 161 | private: | 163 | private: |
| 162 | virtual SrsConfDirective* get_hls(std::string vhost); | 164 | virtual SrsConfDirective* get_hls(std::string vhost); |
| @@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | @@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
| 31 | // current release version | 31 | // current release version |
| 32 | #define VERSION_MAJOR "0" | 32 | #define VERSION_MAJOR "0" |
| 33 | #define VERSION_MINOR "9" | 33 | #define VERSION_MINOR "9" |
| 34 | -#define VERSION_REVISION "47" | 34 | +#define VERSION_REVISION "48" |
| 35 | #define RTMP_SIG_SRS_VERSION VERSION_MAJOR"."VERSION_MINOR"."VERSION_REVISION | 35 | #define RTMP_SIG_SRS_VERSION VERSION_MAJOR"."VERSION_MINOR"."VERSION_REVISION |
| 36 | // server info. | 36 | // server info. |
| 37 | #define RTMP_SIG_SRS_KEY "srs" | 37 | #define RTMP_SIG_SRS_KEY "srs" |
-
请 注册 或 登录 后发表评论