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

fix #367, support nginx-rtmp exec. 3.0.1

This commit is contained in:
winlin 2015-08-25 22:29:00 +08:00
parent 7de181004f
commit c34b0c86e1
25 changed files with 519 additions and 14 deletions

View file

@ -168,6 +168,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define SRS_CONSTS_LOG_HTTP_STREAM_CACHE "HTC"
// stream caster log id.
#define SRS_CONSTS_LOG_STREAM_CASTER "SCS"
// the nginx exec log id.
#define SRS_CONSTS_LOG_EXEC "EXE"
///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////

View file

@ -35,6 +35,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <sys/stat.h>
#include <fcntl.h>
#include <vector>
using namespace std;
#include <srs_kernel_log.hpp>
@ -284,6 +285,25 @@ bool srs_string_contains(string str, string flag)
return str.find(flag) != string::npos;
}
vector<string> srs_string_split(string str, string flag)
{
vector<string> arr;
size_t pos;
string s = str;
while ((pos = s.find(flag)) != string::npos) {
arr.push_back(s.substr(0, pos));
s = s.substr(pos + 1);
}
if (!s.empty()) {
arr.push_back(s);
}
return arr;
}
int srs_do_create_dir_recursively(string dir)
{
int ret = ERROR_SUCCESS;

View file

@ -31,6 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <srs_core.hpp>
#include <string>
#include <vector>
class SrsStream;
class SrsBitStream;
@ -69,6 +70,8 @@ extern bool srs_string_ends_with(std::string str, std::string flag);
extern bool srs_string_starts_with(std::string str, std::string flag);
// whether string contains with
extern bool srs_string_contains(std::string str, std::string flag);
// split the string by flag to array.
extern std::vector<std::string> srs_string_split(std::string str, std::string flag);
// create dir recursively
extern int srs_create_dir_recursively(std::string dir);