mirror of
https://github.com/ZoneMinder/zoneminder.git
synced 2026-11-30 12:14:36 -05:00
fix: convert 4:2:2 frames to YUV420P before a quarter-turn rotation refs #5952
This commit is contained in:
1 parent
5f0573207c
commit
595fe64242
3 files changed
+36
-9
No files matched your search
@@ -35,6 +35,7 @@ class DecoderQueue : public Monitor {
|
||||
public:
|
||||
DecoderQueue() : Monitor() {}
|
||||
using Monitor::DecoderQueueLimit;
|
||||
using Monitor::CanPassthroughFormat;
|
||||
|
||||
// Packets sent to the codec, in decode order, by pts.
|
||||
std::vector<std::shared_ptr<ZMPacket>> Send(const std::vector<int64_t> &pts) {
|
||||
@@ -177,3 +178,21 @@ TEST_CASE("Monitor decoder queue: after a flush nothing is sent until a keyframe
|
||||
// The wait is over once the keyframe went to the codec
|
||||
CHECK_FALSE(q.Skip(false));
|
||||
}
|
||||
|
||||
TEST_CASE("Monitor::CanPassthroughFormat keeps 4:2:2 out of quarter turns", "[Monitor]") {
|
||||
for (Monitor::Orientation o : {Monitor::ROTATE_0, Monitor::ROTATE_180, Monitor::FLIP_HORI, Monitor::FLIP_VERT}) {
|
||||
CHECK(DecoderQueue::CanPassthroughFormat(AV_PIX_FMT_YUV422P, o));
|
||||
CHECK(DecoderQueue::CanPassthroughFormat(AV_PIX_FMT_YUVJ422P, o));
|
||||
}
|
||||
for (Monitor::Orientation o : {Monitor::ROTATE_90, Monitor::ROTATE_270}) {
|
||||
CHECK_FALSE(DecoderQueue::CanPassthroughFormat(AV_PIX_FMT_YUV422P, o));
|
||||
CHECK_FALSE(DecoderQueue::CanPassthroughFormat(AV_PIX_FMT_YUVJ422P, o));
|
||||
CHECK(DecoderQueue::CanPassthroughFormat(AV_PIX_FMT_YUV420P, o));
|
||||
CHECK(DecoderQueue::CanPassthroughFormat(AV_PIX_FMT_YUVJ420P, o));
|
||||
CHECK(DecoderQueue::CanPassthroughFormat(AV_PIX_FMT_GRAY8, o));
|
||||
CHECK(DecoderQueue::CanPassthroughFormat(AV_PIX_FMT_RGB24, o));
|
||||
CHECK(DecoderQueue::CanPassthroughFormat(AV_PIX_FMT_BGRA, o));
|
||||
}
|
||||
CHECK_FALSE(DecoderQueue::CanPassthroughFormat(AV_PIX_FMT_YUV444P, Monitor::ROTATE_0));
|
||||
CHECK_FALSE(DecoderQueue::CanPassthroughFormat(AV_PIX_FMT_YUV420P10LE, Monitor::ROTATE_0));
|
||||
}
|
||||
Reference in new issue
Block a user