forge
Explore
Log in

Don't you dare go Hollow

The transform reaches both render paths

Browse files at this commit

f4e379fb38edca6c02b6f439a6cc9cfee50d37f8Ahmet Kaan GümüşParent: 5984e27
  • feat
    • the transform reaches both render paths
Show full message
✨ feat(engine): the transform reaches both render paths
crates/engine/src/decode.rsmodified+49 -4
@@ -17,6 +17,7 @@ use crate::hw::HwSession;
17 use crate::project::Speed;17 use crate::project::Speed;
18 use crate::scale::Composer;18 use crate::scale::Composer;
19 use crate::tonemap::{self, ToneMapper};19 use crate::tonemap::{self, ToneMapper};
20+use crate::transform::TransformParams;
20 21
21 /// One decoded picture, ready to hand to a renderer.22 /// One decoded picture, ready to hand to a renderer.
22 pub struct Frame {23 pub struct Frame {
@@ -176,6 +177,7 @@ struct SpanCmd {
176 start: u32,177 start: u32,
177 end: u32,178 end: u32,
178 color: ColorParams,179 color: ColorParams,
180+ transform: TransformParams,
179 canvas: Composer,181 canvas: Composer,
180 tone: tonemap::Preset,182 tone: tonemap::Preset,
181 /// The clip's own playback speed ([`crate::project::Clip::speed`]), for183 /// The clip's own playback speed ([`crate::project::Clip::speed`]), for
@@ -308,6 +310,7 @@ impl Worker {
308 start: u32,310 start: u32,
309 end: u32,311 end: u32,
310 color: ColorParams,312 color: ColorParams,
313+ transform: TransformParams,
311 canvas: Composer,314 canvas: Composer,
312 tone: tonemap::Preset,315 tone: tonemap::Preset,
313 speed: Speed,316 speed: Speed,
@@ -331,6 +334,7 @@ impl Worker {
331 start,334 start,
332 end,335 end,
333 color,336 color,
337+ transform,
334 canvas,338 canvas,
335 tone,339 tone,
336 speed,340 speed,
@@ -433,6 +437,9 @@ impl DecodeSession {
433 start_frame,437 start_frame,
434 end_frame,438 end_frame,
435 ColorParams::default(),439 ColorParams::default(),
440+ // No clip, no transform either: the file-level API hands back the
441+ // pictures the file holds, untouched.
442+ TransformParams::default(),
436 // No project, no canvas: the file-level API hands back the443 // No project, no canvas: the file-level API hands back the
437 // pictures the file holds, at the size it holds them.444 // pictures the file holds, at the size it holds them.
438 Composer::passthrough(),445 Composer::passthrough(),
@@ -512,6 +519,7 @@ impl DecodeSession {
512 start_frame: u32,519 start_frame: u32,
513 len: u32,520 len: u32,
514 color: ColorParams,521 color: ColorParams,
522+ transform: TransformParams,
515 canvas: Composer,523 canvas: Composer,
516 ) -> crate::Result<FrameStream> {524 ) -> crate::Result<FrameStream> {
517 let still = Still::open(path)?;525 let still = Still::open(path)?;
@@ -538,6 +546,7 @@ impl DecodeSession {
538 // the project is watching.546 // the project is watching.
539 let first = Render::new(547 let first = Render::new(
540 color,548 color,
549+ transform,
541 ColorDescription::default(),550 ColorDescription::default(),
542 canvas,551 canvas,
543 tonemap::Preset::default(),552 tonemap::Preset::default(),
@@ -610,6 +619,7 @@ impl DecodeSession {
610 start_frame: u32,619 start_frame: u32,
611 end_frame: u32,620 end_frame: u32,
612 color: ColorParams,621 color: ColorParams,
622+ transform: TransformParams,
613 canvas: Composer,623 canvas: Composer,
614 tone: tonemap::Preset,624 tone: tonemap::Preset,
615 ) -> crate::Result<(VideoMeta, FrameStream)> {625 ) -> crate::Result<(VideoMeta, FrameStream)> {
@@ -650,6 +660,7 @@ impl DecodeSession {
650 start_frame,660 start_frame,
651 end_frame,661 end_frame,
652 color,662 color,
663+ transform,
653 canvas,664 canvas,
654 tone,665 tone,
655 // A file-level open has no clip and no speed to skip frames666 // A file-level open has no clip and no speed to skip frames
@@ -677,6 +688,7 @@ impl DecodeSession {
677 start_frame: u32,688 start_frame: u32,
678 end_frame: u32,689 end_frame: u32,
679 color: ColorParams,690 color: ColorParams,
691+ transform: TransformParams,
680 canvas: Composer,692 canvas: Composer,
681 tone: tonemap::Preset,693 tone: tonemap::Preset,
682 speed: Speed,694 speed: Speed,
@@ -687,6 +699,7 @@ impl DecodeSession {
687 start_frame,699 start_frame,
688 end_frame,700 end_frame,
689 color,701 color,
702+ transform,
690 canvas,703 canvas,
691 tone,704 tone,
692 speed,705 speed,
@@ -710,6 +723,7 @@ fn span_worker(
710 start_frame: u32,723 start_frame: u32,
711 end_frame: u32,724 end_frame: u32,
712 color: ColorParams,725 color: ColorParams,
726+ transform: TransformParams,
713 canvas: Composer,727 canvas: Composer,
714 tone: tonemap::Preset,728 tone: tonemap::Preset,
715 speed: Speed,729 speed: Speed,
@@ -740,6 +754,7 @@ fn span_worker(
740 start: start_frame,754 start: start_frame,
741 end: end_frame,755 end: end_frame,
742 color,756 color,
757+ transform,
743 canvas,758 canvas,
744 tone,759 tone,
745 speed,760 speed,
@@ -919,6 +934,7 @@ fn run_span(
919 start,934 start,
920 end,935 end,
921 color,936 color,
937+ transform,
922 canvas,938 canvas,
923 tone,939 tone,
924 speed,940 speed,
@@ -947,7 +963,7 @@ fn run_span(
947 // The stream's own colour and peak brightness: properties of the stream, so963 // The stream's own colour and peak brightness: properties of the stream, so
948 // neither can change while one range decodes -- but the grade, the canvas964 // neither can change while one range decodes -- but the grade, the canvas
949 // and the rendition are the *span's*, so this is built per span.965 // and the rendition are the *span's*, so this is built per span.
950- let mut render = Render::new(color, opened.meta.color, canvas, tone, opened.peak);966+ let mut render = Render::new(color, transform, opened.meta.color, canvas, tone, opened.peak);
951 if let Some(reused) = opened.position_hw(path, start) {967 if let Some(reused) = opened.position_hw(path, start) {
952 // Cancelled during the init (or the seek): leave without decoding.968 // Cancelled during the init (or the seek): leave without decoding.
953 if abort.hit() {969 if abort.hit() {
@@ -1007,6 +1023,9 @@ fn run_span(
1007 /// project resolution, byte for byte and allocation for allocation.1023 /// project resolution, byte for byte and allocation for allocation.
1008 struct Render {1024 struct Render {
1009 color: ColorParams,1025 color: ColorParams,
1026+ /// This clip's placement, on top of whatever the canvas's own fit policy
1027+ /// already does ([`crate::scale::Composer::place_transformed`]).
1028+ transform: TransformParams,
1010 /// What the source's samples mean -- the stream's own matrix and range,1029 /// What the source's samples mean -- the stream's own matrix and range,
1011 /// which is what the conversion below is done in rather than the BT.601 it1030 /// which is what the conversion below is done in rather than the BT.601 it
1012 /// used to assume of every file.1031 /// used to assume of every file.
@@ -1021,6 +1040,10 @@ struct Render {
1021 /// across the worker's whole range. Empty unless the clip needs one: it is1040 /// across the worker's whole range. Empty unless the clip needs one: it is
1022 /// tone-mapped in place, graded in place, or both.1041 /// tone-mapped in place, graded in place, or both.
1023 graded: (Vec<u8>, Vec<u8>, Vec<u8>),1042 graded: (Vec<u8>, Vec<u8>, Vec<u8>),
1043+ /// Where [`Composer::place_transformed`]'s owned picture lands, so a
1044+ /// transformed frame's planes live as long as `self` -- matching what
1045+ /// [`Composer::place`] already hands back by borrowing `self.canvas`.
1046+ placed: (Vec<u8>, Vec<u8>, Vec<u8>),
1024 }1047 }
1025 1048
1026 /// What [`Render::frame`] converts a tone-mapped picture in: the tone map's1049 /// What [`Render::frame`] converts a tone-mapped picture in: the tone map's
@@ -1038,6 +1061,7 @@ impl Render {
1038 /// reference rendition reads (see [`tonemap::Preset`]).1061 /// reference rendition reads (see [`tonemap::Preset`]).
1039 fn new(1062 fn new(
1040 color: ColorParams,1063 color: ColorParams,
1064+ transform: TransformParams,
1041 desc: ColorDescription,1065 desc: ColorDescription,
1042 canvas: Composer,1066 canvas: Composer,
1043 preset: tonemap::Preset,1067 preset: tonemap::Preset,
@@ -1045,6 +1069,7 @@ impl Render {
1045 ) -> Self {1069 ) -> Self {
1046 Self {1070 Self {
1047 color,1071 color,
1072+ transform,
1048 desc,1073 desc,
1049 canvas,1074 canvas,
1050 // corner-cut: the ceiling is that the map reads limited-range codes1075 // corner-cut: the ceiling is that the map reads limited-range codes
@@ -1058,6 +1083,7 @@ impl Render {
1058 Transfer::Hlg => Some(ToneMapper::new(tonemap::Transfer::Hlg, preset, peak)),1083 Transfer::Hlg => Some(ToneMapper::new(tonemap::Transfer::Hlg, preset, peak)),
1059 },1084 },
1060 graded: (Vec::new(), Vec::new(), Vec::new()),1085 graded: (Vec::new(), Vec::new(), Vec::new()),
1086+ placed: (Vec::new(), Vec::new(), Vec::new()),
1061 }1087 }
1062 }1088 }
1063 1089
@@ -1071,6 +1097,12 @@ impl Render {
1071 height: u32,1097 height: u32,
1072 ) -> Frame {1098 ) -> Frame {
1073 let passthrough = self.canvas.is_passthrough(width, height);1099 let passthrough = self.canvas.is_passthrough(width, height);
1100+ // A transform still has a picture to place even where the canvas
1101+ // itself would hand this size back untouched -- moving, scaling,
1102+ // rotating or cropping a passthrough-sized clip is still a placement,
1103+ // and must not be silently dropped by the fused conversion below.
1104+ let transform_active = !self.transform.is_identity();
1105+ let skip_placement = passthrough && !transform_active;
1074 // Everything that has to happen to the samples before the canvas sees1106 // Everything that has to happen to the samples before the canvas sees
1075 // them, on one copy: the tone map (HDR streams only) and, unless the1107 // them, on one copy: the tone map (HDR streams only) and, unless the
1076 // conversion below can fuse it, the grade. An SDR stream that is either1108 // conversion below can fuse it, the grade. An SDR stream that is either
@@ -1080,7 +1112,8 @@ impl Render {
1080 // picture a viewer is shown, so its brightness and saturation mean what1112 // picture a viewer is shown, so its brightness and saturation mean what
1081 // they say in the SDR the tone map just produced, not in the 10-stop1113 // they say in the SDR the tone map just produced, not in the 10-stop
1082 // HDR the file was in.1114 // HDR the file was in.
1083- let (y, u, v, desc) = if self.tone.is_some() || (!passthrough && !self.color.is_identity())1115+ let (y, u, v, desc) = if self.tone.is_some()
1116+ || (!skip_placement && !self.color.is_identity())
1084 {1117 {
1085 let (gy, gu, gv) = &mut self.graded;1118 let (gy, gu, gv) = &mut self.graded;
1086 gy.clear();1119 gy.clear();
@@ -1104,7 +1137,7 @@ impl Render {
1104 } else {1137 } else {
1105 (y, u, v, self.desc)1138 (y, u, v, self.desc)
1106 };1139 };
1107- if passthrough {1140+ if skip_placement {
1108 return Frame {1141 return Frame {
1109 index,1142 index,
1110 width,1143 width,
@@ -1120,7 +1153,15 @@ impl Render {
1120 ),1153 ),
1121 };1154 };
1122 }1155 }
1123- let (y, u, v, width, height) = self.canvas.place(y, u, v, width, height);1156+ let (y, u, v, width, height) = if transform_active {
1157+ let (py, pu, pv, w, h) = self
1158+ .canvas
1159+ .place_transformed(y, u, v, width, height, &self.transform);
1160+ self.placed = (py, pu, pv);
1161+ (&self.placed.0[..], &self.placed.1[..], &self.placed.2[..], w, h)
1162+ } else {
1163+ self.canvas.place(y, u, v, width, height)
1164+ };
1124 Frame {1165 Frame {
1125 index,1166 index,
1126 width,1167 width,
@@ -1384,6 +1425,7 @@ mod tests {
1384 0,1425 0,
1385 u32::MAX,1426 u32::MAX,
1386 ColorParams::default(),1427 ColorParams::default(),
1428+ TransformParams::default(),
1387 Composer::passthrough(),1429 Composer::passthrough(),
1388 tonemap::Preset::default(),1430 tonemap::Preset::default(),
1389 Speed::NORMAL,1431 Speed::NORMAL,
@@ -1405,6 +1447,7 @@ mod tests {
1405 0,1447 0,
1406 u32::MAX,1448 u32::MAX,
1407 ColorParams::default(),1449 ColorParams::default(),
1450+ TransformParams::default(),
1408 Composer::passthrough(),1451 Composer::passthrough(),
1409 tonemap::Preset::default(),1452 tonemap::Preset::default(),
1410 )1453 )
@@ -1453,6 +1496,7 @@ mod tests {
1453 0,1496 0,
1454 u32::MAX,1497 u32::MAX,
1455 ColorParams::default(),1498 ColorParams::default(),
1499+ TransformParams::default(),
1456 Composer::passthrough(),1500 Composer::passthrough(),
1457 tonemap::Preset::default(),1501 tonemap::Preset::default(),
1458 Speed::NORMAL,1502 Speed::NORMAL,
@@ -1536,6 +1580,7 @@ mod tests {
1536 0,1580 0,
1537 u32::MAX,1581 u32::MAX,
1538 ColorParams::default(),1582 ColorParams::default(),
1583+ TransformParams::default(),
1539 Composer::passthrough(),1584 Composer::passthrough(),
1540 tonemap::Preset::default(),1585 tonemap::Preset::default(),
1541 )1586 )
crates/engine/src/export.rsmodified+38 -3
@@ -82,6 +82,7 @@ use crate::project::{Lane, LaneKind, Project, Rate};
82 use crate::scale::{blend_i420, Composer};82 use crate::scale::{blend_i420, Composer};
83 use crate::subtitle::{Cue, SubtitleTrack};83 use crate::subtitle::{Cue, SubtitleTrack};
84 use crate::tonemap::{self, ToneMapper};84 use crate::tonemap::{self, ToneMapper};
85+use crate::transform::TransformParams;
85 86
86 /// Progress is reported in permille: an atomic integer the render loop can read87 /// Progress is reported in permille: an atomic integer the render loop can read
87 /// without a lock, fine enough for any progress bar.88 /// without a lock, fine enough for any progress bar.
@@ -1083,8 +1084,10 @@ struct Dissolve<'a> {
1083 mapper: Option<&'a ToneMapper>,1084 mapper: Option<&'a ToneMapper>,
1084 remap: Option<(Matrix, Matrix)>,1085 remap: Option<(Matrix, Matrix)>,
1085 grade: Option<crate::color::ColorParams>,1086 grade: Option<crate::color::ColorParams>,
1087+ transform: TransformParams,
1086 canvas: Composer,1088 canvas: Composer,
1087 graded: (Vec<u8>, Vec<u8>, Vec<u8>),1089 graded: (Vec<u8>, Vec<u8>, Vec<u8>),
1090+ transformed: (Vec<u8>, Vec<u8>, Vec<u8>),
1088 }1091 }
1089 1092
1090 /// The track's cues where the *exported* timeline puts them, which is the only1093 /// The track's cues where the *exported* timeline puts them, which is the only
@@ -1643,6 +1646,14 @@ impl CopyPlan {
1643 {1646 {
1644 return None;1647 return None;
1645 }1648 }
1649+ // A moved, scaled, rotated or cropped clip is a different picture
1650+ // than the source's own packets, exactly as a grade is.
1651+ if project
1652+ .composite_transform_at(span.start)
1653+ .is_some_and(|params| !params.is_identity())
1654+ {
1655+ return None;
1656+ }
1646 let path = &entries.get(source)?.path;1657 let path = &entries.get(source)?.path;
1647 if sources.get(source)?.is_none() {1658 if sources.get(source)?.is_none() {
1648 if !crate::demux::is_matroska(path) {1659 if !crate::demux::is_matroska(path) {
@@ -2537,6 +2548,9 @@ fn run(
2537 && project2548 && project
2538 .composite_color_at(span.start)2549 .composite_color_at(span.start)
2539 .is_none_or(|params| params.is_identity())2550 .is_none_or(|params| params.is_identity())
2551+ && project
2552+ .composite_transform_at(span.start)
2553+ .is_none_or(|params| params.is_identity())
2540 && dissolve.is_none();2554 && dissolve.is_none();
2541 let want = untouched.then(|| encoder.dma_want(meta)).flatten();2555 let want = untouched.then(|| encoder.dma_want(meta)).flatten();
2542 // Opened at the file's own frame, which is the only place the2556 // Opened at the file's own frame, which is the only place the
@@ -2566,7 +2580,12 @@ fn run(
2566 // is touched. Scratch outside the frame loop: it is refilled per frame2580 // is touched. Scratch outside the frame loop: it is refilled per frame
2567 // and its allocation survives the whole span.2581 // and its allocation survives the whole span.
2568 let grade = project.composite_color_at(span.start).copied();2582 let grade = project.composite_color_at(span.start).copied();
2583+ let transform = project
2584+ .composite_transform_at(span.start)
2585+ .copied()
2586+ .unwrap_or_default();
2569 let mut graded = (Vec::new(), Vec::new(), Vec::new());2587 let mut graded = (Vec::new(), Vec::new(), Vec::new());
2588+ let mut transformed = (Vec::new(), Vec::new(), Vec::new());
2570 // ...and the canvas it is placed on, which is where a source of another2589 // ...and the canvas it is placed on, which is where a source of another
2571 // resolution becomes a picture at the project's. The same `Composer`2590 // resolution becomes a picture at the project's. The same `Composer`
2572 // playback composes with, given the same policy, so an export is what2591 // playback composes with, given the same policy, so an export is what
@@ -2595,12 +2614,17 @@ fn run(
2595 mapper: b_mapper,2614 mapper: b_mapper,
2596 remap: b_remap,2615 remap: b_remap,
2597 grade: project.composite_color_at(b_start).copied(),2616 grade: project.composite_color_at(b_start).copied(),
2617+ transform: project
2618+ .composite_transform_at(b_start)
2619+ .copied()
2620+ .unwrap_or_default(),
2598 canvas: Composer::new(2621 canvas: Composer::new(
2599 meta.width,2622 meta.width,
2600 meta.height,2623 meta.height,
2601 project.composite_fit_at(b_start),2624 project.composite_fit_at(b_start),
2602 ),2625 ),
2603 graded: (Vec::new(), Vec::new(), Vec::new()),2626 graded: (Vec::new(), Vec::new(), Vec::new()),
2627+ transformed: (Vec::new(), Vec::new(), Vec::new()),
2604 })2628 })
2605 })2629 })
2606 .transpose()?;2630 .transpose()?;
@@ -2688,9 +2712,11 @@ fn run(
2688 width,2712 width,
2689 height,2713 height,
2690 grade,2714 grade,
2715+ transform,
2691 remap,2716 remap,
2692 mapper,2717 mapper,
2693 &mut graded,2718 &mut graded,
2719+ &mut transformed,
2694 &mut canvas,2720 &mut canvas,
2695 )),2721 )),
2696 };2722 };
@@ -2718,8 +2744,9 @@ fn run(
2718 }2744 }
2719 Some(Frame::Pixels(by, bu, bv, bw, bh)) => {2745 Some(Frame::Pixels(by, bu, bv, bw, bh)) => {
2720 let (by, bu, bv, _, _) = place_picture(2746 let (by, bu, bv, _, _) = place_picture(
2721- by, bu, bv, bw, bh, d.grade, d.remap, d.mapper,2747+ by, bu, bv, bw, bh, d.grade, d.transform, d.remap,
2722- &mut d.graded, &mut d.canvas,2748+ d.mapper, &mut d.graded, &mut d.transformed,
2749+ &mut d.canvas,
2723 );2750 );
2724 let idx_in_window = done_here + r - d.tail_start;2751 let idx_in_window = done_here + r - d.tail_start;
2725 let t = dissolve_weight(idx_in_window, d.window);2752 let t = dissolve_weight(idx_in_window, d.window);
@@ -2854,9 +2881,11 @@ fn place_picture<'a>(
2854 width: u32,2881 width: u32,
2855 height: u32,2882 height: u32,
2856 grade: Option<crate::color::ColorParams>,2883 grade: Option<crate::color::ColorParams>,
2884+ transform: TransformParams,
2857 remap: Option<(Matrix, Matrix)>,2885 remap: Option<(Matrix, Matrix)>,
2858 mapper: Option<&ToneMapper>,2886 mapper: Option<&ToneMapper>,
2859 graded: &'a mut (Vec<u8>, Vec<u8>, Vec<u8>),2887 graded: &'a mut (Vec<u8>, Vec<u8>, Vec<u8>),
2888+ transformed: &'a mut (Vec<u8>, Vec<u8>, Vec<u8>),
2860 canvas: &'a mut Composer,2889 canvas: &'a mut Composer,
2861 ) -> (&'a [u8], &'a [u8], &'a [u8], u32, u32) {2890 ) -> (&'a [u8], &'a [u8], &'a [u8], u32, u32) {
2862 // The planes are borrowed from the decoder (and `Black::picture` hands the2891 // The planes are borrowed from the decoder (and `Black::picture` hands the
@@ -2891,7 +2920,13 @@ fn place_picture<'a>(
2891 };2920 };
2892 // Grade first, place second: the grade is the clip's own pixels and the2921 // Grade first, place second: the grade is the clip's own pixels and the
2893 // bars around them are not the clip (see `scale::Composer`).2922 // bars around them are not the clip (see `scale::Composer`).
2894- canvas.place(y, u, v, width, height)2923+ if transform.is_identity() {
2924+ canvas.place(y, u, v, width, height)
2925+ } else {
2926+ let (py, pu, pv, w, h) = canvas.place_transformed(y, u, v, width, height, &transform);
2927+ *transformed = (py, pu, pv);
2928+ (&transformed.0[..], &transformed.1[..], &transformed.2[..], w, h)
2929+ }
2895 }2930 }
2896 2931
2897 /// Which matrix pair a span's samples are rewritten by on the way into a file2932 /// Which matrix pair a span's samples are rewritten by on the way into a file
crates/engine/src/playback.rsmodified+17 -0
@@ -28,6 +28,7 @@ use crate::demux::{Codec, Demuxer, VideoMeta};
28 use crate::eq::EqParams;28 use crate::eq::EqParams;
29 use crate::project::{Clip, Edge, Lane, LaneKind, Project, Rate, Source, Span, Speed, SubClip};29 use crate::project::{Clip, Edge, Lane, LaneKind, Project, Rate, Source, Span, Speed, SubClip};
30 use crate::scale::{Composer, FitPolicy};30 use crate::scale::{Composer, FitPolicy};
31+use crate::transform::TransformParams;
31 32
32 /// How long the feeder waits out a full ring. The ring holds a second, so this33 /// How long the feeder waits out a full ring. The ring holds a second, so this
33 /// only has to be short next to that; it costs one wakeup per 10 ms of audio.34 /// only has to be short next to that; it costs one wakeup per 10 ms of audio.
@@ -510,6 +511,7 @@ impl PlaybackSession {
510 0,511 0,
511 u32::MAX,512 u32::MAX,
512 ColorParams::default(),513 ColorParams::default(),
514+ TransformParams::default(),
513 Composer::passthrough(),515 Composer::passthrough(),
514 // The default rendition: a file just opened is a project nobody has516 // The default rendition: a file just opened is a project nobody has
515 // picked one for, exactly as it is a project nobody has graded.517 // picked one for, exactly as it is a project nobody has graded.
@@ -738,6 +740,7 @@ impl PlaybackSession {
738 0,740 0,
739 span.map_or(1, |s| s.len),741 span.map_or(1, |s| s.len),
740 ColorParams::default(),742 ColorParams::default(),
743+ TransformParams::default(),
741 Composer::passthrough(),744 Composer::passthrough(),
742 )?;745 )?;
743 Ok(Self {746 Ok(Self {
@@ -870,6 +873,7 @@ impl PlaybackSession {
870 0,873 0,
871 1,874 1,
872 ColorParams::default(),875 ColorParams::default(),
876+ TransformParams::default(),
873 Composer::passthrough(),877 Composer::passthrough(),
874 )?;878 )?;
875 (meta, stream)879 (meta, stream)
@@ -879,6 +883,7 @@ impl PlaybackSession {
879 0,883 0,
880 u32::MAX,884 u32::MAX,
881 ColorParams::default(),885 ColorParams::default(),
886+ TransformParams::default(),
882 Composer::passthrough(),887 Composer::passthrough(),
883 // The saved rendition, from the document rather than from the888 // The saved rendition, from the document rather than from the
884 // project (which is built below): this placeholder is what the889 // project (which is built below): this placeholder is what the
@@ -1603,6 +1608,10 @@ impl PlaybackSession {
1603 .composite_color_at(start)1608 .composite_color_at(start)
1604 .copied()1609 .copied()
1605 .unwrap_or_default(),1610 .unwrap_or_default(),
1611+ self.project
1612+ .composite_transform_at(start)
1613+ .copied()
1614+ .unwrap_or_default(),
1606 Composer::new(1615 Composer::new(
1607 self.meta.width,1616 self.meta.width,
1608 self.meta.height,1617 self.meta.height,
@@ -1646,6 +1655,11 @@ impl PlaybackSession {
1646 .composite_color_at(start)1655 .composite_color_at(start)
1647 .copied()1656 .copied()
1648 .unwrap_or_default();1657 .unwrap_or_default();
1658+ let transform = self
1659+ .project
1660+ .composite_transform_at(start)
1661+ .copied()
1662+ .unwrap_or_default();
1649 // ...and the canvas it is placed on: the project's resolution1663 // ...and the canvas it is placed on: the project's resolution
1650 // and this clip's own fit policy, constant across the span for1664 // and this clip's own fit policy, constant across the span for
1651 // the reason the grade is. Built where it is handed over rather1665 // the reason the grade is. Built where it is handed over rather
@@ -1684,6 +1698,7 @@ impl PlaybackSession {
1684 start_frame,1698 start_frame,
1685 end_frame,1699 end_frame,
1686 color,1700 color,
1701+ transform,
1687 canvas(),1702 canvas(),
1688 tone,1703 tone,
1689 decode_speed,1704 decode_speed,
@@ -1698,6 +1713,7 @@ impl PlaybackSession {
1698 start_frame,1713 start_frame,
1699 end_frame,1714 end_frame,
1700 color,1715 color,
1716+ transform,
1701 canvas(),1717 canvas(),
1702 tone,1718 tone,
1703 decode_speed,1719 decode_speed,
@@ -3578,6 +3594,7 @@ fn matches_timeline(
3578 0,3594 0,
3579 0,3595 0,
3580 ColorParams::default(),3596 ColorParams::default(),
3597+ TransformParams::default(),
3581 Composer::passthrough(),3598 Composer::passthrough(),
3582 // A zero-length range decodes nothing, so no table is built and the3599 // A zero-length range decodes nothing, so no table is built and the
3583 // rendition cannot matter here.3600 // rendition cannot matter here.