mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
refine pithy print to more easyer to use 2.0.121.
This commit is contained in:
parent
9d233db27e
commit
1102c7a58f
23 changed files with 242 additions and 332 deletions
|
@ -31,8 +31,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
#include <srs_kernel_error.hpp>
|
||||
#include <srs_kernel_utility.hpp>
|
||||
|
||||
#define SRS_CONSTS_STAGE_DEFAULT_INTERVAL_MS 1200
|
||||
|
||||
SrsStageInfo::SrsStageInfo(int _stage_id)
|
||||
{
|
||||
stage_id = _stage_id;
|
||||
|
@ -51,40 +49,7 @@ SrsStageInfo::~SrsStageInfo()
|
|||
|
||||
void SrsStageInfo::update_print_time()
|
||||
{
|
||||
switch (stage_id) {
|
||||
case SRS_CONSTS_STAGE_PLAY_USER: {
|
||||
pithy_print_time_ms = _srs_config->get_pithy_print_play();
|
||||
break;
|
||||
}
|
||||
case SRS_CONSTS_STAGE_PUBLISH_USER: {
|
||||
pithy_print_time_ms = _srs_config->get_pithy_print_publish();
|
||||
break;
|
||||
}
|
||||
case SRS_CONSTS_STAGE_FORWARDER: {
|
||||
pithy_print_time_ms = _srs_config->get_pithy_print_forwarder();
|
||||
break;
|
||||
}
|
||||
case SRS_CONSTS_STAGE_ENCODER: {
|
||||
pithy_print_time_ms = _srs_config->get_pithy_print_encoder();
|
||||
break;
|
||||
}
|
||||
case SRS_CONSTS_STAGE_INGESTER: {
|
||||
pithy_print_time_ms = _srs_config->get_pithy_print_ingester();
|
||||
break;
|
||||
}
|
||||
case SRS_CONSTS_STAGE_EDGE: {
|
||||
pithy_print_time_ms = _srs_config->get_pithy_print_edge();
|
||||
break;
|
||||
}
|
||||
case SRS_CONSTS_STAGE_HLS: {
|
||||
pithy_print_time_ms = _srs_config->get_pithy_print_hls();
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
pithy_print_time_ms = SRS_CONSTS_STAGE_DEFAULT_INTERVAL_MS;
|
||||
break;
|
||||
}
|
||||
}
|
||||
pithy_print_time_ms = _srs_config->get_pithy_print_ms();
|
||||
}
|
||||
|
||||
void SrsStageInfo::elapse(int64_t diff)
|
||||
|
@ -120,6 +85,80 @@ SrsPithyPrint::SrsPithyPrint(int _stage_id)
|
|||
_age = 0;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
// pithy-print consts values
|
||||
///////////////////////////////////////////////////////////
|
||||
// the pithy stage for all play clients.
|
||||
#define SRS_CONSTS_STAGE_PLAY_USER 1
|
||||
// the pithy stage for all publish clients.
|
||||
#define SRS_CONSTS_STAGE_PUBLISH_USER 2
|
||||
// the pithy stage for all forward clients.
|
||||
#define SRS_CONSTS_STAGE_FORWARDER 3
|
||||
// the pithy stage for all encoders.
|
||||
#define SRS_CONSTS_STAGE_ENCODER 4
|
||||
// the pithy stage for all hls.
|
||||
#define SRS_CONSTS_STAGE_HLS 5
|
||||
// the pithy stage for all ingesters.
|
||||
#define SRS_CONSTS_STAGE_INGESTER 6
|
||||
// the pithy stage for all edge.
|
||||
#define SRS_CONSTS_STAGE_EDGE 7
|
||||
// the pithy stage for all stream caster.
|
||||
#define SRS_CONSTS_STAGE_CASTER 8
|
||||
// the pithy stage for all http stream.
|
||||
#define SRS_CONSTS_STAGE_HTTP_STREAM 9
|
||||
// the pithy stage for all http stream cache.
|
||||
#define SRS_CONSTS_STAGE_HTTP_STREAM_CACHE 10
|
||||
|
||||
SrsPithyPrint* SrsPithyPrint::create_rtmp_play()
|
||||
{
|
||||
return new SrsPithyPrint(SRS_CONSTS_STAGE_PLAY_USER);
|
||||
}
|
||||
|
||||
SrsPithyPrint* SrsPithyPrint::create_rtmp_publish()
|
||||
{
|
||||
return new SrsPithyPrint(SRS_CONSTS_STAGE_PUBLISH_USER);
|
||||
}
|
||||
|
||||
SrsPithyPrint* SrsPithyPrint::create_hls()
|
||||
{
|
||||
return new SrsPithyPrint(SRS_CONSTS_STAGE_HLS);
|
||||
}
|
||||
|
||||
SrsPithyPrint* SrsPithyPrint::create_forwarder()
|
||||
{
|
||||
return new SrsPithyPrint(SRS_CONSTS_STAGE_FORWARDER);
|
||||
}
|
||||
|
||||
SrsPithyPrint* SrsPithyPrint::create_encoder()
|
||||
{
|
||||
return new SrsPithyPrint(SRS_CONSTS_STAGE_ENCODER);
|
||||
}
|
||||
|
||||
SrsPithyPrint* SrsPithyPrint::create_ingester()
|
||||
{
|
||||
return new SrsPithyPrint(SRS_CONSTS_STAGE_INGESTER);
|
||||
}
|
||||
|
||||
SrsPithyPrint* SrsPithyPrint::create_edge()
|
||||
{
|
||||
return new SrsPithyPrint(SRS_CONSTS_STAGE_EDGE);
|
||||
}
|
||||
|
||||
SrsPithyPrint* SrsPithyPrint::create_caster()
|
||||
{
|
||||
return new SrsPithyPrint(SRS_CONSTS_STAGE_CASTER);
|
||||
}
|
||||
|
||||
SrsPithyPrint* SrsPithyPrint::create_http_stream()
|
||||
{
|
||||
return new SrsPithyPrint(SRS_CONSTS_STAGE_HTTP_STREAM);
|
||||
}
|
||||
|
||||
SrsPithyPrint* SrsPithyPrint::create_http_stream_cache()
|
||||
{
|
||||
return new SrsPithyPrint(SRS_CONSTS_STAGE_HTTP_STREAM_CACHE);
|
||||
}
|
||||
|
||||
SrsPithyPrint::~SrsPithyPrint()
|
||||
{
|
||||
leave_stage();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue