mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
Merge 5.0.100, v5.0-a1 into develop.
This commit is contained in:
commit
fa177679a6
13 changed files with 1088 additions and 108 deletions
File diff suppressed because it is too large
Load diff
|
@ -41,5 +41,27 @@ protected:
|
|||
virtual srs_error_t build_buffer(std::string src, srs_internal::SrsConfigBuffer** pbuffer);
|
||||
};
|
||||
|
||||
class ISrsSetEnvConfig
|
||||
{
|
||||
private:
|
||||
std::string key;
|
||||
public:
|
||||
ISrsSetEnvConfig(const std::string& k, const std::string& v, bool overwrite) {
|
||||
key = k;
|
||||
srs_setenv(k, v, overwrite);
|
||||
}
|
||||
virtual ~ISrsSetEnvConfig() {
|
||||
srs_unsetenv(key);
|
||||
}
|
||||
private:
|
||||
// Adds, changes environment variables, which may starts with $.
|
||||
int srs_setenv(const std::string& key, const std::string& value, bool overwrite);
|
||||
// Deletes environment variables, which may starts with $.
|
||||
int srs_unsetenv(const std::string& key);
|
||||
};
|
||||
|
||||
#define SrsSetEnvConfig(instance, key, value) \
|
||||
ISrsSetEnvConfig _SRS_free_##instance(key, value, true)
|
||||
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue