1#[cfg(feature = "file")]
10use std::path::Path;
11use std::sync::Arc;
12
13use tokio_util::sync::{CancellationToken, WaitForCancellationFutureOwned};
14#[cfg(feature = "capture")]
15use tracing::info;
16use tracing::{debug, warn};
17
18#[cfg(feature = "file")]
19pub use self::media_file::{AudioInfo, MediaFile, MediaInfo, VideoFileConfig, VideoInfo};
20#[cfg(all(target_os = "linux", feature = "rpicam"))]
21pub use self::rpicam::RpicamConfig;
22pub use self::{
23 sender::{Demand, DemandGuard, FrameSender, PcmFanout, WeakPcmFanout},
24 switch::VideoSwitch,
25};
26use crate::{
27 Error, audio,
28 frames::{FrameReader, FrameSlot, VideoFrames},
29 video,
30};
31
32#[cfg(feature = "capture")]
33mod capture;
34#[cfg(feature = "file")]
35mod file;
36#[cfg(feature = "pattern")]
37mod generator;
38#[cfg(feature = "file")]
39mod media_file;
40#[cfg(all(target_os = "linux", feature = "rpicam"))]
41mod rpicam;
42mod scaled;
43mod sender;
44mod switch;
45
46const PCM_BUFFER: usize = 100;
51
52#[derive(Debug, Clone, Copy, PartialEq, Eq)]
54pub struct VideoFormat {
55 pub size: video::Size,
57 pub rate: video::FrameRate,
59}
60
61#[derive(Debug, Clone, Copy, PartialEq, Eq)]
65pub struct AudioFormat {
66 pub sample_rate: u32,
68 pub layout: audio::Layout,
70}
71
72#[derive(Debug)]
74enum Driver {
75 Thread,
77 #[cfg(any(feature = "capture", all(target_os = "linux", feature = "rpicam")))]
79 Local(crate::local_task::LocalTask),
80 #[cfg(feature = "capture")]
82 Camera(capture::Camera),
83 Pushed,
85 Derived {
87 input: VideoSource,
88 _task: n0_future::task::AbortOnDropHandle<()>,
89 },
90}
91
92#[derive(Debug)]
94struct VideoInner {
95 label: String,
96 format: VideoFormat,
97 frames: FrameReader,
98 demand: Demand,
99 stop: CancellationToken,
100 driver: Driver,
101}
102
103impl Drop for VideoInner {
104 fn drop(&mut self) {
105 self.stop.cancel();
106 }
107}
108
109#[derive(Debug, Clone)]
115pub struct VideoSource {
116 inner: Arc<VideoInner>,
117}
118
119#[cfg(feature = "capture")]
128#[must_use]
129pub fn screen_source() -> video::capture::Source {
130 #[cfg(all(target_os = "linux", feature = "pipewire"))]
131 if std::env::var_os("WAYLAND_DISPLAY").is_some() {
132 use video::capture::portal::{Kind, Selection};
133 return video::capture::Source::Portal(Selection::new(Kind::Screen));
134 }
135 video::capture::Source::Display(video::capture::DisplaySelection::default())
136}
137
138impl VideoSource {
139 fn new(
140 label: impl Into<String>,
141 format: VideoFormat,
142 frames: FrameReader,
143 stop: CancellationToken,
144 driver: Driver,
145 ) -> Self {
146 Self::with_demand(label, format, frames, stop, driver, Demand::default())
147 }
148
149 fn with_demand(
151 label: impl Into<String>,
152 format: VideoFormat,
153 frames: FrameReader,
154 stop: CancellationToken,
155 driver: Driver,
156 demand: Demand,
157 ) -> Self {
158 Self {
159 inner: Arc::new(VideoInner {
160 label: label.into(),
161 format,
162 frames,
163 demand,
164 stop,
165 driver,
166 }),
167 }
168 }
169
170 #[cfg(feature = "capture")]
208 pub async fn capture(config: video::capture::Config) -> Result<Self, Error> {
209 if matches!(config.source, video::capture::Source::Camera(_)) {
210 capture::settle().await;
211 }
212 #[cfg(all(target_os = "linux", feature = "pipewire"))]
213 let mut config = config;
214 #[cfg(all(target_os = "linux", feature = "pipewire"))]
215 if let Some(preferred) = capture::pipewire_default(&config.source) {
216 let mut pipewire = config.clone();
217 pipewire.source = preferred;
218 match Self::capture_device(pipewire).await {
219 Ok(source) => return Ok(source),
220 Err(err) if !capture::falls_back(&config.source, &err) => return Err(err),
221 Err(err) => info!(
222 error = format_args!("{err:#}"),
223 source = ?config.source,
224 "PipeWire did not open the default source, trying the fallback"
225 ),
226 }
227 config.source = capture::fallback(config.source);
228 }
229 Self::capture_device(config).await
230 }
231
232 #[cfg(feature = "capture")]
242 pub async fn camera(id: Option<String>) -> Result<Self, Error> {
243 let mut config = video::capture::Config::default();
244 config.source = video::capture::Source::Camera(id);
245 Self::capture(config).await
246 }
247
248 #[cfg(feature = "capture")]
262 pub async fn screen() -> Result<Self, Error> {
263 let mut config = video::capture::Config::default();
264 config.source = screen_source();
265 Self::capture(config).await
266 }
267
268 #[cfg(feature = "capture")]
270 async fn capture_device(config: video::capture::Config) -> Result<Self, Error> {
271 let slot = FrameSlot::new();
272 let reader = slot.reader();
273 let stop = CancellationToken::new();
274 let (format, driver) = capture::open(config, slot, stop.clone()).await?;
275 Ok(Self::new("capture", format, reader, stop, driver))
276 }
277
278 #[cfg(feature = "pattern")]
287 pub fn test_pattern(size: video::Size, rate: video::FrameRate) -> Result<Self, Error> {
288 Self::spawn_generator(
289 "test-pattern",
290 VideoFormat { size, rate },
291 move |slot, stop| {
292 generator::run_pattern(size, rate, slot, stop);
293 },
294 )
295 }
296
297 #[cfg(feature = "pattern")]
307 pub fn test_gradient(size: video::Size, rate: video::FrameRate) -> Result<Self, Error> {
308 Self::spawn_generator(
309 "test-gradient",
310 VideoFormat { size, rate },
311 move |slot, stop| {
312 generator::run_gradient(size, rate, slot, stop);
313 },
314 )
315 }
316
317 #[cfg(feature = "pattern")]
326 pub fn test_bounce(size: video::Size, rate: video::FrameRate) -> Result<Self, Error> {
327 let pattern = crate::BouncePattern::new(size)?;
328 Self::spawn_generator(
329 "test-bounce",
330 VideoFormat { size, rate },
331 move |slot, stop| {
332 generator::run_bounce(&pattern, rate, slot, stop);
333 },
334 )
335 }
336
337 #[cfg(feature = "pattern")]
345 fn spawn_generator(
346 name: &'static str,
347 format: VideoFormat,
348 run: impl FnOnce(FrameSlot, CancellationToken) + Send + 'static,
349 ) -> Result<Self, Error> {
350 let slot = FrameSlot::new();
351 let reader = slot.reader();
352 let stop = CancellationToken::new();
353 let token = stop.clone();
354 std::thread::Builder::new()
355 .name(name.into())
356 .spawn(move || run(slot, token))?;
357 Ok(Self::new(name, format, reader, stop, Driver::Thread))
358 }
359
360 #[must_use]
370 pub fn push(format: VideoFormat) -> (FrameSender<video::Frame>, Self) {
371 let slot = FrameSlot::new();
372 let reader = slot.reader();
373 let stop = CancellationToken::new();
374 let source = Self::new("push", format, reader, stop.clone(), Driver::Pushed);
375 let sender = FrameSender::new(Arc::new(slot), stop, source.inner.demand.clone());
376 (sender, source)
377 }
378
379 pub fn spawn<F>(name: &str, format: VideoFormat, run: F) -> Result<Self, Error>
392 where
393 F: FnOnce(FrameSender<video::Frame>) -> Result<(), Error> + Send + 'static,
394 {
395 let slot = FrameSlot::new();
396 let stop = CancellationToken::new();
397 let source = Self::new(name, format, slot.reader(), stop.clone(), Driver::Thread);
398 let sender = FrameSender::new(Arc::new(slot.clone()), stop, source.inner.demand.clone());
399 let runtime = tokio::runtime::Builder::new_current_thread()
400 .enable_all()
401 .build()?;
402 let thread_name = name.to_string();
403 std::thread::Builder::new()
404 .name(thread_name.clone())
405 .spawn(move || {
406 let _entered = runtime.enter();
407 match run(sender) {
408 Ok(()) => debug!(source = %thread_name, "video source ended"),
409 Err(err) => {
410 warn!(source = %thread_name, error = format_args!("{err:#}"), "video source failed");
411 slot.fail(Arc::new(err));
412 }
413 }
414 })?;
415 Ok(source)
416 }
417
418 #[cfg(all(target_os = "linux", feature = "rpicam"))]
430 pub async fn rpicam(config: RpicamConfig) -> Result<Self, Error> {
431 let slot = FrameSlot::new();
432 let reader = slot.reader();
433 let stop = CancellationToken::new();
434 let (format, task) = rpicam::open_raw(config, slot, stop.clone()).await?;
435 Ok(Self::new(
436 "rpicam",
437 format,
438 reader,
439 stop,
440 Driver::Local(task),
441 ))
442 }
443
444 #[must_use]
451 pub fn frames(&self) -> VideoFrames {
452 self.observe().wanting(self.want())
453 }
454
455 #[must_use]
462 pub fn observe(&self) -> VideoFrames {
463 self.inner.frames.frames()
464 }
465
466 #[must_use]
472 pub fn format(&self) -> VideoFormat {
473 self.inner.format
474 }
475
476 #[doc(hidden)]
482 pub fn want(&self) -> DemandGuard {
483 self.inner.demand.acquire()
484 }
485
486 #[must_use]
488 pub fn failure(&self) -> Option<Arc<Error>> {
489 self.inner.frames.failure()
490 }
491
492 #[must_use]
494 pub fn label(&self) -> &str {
495 &self.inner.label
496 }
497
498 pub fn released(&self) -> WaitForCancellationFutureOwned {
507 match &self.inner.driver {
508 #[cfg(any(feature = "capture", all(target_os = "linux", feature = "rpicam")))]
509 Driver::Local(task) => task.released().cancelled_owned(),
510 #[cfg(feature = "capture")]
511 Driver::Camera(camera) => camera.released().cancelled_owned(),
512 Driver::Derived { input, .. } => input.released(),
513 Driver::Thread | Driver::Pushed => {
514 let released = CancellationToken::new();
515 released.cancel();
516 released.cancelled_owned()
517 }
518 }
519 }
520}
521
522#[cfg(all(target_os = "linux", feature = "rpicam"))]
532pub fn rpicam_h264(config: RpicamConfig) -> Result<crate::EncodedVideo, Error> {
533 rpicam::open_encoded(config).map(crate::EncodedVideo::AnnexB)
534}
535
536#[derive(Debug, Clone, Copy, PartialEq, Eq)]
538pub enum FileEnd {
539 Stop,
541 Restart,
543}
544
545impl FileEnd {
546 #[must_use]
548 pub fn looping(looping: bool) -> Self {
549 if looping { Self::Restart } else { Self::Stop }
550 }
551}
552
553#[derive(Debug)]
555pub enum AudioKind {
556 #[cfg(feature = "capture")]
558 Microphone(audio::capture::Config),
559 Pcm {
564 format: AudioFormat,
566 fanout: WeakPcmFanout,
568 },
569}
570
571#[derive(Debug)]
573struct AudioInner {
574 label: &'static str,
575 kind: AudioKind,
576 demand: Demand,
577 stop: CancellationToken,
578 _driver: Driver,
579}
580
581impl Drop for AudioInner {
582 fn drop(&mut self) {
583 self.stop.cancel();
584 }
585}
586
587#[derive(Debug, Clone)]
593pub struct AudioSource {
594 inner: Arc<AudioInner>,
595}
596
597impl AudioSource {
598 fn new(label: &'static str, kind: AudioKind, stop: CancellationToken, driver: Driver) -> Self {
599 Self {
600 inner: Arc::new(AudioInner {
601 label,
602 kind,
603 demand: Demand::default(),
604 stop,
605 _driver: driver,
606 }),
607 }
608 }
609
610 #[doc(hidden)]
613 pub fn want(&self) -> DemandGuard {
614 self.inner.demand.acquire()
615 }
616
617 #[cfg(feature = "capture")]
636 pub async fn microphone(config: audio::capture::Config) -> Result<Self, Error> {
637 if let audio::capture::Source::Microphone(wanted) = &config.source {
638 let devices = audio::capture::devices().await.map_err(Error::device)?;
639 let found = match wanted {
640 Some(id) => devices.iter().any(|device| &device.id == id),
641 None => !devices.is_empty(),
642 };
643 if !found {
644 return Err(Error::device_msg(match wanted {
645 Some(id) => format!("no microphone with the id {id}"),
646 None => "this machine has no microphone".to_string(),
647 }));
648 }
649 }
650 #[cfg(feature = "aec")]
651 let echo_cancellation = config.aec.is_some();
652 #[cfg(not(feature = "aec"))]
653 let echo_cancellation = false;
654 info!(source = ?config.source, echo_cancellation, "microphone ready");
655 Ok(Self::microphone_unchecked(config))
656 }
657
658 #[cfg(feature = "capture")]
662 #[must_use]
663 pub fn microphone_unchecked(config: audio::capture::Config) -> Self {
664 Self::new(
665 "microphone",
666 AudioKind::Microphone(config),
667 CancellationToken::new(),
668 Driver::Pushed,
669 )
670 }
671
672 #[cfg(feature = "file")]
686 pub async fn file(path: impl AsRef<Path>, at_end: FileEnd) -> Result<Self, Error> {
687 let path = path.as_ref().to_path_buf();
688 if media_file::is_mp4(&path).await {
689 return MediaFile::open(&path).await?.with_end(at_end).audio();
690 }
691 let probed = path.clone();
692 let format = tokio::task::spawn_blocking(move || file::probe(&probed))
693 .await
694 .map_err(|err| Error::device_msg(format!("the file reader failed: {err}")))??;
695 Self::spawn("audio-file", format, move |sender| {
696 file::decode_loop(&path, at_end, &sender)
697 })
698 }
699
700 #[cfg(feature = "pattern")]
706 pub fn tone(hz: f32, layout: audio::Layout) -> Result<Self, Error> {
707 Self::generated("tone", f64::from(hz), layout, generator::Gate::Continuous)
708 }
709
710 #[cfg(feature = "pattern")]
719 pub fn test_pattern(layout: audio::Layout) -> Result<Self, Error> {
720 Self::generated("test-pattern", generator::BEEP_HZ, layout, generator::BEEP)
721 }
722
723 #[cfg(feature = "pattern")]
725 fn generated(
726 name: &'static str,
727 hz: f64,
728 layout: audio::Layout,
729 gate: generator::Gate,
730 ) -> Result<Self, Error> {
731 let format = AudioFormat {
732 sample_rate: generator::TONE_RATE,
733 layout,
734 };
735 Self::spawn(name, format, move |sender| {
736 generator::run_tone(hz, format, gate, &sender);
737 Ok(())
738 })
739 }
740
741 #[must_use]
748 pub fn push(format: AudioFormat) -> (FrameSender<audio::Frame>, Self) {
749 Self::pcm("push", format, Driver::Pushed)
750 }
751
752 pub fn spawn<F>(name: &'static str, format: AudioFormat, run: F) -> Result<Self, Error>
763 where
764 F: FnOnce(FrameSender<audio::Frame>) -> Result<(), Error> + Send + 'static,
765 {
766 let (sender, source) = Self::pcm(name, format, Driver::Thread);
767 std::thread::Builder::new()
768 .name(name.into())
769 .spawn(move || match run(sender) {
770 Ok(()) => debug!(source = name, "audio source ended"),
771 Err(err) => {
772 warn!(
773 source = name,
774 error = format_args!("{err:#}"),
775 "audio source failed"
776 );
777 }
778 })?;
779 Ok(source)
780 }
781
782 fn pcm(
784 label: &'static str,
785 format: AudioFormat,
786 driver: Driver,
787 ) -> (FrameSender<audio::Frame>, Self) {
788 let (fanout, _) = tokio::sync::broadcast::channel(PCM_BUFFER);
789 let stop = CancellationToken::new();
790 let kind = AudioKind::Pcm {
791 format,
792 fanout: fanout.downgrade(),
793 };
794 let source = Self::new(label, kind, stop.clone(), driver);
795 let sender = FrameSender::new(Arc::new(fanout), stop, source.inner.demand.clone());
796 (sender, source)
797 }
798
799 #[doc(hidden)]
802 #[must_use]
803 pub fn kind(&self) -> &AudioKind {
804 &self.inner.kind
805 }
806
807 #[must_use]
811 pub fn format(&self) -> Option<AudioFormat> {
812 match &self.inner.kind {
813 AudioKind::Pcm { format, .. } => Some(*format),
814 #[cfg(feature = "capture")]
815 AudioKind::Microphone(_) => None,
816 }
817 }
818
819 #[must_use]
821 pub fn label(&self) -> &str {
822 self.inner.label
823 }
824}
825
826#[cfg(all(test, any(feature = "pattern", feature = "file")))]
827impl AudioSource {
828 pub(crate) fn subscribe_pcm(&self) -> Option<tokio::sync::broadcast::Receiver<audio::Frame>> {
830 match &self.inner.kind {
831 AudioKind::Pcm { fanout, .. } => fanout.upgrade().map(|fanout| fanout.subscribe()),
832 #[cfg(feature = "capture")]
833 AudioKind::Microphone(_) => None,
834 }
835 }
836}
837
838#[cfg(any(feature = "pattern", feature = "file"))]
843fn sleep_until(due: std::time::Instant, closed: impl Fn() -> bool) -> bool {
844 loop {
845 if closed() {
846 return false;
847 }
848 let left = due.saturating_duration_since(std::time::Instant::now());
849 if left.is_zero() {
850 return true;
851 }
852 std::thread::sleep(left.min(std::time::Duration::from_millis(50)));
853 }
854}
855
856#[cfg(any(feature = "capture", all(target_os = "linux", feature = "rpicam")))]
858pub(crate) const FIRST_FRAME_PATIENCE: std::time::Duration = std::time::Duration::from_secs(30);
859
860#[cfg(test)]
861mod tests {
862 #[cfg(feature = "pattern")]
863 use std::time::Duration;
864
865 use super::*;
866
867 fn rate(fps: u32) -> video::FrameRate {
868 video::FrameRate::new(fps, 1).expect("a valid rate")
869 }
870
871 #[cfg(feature = "pattern")]
872 #[tokio::test]
873 async fn a_test_pattern_produces_frames_and_stops_with_its_source() {
874 let source = VideoSource::test_pattern(video::Size::new(64, 48), rate(30))
875 .expect("the pattern thread starts");
876 let mut frames = source.frames();
877 let first = tokio::time::timeout(Duration::from_secs(5), frames.next())
878 .await
879 .expect("the pattern draws")
880 .expect("the pattern runs");
881 assert_eq!(first.size(), video::Size::new(64, 48));
882 drop(source);
883 let ended = tokio::time::timeout(Duration::from_secs(5), async {
884 while frames.next().await.is_some() {}
885 })
886 .await;
887 assert!(ended.is_ok(), "the pattern kept running without its source");
888 }
889
890 #[tokio::test]
891 async fn a_pushed_source_ends_when_its_senders_go() {
892 let format = VideoFormat {
893 size: video::Size::new(2, 2),
894 rate: rate(30),
895 };
896 let (sender, source) = VideoSource::push(format);
897 let mut frames = source.frames();
898 let surface = video::Surface::rgba(&[0; 16], format.size).expect("2x2");
899 sender
900 .push(video::Frame::new(
901 moq_net::Timestamp::from_micros(0).expect("0"),
902 surface,
903 ))
904 .expect("open");
905 assert!(frames.next().await.is_some());
906 drop(sender);
907 assert!(frames.next().await.is_none());
908 }
909
910 #[tokio::test]
911 async fn a_source_without_a_device_is_released_at_once() {
912 let (_sender, source) = VideoSource::push(VideoFormat {
913 size: video::Size::new(2, 2),
914 rate: rate(30),
915 });
916 source.released().await;
918 }
919
920 #[tokio::test]
921 async fn a_pushed_source_reports_demand_while_something_wants_it() {
922 let format = VideoFormat {
923 size: video::Size::new(2, 2),
924 rate: rate(30),
925 };
926 let (sender, source) = VideoSource::push(format);
927 let demand = sender.demand();
928 assert!(!*demand.borrow());
929 let wanted = source.want();
930 assert!(*demand.borrow());
931 drop(wanted);
932 assert!(!*demand.borrow());
933
934 let _observed = source.observe();
935 assert!(!*demand.borrow(), "an observer is not demand");
936 let frames = source.frames();
937 let clone = frames.clone();
938 assert!(*demand.borrow(), "a frames reader is demand");
939 drop(frames);
940 assert!(*demand.borrow(), "the clone still wants frames");
941 drop(clone);
942 assert!(!*demand.borrow());
943 drop(source);
944 assert!(sender.is_closed());
945 }
946
947 #[tokio::test]
949 async fn a_frames_reader_gets_frames_from_a_source_that_waits_for_demand() {
950 let format = VideoFormat {
951 size: video::Size::new(2, 2),
952 rate: rate(30),
953 };
954 let (sender, source) = VideoSource::push(format);
955 let producer = tokio::spawn(async move {
956 sender
957 .demand()
958 .wait_for(|wanted| *wanted)
959 .await
960 .expect("the source is open");
961 let surface = video::Surface::rgba(&[0; 16], format.size).expect("2x2");
962 let timestamp = moq_net::Timestamp::from_micros(7).expect("in range");
963 sender.push(video::Frame::new(timestamp, surface))
964 });
965 let mut frames = source.frames();
966 let frame = tokio::time::timeout(std::time::Duration::from_secs(5), frames.next())
967 .await
968 .expect("the source produced for the reader")
969 .expect("the source is open");
970 assert_eq!(frame.timestamp.as_micros(), Ok(7));
971 producer.await.expect("joined").expect("pushed");
972 }
973
974 #[tokio::test]
975 async fn a_spawned_source_that_fails_reports_why() {
976 let format = VideoFormat {
977 size: video::Size::new(2, 2),
978 rate: rate(30),
979 };
980 let source = VideoSource::spawn("failing", format, |_sender| {
981 Err(Error::device_msg("the camera caught fire"))
982 })
983 .expect("the thread starts");
984 let mut frames = source.frames();
985 assert!(frames.next().await.is_none());
986 let failure = source.failure().expect("the failure is kept");
987 assert!(matches!(*failure, Error::Device { .. }));
988 }
989
990 #[cfg(feature = "pattern")]
992 async fn generates_pcm(source: AudioSource, layout: audio::Layout) {
993 let (format, fanout) = match source.kind() {
994 AudioKind::Pcm { format, fanout } => (*format, fanout.clone()),
995 #[cfg(feature = "capture")]
996 AudioKind::Microphone(_) => panic!("a generated source is PCM"),
997 };
998 assert_eq!(format.sample_rate, 48_000);
999 assert_eq!(format.layout, layout);
1000 let mut frames = fanout.upgrade().expect("the generator runs").subscribe();
1001 let frame = tokio::time::timeout(Duration::from_secs(5), frames.recv())
1002 .await
1003 .expect("the generator sends")
1004 .expect("the generator runs");
1005 let sample_bytes = layout.channels() as usize * 4;
1006 assert!(!frame.data.is_empty());
1007 assert_eq!(frame.data.len() % sample_bytes, 0, "whole samples");
1008
1009 drop(source);
1010 let stopped = tokio::time::timeout(Duration::from_secs(5), async {
1011 while fanout.upgrade().is_some() {
1012 tokio::time::sleep(Duration::from_millis(10)).await;
1013 }
1014 })
1015 .await;
1016 assert!(
1017 stopped.is_ok(),
1018 "the generator kept running without its source"
1019 );
1020 }
1021
1022 #[cfg(feature = "pattern")]
1023 #[tokio::test]
1024 async fn a_tone_generates_pcm_in_its_layout_and_stops_with_its_source() {
1025 let source = AudioSource::tone(440.0, audio::Layout::Stereo).expect("the thread starts");
1026 assert_eq!(source.label(), "tone");
1027 generates_pcm(source, audio::Layout::Stereo).await;
1028 }
1029
1030 #[cfg(feature = "pattern")]
1031 #[tokio::test]
1032 async fn the_audio_test_pattern_generates_pcm_and_stops_with_its_source() {
1033 let source = AudioSource::test_pattern(audio::Layout::Mono).expect("the thread starts");
1034 assert_eq!(source.label(), "test-pattern");
1035 generates_pcm(source, audio::Layout::Mono).await;
1036 }
1037}