mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-21 09:12:25 +08:00
framereader: remove swscale (#22578)
old-commit-hash: 085c424cf923f8a2886dbfaf7be71b1c38d28101
This commit is contained in:
@@ -111,7 +111,7 @@ if arch in ['x86_64', 'Darwin'] and os.path.exists(Dir("#tools/").get_abspath())
|
||||
replay_lib_src = ["replay/replay.cc", "replay/camera.cc", "replay/logreader.cc", "replay/framereader.cc", "replay/route.cc", "replay/util.cc"]
|
||||
|
||||
replay_lib = qt_env.Library("qt_replay", replay_lib_src, LIBS=base_libs)
|
||||
replay_libs = [replay_lib, 'avutil', 'avcodec', 'avformat', 'swscale', 'bz2', 'curl', 'yuv'] + qt_libs
|
||||
replay_libs = [replay_lib, 'avutil', 'avcodec', 'avformat', 'bz2', 'curl', 'yuv'] + qt_libs
|
||||
qt_env.Program("replay/replay", ["replay/main.cc"], LIBS=replay_libs)
|
||||
|
||||
qt_env.Program("watch3", ["watch3.cc"], LIBS=qt_libs)
|
||||
|
||||
@@ -57,9 +57,6 @@ FrameReader::~FrameReader() {
|
||||
if (pFormatCtx_) {
|
||||
avformat_close_input(&pFormatCtx_);
|
||||
}
|
||||
if (sws_ctx_) {
|
||||
sws_freeContext(sws_ctx_);
|
||||
}
|
||||
}
|
||||
|
||||
bool FrameReader::load(const std::string &url) {
|
||||
@@ -86,11 +83,6 @@ bool FrameReader::load(const std::string &url) {
|
||||
width = pCodecCtxOrig->width;
|
||||
height = pCodecCtxOrig->height;
|
||||
|
||||
sws_ctx_ = sws_getContext(width, height, AV_PIX_FMT_YUV420P,
|
||||
width, height, AV_PIX_FMT_BGR24,
|
||||
SWS_BILINEAR, NULL, NULL, NULL);
|
||||
if (!sws_ctx_) return false;
|
||||
|
||||
frames_.reserve(60 * 20); // 20fps, one minute
|
||||
do {
|
||||
Frame &frame = frames_.emplace_back();
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
extern "C" {
|
||||
#include <libavcodec/avcodec.h>
|
||||
#include <libavformat/avformat.h>
|
||||
#include <libswscale/swscale.h>
|
||||
}
|
||||
|
||||
class FrameReader {
|
||||
@@ -41,7 +40,6 @@ private:
|
||||
|
||||
AVFormatContext *pFormatCtx_ = nullptr;
|
||||
AVCodecContext *pCodecCtx_ = nullptr;
|
||||
struct SwsContext *sws_ctx_ = nullptr;
|
||||
|
||||
std::mutex mutex_;
|
||||
std::condition_variable cv_decode_;
|
||||
|
||||
Reference in New Issue
Block a user