From be9c1d1f659b0ff31f656424c478e83a4f7c53b5 Mon Sep 17 00:00:00 2001 From: zhangmeng <775834166@qq.com> Date: 星期五, 20 九月 2019 11:44:19 +0800 Subject: [PATCH] update ffmpeg --- csrc/ffmpeg/format/FormatIn.hpp | 14 ++++++++++---- 1 files changed, 10 insertions(+), 4 deletions(-) diff --git a/csrc/ffmpeg/format/FormatIn.hpp b/csrc/ffmpeg/format/FormatIn.hpp index a19d0fe..ca14f81 100644 --- a/csrc/ffmpeg/format/FormatIn.hpp +++ b/csrc/ffmpeg/format/FormatIn.hpp @@ -3,6 +3,7 @@ #include <stdint.h> #include <memory> +#include "PsToEs.hpp" struct AVFormatContext; struct AVDictionary; @@ -36,8 +37,8 @@ bool openCodec(const int type, AVDictionary **options); - bool readPacket(AVPacket &pkt_out, int stream_index = 0); - bool readPacket(std::shared_ptr<CodedData> &data, int stream_index = 0); + bool readPacket(AVPacket &pkt_out); + bool readPacket(std::shared_ptr<CodedData> &data); int decode(AVFrame* &frame, AVPacket &pkt); int decode(std::shared_ptr<FrameData> &frame_data, @@ -46,22 +47,27 @@ int readFrame(AVFrame* &frame); int readFrame(std::shared_ptr<FrameData> &frame_data); + bool isVideoPkt(AVPacket &pkt); + bool isAudioPkt(AVPacket &pkt); private: bool allocCodec(AVCodec *dec, AVStream *s, AVDictionary **options); public: - AVStream *getStream(int type = 0); + AVStream *getStream(int type = -1); AVCodecContext *getCodecContext(int type = 0); + const double getFPS()const{return fps_;} private: AVFormatContext *ctx_; AVCodecContext *dec_ctx_; int vs_idx_; + int as_idx_; bool hw_accl_; - + double fps_; private: AVIOContext *io_ctx_; uint8_t *read_io_buff_; const int read_io_buff_size_; + GB28181API *handle_gb28181; }; } -- Gitblit v1.8.0