mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
for #328, support adobe hds. 2.0.138.
This commit is contained in:
parent
da56e4fbb9
commit
ffef62900f
13 changed files with 198 additions and 17 deletions
|
@ -782,8 +782,9 @@ SrsSource::SrsSource()
|
|||
#ifdef SRS_AUTO_TRANSCODE
|
||||
encoder = new SrsEncoder();
|
||||
#endif
|
||||
|
||||
#ifdef SRS_AUTO_HDS
|
||||
hds = new SrsHds(this);
|
||||
#endif
|
||||
|
||||
cache_metadata = cache_sh_video = cache_sh_audio = NULL;
|
||||
|
||||
|
@ -835,6 +836,9 @@ SrsSource::~SrsSource()
|
|||
#ifdef SRS_AUTO_TRANSCODE
|
||||
srs_freep(encoder);
|
||||
#endif
|
||||
#ifdef SRS_AUTO_HDS
|
||||
srs_freep(hds);
|
||||
#endif
|
||||
|
||||
srs_freep(_req);
|
||||
}
|
||||
|
@ -1349,14 +1353,16 @@ int SrsSource::on_audio(SrsCommonMessage* __audio)
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef SRS_AUTO_HDS
|
||||
if ((ret = hds->on_audio(&msg)) != ERROR_SUCCESS) {
|
||||
srs_warn("hds process audio message failed, ignore and disable dvr. ret=%d", ret);
|
||||
|
||||
// unpublish, ignore ret.
|
||||
hds->on_unpublish();
|
||||
// ignore.
|
||||
ret = ERROR_SUCCESS;
|
||||
|
||||
srs_warn("hds process audio message failed, ignore and disable dvr. ret=%d", ret);
|
||||
}
|
||||
#endif
|
||||
|
||||
// copy to all consumer
|
||||
int nb_consumers = (int)consumers.size();
|
||||
|
@ -1498,14 +1504,16 @@ int SrsSource::on_video(SrsCommonMessage* __video)
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef SRS_AUTO_HDS
|
||||
if ((ret = hds->on_video(&msg)) != ERROR_SUCCESS) {
|
||||
srs_warn("hds process video message failed, ignore and disable dvr. ret=%d", ret);
|
||||
|
||||
// unpublish, ignore ret.
|
||||
hds->on_unpublish();
|
||||
// ignore.
|
||||
ret = ERROR_SUCCESS;
|
||||
|
||||
srs_warn("hds process video message failed, ignore and disable dvr. ret=%d", ret);
|
||||
}
|
||||
#endif
|
||||
|
||||
// copy to all consumer
|
||||
if (true) {
|
||||
|
@ -1751,10 +1759,12 @@ int SrsSource::on_publish()
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef SRS_AUTO_HDS
|
||||
if ((ret = hds->on_publish(_req)) != ERROR_SUCCESS) {
|
||||
srs_error("start hds failed. ret=%d", ret);
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
// notify the handler.
|
||||
srs_assert(handler);
|
||||
|
@ -1783,7 +1793,9 @@ void SrsSource::on_unpublish()
|
|||
dvr->on_unpublish();
|
||||
#endif
|
||||
|
||||
#ifdef SRS_AUTO_HDS
|
||||
hds->on_unpublish();
|
||||
#endif
|
||||
|
||||
gop_cache->clear();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue