mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
For #299, refine the codec to format-frame-sample chain.
This commit is contained in:
parent
c4a510b834
commit
d7458c4e72
18 changed files with 990 additions and 1150 deletions
|
@ -653,75 +653,6 @@ bool SrsLiveEntry::is_mp3()
|
|||
return _is_mp3;
|
||||
}
|
||||
|
||||
SrsHlsM3u8Stream::SrsHlsM3u8Stream()
|
||||
{
|
||||
}
|
||||
|
||||
SrsHlsM3u8Stream::~SrsHlsM3u8Stream()
|
||||
{
|
||||
}
|
||||
|
||||
void SrsHlsM3u8Stream::set_m3u8(std::string v)
|
||||
{
|
||||
m3u8 = v;
|
||||
}
|
||||
|
||||
int SrsHlsM3u8Stream::serve_http(ISrsHttpResponseWriter* w, ISrsHttpMessage* r)
|
||||
{
|
||||
int ret = ERROR_SUCCESS;
|
||||
|
||||
std::string data = m3u8;
|
||||
|
||||
w->header()->set_content_length((int)data.length());
|
||||
w->header()->set_content_type("application/x-mpegURL;charset=utf-8");
|
||||
|
||||
if ((ret = w->write((char*)data.data(), (int)data.length())) != ERROR_SUCCESS) {
|
||||
if (!srs_is_client_gracefully_close(ret)) {
|
||||
srs_error("send m3u8 failed. ret=%d", ret);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
SrsHlsTsStream::SrsHlsTsStream()
|
||||
{
|
||||
}
|
||||
|
||||
SrsHlsTsStream::~SrsHlsTsStream()
|
||||
{
|
||||
}
|
||||
|
||||
void SrsHlsTsStream::set_ts(std::string v)
|
||||
{
|
||||
ts = v;
|
||||
}
|
||||
|
||||
int SrsHlsTsStream::serve_http(ISrsHttpResponseWriter* w, ISrsHttpMessage* r)
|
||||
{
|
||||
int ret = ERROR_SUCCESS;
|
||||
|
||||
std::string data = ts;
|
||||
|
||||
w->header()->set_content_length((int)data.length());
|
||||
w->header()->set_content_type("video/MP2T");
|
||||
|
||||
if ((ret = w->write((char*)data.data(), (int)data.length())) != ERROR_SUCCESS) {
|
||||
if (!srs_is_client_gracefully_close(ret)) {
|
||||
srs_error("send ts failed. ret=%d", ret);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
SrsHlsEntry::SrsHlsEntry()
|
||||
{
|
||||
tmpl = NULL;
|
||||
}
|
||||
|
||||
SrsHttpStreamServer::SrsHttpStreamServer(SrsServer* svr)
|
||||
{
|
||||
server = svr;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue