| | |
| | | #include "../data/FrameData.hpp" |
| | | |
| | | #include "../../common/gpu/info.h" |
| | | #include "PsToEs.hpp" |
| | | |
| | | using namespace logif; |
| | | |
| | |
| | | FormatIn::~FormatIn() |
| | | { |
| | | if(io_ctx_){ |
| | | free(read_io_buff_); |
| | | avio_close(io_ctx_); |
| | | if(read_io_buff_){ |
| | | // av_free(read_io_buff_); |
| | | read_io_buff_ = NULL; |
| | | } |
| | | avio_context_free(&io_ctx_); |
| | | io_ctx_ = NULL; |
| | | } |
| | | if(ctx_){ |
| | | avformat_close_input(&ctx_); |
| | |
| | | ctx_ = NULL; |
| | | if(dec_ctx_){ |
| | | avcodec_close(dec_ctx_); |
| | | dec_ctx_ = NULL; |
| | | } |
| | | } |
| | | } |
| | |
| | | int FormatIn::openGb28181(const char *filename, AVDictionary **options){ |
| | | |
| | | std::string fn = filename; |
| | | addCamera(fn); |
| | | //GB28181API gb28181(fn); |
| | | handle_gb28181.addCamera(fn); |
| | | |
| | | int ret = openWithCustomIO(NULL, readData, options); |
| | | int ret = openWithCustomIO((void *)&handle_gb28181, handle_gb28181.readData, options); |
| | | if(ret < 0){ |
| | | logIt("do openWithCustomIO failed:%d",ret); |
| | | } |