edith
Clone
https://git.tahinli.com/Tahinli/edith.git
0 watching0 forksRust18.3 MiBe3392c8Tahinli3 months ago529 commits
| 1 | //! Video engine: demux -> decode -> pixel convert. No UI dependencies. |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 | |
| 22 | |
| 23 | |
| 24 | |
| 25 | |
| 26 | |
| 27 | pub |
| 28 | |
| 29 | |
| 30 | pub |
| 31 | |
| 32 | |
| 33 | |
| 34 | pub use |
| 35 | |
| 36 | ; |
| 37 | pub use PlaybackClock; |
| 38 | pub use ; |
| 39 | pub use ; |
| 40 | pub use ExportHandle; |
| 41 | pub use ; |
| 42 | pub use ; |
| 43 | pub use ; |
| 44 | |
| 45 | /// Whether a path names a standalone audio file -- a source with no picture, |
| 46 | /// which belongs on the audio lane and nowhere else. Extension only, lowercased: |
| 47 | /// the decoder is what really decides, but a front-end has to know which lane a |
| 48 | /// dropped file may land on *before* anything is opened, and so does |
| 49 | /// [`PlaybackSession::import`](playback::PlaybackSession::import). |
| 50 | /// |
| 51 | /// Exactly the containers the engine's audio path reads (`audio::AudioSession`), |
| 52 | /// Opus included: `.opus` is an Ogg file symphonia's probe already reads and |
| 53 | /// `ruopus` now decodes, and `.mka` is the Matroska whose sound is all it |
| 54 | /// has. A `.dts` or a bare `.ac3` is refused by the same door that refuses a |
| 55 | /// `.txt` -- there is no reader here that opens an elementary stream -- which is |
| 56 | /// the honest answer. |
| 57 | |
| 58 | |
| 59 | |
| 60 | |
| 61 | |
| 62 | |
| 63 | |
| 64 | |
| 65 | |
| 66 | /// Whether a path names a still image -- a source with a picture and no sound |
| 67 | /// and no length of its own, which belongs on a video lane and nowhere else. |
| 68 | /// Extension only, lowercased, for [`is_audio`]'s reason: a front-end has to |
| 69 | /// know which lane a dropped file may land on before anything is opened. |
| 70 | /// |
| 71 | /// Exactly the formats `image` is built with here (see `Cargo.toml`): PNG, |
| 72 | /// JPEG and WebP. A `.gif` or a `.tif` is refused by the same door that refuses |
| 73 | /// a `.txt`, which is the honest answer until a decoder for it is compiled in. |
| 74 | |
| 75 | |
| 76 | |
| 77 | |
| 78 | |
| 79 | |
| 80 | |
| 81 | |
| 82 | |
| 83 | /// The largest picture this engine composes onto, either way: 8K, which is where |
| 84 | /// a per-frame buffer stops being a sane thing to allocate. |
| 85 | pub const MAX_RESOLUTION: u32 = 7680; |
| 86 | |
| 87 | /// Whether a project resolution is a picture at all: not zero either way, and |
| 88 | /// not past [`MAX_RESOLUTION`]. Both doors ask -- the keystroke |
| 89 | /// ([`PlaybackSession::set_resolution`](playback::PlaybackSession::set_resolution)) |
| 90 | /// and the file ([`edith::load`]) -- so a hand-written `resolution` line cannot |
| 91 | /// reach an allocation a keypress could not, which is how `4294967295` used to |
| 92 | /// panic the open with a capacity overflow. |
| 93 | |
| 94 | |
| 95 | |
| 96 | |
| 97 | /// Boxed error; the engine has few failure modes and every one of them is fatal |
| 98 | /// to the session, so a message is all a caller can act on. |
| 99 | pub type Error = ; |
| 100 | pub type Result<T> = Result; |
| 101 | |
| 102 | |
| 103 | |
| 104 | |
| 105 | |
| 106 | |
| 107 | |
| 108 | |
| 109 | |
| 110 | |
| 111 | |
| 112 | |
| 113 | |
| 114 | |
| 115 | |
| 116 | |
| 117 | |
| 118 | |
| 119 | |
| 120 | |
| 121 | |
| 122 | |
| 123 | |
| 124 | |
| 125 | |
| 126 | |
| 127 | |
| 128 | |
| 129 | |
| 130 | |
| 131 | |
| 132 | |
| 133 | |
| 134 | |
| 135 | |
| 136 | |
| 137 | |
| 138 | |
| 139 | |
| 140 | |
| 141 | |
| 142 | |
| 143 | |
| 144 | |
| 145 | |
| 146 | |
| 147 | |
| 148 | |
| 149 | |
| 150 | |
| 151 | |
| 152 | |
| 153 | |
| 154 |