1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

RTC: Refactor code

This commit is contained in:
winlin 2020-05-13 13:42:55 +08:00
parent 44c8334b71
commit 6740a03a9c
3 changed files with 24 additions and 23 deletions

View file

@ -456,6 +456,11 @@ srs_error_t SrsRtcFromRtmpBridger::initialize(SrsRequest* r)
return err;
}
SrsMetaCache* SrsRtcFromRtmpBridger::cached_meta()
{
return meta;
}
srs_error_t SrsRtcFromRtmpBridger::on_publish()
{
srs_error_t err = srs_success;
@ -476,6 +481,19 @@ srs_error_t SrsRtcFromRtmpBridger::on_publish()
return err;
}
void SrsRtcFromRtmpBridger::on_unpublish()
{
// TODO: FIXME: Should sync with bridger?
source_->on_unpublish();
rtc->on_unpublish();
// Reset the metadata cache, to make VLC happy when disable/enable stream.
// @see https://github.com/ossrs/srs/issues/1630#issuecomment-597979448
meta->update_previous_vsh();
meta->update_previous_ash();
}
srs_error_t SrsRtcFromRtmpBridger::on_audio(SrsSharedPtrMessage* msg)
{
srs_error_t err = srs_success;
@ -528,21 +546,3 @@ srs_error_t SrsRtcFromRtmpBridger::on_video(SrsSharedPtrMessage* msg)
return source_->on_video_imp(msg);
}
void SrsRtcFromRtmpBridger::on_unpublish()
{
// TODO: FIXME: Should sync with bridger?
source_->on_unpublish();
rtc->on_unpublish();
// Reset the metadata cache, to make VLC happy when disable/enable stream.
// @see https://github.com/ossrs/srs/issues/1630#issuecomment-597979448
meta->update_previous_vsh();
meta->update_previous_ash();
}
SrsMetaCache* SrsRtcFromRtmpBridger::cached_meta()
{
return meta;
}