From 84da660754e4aad280a457e0b9a7fb358e6c2d51 Mon Sep 17 00:00:00 2001 From: xzl Date: Thu, 13 Apr 2017 17:38:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E8=AF=A5=E9=85=8D=E7=BD=AE=E9=A1=B9?= =?UTF-8?q?=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/MedaiFile/MediaRecorder.cpp | 2 +- src/config.cpp | 14 +++++++------- src/config.h | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/MedaiFile/MediaRecorder.cpp b/src/MedaiFile/MediaRecorder.cpp index 5be3ccbc..661c54e7 100644 --- a/src/MedaiFile/MediaRecorder.cpp +++ b/src/MedaiFile/MediaRecorder.cpp @@ -21,7 +21,7 @@ namespace MediaFile { MediaRecorder::MediaRecorder(const string &strApp,const string &strId,const std::shared_ptr &pPlayer) { #ifdef ENABLE_MEDIAFILE - static string hlsPrefix = mINI::Instance()[Config::Hls::kHttpPrefix]; + static string hlsPrefix = mINI::Instance()[Config::Http::kHttpPrefix]; static string hlsPath = mINI::Instance()[Config::Hls::kFilePath]; static uint32_t hlsBufSize = mINI::Instance()[Config::Hls::kFileBufSize].as(); static uint32_t hlsDuration = mINI::Instance()[Config::Hls::kSegmentDuration].as(); diff --git a/src/config.cpp b/src/config.cpp index d562c6e9..3c7be0ce 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -77,6 +77,12 @@ const char kRootPath[] = HTTP_FIELD"rootPath"; "" const char kNotFound[] = HTTP_FIELD"notFound"; +//HTTP访问url前缀 +#define HTTP_PREFIX (StrPrinter << "http://" \ + << SockUtil::get_local_ip() \ + << ":" << HTTP_PORT << endl) +const char kHttpPrefix[] = HTTP_FIELD"httpPrefix"; + onceToken token([](){ mINI::Instance()[kPort] = HTTP_PORT; mINI::Instance()[kSendBufSize] = HTTP_SEND_BUF_SIZE; @@ -87,6 +93,7 @@ onceToken token([](){ mINI::Instance()[kServerName] = HTTP_SERVER_NAME; mINI::Instance()[kRootPath] = HTTP_ROOT_PATH; mINI::Instance()[kNotFound] = HTTP_NOT_FOUND; + mINI::Instance()[kHttpPrefix] = HTTP_PREFIX; },nullptr); }//namespace Http @@ -254,12 +261,6 @@ const char kSegmentNum[] = HLS_FIELD"segNum"; #define HLS_FILE_BUF_SIZE (64 * 1024) const char kFileBufSize[] = HLS_FIELD"fileBufSize"; -//HTTP访问url前缀 -#define HLS_HTTP_PREFIX (StrPrinter << "http://" \ - << SockUtil::get_local_ip() \ - << ":" << HTTP_PORT << endl) -const char kHttpPrefix[] = HLS_FIELD"httpPrefix"; - //录制文件路径 #define HLS_FILE_PATH (HTTP_ROOT_PATH) const char kFilePath[] = HLS_FIELD"filePath"; @@ -268,7 +269,6 @@ onceToken token([](){ mINI::Instance()[kSegmentDuration] = HLS_SEGMENT_DURATION; mINI::Instance()[kSegmentNum] = HLS_SEGMENT_NUM; mINI::Instance()[kFileBufSize] = HLS_FILE_BUF_SIZE; - mINI::Instance()[kHttpPrefix] = HLS_HTTP_PREFIX; mINI::Instance()[kFilePath] = HLS_FILE_PATH; },nullptr); diff --git a/src/config.h b/src/config.h index 90563655..81ad9bc9 100644 --- a/src/config.h +++ b/src/config.h @@ -79,6 +79,8 @@ extern const char kServerName[]; extern const char kRootPath[]; //http 404错误提示内容 extern const char kNotFound[]; +//HTTP访问url前缀 +extern const char kHttpPrefix[]; }//namespace Http ////////////SHELL配置/////////// @@ -151,8 +153,6 @@ extern const char kSegmentDuration[]; extern const char kSegmentNum[]; //HLS文件写缓存大小 extern const char kFileBufSize[]; -//HTTP访问url前缀 -extern const char kHttpPrefix[]; //录制文件路径 extern const char kFilePath[]; } //namespace Hls