winlin

fix the stream caster build failed bug.

@@ -4418,3 +4418,18 @@ bool srs_config_dvr_is_plan_append(string plan) @@ -4418,3 +4418,18 @@ bool srs_config_dvr_is_plan_append(string plan)
4418 { 4418 {
4419 return plan == SRS_CONF_DEFAULT_DVR_PLAN_APPEND; 4419 return plan == SRS_CONF_DEFAULT_DVR_PLAN_APPEND;
4420 } 4420 }
  4421 +
  4422 +bool srs_stream_caster_is_udp(string caster)
  4423 +{
  4424 + return caster == SRS_CONF_DEFAULT_STREAM_CASTER_MPEGTS_OVER_UDP;
  4425 +}
  4426 +
  4427 +bool srs_stream_caster_is_rtsp(string caster)
  4428 +{
  4429 + return caster == SRS_CONF_DEFAULT_STREAM_CASTER_RTSP;
  4430 +}
  4431 +
  4432 +bool srs_stream_caster_is_flv(string caster)
  4433 +{
  4434 + return caster == SRS_CONF_DEFAULT_STREAM_CASTER_FLV;
  4435 +}
@@ -1143,6 +1143,9 @@ extern bool srs_config_ingest_is_stream(std::string type); @@ -1143,6 +1143,9 @@ extern bool srs_config_ingest_is_stream(std::string type);
1143 extern bool srs_config_dvr_is_plan_segment(std::string plan); 1143 extern bool srs_config_dvr_is_plan_segment(std::string plan);
1144 extern bool srs_config_dvr_is_plan_session(std::string plan); 1144 extern bool srs_config_dvr_is_plan_session(std::string plan);
1145 extern bool srs_config_dvr_is_plan_append(std::string plan); 1145 extern bool srs_config_dvr_is_plan_append(std::string plan);
  1146 +extern bool srs_stream_caster_is_udp(std::string caster);
  1147 +extern bool srs_stream_caster_is_rtsp(std::string caster);
  1148 +extern bool srs_stream_caster_is_flv(std::string caster);
1146 1149
1147 // global config 1150 // global config
1148 extern SrsConfig* _srs_config; 1151 extern SrsConfig* _srs_config;
@@ -1120,11 +1120,11 @@ int SrsServer::listen_stream_caster() @@ -1120,11 +1120,11 @@ int SrsServer::listen_stream_caster()
1120 SrsListener* listener = NULL; 1120 SrsListener* listener = NULL;
1121 1121
1122 std::string caster = _srs_config->get_stream_caster_engine(stream_caster); 1122 std::string caster = _srs_config->get_stream_caster_engine(stream_caster);
1123 - if (caster == SRS_CONF_DEFAULT_STREAM_CASTER_MPEGTS_OVER_UDP) { 1123 + if (srs_stream_caster_is_udp(caster)) {
1124 listener = new SrsUdpCasterListener(this, SrsListenerMpegTsOverUdp, stream_caster); 1124 listener = new SrsUdpCasterListener(this, SrsListenerMpegTsOverUdp, stream_caster);
1125 - } else if (caster == SRS_CONF_DEFAULT_STREAM_CASTER_RTSP) { 1125 + } else if (srs_stream_caster_is_rtsp(caster)) {
1126 listener = new SrsRtspListener(this, SrsListenerRtsp, stream_caster); 1126 listener = new SrsRtspListener(this, SrsListenerRtsp, stream_caster);
1127 - } else if (caster == SRS_CONF_DEFAULT_STREAM_CASTER_FLV) { 1127 + } else if (srs_stream_caster_is_flv(caster)) {
1128 listener = new SrsHttpFlvListener(this, SrsListenerFlv, stream_caster); 1128 listener = new SrsHttpFlvListener(this, SrsListenerFlv, stream_caster);
1129 } else { 1129 } else {
1130 ret = ERROR_STREAM_CASTER_ENGINE; 1130 ret = ERROR_STREAM_CASTER_ENGINE;