summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2022-12-27 22:38:35 +0100
committerCarl Hetherington <cth@carlh.net>2024-04-15 10:59:34 +0200
commit6c2b42d53a9c7f5bec21795667faf94acf5bf1af (patch)
tree0ede58b2a46a59217b92861682511559e9b8bc74 /src
parentd23abb4b3fef1e2497969b0909c736d0541b1091 (diff)
Add OK note when picture frame sizes are all OK.
Diffstat (limited to 'src')
-rw-r--r--src/verify.cc12
-rw-r--r--src/verify.h1
2 files changed, 12 insertions, 1 deletions
diff --git a/src/verify.cc b/src/verify.cc
index 9460bc62..85d09204 100644
--- a/src/verify.cc
+++ b/src/verify.cc
@@ -539,19 +539,23 @@ verify_picture_asset(
int const max_frame = rint(250 * 1000000 / (8 * asset->edit_rate().as_float()));
int const risky_frame = rint(230 * 1000000 / (8 * asset->edit_rate().as_float()));
- auto check_frame_size = [max_frame, risky_frame, file, start_frame](Context& context, int index, int size, int frame_rate) {
+ bool any_bad_frames_seen = false;
+
+ auto check_frame_size = [max_frame, risky_frame, file, start_frame, &any_bad_frames_seen](Context& context, int index, int size, int frame_rate) {
if (size > max_frame) {
context.add_note(
VerificationNote(
VerificationNote::Type::ERROR, VerificationNote::Code::INVALID_PICTURE_FRAME_SIZE_IN_BYTES, file
).set_frame(start_frame + index).set_frame_rate(frame_rate)
);
+ any_bad_frames_seen = true;
} else if (size > risky_frame) {
context.add_note(
VerificationNote(
VerificationNote::Type::WARNING, VerificationNote::Code::NEARLY_INVALID_PICTURE_FRAME_SIZE_IN_BYTES, file
).set_frame(start_frame + index).set_frame_rate(frame_rate)
);
+ any_bad_frames_seen = true;
}
};
@@ -583,6 +587,10 @@ verify_picture_asset(
}
}
+
+ if (!any_bad_frames_seen) {
+ context.ok(VerificationNote::Code::VALID_PICTURE_FRAME_SIZES_IN_BYTES, file);
+ }
}
@@ -1945,6 +1953,8 @@ dcp::note_to_string (VerificationNote note)
return String::compose("The intrinsic duration of the asset %1 is less than 1 second.", note.note().get());
case VerificationNote::Code::INVALID_DURATION:
return String::compose("The duration of the asset %1 is less than 1 second.", note.note().get());
+ case VerificationNote::Code::VALID_PICTURE_FRAME_SIZES_IN_BYTES:
+ return String::compose("Each frame of the picture asset %1 has a bit rate safely under the limit of 250Mbit/s.", note.file()->filename());
case VerificationNote::Code::INVALID_PICTURE_FRAME_SIZE_IN_BYTES:
return String::compose(
"Frame %1 (timecode %2) in asset %3 has an instantaneous bit rate that is larger than the limit of 250Mbit/s.",
diff --git a/src/verify.h b/src/verify.h
index 7c902660..eeda0b7a 100644
--- a/src/verify.h
+++ b/src/verify.h
@@ -158,6 +158,7 @@ public:
* note contains asset ID
*/
INVALID_DURATION,
+ VALID_PICTURE_FRAME_SIZES_IN_BYTES,
/** The JPEG2000 data in at least one picture frame is larger than the equivalent of 250Mbit/s
* file contains the picture asset filename
*/