mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
fix #87: add source id for full trackable log. 0.9.120
This commit is contained in:
parent
b28593894b
commit
978e985519
6 changed files with 34 additions and 6 deletions
|
@ -228,8 +228,9 @@ Supported operating systems and hardware:
|
||||||
* 2013-10-17, Created.<br/>
|
* 2013-10-17, Created.<br/>
|
||||||
|
|
||||||
## History
|
## History
|
||||||
* v1.0, 2014-05-25, fix [#84](https://github.com/winlinvip/simple-rtmp-server/issues/84), unpublish when edge disconnect. 0.9.119
|
* v1.0, 2014-05-27, fix [#87](https://github.com/winlinvip/simple-rtmp-server/issues/87), add source id for full trackable log. 0.9.120
|
||||||
* v1.0, 2014-05-25, fix [#89](https://github.com/winlinvip/simple-rtmp-server/issues/89), config to /dev/null to disable ffmpeg log. 0.9.117
|
* v1.0, 2014-05-27, fix [#84](https://github.com/winlinvip/simple-rtmp-server/issues/84), unpublish when edge disconnect. 0.9.119
|
||||||
|
* v1.0, 2014-05-27, fix [#89](https://github.com/winlinvip/simple-rtmp-server/issues/89), config to /dev/null to disable ffmpeg log. 0.9.117
|
||||||
* v1.0, 2014-05-25, fix [#76](https://github.com/winlinvip/simple-rtmp-server/issues/76), allow edge vhost to add or remove. 0.9.114
|
* v1.0, 2014-05-25, fix [#76](https://github.com/winlinvip/simple-rtmp-server/issues/76), allow edge vhost to add or remove. 0.9.114
|
||||||
* v1.0, 2014-05-24, Johnny contribute [ossrs.net](http://ossrs.net). karthikeyan start to translate wiki to English.
|
* v1.0, 2014-05-24, Johnny contribute [ossrs.net](http://ossrs.net). karthikeyan start to translate wiki to English.
|
||||||
* v1.0, 2014-05-22, fix [#78](https://github.com/winlinvip/simple-rtmp-server/issues/78), st joinable thread must be stop by other threads, 0.9.113
|
* v1.0, 2014-05-22, fix [#78](https://github.com/winlinvip/simple-rtmp-server/issues/78), st joinable thread must be stop by other threads, 0.9.113
|
||||||
|
|
|
@ -571,7 +571,7 @@ int SrsRtmpConn::fmle_publish(SrsSource* source)
|
||||||
bool vhost_is_edge = _srs_config->get_vhost_is_edge(req->vhost);
|
bool vhost_is_edge = _srs_config->get_vhost_is_edge(req->vhost);
|
||||||
|
|
||||||
// when edge, ignore the publish event, directly proxy it.
|
// when edge, ignore the publish event, directly proxy it.
|
||||||
if (vhost_is_edge) {
|
if (!vhost_is_edge) {
|
||||||
// notify the hls to prepare when publish start.
|
// notify the hls to prepare when publish start.
|
||||||
if ((ret = source->on_publish()) != ERROR_SUCCESS) {
|
if ((ret = source->on_publish()) != ERROR_SUCCESS) {
|
||||||
srs_error("fmle hls on_publish failed. ret=%d", ret);
|
srs_error("fmle hls on_publish failed. ret=%d", ret);
|
||||||
|
@ -650,7 +650,7 @@ int SrsRtmpConn::flash_publish(SrsSource* source)
|
||||||
bool vhost_is_edge = _srs_config->get_vhost_is_edge(req->vhost);
|
bool vhost_is_edge = _srs_config->get_vhost_is_edge(req->vhost);
|
||||||
|
|
||||||
// when edge, ignore the publish event, directly proxy it.
|
// when edge, ignore the publish event, directly proxy it.
|
||||||
if (vhost_is_edge) {
|
if (!vhost_is_edge) {
|
||||||
// notify the hls to prepare when publish start.
|
// notify the hls to prepare when publish start.
|
||||||
if ((ret = source->on_publish()) != ERROR_SUCCESS) {
|
if ((ret = source->on_publish()) != ERROR_SUCCESS) {
|
||||||
srs_error("flash hls on_publish failed. ret=%d", ret);
|
srs_error("flash hls on_publish failed. ret=%d", ret);
|
||||||
|
|
|
@ -176,7 +176,7 @@ int SrsListener::cycle()
|
||||||
|
|
||||||
if(client_stfd == NULL){
|
if(client_stfd == NULL){
|
||||||
// ignore error.
|
// ignore error.
|
||||||
srs_warn("ignore accept thread stoppped for accept client error");
|
srs_error("ignore accept thread stoppped for accept client error");
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
srs_verbose("get a client. fd=%d", st_netfd_fileno(client_stfd));
|
srs_verbose("get a client. fd=%d", st_netfd_fileno(client_stfd));
|
||||||
|
|
|
@ -248,6 +248,7 @@ SrsConsumer::SrsConsumer(SrsSource* _source)
|
||||||
paused = false;
|
paused = false;
|
||||||
jitter = new SrsRtmpJitter();
|
jitter = new SrsRtmpJitter();
|
||||||
queue = new SrsMessageQueue();
|
queue = new SrsMessageQueue();
|
||||||
|
should_update_source_id = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
SrsConsumer::~SrsConsumer()
|
SrsConsumer::~SrsConsumer()
|
||||||
|
@ -262,6 +263,11 @@ void SrsConsumer::set_queue_size(double queue_size)
|
||||||
queue->set_queue_size(queue_size);
|
queue->set_queue_size(queue_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SrsConsumer::update_source_id()
|
||||||
|
{
|
||||||
|
should_update_source_id = true;
|
||||||
|
}
|
||||||
|
|
||||||
int SrsConsumer::get_time()
|
int SrsConsumer::get_time()
|
||||||
{
|
{
|
||||||
return jitter->get_time();
|
return jitter->get_time();
|
||||||
|
@ -287,6 +293,11 @@ int SrsConsumer::enqueue(SrsSharedPtrMessage* msg, int tba, int tbv)
|
||||||
|
|
||||||
int SrsConsumer::get_packets(int max_count, SrsSharedPtrMessage**& pmsgs, int& count)
|
int SrsConsumer::get_packets(int max_count, SrsSharedPtrMessage**& pmsgs, int& count)
|
||||||
{
|
{
|
||||||
|
if (should_update_source_id) {
|
||||||
|
srs_trace("update source_id=%d", source->source_id());
|
||||||
|
should_update_source_id = false;
|
||||||
|
}
|
||||||
|
|
||||||
// paused, return nothing.
|
// paused, return nothing.
|
||||||
if (paused) {
|
if (paused) {
|
||||||
return ERROR_SUCCESS;
|
return ERROR_SUCCESS;
|
||||||
|
@ -802,6 +813,13 @@ int SrsSource::on_source_id_changed(int id)
|
||||||
|
|
||||||
_source_id = id;
|
_source_id = id;
|
||||||
|
|
||||||
|
// notice all consumer
|
||||||
|
std::vector<SrsConsumer*>::iterator it;
|
||||||
|
for (it = consumers.begin(); it != consumers.end(); ++it) {
|
||||||
|
SrsConsumer* consumer = *it;
|
||||||
|
consumer->update_source_id();
|
||||||
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -134,11 +134,20 @@ private:
|
||||||
SrsSource* source;
|
SrsSource* source;
|
||||||
SrsMessageQueue* queue;
|
SrsMessageQueue* queue;
|
||||||
bool paused;
|
bool paused;
|
||||||
|
// when source id changed, notice all consumers
|
||||||
|
bool should_update_source_id;
|
||||||
public:
|
public:
|
||||||
SrsConsumer(SrsSource* _source);
|
SrsConsumer(SrsSource* _source);
|
||||||
virtual ~SrsConsumer();
|
virtual ~SrsConsumer();
|
||||||
public:
|
public:
|
||||||
|
/**
|
||||||
|
* set the size of queue.
|
||||||
|
*/
|
||||||
virtual void set_queue_size(double queue_size);
|
virtual void set_queue_size(double queue_size);
|
||||||
|
/**
|
||||||
|
* when source id changed, notice client to print.
|
||||||
|
*/
|
||||||
|
virtual void update_source_id();
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
* get current client time, the last packet time.
|
* get current client time, the last packet time.
|
||||||
|
|
|
@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
// current release version
|
// current release version
|
||||||
#define VERSION_MAJOR "0"
|
#define VERSION_MAJOR "0"
|
||||||
#define VERSION_MINOR "9"
|
#define VERSION_MINOR "9"
|
||||||
#define VERSION_REVISION "119"
|
#define VERSION_REVISION "120"
|
||||||
#define RTMP_SIG_SRS_VERSION VERSION_MAJOR"."VERSION_MINOR"."VERSION_REVISION
|
#define RTMP_SIG_SRS_VERSION VERSION_MAJOR"."VERSION_MINOR"."VERSION_REVISION
|
||||||
// server info.
|
// server info.
|
||||||
#define RTMP_SIG_SRS_KEY "SRS"
|
#define RTMP_SIG_SRS_KEY "SRS"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue