Advertisement
Guest User

Untitled

a guest
May 7th, 2012
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. #ifndef __VIDEO_ENCODER_H
  2. #define __VIDEO_ENCODER_H
  3.  
  4. #include <memory>
  5.  
  6. #ifndef INT64_C
  7. # define INT64_C(c) (c ## LL)
  8. # define UINT64_C(c) (c ## ULL)
  9. #endif
  10.  
  11. extern "C" {
  12.  
  13. #include <libavcodec/avcodec.h>
  14. #include <libavformat/avformat.h>
  15. #include <libavutil/imgutils.h>
  16.  
  17. }
  18.  
  19. namespace PTAMM {
  20.  
  21. class VideoEncoder {
  22. public:
  23. VideoEncoder();
  24. ~VideoEncoder();
  25.  
  26. void EncodeFrame(const uint8_t* frame);
  27. private:
  28. AVStream* CreateVideoStream(AVFormatContext* oc);
  29. void CopyFrameData(const uint8_t* src_frame, AVFrame* dest_frame);
  30.  
  31. AVOutputFormat* format_;
  32. AVFormatContext* format_ctx_;
  33. AVStream* stream_;
  34. AVFrame* pic_;
  35. AVIOContext* io_ctx_;
  36.  
  37. uint8_t* outbuf_;
  38. uint32_t outbuf_size_;
  39. uint32_t frame_count_;
  40. };
  41.  
  42. }
  43.  
  44. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement