alias http_stream to http_server. rename http to http_static of vhost. rename http_flv to http_renux
正在显示
16 个修改的文件
包含
101 行增加
和
64 行删除
| @@ -120,7 +120,7 @@ http_api { | @@ -120,7 +120,7 @@ http_api { | ||
| 120 | # which will show srs version and welcome to srs. | 120 | # which will show srs version and welcome to srs. |
| 121 | # @remark, the http embeded stream need to config the vhost, for instance, the __defaultVhost__ | 121 | # @remark, the http embeded stream need to config the vhost, for instance, the __defaultVhost__ |
| 122 | # need to open the feature http of vhost. | 122 | # need to open the feature http of vhost. |
| 123 | -http_stream { | 123 | +http_server { |
| 124 | # whether http streaming service is enabled. | 124 | # whether http streaming service is enabled. |
| 125 | # default: off | 125 | # default: off |
| 126 | enabled on; | 126 | enabled on; |
| @@ -355,7 +355,7 @@ vhost http.static.srs.com { | @@ -355,7 +355,7 @@ vhost http.static.srs.com { | ||
| 355 | # the variables: | 355 | # the variables: |
| 356 | # [vhost] current vhost for http server. | 356 | # [vhost] current vhost for http server. |
| 357 | # @remark the [vhost] is optional, used to mount at specified vhost. | 357 | # @remark the [vhost] is optional, used to mount at specified vhost. |
| 358 | - # @remark the http of __defaultVhost__ will override the http_stream section. | 358 | + # @remark the http of __defaultVhost__ will override the http_server section. |
| 359 | # for example: | 359 | # for example: |
| 360 | # mount to [vhost]/ | 360 | # mount to [vhost]/ |
| 361 | # access by http://ossrs.net:8080/xxx.html | 361 | # access by http://ossrs.net:8080/xxx.html |
| @@ -367,7 +367,7 @@ vhost http.static.srs.com { | @@ -367,7 +367,7 @@ vhost http.static.srs.com { | ||
| 367 | # mount to /hls | 367 | # mount to /hls |
| 368 | # access by http://ossrs.net:8080/hls/xxx.html | 368 | # access by http://ossrs.net:8080/hls/xxx.html |
| 369 | # or by http://192.168.1.173:8080/hls/xxx.html | 369 | # or by http://192.168.1.173:8080/hls/xxx.html |
| 370 | - # @remark the port of http is specified by http_stream section. | 370 | + # @remark the port of http is specified by http_server section. |
| 371 | # default: [vhost]/ | 371 | # default: [vhost]/ |
| 372 | mount [vhost]/hls; | 372 | mount [vhost]/hls; |
| 373 | # main dir of vhost, | 373 | # main dir of vhost, |
| @@ -378,9 +378,9 @@ vhost http.static.srs.com { | @@ -378,9 +378,9 @@ vhost http.static.srs.com { | ||
| 378 | } | 378 | } |
| 379 | 379 | ||
| 380 | # vhost for http flv/aac/mp3 live stream for each vhost. | 380 | # vhost for http flv/aac/mp3 live stream for each vhost. |
| 381 | -vhost http.flv.srs.com { | 381 | +vhost http.remux.srs.com { |
| 382 | # http flv/mp3/aac stream vhost specified config | 382 | # http flv/mp3/aac stream vhost specified config |
| 383 | - http_flv { | 383 | + http_remux { |
| 384 | # whether enable the http flv live streaming service for vhost. | 384 | # whether enable the http flv live streaming service for vhost. |
| 385 | # default: off | 385 | # default: off |
| 386 | enabled on; | 386 | enabled on; |
| @@ -410,7 +410,7 @@ vhost http.flv.srs.com { | @@ -410,7 +410,7 @@ vhost http.flv.srs.com { | ||
| 410 | # access by http://ossrs.net:8080/live/livestream.mp3 | 410 | # access by http://ossrs.net:8080/live/livestream.mp3 |
| 411 | # mount to [vhost]/[app]/[stream].aac | 411 | # mount to [vhost]/[app]/[stream].aac |
| 412 | # access by http://ossrs.net:8080/live/livestream.aac | 412 | # access by http://ossrs.net:8080/live/livestream.aac |
| 413 | - # @remark the port of http is specified by http_stream section. | 413 | + # @remark the port of http is specified by http_server section. |
| 414 | # default: [vhost]/[app]/[stream].flv | 414 | # default: [vhost]/[app]/[stream].flv |
| 415 | mount [vhost]/[app]/[stream].flv; | 415 | mount [vhost]/[app]/[stream].flv; |
| 416 | } | 416 | } |
| @@ -4,13 +4,13 @@ | @@ -4,13 +4,13 @@ | ||
| 4 | 4 | ||
| 5 | listen 1935; | 5 | listen 1935; |
| 6 | max_connections 1000; | 6 | max_connections 1000; |
| 7 | -http_stream { | 7 | +http_server { |
| 8 | enabled on; | 8 | enabled on; |
| 9 | listen 8080; | 9 | listen 8080; |
| 10 | dir ./objs/nginx/html; | 10 | dir ./objs/nginx/html; |
| 11 | } | 11 | } |
| 12 | vhost __defaultVhost__ { | 12 | vhost __defaultVhost__ { |
| 13 | - http_flv { | 13 | + http_remux { |
| 14 | enabled on; | 14 | enabled on; |
| 15 | fast_cache 30; | 15 | fast_cache 30; |
| 16 | mount [vhost]/[app]/[stream].aac; | 16 | mount [vhost]/[app]/[stream].aac; |
| @@ -4,13 +4,13 @@ | @@ -4,13 +4,13 @@ | ||
| 4 | 4 | ||
| 5 | listen 1935; | 5 | listen 1935; |
| 6 | max_connections 1000; | 6 | max_connections 1000; |
| 7 | -http_stream { | 7 | +http_server { |
| 8 | enabled on; | 8 | enabled on; |
| 9 | listen 8080; | 9 | listen 8080; |
| 10 | dir ./objs/nginx/html; | 10 | dir ./objs/nginx/html; |
| 11 | } | 11 | } |
| 12 | vhost __defaultVhost__ { | 12 | vhost __defaultVhost__ { |
| 13 | - http_flv { | 13 | + http_remux { |
| 14 | enabled on; | 14 | enabled on; |
| 15 | mount [vhost]/[app]/[stream].flv; | 15 | mount [vhost]/[app]/[stream].flv; |
| 16 | } | 16 | } |
| @@ -4,13 +4,13 @@ | @@ -4,13 +4,13 @@ | ||
| 4 | 4 | ||
| 5 | listen 1935; | 5 | listen 1935; |
| 6 | max_connections 1000; | 6 | max_connections 1000; |
| 7 | -http_stream { | 7 | +http_server { |
| 8 | enabled on; | 8 | enabled on; |
| 9 | listen 8080; | 9 | listen 8080; |
| 10 | dir ./objs/nginx/html; | 10 | dir ./objs/nginx/html; |
| 11 | } | 11 | } |
| 12 | vhost __defaultVhost__ { | 12 | vhost __defaultVhost__ { |
| 13 | - http_flv { | 13 | + http_remux { |
| 14 | enabled on; | 14 | enabled on; |
| 15 | fast_cache 30; | 15 | fast_cache 30; |
| 16 | mount [vhost]/[app]/[stream].mp3; | 16 | mount [vhost]/[app]/[stream].mp3; |
| @@ -606,7 +606,16 @@ int SrsConfig::reload_http_stream(SrsConfDirective* old_root) | @@ -606,7 +606,16 @@ int SrsConfig::reload_http_stream(SrsConfDirective* old_root) | ||
| 606 | // ENABLED => ENABLED (modified) | 606 | // ENABLED => ENABLED (modified) |
| 607 | 607 | ||
| 608 | SrsConfDirective* new_http_stream = root->get("http_stream"); | 608 | SrsConfDirective* new_http_stream = root->get("http_stream"); |
| 609 | + // http_stream rename to http_server in SRS2. | ||
| 610 | + if (!new_http_stream) { | ||
| 611 | + new_http_stream = root->get("http_server"); | ||
| 612 | + } | ||
| 613 | + | ||
| 609 | SrsConfDirective* old_http_stream = old_root->get("http_stream"); | 614 | SrsConfDirective* old_http_stream = old_root->get("http_stream"); |
| 615 | + // http_stream rename to http_server in SRS2. | ||
| 616 | + if (!old_http_stream) { | ||
| 617 | + old_http_stream = root->get("http_server"); | ||
| 618 | + } | ||
| 610 | 619 | ||
| 611 | // DISABLED => ENABLED | 620 | // DISABLED => ENABLED |
| 612 | if (!get_http_stream_enabled(old_http_stream) && get_http_stream_enabled(new_http_stream)) { | 621 | if (!get_http_stream_enabled(old_http_stream) && get_http_stream_enabled(new_http_stream)) { |
| @@ -876,16 +885,28 @@ int SrsConfig::reload_vhost(SrsConfDirective* old_root) | @@ -876,16 +885,28 @@ int SrsConfig::reload_vhost(SrsConfDirective* old_root) | ||
| 876 | } | 885 | } |
| 877 | srs_trace("vhost %s reload http success.", vhost.c_str()); | 886 | srs_trace("vhost %s reload http success.", vhost.c_str()); |
| 878 | } | 887 | } |
| 879 | - // http_flv, only one per vhost. | ||
| 880 | - if (!srs_directive_equals(new_vhost->get("http_flv"), old_vhost->get("http_flv"))) { | 888 | + // http_static, only one per vhost. |
| 889 | + // @remark, http_static introduced as alias of http. | ||
| 890 | + if (!srs_directive_equals(new_vhost->get("http_static"), old_vhost->get("http_static"))) { | ||
| 881 | for (it = subscribes.begin(); it != subscribes.end(); ++it) { | 891 | for (it = subscribes.begin(); it != subscribes.end(); ++it) { |
| 882 | ISrsReloadHandler* subscribe = *it; | 892 | ISrsReloadHandler* subscribe = *it; |
| 883 | - if ((ret = subscribe->on_reload_vhost_http_flv_updated()) != ERROR_SUCCESS) { | ||
| 884 | - srs_error("vhost %s notify subscribes http_flv failed. ret=%d", vhost.c_str(), ret); | 893 | + if ((ret = subscribe->on_reload_vhost_http_updated()) != ERROR_SUCCESS) { |
| 894 | + srs_error("vhost %s notify subscribes http_static failed. ret=%d", vhost.c_str(), ret); | ||
| 885 | return ret; | 895 | return ret; |
| 886 | } | 896 | } |
| 887 | } | 897 | } |
| 888 | - srs_trace("vhost %s reload http_flv success.", vhost.c_str()); | 898 | + srs_trace("vhost %s reload http_static success.", vhost.c_str()); |
| 899 | + } | ||
| 900 | + // http_remux, only one per vhost. | ||
| 901 | + if (!srs_directive_equals(new_vhost->get("http_remux"), old_vhost->get("http_remux"))) { | ||
| 902 | + for (it = subscribes.begin(); it != subscribes.end(); ++it) { | ||
| 903 | + ISrsReloadHandler* subscribe = *it; | ||
| 904 | + if ((ret = subscribe->on_reload_vhost_http_remux_updated()) != ERROR_SUCCESS) { | ||
| 905 | + srs_error("vhost %s notify subscribes http_remux failed. ret=%d", vhost.c_str(), ret); | ||
| 906 | + return ret; | ||
| 907 | + } | ||
| 908 | + } | ||
| 909 | + srs_trace("vhost %s reload http_remux success.", vhost.c_str()); | ||
| 889 | } | 910 | } |
| 890 | // transcode, many per vhost. | 911 | // transcode, many per vhost. |
| 891 | if ((ret = reload_transcode(new_vhost, old_vhost)) != ERROR_SUCCESS) { | 912 | if ((ret = reload_transcode(new_vhost, old_vhost)) != ERROR_SUCCESS) { |
| @@ -1293,8 +1314,8 @@ int SrsConfig::check_config() | @@ -1293,8 +1314,8 @@ int SrsConfig::check_config() | ||
| 1293 | if (n != "listen" && n != "pid" && n != "chunk_size" && n != "ff_log_dir" | 1314 | if (n != "listen" && n != "pid" && n != "chunk_size" && n != "ff_log_dir" |
| 1294 | && n != "srs_log_tank" && n != "srs_log_level" && n != "srs_log_file" | 1315 | && n != "srs_log_tank" && n != "srs_log_level" && n != "srs_log_file" |
| 1295 | && n != "max_connections" && n != "daemon" && n != "heartbeat" | 1316 | && n != "max_connections" && n != "daemon" && n != "heartbeat" |
| 1296 | - && n != "http_api" && n != "http_stream" && n != "stats" && n != "vhost" | ||
| 1297 | - && n != "pithy_print") | 1317 | + && n != "http_api" && n != "stats" && n != "vhost" && n != "pithy_print" |
| 1318 | + && n != "http_stream" && n != "http_server") | ||
| 1298 | { | 1319 | { |
| 1299 | ret = ERROR_SYSTEM_CONFIG_INVALID; | 1320 | ret = ERROR_SYSTEM_CONFIG_INVALID; |
| 1300 | srs_error("unsupported directive %s, ret=%d", n.c_str(), ret); | 1321 | srs_error("unsupported directive %s, ret=%d", n.c_str(), ret); |
| @@ -1367,7 +1388,7 @@ int SrsConfig::check_config() | @@ -1367,7 +1388,7 @@ int SrsConfig::check_config() | ||
| 1367 | string n = conf->name; | 1388 | string n = conf->name; |
| 1368 | if (n != "enabled" && n != "chunk_size" | 1389 | if (n != "enabled" && n != "chunk_size" |
| 1369 | && n != "mode" && n != "origin" && n != "token_traverse" | 1390 | && n != "mode" && n != "origin" && n != "token_traverse" |
| 1370 | - && n != "dvr" && n != "ingest" && n != "http" && n != "hls" && n != "http_hooks" | 1391 | + && n != "dvr" && n != "ingest" && n != "hls" && n != "http_hooks" |
| 1371 | && n != "gop_cache" && n != "queue_length" | 1392 | && n != "gop_cache" && n != "queue_length" |
| 1372 | && n != "refer" && n != "refer_publish" && n != "refer_play" | 1393 | && n != "refer" && n != "refer_publish" && n != "refer_play" |
| 1373 | && n != "forward" && n != "transcode" && n != "bandcheck" | 1394 | && n != "forward" && n != "transcode" && n != "bandcheck" |
| @@ -1375,7 +1396,8 @@ int SrsConfig::check_config() | @@ -1375,7 +1396,8 @@ int SrsConfig::check_config() | ||
| 1375 | && n != "atc" && n != "atc_auto" | 1396 | && n != "atc" && n != "atc_auto" |
| 1376 | && n != "debug_srs_upnode" | 1397 | && n != "debug_srs_upnode" |
| 1377 | && n != "mr" && n != "mw_latency" && n != "min_latency" | 1398 | && n != "mr" && n != "mw_latency" && n != "min_latency" |
| 1378 | - && n != "security" && n != "http_flv" | 1399 | + && n != "security" && n != "http_remux" |
| 1400 | + && n != "http" && n != "http_static" | ||
| 1379 | ) { | 1401 | ) { |
| 1380 | ret = ERROR_SYSTEM_CONFIG_INVALID; | 1402 | ret = ERROR_SYSTEM_CONFIG_INVALID; |
| 1381 | srs_error("unsupported vhost directive %s, ret=%d", n.c_str(), ret); | 1403 | srs_error("unsupported vhost directive %s, ret=%d", n.c_str(), ret); |
| @@ -1414,7 +1436,7 @@ int SrsConfig::check_config() | @@ -1414,7 +1436,7 @@ int SrsConfig::check_config() | ||
| 1414 | return ret; | 1436 | return ret; |
| 1415 | } | 1437 | } |
| 1416 | } | 1438 | } |
| 1417 | - } else if (n == "http") { | 1439 | + } else if (n == "http" || n == "http_static") { |
| 1418 | for (int j = 0; j < (int)conf->directives.size(); j++) { | 1440 | for (int j = 0; j < (int)conf->directives.size(); j++) { |
| 1419 | string m = conf->at(j)->name.c_str(); | 1441 | string m = conf->at(j)->name.c_str(); |
| 1420 | if (m != "enabled" && m != "mount" && m != "dir") { | 1442 | if (m != "enabled" && m != "mount" && m != "dir") { |
| @@ -1423,12 +1445,12 @@ int SrsConfig::check_config() | @@ -1423,12 +1445,12 @@ int SrsConfig::check_config() | ||
| 1423 | return ret; | 1445 | return ret; |
| 1424 | } | 1446 | } |
| 1425 | } | 1447 | } |
| 1426 | - } else if (n == "http_flv") { | 1448 | + } else if (n == "http_remux") { |
| 1427 | for (int j = 0; j < (int)conf->directives.size(); j++) { | 1449 | for (int j = 0; j < (int)conf->directives.size(); j++) { |
| 1428 | string m = conf->at(j)->name.c_str(); | 1450 | string m = conf->at(j)->name.c_str(); |
| 1429 | if (m != "enabled" && m != "mount" && m != "fast_cache") { | 1451 | if (m != "enabled" && m != "mount" && m != "fast_cache") { |
| 1430 | ret = ERROR_SYSTEM_CONFIG_INVALID; | 1452 | ret = ERROR_SYSTEM_CONFIG_INVALID; |
| 1431 | - srs_error("unsupported vhost http_flv directive %s, ret=%d", m.c_str(), ret); | 1453 | + srs_error("unsupported vhost http_remux directive %s, ret=%d", m.c_str(), ret); |
| 1432 | return ret; | 1454 | return ret; |
| 1433 | } | 1455 | } |
| 1434 | } | 1456 | } |
| @@ -3329,7 +3351,13 @@ bool SrsConfig::get_http_stream_enabled() | @@ -3329,7 +3351,13 @@ bool SrsConfig::get_http_stream_enabled() | ||
| 3329 | 3351 | ||
| 3330 | SrsConfDirective* SrsConfig::get_http_stream() | 3352 | SrsConfDirective* SrsConfig::get_http_stream() |
| 3331 | { | 3353 | { |
| 3332 | - return root->get("http_stream"); | 3354 | + SrsConfDirective* conf = root->get("http_stream"); |
| 3355 | + // http_stream renamed to http_server in SRS2. | ||
| 3356 | + if (!conf) { | ||
| 3357 | + conf = root->get("http_server"); | ||
| 3358 | + } | ||
| 3359 | + | ||
| 3360 | + return conf; | ||
| 3333 | } | 3361 | } |
| 3334 | 3362 | ||
| 3335 | bool SrsConfig::get_http_stream_enabled(SrsConfDirective* conf) | 3363 | bool SrsConfig::get_http_stream_enabled(SrsConfDirective* conf) |
| @@ -3383,15 +3411,18 @@ string SrsConfig::get_http_stream_dir() | @@ -3383,15 +3411,18 @@ string SrsConfig::get_http_stream_dir() | ||
| 3383 | 3411 | ||
| 3384 | bool SrsConfig::get_vhost_http_enabled(string vhost) | 3412 | bool SrsConfig::get_vhost_http_enabled(string vhost) |
| 3385 | { | 3413 | { |
| 3386 | - SrsConfDirective* conf = get_vhost(vhost); | ||
| 3387 | - if (!conf) { | 3414 | + SrsConfDirective* vconf = get_vhost(vhost); |
| 3415 | + if (!vconf) { | ||
| 3388 | return false; | 3416 | return false; |
| 3389 | } | 3417 | } |
| 3390 | 3418 | ||
| 3391 | - conf = conf->get("http"); | 3419 | + SrsConfDirective* conf = vconf->get("http"); |
| 3420 | + if (!conf) { | ||
| 3421 | + conf = vconf->get("http_static"); | ||
| 3392 | if (!conf) { | 3422 | if (!conf) { |
| 3393 | return false; | 3423 | return false; |
| 3394 | } | 3424 | } |
| 3425 | + } | ||
| 3395 | 3426 | ||
| 3396 | conf = conf->get("enabled"); | 3427 | conf = conf->get("enabled"); |
| 3397 | if (!conf) { | 3428 | if (!conf) { |
| @@ -3407,15 +3438,18 @@ bool SrsConfig::get_vhost_http_enabled(string vhost) | @@ -3407,15 +3438,18 @@ bool SrsConfig::get_vhost_http_enabled(string vhost) | ||
| 3407 | 3438 | ||
| 3408 | string SrsConfig::get_vhost_http_mount(string vhost) | 3439 | string SrsConfig::get_vhost_http_mount(string vhost) |
| 3409 | { | 3440 | { |
| 3410 | - SrsConfDirective* conf = get_vhost(vhost); | ||
| 3411 | - if (!conf) { | 3441 | + SrsConfDirective* vconf = get_vhost(vhost); |
| 3442 | + if (!vconf) { | ||
| 3412 | return SRS_CONF_DEFAULT_HTTP_MOUNT; | 3443 | return SRS_CONF_DEFAULT_HTTP_MOUNT; |
| 3413 | } | 3444 | } |
| 3414 | 3445 | ||
| 3415 | - conf = conf->get("http"); | 3446 | + SrsConfDirective* conf = vconf->get("http"); |
| 3447 | + if (!conf) { | ||
| 3448 | + conf = vconf->get("http_static"); | ||
| 3416 | if (!conf) { | 3449 | if (!conf) { |
| 3417 | return SRS_CONF_DEFAULT_HTTP_MOUNT; | 3450 | return SRS_CONF_DEFAULT_HTTP_MOUNT; |
| 3418 | } | 3451 | } |
| 3452 | + } | ||
| 3419 | 3453 | ||
| 3420 | conf = conf->get("mount"); | 3454 | conf = conf->get("mount"); |
| 3421 | if (!conf || conf->arg0().empty()) { | 3455 | if (!conf || conf->arg0().empty()) { |
| @@ -3427,15 +3461,18 @@ string SrsConfig::get_vhost_http_mount(string vhost) | @@ -3427,15 +3461,18 @@ string SrsConfig::get_vhost_http_mount(string vhost) | ||
| 3427 | 3461 | ||
| 3428 | string SrsConfig::get_vhost_http_dir(string vhost) | 3462 | string SrsConfig::get_vhost_http_dir(string vhost) |
| 3429 | { | 3463 | { |
| 3430 | - SrsConfDirective* conf = get_vhost(vhost); | ||
| 3431 | - if (!conf) { | 3464 | + SrsConfDirective* vconf = get_vhost(vhost); |
| 3465 | + if (!vconf) { | ||
| 3432 | return SRS_CONF_DEFAULT_HTTP_DIR; | 3466 | return SRS_CONF_DEFAULT_HTTP_DIR; |
| 3433 | } | 3467 | } |
| 3434 | 3468 | ||
| 3435 | - conf = conf->get("http"); | 3469 | + SrsConfDirective* conf = vconf->get("http"); |
| 3470 | + if (!conf) { | ||
| 3471 | + conf = vconf->get("http_static"); | ||
| 3436 | if (!conf) { | 3472 | if (!conf) { |
| 3437 | return SRS_CONF_DEFAULT_HTTP_DIR; | 3473 | return SRS_CONF_DEFAULT_HTTP_DIR; |
| 3438 | } | 3474 | } |
| 3475 | + } | ||
| 3439 | 3476 | ||
| 3440 | conf = conf->get("dir"); | 3477 | conf = conf->get("dir"); |
| 3441 | if (!conf || conf->arg0().empty()) { | 3478 | if (!conf || conf->arg0().empty()) { |
| @@ -3445,14 +3482,14 @@ string SrsConfig::get_vhost_http_dir(string vhost) | @@ -3445,14 +3482,14 @@ string SrsConfig::get_vhost_http_dir(string vhost) | ||
| 3445 | return conf->arg0(); | 3482 | return conf->arg0(); |
| 3446 | } | 3483 | } |
| 3447 | 3484 | ||
| 3448 | -bool SrsConfig::get_vhost_http_flv_enabled(string vhost) | 3485 | +bool SrsConfig::get_vhost_http_remux_enabled(string vhost) |
| 3449 | { | 3486 | { |
| 3450 | SrsConfDirective* conf = get_vhost(vhost); | 3487 | SrsConfDirective* conf = get_vhost(vhost); |
| 3451 | if (!conf) { | 3488 | if (!conf) { |
| 3452 | return false; | 3489 | return false; |
| 3453 | } | 3490 | } |
| 3454 | 3491 | ||
| 3455 | - conf = conf->get("http_flv"); | 3492 | + conf = conf->get("http_remux"); |
| 3456 | if (!conf) { | 3493 | if (!conf) { |
| 3457 | return false; | 3494 | return false; |
| 3458 | } | 3495 | } |
| @@ -3469,14 +3506,14 @@ bool SrsConfig::get_vhost_http_flv_enabled(string vhost) | @@ -3469,14 +3506,14 @@ bool SrsConfig::get_vhost_http_flv_enabled(string vhost) | ||
| 3469 | return false; | 3506 | return false; |
| 3470 | } | 3507 | } |
| 3471 | 3508 | ||
| 3472 | -double SrsConfig::get_vhost_http_flv_fast_cache(string vhost) | 3509 | +double SrsConfig::get_vhost_http_remux_fast_cache(string vhost) |
| 3473 | { | 3510 | { |
| 3474 | SrsConfDirective* conf = get_vhost(vhost); | 3511 | SrsConfDirective* conf = get_vhost(vhost); |
| 3475 | if (!conf) { | 3512 | if (!conf) { |
| 3476 | return SRS_CONF_DEFAULT_HTTP_AUDIO_FAST_CACHE; | 3513 | return SRS_CONF_DEFAULT_HTTP_AUDIO_FAST_CACHE; |
| 3477 | } | 3514 | } |
| 3478 | 3515 | ||
| 3479 | - conf = conf->get("http_flv"); | 3516 | + conf = conf->get("http_remux"); |
| 3480 | if (!conf) { | 3517 | if (!conf) { |
| 3481 | return SRS_CONF_DEFAULT_HTTP_AUDIO_FAST_CACHE; | 3518 | return SRS_CONF_DEFAULT_HTTP_AUDIO_FAST_CACHE; |
| 3482 | } | 3519 | } |
| @@ -3493,21 +3530,21 @@ double SrsConfig::get_vhost_http_flv_fast_cache(string vhost) | @@ -3493,21 +3530,21 @@ double SrsConfig::get_vhost_http_flv_fast_cache(string vhost) | ||
| 3493 | return ::atof(conf->arg0().c_str()); | 3530 | return ::atof(conf->arg0().c_str()); |
| 3494 | } | 3531 | } |
| 3495 | 3532 | ||
| 3496 | -string SrsConfig::get_vhost_http_flv_mount(string vhost) | 3533 | +string SrsConfig::get_vhost_http_remux_mount(string vhost) |
| 3497 | { | 3534 | { |
| 3498 | SrsConfDirective* conf = get_vhost(vhost); | 3535 | SrsConfDirective* conf = get_vhost(vhost); |
| 3499 | if (!conf) { | 3536 | if (!conf) { |
| 3500 | - return SRS_CONF_DEFAULT_HTTP_FLV_MOUNT; | 3537 | + return SRS_CONF_DEFAULT_HTTP_REMUX_MOUNT; |
| 3501 | } | 3538 | } |
| 3502 | 3539 | ||
| 3503 | - conf = conf->get("http_flv"); | 3540 | + conf = conf->get("http_remux"); |
| 3504 | if (!conf) { | 3541 | if (!conf) { |
| 3505 | - return SRS_CONF_DEFAULT_HTTP_FLV_MOUNT; | 3542 | + return SRS_CONF_DEFAULT_HTTP_REMUX_MOUNT; |
| 3506 | } | 3543 | } |
| 3507 | 3544 | ||
| 3508 | conf = conf->get("mount"); | 3545 | conf = conf->get("mount"); |
| 3509 | if (!conf || conf->arg0().empty()) { | 3546 | if (!conf || conf->arg0().empty()) { |
| 3510 | - return SRS_CONF_DEFAULT_HTTP_FLV_MOUNT; | 3547 | + return SRS_CONF_DEFAULT_HTTP_REMUX_MOUNT; |
| 3511 | } | 3548 | } |
| 3512 | 3549 | ||
| 3513 | return conf->arg0(); | 3550 | return conf->arg0(); |
| @@ -66,7 +66,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | @@ -66,7 +66,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
| 66 | #define SRS_CONF_DEFAULT_BANDWIDTH_LIMIT_KBPS 1000 | 66 | #define SRS_CONF_DEFAULT_BANDWIDTH_LIMIT_KBPS 1000 |
| 67 | 67 | ||
| 68 | #define SRS_CONF_DEFAULT_HTTP_MOUNT "[vhost]/" | 68 | #define SRS_CONF_DEFAULT_HTTP_MOUNT "[vhost]/" |
| 69 | -#define SRS_CONF_DEFAULT_HTTP_FLV_MOUNT "[vhost]/[app]/[stream].flv" | 69 | +#define SRS_CONF_DEFAULT_HTTP_REMUX_MOUNT "[vhost]/[app]/[stream].flv" |
| 70 | #define SRS_CONF_DEFAULT_HTTP_DIR SRS_CONF_DEFAULT_HLS_PATH | 70 | #define SRS_CONF_DEFAULT_HTTP_DIR SRS_CONF_DEFAULT_HLS_PATH |
| 71 | #define SRS_CONF_DEFAULT_HTTP_AUDIO_FAST_CACHE 30 | 71 | #define SRS_CONF_DEFAULT_HTTP_AUDIO_FAST_CACHE 30 |
| 72 | 72 | ||
| @@ -970,16 +970,16 @@ public: | @@ -970,16 +970,16 @@ public: | ||
| 970 | /** | 970 | /** |
| 971 | * get whether vhost enabled http flv live stream | 971 | * get whether vhost enabled http flv live stream |
| 972 | */ | 972 | */ |
| 973 | - virtual bool get_vhost_http_flv_enabled(std::string vhost); | 973 | + virtual bool get_vhost_http_remux_enabled(std::string vhost); |
| 974 | /** | 974 | /** |
| 975 | * get the fast cache duration for http audio live stream. | 975 | * get the fast cache duration for http audio live stream. |
| 976 | */ | 976 | */ |
| 977 | - virtual double get_vhost_http_flv_fast_cache(std::string vhost); | 977 | + virtual double get_vhost_http_remux_fast_cache(std::string vhost); |
| 978 | /** | 978 | /** |
| 979 | * get the http flv live stream mount point for vhost. | 979 | * get the http flv live stream mount point for vhost. |
| 980 | * used to generate the flv stream mount path. | 980 | * used to generate the flv stream mount path. |
| 981 | */ | 981 | */ |
| 982 | - virtual std::string get_vhost_http_flv_mount(std::string vhost); | 982 | + virtual std::string get_vhost_http_remux_mount(std::string vhost); |
| 983 | // http heartbeart section | 983 | // http heartbeart section |
| 984 | private: | 984 | private: |
| 985 | /** | 985 | /** |
| @@ -68,7 +68,7 @@ int SrsVodStream::serve_flv_stream(ISrsGoHttpResponseWriter* w, SrsHttpMessage* | @@ -68,7 +68,7 @@ int SrsVodStream::serve_flv_stream(ISrsGoHttpResponseWriter* w, SrsHttpMessage* | ||
| 68 | } | 68 | } |
| 69 | 69 | ||
| 70 | if (offset > fs.filesize()) { | 70 | if (offset > fs.filesize()) { |
| 71 | - ret = ERROR_HTTP_FLV_OFFSET_OVERFLOW; | 71 | + ret = ERROR_HTTP_REMUX_OFFSET_OVERFLOW; |
| 72 | srs_warn("http flv streaming %s overflow. size=%"PRId64", offset=%d, ret=%d", | 72 | srs_warn("http flv streaming %s overflow. size=%"PRId64", offset=%d, ret=%d", |
| 73 | fullpath.c_str(), fs.filesize(), offset, ret); | 73 | fullpath.c_str(), fs.filesize(), offset, ret); |
| 74 | return ret; | 74 | return ret; |
| @@ -100,7 +100,7 @@ int SrsVodStream::serve_flv_stream(ISrsGoHttpResponseWriter* w, SrsHttpMessage* | @@ -100,7 +100,7 @@ int SrsVodStream::serve_flv_stream(ISrsGoHttpResponseWriter* w, SrsHttpMessage* | ||
| 100 | return ret; | 100 | return ret; |
| 101 | } | 101 | } |
| 102 | if (sh_size <= 0) { | 102 | if (sh_size <= 0) { |
| 103 | - ret = ERROR_HTTP_FLV_SEQUENCE_HEADER; | 103 | + ret = ERROR_HTTP_REMUX_SEQUENCE_HEADER; |
| 104 | srs_warn("http flv streaming no sequence header. size=%d, ret=%d", sh_size, ret); | 104 | srs_warn("http flv streaming no sequence header. size=%d, ret=%d", sh_size, ret); |
| 105 | return ret; | 105 | return ret; |
| 106 | } | 106 | } |
| @@ -171,7 +171,7 @@ int SrsStreamCache::dump_cache(SrsConsumer* consumer) | @@ -171,7 +171,7 @@ int SrsStreamCache::dump_cache(SrsConsumer* consumer) | ||
| 171 | } | 171 | } |
| 172 | 172 | ||
| 173 | srs_trace("http: dump cache %d msgs, duration=%dms, cache=%.2fs", | 173 | srs_trace("http: dump cache %d msgs, duration=%dms, cache=%.2fs", |
| 174 | - queue->size(), queue->duration(), _srs_config->get_vhost_http_flv_fast_cache(req->vhost)); | 174 | + queue->size(), queue->duration(), _srs_config->get_vhost_http_remux_fast_cache(req->vhost)); |
| 175 | 175 | ||
| 176 | return ret; | 176 | return ret; |
| 177 | } | 177 | } |
| @@ -191,7 +191,7 @@ int SrsStreamCache::cycle() | @@ -191,7 +191,7 @@ int SrsStreamCache::cycle() | ||
| 191 | // TODO: FIMXE: add pithy print. | 191 | // TODO: FIMXE: add pithy print. |
| 192 | 192 | ||
| 193 | // TODO: FIXME: support reload. | 193 | // TODO: FIXME: support reload. |
| 194 | - queue->set_queue_size(_srs_config->get_vhost_http_flv_fast_cache(req->vhost)); | 194 | + queue->set_queue_size(_srs_config->get_vhost_http_remux_fast_cache(req->vhost)); |
| 195 | 195 | ||
| 196 | while (true) { | 196 | while (true) { |
| 197 | // get messages from consumer. | 197 | // get messages from consumer. |
| @@ -656,7 +656,7 @@ int SrsHttpServer::on_reload_vhost_http_updated() | @@ -656,7 +656,7 @@ int SrsHttpServer::on_reload_vhost_http_updated() | ||
| 656 | return ret; | 656 | return ret; |
| 657 | } | 657 | } |
| 658 | 658 | ||
| 659 | -int SrsHttpServer::on_reload_vhost_http_flv_updated() | 659 | +int SrsHttpServer::on_reload_vhost_http_remux_updated() |
| 660 | { | 660 | { |
| 661 | int ret = ERROR_SUCCESS; | 661 | int ret = ERROR_SUCCESS; |
| 662 | // TODO: FIXME: implements it. | 662 | // TODO: FIXME: implements it. |
| @@ -737,13 +737,13 @@ int SrsHttpServer::mount_flv_streaming() | @@ -737,13 +737,13 @@ int SrsHttpServer::mount_flv_streaming() | ||
| 737 | } | 737 | } |
| 738 | 738 | ||
| 739 | std::string vhost = conf->arg0(); | 739 | std::string vhost = conf->arg0(); |
| 740 | - if (!_srs_config->get_vhost_http_flv_enabled(vhost)) { | 740 | + if (!_srs_config->get_vhost_http_remux_enabled(vhost)) { |
| 741 | continue; | 741 | continue; |
| 742 | } | 742 | } |
| 743 | 743 | ||
| 744 | SrsLiveEntry* entry = new SrsLiveEntry(); | 744 | SrsLiveEntry* entry = new SrsLiveEntry(); |
| 745 | entry->vhost = vhost; | 745 | entry->vhost = vhost; |
| 746 | - entry->mount = _srs_config->get_vhost_http_flv_mount(vhost); | 746 | + entry->mount = _srs_config->get_vhost_http_remux_mount(vhost); |
| 747 | flvs[vhost] = entry; | 747 | flvs[vhost] = entry; |
| 748 | srs_trace("http flv live stream, vhost=%s, mount=%s", | 748 | srs_trace("http flv live stream, vhost=%s, mount=%s", |
| 749 | vhost.c_str(), entry->mount.c_str()); | 749 | vhost.c_str(), entry->mount.c_str()); |
| @@ -259,7 +259,7 @@ public: | @@ -259,7 +259,7 @@ public: | ||
| 259 | // interface ISrsThreadHandler. | 259 | // interface ISrsThreadHandler. |
| 260 | public: | 260 | public: |
| 261 | virtual int on_reload_vhost_http_updated(); | 261 | virtual int on_reload_vhost_http_updated(); |
| 262 | - virtual int on_reload_vhost_http_flv_updated(); | 262 | + virtual int on_reload_vhost_http_remux_updated(); |
| 263 | private: | 263 | private: |
| 264 | virtual int mount_static_file(); | 264 | virtual int mount_static_file(); |
| 265 | virtual int mount_flv_streaming(); | 265 | virtual int mount_flv_streaming(); |
| @@ -95,7 +95,7 @@ int ISrsReloadHandler::on_reload_vhost_http_updated() | @@ -95,7 +95,7 @@ int ISrsReloadHandler::on_reload_vhost_http_updated() | ||
| 95 | return ERROR_SUCCESS; | 95 | return ERROR_SUCCESS; |
| 96 | } | 96 | } |
| 97 | 97 | ||
| 98 | -int ISrsReloadHandler::on_reload_vhost_http_flv_updated() | 98 | +int ISrsReloadHandler::on_reload_vhost_http_remux_updated() |
| 99 | { | 99 | { |
| 100 | return ERROR_SUCCESS; | 100 | return ERROR_SUCCESS; |
| 101 | } | 101 | } |
| @@ -56,7 +56,7 @@ public: | @@ -56,7 +56,7 @@ public: | ||
| 56 | virtual int on_reload_http_stream_disabled(); | 56 | virtual int on_reload_http_stream_disabled(); |
| 57 | virtual int on_reload_http_stream_updated(); | 57 | virtual int on_reload_http_stream_updated(); |
| 58 | virtual int on_reload_vhost_http_updated(); | 58 | virtual int on_reload_vhost_http_updated(); |
| 59 | - virtual int on_reload_vhost_http_flv_updated(); | 59 | + virtual int on_reload_vhost_http_remux_updated(); |
| 60 | virtual int on_reload_vhost_added(std::string vhost); | 60 | virtual int on_reload_vhost_added(std::string vhost); |
| 61 | virtual int on_reload_vhost_removed(std::string vhost); | 61 | virtual int on_reload_vhost_removed(std::string vhost); |
| 62 | virtual int on_reload_vhost_atc(std::string vhost); | 62 | virtual int on_reload_vhost_atc(std::string vhost); |
| @@ -166,8 +166,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | @@ -166,8 +166,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
| 166 | #define ERROR_HTTP_HANDLER_MATCH_URL 3010 | 166 | #define ERROR_HTTP_HANDLER_MATCH_URL 3010 |
| 167 | #define ERROR_HTTP_HANDLER_INVALID 3011 | 167 | #define ERROR_HTTP_HANDLER_INVALID 3011 |
| 168 | #define ERROR_HTTP_API_LOGS 3012 | 168 | #define ERROR_HTTP_API_LOGS 3012 |
| 169 | -#define ERROR_HTTP_FLV_SEQUENCE_HEADER 3013 | ||
| 170 | -#define ERROR_HTTP_FLV_OFFSET_OVERFLOW 3014 | 169 | +#define ERROR_HTTP_REMUX_SEQUENCE_HEADER 3013 |
| 170 | +#define ERROR_HTTP_REMUX_OFFSET_OVERFLOW 3014 | ||
| 171 | #define ERROR_ENCODER_VCODEC 3015 | 171 | #define ERROR_ENCODER_VCODEC 3015 |
| 172 | #define ERROR_ENCODER_OUTPUT 3016 | 172 | #define ERROR_ENCODER_OUTPUT 3016 |
| 173 | #define ERROR_ENCODER_ACHANNELS 3017 | 173 | #define ERROR_ENCODER_ACHANNELS 3017 |
-
请 注册 或 登录 后发表评论