Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef __VIDEO_ENCODER_H
- #define __VIDEO_ENCODER_H
- #include <memory>
- #ifndef INT64_C
- # define INT64_C(c) (c ## LL)
- # define UINT64_C(c) (c ## ULL)
- #endif
- extern "C" {
- #include <libavcodec/avcodec.h>
- #include <libavformat/avformat.h>
- #include <libavutil/imgutils.h>
- }
- namespace PTAMM {
- class VideoEncoder {
- public:
- VideoEncoder();
- ~VideoEncoder();
- void EncodeFrame(const uint8_t* frame);
- private:
- AVStream* CreateVideoStream(AVFormatContext* oc);
- void CopyFrameData(const uint8_t* src_frame, AVFrame* dest_frame);
- AVOutputFormat* format_;
- AVFormatContext* format_ctx_;
- AVStream* stream_;
- AVFrame* pic_;
- AVIOContext* io_ctx_;
- uint8_t* outbuf_;
- uint32_t outbuf_size_;
- uint32_t frame_count_;
- };
- }
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement