mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
RTC: Cover default status of track
This commit is contained in:
parent
c72fb76334
commit
4aabbd74dc
4 changed files with 7 additions and 7 deletions
|
@ -525,7 +525,7 @@ void SrsRtcPlayStream::nack_fetch(vector<SrsRtpPacket2*>& pkts, uint32_t ssrc, u
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SrsRtcPlayStream::set_track_status(bool status)
|
void SrsRtcPlayStream::set_all_tracks_status(bool status)
|
||||||
{
|
{
|
||||||
std::ostringstream merged_log;
|
std::ostringstream merged_log;
|
||||||
|
|
||||||
|
@ -2305,7 +2305,7 @@ srs_error_t SrsRtcConnection::do_send_packets(const std::vector<SrsRtpPacket2*>&
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
srs_error_t SrsRtcConnection::set_play_track_status(bool status)
|
srs_error_t SrsRtcConnection::set_all_tracks_status_for_play(bool status)
|
||||||
{
|
{
|
||||||
srs_error_t err = srs_success;
|
srs_error_t err = srs_success;
|
||||||
|
|
||||||
|
@ -2313,7 +2313,7 @@ srs_error_t SrsRtcConnection::set_play_track_status(bool status)
|
||||||
return srs_error_new(ERROR_RTC_NO_PLAYER, "set play track status");
|
return srs_error_new(ERROR_RTC_NO_PLAYER, "set play track status");
|
||||||
}
|
}
|
||||||
|
|
||||||
player_->set_track_status(status);
|
player_->set_all_tracks_status(status);
|
||||||
|
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
|
@ -209,7 +209,7 @@ private:
|
||||||
public:
|
public:
|
||||||
void nack_fetch(std::vector<SrsRtpPacket2*>& pkts, uint32_t ssrc, uint16_t seq);
|
void nack_fetch(std::vector<SrsRtpPacket2*>& pkts, uint32_t ssrc, uint16_t seq);
|
||||||
// Directly set the status of track, generally for init to set the default value.
|
// Directly set the status of track, generally for init to set the default value.
|
||||||
void set_track_status(bool status);
|
void set_all_tracks_status(bool status);
|
||||||
// interface ISrsHourGlass
|
// interface ISrsHourGlass
|
||||||
public:
|
public:
|
||||||
virtual srs_error_t notify(int type, srs_utime_t interval, srs_utime_t tick);
|
virtual srs_error_t notify(int type, srs_utime_t interval, srs_utime_t tick);
|
||||||
|
@ -412,7 +412,7 @@ public:
|
||||||
void simulate_player_drop_packet(SrsRtpHeader* h, int nn_bytes);
|
void simulate_player_drop_packet(SrsRtpHeader* h, int nn_bytes);
|
||||||
srs_error_t do_send_packets(const std::vector<SrsRtpPacket2*>& pkts, SrsRtcPlayStreamStatistic& info);
|
srs_error_t do_send_packets(const std::vector<SrsRtpPacket2*>& pkts, SrsRtcPlayStreamStatistic& info);
|
||||||
// Directly set the status of play track, generally for init to set the default value.
|
// Directly set the status of play track, generally for init to set the default value.
|
||||||
srs_error_t set_play_track_status(bool status);
|
srs_error_t set_all_tracks_status_for_play(bool status);
|
||||||
private:
|
private:
|
||||||
srs_error_t on_binding_request(SrsStunPacket* r);
|
srs_error_t on_binding_request(SrsStunPacket* r);
|
||||||
// publish media capabilitiy negotiate
|
// publish media capabilitiy negotiate
|
||||||
|
|
|
@ -416,7 +416,7 @@ srs_error_t SrsRtcServer::do_create_session(
|
||||||
|
|
||||||
// TODO: FIXME: Handle error.
|
// TODO: FIXME: Handle error.
|
||||||
// All tracks default as inactive, so we must enable them.
|
// All tracks default as inactive, so we must enable them.
|
||||||
session->set_play_track_status(true);
|
session->set_all_tracks_status_for_play(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string local_pwd = srs_random_str(32);
|
std::string local_pwd = srs_random_str(32);
|
||||||
|
|
|
@ -151,7 +151,7 @@ VOID TEST(KernelRTCTest, DefaultTrackStatus)
|
||||||
EXPECT_FALSE(audio->get_track_status());
|
EXPECT_FALSE(audio->get_track_status());
|
||||||
EXPECT_FALSE(video->get_track_status());
|
EXPECT_FALSE(video->get_track_status());
|
||||||
|
|
||||||
play.set_track_status(true);
|
play.set_all_tracks_status(true);
|
||||||
EXPECT_TRUE(audio->get_track_status());
|
EXPECT_TRUE(audio->get_track_status());
|
||||||
EXPECT_TRUE(video->get_track_status());
|
EXPECT_TRUE(video->get_track_status());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue