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

refine the file stream, to file reader and writer. 0.9.142

This commit is contained in:
winlin 2014-06-29 17:05:26 +08:00
parent ed3f9f0a40
commit 1a7735182f
13 changed files with 167 additions and 121 deletions

View file

@ -71,7 +71,7 @@ SrsDvrPlan::SrsDvrPlan()
_req = NULL;
jitter = NULL;
dvr_enabled = false;
fs = new SrsFileStream();
fs = new SrsFileWriter();
enc = new SrsFlvEncoder();
segment = new SrsFlvSegment();
jitter_algorithm = SrsRtmpJitterAlgorithmOFF;
@ -283,7 +283,7 @@ int SrsDvrPlan::flv_open(string stream, string path)
segment->reset();
std::string tmp_file = path + ".tmp";
if ((ret = fs->open_write(tmp_file)) != ERROR_SUCCESS) {
if ((ret = fs->open(tmp_file)) != ERROR_SUCCESS) {
srs_error("open file stream for file %s failed. ret=%d", path.c_str(), ret);
return ret;
}
@ -569,8 +569,8 @@ int SrsDvrHssPlan::on_meta_data(SrsOnMetaDataPacket* metadata)
<< "/" << req->app << "/"
<< req->stream << ".header.flv";
SrsFileStream fs;
if ((ret = fs.open_write(path.str().c_str())) != ERROR_SUCCESS) {
SrsFileWriter fs;
if ((ret = fs.open(path.str().c_str())) != ERROR_SUCCESS) {
return ret;
}

View file

@ -39,7 +39,7 @@ class SrsStream;
class SrsRtmpJitter;
class SrsOnMetaDataPacket;
class SrsSharedPtrMessage;
class SrsFileStream;
class SrsFileWriter;
class SrsFlvEncoder;
#include <srs_app_source.hpp>
@ -114,7 +114,7 @@ protected:
SrsFlvSegment* segment;
SrsRequest* _req;
bool dvr_enabled;
SrsFileStream* fs;
SrsFileWriter* fs;
public:
SrsDvrPlan();
virtual ~SrsDvrPlan();

View file

@ -300,10 +300,10 @@ int SrsHttpVhost::response_flv_file2(SrsSocket* skt, SrsHttpMessage* req, string
{
int ret = ERROR_SUCCESS;
SrsFileStream fs;
SrsFileReader fs;
// open flv file
if ((ret = fs.open_read(fullpath)) != ERROR_SUCCESS) {
if ((ret = fs.open(fullpath)) != ERROR_SUCCESS) {
return ret;
}