本文整理汇总了C++中SrsSource::initialize方法的典型用法代码示例。如果您正苦于以下问题:C++ SrsSource::initialize方法的具体用法?C++ SrsSource::initialize怎么用?C++ SrsSource::initialize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SrsSource
的用法示例。
在下文中一共展示了SrsSource::initialize方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: find
int SrsSource::find(SrsRequest* req, SrsSource** ppsource)
{
int ret = ERROR_SUCCESS;
string stream_url = req->get_stream_url();
string vhost = req->vhost;
if (pool.find(stream_url) == pool.end()) {
SrsSource* source = new SrsSource(req);
if ((ret = source->initialize()) != ERROR_SUCCESS) {
srs_freep(source);
return ret;
}
pool[stream_url] = source;
srs_info("create new source for url=%s, vhost=%s", stream_url.c_str(), vhost.c_str());
}
// we always update the request of resource,
// for origin auth is on, the token in request maybe invalid,
// and we only need to update the token of request, it's simple.
if (true) {
SrsSource* source = pool[stream_url];
source->_req->update_auth(req);
*ppsource = source;
}
return ret;
}
示例2: find
int SrsSource::find(SrsRequest* req, SrsSource** ppsource)
{
int ret = ERROR_SUCCESS;
string stream_url = req->get_stream_url();
string vhost = req->vhost;
if (pool.find(stream_url) == pool.end()) {
SrsSource* source = new SrsSource(req);
if ((ret = source->initialize()) != ERROR_SUCCESS) {
srs_freep(source);
return ret;
}
pool[stream_url] = source;
srs_info("create new source for url=%s, vhost=%s", stream_url.c_str(), vhost.c_str());
}
*ppsource = pool[stream_url];
return ret;
}