From 87fea24e8bba1bfbee707cdaa6f7979451531acc Mon Sep 17 00:00:00 2001 From: zhangmeng <775834166@qq.com> Date: 星期六, 19 十月 2019 10:23:01 +0800 Subject: [PATCH] add interface rec duration --- csrc/buz/recorder.hpp | 24 ++++++++++++++++-------- 1 files changed, 16 insertions(+), 8 deletions(-) diff --git a/csrc/buz/recorder.hpp b/csrc/buz/recorder.hpp index f044907..9c88bbb 100644 --- a/csrc/buz/recorder.hpp +++ b/csrc/buz/recorder.hpp @@ -13,21 +13,17 @@ #include "../common/callback.hpp" +#include "../common.hpp" + +struct AVPacket; + namespace ffwrapper{ class FormatIn; class FormatOut; - - class CodedData; } namespace cffmpeg_wrap{ namespace buz{ - // 缂撳瓨鐨勮棰戝抚,绛夊緟fire瑙﹀彂寮�濮嬪綍鍍� - typedef struct _cache_pkt{ - std::shared_ptr<ffwrapper::CodedData> data; - int64_t id; - }CPacket; - class Recorder{ public: @@ -54,6 +50,15 @@ void end_writer(); void maybe_dump_gop(); + + int init_write_h264(const bool audio); + int write_h264(const CPacket &pkt); + int end_write_h264(); + + int init_write_hevc(const bool audio); + int write_hevc(const CPacket &pkt); + int end_write_hevc(); + int mux_hevc(FILE *fp, const char *outfile); private: ffwrapper::FormatIn *in_; ffwrapper::FormatOut *out_; @@ -62,6 +67,7 @@ int minduration; int end_frame; int cur_frame; + int cur_frame_a; std::list<CPacket> list_pkt_; @@ -82,6 +88,8 @@ bool error_occured_; bool audio_; + + FILE *fp_; }; } } -- Gitblit v1.8.0