diff options
Diffstat (limited to 'video/qt_decoder.cpp')
-rw-r--r-- | video/qt_decoder.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/video/qt_decoder.cpp b/video/qt_decoder.cpp index 9b77ef70c1..cab7372a6d 100644 --- a/video/qt_decoder.cpp +++ b/video/qt_decoder.cpp @@ -751,4 +751,27 @@ bool QuickTimeDecoder::VideoTrackHandler::endOfCurEdit() const { return getRateAdjustedFrameTime() >= getCurEditTimeOffset() + getCurEditTrackDuration(); } +bool QuickTimeDecoder::VideoTrackHandler::canDither() const { + for (uint i = 0; i < _parent->sampleDescs.size(); i++) { + VideoSampleDesc *desc = (VideoSampleDesc *)_parent->sampleDescs[i]; + + if (!desc || !desc->_videoCodec) + return false; + + if (!desc->_videoCodec->canDither(Image::Codec::kDitherTypeQT)) + return false; + } + + return true; +} + +void QuickTimeDecoder::VideoTrackHandler::setDither(const byte *palette) { + assert(canDither()); + + for (uint i = 0; i < _parent->sampleDescs.size(); i++) { + VideoSampleDesc *desc = (VideoSampleDesc *)_parent->sampleDescs[i]; + desc->_videoCodec->setDither(Image::Codec::kDitherTypeQT, palette); + } +} + } // End of namespace Video |