1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

move some consts to kernel consts

This commit is contained in:
winlin 2014-07-20 13:11:53 +08:00
parent 073d900674
commit 736ec48c71
13 changed files with 46 additions and 35 deletions

View file

@ -1405,8 +1405,8 @@ SrsConfDirective* SrsConfig::get_vhost(string vhost)
}
}
if (vhost != RTMP_VHOST_DEFAULT) {
return get_vhost(RTMP_VHOST_DEFAULT);
if (vhost != SRS_CONSTS_RTMP_DEFAULT_VHOST) {
return get_vhost(SRS_CONSTS_RTMP_DEFAULT_VHOST);
}
return NULL;
@ -1575,7 +1575,7 @@ int SrsConfig::get_chunk_size(string vhost)
SrsConfDirective* conf = get_vhost(vhost);
if (!conf) {
return SRS_CONF_DEFAULT_CHUNK_SIZE;
return SRS_CONSTS_RTMP_SRS_CHUNK_SIZE;
}
conf = conf->get("chunk_size");
@ -1584,7 +1584,7 @@ int SrsConfig::get_chunk_size(string vhost)
// use the global instead.
conf = root->get("chunk_size");
if (!conf) {
return SRS_CONF_DEFAULT_CHUNK_SIZE;
return SRS_CONSTS_RTMP_SRS_CHUNK_SIZE;
}
return ::atoi(conf->arg0().c_str());

View file

@ -34,12 +34,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <srs_app_reload.hpp>
///////////////////////////////////////////////////////////
// the value consts
///////////////////////////////////////////////////////////
#define SRS_CONSTS_NULL_FILE "/dev/null"
#define SRS_CONSTS_LOCALHOST "127.0.0.1"
///////////////////////////////////////////////////////////
// default consts values
///////////////////////////////////////////////////////////

View file

@ -285,8 +285,8 @@ int SrsEdgeIngester::connect_server()
std::string server = conf->args.at(origin_index % conf->args.size());
origin_index = (origin_index + 1) % conf->args.size();
std::string s_port = RTMP_DEFAULT_PORT;
int port = ::atoi(RTMP_DEFAULT_PORT);
std::string s_port = SRS_CONSTS_RTMP_DEFAULT_PORT;
int port = ::atoi(SRS_CONSTS_RTMP_DEFAULT_PORT);
size_t pos = server.find(":");
if (pos != std::string::npos) {
s_port = server.substr(pos + 1);
@ -538,8 +538,8 @@ int SrsEdgeForwarder::connect_server()
std::string server = conf->args.at(origin_index % conf->args.size());
origin_index = (origin_index + 1) % conf->args.size();
std::string s_port = RTMP_DEFAULT_PORT;
int port = ::atoi(RTMP_DEFAULT_PORT);
std::string s_port = SRS_CONSTS_RTMP_DEFAULT_PORT;
int port = ::atoi(SRS_CONSTS_RTMP_DEFAULT_PORT);
size_t pos = server.find(":");
if (pos != std::string::npos) {
s_port = server.substr(pos + 1);

View file

@ -34,6 +34,7 @@ using namespace std;
#include <srs_protocol_stack.hpp>
#include <srs_app_ffmpeg.hpp>
#include <srs_kernel_utility.hpp>
#include <srs_kernel_consts.hpp>
#ifdef SRS_AUTO_TRANSCODE

View file

@ -86,8 +86,8 @@ int SrsForwarder::on_publish(SrsRequest* req, std::string forward_server)
stream_name = req->stream;
server = forward_server;
std::string s_port = RTMP_DEFAULT_PORT;
port = ::atoi(RTMP_DEFAULT_PORT);
std::string s_port = SRS_CONSTS_RTMP_DEFAULT_PORT;
port = ::atoi(SRS_CONSTS_RTMP_DEFAULT_PORT);
// TODO: FIXME: parse complex params
size_t pos = forward_server.find(":");

View file

@ -33,6 +33,7 @@ using namespace std;
#include <srs_app_ffmpeg.hpp>
#include <srs_app_pithy_print.hpp>
#include <srs_kernel_utility.hpp>
#include <srs_kernel_consts.hpp>
// when error, ingester sleep for a while and retry.
// ingest never sleep a long time, for we must start the stream ASAP.

View file

@ -933,8 +933,8 @@ int SrsRtmpConn::connect_server(int origin_index, st_netfd_t* pstsock)
std::string server = conf->args.at(origin_index % conf->args.size());
origin_index = (origin_index + 1) % conf->args.size();
std::string s_port = RTMP_DEFAULT_PORT;
int port = ::atoi(RTMP_DEFAULT_PORT);
std::string s_port = SRS_CONSTS_RTMP_DEFAULT_PORT;
int port = ::atoi(SRS_CONSTS_RTMP_DEFAULT_PORT);
size_t pos = server.find(":");
if (pos != std::string::npos) {
s_port = server.substr(pos + 1);

View file

@ -36,6 +36,7 @@ using namespace std;
#include <srs_kernel_error.hpp>
#include <srs_app_kbps.hpp>
#include <srs_app_json.hpp>
#include <srs_kernel_consts.hpp>
int srs_socket_connect(std::string server, int port, int64_t timeout, st_netfd_t* pstfd)
{