X-Git-Url: https://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.0%2Fcinelerra%2Fffmpeg.h;h=68649d16218c5f03763c00b282e41589b762a1bc;hb=6c0c8bd0e577001d1cc18c6c27d58e62f58a6bff;hp=92fabfcdc5367a26b7ffec01c7050ea44212f69b;hpb=fa7f91658c01ba88aab006beff8b167a4bbb7085;p=goodguy%2Fhistory.git diff --git a/cinelerra-5.0/cinelerra/ffmpeg.h b/cinelerra-5.0/cinelerra/ffmpeg.h index 92fabfcd..68649d16 100644 --- a/cinelerra-5.0/cinelerra/ffmpeg.h +++ b/cinelerra-5.0/cinelerra/ffmpeg.h @@ -194,7 +194,32 @@ public: float *aud_bfr; }; -class FFVideoStream : public FFStream { + +class FFVideoConvert { +public: + struct SwsContext *convert_ctx; + + FFVideoConvert() { convert_ctx = 0; } + ~FFVideoConvert() { if( convert_ctx ) sws_freeContext(convert_ctx); } + + static PixelFormat color_model_to_pix_fmt(int color_model); + static int pix_fmt_to_color_model(PixelFormat pix_fmt); + + int convert_picture_vframe(VFrame *frame, + AVPicture *ip, PixelFormat ifmt, int iw, int ih); + int convert_cmodel(VFrame *frame_out, + AVPicture *ip, PixelFormat ifmt, int iw, int ih); + int transfer_cmodel(VFrame *frame_in, //defaults->metadata + AVFrame *ifp, PixelFormat ifmt, int iw, int ih); + int convert_vframe_picture(VFrame *frame, + AVPicture *op, PixelFormat ofmt, int ow, int oh); + int convert_pixfmt(VFrame *frame_in, + AVPicture *op, PixelFormat ofmt, int ow, int oh); + int transfer_pixfmt(VFrame *frame_in, //metadata->defaults + AVFrame *ofp, PixelFormat ofmt, int ow, int oh); +}; + +class FFVideoStream : public FFStream, public FFVideoConvert { public: FFVideoStream(FFMPEG *ffmpeg, AVStream *strm, int idx, int fidx); virtual ~FFVideoStream(); @@ -217,22 +242,9 @@ public: int64_t length; float aspect_ratio; - struct SwsContext *convert_ctx; uint8_t *pkt_bfr; int pkt_bfr_sz; int64_t start_pts; - - static PixelFormat color_model_to_pix_fmt(int color_model); - static int pix_fmt_to_color_model(PixelFormat pix_fmt); - - int convert_picture_vframe(VFrame *frame, - AVPicture *ip, PixelFormat ifmt, int iw, int ih); - int convert_cmodel(VFrame *frame_out, - AVPicture *ip, PixelFormat ifmt, int iw, int ih); - int convert_vframe_picture(VFrame *frame, - AVPicture *op, PixelFormat ofmt, int ow, int oh); - int convert_pixfmt(VFrame *frame_in, - AVPicture *op, PixelFormat ofmt, int ow, int oh); }; class FFMPEG : public Thread {