feat: VideoStack支持等比缩放 (#4191)

feat: VideoStack支持等比缩放 (目前以宏VIDEOSTACK_KEEP_ASPECT_RATIO
方式控制开启,后续考虑是否添加到配置文件中来控制)
This commit is contained in:
KkemChen
2025-03-19 09:42:57 +08:00
committed by GitHub
parent d078446a91
commit fd89e0d801
2 changed files with 102 additions and 11 deletions

View File

@@ -62,12 +62,24 @@ protected:
void copyData(const mediakit::FFmpegFrame::Ptr& buf, const Param::Ptr& p);
void resizeFrame(const mediakit::FFmpegFrame::Ptr &frame);
void resizeFrameImplWithAspectRatio(const mediakit::FFmpegFrame::Ptr &frame);
void resizeFrameImplWithoutAspectRatio(const mediakit::FFmpegFrame::Ptr &frame);
private:
std::string _id;
int _width;
int _height;
AVPixelFormat _pixfmt;
int _lastWidht;
int _lastHeight;
bool _keepAspectRatio;
int _offsetX;
int _offsetY;
mediakit::FFmpegFrame::Ptr _tmp;
std::recursive_mutex _mx;