mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-09-14 19:44:05 +08:00
fix qcom decoder compilation on mac with platform check (#36131)
This commit is contained in:
@@ -12,7 +12,9 @@ else:
|
|||||||
base_libs.append('OpenCL')
|
base_libs.append('OpenCL')
|
||||||
|
|
||||||
replay_lib_src = ["replay.cc", "consoleui.cc", "camera.cc", "filereader.cc", "logreader.cc", "framereader.cc",
|
replay_lib_src = ["replay.cc", "consoleui.cc", "camera.cc", "filereader.cc", "logreader.cc", "framereader.cc",
|
||||||
"route.cc", "util.cc", "seg_mgr.cc", "timeline.cc", "api.cc", "qcom_decoder.cc"]
|
"route.cc", "util.cc", "seg_mgr.cc", "timeline.cc", "api.cc"]
|
||||||
|
if arch != "Darwin":
|
||||||
|
replay_lib_src.append("qcom_decoder.cc")
|
||||||
replay_lib = replay_env.Library("replay", replay_lib_src, LIBS=base_libs, FRAMEWORKS=base_frameworks)
|
replay_lib = replay_env.Library("replay", replay_lib_src, LIBS=base_libs, FRAMEWORKS=base_frameworks)
|
||||||
Export('replay_lib')
|
Export('replay_lib')
|
||||||
replay_libs = [replay_lib, 'avutil', 'avcodec', 'avformat', 'bz2', 'zstd', 'curl', 'yuv', 'ncurses'] + base_libs
|
replay_libs = [replay_lib, 'avutil', 'avcodec', 'avformat', 'bz2', 'zstd', 'curl', 'yuv', 'ncurses'] + base_libs
|
||||||
|
|||||||
@@ -39,9 +39,12 @@ struct DecoderManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::unique_ptr<VideoDecoder> decoder;
|
std::unique_ptr<VideoDecoder> decoder;
|
||||||
|
#ifndef __APPLE__
|
||||||
if (Hardware::TICI() && hw_decoder) {
|
if (Hardware::TICI() && hw_decoder) {
|
||||||
decoder = std::make_unique<QcomVideoDecoder>();
|
decoder = std::make_unique<QcomVideoDecoder>();
|
||||||
} else {
|
} else
|
||||||
|
#endif
|
||||||
|
{
|
||||||
decoder = std::make_unique<FFmpegVideoDecoder>();
|
decoder = std::make_unique<FFmpegVideoDecoder>();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -264,6 +267,7 @@ bool FFmpegVideoDecoder::copyBuffer(AVFrame *f, VisionBuf *buf) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef __APPLE__
|
||||||
bool QcomVideoDecoder::open(AVCodecParameters *codecpar, bool hw_decoder) {
|
bool QcomVideoDecoder::open(AVCodecParameters *codecpar, bool hw_decoder) {
|
||||||
if (codecpar->codec_id != AV_CODEC_ID_HEVC) {
|
if (codecpar->codec_id != AV_CODEC_ID_HEVC) {
|
||||||
rError("Hardware decoder only supports HEVC codec");
|
rError("Hardware decoder only supports HEVC codec");
|
||||||
@@ -305,3 +309,4 @@ bool QcomVideoDecoder::decode(FrameReader *reader, int idx, VisionBuf *buf) {
|
|||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|||||||
@@ -6,7 +6,10 @@
|
|||||||
#include "msgq/visionipc/visionbuf.h"
|
#include "msgq/visionipc/visionbuf.h"
|
||||||
#include "tools/replay/filereader.h"
|
#include "tools/replay/filereader.h"
|
||||||
#include "tools/replay/util.h"
|
#include "tools/replay/util.h"
|
||||||
|
|
||||||
|
#ifndef __APPLE__
|
||||||
#include "tools/replay/qcom_decoder.h"
|
#include "tools/replay/qcom_decoder.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#include <libavcodec/avcodec.h>
|
#include <libavcodec/avcodec.h>
|
||||||
@@ -65,6 +68,7 @@ private:
|
|||||||
AVBufferRef *hw_device_ctx = nullptr;
|
AVBufferRef *hw_device_ctx = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifndef __APPLE__
|
||||||
class QcomVideoDecoder : public VideoDecoder {
|
class QcomVideoDecoder : public VideoDecoder {
|
||||||
public:
|
public:
|
||||||
QcomVideoDecoder() {};
|
QcomVideoDecoder() {};
|
||||||
@@ -75,3 +79,4 @@ public:
|
|||||||
private:
|
private:
|
||||||
MsmVidc msm_vidc = MsmVidc();
|
MsmVidc msm_vidc = MsmVidc();
|
||||||
};
|
};
|
||||||
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user