Skip to content
Snippets Groups Projects
Commit 2f7dd3dd authored by Nicolas Pope's avatar Nicolas Pope
Browse files

Fix for not recreating encoder with tile change

parent 7dd67518
No related branches found
No related tags found
No related merge requests found
Pipeline #27115 passed
......@@ -30,6 +30,8 @@ class NvPipeDecoder : public ftl::codecs::Decoder {
cv::cuda::GpuMat tmp_;
int width_;
int height_;
int last_width_;
int last_height_;
int n_;
bool _create(const ftl::codecs::Packet &pkt);
......
......@@ -66,7 +66,9 @@ bool NvPipeDecoder::_create(const ftl::codecs::Packet &pkt) {
bool is_float_frame = pkt.flags & ftl::codecs::kFlagFloat;
// Check existing decoder is valid first and remove if not
if (nv_decoder_ != nullptr && (last_definition_ != pkt.definition || last_codec_ != pkt.codec || is_float_channel_ != is_float_frame)) {
if (nv_decoder_ != nullptr && (last_definition_ != pkt.definition ||
last_codec_ != pkt.codec || is_float_channel_ != is_float_frame ||
width_ != last_width_ || height_ != last_height_)) {
delete nv_decoder_;
nv_decoder_ = nullptr;
}
......@@ -163,6 +165,8 @@ bool NvPipeDecoder::decode(const ftl::codecs::Packet &pkt, cv::cuda::GpuMat &out
is_float_channel_ = is_float_frame;
last_definition_ = pkt.definition;
last_codec_ = pkt.codec;
last_width_ = width_;
last_height_ = height_;
// Build a decoder instance of the correct kind
/*if (nv_decoder_ == nullptr) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment