diff options
| author | Carl Hetherington <cth@carlh.net> | 2025-12-17 18:23:45 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2025-12-18 12:54:28 +0100 |
| commit | 360a935d7422c0fae0c85f32447e751f26fc37d5 (patch) | |
| tree | 71012097ba0425ede0a16d48dbaa98aaceb9ccc2 /src | |
| parent | 3a001037ec1131c236b253d16bfc2c3bc8f36212 (diff) | |
Add CPL::picture_encoding().
Diffstat (limited to 'src')
| -rw-r--r-- | src/cpl.cc | 28 | ||||
| -rw-r--r-- | src/cpl.h | 4 |
2 files changed, 32 insertions, 0 deletions
@@ -850,3 +850,31 @@ CPL::can_be_read() const return std::all_of(r.begin(), r.end(), [](shared_ptr<const Reel> reel) { return reel->can_be_read(); }); } + +PictureEncoding +CPL::picture_encoding() const +{ + PictureEncoding encoding = PictureEncoding::NO_VIDEO; + + for (auto reel: reels()) { + auto const reel_encoding = reel->picture_encoding(); + switch (reel_encoding) { + case PictureEncoding::NO_VIDEO: + break; + case PictureEncoding::JPEG2000: + case PictureEncoding::MPEG2: + if (encoding == PictureEncoding::NO_VIDEO) { + encoding = reel_encoding; + } else if (encoding != reel_encoding) { + encoding = PictureEncoding::MIXED; + } + break; + case PictureEncoding::MIXED: + encoding = PictureEncoding::MIXED; + break; + } + } + + return encoding; +} + @@ -47,6 +47,7 @@ #include "key.h" #include "language_tag.h" #include "main_sound_configuration.h" +#include "picture_encoding.h" #include "profile.h" #include "rating.h" #include "verify.h" @@ -352,6 +353,9 @@ public: return _read_composition_metadata; } + /** @return picture encoding scheme used by assets in this CPL */ + PictureEncoding picture_encoding() const; + static std::string static_pkl_type(Standard standard); protected: |
