From 9e5babf9db52e64bdae60137be7696e56241fca6 Mon Sep 17 00:00:00 2001 From: xingzilong <xingzilong@454eff88-639b-444f-9e54-f578c98de674> Date: 星期五, 18 八月 2017 18:12:17 +0800 Subject: [PATCH] H264 NALU解析 并在RTSPServer判断 --- VisitFace/RtspNativeCodec/app/src/main/cpp/AppConfig.cpp | 17 +++++++++++++---- 1 files changed, 13 insertions(+), 4 deletions(-) diff --git a/VisitFace/RtspNativeCodec/app/src/main/cpp/AppConfig.cpp b/VisitFace/RtspNativeCodec/app/src/main/cpp/AppConfig.cpp index 9724375..066053a 100644 --- a/VisitFace/RtspNativeCodec/app/src/main/cpp/AppConfig.cpp +++ b/VisitFace/RtspNativeCodec/app/src/main/cpp/AppConfig.cpp @@ -8,6 +8,11 @@ { } +AppConfig::AppConfig(string path) +{ + loadConfig(path); +} + AppConfig::~AppConfig() { } @@ -35,22 +40,26 @@ void AppConfig::loadConfig(string path) { fstream fs(path); - if (!fs.is_open()) { + if (!fs.is_open()) + { save(path); return; } Json::CharReaderBuilder builder; auto reader = builder.newCharReader(); - JSONCPP_STRING doc; - std::getline(fs, doc, (char)EOF); + JSONCPP_STRING doc; + std::getline(fs, doc, (char) EOF); reader->parse(doc.data(), doc.data() + doc.size(), &root, false); } + void AppConfig::save(string path) { ofstream ofs(path); ofs << root.toStyledString(); ofs.close(); } -void AppConfig::clear(){ + +void AppConfig::clear() +{ root.clear(); } -- Gitblit v1.8.0