framereader: remove swscale (#22578)

pull/22585/head
Dean Lee 4 years ago committed by GitHub
parent df9492d1e1
commit 085c424cf9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      selfdrive/ui/SConscript
  2. 8
      selfdrive/ui/replay/framereader.cc
  3. 2
      selfdrive/ui/replay/framereader.h

@ -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_;

Loading…
Cancel
Save