mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
for #179, update the metadata of flv dvr file.
This commit is contained in:
parent
7077b74d03
commit
1445086451
8 changed files with 270 additions and 25 deletions
|
@ -66,6 +66,17 @@ private:
|
|||
SrsRtmpJitter* jitter;
|
||||
SrsRtmpJitterAlgorithm jitter_algorithm;
|
||||
SrsFileWriter* fs;
|
||||
private:
|
||||
/**
|
||||
* the offset of file for duration value.
|
||||
* the next 8 bytes is the double value.
|
||||
*/
|
||||
int64_t duration_offset;
|
||||
/**
|
||||
* the offset of file for filesize value.
|
||||
* the next 8 bytes is the double value.
|
||||
*/
|
||||
int64_t filesize_offset;
|
||||
private:
|
||||
std::string tmp_flv_file;
|
||||
private:
|
||||
|
@ -124,7 +135,7 @@ public:
|
|||
/**
|
||||
* write the metadata to segment.
|
||||
*/
|
||||
virtual int write_metadata(SrsOnMetaDataPacket* metadata);
|
||||
virtual int write_metadata(SrsSharedPtrMessage* metadata);
|
||||
/**
|
||||
* @param __audio, directly ptr, copy it if need to save it.
|
||||
*/
|
||||
|
@ -133,6 +144,10 @@ public:
|
|||
* @param __video, directly ptr, copy it if need to save it.
|
||||
*/
|
||||
virtual int write_video(SrsSharedPtrMessage* __video);
|
||||
/**
|
||||
* update the flv metadata.
|
||||
*/
|
||||
virtual int update_flv_metadata();
|
||||
private:
|
||||
/**
|
||||
* generate the flv segment path.
|
||||
|
@ -178,7 +193,7 @@ public:
|
|||
/**
|
||||
* when got metadata.
|
||||
*/
|
||||
virtual int on_meta_data(SrsOnMetaDataPacket* metadata);
|
||||
virtual int on_meta_data(SrsSharedPtrMessage* __metadata);
|
||||
/**
|
||||
* @param __audio, directly ptr, copy it if need to save it.
|
||||
*/
|
||||
|
@ -213,12 +228,24 @@ public:
|
|||
*/
|
||||
class SrsDvrAppendPlan : public SrsDvrPlan
|
||||
{
|
||||
private:
|
||||
int64_t last_update_time;
|
||||
public:
|
||||
SrsDvrAppendPlan();
|
||||
virtual ~SrsDvrAppendPlan();
|
||||
public:
|
||||
virtual int on_publish();
|
||||
virtual void on_unpublish();
|
||||
/**
|
||||
* @param audio, directly ptr, copy it if need to save it.
|
||||
*/
|
||||
virtual int on_audio(SrsSharedPtrMessage* audio);
|
||||
/**
|
||||
* @param video, directly ptr, copy it if need to save it.
|
||||
*/
|
||||
virtual int on_video(SrsSharedPtrMessage* video);
|
||||
private:
|
||||
virtual int update_duration(SrsSharedPtrMessage* msg);
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -231,6 +258,7 @@ private:
|
|||
int segment_duration;
|
||||
SrsSharedPtrMessage* sh_audio;
|
||||
SrsSharedPtrMessage* sh_video;
|
||||
SrsSharedPtrMessage* metadata;
|
||||
public:
|
||||
SrsDvrSegmentPlan();
|
||||
virtual ~SrsDvrSegmentPlan();
|
||||
|
@ -239,6 +267,10 @@ public:
|
|||
virtual int on_publish();
|
||||
virtual void on_unpublish();
|
||||
/**
|
||||
* when got metadata.
|
||||
*/
|
||||
virtual int on_meta_data(SrsSharedPtrMessage* __metadata);
|
||||
/**
|
||||
* @param audio, directly ptr, copy it if need to save it.
|
||||
*/
|
||||
virtual int on_audio(SrsSharedPtrMessage* audio);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue