#ifndef _CV_FFMPEG_DATA_BRIDGE_H_ #define _CV_FFMPEG_DATA_BRIDGE_H_ #include #include struct AVFrame; namespace ffwrapper{ class swscale_wrapper; class PicData; class cvbridge { public: cvbridge(int srcW, int srcH, int srcFmt, int dstW, int dstH, int dstFmt, int flags=4, void *srcFilter=NULL, void *dstFilter=NULL, double *param=NULL); ~cvbridge(); public: uint8_t* convert2Data(AVFrame *in); AVFrame* convert2Frame(AVFrame *in); static AVFrame *fillFrame(uint8_t *in, const int w, const int h, const int f); static uint8_t* extractFrame(AVFrame *in, int *length); private: ffwrapper::swscale_wrapper *scale_; ffwrapper::PicData *pic_; }; } #endif