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

for #738, refine the dvr segmenter.

This commit is contained in:
winlin 2017-02-06 18:33:26 +08:00
parent 31191f2650
commit 8c01f52372
9 changed files with 477 additions and 293 deletions

View file

@ -255,6 +255,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define ERROR_MP4_MOOV_OVERFLOW 3079
#define ERROR_MP4_ILLEGAL_SAMPLES 3080
#define ERROR_MP4_ILLEGAL_TIMESTAMP 3081
#define ERROR_DVR_CANNOT_APPEND 3082
#define ERROR_DVR_ILLEGAL_PLAN 3083
///////////////////////////////////////////////////////
// HTTP/StreamCaster/KAFKA protocol error.

View file

@ -3783,3 +3783,18 @@ int SrsMp4Decoder::do_load_next_box(SrsMp4Box** ppbox, uint32_t required_box_typ
return ret;
}
SrsMp4Encoder::SrsMp4Encoder()
{
writer = NULL;
}
SrsMp4Encoder::~SrsMp4Encoder()
{
}
int SrsMp4Encoder::initialize(ISrsWriter* w)
{
writer = w;
return ERROR_SUCCESS;
}

View file

@ -36,6 +36,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <vector>
#include <map>
class ISrsWriter;
class ISrsReadSeeker;
class SrsMp4TrackBox;
class SrsMp4MediaBox;
@ -1538,8 +1539,7 @@ public:
public:
/**
* Initialize the decoder with a reader r.
* @param r The underlayer io reader, user must manage it for decoder never open/free it,
* the decoder just read data from the reader.
* @param r The underlayer io reader, user must manage it.
*/
virtual int initialize(ISrsReadSeeker* rs);
/**
@ -1567,5 +1567,23 @@ private:
virtual int do_load_next_box(SrsMp4Box** ppbox, uint32_t required_box_type);
};
/**
* The MP4 muxer.
*/
class SrsMp4Encoder
{
private:
ISrsWriter* writer;
public:
SrsMp4Encoder();
virtual ~SrsMp4Encoder();
public:
/**
* Initialize the encoder with a writer w.
* @param w The underlayer io writer, user must manage it.
*/
virtual int initialize(ISrsWriter* w);
};
#endif