| 609 | } |
| 610 | |
| 611 | int DocumentData::resolveVideoQuality() const { |
| 612 | if (const auto data = video()) { |
| 613 | if (!data->realVideoSize.isEmpty()) { |
| 614 | const auto size = data->realVideoSize; |
| 615 | return std::min(size.width(), size.height()); |
| 616 | } |
| 617 | const auto attributesSize = isVideoFile() ? dimensions : QSize(); |
| 618 | const auto attributesQuality = attributesSize.isEmpty() |
| 619 | ? 0 |
| 620 | : std::min(attributesSize.width(), attributesSize.height()); |
| 621 | if (!data->qualities.empty()) { |
| 622 | auto transcodeMax = 0; |
| 623 | for (const auto &quality : data->qualities) { |
| 624 | if (quality != this) { |
| 625 | const auto qres = quality->resolveVideoQuality(); |
| 626 | if (qres > transcodeMax) { |
| 627 | transcodeMax = qres; |
| 628 | } |
| 629 | } |
| 630 | } |
| 631 | if (transcodeMax > 0) { |
| 632 | return ResolveAttributeVsTranscodeQuality( |
| 633 | attributesQuality, |
| 634 | transcodeMax); |
| 635 | } |
| 636 | } |
| 637 | } |
| 638 | const auto attributesSize = isVideoFile() ? dimensions : QSize(); |
| 639 | return attributesSize.isEmpty() |
| 640 | ? 0 |
| 641 | : std::min(attributesSize.width(), attributesSize.height()); |
| 642 | } |
| 643 | |
| 644 | int DocumentData::resolveOriginalVideoQuality() const { |
| 645 | if (const auto data = video()) { |
no test coverage detected