| | |
| | | #include <stdlib.h> |
| | | #include <memory> |
| | | #include <string> |
| | | #include <vector> |
| | | |
| | | struct AVFormatContext; |
| | | struct AVStream; |
| | |
| | | FormatOut(VideoProp &prop, |
| | | const char *filename, char *format_name = NULL); |
| | | |
| | | FormatOut(AVStream *in, const char *format_name); |
| | | FormatOut(const double fps, const char *format_name); |
| | | |
| | | void clear(); |
| | | public: |
| | |
| | | int encode(std::shared_ptr<CodedData> &data,AVFrame *frame); |
| | | |
| | | public: |
| | | bool copyCodecFromIn(AVStream *in); |
| | | bool copyCodecFromIn(std::vector<AVStream*> in); |
| | | bool openResource(const char *filename, const int flags); |
| | | bool closeResource(); |
| | | |
| | | bool JustWriter(AVStream *in, const char *filename); |
| | | bool JustWriter(std::vector<AVStream*> in, const char *filename); |
| | | bool EncodeWriter(const char *filename); |
| | | bool writeFrame(AVPacket &pkt, const int64_t &frame_cnt, bool interleaved = true); |
| | | void adjustPTS(AVPacket &pkt, const int64_t &frame_cnt); |
| | | void adjustVideoPTS(AVPacket &pkt, const int64_t &frame_cnt); |
| | | bool endWriter(); |
| | | |
| | | bool writeHeader(AVDictionary **options = NULL); |
| | |
| | | double fps_; |
| | | std::string format_name_; |
| | | |
| | | // rec |
| | | std::vector<AVStream*> streams_; |
| | | }; |
| | | } |
| | | #endif |