1#![warn(clippy::all)]
4#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
5
6use bitflags::bitflags;
7use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
8use futures::future::{self, MaybeDone, TryFutureExt};
9use zx_status;
10
11pub type CompressionType = String;
13
14pub type EncryptionScheme = String;
15
16pub type InitVector = Vec<u8>;
17
18pub type KeyId = Vec<u8>;
19
20pub const AUDIO_ENCODING_AAC: &str = "fuchsia.media.aac";
22
23pub const AUDIO_ENCODING_AACLATM: &str = "fuchsia.media.aaclatm";
24
25pub const AUDIO_ENCODING_AMRNB: &str = "fuchsia.media.amrnb";
26
27pub const AUDIO_ENCODING_AMRWB: &str = "fuchsia.media.amrwb";
28
29pub const AUDIO_ENCODING_APTX: &str = "fuchsia.media.aptx";
30
31pub const AUDIO_ENCODING_FLAC: &str = "fuchsia.media.flac";
32
33pub const AUDIO_ENCODING_GSMMS: &str = "fuchsia.media.gsmms";
34
35pub const AUDIO_ENCODING_LPCM: &str = "fuchsia.media.lpcm";
36
37pub const AUDIO_ENCODING_MP3: &str = "fuchsia.media.mp3";
38
39pub const AUDIO_ENCODING_OPUS: &str = "fuchsia.media.opus";
40
41pub const AUDIO_ENCODING_PCMALAW: &str = "fuchsia.media.pcmalaw";
42
43pub const AUDIO_ENCODING_PCMMULAW: &str = "fuchsia.media.pcmmulaw";
44
45pub const AUDIO_ENCODING_SBC: &str = "fuchsia.media.sbc";
46
47pub const AUDIO_ENCODING_VORBIS: &str = "fuchsia.media.vorbis";
48
49pub const CAPTURE_USAGE2_COUNT: u8 = 4;
50
51pub const CAPTURE_USAGE_COUNT: u8 = 4;
52
53pub const ENCRYPTION_SCHEME_CBC1: &str = "cbc1";
54
55pub const ENCRYPTION_SCHEME_CBCS: &str = "cbcs";
56
57pub const ENCRYPTION_SCHEME_CENC: &str = "cenc";
58
59pub const ENCRYPTION_SCHEME_CENS: &str = "cens";
60
61pub const ENCRYPTION_SCHEME_UNENCRYPTED: &str = "unencrypted";
62
63pub const MAX_ENCRYPTION_SCHEME_SIZE: u32 = 100;
64
65pub const MAX_FRAMES_PER_RENDERER_PACKET: i64 = 262143;
67
68pub const MAX_INIT_VECTOR_SIZE: u32 = 16;
69
70pub const MAX_KEY_ID_SIZE: u32 = 16;
71
72pub const MAX_PCM_CHANNEL_COUNT: u32 = 8;
73
74pub const MAX_PCM_FRAMES_PER_SECOND: u32 = 192000;
75
76pub const MAX_USAGE_COUNT: u8 = 8;
80
81pub const METADATA_LABEL_ALBUM: &str = "fuchsia.media.album";
82
83pub const METADATA_LABEL_ARTIST: &str = "fuchsia.media.artist";
84
85pub const METADATA_LABEL_COMPOSER: &str = "fuchsia.media.composer";
86
87pub const METADATA_LABEL_EPISODE: &str = "fuchsia.media.episode";
88
89pub const METADATA_LABEL_GENRE: &str = "fuchsia.media.genre";
90
91pub const METADATA_LABEL_PUBLISHER: &str = "fuchsia.media.publisher";
92
93pub const METADATA_LABEL_RELEASE_DATE: &str = "fuchsia.media.release_date";
94
95pub const METADATA_LABEL_SEASON: &str = "fuchsia.media.season";
96
97pub const METADATA_LABEL_STUDIO: &str = "fuchsia.media.studio";
98
99pub const METADATA_LABEL_SUBTITLE: &str = "fuchsia.media.subtitle";
100
101pub const METADATA_LABEL_TITLE: &str = "fuchsia.media.title";
102
103pub const METADATA_LABEL_TRACK_NUMBER: &str = "fuchsia.media.track_number";
104
105pub const METADATA_SOURCE_TITLE: &str = "fuchsia.media.source_title";
108
109pub const MIN_PCM_CHANNEL_COUNT: u32 = 1;
111
112pub const MIN_PCM_FRAMES_PER_SECOND: u32 = 1000;
113
114pub const NO_TIMESTAMP: i64 = 9223372036854775807;
118
119pub const RENDER_USAGE2_COUNT: u8 = 6;
120
121pub const RENDER_USAGE_COUNT: u8 = 5;
122
123pub const STREAM_PACKET_FLAG_DISCONTINUITY: u32 = 4;
127
128pub const STREAM_PACKET_FLAG_DROPPABLE: u32 = 2;
133
134pub const STREAM_PACKET_FLAG_KEY_FRAME: u32 = 1;
138
139pub const VIDEO_ENCODING_H263: &str = "fuchsia.media.h263";
141
142pub const VIDEO_ENCODING_H264: &str = "fuchsia.media.h264";
143
144pub const VIDEO_ENCODING_MPEG4: &str = "fuchsia.media.mpeg4";
145
146pub const VIDEO_ENCODING_THEORA: &str = "fuchsia.media.theora";
147
148pub const VIDEO_ENCODING_UNCOMPRESSED: &str = "fuchsia.media.uncompressed_video";
149
150pub const VIDEO_ENCODING_VP3: &str = "fuchsia.media.vp3";
151
152pub const VIDEO_ENCODING_VP8: &str = "fuchsia.media.vp8";
153
154pub const VIDEO_ENCODING_VP9: &str = "fuchsia.media.vp9";
155
156pub const MAX_OOB_BYTES_SIZE: u64 = 8192;
157
158bitflags! {
159 #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
161 pub struct AudioConsumerStartFlags: u32 {
162 const LOW_LATENCY = 1;
164 const SUPPLY_DRIVEN = 2;
169 }
170}
171
172impl AudioConsumerStartFlags {
173 #[deprecated = "Strict bits should not use `has_unknown_bits`"]
174 #[inline(always)]
175 pub fn has_unknown_bits(&self) -> bool {
176 false
177 }
178
179 #[deprecated = "Strict bits should not use `get_unknown_bits`"]
180 #[inline(always)]
181 pub fn get_unknown_bits(&self) -> u32 {
182 0
183 }
184}
185
186bitflags! {
187 #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
188 pub struct AudioGainInfoFlags: u32 {
189 const MUTE = 1;
190 const AGC_SUPPORTED = 2;
191 const AGC_ENABLED = 4;
192 }
193}
194
195impl AudioGainInfoFlags {
196 #[deprecated = "Strict bits should not use `has_unknown_bits`"]
197 #[inline(always)]
198 pub fn has_unknown_bits(&self) -> bool {
199 false
200 }
201
202 #[deprecated = "Strict bits should not use `get_unknown_bits`"]
203 #[inline(always)]
204 pub fn get_unknown_bits(&self) -> u32 {
205 0
206 }
207}
208
209bitflags! {
210 #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
211 pub struct AudioGainValidFlags: u32 {
212 const GAIN_VALID = 1;
213 const MUTE_VALID = 2;
214 const AGC_VALID = 4;
215 }
216}
217
218impl AudioGainValidFlags {
219 #[deprecated = "Strict bits should not use `has_unknown_bits`"]
220 #[inline(always)]
221 pub fn has_unknown_bits(&self) -> bool {
222 false
223 }
224
225 #[deprecated = "Strict bits should not use `get_unknown_bits`"]
226 #[inline(always)]
227 pub fn get_unknown_bits(&self) -> u32 {
228 0
229 }
230}
231
232#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
233#[repr(u32)]
234pub enum AacAudioObjectType {
235 Mpeg2AacLc = 0,
237 Mpeg4AacLc = 1,
239}
240
241impl AacAudioObjectType {
242 #[inline]
243 pub fn from_primitive(prim: u32) -> Option<Self> {
244 match prim {
245 0 => Some(Self::Mpeg2AacLc),
246 1 => Some(Self::Mpeg4AacLc),
247 _ => None,
248 }
249 }
250
251 #[inline]
252 pub const fn into_primitive(self) -> u32 {
253 self as u32
254 }
255
256 #[deprecated = "Strict enums should not use `is_unknown`"]
257 #[inline]
258 pub fn is_unknown(&self) -> bool {
259 false
260 }
261}
262
263#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
264#[repr(u32)]
265pub enum AacChannelMode {
266 Mono = 0,
267 Stereo = 2,
268}
269
270impl AacChannelMode {
271 #[inline]
272 pub fn from_primitive(prim: u32) -> Option<Self> {
273 match prim {
274 0 => Some(Self::Mono),
275 2 => Some(Self::Stereo),
276 _ => None,
277 }
278 }
279
280 #[inline]
281 pub const fn into_primitive(self) -> u32 {
282 self as u32
283 }
284
285 #[deprecated = "Strict enums should not use `is_unknown`"]
286 #[inline]
287 pub fn is_unknown(&self) -> bool {
288 false
289 }
290}
291
292#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
297#[repr(u32)]
298pub enum AacVariableBitRate {
299 V1 = 1,
300 V2 = 2,
301 V3 = 3,
302 V4 = 4,
303 V5 = 5,
304}
305
306impl AacVariableBitRate {
307 #[inline]
308 pub fn from_primitive(prim: u32) -> Option<Self> {
309 match prim {
310 1 => Some(Self::V1),
311 2 => Some(Self::V2),
312 3 => Some(Self::V3),
313 4 => Some(Self::V4),
314 5 => Some(Self::V5),
315 _ => None,
316 }
317 }
318
319 #[inline]
320 pub const fn into_primitive(self) -> u32 {
321 self as u32
322 }
323
324 #[deprecated = "Strict enums should not use `is_unknown`"]
325 #[inline]
326 pub fn is_unknown(&self) -> bool {
327 false
328 }
329}
330
331#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
332#[repr(u32)]
333pub enum AudioBitrateMode {
334 Unspecified = 0,
335 Cbr = 1,
336 Vbr = 2,
337}
338
339impl AudioBitrateMode {
340 #[inline]
341 pub fn from_primitive(prim: u32) -> Option<Self> {
342 match prim {
343 0 => Some(Self::Unspecified),
344 1 => Some(Self::Cbr),
345 2 => Some(Self::Vbr),
346 _ => None,
347 }
348 }
349
350 #[inline]
351 pub const fn into_primitive(self) -> u32 {
352 self as u32
353 }
354
355 #[deprecated = "Strict enums should not use `is_unknown`"]
356 #[inline]
357 pub fn is_unknown(&self) -> bool {
358 false
359 }
360}
361
362#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
366#[repr(u32)]
367pub enum AudioCaptureUsage {
368 Background = 0,
372 Foreground = 1,
377 SystemAgent = 2,
382 Communication = 3,
385}
386
387impl AudioCaptureUsage {
388 #[inline]
389 pub fn from_primitive(prim: u32) -> Option<Self> {
390 match prim {
391 0 => Some(Self::Background),
392 1 => Some(Self::Foreground),
393 2 => Some(Self::SystemAgent),
394 3 => Some(Self::Communication),
395 _ => None,
396 }
397 }
398
399 #[inline]
400 pub const fn into_primitive(self) -> u32 {
401 self as u32
402 }
403
404 #[deprecated = "Strict enums should not use `is_unknown`"]
405 #[inline]
406 pub fn is_unknown(&self) -> bool {
407 false
408 }
409}
410
411#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
415pub enum AudioCaptureUsage2 {
416 Background,
420 Foreground,
424 SystemAgent,
428 Communication,
431 #[doc(hidden)]
432 __SourceBreaking { unknown_ordinal: u32 },
433}
434
435#[macro_export]
437macro_rules! AudioCaptureUsage2Unknown {
438 () => {
439 _
440 };
441}
442
443impl AudioCaptureUsage2 {
444 #[inline]
445 pub fn from_primitive(prim: u32) -> Option<Self> {
446 match prim {
447 0 => Some(Self::Background),
448 1 => Some(Self::Foreground),
449 2 => Some(Self::SystemAgent),
450 3 => Some(Self::Communication),
451 _ => None,
452 }
453 }
454
455 #[inline]
456 pub fn from_primitive_allow_unknown(prim: u32) -> Self {
457 match prim {
458 0 => Self::Background,
459 1 => Self::Foreground,
460 2 => Self::SystemAgent,
461 3 => Self::Communication,
462 unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
463 }
464 }
465
466 #[inline]
467 pub fn unknown() -> Self {
468 Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
469 }
470
471 #[inline]
472 pub const fn into_primitive(self) -> u32 {
473 match self {
474 Self::Background => 0,
475 Self::Foreground => 1,
476 Self::SystemAgent => 2,
477 Self::Communication => 3,
478 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
479 }
480 }
481
482 #[inline]
483 pub fn is_unknown(&self) -> bool {
484 match self {
485 Self::__SourceBreaking { unknown_ordinal: _ } => true,
486 _ => false,
487 }
488 }
489}
490
491#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
497#[repr(u32)]
498pub enum AudioChannelId {
499 Skip = 0,
500 Lf = 1,
501 Rf = 2,
502 Cf = 3,
503 Ls = 4,
504 Rs = 5,
505 Lfe = 6,
506 Cs = 7,
507 Lr = 8,
508 Rr = 9,
509 EndDefined = 10,
510 ExtendedChannelIdBase = 1862270976,
511 Max = 2147483647,
512}
513
514impl AudioChannelId {
515 #[inline]
516 pub fn from_primitive(prim: u32) -> Option<Self> {
517 match prim {
518 0 => Some(Self::Skip),
519 1 => Some(Self::Lf),
520 2 => Some(Self::Rf),
521 3 => Some(Self::Cf),
522 4 => Some(Self::Ls),
523 5 => Some(Self::Rs),
524 6 => Some(Self::Lfe),
525 7 => Some(Self::Cs),
526 8 => Some(Self::Lr),
527 9 => Some(Self::Rr),
528 10 => Some(Self::EndDefined),
529 1862270976 => Some(Self::ExtendedChannelIdBase),
530 2147483647 => Some(Self::Max),
531 _ => None,
532 }
533 }
534
535 #[inline]
536 pub const fn into_primitive(self) -> u32 {
537 self as u32
538 }
539
540 #[deprecated = "Strict enums should not use `is_unknown`"]
541 #[inline]
542 pub fn is_unknown(&self) -> bool {
543 false
544 }
545}
546
547#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
548#[repr(u32)]
549pub enum AudioOutputRoutingPolicy {
550 AllPluggedOutputs = 0,
551 LastPluggedOutput = 1,
552}
553
554impl AudioOutputRoutingPolicy {
555 #[inline]
556 pub fn from_primitive(prim: u32) -> Option<Self> {
557 match prim {
558 0 => Some(Self::AllPluggedOutputs),
559 1 => Some(Self::LastPluggedOutput),
560 _ => None,
561 }
562 }
563
564 #[inline]
565 pub const fn into_primitive(self) -> u32 {
566 self as u32
567 }
568
569 #[deprecated = "Strict enums should not use `is_unknown`"]
570 #[inline]
571 pub fn is_unknown(&self) -> bool {
572 false
573 }
574}
575
576#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
578#[repr(u32)]
579pub enum AudioPcmMode {
580 Linear = 0,
581 Alaw = 1,
582 Mulaw = 2,
583}
584
585impl AudioPcmMode {
586 #[inline]
587 pub fn from_primitive(prim: u32) -> Option<Self> {
588 match prim {
589 0 => Some(Self::Linear),
590 1 => Some(Self::Alaw),
591 2 => Some(Self::Mulaw),
592 _ => None,
593 }
594 }
595
596 #[inline]
597 pub const fn into_primitive(self) -> u32 {
598 self as u32
599 }
600
601 #[deprecated = "Strict enums should not use `is_unknown`"]
602 #[inline]
603 pub fn is_unknown(&self) -> bool {
604 false
605 }
606}
607
608#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
613#[repr(u32)]
614pub enum AudioRenderUsage {
615 Background = 0,
618 Media = 1,
621 Interruption = 2,
625 SystemAgent = 3,
628 Communication = 4,
631}
632
633impl AudioRenderUsage {
634 #[inline]
635 pub fn from_primitive(prim: u32) -> Option<Self> {
636 match prim {
637 0 => Some(Self::Background),
638 1 => Some(Self::Media),
639 2 => Some(Self::Interruption),
640 3 => Some(Self::SystemAgent),
641 4 => Some(Self::Communication),
642 _ => None,
643 }
644 }
645
646 #[inline]
647 pub const fn into_primitive(self) -> u32 {
648 self as u32
649 }
650
651 #[deprecated = "Strict enums should not use `is_unknown`"]
652 #[inline]
653 pub fn is_unknown(&self) -> bool {
654 false
655 }
656}
657
658#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
663pub enum AudioRenderUsage2 {
664 Background,
667 Media,
670 Interruption,
674 SystemAgent,
677 Communication,
680 Accessibility,
683 #[doc(hidden)]
684 __SourceBreaking { unknown_ordinal: u32 },
685}
686
687#[macro_export]
689macro_rules! AudioRenderUsage2Unknown {
690 () => {
691 _
692 };
693}
694
695impl AudioRenderUsage2 {
696 #[inline]
697 pub fn from_primitive(prim: u32) -> Option<Self> {
698 match prim {
699 0 => Some(Self::Background),
700 1 => Some(Self::Media),
701 2 => Some(Self::Interruption),
702 3 => Some(Self::SystemAgent),
703 4 => Some(Self::Communication),
704 5 => Some(Self::Accessibility),
705 _ => None,
706 }
707 }
708
709 #[inline]
710 pub fn from_primitive_allow_unknown(prim: u32) -> Self {
711 match prim {
712 0 => Self::Background,
713 1 => Self::Media,
714 2 => Self::Interruption,
715 3 => Self::SystemAgent,
716 4 => Self::Communication,
717 5 => Self::Accessibility,
718 unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
719 }
720 }
721
722 #[inline]
723 pub fn unknown() -> Self {
724 Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
725 }
726
727 #[inline]
728 pub const fn into_primitive(self) -> u32 {
729 match self {
730 Self::Background => 0,
731 Self::Media => 1,
732 Self::Interruption => 2,
733 Self::SystemAgent => 3,
734 Self::Communication => 4,
735 Self::Accessibility => 5,
736 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
737 }
738 }
739
740 #[inline]
741 pub fn is_unknown(&self) -> bool {
742 match self {
743 Self::__SourceBreaking { unknown_ordinal: _ } => true,
744 _ => false,
745 }
746 }
747}
748
749#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
751#[repr(u32)]
752pub enum AudioSampleFormat {
753 Unsigned8 = 1,
755 Signed16 = 2,
757 Signed24In32 = 3,
759 Float = 4,
761}
762
763impl AudioSampleFormat {
764 #[inline]
765 pub fn from_primitive(prim: u32) -> Option<Self> {
766 match prim {
767 1 => Some(Self::Unsigned8),
768 2 => Some(Self::Signed16),
769 3 => Some(Self::Signed24In32),
770 4 => Some(Self::Float),
771 _ => None,
772 }
773 }
774
775 #[inline]
776 pub const fn into_primitive(self) -> u32 {
777 self as u32
778 }
779
780 #[deprecated = "Strict enums should not use `is_unknown`"]
781 #[inline]
782 pub fn is_unknown(&self) -> bool {
783 false
784 }
785}
786
787#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
788pub enum Behavior {
789 None,
791 Duck,
793 Mute,
795 #[doc(hidden)]
796 __SourceBreaking { unknown_ordinal: u32 },
797}
798
799#[macro_export]
801macro_rules! BehaviorUnknown {
802 () => {
803 _
804 };
805}
806
807impl Behavior {
808 #[inline]
809 pub fn from_primitive(prim: u32) -> Option<Self> {
810 match prim {
811 0 => Some(Self::None),
812 1 => Some(Self::Duck),
813 2 => Some(Self::Mute),
814 _ => None,
815 }
816 }
817
818 #[inline]
819 pub fn from_primitive_allow_unknown(prim: u32) -> Self {
820 match prim {
821 0 => Self::None,
822 1 => Self::Duck,
823 2 => Self::Mute,
824 unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
825 }
826 }
827
828 #[inline]
829 pub fn unknown() -> Self {
830 Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
831 }
832
833 #[inline]
834 pub const fn into_primitive(self) -> u32 {
835 match self {
836 Self::None => 0,
837 Self::Duck => 1,
838 Self::Mute => 2,
839 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
840 }
841 }
842
843 #[inline]
844 pub fn is_unknown(&self) -> bool {
845 match self {
846 Self::__SourceBreaking { unknown_ordinal: _ } => true,
847 _ => false,
848 }
849 }
850}
851
852#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
855pub enum CodecProfile {
856 H264ProfileBaseline,
857 H264ProfileMain,
858 H264ProfileExtended,
859 H264ProfileHigh,
860 H264ProfileHigh10Profile,
861 H264ProfileHigh422Profile,
862 H264ProfileHigh444Predictiveprofile,
863 H264ProfileScalablebaseline,
864 H264ProfileScalablehigh,
865 H264ProfileStereohigh,
866 H264ProfileMultiviewhigh,
867 Vp8ProfileAny,
868 Vp9ProfileProfile0,
869 Vp9ProfileProfile1,
870 Vp9ProfileProfile2,
871 Vp9ProfileProfile3,
872 HevcprofileMain,
873 HevcprofileMain10,
874 HevcprofileMainStillPicture,
875 MjpegBaseline,
876 #[doc(hidden)]
877 __SourceBreaking {
878 unknown_ordinal: u32,
879 },
880}
881
882#[macro_export]
884macro_rules! CodecProfileUnknown {
885 () => {
886 _
887 };
888}
889
890impl CodecProfile {
891 #[inline]
892 pub fn from_primitive(prim: u32) -> Option<Self> {
893 match prim {
894 0 => Some(Self::H264ProfileBaseline),
895 1 => Some(Self::H264ProfileMain),
896 2 => Some(Self::H264ProfileExtended),
897 3 => Some(Self::H264ProfileHigh),
898 4 => Some(Self::H264ProfileHigh10Profile),
899 5 => Some(Self::H264ProfileHigh422Profile),
900 6 => Some(Self::H264ProfileHigh444Predictiveprofile),
901 7 => Some(Self::H264ProfileScalablebaseline),
902 8 => Some(Self::H264ProfileScalablehigh),
903 9 => Some(Self::H264ProfileStereohigh),
904 10 => Some(Self::H264ProfileMultiviewhigh),
905 11 => Some(Self::Vp8ProfileAny),
906 12 => Some(Self::Vp9ProfileProfile0),
907 13 => Some(Self::Vp9ProfileProfile1),
908 14 => Some(Self::Vp9ProfileProfile2),
909 15 => Some(Self::Vp9ProfileProfile3),
910 16 => Some(Self::HevcprofileMain),
911 17 => Some(Self::HevcprofileMain10),
912 18 => Some(Self::HevcprofileMainStillPicture),
913 19 => Some(Self::MjpegBaseline),
914 _ => None,
915 }
916 }
917
918 #[inline]
919 pub fn from_primitive_allow_unknown(prim: u32) -> Self {
920 match prim {
921 0 => Self::H264ProfileBaseline,
922 1 => Self::H264ProfileMain,
923 2 => Self::H264ProfileExtended,
924 3 => Self::H264ProfileHigh,
925 4 => Self::H264ProfileHigh10Profile,
926 5 => Self::H264ProfileHigh422Profile,
927 6 => Self::H264ProfileHigh444Predictiveprofile,
928 7 => Self::H264ProfileScalablebaseline,
929 8 => Self::H264ProfileScalablehigh,
930 9 => Self::H264ProfileStereohigh,
931 10 => Self::H264ProfileMultiviewhigh,
932 11 => Self::Vp8ProfileAny,
933 12 => Self::Vp9ProfileProfile0,
934 13 => Self::Vp9ProfileProfile1,
935 14 => Self::Vp9ProfileProfile2,
936 15 => Self::Vp9ProfileProfile3,
937 16 => Self::HevcprofileMain,
938 17 => Self::HevcprofileMain10,
939 18 => Self::HevcprofileMainStillPicture,
940 19 => Self::MjpegBaseline,
941 unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
942 }
943 }
944
945 #[inline]
946 pub fn unknown() -> Self {
947 Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
948 }
949
950 #[inline]
951 pub const fn into_primitive(self) -> u32 {
952 match self {
953 Self::H264ProfileBaseline => 0,
954 Self::H264ProfileMain => 1,
955 Self::H264ProfileExtended => 2,
956 Self::H264ProfileHigh => 3,
957 Self::H264ProfileHigh10Profile => 4,
958 Self::H264ProfileHigh422Profile => 5,
959 Self::H264ProfileHigh444Predictiveprofile => 6,
960 Self::H264ProfileScalablebaseline => 7,
961 Self::H264ProfileScalablehigh => 8,
962 Self::H264ProfileStereohigh => 9,
963 Self::H264ProfileMultiviewhigh => 10,
964 Self::Vp8ProfileAny => 11,
965 Self::Vp9ProfileProfile0 => 12,
966 Self::Vp9ProfileProfile1 => 13,
967 Self::Vp9ProfileProfile2 => 14,
968 Self::Vp9ProfileProfile3 => 15,
969 Self::HevcprofileMain => 16,
970 Self::HevcprofileMain10 => 17,
971 Self::HevcprofileMainStillPicture => 18,
972 Self::MjpegBaseline => 19,
973 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
974 }
975 }
976
977 #[inline]
978 pub fn is_unknown(&self) -> bool {
979 match self {
980 Self::__SourceBreaking { unknown_ordinal: _ } => true,
981 _ => false,
982 }
983 }
984}
985
986#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
987#[repr(u32)]
988pub enum ColorSpace {
989 Unknown = 0,
990 NotApplicable = 1,
991 Jpeg = 2,
992 HdRec709 = 3,
993 SdRec601 = 4,
994}
995
996impl ColorSpace {
997 #[inline]
998 pub fn from_primitive(prim: u32) -> Option<Self> {
999 match prim {
1000 0 => Some(Self::Unknown),
1001 1 => Some(Self::NotApplicable),
1002 2 => Some(Self::Jpeg),
1003 3 => Some(Self::HdRec709),
1004 4 => Some(Self::SdRec601),
1005 _ => None,
1006 }
1007 }
1008
1009 #[inline]
1010 pub const fn into_primitive(self) -> u32 {
1011 self as u32
1012 }
1013
1014 #[deprecated = "Strict enums should not use `is_unknown`"]
1015 #[inline]
1016 pub fn is_unknown(&self) -> bool {
1017 false
1018 }
1019}
1020
1021#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
1022pub enum Lc3FrameDuration {
1023 D10Ms,
1024 D7P5Ms,
1025 #[doc(hidden)]
1026 __SourceBreaking {
1027 unknown_ordinal: u32,
1028 },
1029}
1030
1031#[macro_export]
1033macro_rules! Lc3FrameDurationUnknown {
1034 () => {
1035 _
1036 };
1037}
1038
1039impl Lc3FrameDuration {
1040 #[inline]
1041 pub fn from_primitive(prim: u32) -> Option<Self> {
1042 match prim {
1043 1 => Some(Self::D10Ms),
1044 2 => Some(Self::D7P5Ms),
1045 _ => None,
1046 }
1047 }
1048
1049 #[inline]
1050 pub fn from_primitive_allow_unknown(prim: u32) -> Self {
1051 match prim {
1052 1 => Self::D10Ms,
1053 2 => Self::D7P5Ms,
1054 unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
1055 }
1056 }
1057
1058 #[inline]
1059 pub fn unknown() -> Self {
1060 Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
1061 }
1062
1063 #[inline]
1064 pub const fn into_primitive(self) -> u32 {
1065 match self {
1066 Self::D10Ms => 1,
1067 Self::D7P5Ms => 2,
1068 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
1069 }
1070 }
1071
1072 #[inline]
1073 pub fn is_unknown(&self) -> bool {
1074 match self {
1075 Self::__SourceBreaking { unknown_ordinal: _ } => true,
1076 _ => false,
1077 }
1078 }
1079}
1080
1081#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
1082#[repr(u32)]
1083pub enum SbcAllocation {
1084 AllocLoudness = 0,
1085 AllocSnr = 1,
1086}
1087
1088impl SbcAllocation {
1089 #[inline]
1090 pub fn from_primitive(prim: u32) -> Option<Self> {
1091 match prim {
1092 0 => Some(Self::AllocLoudness),
1093 1 => Some(Self::AllocSnr),
1094 _ => None,
1095 }
1096 }
1097
1098 #[inline]
1099 pub const fn into_primitive(self) -> u32 {
1100 self as u32
1101 }
1102
1103 #[deprecated = "Strict enums should not use `is_unknown`"]
1104 #[inline]
1105 pub fn is_unknown(&self) -> bool {
1106 false
1107 }
1108}
1109
1110#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
1111#[repr(u32)]
1112pub enum SbcBlockCount {
1113 BlockCount4 = 4,
1114 BlockCount8 = 8,
1115 BlockCount12 = 12,
1116 BlockCount16 = 16,
1117}
1118
1119impl SbcBlockCount {
1120 #[inline]
1121 pub fn from_primitive(prim: u32) -> Option<Self> {
1122 match prim {
1123 4 => Some(Self::BlockCount4),
1124 8 => Some(Self::BlockCount8),
1125 12 => Some(Self::BlockCount12),
1126 16 => Some(Self::BlockCount16),
1127 _ => None,
1128 }
1129 }
1130
1131 #[inline]
1132 pub const fn into_primitive(self) -> u32 {
1133 self as u32
1134 }
1135
1136 #[deprecated = "Strict enums should not use `is_unknown`"]
1137 #[inline]
1138 pub fn is_unknown(&self) -> bool {
1139 false
1140 }
1141}
1142
1143#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
1144#[repr(u32)]
1145pub enum SbcChannelMode {
1146 Mono = 0,
1147 Dual = 1,
1148 Stereo = 2,
1149 JointStereo = 3,
1150}
1151
1152impl SbcChannelMode {
1153 #[inline]
1154 pub fn from_primitive(prim: u32) -> Option<Self> {
1155 match prim {
1156 0 => Some(Self::Mono),
1157 1 => Some(Self::Dual),
1158 2 => Some(Self::Stereo),
1159 3 => Some(Self::JointStereo),
1160 _ => None,
1161 }
1162 }
1163
1164 #[inline]
1165 pub const fn into_primitive(self) -> u32 {
1166 self as u32
1167 }
1168
1169 #[deprecated = "Strict enums should not use `is_unknown`"]
1170 #[inline]
1171 pub fn is_unknown(&self) -> bool {
1172 false
1173 }
1174}
1175
1176#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
1177#[repr(u32)]
1178pub enum SbcSubBands {
1179 SubBands4 = 4,
1180 SubBands8 = 8,
1181}
1182
1183impl SbcSubBands {
1184 #[inline]
1185 pub fn from_primitive(prim: u32) -> Option<Self> {
1186 match prim {
1187 4 => Some(Self::SubBands4),
1188 8 => Some(Self::SubBands8),
1189 _ => None,
1190 }
1191 }
1192
1193 #[inline]
1194 pub const fn into_primitive(self) -> u32 {
1195 self as u32
1196 }
1197
1198 #[deprecated = "Strict enums should not use `is_unknown`"]
1199 #[inline]
1200 pub fn is_unknown(&self) -> bool {
1201 false
1202 }
1203}
1204
1205#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
1211#[repr(u32)]
1212pub enum StreamError {
1213 Unknown = 1,
1215 InvalidInputFormatDetails = 2,
1217 IncompatibleBuffersProvided = 3,
1221 EosProcessing = 4,
1225 DecoderUnknown = 16777217,
1227 DecoderDataParsing = 16777218,
1231 EncoderUnknown = 33554433,
1233 DecryptorUnknown = 50331649,
1235 DecryptorNoKey = 50331650,
1238}
1239
1240impl StreamError {
1241 #[inline]
1242 pub fn from_primitive(prim: u32) -> Option<Self> {
1243 match prim {
1244 1 => Some(Self::Unknown),
1245 2 => Some(Self::InvalidInputFormatDetails),
1246 3 => Some(Self::IncompatibleBuffersProvided),
1247 4 => Some(Self::EosProcessing),
1248 16777217 => Some(Self::DecoderUnknown),
1249 16777218 => Some(Self::DecoderDataParsing),
1250 33554433 => Some(Self::EncoderUnknown),
1251 50331649 => Some(Self::DecryptorUnknown),
1252 50331650 => Some(Self::DecryptorNoKey),
1253 _ => None,
1254 }
1255 }
1256
1257 #[inline]
1258 pub const fn into_primitive(self) -> u32 {
1259 self as u32
1260 }
1261
1262 #[deprecated = "Strict enums should not use `is_unknown`"]
1263 #[inline]
1264 pub fn is_unknown(&self) -> bool {
1265 false
1266 }
1267}
1268
1269#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
1270#[repr(u32)]
1271pub enum VideoColorSpace {
1272 Invalid = 0,
1273}
1274
1275impl VideoColorSpace {
1276 #[inline]
1277 pub fn from_primitive(prim: u32) -> Option<Self> {
1278 match prim {
1279 0 => Some(Self::Invalid),
1280 _ => None,
1281 }
1282 }
1283
1284 #[inline]
1285 pub const fn into_primitive(self) -> u32 {
1286 self as u32
1287 }
1288
1289 #[deprecated = "Strict enums should not use `is_unknown`"]
1290 #[inline]
1291 pub fn is_unknown(&self) -> bool {
1292 false
1293 }
1294}
1295
1296#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1297#[repr(C)]
1298pub struct AacConstantBitRate {
1299 pub bit_rate: u32,
1301}
1302
1303impl fidl::Persistable for AacConstantBitRate {}
1304
1305#[derive(Clone, Debug, PartialEq)]
1306pub struct AacEncoderSettings {
1307 pub transport: AacTransport,
1308 pub channel_mode: AacChannelMode,
1309 pub bit_rate: AacBitRate,
1310 pub aot: AacAudioObjectType,
1311}
1312
1313impl fidl::Persistable for AacEncoderSettings {}
1314
1315#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1317pub struct AacTransportAdts;
1318
1319impl fidl::Persistable for AacTransportAdts {}
1320
1321#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1323pub struct AacTransportLatm {
1324 pub mux_config_present: bool,
1326}
1327
1328impl fidl::Persistable for AacTransportLatm {}
1329
1330#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1332pub struct AacTransportRaw;
1333
1334impl fidl::Persistable for AacTransportRaw {}
1335
1336#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1337pub struct ActivityReporterWatchCaptureActivityResponse {
1338 pub active_usages: Vec<AudioCaptureUsage>,
1339}
1340
1341impl fidl::Persistable for ActivityReporterWatchCaptureActivityResponse {}
1342
1343#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1344pub struct ActivityReporterWatchRenderActivityResponse {
1345 pub active_usages: Vec<AudioRenderUsage>,
1346}
1347
1348impl fidl::Persistable for ActivityReporterWatchRenderActivityResponse {}
1349
1350#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1351pub struct ActivityReporterWatchCaptureActivity2Response {
1352 pub active_usages: Vec<AudioCaptureUsage2>,
1353}
1354
1355impl fidl::Persistable for ActivityReporterWatchCaptureActivity2Response {}
1356
1357#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1358pub struct ActivityReporterWatchRenderActivity2Response {
1359 pub active_usages: Vec<AudioRenderUsage2>,
1360}
1361
1362impl fidl::Persistable for ActivityReporterWatchRenderActivity2Response {}
1363
1364#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1365#[repr(C)]
1366pub struct AudioCapturerCaptureAtRequest {
1367 pub payload_buffer_id: u32,
1368 pub payload_offset: u32,
1369 pub frames: u32,
1370}
1371
1372impl fidl::Persistable for AudioCapturerCaptureAtRequest {}
1373
1374#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1375#[repr(C)]
1376pub struct AudioCapturerCaptureAtResponse {
1377 pub captured_packet: StreamPacket,
1378}
1379
1380impl fidl::Persistable for AudioCapturerCaptureAtResponse {}
1381
1382#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1383pub struct AudioCapturerGetStreamTypeResponse {
1384 pub stream_type: StreamType,
1385}
1386
1387impl fidl::Persistable for AudioCapturerGetStreamTypeResponse {}
1388
1389#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1390pub struct AudioCapturerSetPcmStreamTypeRequest {
1391 pub stream_type: AudioStreamType,
1392}
1393
1394impl fidl::Persistable for AudioCapturerSetPcmStreamTypeRequest {}
1395
1396#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1397pub struct AudioCapturerSetUsage2Request {
1398 pub usage: AudioCaptureUsage2,
1399}
1400
1401impl fidl::Persistable for AudioCapturerSetUsage2Request {}
1402
1403#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1404pub struct AudioCapturerSetUsageRequest {
1405 pub usage: AudioCaptureUsage,
1406}
1407
1408impl fidl::Persistable for AudioCapturerSetUsageRequest {}
1409
1410#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1411#[repr(C)]
1412pub struct AudioCapturerStartAsyncCaptureRequest {
1413 pub frames_per_packet: u32,
1414}
1415
1416impl fidl::Persistable for AudioCapturerStartAsyncCaptureRequest {}
1417
1418#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1419pub struct AudioCompressedFormatAac;
1420
1421impl fidl::Persistable for AudioCompressedFormatAac {}
1422
1423#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1424pub struct AudioCompressedFormatSbc;
1425
1426impl fidl::Persistable for AudioCompressedFormatSbc {}
1427
1428#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1429pub struct AudioConsumerSetRateRequest {
1430 pub rate: f32,
1431}
1432
1433impl fidl::Persistable for AudioConsumerSetRateRequest {}
1434
1435#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1436pub struct AudioConsumerStartRequest {
1437 pub flags: AudioConsumerStartFlags,
1438 pub reference_time: i64,
1439 pub media_time: i64,
1440}
1441
1442impl fidl::Persistable for AudioConsumerStartRequest {}
1443
1444#[derive(Clone, Debug, PartialEq)]
1445pub struct AudioConsumerWatchStatusResponse {
1446 pub status: AudioConsumerStatus,
1447}
1448
1449impl fidl::Persistable for AudioConsumerWatchStatusResponse {}
1450
1451#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1452pub struct AudioCoreEnableDeviceSettingsRequest {
1453 pub enabled: bool,
1454}
1455
1456impl fidl::Persistable for AudioCoreEnableDeviceSettingsRequest {}
1457
1458#[derive(Clone, Debug, PartialEq)]
1459pub struct AudioCoreGetDbFromVolume2Request {
1460 pub usage: Usage2,
1461 pub volume: f32,
1462}
1463
1464impl fidl::Persistable for AudioCoreGetDbFromVolume2Request {}
1465
1466#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1467pub struct AudioCoreGetDbFromVolumeRequest {
1468 pub usage: Usage,
1469 pub volume: f32,
1470}
1471
1472impl fidl::Persistable for AudioCoreGetDbFromVolumeRequest {}
1473
1474#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1475pub struct AudioCoreGetDbFromVolumeResponse {
1476 pub gain_db: f32,
1477}
1478
1479impl fidl::Persistable for AudioCoreGetDbFromVolumeResponse {}
1480
1481#[derive(Clone, Debug, PartialEq)]
1482pub struct AudioCoreGetVolumeFromDb2Request {
1483 pub usage: Usage2,
1484 pub gain_db: f32,
1485}
1486
1487impl fidl::Persistable for AudioCoreGetVolumeFromDb2Request {}
1488
1489#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1490pub struct AudioCoreGetVolumeFromDbRequest {
1491 pub usage: Usage,
1492 pub gain_db: f32,
1493}
1494
1495impl fidl::Persistable for AudioCoreGetVolumeFromDbRequest {}
1496
1497#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1498pub struct AudioCoreGetVolumeFromDbResponse {
1499 pub volume: f32,
1500}
1501
1502impl fidl::Persistable for AudioCoreGetVolumeFromDbResponse {}
1503
1504#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1505pub struct AudioCoreSetCaptureUsageGain2Request {
1506 pub usage: AudioCaptureUsage2,
1507 pub gain_db: f32,
1508}
1509
1510impl fidl::Persistable for AudioCoreSetCaptureUsageGain2Request {}
1511
1512#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1513pub struct AudioCoreSetCaptureUsageGainRequest {
1514 pub usage: AudioCaptureUsage,
1515 pub gain_db: f32,
1516}
1517
1518impl fidl::Persistable for AudioCoreSetCaptureUsageGainRequest {}
1519
1520#[derive(Clone, Debug, PartialEq)]
1521pub struct AudioCoreSetInteraction2Request {
1522 pub active: Usage2,
1523 pub affected: Usage2,
1524 pub behavior: Behavior,
1525}
1526
1527impl fidl::Persistable for AudioCoreSetInteraction2Request {}
1528
1529#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1530pub struct AudioCoreSetInteractionRequest {
1531 pub active: Usage,
1532 pub affected: Usage,
1533 pub behavior: Behavior,
1534}
1535
1536impl fidl::Persistable for AudioCoreSetInteractionRequest {}
1537
1538#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1539pub struct AudioCoreSetRenderUsageGain2Request {
1540 pub usage: AudioRenderUsage2,
1541 pub gain_db: f32,
1542}
1543
1544impl fidl::Persistable for AudioCoreSetRenderUsageGain2Request {}
1545
1546#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1547pub struct AudioCoreSetRenderUsageGainRequest {
1548 pub usage: AudioRenderUsage,
1549 pub gain_db: f32,
1550}
1551
1552impl fidl::Persistable for AudioCoreSetRenderUsageGainRequest {}
1553
1554#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1555pub struct AudioCoreGetDbFromVolume2Response {
1556 pub gain_db: f32,
1557}
1558
1559impl fidl::Persistable for AudioCoreGetDbFromVolume2Response {}
1560
1561#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1562pub struct AudioCoreGetVolumeFromDb2Response {
1563 pub volume: f32,
1564}
1565
1566impl fidl::Persistable for AudioCoreGetVolumeFromDb2Response {}
1567
1568#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1569#[repr(C)]
1570pub struct AudioDeviceEnumeratorGetDeviceGainRequest {
1571 pub device_token: u64,
1572}
1573
1574impl fidl::Persistable for AudioDeviceEnumeratorGetDeviceGainRequest {}
1575
1576#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1577pub struct AudioDeviceEnumeratorGetDeviceGainResponse {
1578 pub device_token: u64,
1579 pub gain_info: AudioGainInfo,
1580}
1581
1582impl fidl::Persistable for AudioDeviceEnumeratorGetDeviceGainResponse {}
1583
1584#[derive(Clone, Debug, PartialEq, PartialOrd)]
1585pub struct AudioDeviceEnumeratorGetDevicesResponse {
1586 pub devices: Vec<AudioDeviceInfo>,
1587}
1588
1589impl fidl::Persistable for AudioDeviceEnumeratorGetDevicesResponse {}
1590
1591#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1592#[repr(C)]
1593pub struct AudioDeviceEnumeratorOnDefaultDeviceChangedRequest {
1594 pub old_default_token: u64,
1595 pub new_default_token: u64,
1596}
1597
1598impl fidl::Persistable for AudioDeviceEnumeratorOnDefaultDeviceChangedRequest {}
1599
1600#[derive(Clone, Debug, PartialEq, PartialOrd)]
1601pub struct AudioDeviceEnumeratorOnDeviceAddedRequest {
1602 pub device: AudioDeviceInfo,
1603}
1604
1605impl fidl::Persistable for AudioDeviceEnumeratorOnDeviceAddedRequest {}
1606
1607#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1608pub struct AudioDeviceEnumeratorOnDeviceGainChangedRequest {
1609 pub device_token: u64,
1610 pub gain_info: AudioGainInfo,
1611}
1612
1613impl fidl::Persistable for AudioDeviceEnumeratorOnDeviceGainChangedRequest {}
1614
1615#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1616#[repr(C)]
1617pub struct AudioDeviceEnumeratorOnDeviceRemovedRequest {
1618 pub device_token: u64,
1619}
1620
1621impl fidl::Persistable for AudioDeviceEnumeratorOnDeviceRemovedRequest {}
1622
1623#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1624pub struct AudioDeviceEnumeratorSetDeviceGainRequest {
1625 pub device_token: u64,
1626 pub gain_info: AudioGainInfo,
1627 pub valid_flags: AudioGainValidFlags,
1628}
1629
1630impl fidl::Persistable for AudioDeviceEnumeratorSetDeviceGainRequest {}
1631
1632#[derive(Clone, Debug, PartialEq, PartialOrd)]
1633pub struct AudioDeviceInfo {
1634 pub name: String,
1635 pub unique_id: String,
1636 pub token_id: u64,
1637 pub is_input: bool,
1638 pub gain_info: AudioGainInfo,
1639 pub is_default: bool,
1640}
1641
1642impl fidl::Persistable for AudioDeviceInfo {}
1643
1644#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1645pub struct AudioGainInfo {
1646 pub gain_db: f32,
1647 pub flags: AudioGainInfoFlags,
1648}
1649
1650impl fidl::Persistable for AudioGainInfo {}
1651
1652#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1653pub struct AudioRendererEnableMinLeadTimeEventsRequest {
1654 pub enabled: bool,
1655}
1656
1657impl fidl::Persistable for AudioRendererEnableMinLeadTimeEventsRequest {}
1658
1659#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1660#[repr(C)]
1661pub struct AudioRendererGetMinLeadTimeResponse {
1662 pub min_lead_time_nsec: i64,
1663}
1664
1665impl fidl::Persistable for AudioRendererGetMinLeadTimeResponse {}
1666
1667#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1668#[repr(C)]
1669pub struct AudioRendererOnMinLeadTimeChangedRequest {
1670 pub min_lead_time_nsec: i64,
1671}
1672
1673impl fidl::Persistable for AudioRendererOnMinLeadTimeChangedRequest {}
1674
1675#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1676#[repr(C)]
1677pub struct AudioRendererPauseResponse {
1678 pub reference_time: i64,
1679 pub media_time: i64,
1680}
1681
1682impl fidl::Persistable for AudioRendererPauseResponse {}
1683
1684#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1685#[repr(C)]
1686pub struct AudioRendererPlayNoReplyRequest {
1687 pub reference_time: i64,
1688 pub media_time: i64,
1689}
1690
1691impl fidl::Persistable for AudioRendererPlayNoReplyRequest {}
1692
1693#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1694#[repr(C)]
1695pub struct AudioRendererPlayRequest {
1696 pub reference_time: i64,
1697 pub media_time: i64,
1698}
1699
1700impl fidl::Persistable for AudioRendererPlayRequest {}
1701
1702#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1703#[repr(C)]
1704pub struct AudioRendererPlayResponse {
1705 pub reference_time: i64,
1706 pub media_time: i64,
1707}
1708
1709impl fidl::Persistable for AudioRendererPlayResponse {}
1710
1711#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1712pub struct AudioRendererSetPcmStreamTypeRequest {
1713 pub type_: AudioStreamType,
1714}
1715
1716impl fidl::Persistable for AudioRendererSetPcmStreamTypeRequest {}
1717
1718#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1719pub struct AudioRendererSetPtsContinuityThresholdRequest {
1720 pub threshold_seconds: f32,
1721}
1722
1723impl fidl::Persistable for AudioRendererSetPtsContinuityThresholdRequest {}
1724
1725#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1726#[repr(C)]
1727pub struct AudioRendererSetPtsUnitsRequest {
1728 pub tick_per_second_numerator: u32,
1729 pub tick_per_second_denominator: u32,
1730}
1731
1732impl fidl::Persistable for AudioRendererSetPtsUnitsRequest {}
1733
1734#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1735pub struct AudioRendererSetUsage2Request {
1736 pub usage2: AudioRenderUsage2,
1737}
1738
1739impl fidl::Persistable for AudioRendererSetUsage2Request {}
1740
1741#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1742pub struct AudioRendererSetUsageRequest {
1743 pub usage: AudioRenderUsage,
1744}
1745
1746impl fidl::Persistable for AudioRendererSetUsageRequest {}
1747
1748#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1750pub struct AudioStreamType {
1751 pub sample_format: AudioSampleFormat,
1752 pub channels: u32,
1753 pub frames_per_second: u32,
1754}
1755
1756impl fidl::Persistable for AudioStreamType {}
1757
1758#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1761pub struct Compression {
1762 pub type_: String,
1766 pub parameters: Option<Vec<u8>>,
1768}
1769
1770impl fidl::Persistable for Compression {}
1771
1772#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1779#[repr(C)]
1780pub struct EncryptionPattern {
1781 pub clear_blocks: u32,
1782 pub encrypted_blocks: u32,
1783}
1784
1785impl fidl::Persistable for EncryptionPattern {}
1786
1787#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1788pub struct Metadata {
1789 pub properties: Vec<Property>,
1790}
1791
1792impl fidl::Persistable for Metadata {}
1793
1794#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1801pub struct Parameter {
1802 pub scope: String,
1803 pub name: String,
1804 pub value: Value,
1805}
1806
1807impl fidl::Persistable for Parameter {}
1808
1809#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1813pub struct PcmFormat {
1814 pub pcm_mode: AudioPcmMode,
1815 pub bits_per_sample: u32,
1816 pub frames_per_second: u32,
1817 pub channel_map: Vec<AudioChannelId>,
1818}
1819
1820impl fidl::Persistable for PcmFormat {}
1821
1822#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1823#[repr(C)]
1824pub struct ProfileProviderRegisterHandlerWithCapacityResponse {
1825 pub period: i64,
1826 pub capacity: i64,
1827}
1828
1829impl fidl::Persistable for ProfileProviderRegisterHandlerWithCapacityResponse {}
1830
1831#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1832pub struct Property {
1833 pub label: String,
1834 pub value: String,
1835}
1836
1837impl fidl::Persistable for Property {}
1838
1839#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1847pub struct SbcEncoderSettings {
1848 pub sub_bands: SbcSubBands,
1849 pub allocation: SbcAllocation,
1850 pub block_count: SbcBlockCount,
1851 pub channel_mode: SbcChannelMode,
1852 pub bit_pool: u64,
1854}
1855
1856impl fidl::Persistable for SbcEncoderSettings {}
1857
1858#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1859#[repr(C)]
1860pub struct StreamBufferSetRemovePayloadBufferRequest {
1861 pub id: u32,
1862}
1863
1864impl fidl::Persistable for StreamBufferSetRemovePayloadBufferRequest {}
1865
1866#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1868#[repr(C)]
1869pub struct StreamPacket {
1870 pub pts: i64,
1873 pub payload_buffer_id: u32,
1880 pub payload_offset: u64,
1885 pub payload_size: u64,
1890 pub flags: u32,
1893 pub buffer_config: u64,
1901 pub stream_segment_id: u64,
1907}
1908
1909impl fidl::Persistable for StreamPacket {}
1910
1911#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1912pub struct StreamProcessorCloseCurrentStreamRequest {
1913 pub stream_lifetime_ordinal: u64,
1914 pub release_input_buffers: bool,
1915 pub release_output_buffers: bool,
1916}
1917
1918impl fidl::Persistable for StreamProcessorCloseCurrentStreamRequest {}
1919
1920#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1921#[repr(C)]
1922pub struct StreamProcessorCompleteOutputBufferPartialSettingsRequest {
1923 pub buffer_lifetime_ordinal: u64,
1924}
1925
1926impl fidl::Persistable for StreamProcessorCompleteOutputBufferPartialSettingsRequest {}
1927
1928#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1929#[repr(C)]
1930pub struct StreamProcessorFlushEndOfStreamAndCloseStreamRequest {
1931 pub stream_lifetime_ordinal: u64,
1932}
1933
1934impl fidl::Persistable for StreamProcessorFlushEndOfStreamAndCloseStreamRequest {}
1935
1936#[derive(Clone, Debug, PartialEq)]
1937pub struct StreamProcessorOnFreeInputPacketRequest {
1938 pub free_input_packet: PacketHeader,
1939}
1940
1941impl fidl::Persistable for StreamProcessorOnFreeInputPacketRequest {}
1942
1943#[derive(Clone, Debug, PartialEq)]
1944pub struct StreamProcessorOnInputConstraintsRequest {
1945 pub input_constraints: StreamBufferConstraints,
1946}
1947
1948impl fidl::Persistable for StreamProcessorOnInputConstraintsRequest {}
1949
1950#[derive(Clone, Debug, PartialEq)]
1951pub struct StreamProcessorOnOutputConstraintsRequest {
1952 pub output_config: StreamOutputConstraints,
1953}
1954
1955impl fidl::Persistable for StreamProcessorOnOutputConstraintsRequest {}
1956
1957#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1958pub struct StreamProcessorOnOutputEndOfStreamRequest {
1959 pub stream_lifetime_ordinal: u64,
1960 pub error_detected_before: bool,
1961}
1962
1963impl fidl::Persistable for StreamProcessorOnOutputEndOfStreamRequest {}
1964
1965#[derive(Clone, Debug, PartialEq)]
1966pub struct StreamProcessorOnOutputFormatRequest {
1967 pub output_format: StreamOutputFormat,
1968}
1969
1970impl fidl::Persistable for StreamProcessorOnOutputFormatRequest {}
1971
1972#[derive(Clone, Debug, PartialEq)]
1973pub struct StreamProcessorOnOutputPacketRequest {
1974 pub output_packet: Packet,
1975 pub error_detected_before: bool,
1976 pub error_detected_during: bool,
1977}
1978
1979impl fidl::Persistable for StreamProcessorOnOutputPacketRequest {}
1980
1981#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1982pub struct StreamProcessorOnStreamFailedRequest {
1983 pub stream_lifetime_ordinal: u64,
1984 pub error: StreamError,
1985}
1986
1987impl fidl::Persistable for StreamProcessorOnStreamFailedRequest {}
1988
1989#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1990#[repr(C)]
1991pub struct StreamProcessorQueueInputEndOfStreamRequest {
1992 pub stream_lifetime_ordinal: u64,
1993}
1994
1995impl fidl::Persistable for StreamProcessorQueueInputEndOfStreamRequest {}
1996
1997#[derive(Clone, Debug, PartialEq)]
1998pub struct StreamProcessorQueueInputFormatDetailsRequest {
1999 pub stream_lifetime_ordinal: u64,
2000 pub format_details: FormatDetails,
2001}
2002
2003impl fidl::Persistable for StreamProcessorQueueInputFormatDetailsRequest {}
2004
2005#[derive(Clone, Debug, PartialEq)]
2006pub struct StreamProcessorQueueInputPacketRequest {
2007 pub packet: Packet,
2008}
2009
2010impl fidl::Persistable for StreamProcessorQueueInputPacketRequest {}
2011
2012#[derive(Clone, Debug, PartialEq)]
2013pub struct StreamProcessorRecycleOutputPacketRequest {
2014 pub available_output_packet: PacketHeader,
2015}
2016
2017impl fidl::Persistable for StreamProcessorRecycleOutputPacketRequest {}
2018
2019#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
2020#[repr(C)]
2021pub struct StreamSinkSendPacketNoReplyRequest {
2022 pub packet: StreamPacket,
2023}
2024
2025impl fidl::Persistable for StreamSinkSendPacketNoReplyRequest {}
2026
2027#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
2028#[repr(C)]
2029pub struct StreamSinkSendPacketRequest {
2030 pub packet: StreamPacket,
2031}
2032
2033impl fidl::Persistable for StreamSinkSendPacketRequest {}
2034
2035#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
2036#[repr(C)]
2037pub struct StreamSourceOnPacketProducedRequest {
2038 pub packet: StreamPacket,
2039}
2040
2041impl fidl::Persistable for StreamSourceOnPacketProducedRequest {}
2042
2043#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
2044#[repr(C)]
2045pub struct StreamSourceReleasePacketRequest {
2046 pub packet: StreamPacket,
2047}
2048
2049impl fidl::Persistable for StreamSourceReleasePacketRequest {}
2050
2051#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
2053pub struct StreamType {
2054 pub medium_specific: MediumSpecificStreamType,
2056 pub encoding: String,
2059 pub encoding_parameters: Option<Vec<u8>>,
2065}
2066
2067impl fidl::Persistable for StreamType {}
2068
2069#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
2071pub struct SubpictureStreamType;
2072
2073impl fidl::Persistable for SubpictureStreamType {}
2074
2075#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
2081#[repr(C)]
2082pub struct SubsampleEntry {
2083 pub clear_bytes: u32,
2084 pub encrypted_bytes: u32,
2085}
2086
2087impl fidl::Persistable for SubsampleEntry {}
2088
2089#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
2091pub struct TextStreamType;
2092
2093impl fidl::Persistable for TextStreamType {}
2094
2095#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
2131#[repr(C)]
2132pub struct TimelineFunction {
2133 pub subject_time: i64,
2135 pub reference_time: i64,
2137 pub subject_delta: u32,
2139 pub reference_delta: u32,
2142}
2143
2144impl fidl::Persistable for TimelineFunction {}
2145
2146#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
2147pub struct UsageGainListenerOnGainMuteChangedRequest {
2148 pub muted: bool,
2149 pub gain_dbfs: f32,
2150}
2151
2152impl fidl::Persistable for UsageGainListenerOnGainMuteChangedRequest {}
2153
2154#[derive(Clone, Debug, PartialEq)]
2155pub struct UsageWatcher2OnStateChangedRequest {
2156 pub usage: Usage2,
2157 pub state: UsageState,
2158}
2159
2160impl fidl::Persistable for UsageWatcher2OnStateChangedRequest {}
2161
2162#[derive(Clone, Debug, PartialEq)]
2163pub struct UsageWatcherOnStateChangedRequest {
2164 pub usage: Usage,
2165 pub state: UsageState,
2166}
2167
2168impl fidl::Persistable for UsageWatcherOnStateChangedRequest {}
2169
2170#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
2172pub struct VideoStreamType {
2173 pub pixel_format: fidl_fuchsia_images::PixelFormat,
2174 pub color_space: ColorSpace,
2175 pub width: u32,
2177 pub height: u32,
2178 pub coded_width: u32,
2181 pub coded_height: u32,
2182 pub pixel_aspect_ratio_width: u32,
2185 pub pixel_aspect_ratio_height: u32,
2186 pub stride: u32,
2188}
2189
2190impl fidl::Persistable for VideoStreamType {}
2191
2192#[derive(Clone, Debug, PartialEq)]
2196pub struct VideoUncompressedFormat {
2197 pub image_format: fidl_fuchsia_sysmem::ImageFormat2,
2198 pub fourcc: u32,
2199 pub primary_width_pixels: u32,
2200 pub primary_height_pixels: u32,
2201 pub secondary_width_pixels: u32,
2202 pub secondary_height_pixels: u32,
2203 pub planar: bool,
2204 pub swizzled: bool,
2205 pub primary_line_stride_bytes: u32,
2206 pub secondary_line_stride_bytes: u32,
2207 pub primary_start_offset: u32,
2208 pub secondary_start_offset: u32,
2209 pub tertiary_start_offset: u32,
2210 pub primary_pixel_stride: u32,
2211 pub secondary_pixel_stride: u32,
2212 pub primary_display_width_pixels: u32,
2213 pub primary_display_height_pixels: u32,
2214 pub has_pixel_aspect_ratio: bool,
2215 pub pixel_aspect_ratio_width: u32,
2216 pub pixel_aspect_ratio_height: u32,
2217}
2218
2219impl fidl::Persistable for VideoUncompressedFormat {}
2220
2221#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
2222pub struct Void;
2223
2224impl fidl::Persistable for Void {}
2225
2226#[derive(Clone, Debug, Default, PartialEq)]
2230pub struct AudioCompressedFormatCvsd {
2231 #[doc(hidden)]
2232 pub __source_breaking: fidl::marker::SourceBreaking,
2233}
2234
2235impl fidl::Persistable for AudioCompressedFormatCvsd {}
2236
2237#[derive(Clone, Debug, Default, PartialEq)]
2241pub struct AudioCompressedFormatLc3 {
2242 #[doc(hidden)]
2243 pub __source_breaking: fidl::marker::SourceBreaking,
2244}
2245
2246impl fidl::Persistable for AudioCompressedFormatLc3 {}
2247
2248#[derive(Clone, Debug, Default, PartialEq)]
2251pub struct AudioConsumerStatus {
2252 pub error: Option<AudioConsumerError>,
2254 pub presentation_timeline: Option<TimelineFunction>,
2262 pub min_lead_time: Option<u64>,
2267 pub max_lead_time: Option<u64>,
2272 #[doc(hidden)]
2273 pub __source_breaking: fidl::marker::SourceBreaking,
2274}
2275
2276impl fidl::Persistable for AudioConsumerStatus {}
2277
2278#[derive(Clone, Debug, Default, PartialEq)]
2282pub struct CvsdEncoderSettings {
2283 #[doc(hidden)]
2284 pub __source_breaking: fidl::marker::SourceBreaking,
2285}
2286
2287impl fidl::Persistable for CvsdEncoderSettings {}
2288
2289#[derive(Clone, Debug, Default, PartialEq)]
2295pub struct DecryptedFormat {
2296 pub ignore_this_field: Option<bool>,
2297 #[doc(hidden)]
2298 pub __source_breaking: fidl::marker::SourceBreaking,
2299}
2300
2301impl fidl::Persistable for DecryptedFormat {}
2302
2303#[derive(Clone, Debug, Default, PartialEq)]
2310pub struct EncryptedFormat {
2311 pub init_vector: Option<Vec<u8>>,
2319 pub subsamples: Option<Vec<SubsampleEntry>>,
2325 pub pattern: Option<EncryptionPattern>,
2333 pub scheme: Option<String>,
2343 pub key_id: Option<Vec<u8>>,
2350 #[doc(hidden)]
2351 pub __source_breaking: fidl::marker::SourceBreaking,
2352}
2353
2354impl fidl::Persistable for EncryptedFormat {}
2355
2356#[derive(Clone, Debug, Default, PartialEq)]
2361pub struct FormatDetails {
2362 pub format_details_version_ordinal: Option<u64>,
2363 pub mime_type: Option<String>,
2364 pub oob_bytes: Option<Vec<u8>>,
2365 pub domain: Option<DomainFormat>,
2366 pub pass_through_parameters: Option<Vec<Parameter>>,
2367 pub encoder_settings: Option<EncoderSettings>,
2372 pub timebase: Option<u64>,
2386 pub profile: Option<CodecProfile>,
2399 #[doc(hidden)]
2400 pub __source_breaking: fidl::marker::SourceBreaking,
2401}
2402
2403impl fidl::Persistable for FormatDetails {}
2404
2405#[derive(Clone, Debug, Default, PartialEq)]
2407pub struct H264EncoderSettings {
2408 pub bit_rate: Option<u32>,
2411 pub frame_rate: Option<u32>,
2414 pub gop_size: Option<u32>,
2418 pub variable_frame_rate: Option<bool>,
2421 pub min_frame_rate: Option<u32>,
2424 pub force_key_frame: Option<bool>,
2427 pub quantization_params: Option<H264QuantizationParameters>,
2431 #[doc(hidden)]
2432 pub __source_breaking: fidl::marker::SourceBreaking,
2433}
2434
2435impl fidl::Persistable for H264EncoderSettings {}
2436
2437#[derive(Clone, Debug, Default, PartialEq)]
2446pub struct H264QuantizationParameters {
2447 pub i_base: Option<u32>,
2449 pub i_min: Option<u32>,
2451 pub i_max: Option<u32>,
2453 pub p_base: Option<u32>,
2455 pub p_min: Option<u32>,
2457 pub p_max: Option<u32>,
2459 #[doc(hidden)]
2460 pub __source_breaking: fidl::marker::SourceBreaking,
2461}
2462
2463impl fidl::Persistable for H264QuantizationParameters {}
2464
2465#[derive(Clone, Debug, Default, PartialEq)]
2467pub struct HevcEncoderSettings {
2468 pub bit_rate: Option<u32>,
2471 pub frame_rate: Option<u32>,
2473 pub gop_size: Option<u32>,
2475 #[doc(hidden)]
2476 pub __source_breaking: fidl::marker::SourceBreaking,
2477}
2478
2479impl fidl::Persistable for HevcEncoderSettings {}
2480
2481#[derive(Clone, Debug, Default, PartialEq)]
2484pub struct InputAudioCapturerConfiguration {
2485 pub usage: Option<AudioCaptureUsage>,
2486 pub usage2: Option<AudioCaptureUsage2>,
2487 #[doc(hidden)]
2488 pub __source_breaking: fidl::marker::SourceBreaking,
2489}
2490
2491impl fidl::Persistable for InputAudioCapturerConfiguration {}
2492
2493#[derive(Clone, Debug, Default, PartialEq)]
2496pub struct Lc3EncoderSettings {
2497 pub nbytes: Option<u16>,
2502 pub frame_duration: Option<Lc3FrameDuration>,
2505 #[doc(hidden)]
2506 pub __source_breaking: fidl::marker::SourceBreaking,
2507}
2508
2509impl fidl::Persistable for Lc3EncoderSettings {}
2510
2511#[derive(Clone, Debug, Default, PartialEq)]
2514pub struct LoopbackAudioCapturerConfiguration {
2515 #[doc(hidden)]
2516 pub __source_breaking: fidl::marker::SourceBreaking,
2517}
2518
2519impl fidl::Persistable for LoopbackAudioCapturerConfiguration {}
2520
2521#[derive(Clone, Debug, Default, PartialEq)]
2524pub struct MSbcEncoderSettings {
2525 #[doc(hidden)]
2526 pub __source_breaking: fidl::marker::SourceBreaking,
2527}
2528
2529impl fidl::Persistable for MSbcEncoderSettings {}
2530
2531#[derive(Clone, Debug, Default, PartialEq)]
2548pub struct Packet {
2549 pub header: Option<PacketHeader>,
2550 pub buffer_index: Option<u32>,
2564 pub stream_lifetime_ordinal: Option<u64>,
2573 pub start_offset: Option<u32>,
2592 pub valid_length_bytes: Option<u32>,
2615 pub timestamp_ish: Option<u64>,
2635 pub start_access_unit: Option<bool>,
2646 pub known_end_access_unit: Option<bool>,
2658 pub key_frame: Option<bool>,
2662 #[doc(hidden)]
2663 pub __source_breaking: fidl::marker::SourceBreaking,
2664}
2665
2666impl fidl::Persistable for Packet {}
2667
2668#[derive(Clone, Debug, Default, PartialEq)]
2676pub struct PacketHeader {
2677 pub buffer_lifetime_ordinal: Option<u64>,
2690 pub packet_index: Option<u32>,
2710 #[doc(hidden)]
2711 pub __source_breaking: fidl::marker::SourceBreaking,
2712}
2713
2714impl fidl::Persistable for PacketHeader {}
2715
2716#[derive(Clone, Debug, Default, PartialEq)]
2729pub struct StreamBufferConstraints {
2730 pub buffer_constraints_version_ordinal: Option<u64>,
2745 pub default_settings: Option<StreamBufferSettings>,
2746 pub per_packet_buffer_bytes_min: Option<u32>,
2747 pub per_packet_buffer_bytes_recommended: Option<u32>,
2748 pub per_packet_buffer_bytes_max: Option<u32>,
2749 pub packet_count_for_server_min: Option<u32>,
2750 pub packet_count_for_server_recommended: Option<u32>,
2751 pub packet_count_for_server_recommended_max: Option<u32>,
2752 pub packet_count_for_server_max: Option<u32>,
2753 pub packet_count_for_client_min: Option<u32>,
2754 pub packet_count_for_client_max: Option<u32>,
2755 pub single_buffer_mode_allowed: Option<bool>,
2756 pub is_physically_contiguous_required: Option<bool>,
2757 #[doc(hidden)]
2758 pub __source_breaking: fidl::marker::SourceBreaking,
2759}
2760
2761impl fidl::Persistable for StreamBufferConstraints {}
2762
2763#[derive(Clone, Debug, Default, PartialEq)]
2766pub struct StreamBufferSettings {
2767 pub buffer_lifetime_ordinal: Option<u64>,
2768 pub buffer_constraints_version_ordinal: Option<u64>,
2769 pub packet_count_for_server: Option<u32>,
2770 pub packet_count_for_client: Option<u32>,
2771 pub per_packet_buffer_bytes: Option<u32>,
2772 pub single_buffer_mode: Option<bool>,
2773 #[doc(hidden)]
2774 pub __source_breaking: fidl::marker::SourceBreaking,
2775}
2776
2777impl fidl::Persistable for StreamBufferSettings {}
2778
2779#[derive(Clone, Debug, Default, PartialEq)]
2782pub struct StreamOutputConstraints {
2783 pub stream_lifetime_ordinal: Option<u64>,
2797 pub buffer_constraints_action_required: Option<bool>,
2826 pub buffer_constraints: Option<StreamBufferConstraints>,
2827 #[doc(hidden)]
2828 pub __source_breaking: fidl::marker::SourceBreaking,
2829}
2830
2831impl fidl::Persistable for StreamOutputConstraints {}
2832
2833#[derive(Clone, Debug, Default, PartialEq)]
2834pub struct StreamOutputFormat {
2835 pub stream_lifetime_ordinal: Option<u64>,
2848 pub format_details: Option<FormatDetails>,
2905 #[doc(hidden)]
2906 pub __source_breaking: fidl::marker::SourceBreaking,
2907}
2908
2909impl fidl::Persistable for StreamOutputFormat {}
2910
2911#[derive(Clone, Debug, Default, PartialEq)]
2914pub struct UsageStateDucked {
2915 #[doc(hidden)]
2916 pub __source_breaking: fidl::marker::SourceBreaking,
2917}
2918
2919impl fidl::Persistable for UsageStateDucked {}
2920
2921#[derive(Clone, Debug, Default, PartialEq)]
2924pub struct UsageStateMuted {
2925 #[doc(hidden)]
2926 pub __source_breaking: fidl::marker::SourceBreaking,
2927}
2928
2929impl fidl::Persistable for UsageStateMuted {}
2930
2931#[derive(Clone, Debug, Default, PartialEq)]
2933pub struct UsageStateUnadjusted {
2934 #[doc(hidden)]
2935 pub __source_breaking: fidl::marker::SourceBreaking,
2936}
2937
2938impl fidl::Persistable for UsageStateUnadjusted {}
2939
2940#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
2941pub enum AacBitRate {
2942 Constant(AacConstantBitRate),
2943 Variable(AacVariableBitRate),
2944}
2945
2946impl AacBitRate {
2947 #[inline]
2948 pub fn ordinal(&self) -> u64 {
2949 match *self {
2950 Self::Constant(_) => 1,
2951 Self::Variable(_) => 2,
2952 }
2953 }
2954
2955 #[deprecated = "Strict unions should not use `is_unknown`"]
2956 #[inline]
2957 pub fn is_unknown(&self) -> bool {
2958 false
2959 }
2960}
2961
2962impl fidl::Persistable for AacBitRate {}
2963
2964#[derive(Clone, Debug)]
2965pub enum AacTransport {
2966 Raw(AacTransportRaw),
2967 Latm(AacTransportLatm),
2968 Adts(AacTransportAdts),
2969 #[doc(hidden)]
2970 __SourceBreaking {
2971 unknown_ordinal: u64,
2972 },
2973}
2974
2975#[macro_export]
2977macro_rules! AacTransportUnknown {
2978 () => {
2979 _
2980 };
2981}
2982
2983impl PartialEq for AacTransport {
2985 fn eq(&self, other: &Self) -> bool {
2986 match (self, other) {
2987 (Self::Raw(x), Self::Raw(y)) => *x == *y,
2988 (Self::Latm(x), Self::Latm(y)) => *x == *y,
2989 (Self::Adts(x), Self::Adts(y)) => *x == *y,
2990 _ => false,
2991 }
2992 }
2993}
2994
2995impl AacTransport {
2996 #[inline]
2997 pub fn ordinal(&self) -> u64 {
2998 match *self {
2999 Self::Raw(_) => 1,
3000 Self::Latm(_) => 2,
3001 Self::Adts(_) => 3,
3002 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
3003 }
3004 }
3005
3006 #[inline]
3007 pub fn unknown_variant_for_testing() -> Self {
3008 Self::__SourceBreaking { unknown_ordinal: 0 }
3009 }
3010
3011 #[inline]
3012 pub fn is_unknown(&self) -> bool {
3013 match self {
3014 Self::__SourceBreaking { .. } => true,
3015 _ => false,
3016 }
3017 }
3018}
3019
3020impl fidl::Persistable for AacTransport {}
3021
3022#[derive(Clone, Debug, PartialEq)]
3024pub enum AudioCapturerConfiguration {
3025 Loopback(LoopbackAudioCapturerConfiguration),
3026 Input(InputAudioCapturerConfiguration),
3027}
3028
3029impl AudioCapturerConfiguration {
3030 #[inline]
3031 pub fn ordinal(&self) -> u64 {
3032 match *self {
3033 Self::Loopback(_) => 1,
3034 Self::Input(_) => 2,
3035 }
3036 }
3037
3038 #[deprecated = "Strict unions should not use `is_unknown`"]
3039 #[inline]
3040 pub fn is_unknown(&self) -> bool {
3041 false
3042 }
3043}
3044
3045impl fidl::Persistable for AudioCapturerConfiguration {}
3046
3047#[derive(Clone, Debug)]
3048pub enum AudioCompressedFormat {
3049 Aac(AudioCompressedFormatAac),
3050 Sbc(AudioCompressedFormatSbc),
3051 Cvsd(AudioCompressedFormatCvsd),
3052 Lc3(AudioCompressedFormatLc3),
3053 #[doc(hidden)]
3054 __SourceBreaking {
3055 unknown_ordinal: u64,
3056 },
3057}
3058
3059#[macro_export]
3061macro_rules! AudioCompressedFormatUnknown {
3062 () => {
3063 _
3064 };
3065}
3066
3067impl PartialEq for AudioCompressedFormat {
3069 fn eq(&self, other: &Self) -> bool {
3070 match (self, other) {
3071 (Self::Aac(x), Self::Aac(y)) => *x == *y,
3072 (Self::Sbc(x), Self::Sbc(y)) => *x == *y,
3073 (Self::Cvsd(x), Self::Cvsd(y)) => *x == *y,
3074 (Self::Lc3(x), Self::Lc3(y)) => *x == *y,
3075 _ => false,
3076 }
3077 }
3078}
3079
3080impl AudioCompressedFormat {
3081 #[inline]
3082 pub fn ordinal(&self) -> u64 {
3083 match *self {
3084 Self::Aac(_) => 1,
3085 Self::Sbc(_) => 2,
3086 Self::Cvsd(_) => 3,
3087 Self::Lc3(_) => 4,
3088 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
3089 }
3090 }
3091
3092 #[inline]
3093 pub fn unknown_variant_for_testing() -> Self {
3094 Self::__SourceBreaking { unknown_ordinal: 0 }
3095 }
3096
3097 #[inline]
3098 pub fn is_unknown(&self) -> bool {
3099 match self {
3100 Self::__SourceBreaking { .. } => true,
3101 _ => false,
3102 }
3103 }
3104}
3105
3106impl fidl::Persistable for AudioCompressedFormat {}
3107
3108#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
3110pub enum AudioConsumerError {
3111 PlaceHolder(Void),
3112}
3113
3114impl AudioConsumerError {
3115 #[inline]
3116 pub fn ordinal(&self) -> u64 {
3117 match *self {
3118 Self::PlaceHolder(_) => 1,
3119 }
3120 }
3121
3122 #[deprecated = "Strict unions should not use `is_unknown`"]
3123 #[inline]
3124 pub fn is_unknown(&self) -> bool {
3125 false
3126 }
3127}
3128
3129impl fidl::Persistable for AudioConsumerError {}
3130
3131#[derive(Clone, Debug, PartialEq)]
3133pub enum AudioFormat {
3134 Compressed(AudioCompressedFormat),
3135 Uncompressed(AudioUncompressedFormat),
3136}
3137
3138impl AudioFormat {
3139 #[inline]
3140 pub fn ordinal(&self) -> u64 {
3141 match *self {
3142 Self::Compressed(_) => 1,
3143 Self::Uncompressed(_) => 2,
3144 }
3145 }
3146
3147 #[deprecated = "Strict unions should not use `is_unknown`"]
3148 #[inline]
3149 pub fn is_unknown(&self) -> bool {
3150 false
3151 }
3152}
3153
3154impl fidl::Persistable for AudioFormat {}
3155
3156#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
3158pub enum AudioUncompressedFormat {
3159 Pcm(PcmFormat),
3160}
3161
3162impl AudioUncompressedFormat {
3163 #[inline]
3164 pub fn ordinal(&self) -> u64 {
3165 match *self {
3166 Self::Pcm(_) => 1,
3167 }
3168 }
3169
3170 #[deprecated = "Strict unions should not use `is_unknown`"]
3171 #[inline]
3172 pub fn is_unknown(&self) -> bool {
3173 false
3174 }
3175}
3176
3177impl fidl::Persistable for AudioUncompressedFormat {}
3178
3179#[derive(Clone, Debug)]
3183pub enum CryptoFormat {
3184 Encrypted(EncryptedFormat),
3185 Decrypted(DecryptedFormat),
3186 #[doc(hidden)]
3187 __SourceBreaking {
3188 unknown_ordinal: u64,
3189 },
3190}
3191
3192#[macro_export]
3194macro_rules! CryptoFormatUnknown {
3195 () => {
3196 _
3197 };
3198}
3199
3200impl PartialEq for CryptoFormat {
3202 fn eq(&self, other: &Self) -> bool {
3203 match (self, other) {
3204 (Self::Encrypted(x), Self::Encrypted(y)) => *x == *y,
3205 (Self::Decrypted(x), Self::Decrypted(y)) => *x == *y,
3206 _ => false,
3207 }
3208 }
3209}
3210
3211impl CryptoFormat {
3212 #[inline]
3213 pub fn ordinal(&self) -> u64 {
3214 match *self {
3215 Self::Encrypted(_) => 1,
3216 Self::Decrypted(_) => 2,
3217 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
3218 }
3219 }
3220
3221 #[inline]
3222 pub fn unknown_variant_for_testing() -> Self {
3223 Self::__SourceBreaking { unknown_ordinal: 0 }
3224 }
3225
3226 #[inline]
3227 pub fn is_unknown(&self) -> bool {
3228 match self {
3229 Self::__SourceBreaking { .. } => true,
3230 _ => false,
3231 }
3232 }
3233}
3234
3235impl fidl::Persistable for CryptoFormat {}
3236
3237#[derive(Clone, Debug, PartialEq)]
3239pub enum DomainFormat {
3240 Audio(AudioFormat),
3241 Video(VideoFormat),
3242 Crypto(CryptoFormat),
3243}
3244
3245impl DomainFormat {
3246 #[inline]
3247 pub fn ordinal(&self) -> u64 {
3248 match *self {
3249 Self::Audio(_) => 1,
3250 Self::Video(_) => 2,
3251 Self::Crypto(_) => 3,
3252 }
3253 }
3254
3255 #[deprecated = "Strict unions should not use `is_unknown`"]
3256 #[inline]
3257 pub fn is_unknown(&self) -> bool {
3258 false
3259 }
3260}
3261
3262impl fidl::Persistable for DomainFormat {}
3263
3264#[derive(Clone, Debug)]
3267pub enum EncoderSettings {
3268 Sbc(SbcEncoderSettings),
3269 Aac(AacEncoderSettings),
3270 H264(H264EncoderSettings),
3271 Hevc(HevcEncoderSettings),
3272 Cvsd(CvsdEncoderSettings),
3273 Lc3(Lc3EncoderSettings),
3274 Msbc(MSbcEncoderSettings),
3275 #[doc(hidden)]
3276 __SourceBreaking {
3277 unknown_ordinal: u64,
3278 },
3279}
3280
3281#[macro_export]
3283macro_rules! EncoderSettingsUnknown {
3284 () => {
3285 _
3286 };
3287}
3288
3289impl PartialEq for EncoderSettings {
3291 fn eq(&self, other: &Self) -> bool {
3292 match (self, other) {
3293 (Self::Sbc(x), Self::Sbc(y)) => *x == *y,
3294 (Self::Aac(x), Self::Aac(y)) => *x == *y,
3295 (Self::H264(x), Self::H264(y)) => *x == *y,
3296 (Self::Hevc(x), Self::Hevc(y)) => *x == *y,
3297 (Self::Cvsd(x), Self::Cvsd(y)) => *x == *y,
3298 (Self::Lc3(x), Self::Lc3(y)) => *x == *y,
3299 (Self::Msbc(x), Self::Msbc(y)) => *x == *y,
3300 _ => false,
3301 }
3302 }
3303}
3304
3305impl EncoderSettings {
3306 #[inline]
3307 pub fn ordinal(&self) -> u64 {
3308 match *self {
3309 Self::Sbc(_) => 1,
3310 Self::Aac(_) => 2,
3311 Self::H264(_) => 3,
3312 Self::Hevc(_) => 4,
3313 Self::Cvsd(_) => 5,
3314 Self::Lc3(_) => 6,
3315 Self::Msbc(_) => 7,
3316 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
3317 }
3318 }
3319
3320 #[inline]
3321 pub fn unknown_variant_for_testing() -> Self {
3322 Self::__SourceBreaking { unknown_ordinal: 0 }
3323 }
3324
3325 #[inline]
3326 pub fn is_unknown(&self) -> bool {
3327 match self {
3328 Self::__SourceBreaking { .. } => true,
3329 _ => false,
3330 }
3331 }
3332}
3333
3334impl fidl::Persistable for EncoderSettings {}
3335
3336#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
3338pub enum MediumSpecificStreamType {
3339 Audio(AudioStreamType),
3340 Video(VideoStreamType),
3341 Text(TextStreamType),
3342 Subpicture(SubpictureStreamType),
3343}
3344
3345impl MediumSpecificStreamType {
3346 #[inline]
3347 pub fn ordinal(&self) -> u64 {
3348 match *self {
3349 Self::Audio(_) => 1,
3350 Self::Video(_) => 2,
3351 Self::Text(_) => 3,
3352 Self::Subpicture(_) => 4,
3353 }
3354 }
3355
3356 #[deprecated = "Strict unions should not use `is_unknown`"]
3357 #[inline]
3358 pub fn is_unknown(&self) -> bool {
3359 false
3360 }
3361}
3362
3363impl fidl::Persistable for MediumSpecificStreamType {}
3364
3365#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
3366pub enum Usage {
3367 RenderUsage(AudioRenderUsage),
3368 CaptureUsage(AudioCaptureUsage),
3369}
3370
3371impl Usage {
3372 #[inline]
3373 pub fn ordinal(&self) -> u64 {
3374 match *self {
3375 Self::RenderUsage(_) => 1,
3376 Self::CaptureUsage(_) => 2,
3377 }
3378 }
3379
3380 #[deprecated = "Strict unions should not use `is_unknown`"]
3381 #[inline]
3382 pub fn is_unknown(&self) -> bool {
3383 false
3384 }
3385}
3386
3387impl fidl::Persistable for Usage {}
3388
3389#[derive(Clone, Debug)]
3390pub enum Usage2 {
3391 RenderUsage(AudioRenderUsage2),
3392 CaptureUsage(AudioCaptureUsage2),
3393 #[doc(hidden)]
3394 __SourceBreaking {
3395 unknown_ordinal: u64,
3396 },
3397}
3398
3399#[macro_export]
3401macro_rules! Usage2Unknown {
3402 () => {
3403 _
3404 };
3405}
3406
3407impl PartialEq for Usage2 {
3409 fn eq(&self, other: &Self) -> bool {
3410 match (self, other) {
3411 (Self::RenderUsage(x), Self::RenderUsage(y)) => *x == *y,
3412 (Self::CaptureUsage(x), Self::CaptureUsage(y)) => *x == *y,
3413 _ => false,
3414 }
3415 }
3416}
3417
3418impl Usage2 {
3419 #[inline]
3420 pub fn ordinal(&self) -> u64 {
3421 match *self {
3422 Self::RenderUsage(_) => 1,
3423 Self::CaptureUsage(_) => 2,
3424 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
3425 }
3426 }
3427
3428 #[inline]
3429 pub fn unknown_variant_for_testing() -> Self {
3430 Self::__SourceBreaking { unknown_ordinal: 0 }
3431 }
3432
3433 #[inline]
3434 pub fn is_unknown(&self) -> bool {
3435 match self {
3436 Self::__SourceBreaking { .. } => true,
3437 _ => false,
3438 }
3439 }
3440}
3441
3442impl fidl::Persistable for Usage2 {}
3443
3444#[derive(Clone, Debug)]
3446pub enum UsageState {
3447 Unadjusted(UsageStateUnadjusted),
3448 Ducked(UsageStateDucked),
3449 Muted(UsageStateMuted),
3450 #[doc(hidden)]
3451 __SourceBreaking {
3452 unknown_ordinal: u64,
3453 },
3454}
3455
3456#[macro_export]
3458macro_rules! UsageStateUnknown {
3459 () => {
3460 _
3461 };
3462}
3463
3464impl PartialEq for UsageState {
3466 fn eq(&self, other: &Self) -> bool {
3467 match (self, other) {
3468 (Self::Unadjusted(x), Self::Unadjusted(y)) => *x == *y,
3469 (Self::Ducked(x), Self::Ducked(y)) => *x == *y,
3470 (Self::Muted(x), Self::Muted(y)) => *x == *y,
3471 _ => false,
3472 }
3473 }
3474}
3475
3476impl UsageState {
3477 #[inline]
3478 pub fn ordinal(&self) -> u64 {
3479 match *self {
3480 Self::Unadjusted(_) => 1,
3481 Self::Ducked(_) => 2,
3482 Self::Muted(_) => 3,
3483 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
3484 }
3485 }
3486
3487 #[inline]
3488 pub fn unknown_variant_for_testing() -> Self {
3489 Self::__SourceBreaking { unknown_ordinal: 0 }
3490 }
3491
3492 #[inline]
3493 pub fn is_unknown(&self) -> bool {
3494 match self {
3495 Self::__SourceBreaking { .. } => true,
3496 _ => false,
3497 }
3498 }
3499}
3500
3501impl fidl::Persistable for UsageState {}
3502
3503#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
3507pub enum Value {
3508 BoolValue(bool),
3509 Uint64Value(u64),
3510 Int64Value(i64),
3511 StringValue(String),
3512 BytesValue(Vec<u8>),
3513}
3514
3515impl Value {
3516 #[inline]
3517 pub fn ordinal(&self) -> u64 {
3518 match *self {
3519 Self::BoolValue(_) => 1,
3520 Self::Uint64Value(_) => 2,
3521 Self::Int64Value(_) => 3,
3522 Self::StringValue(_) => 4,
3523 Self::BytesValue(_) => 5,
3524 }
3525 }
3526
3527 #[deprecated = "Strict unions should not use `is_unknown`"]
3528 #[inline]
3529 pub fn is_unknown(&self) -> bool {
3530 false
3531 }
3532}
3533
3534impl fidl::Persistable for Value {}
3535
3536#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
3540pub enum VideoCompressedFormat {
3541 TempFieldTodoRemove(u32),
3542}
3543
3544impl VideoCompressedFormat {
3545 #[inline]
3546 pub fn ordinal(&self) -> u64 {
3547 match *self {
3548 Self::TempFieldTodoRemove(_) => 1,
3549 }
3550 }
3551
3552 #[deprecated = "Strict unions should not use `is_unknown`"]
3553 #[inline]
3554 pub fn is_unknown(&self) -> bool {
3555 false
3556 }
3557}
3558
3559impl fidl::Persistable for VideoCompressedFormat {}
3560
3561#[derive(Clone, Debug, PartialEq)]
3567pub enum VideoFormat {
3568 Compressed(VideoCompressedFormat),
3569 Uncompressed(VideoUncompressedFormat),
3570}
3571
3572impl VideoFormat {
3573 #[inline]
3574 pub fn ordinal(&self) -> u64 {
3575 match *self {
3576 Self::Compressed(_) => 1,
3577 Self::Uncompressed(_) => 2,
3578 }
3579 }
3580
3581 #[deprecated = "Strict unions should not use `is_unknown`"]
3582 #[inline]
3583 pub fn is_unknown(&self) -> bool {
3584 false
3585 }
3586}
3587
3588impl fidl::Persistable for VideoFormat {}
3589
3590mod internal {
3591 use super::*;
3592 unsafe impl fidl::encoding::TypeMarker for AudioConsumerStartFlags {
3593 type Owned = Self;
3594
3595 #[inline(always)]
3596 fn inline_align(_context: fidl::encoding::Context) -> usize {
3597 4
3598 }
3599
3600 #[inline(always)]
3601 fn inline_size(_context: fidl::encoding::Context) -> usize {
3602 4
3603 }
3604 }
3605
3606 impl fidl::encoding::ValueTypeMarker for AudioConsumerStartFlags {
3607 type Borrowed<'a> = Self;
3608 #[inline(always)]
3609 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3610 *value
3611 }
3612 }
3613
3614 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
3615 for AudioConsumerStartFlags
3616 {
3617 #[inline]
3618 unsafe fn encode(
3619 self,
3620 encoder: &mut fidl::encoding::Encoder<'_, D>,
3621 offset: usize,
3622 _depth: fidl::encoding::Depth,
3623 ) -> fidl::Result<()> {
3624 encoder.debug_check_bounds::<Self>(offset);
3625 if self.bits() & Self::all().bits() != self.bits() {
3626 return Err(fidl::Error::InvalidBitsValue);
3627 }
3628 encoder.write_num(self.bits(), offset);
3629 Ok(())
3630 }
3631 }
3632
3633 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3634 for AudioConsumerStartFlags
3635 {
3636 #[inline(always)]
3637 fn new_empty() -> Self {
3638 Self::empty()
3639 }
3640
3641 #[inline]
3642 unsafe fn decode(
3643 &mut self,
3644 decoder: &mut fidl::encoding::Decoder<'_, D>,
3645 offset: usize,
3646 _depth: fidl::encoding::Depth,
3647 ) -> fidl::Result<()> {
3648 decoder.debug_check_bounds::<Self>(offset);
3649 let prim = decoder.read_num::<u32>(offset);
3650 *self = Self::from_bits(prim).ok_or(fidl::Error::InvalidBitsValue)?;
3651 Ok(())
3652 }
3653 }
3654 unsafe impl fidl::encoding::TypeMarker for AudioGainInfoFlags {
3655 type Owned = Self;
3656
3657 #[inline(always)]
3658 fn inline_align(_context: fidl::encoding::Context) -> usize {
3659 4
3660 }
3661
3662 #[inline(always)]
3663 fn inline_size(_context: fidl::encoding::Context) -> usize {
3664 4
3665 }
3666 }
3667
3668 impl fidl::encoding::ValueTypeMarker for AudioGainInfoFlags {
3669 type Borrowed<'a> = Self;
3670 #[inline(always)]
3671 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3672 *value
3673 }
3674 }
3675
3676 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
3677 for AudioGainInfoFlags
3678 {
3679 #[inline]
3680 unsafe fn encode(
3681 self,
3682 encoder: &mut fidl::encoding::Encoder<'_, D>,
3683 offset: usize,
3684 _depth: fidl::encoding::Depth,
3685 ) -> fidl::Result<()> {
3686 encoder.debug_check_bounds::<Self>(offset);
3687 if self.bits() & Self::all().bits() != self.bits() {
3688 return Err(fidl::Error::InvalidBitsValue);
3689 }
3690 encoder.write_num(self.bits(), offset);
3691 Ok(())
3692 }
3693 }
3694
3695 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AudioGainInfoFlags {
3696 #[inline(always)]
3697 fn new_empty() -> Self {
3698 Self::empty()
3699 }
3700
3701 #[inline]
3702 unsafe fn decode(
3703 &mut self,
3704 decoder: &mut fidl::encoding::Decoder<'_, D>,
3705 offset: usize,
3706 _depth: fidl::encoding::Depth,
3707 ) -> fidl::Result<()> {
3708 decoder.debug_check_bounds::<Self>(offset);
3709 let prim = decoder.read_num::<u32>(offset);
3710 *self = Self::from_bits(prim).ok_or(fidl::Error::InvalidBitsValue)?;
3711 Ok(())
3712 }
3713 }
3714 unsafe impl fidl::encoding::TypeMarker for AudioGainValidFlags {
3715 type Owned = Self;
3716
3717 #[inline(always)]
3718 fn inline_align(_context: fidl::encoding::Context) -> usize {
3719 4
3720 }
3721
3722 #[inline(always)]
3723 fn inline_size(_context: fidl::encoding::Context) -> usize {
3724 4
3725 }
3726 }
3727
3728 impl fidl::encoding::ValueTypeMarker for AudioGainValidFlags {
3729 type Borrowed<'a> = Self;
3730 #[inline(always)]
3731 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3732 *value
3733 }
3734 }
3735
3736 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
3737 for AudioGainValidFlags
3738 {
3739 #[inline]
3740 unsafe fn encode(
3741 self,
3742 encoder: &mut fidl::encoding::Encoder<'_, D>,
3743 offset: usize,
3744 _depth: fidl::encoding::Depth,
3745 ) -> fidl::Result<()> {
3746 encoder.debug_check_bounds::<Self>(offset);
3747 if self.bits() & Self::all().bits() != self.bits() {
3748 return Err(fidl::Error::InvalidBitsValue);
3749 }
3750 encoder.write_num(self.bits(), offset);
3751 Ok(())
3752 }
3753 }
3754
3755 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AudioGainValidFlags {
3756 #[inline(always)]
3757 fn new_empty() -> Self {
3758 Self::empty()
3759 }
3760
3761 #[inline]
3762 unsafe fn decode(
3763 &mut self,
3764 decoder: &mut fidl::encoding::Decoder<'_, D>,
3765 offset: usize,
3766 _depth: fidl::encoding::Depth,
3767 ) -> fidl::Result<()> {
3768 decoder.debug_check_bounds::<Self>(offset);
3769 let prim = decoder.read_num::<u32>(offset);
3770 *self = Self::from_bits(prim).ok_or(fidl::Error::InvalidBitsValue)?;
3771 Ok(())
3772 }
3773 }
3774 unsafe impl fidl::encoding::TypeMarker for AacAudioObjectType {
3775 type Owned = Self;
3776
3777 #[inline(always)]
3778 fn inline_align(_context: fidl::encoding::Context) -> usize {
3779 std::mem::align_of::<u32>()
3780 }
3781
3782 #[inline(always)]
3783 fn inline_size(_context: fidl::encoding::Context) -> usize {
3784 std::mem::size_of::<u32>()
3785 }
3786
3787 #[inline(always)]
3788 fn encode_is_copy() -> bool {
3789 true
3790 }
3791
3792 #[inline(always)]
3793 fn decode_is_copy() -> bool {
3794 false
3795 }
3796 }
3797
3798 impl fidl::encoding::ValueTypeMarker for AacAudioObjectType {
3799 type Borrowed<'a> = Self;
3800 #[inline(always)]
3801 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3802 *value
3803 }
3804 }
3805
3806 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
3807 for AacAudioObjectType
3808 {
3809 #[inline]
3810 unsafe fn encode(
3811 self,
3812 encoder: &mut fidl::encoding::Encoder<'_, D>,
3813 offset: usize,
3814 _depth: fidl::encoding::Depth,
3815 ) -> fidl::Result<()> {
3816 encoder.debug_check_bounds::<Self>(offset);
3817 encoder.write_num(self.into_primitive(), offset);
3818 Ok(())
3819 }
3820 }
3821
3822 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AacAudioObjectType {
3823 #[inline(always)]
3824 fn new_empty() -> Self {
3825 Self::Mpeg2AacLc
3826 }
3827
3828 #[inline]
3829 unsafe fn decode(
3830 &mut self,
3831 decoder: &mut fidl::encoding::Decoder<'_, D>,
3832 offset: usize,
3833 _depth: fidl::encoding::Depth,
3834 ) -> fidl::Result<()> {
3835 decoder.debug_check_bounds::<Self>(offset);
3836 let prim = decoder.read_num::<u32>(offset);
3837
3838 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
3839 Ok(())
3840 }
3841 }
3842 unsafe impl fidl::encoding::TypeMarker for AacChannelMode {
3843 type Owned = Self;
3844
3845 #[inline(always)]
3846 fn inline_align(_context: fidl::encoding::Context) -> usize {
3847 std::mem::align_of::<u32>()
3848 }
3849
3850 #[inline(always)]
3851 fn inline_size(_context: fidl::encoding::Context) -> usize {
3852 std::mem::size_of::<u32>()
3853 }
3854
3855 #[inline(always)]
3856 fn encode_is_copy() -> bool {
3857 true
3858 }
3859
3860 #[inline(always)]
3861 fn decode_is_copy() -> bool {
3862 false
3863 }
3864 }
3865
3866 impl fidl::encoding::ValueTypeMarker for AacChannelMode {
3867 type Borrowed<'a> = Self;
3868 #[inline(always)]
3869 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3870 *value
3871 }
3872 }
3873
3874 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for AacChannelMode {
3875 #[inline]
3876 unsafe fn encode(
3877 self,
3878 encoder: &mut fidl::encoding::Encoder<'_, D>,
3879 offset: usize,
3880 _depth: fidl::encoding::Depth,
3881 ) -> fidl::Result<()> {
3882 encoder.debug_check_bounds::<Self>(offset);
3883 encoder.write_num(self.into_primitive(), offset);
3884 Ok(())
3885 }
3886 }
3887
3888 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AacChannelMode {
3889 #[inline(always)]
3890 fn new_empty() -> Self {
3891 Self::Mono
3892 }
3893
3894 #[inline]
3895 unsafe fn decode(
3896 &mut self,
3897 decoder: &mut fidl::encoding::Decoder<'_, D>,
3898 offset: usize,
3899 _depth: fidl::encoding::Depth,
3900 ) -> fidl::Result<()> {
3901 decoder.debug_check_bounds::<Self>(offset);
3902 let prim = decoder.read_num::<u32>(offset);
3903
3904 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
3905 Ok(())
3906 }
3907 }
3908 unsafe impl fidl::encoding::TypeMarker for AacVariableBitRate {
3909 type Owned = Self;
3910
3911 #[inline(always)]
3912 fn inline_align(_context: fidl::encoding::Context) -> usize {
3913 std::mem::align_of::<u32>()
3914 }
3915
3916 #[inline(always)]
3917 fn inline_size(_context: fidl::encoding::Context) -> usize {
3918 std::mem::size_of::<u32>()
3919 }
3920
3921 #[inline(always)]
3922 fn encode_is_copy() -> bool {
3923 true
3924 }
3925
3926 #[inline(always)]
3927 fn decode_is_copy() -> bool {
3928 false
3929 }
3930 }
3931
3932 impl fidl::encoding::ValueTypeMarker for AacVariableBitRate {
3933 type Borrowed<'a> = Self;
3934 #[inline(always)]
3935 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3936 *value
3937 }
3938 }
3939
3940 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
3941 for AacVariableBitRate
3942 {
3943 #[inline]
3944 unsafe fn encode(
3945 self,
3946 encoder: &mut fidl::encoding::Encoder<'_, D>,
3947 offset: usize,
3948 _depth: fidl::encoding::Depth,
3949 ) -> fidl::Result<()> {
3950 encoder.debug_check_bounds::<Self>(offset);
3951 encoder.write_num(self.into_primitive(), offset);
3952 Ok(())
3953 }
3954 }
3955
3956 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AacVariableBitRate {
3957 #[inline(always)]
3958 fn new_empty() -> Self {
3959 Self::V1
3960 }
3961
3962 #[inline]
3963 unsafe fn decode(
3964 &mut self,
3965 decoder: &mut fidl::encoding::Decoder<'_, D>,
3966 offset: usize,
3967 _depth: fidl::encoding::Depth,
3968 ) -> fidl::Result<()> {
3969 decoder.debug_check_bounds::<Self>(offset);
3970 let prim = decoder.read_num::<u32>(offset);
3971
3972 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
3973 Ok(())
3974 }
3975 }
3976 unsafe impl fidl::encoding::TypeMarker for AudioBitrateMode {
3977 type Owned = Self;
3978
3979 #[inline(always)]
3980 fn inline_align(_context: fidl::encoding::Context) -> usize {
3981 std::mem::align_of::<u32>()
3982 }
3983
3984 #[inline(always)]
3985 fn inline_size(_context: fidl::encoding::Context) -> usize {
3986 std::mem::size_of::<u32>()
3987 }
3988
3989 #[inline(always)]
3990 fn encode_is_copy() -> bool {
3991 true
3992 }
3993
3994 #[inline(always)]
3995 fn decode_is_copy() -> bool {
3996 false
3997 }
3998 }
3999
4000 impl fidl::encoding::ValueTypeMarker for AudioBitrateMode {
4001 type Borrowed<'a> = Self;
4002 #[inline(always)]
4003 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4004 *value
4005 }
4006 }
4007
4008 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
4009 for AudioBitrateMode
4010 {
4011 #[inline]
4012 unsafe fn encode(
4013 self,
4014 encoder: &mut fidl::encoding::Encoder<'_, D>,
4015 offset: usize,
4016 _depth: fidl::encoding::Depth,
4017 ) -> fidl::Result<()> {
4018 encoder.debug_check_bounds::<Self>(offset);
4019 encoder.write_num(self.into_primitive(), offset);
4020 Ok(())
4021 }
4022 }
4023
4024 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AudioBitrateMode {
4025 #[inline(always)]
4026 fn new_empty() -> Self {
4027 Self::Unspecified
4028 }
4029
4030 #[inline]
4031 unsafe fn decode(
4032 &mut self,
4033 decoder: &mut fidl::encoding::Decoder<'_, D>,
4034 offset: usize,
4035 _depth: fidl::encoding::Depth,
4036 ) -> fidl::Result<()> {
4037 decoder.debug_check_bounds::<Self>(offset);
4038 let prim = decoder.read_num::<u32>(offset);
4039
4040 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
4041 Ok(())
4042 }
4043 }
4044 unsafe impl fidl::encoding::TypeMarker for AudioCaptureUsage {
4045 type Owned = Self;
4046
4047 #[inline(always)]
4048 fn inline_align(_context: fidl::encoding::Context) -> usize {
4049 std::mem::align_of::<u32>()
4050 }
4051
4052 #[inline(always)]
4053 fn inline_size(_context: fidl::encoding::Context) -> usize {
4054 std::mem::size_of::<u32>()
4055 }
4056
4057 #[inline(always)]
4058 fn encode_is_copy() -> bool {
4059 true
4060 }
4061
4062 #[inline(always)]
4063 fn decode_is_copy() -> bool {
4064 false
4065 }
4066 }
4067
4068 impl fidl::encoding::ValueTypeMarker for AudioCaptureUsage {
4069 type Borrowed<'a> = Self;
4070 #[inline(always)]
4071 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4072 *value
4073 }
4074 }
4075
4076 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
4077 for AudioCaptureUsage
4078 {
4079 #[inline]
4080 unsafe fn encode(
4081 self,
4082 encoder: &mut fidl::encoding::Encoder<'_, D>,
4083 offset: usize,
4084 _depth: fidl::encoding::Depth,
4085 ) -> fidl::Result<()> {
4086 encoder.debug_check_bounds::<Self>(offset);
4087 encoder.write_num(self.into_primitive(), offset);
4088 Ok(())
4089 }
4090 }
4091
4092 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AudioCaptureUsage {
4093 #[inline(always)]
4094 fn new_empty() -> Self {
4095 Self::Background
4096 }
4097
4098 #[inline]
4099 unsafe fn decode(
4100 &mut self,
4101 decoder: &mut fidl::encoding::Decoder<'_, D>,
4102 offset: usize,
4103 _depth: fidl::encoding::Depth,
4104 ) -> fidl::Result<()> {
4105 decoder.debug_check_bounds::<Self>(offset);
4106 let prim = decoder.read_num::<u32>(offset);
4107
4108 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
4109 Ok(())
4110 }
4111 }
4112 unsafe impl fidl::encoding::TypeMarker for AudioCaptureUsage2 {
4113 type Owned = Self;
4114
4115 #[inline(always)]
4116 fn inline_align(_context: fidl::encoding::Context) -> usize {
4117 std::mem::align_of::<u32>()
4118 }
4119
4120 #[inline(always)]
4121 fn inline_size(_context: fidl::encoding::Context) -> usize {
4122 std::mem::size_of::<u32>()
4123 }
4124
4125 #[inline(always)]
4126 fn encode_is_copy() -> bool {
4127 false
4128 }
4129
4130 #[inline(always)]
4131 fn decode_is_copy() -> bool {
4132 false
4133 }
4134 }
4135
4136 impl fidl::encoding::ValueTypeMarker for AudioCaptureUsage2 {
4137 type Borrowed<'a> = Self;
4138 #[inline(always)]
4139 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4140 *value
4141 }
4142 }
4143
4144 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
4145 for AudioCaptureUsage2
4146 {
4147 #[inline]
4148 unsafe fn encode(
4149 self,
4150 encoder: &mut fidl::encoding::Encoder<'_, D>,
4151 offset: usize,
4152 _depth: fidl::encoding::Depth,
4153 ) -> fidl::Result<()> {
4154 encoder.debug_check_bounds::<Self>(offset);
4155 encoder.write_num(self.into_primitive(), offset);
4156 Ok(())
4157 }
4158 }
4159
4160 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AudioCaptureUsage2 {
4161 #[inline(always)]
4162 fn new_empty() -> Self {
4163 Self::unknown()
4164 }
4165
4166 #[inline]
4167 unsafe fn decode(
4168 &mut self,
4169 decoder: &mut fidl::encoding::Decoder<'_, D>,
4170 offset: usize,
4171 _depth: fidl::encoding::Depth,
4172 ) -> fidl::Result<()> {
4173 decoder.debug_check_bounds::<Self>(offset);
4174 let prim = decoder.read_num::<u32>(offset);
4175
4176 *self = Self::from_primitive_allow_unknown(prim);
4177 Ok(())
4178 }
4179 }
4180 unsafe impl fidl::encoding::TypeMarker for AudioChannelId {
4181 type Owned = Self;
4182
4183 #[inline(always)]
4184 fn inline_align(_context: fidl::encoding::Context) -> usize {
4185 std::mem::align_of::<u32>()
4186 }
4187
4188 #[inline(always)]
4189 fn inline_size(_context: fidl::encoding::Context) -> usize {
4190 std::mem::size_of::<u32>()
4191 }
4192
4193 #[inline(always)]
4194 fn encode_is_copy() -> bool {
4195 true
4196 }
4197
4198 #[inline(always)]
4199 fn decode_is_copy() -> bool {
4200 false
4201 }
4202 }
4203
4204 impl fidl::encoding::ValueTypeMarker for AudioChannelId {
4205 type Borrowed<'a> = Self;
4206 #[inline(always)]
4207 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4208 *value
4209 }
4210 }
4211
4212 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for AudioChannelId {
4213 #[inline]
4214 unsafe fn encode(
4215 self,
4216 encoder: &mut fidl::encoding::Encoder<'_, D>,
4217 offset: usize,
4218 _depth: fidl::encoding::Depth,
4219 ) -> fidl::Result<()> {
4220 encoder.debug_check_bounds::<Self>(offset);
4221 encoder.write_num(self.into_primitive(), offset);
4222 Ok(())
4223 }
4224 }
4225
4226 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AudioChannelId {
4227 #[inline(always)]
4228 fn new_empty() -> Self {
4229 Self::Skip
4230 }
4231
4232 #[inline]
4233 unsafe fn decode(
4234 &mut self,
4235 decoder: &mut fidl::encoding::Decoder<'_, D>,
4236 offset: usize,
4237 _depth: fidl::encoding::Depth,
4238 ) -> fidl::Result<()> {
4239 decoder.debug_check_bounds::<Self>(offset);
4240 let prim = decoder.read_num::<u32>(offset);
4241
4242 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
4243 Ok(())
4244 }
4245 }
4246 unsafe impl fidl::encoding::TypeMarker for AudioOutputRoutingPolicy {
4247 type Owned = Self;
4248
4249 #[inline(always)]
4250 fn inline_align(_context: fidl::encoding::Context) -> usize {
4251 std::mem::align_of::<u32>()
4252 }
4253
4254 #[inline(always)]
4255 fn inline_size(_context: fidl::encoding::Context) -> usize {
4256 std::mem::size_of::<u32>()
4257 }
4258
4259 #[inline(always)]
4260 fn encode_is_copy() -> bool {
4261 true
4262 }
4263
4264 #[inline(always)]
4265 fn decode_is_copy() -> bool {
4266 false
4267 }
4268 }
4269
4270 impl fidl::encoding::ValueTypeMarker for AudioOutputRoutingPolicy {
4271 type Borrowed<'a> = Self;
4272 #[inline(always)]
4273 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4274 *value
4275 }
4276 }
4277
4278 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
4279 for AudioOutputRoutingPolicy
4280 {
4281 #[inline]
4282 unsafe fn encode(
4283 self,
4284 encoder: &mut fidl::encoding::Encoder<'_, D>,
4285 offset: usize,
4286 _depth: fidl::encoding::Depth,
4287 ) -> fidl::Result<()> {
4288 encoder.debug_check_bounds::<Self>(offset);
4289 encoder.write_num(self.into_primitive(), offset);
4290 Ok(())
4291 }
4292 }
4293
4294 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4295 for AudioOutputRoutingPolicy
4296 {
4297 #[inline(always)]
4298 fn new_empty() -> Self {
4299 Self::AllPluggedOutputs
4300 }
4301
4302 #[inline]
4303 unsafe fn decode(
4304 &mut self,
4305 decoder: &mut fidl::encoding::Decoder<'_, D>,
4306 offset: usize,
4307 _depth: fidl::encoding::Depth,
4308 ) -> fidl::Result<()> {
4309 decoder.debug_check_bounds::<Self>(offset);
4310 let prim = decoder.read_num::<u32>(offset);
4311
4312 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
4313 Ok(())
4314 }
4315 }
4316 unsafe impl fidl::encoding::TypeMarker for AudioPcmMode {
4317 type Owned = Self;
4318
4319 #[inline(always)]
4320 fn inline_align(_context: fidl::encoding::Context) -> usize {
4321 std::mem::align_of::<u32>()
4322 }
4323
4324 #[inline(always)]
4325 fn inline_size(_context: fidl::encoding::Context) -> usize {
4326 std::mem::size_of::<u32>()
4327 }
4328
4329 #[inline(always)]
4330 fn encode_is_copy() -> bool {
4331 true
4332 }
4333
4334 #[inline(always)]
4335 fn decode_is_copy() -> bool {
4336 false
4337 }
4338 }
4339
4340 impl fidl::encoding::ValueTypeMarker for AudioPcmMode {
4341 type Borrowed<'a> = Self;
4342 #[inline(always)]
4343 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4344 *value
4345 }
4346 }
4347
4348 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for AudioPcmMode {
4349 #[inline]
4350 unsafe fn encode(
4351 self,
4352 encoder: &mut fidl::encoding::Encoder<'_, D>,
4353 offset: usize,
4354 _depth: fidl::encoding::Depth,
4355 ) -> fidl::Result<()> {
4356 encoder.debug_check_bounds::<Self>(offset);
4357 encoder.write_num(self.into_primitive(), offset);
4358 Ok(())
4359 }
4360 }
4361
4362 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AudioPcmMode {
4363 #[inline(always)]
4364 fn new_empty() -> Self {
4365 Self::Linear
4366 }
4367
4368 #[inline]
4369 unsafe fn decode(
4370 &mut self,
4371 decoder: &mut fidl::encoding::Decoder<'_, D>,
4372 offset: usize,
4373 _depth: fidl::encoding::Depth,
4374 ) -> fidl::Result<()> {
4375 decoder.debug_check_bounds::<Self>(offset);
4376 let prim = decoder.read_num::<u32>(offset);
4377
4378 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
4379 Ok(())
4380 }
4381 }
4382 unsafe impl fidl::encoding::TypeMarker for AudioRenderUsage {
4383 type Owned = Self;
4384
4385 #[inline(always)]
4386 fn inline_align(_context: fidl::encoding::Context) -> usize {
4387 std::mem::align_of::<u32>()
4388 }
4389
4390 #[inline(always)]
4391 fn inline_size(_context: fidl::encoding::Context) -> usize {
4392 std::mem::size_of::<u32>()
4393 }
4394
4395 #[inline(always)]
4396 fn encode_is_copy() -> bool {
4397 true
4398 }
4399
4400 #[inline(always)]
4401 fn decode_is_copy() -> bool {
4402 false
4403 }
4404 }
4405
4406 impl fidl::encoding::ValueTypeMarker for AudioRenderUsage {
4407 type Borrowed<'a> = Self;
4408 #[inline(always)]
4409 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4410 *value
4411 }
4412 }
4413
4414 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
4415 for AudioRenderUsage
4416 {
4417 #[inline]
4418 unsafe fn encode(
4419 self,
4420 encoder: &mut fidl::encoding::Encoder<'_, D>,
4421 offset: usize,
4422 _depth: fidl::encoding::Depth,
4423 ) -> fidl::Result<()> {
4424 encoder.debug_check_bounds::<Self>(offset);
4425 encoder.write_num(self.into_primitive(), offset);
4426 Ok(())
4427 }
4428 }
4429
4430 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AudioRenderUsage {
4431 #[inline(always)]
4432 fn new_empty() -> Self {
4433 Self::Background
4434 }
4435
4436 #[inline]
4437 unsafe fn decode(
4438 &mut self,
4439 decoder: &mut fidl::encoding::Decoder<'_, D>,
4440 offset: usize,
4441 _depth: fidl::encoding::Depth,
4442 ) -> fidl::Result<()> {
4443 decoder.debug_check_bounds::<Self>(offset);
4444 let prim = decoder.read_num::<u32>(offset);
4445
4446 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
4447 Ok(())
4448 }
4449 }
4450 unsafe impl fidl::encoding::TypeMarker for AudioRenderUsage2 {
4451 type Owned = Self;
4452
4453 #[inline(always)]
4454 fn inline_align(_context: fidl::encoding::Context) -> usize {
4455 std::mem::align_of::<u32>()
4456 }
4457
4458 #[inline(always)]
4459 fn inline_size(_context: fidl::encoding::Context) -> usize {
4460 std::mem::size_of::<u32>()
4461 }
4462
4463 #[inline(always)]
4464 fn encode_is_copy() -> bool {
4465 false
4466 }
4467
4468 #[inline(always)]
4469 fn decode_is_copy() -> bool {
4470 false
4471 }
4472 }
4473
4474 impl fidl::encoding::ValueTypeMarker for AudioRenderUsage2 {
4475 type Borrowed<'a> = Self;
4476 #[inline(always)]
4477 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4478 *value
4479 }
4480 }
4481
4482 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
4483 for AudioRenderUsage2
4484 {
4485 #[inline]
4486 unsafe fn encode(
4487 self,
4488 encoder: &mut fidl::encoding::Encoder<'_, D>,
4489 offset: usize,
4490 _depth: fidl::encoding::Depth,
4491 ) -> fidl::Result<()> {
4492 encoder.debug_check_bounds::<Self>(offset);
4493 encoder.write_num(self.into_primitive(), offset);
4494 Ok(())
4495 }
4496 }
4497
4498 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AudioRenderUsage2 {
4499 #[inline(always)]
4500 fn new_empty() -> Self {
4501 Self::unknown()
4502 }
4503
4504 #[inline]
4505 unsafe fn decode(
4506 &mut self,
4507 decoder: &mut fidl::encoding::Decoder<'_, D>,
4508 offset: usize,
4509 _depth: fidl::encoding::Depth,
4510 ) -> fidl::Result<()> {
4511 decoder.debug_check_bounds::<Self>(offset);
4512 let prim = decoder.read_num::<u32>(offset);
4513
4514 *self = Self::from_primitive_allow_unknown(prim);
4515 Ok(())
4516 }
4517 }
4518 unsafe impl fidl::encoding::TypeMarker for AudioSampleFormat {
4519 type Owned = Self;
4520
4521 #[inline(always)]
4522 fn inline_align(_context: fidl::encoding::Context) -> usize {
4523 std::mem::align_of::<u32>()
4524 }
4525
4526 #[inline(always)]
4527 fn inline_size(_context: fidl::encoding::Context) -> usize {
4528 std::mem::size_of::<u32>()
4529 }
4530
4531 #[inline(always)]
4532 fn encode_is_copy() -> bool {
4533 true
4534 }
4535
4536 #[inline(always)]
4537 fn decode_is_copy() -> bool {
4538 false
4539 }
4540 }
4541
4542 impl fidl::encoding::ValueTypeMarker for AudioSampleFormat {
4543 type Borrowed<'a> = Self;
4544 #[inline(always)]
4545 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4546 *value
4547 }
4548 }
4549
4550 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
4551 for AudioSampleFormat
4552 {
4553 #[inline]
4554 unsafe fn encode(
4555 self,
4556 encoder: &mut fidl::encoding::Encoder<'_, D>,
4557 offset: usize,
4558 _depth: fidl::encoding::Depth,
4559 ) -> fidl::Result<()> {
4560 encoder.debug_check_bounds::<Self>(offset);
4561 encoder.write_num(self.into_primitive(), offset);
4562 Ok(())
4563 }
4564 }
4565
4566 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AudioSampleFormat {
4567 #[inline(always)]
4568 fn new_empty() -> Self {
4569 Self::Unsigned8
4570 }
4571
4572 #[inline]
4573 unsafe fn decode(
4574 &mut self,
4575 decoder: &mut fidl::encoding::Decoder<'_, D>,
4576 offset: usize,
4577 _depth: fidl::encoding::Depth,
4578 ) -> fidl::Result<()> {
4579 decoder.debug_check_bounds::<Self>(offset);
4580 let prim = decoder.read_num::<u32>(offset);
4581
4582 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
4583 Ok(())
4584 }
4585 }
4586 unsafe impl fidl::encoding::TypeMarker for Behavior {
4587 type Owned = Self;
4588
4589 #[inline(always)]
4590 fn inline_align(_context: fidl::encoding::Context) -> usize {
4591 std::mem::align_of::<u32>()
4592 }
4593
4594 #[inline(always)]
4595 fn inline_size(_context: fidl::encoding::Context) -> usize {
4596 std::mem::size_of::<u32>()
4597 }
4598
4599 #[inline(always)]
4600 fn encode_is_copy() -> bool {
4601 false
4602 }
4603
4604 #[inline(always)]
4605 fn decode_is_copy() -> bool {
4606 false
4607 }
4608 }
4609
4610 impl fidl::encoding::ValueTypeMarker for Behavior {
4611 type Borrowed<'a> = Self;
4612 #[inline(always)]
4613 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4614 *value
4615 }
4616 }
4617
4618 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for Behavior {
4619 #[inline]
4620 unsafe fn encode(
4621 self,
4622 encoder: &mut fidl::encoding::Encoder<'_, D>,
4623 offset: usize,
4624 _depth: fidl::encoding::Depth,
4625 ) -> fidl::Result<()> {
4626 encoder.debug_check_bounds::<Self>(offset);
4627 encoder.write_num(self.into_primitive(), offset);
4628 Ok(())
4629 }
4630 }
4631
4632 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Behavior {
4633 #[inline(always)]
4634 fn new_empty() -> Self {
4635 Self::unknown()
4636 }
4637
4638 #[inline]
4639 unsafe fn decode(
4640 &mut self,
4641 decoder: &mut fidl::encoding::Decoder<'_, D>,
4642 offset: usize,
4643 _depth: fidl::encoding::Depth,
4644 ) -> fidl::Result<()> {
4645 decoder.debug_check_bounds::<Self>(offset);
4646 let prim = decoder.read_num::<u32>(offset);
4647
4648 *self = Self::from_primitive_allow_unknown(prim);
4649 Ok(())
4650 }
4651 }
4652 unsafe impl fidl::encoding::TypeMarker for CodecProfile {
4653 type Owned = Self;
4654
4655 #[inline(always)]
4656 fn inline_align(_context: fidl::encoding::Context) -> usize {
4657 std::mem::align_of::<u32>()
4658 }
4659
4660 #[inline(always)]
4661 fn inline_size(_context: fidl::encoding::Context) -> usize {
4662 std::mem::size_of::<u32>()
4663 }
4664
4665 #[inline(always)]
4666 fn encode_is_copy() -> bool {
4667 false
4668 }
4669
4670 #[inline(always)]
4671 fn decode_is_copy() -> bool {
4672 false
4673 }
4674 }
4675
4676 impl fidl::encoding::ValueTypeMarker for CodecProfile {
4677 type Borrowed<'a> = Self;
4678 #[inline(always)]
4679 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4680 *value
4681 }
4682 }
4683
4684 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for CodecProfile {
4685 #[inline]
4686 unsafe fn encode(
4687 self,
4688 encoder: &mut fidl::encoding::Encoder<'_, D>,
4689 offset: usize,
4690 _depth: fidl::encoding::Depth,
4691 ) -> fidl::Result<()> {
4692 encoder.debug_check_bounds::<Self>(offset);
4693 encoder.write_num(self.into_primitive(), offset);
4694 Ok(())
4695 }
4696 }
4697
4698 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CodecProfile {
4699 #[inline(always)]
4700 fn new_empty() -> Self {
4701 Self::unknown()
4702 }
4703
4704 #[inline]
4705 unsafe fn decode(
4706 &mut self,
4707 decoder: &mut fidl::encoding::Decoder<'_, D>,
4708 offset: usize,
4709 _depth: fidl::encoding::Depth,
4710 ) -> fidl::Result<()> {
4711 decoder.debug_check_bounds::<Self>(offset);
4712 let prim = decoder.read_num::<u32>(offset);
4713
4714 *self = Self::from_primitive_allow_unknown(prim);
4715 Ok(())
4716 }
4717 }
4718 unsafe impl fidl::encoding::TypeMarker for ColorSpace {
4719 type Owned = Self;
4720
4721 #[inline(always)]
4722 fn inline_align(_context: fidl::encoding::Context) -> usize {
4723 std::mem::align_of::<u32>()
4724 }
4725
4726 #[inline(always)]
4727 fn inline_size(_context: fidl::encoding::Context) -> usize {
4728 std::mem::size_of::<u32>()
4729 }
4730
4731 #[inline(always)]
4732 fn encode_is_copy() -> bool {
4733 true
4734 }
4735
4736 #[inline(always)]
4737 fn decode_is_copy() -> bool {
4738 false
4739 }
4740 }
4741
4742 impl fidl::encoding::ValueTypeMarker for ColorSpace {
4743 type Borrowed<'a> = Self;
4744 #[inline(always)]
4745 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4746 *value
4747 }
4748 }
4749
4750 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for ColorSpace {
4751 #[inline]
4752 unsafe fn encode(
4753 self,
4754 encoder: &mut fidl::encoding::Encoder<'_, D>,
4755 offset: usize,
4756 _depth: fidl::encoding::Depth,
4757 ) -> fidl::Result<()> {
4758 encoder.debug_check_bounds::<Self>(offset);
4759 encoder.write_num(self.into_primitive(), offset);
4760 Ok(())
4761 }
4762 }
4763
4764 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ColorSpace {
4765 #[inline(always)]
4766 fn new_empty() -> Self {
4767 Self::Unknown
4768 }
4769
4770 #[inline]
4771 unsafe fn decode(
4772 &mut self,
4773 decoder: &mut fidl::encoding::Decoder<'_, D>,
4774 offset: usize,
4775 _depth: fidl::encoding::Depth,
4776 ) -> fidl::Result<()> {
4777 decoder.debug_check_bounds::<Self>(offset);
4778 let prim = decoder.read_num::<u32>(offset);
4779
4780 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
4781 Ok(())
4782 }
4783 }
4784 unsafe impl fidl::encoding::TypeMarker for Lc3FrameDuration {
4785 type Owned = Self;
4786
4787 #[inline(always)]
4788 fn inline_align(_context: fidl::encoding::Context) -> usize {
4789 std::mem::align_of::<u32>()
4790 }
4791
4792 #[inline(always)]
4793 fn inline_size(_context: fidl::encoding::Context) -> usize {
4794 std::mem::size_of::<u32>()
4795 }
4796
4797 #[inline(always)]
4798 fn encode_is_copy() -> bool {
4799 false
4800 }
4801
4802 #[inline(always)]
4803 fn decode_is_copy() -> bool {
4804 false
4805 }
4806 }
4807
4808 impl fidl::encoding::ValueTypeMarker for Lc3FrameDuration {
4809 type Borrowed<'a> = Self;
4810 #[inline(always)]
4811 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4812 *value
4813 }
4814 }
4815
4816 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
4817 for Lc3FrameDuration
4818 {
4819 #[inline]
4820 unsafe fn encode(
4821 self,
4822 encoder: &mut fidl::encoding::Encoder<'_, D>,
4823 offset: usize,
4824 _depth: fidl::encoding::Depth,
4825 ) -> fidl::Result<()> {
4826 encoder.debug_check_bounds::<Self>(offset);
4827 encoder.write_num(self.into_primitive(), offset);
4828 Ok(())
4829 }
4830 }
4831
4832 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Lc3FrameDuration {
4833 #[inline(always)]
4834 fn new_empty() -> Self {
4835 Self::unknown()
4836 }
4837
4838 #[inline]
4839 unsafe fn decode(
4840 &mut self,
4841 decoder: &mut fidl::encoding::Decoder<'_, D>,
4842 offset: usize,
4843 _depth: fidl::encoding::Depth,
4844 ) -> fidl::Result<()> {
4845 decoder.debug_check_bounds::<Self>(offset);
4846 let prim = decoder.read_num::<u32>(offset);
4847
4848 *self = Self::from_primitive_allow_unknown(prim);
4849 Ok(())
4850 }
4851 }
4852 unsafe impl fidl::encoding::TypeMarker for SbcAllocation {
4853 type Owned = Self;
4854
4855 #[inline(always)]
4856 fn inline_align(_context: fidl::encoding::Context) -> usize {
4857 std::mem::align_of::<u32>()
4858 }
4859
4860 #[inline(always)]
4861 fn inline_size(_context: fidl::encoding::Context) -> usize {
4862 std::mem::size_of::<u32>()
4863 }
4864
4865 #[inline(always)]
4866 fn encode_is_copy() -> bool {
4867 true
4868 }
4869
4870 #[inline(always)]
4871 fn decode_is_copy() -> bool {
4872 false
4873 }
4874 }
4875
4876 impl fidl::encoding::ValueTypeMarker for SbcAllocation {
4877 type Borrowed<'a> = Self;
4878 #[inline(always)]
4879 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4880 *value
4881 }
4882 }
4883
4884 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for SbcAllocation {
4885 #[inline]
4886 unsafe fn encode(
4887 self,
4888 encoder: &mut fidl::encoding::Encoder<'_, D>,
4889 offset: usize,
4890 _depth: fidl::encoding::Depth,
4891 ) -> fidl::Result<()> {
4892 encoder.debug_check_bounds::<Self>(offset);
4893 encoder.write_num(self.into_primitive(), offset);
4894 Ok(())
4895 }
4896 }
4897
4898 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SbcAllocation {
4899 #[inline(always)]
4900 fn new_empty() -> Self {
4901 Self::AllocLoudness
4902 }
4903
4904 #[inline]
4905 unsafe fn decode(
4906 &mut self,
4907 decoder: &mut fidl::encoding::Decoder<'_, D>,
4908 offset: usize,
4909 _depth: fidl::encoding::Depth,
4910 ) -> fidl::Result<()> {
4911 decoder.debug_check_bounds::<Self>(offset);
4912 let prim = decoder.read_num::<u32>(offset);
4913
4914 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
4915 Ok(())
4916 }
4917 }
4918 unsafe impl fidl::encoding::TypeMarker for SbcBlockCount {
4919 type Owned = Self;
4920
4921 #[inline(always)]
4922 fn inline_align(_context: fidl::encoding::Context) -> usize {
4923 std::mem::align_of::<u32>()
4924 }
4925
4926 #[inline(always)]
4927 fn inline_size(_context: fidl::encoding::Context) -> usize {
4928 std::mem::size_of::<u32>()
4929 }
4930
4931 #[inline(always)]
4932 fn encode_is_copy() -> bool {
4933 true
4934 }
4935
4936 #[inline(always)]
4937 fn decode_is_copy() -> bool {
4938 false
4939 }
4940 }
4941
4942 impl fidl::encoding::ValueTypeMarker for SbcBlockCount {
4943 type Borrowed<'a> = Self;
4944 #[inline(always)]
4945 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4946 *value
4947 }
4948 }
4949
4950 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for SbcBlockCount {
4951 #[inline]
4952 unsafe fn encode(
4953 self,
4954 encoder: &mut fidl::encoding::Encoder<'_, D>,
4955 offset: usize,
4956 _depth: fidl::encoding::Depth,
4957 ) -> fidl::Result<()> {
4958 encoder.debug_check_bounds::<Self>(offset);
4959 encoder.write_num(self.into_primitive(), offset);
4960 Ok(())
4961 }
4962 }
4963
4964 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SbcBlockCount {
4965 #[inline(always)]
4966 fn new_empty() -> Self {
4967 Self::BlockCount4
4968 }
4969
4970 #[inline]
4971 unsafe fn decode(
4972 &mut self,
4973 decoder: &mut fidl::encoding::Decoder<'_, D>,
4974 offset: usize,
4975 _depth: fidl::encoding::Depth,
4976 ) -> fidl::Result<()> {
4977 decoder.debug_check_bounds::<Self>(offset);
4978 let prim = decoder.read_num::<u32>(offset);
4979
4980 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
4981 Ok(())
4982 }
4983 }
4984 unsafe impl fidl::encoding::TypeMarker for SbcChannelMode {
4985 type Owned = Self;
4986
4987 #[inline(always)]
4988 fn inline_align(_context: fidl::encoding::Context) -> usize {
4989 std::mem::align_of::<u32>()
4990 }
4991
4992 #[inline(always)]
4993 fn inline_size(_context: fidl::encoding::Context) -> usize {
4994 std::mem::size_of::<u32>()
4995 }
4996
4997 #[inline(always)]
4998 fn encode_is_copy() -> bool {
4999 true
5000 }
5001
5002 #[inline(always)]
5003 fn decode_is_copy() -> bool {
5004 false
5005 }
5006 }
5007
5008 impl fidl::encoding::ValueTypeMarker for SbcChannelMode {
5009 type Borrowed<'a> = Self;
5010 #[inline(always)]
5011 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5012 *value
5013 }
5014 }
5015
5016 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for SbcChannelMode {
5017 #[inline]
5018 unsafe fn encode(
5019 self,
5020 encoder: &mut fidl::encoding::Encoder<'_, D>,
5021 offset: usize,
5022 _depth: fidl::encoding::Depth,
5023 ) -> fidl::Result<()> {
5024 encoder.debug_check_bounds::<Self>(offset);
5025 encoder.write_num(self.into_primitive(), offset);
5026 Ok(())
5027 }
5028 }
5029
5030 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SbcChannelMode {
5031 #[inline(always)]
5032 fn new_empty() -> Self {
5033 Self::Mono
5034 }
5035
5036 #[inline]
5037 unsafe fn decode(
5038 &mut self,
5039 decoder: &mut fidl::encoding::Decoder<'_, D>,
5040 offset: usize,
5041 _depth: fidl::encoding::Depth,
5042 ) -> fidl::Result<()> {
5043 decoder.debug_check_bounds::<Self>(offset);
5044 let prim = decoder.read_num::<u32>(offset);
5045
5046 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
5047 Ok(())
5048 }
5049 }
5050 unsafe impl fidl::encoding::TypeMarker for SbcSubBands {
5051 type Owned = Self;
5052
5053 #[inline(always)]
5054 fn inline_align(_context: fidl::encoding::Context) -> usize {
5055 std::mem::align_of::<u32>()
5056 }
5057
5058 #[inline(always)]
5059 fn inline_size(_context: fidl::encoding::Context) -> usize {
5060 std::mem::size_of::<u32>()
5061 }
5062
5063 #[inline(always)]
5064 fn encode_is_copy() -> bool {
5065 true
5066 }
5067
5068 #[inline(always)]
5069 fn decode_is_copy() -> bool {
5070 false
5071 }
5072 }
5073
5074 impl fidl::encoding::ValueTypeMarker for SbcSubBands {
5075 type Borrowed<'a> = Self;
5076 #[inline(always)]
5077 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5078 *value
5079 }
5080 }
5081
5082 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for SbcSubBands {
5083 #[inline]
5084 unsafe fn encode(
5085 self,
5086 encoder: &mut fidl::encoding::Encoder<'_, D>,
5087 offset: usize,
5088 _depth: fidl::encoding::Depth,
5089 ) -> fidl::Result<()> {
5090 encoder.debug_check_bounds::<Self>(offset);
5091 encoder.write_num(self.into_primitive(), offset);
5092 Ok(())
5093 }
5094 }
5095
5096 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SbcSubBands {
5097 #[inline(always)]
5098 fn new_empty() -> Self {
5099 Self::SubBands4
5100 }
5101
5102 #[inline]
5103 unsafe fn decode(
5104 &mut self,
5105 decoder: &mut fidl::encoding::Decoder<'_, D>,
5106 offset: usize,
5107 _depth: fidl::encoding::Depth,
5108 ) -> fidl::Result<()> {
5109 decoder.debug_check_bounds::<Self>(offset);
5110 let prim = decoder.read_num::<u32>(offset);
5111
5112 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
5113 Ok(())
5114 }
5115 }
5116 unsafe impl fidl::encoding::TypeMarker for StreamError {
5117 type Owned = Self;
5118
5119 #[inline(always)]
5120 fn inline_align(_context: fidl::encoding::Context) -> usize {
5121 std::mem::align_of::<u32>()
5122 }
5123
5124 #[inline(always)]
5125 fn inline_size(_context: fidl::encoding::Context) -> usize {
5126 std::mem::size_of::<u32>()
5127 }
5128
5129 #[inline(always)]
5130 fn encode_is_copy() -> bool {
5131 true
5132 }
5133
5134 #[inline(always)]
5135 fn decode_is_copy() -> bool {
5136 false
5137 }
5138 }
5139
5140 impl fidl::encoding::ValueTypeMarker for StreamError {
5141 type Borrowed<'a> = Self;
5142 #[inline(always)]
5143 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5144 *value
5145 }
5146 }
5147
5148 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for StreamError {
5149 #[inline]
5150 unsafe fn encode(
5151 self,
5152 encoder: &mut fidl::encoding::Encoder<'_, D>,
5153 offset: usize,
5154 _depth: fidl::encoding::Depth,
5155 ) -> fidl::Result<()> {
5156 encoder.debug_check_bounds::<Self>(offset);
5157 encoder.write_num(self.into_primitive(), offset);
5158 Ok(())
5159 }
5160 }
5161
5162 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for StreamError {
5163 #[inline(always)]
5164 fn new_empty() -> Self {
5165 Self::Unknown
5166 }
5167
5168 #[inline]
5169 unsafe fn decode(
5170 &mut self,
5171 decoder: &mut fidl::encoding::Decoder<'_, D>,
5172 offset: usize,
5173 _depth: fidl::encoding::Depth,
5174 ) -> fidl::Result<()> {
5175 decoder.debug_check_bounds::<Self>(offset);
5176 let prim = decoder.read_num::<u32>(offset);
5177
5178 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
5179 Ok(())
5180 }
5181 }
5182 unsafe impl fidl::encoding::TypeMarker for VideoColorSpace {
5183 type Owned = Self;
5184
5185 #[inline(always)]
5186 fn inline_align(_context: fidl::encoding::Context) -> usize {
5187 std::mem::align_of::<u32>()
5188 }
5189
5190 #[inline(always)]
5191 fn inline_size(_context: fidl::encoding::Context) -> usize {
5192 std::mem::size_of::<u32>()
5193 }
5194
5195 #[inline(always)]
5196 fn encode_is_copy() -> bool {
5197 true
5198 }
5199
5200 #[inline(always)]
5201 fn decode_is_copy() -> bool {
5202 false
5203 }
5204 }
5205
5206 impl fidl::encoding::ValueTypeMarker for VideoColorSpace {
5207 type Borrowed<'a> = Self;
5208 #[inline(always)]
5209 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5210 *value
5211 }
5212 }
5213
5214 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
5215 for VideoColorSpace
5216 {
5217 #[inline]
5218 unsafe fn encode(
5219 self,
5220 encoder: &mut fidl::encoding::Encoder<'_, D>,
5221 offset: usize,
5222 _depth: fidl::encoding::Depth,
5223 ) -> fidl::Result<()> {
5224 encoder.debug_check_bounds::<Self>(offset);
5225 encoder.write_num(self.into_primitive(), offset);
5226 Ok(())
5227 }
5228 }
5229
5230 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for VideoColorSpace {
5231 #[inline(always)]
5232 fn new_empty() -> Self {
5233 Self::Invalid
5234 }
5235
5236 #[inline]
5237 unsafe fn decode(
5238 &mut self,
5239 decoder: &mut fidl::encoding::Decoder<'_, D>,
5240 offset: usize,
5241 _depth: fidl::encoding::Depth,
5242 ) -> fidl::Result<()> {
5243 decoder.debug_check_bounds::<Self>(offset);
5244 let prim = decoder.read_num::<u32>(offset);
5245
5246 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
5247 Ok(())
5248 }
5249 }
5250
5251 impl fidl::encoding::ValueTypeMarker for AacConstantBitRate {
5252 type Borrowed<'a> = &'a Self;
5253 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5254 value
5255 }
5256 }
5257
5258 unsafe impl fidl::encoding::TypeMarker for AacConstantBitRate {
5259 type Owned = Self;
5260
5261 #[inline(always)]
5262 fn inline_align(_context: fidl::encoding::Context) -> usize {
5263 4
5264 }
5265
5266 #[inline(always)]
5267 fn inline_size(_context: fidl::encoding::Context) -> usize {
5268 4
5269 }
5270 #[inline(always)]
5271 fn encode_is_copy() -> bool {
5272 true
5273 }
5274
5275 #[inline(always)]
5276 fn decode_is_copy() -> bool {
5277 true
5278 }
5279 }
5280
5281 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AacConstantBitRate, D>
5282 for &AacConstantBitRate
5283 {
5284 #[inline]
5285 unsafe fn encode(
5286 self,
5287 encoder: &mut fidl::encoding::Encoder<'_, D>,
5288 offset: usize,
5289 _depth: fidl::encoding::Depth,
5290 ) -> fidl::Result<()> {
5291 encoder.debug_check_bounds::<AacConstantBitRate>(offset);
5292 unsafe {
5293 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
5295 (buf_ptr as *mut AacConstantBitRate)
5296 .write_unaligned((self as *const AacConstantBitRate).read());
5297 }
5300 Ok(())
5301 }
5302 }
5303 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
5304 fidl::encoding::Encode<AacConstantBitRate, D> for (T0,)
5305 {
5306 #[inline]
5307 unsafe fn encode(
5308 self,
5309 encoder: &mut fidl::encoding::Encoder<'_, D>,
5310 offset: usize,
5311 depth: fidl::encoding::Depth,
5312 ) -> fidl::Result<()> {
5313 encoder.debug_check_bounds::<AacConstantBitRate>(offset);
5314 self.0.encode(encoder, offset + 0, depth)?;
5318 Ok(())
5319 }
5320 }
5321
5322 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AacConstantBitRate {
5323 #[inline(always)]
5324 fn new_empty() -> Self {
5325 Self { bit_rate: fidl::new_empty!(u32, D) }
5326 }
5327
5328 #[inline]
5329 unsafe fn decode(
5330 &mut self,
5331 decoder: &mut fidl::encoding::Decoder<'_, D>,
5332 offset: usize,
5333 _depth: fidl::encoding::Depth,
5334 ) -> fidl::Result<()> {
5335 decoder.debug_check_bounds::<Self>(offset);
5336 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
5337 unsafe {
5340 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
5341 }
5342 Ok(())
5343 }
5344 }
5345
5346 impl fidl::encoding::ValueTypeMarker for AacEncoderSettings {
5347 type Borrowed<'a> = &'a Self;
5348 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5349 value
5350 }
5351 }
5352
5353 unsafe impl fidl::encoding::TypeMarker for AacEncoderSettings {
5354 type Owned = Self;
5355
5356 #[inline(always)]
5357 fn inline_align(_context: fidl::encoding::Context) -> usize {
5358 8
5359 }
5360
5361 #[inline(always)]
5362 fn inline_size(_context: fidl::encoding::Context) -> usize {
5363 48
5364 }
5365 }
5366
5367 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AacEncoderSettings, D>
5368 for &AacEncoderSettings
5369 {
5370 #[inline]
5371 unsafe fn encode(
5372 self,
5373 encoder: &mut fidl::encoding::Encoder<'_, D>,
5374 offset: usize,
5375 _depth: fidl::encoding::Depth,
5376 ) -> fidl::Result<()> {
5377 encoder.debug_check_bounds::<AacEncoderSettings>(offset);
5378 fidl::encoding::Encode::<AacEncoderSettings, D>::encode(
5380 (
5381 <AacTransport as fidl::encoding::ValueTypeMarker>::borrow(&self.transport),
5382 <AacChannelMode as fidl::encoding::ValueTypeMarker>::borrow(&self.channel_mode),
5383 <AacBitRate as fidl::encoding::ValueTypeMarker>::borrow(&self.bit_rate),
5384 <AacAudioObjectType as fidl::encoding::ValueTypeMarker>::borrow(&self.aot),
5385 ),
5386 encoder,
5387 offset,
5388 _depth,
5389 )
5390 }
5391 }
5392 unsafe impl<
5393 D: fidl::encoding::ResourceDialect,
5394 T0: fidl::encoding::Encode<AacTransport, D>,
5395 T1: fidl::encoding::Encode<AacChannelMode, D>,
5396 T2: fidl::encoding::Encode<AacBitRate, D>,
5397 T3: fidl::encoding::Encode<AacAudioObjectType, D>,
5398 > fidl::encoding::Encode<AacEncoderSettings, D> for (T0, T1, T2, T3)
5399 {
5400 #[inline]
5401 unsafe fn encode(
5402 self,
5403 encoder: &mut fidl::encoding::Encoder<'_, D>,
5404 offset: usize,
5405 depth: fidl::encoding::Depth,
5406 ) -> fidl::Result<()> {
5407 encoder.debug_check_bounds::<AacEncoderSettings>(offset);
5408 unsafe {
5411 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
5412 (ptr as *mut u64).write_unaligned(0);
5413 }
5414 unsafe {
5415 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(40);
5416 (ptr as *mut u64).write_unaligned(0);
5417 }
5418 self.0.encode(encoder, offset + 0, depth)?;
5420 self.1.encode(encoder, offset + 16, depth)?;
5421 self.2.encode(encoder, offset + 24, depth)?;
5422 self.3.encode(encoder, offset + 40, depth)?;
5423 Ok(())
5424 }
5425 }
5426
5427 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AacEncoderSettings {
5428 #[inline(always)]
5429 fn new_empty() -> Self {
5430 Self {
5431 transport: fidl::new_empty!(AacTransport, D),
5432 channel_mode: fidl::new_empty!(AacChannelMode, D),
5433 bit_rate: fidl::new_empty!(AacBitRate, D),
5434 aot: fidl::new_empty!(AacAudioObjectType, D),
5435 }
5436 }
5437
5438 #[inline]
5439 unsafe fn decode(
5440 &mut self,
5441 decoder: &mut fidl::encoding::Decoder<'_, D>,
5442 offset: usize,
5443 _depth: fidl::encoding::Depth,
5444 ) -> fidl::Result<()> {
5445 decoder.debug_check_bounds::<Self>(offset);
5446 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
5448 let padval = unsafe { (ptr as *const u64).read_unaligned() };
5449 let mask = 0xffffffff00000000u64;
5450 let maskedval = padval & mask;
5451 if maskedval != 0 {
5452 return Err(fidl::Error::NonZeroPadding {
5453 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
5454 });
5455 }
5456 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(40) };
5457 let padval = unsafe { (ptr as *const u64).read_unaligned() };
5458 let mask = 0xffffffff00000000u64;
5459 let maskedval = padval & mask;
5460 if maskedval != 0 {
5461 return Err(fidl::Error::NonZeroPadding {
5462 padding_start: offset + 40 + ((mask as u64).trailing_zeros() / 8) as usize,
5463 });
5464 }
5465 fidl::decode!(AacTransport, D, &mut self.transport, decoder, offset + 0, _depth)?;
5466 fidl::decode!(AacChannelMode, D, &mut self.channel_mode, decoder, offset + 16, _depth)?;
5467 fidl::decode!(AacBitRate, D, &mut self.bit_rate, decoder, offset + 24, _depth)?;
5468 fidl::decode!(AacAudioObjectType, D, &mut self.aot, decoder, offset + 40, _depth)?;
5469 Ok(())
5470 }
5471 }
5472
5473 impl fidl::encoding::ValueTypeMarker for AacTransportAdts {
5474 type Borrowed<'a> = &'a Self;
5475 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5476 value
5477 }
5478 }
5479
5480 unsafe impl fidl::encoding::TypeMarker for AacTransportAdts {
5481 type Owned = Self;
5482
5483 #[inline(always)]
5484 fn inline_align(_context: fidl::encoding::Context) -> usize {
5485 1
5486 }
5487
5488 #[inline(always)]
5489 fn inline_size(_context: fidl::encoding::Context) -> usize {
5490 1
5491 }
5492 }
5493
5494 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AacTransportAdts, D>
5495 for &AacTransportAdts
5496 {
5497 #[inline]
5498 unsafe fn encode(
5499 self,
5500 encoder: &mut fidl::encoding::Encoder<'_, D>,
5501 offset: usize,
5502 _depth: fidl::encoding::Depth,
5503 ) -> fidl::Result<()> {
5504 encoder.debug_check_bounds::<AacTransportAdts>(offset);
5505 encoder.write_num(0u8, offset);
5506 Ok(())
5507 }
5508 }
5509
5510 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AacTransportAdts {
5511 #[inline(always)]
5512 fn new_empty() -> Self {
5513 Self
5514 }
5515
5516 #[inline]
5517 unsafe fn decode(
5518 &mut self,
5519 decoder: &mut fidl::encoding::Decoder<'_, D>,
5520 offset: usize,
5521 _depth: fidl::encoding::Depth,
5522 ) -> fidl::Result<()> {
5523 decoder.debug_check_bounds::<Self>(offset);
5524 match decoder.read_num::<u8>(offset) {
5525 0 => Ok(()),
5526 _ => Err(fidl::Error::Invalid),
5527 }
5528 }
5529 }
5530
5531 impl fidl::encoding::ValueTypeMarker for AacTransportLatm {
5532 type Borrowed<'a> = &'a Self;
5533 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5534 value
5535 }
5536 }
5537
5538 unsafe impl fidl::encoding::TypeMarker for AacTransportLatm {
5539 type Owned = Self;
5540
5541 #[inline(always)]
5542 fn inline_align(_context: fidl::encoding::Context) -> usize {
5543 1
5544 }
5545
5546 #[inline(always)]
5547 fn inline_size(_context: fidl::encoding::Context) -> usize {
5548 1
5549 }
5550 }
5551
5552 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AacTransportLatm, D>
5553 for &AacTransportLatm
5554 {
5555 #[inline]
5556 unsafe fn encode(
5557 self,
5558 encoder: &mut fidl::encoding::Encoder<'_, D>,
5559 offset: usize,
5560 _depth: fidl::encoding::Depth,
5561 ) -> fidl::Result<()> {
5562 encoder.debug_check_bounds::<AacTransportLatm>(offset);
5563 fidl::encoding::Encode::<AacTransportLatm, D>::encode(
5565 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.mux_config_present),),
5566 encoder,
5567 offset,
5568 _depth,
5569 )
5570 }
5571 }
5572 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
5573 fidl::encoding::Encode<AacTransportLatm, D> for (T0,)
5574 {
5575 #[inline]
5576 unsafe fn encode(
5577 self,
5578 encoder: &mut fidl::encoding::Encoder<'_, D>,
5579 offset: usize,
5580 depth: fidl::encoding::Depth,
5581 ) -> fidl::Result<()> {
5582 encoder.debug_check_bounds::<AacTransportLatm>(offset);
5583 self.0.encode(encoder, offset + 0, depth)?;
5587 Ok(())
5588 }
5589 }
5590
5591 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AacTransportLatm {
5592 #[inline(always)]
5593 fn new_empty() -> Self {
5594 Self { mux_config_present: fidl::new_empty!(bool, D) }
5595 }
5596
5597 #[inline]
5598 unsafe fn decode(
5599 &mut self,
5600 decoder: &mut fidl::encoding::Decoder<'_, D>,
5601 offset: usize,
5602 _depth: fidl::encoding::Depth,
5603 ) -> fidl::Result<()> {
5604 decoder.debug_check_bounds::<Self>(offset);
5605 fidl::decode!(bool, D, &mut self.mux_config_present, decoder, offset + 0, _depth)?;
5607 Ok(())
5608 }
5609 }
5610
5611 impl fidl::encoding::ValueTypeMarker for AacTransportRaw {
5612 type Borrowed<'a> = &'a Self;
5613 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5614 value
5615 }
5616 }
5617
5618 unsafe impl fidl::encoding::TypeMarker for AacTransportRaw {
5619 type Owned = Self;
5620
5621 #[inline(always)]
5622 fn inline_align(_context: fidl::encoding::Context) -> usize {
5623 1
5624 }
5625
5626 #[inline(always)]
5627 fn inline_size(_context: fidl::encoding::Context) -> usize {
5628 1
5629 }
5630 }
5631
5632 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AacTransportRaw, D>
5633 for &AacTransportRaw
5634 {
5635 #[inline]
5636 unsafe fn encode(
5637 self,
5638 encoder: &mut fidl::encoding::Encoder<'_, D>,
5639 offset: usize,
5640 _depth: fidl::encoding::Depth,
5641 ) -> fidl::Result<()> {
5642 encoder.debug_check_bounds::<AacTransportRaw>(offset);
5643 encoder.write_num(0u8, offset);
5644 Ok(())
5645 }
5646 }
5647
5648 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AacTransportRaw {
5649 #[inline(always)]
5650 fn new_empty() -> Self {
5651 Self
5652 }
5653
5654 #[inline]
5655 unsafe fn decode(
5656 &mut self,
5657 decoder: &mut fidl::encoding::Decoder<'_, D>,
5658 offset: usize,
5659 _depth: fidl::encoding::Depth,
5660 ) -> fidl::Result<()> {
5661 decoder.debug_check_bounds::<Self>(offset);
5662 match decoder.read_num::<u8>(offset) {
5663 0 => Ok(()),
5664 _ => Err(fidl::Error::Invalid),
5665 }
5666 }
5667 }
5668
5669 impl fidl::encoding::ValueTypeMarker for ActivityReporterWatchCaptureActivityResponse {
5670 type Borrowed<'a> = &'a Self;
5671 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5672 value
5673 }
5674 }
5675
5676 unsafe impl fidl::encoding::TypeMarker for ActivityReporterWatchCaptureActivityResponse {
5677 type Owned = Self;
5678
5679 #[inline(always)]
5680 fn inline_align(_context: fidl::encoding::Context) -> usize {
5681 8
5682 }
5683
5684 #[inline(always)]
5685 fn inline_size(_context: fidl::encoding::Context) -> usize {
5686 16
5687 }
5688 }
5689
5690 unsafe impl<D: fidl::encoding::ResourceDialect>
5691 fidl::encoding::Encode<ActivityReporterWatchCaptureActivityResponse, D>
5692 for &ActivityReporterWatchCaptureActivityResponse
5693 {
5694 #[inline]
5695 unsafe fn encode(
5696 self,
5697 encoder: &mut fidl::encoding::Encoder<'_, D>,
5698 offset: usize,
5699 _depth: fidl::encoding::Depth,
5700 ) -> fidl::Result<()> {
5701 encoder.debug_check_bounds::<ActivityReporterWatchCaptureActivityResponse>(offset);
5702 fidl::encoding::Encode::<ActivityReporterWatchCaptureActivityResponse, D>::encode(
5704 (
5705 <fidl::encoding::Vector<AudioCaptureUsage, 4> as fidl::encoding::ValueTypeMarker>::borrow(&self.active_usages),
5706 ),
5707 encoder, offset, _depth
5708 )
5709 }
5710 }
5711 unsafe impl<
5712 D: fidl::encoding::ResourceDialect,
5713 T0: fidl::encoding::Encode<fidl::encoding::Vector<AudioCaptureUsage, 4>, D>,
5714 > fidl::encoding::Encode<ActivityReporterWatchCaptureActivityResponse, D> for (T0,)
5715 {
5716 #[inline]
5717 unsafe fn encode(
5718 self,
5719 encoder: &mut fidl::encoding::Encoder<'_, D>,
5720 offset: usize,
5721 depth: fidl::encoding::Depth,
5722 ) -> fidl::Result<()> {
5723 encoder.debug_check_bounds::<ActivityReporterWatchCaptureActivityResponse>(offset);
5724 self.0.encode(encoder, offset + 0, depth)?;
5728 Ok(())
5729 }
5730 }
5731
5732 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5733 for ActivityReporterWatchCaptureActivityResponse
5734 {
5735 #[inline(always)]
5736 fn new_empty() -> Self {
5737 Self {
5738 active_usages: fidl::new_empty!(fidl::encoding::Vector<AudioCaptureUsage, 4>, D),
5739 }
5740 }
5741
5742 #[inline]
5743 unsafe fn decode(
5744 &mut self,
5745 decoder: &mut fidl::encoding::Decoder<'_, D>,
5746 offset: usize,
5747 _depth: fidl::encoding::Depth,
5748 ) -> fidl::Result<()> {
5749 decoder.debug_check_bounds::<Self>(offset);
5750 fidl::decode!(fidl::encoding::Vector<AudioCaptureUsage, 4>, D, &mut self.active_usages, decoder, offset + 0, _depth)?;
5752 Ok(())
5753 }
5754 }
5755
5756 impl fidl::encoding::ValueTypeMarker for ActivityReporterWatchRenderActivityResponse {
5757 type Borrowed<'a> = &'a Self;
5758 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5759 value
5760 }
5761 }
5762
5763 unsafe impl fidl::encoding::TypeMarker for ActivityReporterWatchRenderActivityResponse {
5764 type Owned = Self;
5765
5766 #[inline(always)]
5767 fn inline_align(_context: fidl::encoding::Context) -> usize {
5768 8
5769 }
5770
5771 #[inline(always)]
5772 fn inline_size(_context: fidl::encoding::Context) -> usize {
5773 16
5774 }
5775 }
5776
5777 unsafe impl<D: fidl::encoding::ResourceDialect>
5778 fidl::encoding::Encode<ActivityReporterWatchRenderActivityResponse, D>
5779 for &ActivityReporterWatchRenderActivityResponse
5780 {
5781 #[inline]
5782 unsafe fn encode(
5783 self,
5784 encoder: &mut fidl::encoding::Encoder<'_, D>,
5785 offset: usize,
5786 _depth: fidl::encoding::Depth,
5787 ) -> fidl::Result<()> {
5788 encoder.debug_check_bounds::<ActivityReporterWatchRenderActivityResponse>(offset);
5789 fidl::encoding::Encode::<ActivityReporterWatchRenderActivityResponse, D>::encode(
5791 (
5792 <fidl::encoding::Vector<AudioRenderUsage, 5> as fidl::encoding::ValueTypeMarker>::borrow(&self.active_usages),
5793 ),
5794 encoder, offset, _depth
5795 )
5796 }
5797 }
5798 unsafe impl<
5799 D: fidl::encoding::ResourceDialect,
5800 T0: fidl::encoding::Encode<fidl::encoding::Vector<AudioRenderUsage, 5>, D>,
5801 > fidl::encoding::Encode<ActivityReporterWatchRenderActivityResponse, D> for (T0,)
5802 {
5803 #[inline]
5804 unsafe fn encode(
5805 self,
5806 encoder: &mut fidl::encoding::Encoder<'_, D>,
5807 offset: usize,
5808 depth: fidl::encoding::Depth,
5809 ) -> fidl::Result<()> {
5810 encoder.debug_check_bounds::<ActivityReporterWatchRenderActivityResponse>(offset);
5811 self.0.encode(encoder, offset + 0, depth)?;
5815 Ok(())
5816 }
5817 }
5818
5819 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5820 for ActivityReporterWatchRenderActivityResponse
5821 {
5822 #[inline(always)]
5823 fn new_empty() -> Self {
5824 Self { active_usages: fidl::new_empty!(fidl::encoding::Vector<AudioRenderUsage, 5>, D) }
5825 }
5826
5827 #[inline]
5828 unsafe fn decode(
5829 &mut self,
5830 decoder: &mut fidl::encoding::Decoder<'_, D>,
5831 offset: usize,
5832 _depth: fidl::encoding::Depth,
5833 ) -> fidl::Result<()> {
5834 decoder.debug_check_bounds::<Self>(offset);
5835 fidl::decode!(fidl::encoding::Vector<AudioRenderUsage, 5>, D, &mut self.active_usages, decoder, offset + 0, _depth)?;
5837 Ok(())
5838 }
5839 }
5840
5841 impl fidl::encoding::ValueTypeMarker for ActivityReporterWatchCaptureActivity2Response {
5842 type Borrowed<'a> = &'a Self;
5843 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5844 value
5845 }
5846 }
5847
5848 unsafe impl fidl::encoding::TypeMarker for ActivityReporterWatchCaptureActivity2Response {
5849 type Owned = Self;
5850
5851 #[inline(always)]
5852 fn inline_align(_context: fidl::encoding::Context) -> usize {
5853 8
5854 }
5855
5856 #[inline(always)]
5857 fn inline_size(_context: fidl::encoding::Context) -> usize {
5858 16
5859 }
5860 }
5861
5862 unsafe impl<D: fidl::encoding::ResourceDialect>
5863 fidl::encoding::Encode<ActivityReporterWatchCaptureActivity2Response, D>
5864 for &ActivityReporterWatchCaptureActivity2Response
5865 {
5866 #[inline]
5867 unsafe fn encode(
5868 self,
5869 encoder: &mut fidl::encoding::Encoder<'_, D>,
5870 offset: usize,
5871 _depth: fidl::encoding::Depth,
5872 ) -> fidl::Result<()> {
5873 encoder.debug_check_bounds::<ActivityReporterWatchCaptureActivity2Response>(offset);
5874 fidl::encoding::Encode::<ActivityReporterWatchCaptureActivity2Response, D>::encode(
5876 (
5877 <fidl::encoding::Vector<AudioCaptureUsage2, 8> as fidl::encoding::ValueTypeMarker>::borrow(&self.active_usages),
5878 ),
5879 encoder, offset, _depth
5880 )
5881 }
5882 }
5883 unsafe impl<
5884 D: fidl::encoding::ResourceDialect,
5885 T0: fidl::encoding::Encode<fidl::encoding::Vector<AudioCaptureUsage2, 8>, D>,
5886 > fidl::encoding::Encode<ActivityReporterWatchCaptureActivity2Response, D> for (T0,)
5887 {
5888 #[inline]
5889 unsafe fn encode(
5890 self,
5891 encoder: &mut fidl::encoding::Encoder<'_, D>,
5892 offset: usize,
5893 depth: fidl::encoding::Depth,
5894 ) -> fidl::Result<()> {
5895 encoder.debug_check_bounds::<ActivityReporterWatchCaptureActivity2Response>(offset);
5896 self.0.encode(encoder, offset + 0, depth)?;
5900 Ok(())
5901 }
5902 }
5903
5904 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5905 for ActivityReporterWatchCaptureActivity2Response
5906 {
5907 #[inline(always)]
5908 fn new_empty() -> Self {
5909 Self {
5910 active_usages: fidl::new_empty!(fidl::encoding::Vector<AudioCaptureUsage2, 8>, D),
5911 }
5912 }
5913
5914 #[inline]
5915 unsafe fn decode(
5916 &mut self,
5917 decoder: &mut fidl::encoding::Decoder<'_, D>,
5918 offset: usize,
5919 _depth: fidl::encoding::Depth,
5920 ) -> fidl::Result<()> {
5921 decoder.debug_check_bounds::<Self>(offset);
5922 fidl::decode!(fidl::encoding::Vector<AudioCaptureUsage2, 8>, D, &mut self.active_usages, decoder, offset + 0, _depth)?;
5924 Ok(())
5925 }
5926 }
5927
5928 impl fidl::encoding::ValueTypeMarker for ActivityReporterWatchRenderActivity2Response {
5929 type Borrowed<'a> = &'a Self;
5930 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5931 value
5932 }
5933 }
5934
5935 unsafe impl fidl::encoding::TypeMarker for ActivityReporterWatchRenderActivity2Response {
5936 type Owned = Self;
5937
5938 #[inline(always)]
5939 fn inline_align(_context: fidl::encoding::Context) -> usize {
5940 8
5941 }
5942
5943 #[inline(always)]
5944 fn inline_size(_context: fidl::encoding::Context) -> usize {
5945 16
5946 }
5947 }
5948
5949 unsafe impl<D: fidl::encoding::ResourceDialect>
5950 fidl::encoding::Encode<ActivityReporterWatchRenderActivity2Response, D>
5951 for &ActivityReporterWatchRenderActivity2Response
5952 {
5953 #[inline]
5954 unsafe fn encode(
5955 self,
5956 encoder: &mut fidl::encoding::Encoder<'_, D>,
5957 offset: usize,
5958 _depth: fidl::encoding::Depth,
5959 ) -> fidl::Result<()> {
5960 encoder.debug_check_bounds::<ActivityReporterWatchRenderActivity2Response>(offset);
5961 fidl::encoding::Encode::<ActivityReporterWatchRenderActivity2Response, D>::encode(
5963 (
5964 <fidl::encoding::Vector<AudioRenderUsage2, 8> as fidl::encoding::ValueTypeMarker>::borrow(&self.active_usages),
5965 ),
5966 encoder, offset, _depth
5967 )
5968 }
5969 }
5970 unsafe impl<
5971 D: fidl::encoding::ResourceDialect,
5972 T0: fidl::encoding::Encode<fidl::encoding::Vector<AudioRenderUsage2, 8>, D>,
5973 > fidl::encoding::Encode<ActivityReporterWatchRenderActivity2Response, D> for (T0,)
5974 {
5975 #[inline]
5976 unsafe fn encode(
5977 self,
5978 encoder: &mut fidl::encoding::Encoder<'_, D>,
5979 offset: usize,
5980 depth: fidl::encoding::Depth,
5981 ) -> fidl::Result<()> {
5982 encoder.debug_check_bounds::<ActivityReporterWatchRenderActivity2Response>(offset);
5983 self.0.encode(encoder, offset + 0, depth)?;
5987 Ok(())
5988 }
5989 }
5990
5991 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5992 for ActivityReporterWatchRenderActivity2Response
5993 {
5994 #[inline(always)]
5995 fn new_empty() -> Self {
5996 Self {
5997 active_usages: fidl::new_empty!(fidl::encoding::Vector<AudioRenderUsage2, 8>, D),
5998 }
5999 }
6000
6001 #[inline]
6002 unsafe fn decode(
6003 &mut self,
6004 decoder: &mut fidl::encoding::Decoder<'_, D>,
6005 offset: usize,
6006 _depth: fidl::encoding::Depth,
6007 ) -> fidl::Result<()> {
6008 decoder.debug_check_bounds::<Self>(offset);
6009 fidl::decode!(fidl::encoding::Vector<AudioRenderUsage2, 8>, D, &mut self.active_usages, decoder, offset + 0, _depth)?;
6011 Ok(())
6012 }
6013 }
6014
6015 impl fidl::encoding::ValueTypeMarker for AudioCapturerCaptureAtRequest {
6016 type Borrowed<'a> = &'a Self;
6017 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6018 value
6019 }
6020 }
6021
6022 unsafe impl fidl::encoding::TypeMarker for AudioCapturerCaptureAtRequest {
6023 type Owned = Self;
6024
6025 #[inline(always)]
6026 fn inline_align(_context: fidl::encoding::Context) -> usize {
6027 4
6028 }
6029
6030 #[inline(always)]
6031 fn inline_size(_context: fidl::encoding::Context) -> usize {
6032 12
6033 }
6034 #[inline(always)]
6035 fn encode_is_copy() -> bool {
6036 true
6037 }
6038
6039 #[inline(always)]
6040 fn decode_is_copy() -> bool {
6041 true
6042 }
6043 }
6044
6045 unsafe impl<D: fidl::encoding::ResourceDialect>
6046 fidl::encoding::Encode<AudioCapturerCaptureAtRequest, D>
6047 for &AudioCapturerCaptureAtRequest
6048 {
6049 #[inline]
6050 unsafe fn encode(
6051 self,
6052 encoder: &mut fidl::encoding::Encoder<'_, D>,
6053 offset: usize,
6054 _depth: fidl::encoding::Depth,
6055 ) -> fidl::Result<()> {
6056 encoder.debug_check_bounds::<AudioCapturerCaptureAtRequest>(offset);
6057 unsafe {
6058 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
6060 (buf_ptr as *mut AudioCapturerCaptureAtRequest)
6061 .write_unaligned((self as *const AudioCapturerCaptureAtRequest).read());
6062 }
6065 Ok(())
6066 }
6067 }
6068 unsafe impl<
6069 D: fidl::encoding::ResourceDialect,
6070 T0: fidl::encoding::Encode<u32, D>,
6071 T1: fidl::encoding::Encode<u32, D>,
6072 T2: fidl::encoding::Encode<u32, D>,
6073 > fidl::encoding::Encode<AudioCapturerCaptureAtRequest, D> for (T0, T1, T2)
6074 {
6075 #[inline]
6076 unsafe fn encode(
6077 self,
6078 encoder: &mut fidl::encoding::Encoder<'_, D>,
6079 offset: usize,
6080 depth: fidl::encoding::Depth,
6081 ) -> fidl::Result<()> {
6082 encoder.debug_check_bounds::<AudioCapturerCaptureAtRequest>(offset);
6083 self.0.encode(encoder, offset + 0, depth)?;
6087 self.1.encode(encoder, offset + 4, depth)?;
6088 self.2.encode(encoder, offset + 8, depth)?;
6089 Ok(())
6090 }
6091 }
6092
6093 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6094 for AudioCapturerCaptureAtRequest
6095 {
6096 #[inline(always)]
6097 fn new_empty() -> Self {
6098 Self {
6099 payload_buffer_id: fidl::new_empty!(u32, D),
6100 payload_offset: fidl::new_empty!(u32, D),
6101 frames: fidl::new_empty!(u32, D),
6102 }
6103 }
6104
6105 #[inline]
6106 unsafe fn decode(
6107 &mut self,
6108 decoder: &mut fidl::encoding::Decoder<'_, D>,
6109 offset: usize,
6110 _depth: fidl::encoding::Depth,
6111 ) -> fidl::Result<()> {
6112 decoder.debug_check_bounds::<Self>(offset);
6113 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
6114 unsafe {
6117 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 12);
6118 }
6119 Ok(())
6120 }
6121 }
6122
6123 impl fidl::encoding::ValueTypeMarker for AudioCapturerCaptureAtResponse {
6124 type Borrowed<'a> = &'a Self;
6125 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6126 value
6127 }
6128 }
6129
6130 unsafe impl fidl::encoding::TypeMarker for AudioCapturerCaptureAtResponse {
6131 type Owned = Self;
6132
6133 #[inline(always)]
6134 fn inline_align(_context: fidl::encoding::Context) -> usize {
6135 8
6136 }
6137
6138 #[inline(always)]
6139 fn inline_size(_context: fidl::encoding::Context) -> usize {
6140 56
6141 }
6142 }
6143
6144 unsafe impl<D: fidl::encoding::ResourceDialect>
6145 fidl::encoding::Encode<AudioCapturerCaptureAtResponse, D>
6146 for &AudioCapturerCaptureAtResponse
6147 {
6148 #[inline]
6149 unsafe fn encode(
6150 self,
6151 encoder: &mut fidl::encoding::Encoder<'_, D>,
6152 offset: usize,
6153 _depth: fidl::encoding::Depth,
6154 ) -> fidl::Result<()> {
6155 encoder.debug_check_bounds::<AudioCapturerCaptureAtResponse>(offset);
6156 unsafe {
6157 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
6159 (buf_ptr as *mut AudioCapturerCaptureAtResponse)
6160 .write_unaligned((self as *const AudioCapturerCaptureAtResponse).read());
6161 let padding_ptr = buf_ptr.offset(8) as *mut u64;
6164 let padding_mask = 0xffffffff00000000u64;
6165 padding_ptr.write_unaligned(padding_ptr.read_unaligned() & !padding_mask);
6166 let padding_ptr = buf_ptr.offset(32) as *mut u64;
6167 let padding_mask = 0xffffffff00000000u64;
6168 padding_ptr.write_unaligned(padding_ptr.read_unaligned() & !padding_mask);
6169 }
6170 Ok(())
6171 }
6172 }
6173 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<StreamPacket, D>>
6174 fidl::encoding::Encode<AudioCapturerCaptureAtResponse, D> for (T0,)
6175 {
6176 #[inline]
6177 unsafe fn encode(
6178 self,
6179 encoder: &mut fidl::encoding::Encoder<'_, D>,
6180 offset: usize,
6181 depth: fidl::encoding::Depth,
6182 ) -> fidl::Result<()> {
6183 encoder.debug_check_bounds::<AudioCapturerCaptureAtResponse>(offset);
6184 self.0.encode(encoder, offset + 0, depth)?;
6188 Ok(())
6189 }
6190 }
6191
6192 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6193 for AudioCapturerCaptureAtResponse
6194 {
6195 #[inline(always)]
6196 fn new_empty() -> Self {
6197 Self { captured_packet: fidl::new_empty!(StreamPacket, D) }
6198 }
6199
6200 #[inline]
6201 unsafe fn decode(
6202 &mut self,
6203 decoder: &mut fidl::encoding::Decoder<'_, D>,
6204 offset: usize,
6205 _depth: fidl::encoding::Depth,
6206 ) -> fidl::Result<()> {
6207 decoder.debug_check_bounds::<Self>(offset);
6208 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
6209 let ptr = unsafe { buf_ptr.offset(8) };
6211 let padval = unsafe { (ptr as *const u64).read_unaligned() };
6212 let mask = 0xffffffff00000000u64;
6213 let maskedval = padval & mask;
6214 if maskedval != 0 {
6215 return Err(fidl::Error::NonZeroPadding {
6216 padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
6217 });
6218 }
6219 let ptr = unsafe { buf_ptr.offset(32) };
6220 let padval = unsafe { (ptr as *const u64).read_unaligned() };
6221 let mask = 0xffffffff00000000u64;
6222 let maskedval = padval & mask;
6223 if maskedval != 0 {
6224 return Err(fidl::Error::NonZeroPadding {
6225 padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
6226 });
6227 }
6228 unsafe {
6230 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 56);
6231 }
6232 Ok(())
6233 }
6234 }
6235
6236 impl fidl::encoding::ValueTypeMarker for AudioCapturerGetStreamTypeResponse {
6237 type Borrowed<'a> = &'a Self;
6238 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6239 value
6240 }
6241 }
6242
6243 unsafe impl fidl::encoding::TypeMarker for AudioCapturerGetStreamTypeResponse {
6244 type Owned = Self;
6245
6246 #[inline(always)]
6247 fn inline_align(_context: fidl::encoding::Context) -> usize {
6248 8
6249 }
6250
6251 #[inline(always)]
6252 fn inline_size(_context: fidl::encoding::Context) -> usize {
6253 48
6254 }
6255 }
6256
6257 unsafe impl<D: fidl::encoding::ResourceDialect>
6258 fidl::encoding::Encode<AudioCapturerGetStreamTypeResponse, D>
6259 for &AudioCapturerGetStreamTypeResponse
6260 {
6261 #[inline]
6262 unsafe fn encode(
6263 self,
6264 encoder: &mut fidl::encoding::Encoder<'_, D>,
6265 offset: usize,
6266 _depth: fidl::encoding::Depth,
6267 ) -> fidl::Result<()> {
6268 encoder.debug_check_bounds::<AudioCapturerGetStreamTypeResponse>(offset);
6269 fidl::encoding::Encode::<AudioCapturerGetStreamTypeResponse, D>::encode(
6271 (<StreamType as fidl::encoding::ValueTypeMarker>::borrow(&self.stream_type),),
6272 encoder,
6273 offset,
6274 _depth,
6275 )
6276 }
6277 }
6278 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<StreamType, D>>
6279 fidl::encoding::Encode<AudioCapturerGetStreamTypeResponse, D> for (T0,)
6280 {
6281 #[inline]
6282 unsafe fn encode(
6283 self,
6284 encoder: &mut fidl::encoding::Encoder<'_, D>,
6285 offset: usize,
6286 depth: fidl::encoding::Depth,
6287 ) -> fidl::Result<()> {
6288 encoder.debug_check_bounds::<AudioCapturerGetStreamTypeResponse>(offset);
6289 self.0.encode(encoder, offset + 0, depth)?;
6293 Ok(())
6294 }
6295 }
6296
6297 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6298 for AudioCapturerGetStreamTypeResponse
6299 {
6300 #[inline(always)]
6301 fn new_empty() -> Self {
6302 Self { stream_type: fidl::new_empty!(StreamType, D) }
6303 }
6304
6305 #[inline]
6306 unsafe fn decode(
6307 &mut self,
6308 decoder: &mut fidl::encoding::Decoder<'_, D>,
6309 offset: usize,
6310 _depth: fidl::encoding::Depth,
6311 ) -> fidl::Result<()> {
6312 decoder.debug_check_bounds::<Self>(offset);
6313 fidl::decode!(StreamType, D, &mut self.stream_type, decoder, offset + 0, _depth)?;
6315 Ok(())
6316 }
6317 }
6318
6319 impl fidl::encoding::ValueTypeMarker for AudioCapturerSetPcmStreamTypeRequest {
6320 type Borrowed<'a> = &'a Self;
6321 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6322 value
6323 }
6324 }
6325
6326 unsafe impl fidl::encoding::TypeMarker for AudioCapturerSetPcmStreamTypeRequest {
6327 type Owned = Self;
6328
6329 #[inline(always)]
6330 fn inline_align(_context: fidl::encoding::Context) -> usize {
6331 4
6332 }
6333
6334 #[inline(always)]
6335 fn inline_size(_context: fidl::encoding::Context) -> usize {
6336 12
6337 }
6338 }
6339
6340 unsafe impl<D: fidl::encoding::ResourceDialect>
6341 fidl::encoding::Encode<AudioCapturerSetPcmStreamTypeRequest, D>
6342 for &AudioCapturerSetPcmStreamTypeRequest
6343 {
6344 #[inline]
6345 unsafe fn encode(
6346 self,
6347 encoder: &mut fidl::encoding::Encoder<'_, D>,
6348 offset: usize,
6349 _depth: fidl::encoding::Depth,
6350 ) -> fidl::Result<()> {
6351 encoder.debug_check_bounds::<AudioCapturerSetPcmStreamTypeRequest>(offset);
6352 fidl::encoding::Encode::<AudioCapturerSetPcmStreamTypeRequest, D>::encode(
6354 (<AudioStreamType as fidl::encoding::ValueTypeMarker>::borrow(&self.stream_type),),
6355 encoder,
6356 offset,
6357 _depth,
6358 )
6359 }
6360 }
6361 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<AudioStreamType, D>>
6362 fidl::encoding::Encode<AudioCapturerSetPcmStreamTypeRequest, D> for (T0,)
6363 {
6364 #[inline]
6365 unsafe fn encode(
6366 self,
6367 encoder: &mut fidl::encoding::Encoder<'_, D>,
6368 offset: usize,
6369 depth: fidl::encoding::Depth,
6370 ) -> fidl::Result<()> {
6371 encoder.debug_check_bounds::<AudioCapturerSetPcmStreamTypeRequest>(offset);
6372 self.0.encode(encoder, offset + 0, depth)?;
6376 Ok(())
6377 }
6378 }
6379
6380 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6381 for AudioCapturerSetPcmStreamTypeRequest
6382 {
6383 #[inline(always)]
6384 fn new_empty() -> Self {
6385 Self { stream_type: fidl::new_empty!(AudioStreamType, D) }
6386 }
6387
6388 #[inline]
6389 unsafe fn decode(
6390 &mut self,
6391 decoder: &mut fidl::encoding::Decoder<'_, D>,
6392 offset: usize,
6393 _depth: fidl::encoding::Depth,
6394 ) -> fidl::Result<()> {
6395 decoder.debug_check_bounds::<Self>(offset);
6396 fidl::decode!(AudioStreamType, D, &mut self.stream_type, decoder, offset + 0, _depth)?;
6398 Ok(())
6399 }
6400 }
6401
6402 impl fidl::encoding::ValueTypeMarker for AudioCapturerSetUsage2Request {
6403 type Borrowed<'a> = &'a Self;
6404 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6405 value
6406 }
6407 }
6408
6409 unsafe impl fidl::encoding::TypeMarker for AudioCapturerSetUsage2Request {
6410 type Owned = Self;
6411
6412 #[inline(always)]
6413 fn inline_align(_context: fidl::encoding::Context) -> usize {
6414 4
6415 }
6416
6417 #[inline(always)]
6418 fn inline_size(_context: fidl::encoding::Context) -> usize {
6419 4
6420 }
6421 }
6422
6423 unsafe impl<D: fidl::encoding::ResourceDialect>
6424 fidl::encoding::Encode<AudioCapturerSetUsage2Request, D>
6425 for &AudioCapturerSetUsage2Request
6426 {
6427 #[inline]
6428 unsafe fn encode(
6429 self,
6430 encoder: &mut fidl::encoding::Encoder<'_, D>,
6431 offset: usize,
6432 _depth: fidl::encoding::Depth,
6433 ) -> fidl::Result<()> {
6434 encoder.debug_check_bounds::<AudioCapturerSetUsage2Request>(offset);
6435 fidl::encoding::Encode::<AudioCapturerSetUsage2Request, D>::encode(
6437 (<AudioCaptureUsage2 as fidl::encoding::ValueTypeMarker>::borrow(&self.usage),),
6438 encoder,
6439 offset,
6440 _depth,
6441 )
6442 }
6443 }
6444 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<AudioCaptureUsage2, D>>
6445 fidl::encoding::Encode<AudioCapturerSetUsage2Request, D> for (T0,)
6446 {
6447 #[inline]
6448 unsafe fn encode(
6449 self,
6450 encoder: &mut fidl::encoding::Encoder<'_, D>,
6451 offset: usize,
6452 depth: fidl::encoding::Depth,
6453 ) -> fidl::Result<()> {
6454 encoder.debug_check_bounds::<AudioCapturerSetUsage2Request>(offset);
6455 self.0.encode(encoder, offset + 0, depth)?;
6459 Ok(())
6460 }
6461 }
6462
6463 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6464 for AudioCapturerSetUsage2Request
6465 {
6466 #[inline(always)]
6467 fn new_empty() -> Self {
6468 Self { usage: fidl::new_empty!(AudioCaptureUsage2, D) }
6469 }
6470
6471 #[inline]
6472 unsafe fn decode(
6473 &mut self,
6474 decoder: &mut fidl::encoding::Decoder<'_, D>,
6475 offset: usize,
6476 _depth: fidl::encoding::Depth,
6477 ) -> fidl::Result<()> {
6478 decoder.debug_check_bounds::<Self>(offset);
6479 fidl::decode!(AudioCaptureUsage2, D, &mut self.usage, decoder, offset + 0, _depth)?;
6481 Ok(())
6482 }
6483 }
6484
6485 impl fidl::encoding::ValueTypeMarker for AudioCapturerSetUsageRequest {
6486 type Borrowed<'a> = &'a Self;
6487 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6488 value
6489 }
6490 }
6491
6492 unsafe impl fidl::encoding::TypeMarker for AudioCapturerSetUsageRequest {
6493 type Owned = Self;
6494
6495 #[inline(always)]
6496 fn inline_align(_context: fidl::encoding::Context) -> usize {
6497 4
6498 }
6499
6500 #[inline(always)]
6501 fn inline_size(_context: fidl::encoding::Context) -> usize {
6502 4
6503 }
6504 }
6505
6506 unsafe impl<D: fidl::encoding::ResourceDialect>
6507 fidl::encoding::Encode<AudioCapturerSetUsageRequest, D> for &AudioCapturerSetUsageRequest
6508 {
6509 #[inline]
6510 unsafe fn encode(
6511 self,
6512 encoder: &mut fidl::encoding::Encoder<'_, D>,
6513 offset: usize,
6514 _depth: fidl::encoding::Depth,
6515 ) -> fidl::Result<()> {
6516 encoder.debug_check_bounds::<AudioCapturerSetUsageRequest>(offset);
6517 fidl::encoding::Encode::<AudioCapturerSetUsageRequest, D>::encode(
6519 (<AudioCaptureUsage as fidl::encoding::ValueTypeMarker>::borrow(&self.usage),),
6520 encoder,
6521 offset,
6522 _depth,
6523 )
6524 }
6525 }
6526 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<AudioCaptureUsage, D>>
6527 fidl::encoding::Encode<AudioCapturerSetUsageRequest, D> for (T0,)
6528 {
6529 #[inline]
6530 unsafe fn encode(
6531 self,
6532 encoder: &mut fidl::encoding::Encoder<'_, D>,
6533 offset: usize,
6534 depth: fidl::encoding::Depth,
6535 ) -> fidl::Result<()> {
6536 encoder.debug_check_bounds::<AudioCapturerSetUsageRequest>(offset);
6537 self.0.encode(encoder, offset + 0, depth)?;
6541 Ok(())
6542 }
6543 }
6544
6545 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6546 for AudioCapturerSetUsageRequest
6547 {
6548 #[inline(always)]
6549 fn new_empty() -> Self {
6550 Self { usage: fidl::new_empty!(AudioCaptureUsage, D) }
6551 }
6552
6553 #[inline]
6554 unsafe fn decode(
6555 &mut self,
6556 decoder: &mut fidl::encoding::Decoder<'_, D>,
6557 offset: usize,
6558 _depth: fidl::encoding::Depth,
6559 ) -> fidl::Result<()> {
6560 decoder.debug_check_bounds::<Self>(offset);
6561 fidl::decode!(AudioCaptureUsage, D, &mut self.usage, decoder, offset + 0, _depth)?;
6563 Ok(())
6564 }
6565 }
6566
6567 impl fidl::encoding::ValueTypeMarker for AudioCapturerStartAsyncCaptureRequest {
6568 type Borrowed<'a> = &'a Self;
6569 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6570 value
6571 }
6572 }
6573
6574 unsafe impl fidl::encoding::TypeMarker for AudioCapturerStartAsyncCaptureRequest {
6575 type Owned = Self;
6576
6577 #[inline(always)]
6578 fn inline_align(_context: fidl::encoding::Context) -> usize {
6579 4
6580 }
6581
6582 #[inline(always)]
6583 fn inline_size(_context: fidl::encoding::Context) -> usize {
6584 4
6585 }
6586 #[inline(always)]
6587 fn encode_is_copy() -> bool {
6588 true
6589 }
6590
6591 #[inline(always)]
6592 fn decode_is_copy() -> bool {
6593 true
6594 }
6595 }
6596
6597 unsafe impl<D: fidl::encoding::ResourceDialect>
6598 fidl::encoding::Encode<AudioCapturerStartAsyncCaptureRequest, D>
6599 for &AudioCapturerStartAsyncCaptureRequest
6600 {
6601 #[inline]
6602 unsafe fn encode(
6603 self,
6604 encoder: &mut fidl::encoding::Encoder<'_, D>,
6605 offset: usize,
6606 _depth: fidl::encoding::Depth,
6607 ) -> fidl::Result<()> {
6608 encoder.debug_check_bounds::<AudioCapturerStartAsyncCaptureRequest>(offset);
6609 unsafe {
6610 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
6612 (buf_ptr as *mut AudioCapturerStartAsyncCaptureRequest)
6613 .write_unaligned((self as *const AudioCapturerStartAsyncCaptureRequest).read());
6614 }
6617 Ok(())
6618 }
6619 }
6620 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
6621 fidl::encoding::Encode<AudioCapturerStartAsyncCaptureRequest, D> for (T0,)
6622 {
6623 #[inline]
6624 unsafe fn encode(
6625 self,
6626 encoder: &mut fidl::encoding::Encoder<'_, D>,
6627 offset: usize,
6628 depth: fidl::encoding::Depth,
6629 ) -> fidl::Result<()> {
6630 encoder.debug_check_bounds::<AudioCapturerStartAsyncCaptureRequest>(offset);
6631 self.0.encode(encoder, offset + 0, depth)?;
6635 Ok(())
6636 }
6637 }
6638
6639 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6640 for AudioCapturerStartAsyncCaptureRequest
6641 {
6642 #[inline(always)]
6643 fn new_empty() -> Self {
6644 Self { frames_per_packet: fidl::new_empty!(u32, D) }
6645 }
6646
6647 #[inline]
6648 unsafe fn decode(
6649 &mut self,
6650 decoder: &mut fidl::encoding::Decoder<'_, D>,
6651 offset: usize,
6652 _depth: fidl::encoding::Depth,
6653 ) -> fidl::Result<()> {
6654 decoder.debug_check_bounds::<Self>(offset);
6655 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
6656 unsafe {
6659 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
6660 }
6661 Ok(())
6662 }
6663 }
6664
6665 impl fidl::encoding::ValueTypeMarker for AudioCompressedFormatAac {
6666 type Borrowed<'a> = &'a Self;
6667 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6668 value
6669 }
6670 }
6671
6672 unsafe impl fidl::encoding::TypeMarker for AudioCompressedFormatAac {
6673 type Owned = Self;
6674
6675 #[inline(always)]
6676 fn inline_align(_context: fidl::encoding::Context) -> usize {
6677 1
6678 }
6679
6680 #[inline(always)]
6681 fn inline_size(_context: fidl::encoding::Context) -> usize {
6682 1
6683 }
6684 }
6685
6686 unsafe impl<D: fidl::encoding::ResourceDialect>
6687 fidl::encoding::Encode<AudioCompressedFormatAac, D> for &AudioCompressedFormatAac
6688 {
6689 #[inline]
6690 unsafe fn encode(
6691 self,
6692 encoder: &mut fidl::encoding::Encoder<'_, D>,
6693 offset: usize,
6694 _depth: fidl::encoding::Depth,
6695 ) -> fidl::Result<()> {
6696 encoder.debug_check_bounds::<AudioCompressedFormatAac>(offset);
6697 encoder.write_num(0u8, offset);
6698 Ok(())
6699 }
6700 }
6701
6702 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6703 for AudioCompressedFormatAac
6704 {
6705 #[inline(always)]
6706 fn new_empty() -> Self {
6707 Self
6708 }
6709
6710 #[inline]
6711 unsafe fn decode(
6712 &mut self,
6713 decoder: &mut fidl::encoding::Decoder<'_, D>,
6714 offset: usize,
6715 _depth: fidl::encoding::Depth,
6716 ) -> fidl::Result<()> {
6717 decoder.debug_check_bounds::<Self>(offset);
6718 match decoder.read_num::<u8>(offset) {
6719 0 => Ok(()),
6720 _ => Err(fidl::Error::Invalid),
6721 }
6722 }
6723 }
6724
6725 impl fidl::encoding::ValueTypeMarker for AudioCompressedFormatSbc {
6726 type Borrowed<'a> = &'a Self;
6727 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6728 value
6729 }
6730 }
6731
6732 unsafe impl fidl::encoding::TypeMarker for AudioCompressedFormatSbc {
6733 type Owned = Self;
6734
6735 #[inline(always)]
6736 fn inline_align(_context: fidl::encoding::Context) -> usize {
6737 1
6738 }
6739
6740 #[inline(always)]
6741 fn inline_size(_context: fidl::encoding::Context) -> usize {
6742 1
6743 }
6744 }
6745
6746 unsafe impl<D: fidl::encoding::ResourceDialect>
6747 fidl::encoding::Encode<AudioCompressedFormatSbc, D> for &AudioCompressedFormatSbc
6748 {
6749 #[inline]
6750 unsafe fn encode(
6751 self,
6752 encoder: &mut fidl::encoding::Encoder<'_, D>,
6753 offset: usize,
6754 _depth: fidl::encoding::Depth,
6755 ) -> fidl::Result<()> {
6756 encoder.debug_check_bounds::<AudioCompressedFormatSbc>(offset);
6757 encoder.write_num(0u8, offset);
6758 Ok(())
6759 }
6760 }
6761
6762 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6763 for AudioCompressedFormatSbc
6764 {
6765 #[inline(always)]
6766 fn new_empty() -> Self {
6767 Self
6768 }
6769
6770 #[inline]
6771 unsafe fn decode(
6772 &mut self,
6773 decoder: &mut fidl::encoding::Decoder<'_, D>,
6774 offset: usize,
6775 _depth: fidl::encoding::Depth,
6776 ) -> fidl::Result<()> {
6777 decoder.debug_check_bounds::<Self>(offset);
6778 match decoder.read_num::<u8>(offset) {
6779 0 => Ok(()),
6780 _ => Err(fidl::Error::Invalid),
6781 }
6782 }
6783 }
6784
6785 impl fidl::encoding::ValueTypeMarker for AudioConsumerSetRateRequest {
6786 type Borrowed<'a> = &'a Self;
6787 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6788 value
6789 }
6790 }
6791
6792 unsafe impl fidl::encoding::TypeMarker for AudioConsumerSetRateRequest {
6793 type Owned = Self;
6794
6795 #[inline(always)]
6796 fn inline_align(_context: fidl::encoding::Context) -> usize {
6797 4
6798 }
6799
6800 #[inline(always)]
6801 fn inline_size(_context: fidl::encoding::Context) -> usize {
6802 4
6803 }
6804 }
6805
6806 unsafe impl<D: fidl::encoding::ResourceDialect>
6807 fidl::encoding::Encode<AudioConsumerSetRateRequest, D> for &AudioConsumerSetRateRequest
6808 {
6809 #[inline]
6810 unsafe fn encode(
6811 self,
6812 encoder: &mut fidl::encoding::Encoder<'_, D>,
6813 offset: usize,
6814 _depth: fidl::encoding::Depth,
6815 ) -> fidl::Result<()> {
6816 encoder.debug_check_bounds::<AudioConsumerSetRateRequest>(offset);
6817 fidl::encoding::Encode::<AudioConsumerSetRateRequest, D>::encode(
6819 (<f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.rate),),
6820 encoder,
6821 offset,
6822 _depth,
6823 )
6824 }
6825 }
6826 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<f32, D>>
6827 fidl::encoding::Encode<AudioConsumerSetRateRequest, D> for (T0,)
6828 {
6829 #[inline]
6830 unsafe fn encode(
6831 self,
6832 encoder: &mut fidl::encoding::Encoder<'_, D>,
6833 offset: usize,
6834 depth: fidl::encoding::Depth,
6835 ) -> fidl::Result<()> {
6836 encoder.debug_check_bounds::<AudioConsumerSetRateRequest>(offset);
6837 self.0.encode(encoder, offset + 0, depth)?;
6841 Ok(())
6842 }
6843 }
6844
6845 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6846 for AudioConsumerSetRateRequest
6847 {
6848 #[inline(always)]
6849 fn new_empty() -> Self {
6850 Self { rate: fidl::new_empty!(f32, D) }
6851 }
6852
6853 #[inline]
6854 unsafe fn decode(
6855 &mut self,
6856 decoder: &mut fidl::encoding::Decoder<'_, D>,
6857 offset: usize,
6858 _depth: fidl::encoding::Depth,
6859 ) -> fidl::Result<()> {
6860 decoder.debug_check_bounds::<Self>(offset);
6861 fidl::decode!(f32, D, &mut self.rate, decoder, offset + 0, _depth)?;
6863 Ok(())
6864 }
6865 }
6866
6867 impl fidl::encoding::ValueTypeMarker for AudioConsumerStartRequest {
6868 type Borrowed<'a> = &'a Self;
6869 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6870 value
6871 }
6872 }
6873
6874 unsafe impl fidl::encoding::TypeMarker for AudioConsumerStartRequest {
6875 type Owned = Self;
6876
6877 #[inline(always)]
6878 fn inline_align(_context: fidl::encoding::Context) -> usize {
6879 8
6880 }
6881
6882 #[inline(always)]
6883 fn inline_size(_context: fidl::encoding::Context) -> usize {
6884 24
6885 }
6886 }
6887
6888 unsafe impl<D: fidl::encoding::ResourceDialect>
6889 fidl::encoding::Encode<AudioConsumerStartRequest, D> for &AudioConsumerStartRequest
6890 {
6891 #[inline]
6892 unsafe fn encode(
6893 self,
6894 encoder: &mut fidl::encoding::Encoder<'_, D>,
6895 offset: usize,
6896 _depth: fidl::encoding::Depth,
6897 ) -> fidl::Result<()> {
6898 encoder.debug_check_bounds::<AudioConsumerStartRequest>(offset);
6899 fidl::encoding::Encode::<AudioConsumerStartRequest, D>::encode(
6901 (
6902 <AudioConsumerStartFlags as fidl::encoding::ValueTypeMarker>::borrow(
6903 &self.flags,
6904 ),
6905 <i64 as fidl::encoding::ValueTypeMarker>::borrow(&self.reference_time),
6906 <i64 as fidl::encoding::ValueTypeMarker>::borrow(&self.media_time),
6907 ),
6908 encoder,
6909 offset,
6910 _depth,
6911 )
6912 }
6913 }
6914 unsafe impl<
6915 D: fidl::encoding::ResourceDialect,
6916 T0: fidl::encoding::Encode<AudioConsumerStartFlags, D>,
6917 T1: fidl::encoding::Encode<i64, D>,
6918 T2: fidl::encoding::Encode<i64, D>,
6919 > fidl::encoding::Encode<AudioConsumerStartRequest, D> for (T0, T1, T2)
6920 {
6921 #[inline]
6922 unsafe fn encode(
6923 self,
6924 encoder: &mut fidl::encoding::Encoder<'_, D>,
6925 offset: usize,
6926 depth: fidl::encoding::Depth,
6927 ) -> fidl::Result<()> {
6928 encoder.debug_check_bounds::<AudioConsumerStartRequest>(offset);
6929 unsafe {
6932 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
6933 (ptr as *mut u64).write_unaligned(0);
6934 }
6935 self.0.encode(encoder, offset + 0, depth)?;
6937 self.1.encode(encoder, offset + 8, depth)?;
6938 self.2.encode(encoder, offset + 16, depth)?;
6939 Ok(())
6940 }
6941 }
6942
6943 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6944 for AudioConsumerStartRequest
6945 {
6946 #[inline(always)]
6947 fn new_empty() -> Self {
6948 Self {
6949 flags: fidl::new_empty!(AudioConsumerStartFlags, D),
6950 reference_time: fidl::new_empty!(i64, D),
6951 media_time: fidl::new_empty!(i64, D),
6952 }
6953 }
6954
6955 #[inline]
6956 unsafe fn decode(
6957 &mut self,
6958 decoder: &mut fidl::encoding::Decoder<'_, D>,
6959 offset: usize,
6960 _depth: fidl::encoding::Depth,
6961 ) -> fidl::Result<()> {
6962 decoder.debug_check_bounds::<Self>(offset);
6963 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
6965 let padval = unsafe { (ptr as *const u64).read_unaligned() };
6966 let mask = 0xffffffff00000000u64;
6967 let maskedval = padval & mask;
6968 if maskedval != 0 {
6969 return Err(fidl::Error::NonZeroPadding {
6970 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
6971 });
6972 }
6973 fidl::decode!(
6974 AudioConsumerStartFlags,
6975 D,
6976 &mut self.flags,
6977 decoder,
6978 offset + 0,
6979 _depth
6980 )?;
6981 fidl::decode!(i64, D, &mut self.reference_time, decoder, offset + 8, _depth)?;
6982 fidl::decode!(i64, D, &mut self.media_time, decoder, offset + 16, _depth)?;
6983 Ok(())
6984 }
6985 }
6986
6987 impl fidl::encoding::ValueTypeMarker for AudioConsumerWatchStatusResponse {
6988 type Borrowed<'a> = &'a Self;
6989 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6990 value
6991 }
6992 }
6993
6994 unsafe impl fidl::encoding::TypeMarker for AudioConsumerWatchStatusResponse {
6995 type Owned = Self;
6996
6997 #[inline(always)]
6998 fn inline_align(_context: fidl::encoding::Context) -> usize {
6999 8
7000 }
7001
7002 #[inline(always)]
7003 fn inline_size(_context: fidl::encoding::Context) -> usize {
7004 16
7005 }
7006 }
7007
7008 unsafe impl<D: fidl::encoding::ResourceDialect>
7009 fidl::encoding::Encode<AudioConsumerWatchStatusResponse, D>
7010 for &AudioConsumerWatchStatusResponse
7011 {
7012 #[inline]
7013 unsafe fn encode(
7014 self,
7015 encoder: &mut fidl::encoding::Encoder<'_, D>,
7016 offset: usize,
7017 _depth: fidl::encoding::Depth,
7018 ) -> fidl::Result<()> {
7019 encoder.debug_check_bounds::<AudioConsumerWatchStatusResponse>(offset);
7020 fidl::encoding::Encode::<AudioConsumerWatchStatusResponse, D>::encode(
7022 (<AudioConsumerStatus as fidl::encoding::ValueTypeMarker>::borrow(&self.status),),
7023 encoder,
7024 offset,
7025 _depth,
7026 )
7027 }
7028 }
7029 unsafe impl<
7030 D: fidl::encoding::ResourceDialect,
7031 T0: fidl::encoding::Encode<AudioConsumerStatus, D>,
7032 > fidl::encoding::Encode<AudioConsumerWatchStatusResponse, D> for (T0,)
7033 {
7034 #[inline]
7035 unsafe fn encode(
7036 self,
7037 encoder: &mut fidl::encoding::Encoder<'_, D>,
7038 offset: usize,
7039 depth: fidl::encoding::Depth,
7040 ) -> fidl::Result<()> {
7041 encoder.debug_check_bounds::<AudioConsumerWatchStatusResponse>(offset);
7042 self.0.encode(encoder, offset + 0, depth)?;
7046 Ok(())
7047 }
7048 }
7049
7050 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7051 for AudioConsumerWatchStatusResponse
7052 {
7053 #[inline(always)]
7054 fn new_empty() -> Self {
7055 Self { status: fidl::new_empty!(AudioConsumerStatus, D) }
7056 }
7057
7058 #[inline]
7059 unsafe fn decode(
7060 &mut self,
7061 decoder: &mut fidl::encoding::Decoder<'_, D>,
7062 offset: usize,
7063 _depth: fidl::encoding::Depth,
7064 ) -> fidl::Result<()> {
7065 decoder.debug_check_bounds::<Self>(offset);
7066 fidl::decode!(AudioConsumerStatus, D, &mut self.status, decoder, offset + 0, _depth)?;
7068 Ok(())
7069 }
7070 }
7071
7072 impl fidl::encoding::ValueTypeMarker for AudioCoreEnableDeviceSettingsRequest {
7073 type Borrowed<'a> = &'a Self;
7074 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7075 value
7076 }
7077 }
7078
7079 unsafe impl fidl::encoding::TypeMarker for AudioCoreEnableDeviceSettingsRequest {
7080 type Owned = Self;
7081
7082 #[inline(always)]
7083 fn inline_align(_context: fidl::encoding::Context) -> usize {
7084 1
7085 }
7086
7087 #[inline(always)]
7088 fn inline_size(_context: fidl::encoding::Context) -> usize {
7089 1
7090 }
7091 }
7092
7093 unsafe impl<D: fidl::encoding::ResourceDialect>
7094 fidl::encoding::Encode<AudioCoreEnableDeviceSettingsRequest, D>
7095 for &AudioCoreEnableDeviceSettingsRequest
7096 {
7097 #[inline]
7098 unsafe fn encode(
7099 self,
7100 encoder: &mut fidl::encoding::Encoder<'_, D>,
7101 offset: usize,
7102 _depth: fidl::encoding::Depth,
7103 ) -> fidl::Result<()> {
7104 encoder.debug_check_bounds::<AudioCoreEnableDeviceSettingsRequest>(offset);
7105 fidl::encoding::Encode::<AudioCoreEnableDeviceSettingsRequest, D>::encode(
7107 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.enabled),),
7108 encoder,
7109 offset,
7110 _depth,
7111 )
7112 }
7113 }
7114 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
7115 fidl::encoding::Encode<AudioCoreEnableDeviceSettingsRequest, D> for (T0,)
7116 {
7117 #[inline]
7118 unsafe fn encode(
7119 self,
7120 encoder: &mut fidl::encoding::Encoder<'_, D>,
7121 offset: usize,
7122 depth: fidl::encoding::Depth,
7123 ) -> fidl::Result<()> {
7124 encoder.debug_check_bounds::<AudioCoreEnableDeviceSettingsRequest>(offset);
7125 self.0.encode(encoder, offset + 0, depth)?;
7129 Ok(())
7130 }
7131 }
7132
7133 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7134 for AudioCoreEnableDeviceSettingsRequest
7135 {
7136 #[inline(always)]
7137 fn new_empty() -> Self {
7138 Self { enabled: fidl::new_empty!(bool, D) }
7139 }
7140
7141 #[inline]
7142 unsafe fn decode(
7143 &mut self,
7144 decoder: &mut fidl::encoding::Decoder<'_, D>,
7145 offset: usize,
7146 _depth: fidl::encoding::Depth,
7147 ) -> fidl::Result<()> {
7148 decoder.debug_check_bounds::<Self>(offset);
7149 fidl::decode!(bool, D, &mut self.enabled, decoder, offset + 0, _depth)?;
7151 Ok(())
7152 }
7153 }
7154
7155 impl fidl::encoding::ValueTypeMarker for AudioCoreGetDbFromVolume2Request {
7156 type Borrowed<'a> = &'a Self;
7157 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7158 value
7159 }
7160 }
7161
7162 unsafe impl fidl::encoding::TypeMarker for AudioCoreGetDbFromVolume2Request {
7163 type Owned = Self;
7164
7165 #[inline(always)]
7166 fn inline_align(_context: fidl::encoding::Context) -> usize {
7167 8
7168 }
7169
7170 #[inline(always)]
7171 fn inline_size(_context: fidl::encoding::Context) -> usize {
7172 24
7173 }
7174 }
7175
7176 unsafe impl<D: fidl::encoding::ResourceDialect>
7177 fidl::encoding::Encode<AudioCoreGetDbFromVolume2Request, D>
7178 for &AudioCoreGetDbFromVolume2Request
7179 {
7180 #[inline]
7181 unsafe fn encode(
7182 self,
7183 encoder: &mut fidl::encoding::Encoder<'_, D>,
7184 offset: usize,
7185 _depth: fidl::encoding::Depth,
7186 ) -> fidl::Result<()> {
7187 encoder.debug_check_bounds::<AudioCoreGetDbFromVolume2Request>(offset);
7188 fidl::encoding::Encode::<AudioCoreGetDbFromVolume2Request, D>::encode(
7190 (
7191 <Usage2 as fidl::encoding::ValueTypeMarker>::borrow(&self.usage),
7192 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.volume),
7193 ),
7194 encoder,
7195 offset,
7196 _depth,
7197 )
7198 }
7199 }
7200 unsafe impl<
7201 D: fidl::encoding::ResourceDialect,
7202 T0: fidl::encoding::Encode<Usage2, D>,
7203 T1: fidl::encoding::Encode<f32, D>,
7204 > fidl::encoding::Encode<AudioCoreGetDbFromVolume2Request, D> for (T0, T1)
7205 {
7206 #[inline]
7207 unsafe fn encode(
7208 self,
7209 encoder: &mut fidl::encoding::Encoder<'_, D>,
7210 offset: usize,
7211 depth: fidl::encoding::Depth,
7212 ) -> fidl::Result<()> {
7213 encoder.debug_check_bounds::<AudioCoreGetDbFromVolume2Request>(offset);
7214 unsafe {
7217 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
7218 (ptr as *mut u64).write_unaligned(0);
7219 }
7220 self.0.encode(encoder, offset + 0, depth)?;
7222 self.1.encode(encoder, offset + 16, depth)?;
7223 Ok(())
7224 }
7225 }
7226
7227 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7228 for AudioCoreGetDbFromVolume2Request
7229 {
7230 #[inline(always)]
7231 fn new_empty() -> Self {
7232 Self { usage: fidl::new_empty!(Usage2, D), volume: fidl::new_empty!(f32, D) }
7233 }
7234
7235 #[inline]
7236 unsafe fn decode(
7237 &mut self,
7238 decoder: &mut fidl::encoding::Decoder<'_, D>,
7239 offset: usize,
7240 _depth: fidl::encoding::Depth,
7241 ) -> fidl::Result<()> {
7242 decoder.debug_check_bounds::<Self>(offset);
7243 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
7245 let padval = unsafe { (ptr as *const u64).read_unaligned() };
7246 let mask = 0xffffffff00000000u64;
7247 let maskedval = padval & mask;
7248 if maskedval != 0 {
7249 return Err(fidl::Error::NonZeroPadding {
7250 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
7251 });
7252 }
7253 fidl::decode!(Usage2, D, &mut self.usage, decoder, offset + 0, _depth)?;
7254 fidl::decode!(f32, D, &mut self.volume, decoder, offset + 16, _depth)?;
7255 Ok(())
7256 }
7257 }
7258
7259 impl fidl::encoding::ValueTypeMarker for AudioCoreGetDbFromVolumeRequest {
7260 type Borrowed<'a> = &'a Self;
7261 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7262 value
7263 }
7264 }
7265
7266 unsafe impl fidl::encoding::TypeMarker for AudioCoreGetDbFromVolumeRequest {
7267 type Owned = Self;
7268
7269 #[inline(always)]
7270 fn inline_align(_context: fidl::encoding::Context) -> usize {
7271 8
7272 }
7273
7274 #[inline(always)]
7275 fn inline_size(_context: fidl::encoding::Context) -> usize {
7276 24
7277 }
7278 }
7279
7280 unsafe impl<D: fidl::encoding::ResourceDialect>
7281 fidl::encoding::Encode<AudioCoreGetDbFromVolumeRequest, D>
7282 for &AudioCoreGetDbFromVolumeRequest
7283 {
7284 #[inline]
7285 unsafe fn encode(
7286 self,
7287 encoder: &mut fidl::encoding::Encoder<'_, D>,
7288 offset: usize,
7289 _depth: fidl::encoding::Depth,
7290 ) -> fidl::Result<()> {
7291 encoder.debug_check_bounds::<AudioCoreGetDbFromVolumeRequest>(offset);
7292 fidl::encoding::Encode::<AudioCoreGetDbFromVolumeRequest, D>::encode(
7294 (
7295 <Usage as fidl::encoding::ValueTypeMarker>::borrow(&self.usage),
7296 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.volume),
7297 ),
7298 encoder,
7299 offset,
7300 _depth,
7301 )
7302 }
7303 }
7304 unsafe impl<
7305 D: fidl::encoding::ResourceDialect,
7306 T0: fidl::encoding::Encode<Usage, D>,
7307 T1: fidl::encoding::Encode<f32, D>,
7308 > fidl::encoding::Encode<AudioCoreGetDbFromVolumeRequest, D> for (T0, T1)
7309 {
7310 #[inline]
7311 unsafe fn encode(
7312 self,
7313 encoder: &mut fidl::encoding::Encoder<'_, D>,
7314 offset: usize,
7315 depth: fidl::encoding::Depth,
7316 ) -> fidl::Result<()> {
7317 encoder.debug_check_bounds::<AudioCoreGetDbFromVolumeRequest>(offset);
7318 unsafe {
7321 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
7322 (ptr as *mut u64).write_unaligned(0);
7323 }
7324 self.0.encode(encoder, offset + 0, depth)?;
7326 self.1.encode(encoder, offset + 16, depth)?;
7327 Ok(())
7328 }
7329 }
7330
7331 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7332 for AudioCoreGetDbFromVolumeRequest
7333 {
7334 #[inline(always)]
7335 fn new_empty() -> Self {
7336 Self { usage: fidl::new_empty!(Usage, D), volume: fidl::new_empty!(f32, D) }
7337 }
7338
7339 #[inline]
7340 unsafe fn decode(
7341 &mut self,
7342 decoder: &mut fidl::encoding::Decoder<'_, D>,
7343 offset: usize,
7344 _depth: fidl::encoding::Depth,
7345 ) -> fidl::Result<()> {
7346 decoder.debug_check_bounds::<Self>(offset);
7347 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
7349 let padval = unsafe { (ptr as *const u64).read_unaligned() };
7350 let mask = 0xffffffff00000000u64;
7351 let maskedval = padval & mask;
7352 if maskedval != 0 {
7353 return Err(fidl::Error::NonZeroPadding {
7354 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
7355 });
7356 }
7357 fidl::decode!(Usage, D, &mut self.usage, decoder, offset + 0, _depth)?;
7358 fidl::decode!(f32, D, &mut self.volume, decoder, offset + 16, _depth)?;
7359 Ok(())
7360 }
7361 }
7362
7363 impl fidl::encoding::ValueTypeMarker for AudioCoreGetDbFromVolumeResponse {
7364 type Borrowed<'a> = &'a Self;
7365 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7366 value
7367 }
7368 }
7369
7370 unsafe impl fidl::encoding::TypeMarker for AudioCoreGetDbFromVolumeResponse {
7371 type Owned = Self;
7372
7373 #[inline(always)]
7374 fn inline_align(_context: fidl::encoding::Context) -> usize {
7375 4
7376 }
7377
7378 #[inline(always)]
7379 fn inline_size(_context: fidl::encoding::Context) -> usize {
7380 4
7381 }
7382 }
7383
7384 unsafe impl<D: fidl::encoding::ResourceDialect>
7385 fidl::encoding::Encode<AudioCoreGetDbFromVolumeResponse, D>
7386 for &AudioCoreGetDbFromVolumeResponse
7387 {
7388 #[inline]
7389 unsafe fn encode(
7390 self,
7391 encoder: &mut fidl::encoding::Encoder<'_, D>,
7392 offset: usize,
7393 _depth: fidl::encoding::Depth,
7394 ) -> fidl::Result<()> {
7395 encoder.debug_check_bounds::<AudioCoreGetDbFromVolumeResponse>(offset);
7396 fidl::encoding::Encode::<AudioCoreGetDbFromVolumeResponse, D>::encode(
7398 (<f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.gain_db),),
7399 encoder,
7400 offset,
7401 _depth,
7402 )
7403 }
7404 }
7405 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<f32, D>>
7406 fidl::encoding::Encode<AudioCoreGetDbFromVolumeResponse, D> for (T0,)
7407 {
7408 #[inline]
7409 unsafe fn encode(
7410 self,
7411 encoder: &mut fidl::encoding::Encoder<'_, D>,
7412 offset: usize,
7413 depth: fidl::encoding::Depth,
7414 ) -> fidl::Result<()> {
7415 encoder.debug_check_bounds::<AudioCoreGetDbFromVolumeResponse>(offset);
7416 self.0.encode(encoder, offset + 0, depth)?;
7420 Ok(())
7421 }
7422 }
7423
7424 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7425 for AudioCoreGetDbFromVolumeResponse
7426 {
7427 #[inline(always)]
7428 fn new_empty() -> Self {
7429 Self { gain_db: fidl::new_empty!(f32, D) }
7430 }
7431
7432 #[inline]
7433 unsafe fn decode(
7434 &mut self,
7435 decoder: &mut fidl::encoding::Decoder<'_, D>,
7436 offset: usize,
7437 _depth: fidl::encoding::Depth,
7438 ) -> fidl::Result<()> {
7439 decoder.debug_check_bounds::<Self>(offset);
7440 fidl::decode!(f32, D, &mut self.gain_db, decoder, offset + 0, _depth)?;
7442 Ok(())
7443 }
7444 }
7445
7446 impl fidl::encoding::ValueTypeMarker for AudioCoreGetVolumeFromDb2Request {
7447 type Borrowed<'a> = &'a Self;
7448 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7449 value
7450 }
7451 }
7452
7453 unsafe impl fidl::encoding::TypeMarker for AudioCoreGetVolumeFromDb2Request {
7454 type Owned = Self;
7455
7456 #[inline(always)]
7457 fn inline_align(_context: fidl::encoding::Context) -> usize {
7458 8
7459 }
7460
7461 #[inline(always)]
7462 fn inline_size(_context: fidl::encoding::Context) -> usize {
7463 24
7464 }
7465 }
7466
7467 unsafe impl<D: fidl::encoding::ResourceDialect>
7468 fidl::encoding::Encode<AudioCoreGetVolumeFromDb2Request, D>
7469 for &AudioCoreGetVolumeFromDb2Request
7470 {
7471 #[inline]
7472 unsafe fn encode(
7473 self,
7474 encoder: &mut fidl::encoding::Encoder<'_, D>,
7475 offset: usize,
7476 _depth: fidl::encoding::Depth,
7477 ) -> fidl::Result<()> {
7478 encoder.debug_check_bounds::<AudioCoreGetVolumeFromDb2Request>(offset);
7479 fidl::encoding::Encode::<AudioCoreGetVolumeFromDb2Request, D>::encode(
7481 (
7482 <Usage2 as fidl::encoding::ValueTypeMarker>::borrow(&self.usage),
7483 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.gain_db),
7484 ),
7485 encoder,
7486 offset,
7487 _depth,
7488 )
7489 }
7490 }
7491 unsafe impl<
7492 D: fidl::encoding::ResourceDialect,
7493 T0: fidl::encoding::Encode<Usage2, D>,
7494 T1: fidl::encoding::Encode<f32, D>,
7495 > fidl::encoding::Encode<AudioCoreGetVolumeFromDb2Request, D> for (T0, T1)
7496 {
7497 #[inline]
7498 unsafe fn encode(
7499 self,
7500 encoder: &mut fidl::encoding::Encoder<'_, D>,
7501 offset: usize,
7502 depth: fidl::encoding::Depth,
7503 ) -> fidl::Result<()> {
7504 encoder.debug_check_bounds::<AudioCoreGetVolumeFromDb2Request>(offset);
7505 unsafe {
7508 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
7509 (ptr as *mut u64).write_unaligned(0);
7510 }
7511 self.0.encode(encoder, offset + 0, depth)?;
7513 self.1.encode(encoder, offset + 16, depth)?;
7514 Ok(())
7515 }
7516 }
7517
7518 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7519 for AudioCoreGetVolumeFromDb2Request
7520 {
7521 #[inline(always)]
7522 fn new_empty() -> Self {
7523 Self { usage: fidl::new_empty!(Usage2, D), gain_db: fidl::new_empty!(f32, D) }
7524 }
7525
7526 #[inline]
7527 unsafe fn decode(
7528 &mut self,
7529 decoder: &mut fidl::encoding::Decoder<'_, D>,
7530 offset: usize,
7531 _depth: fidl::encoding::Depth,
7532 ) -> fidl::Result<()> {
7533 decoder.debug_check_bounds::<Self>(offset);
7534 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
7536 let padval = unsafe { (ptr as *const u64).read_unaligned() };
7537 let mask = 0xffffffff00000000u64;
7538 let maskedval = padval & mask;
7539 if maskedval != 0 {
7540 return Err(fidl::Error::NonZeroPadding {
7541 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
7542 });
7543 }
7544 fidl::decode!(Usage2, D, &mut self.usage, decoder, offset + 0, _depth)?;
7545 fidl::decode!(f32, D, &mut self.gain_db, decoder, offset + 16, _depth)?;
7546 Ok(())
7547 }
7548 }
7549
7550 impl fidl::encoding::ValueTypeMarker for AudioCoreGetVolumeFromDbRequest {
7551 type Borrowed<'a> = &'a Self;
7552 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7553 value
7554 }
7555 }
7556
7557 unsafe impl fidl::encoding::TypeMarker for AudioCoreGetVolumeFromDbRequest {
7558 type Owned = Self;
7559
7560 #[inline(always)]
7561 fn inline_align(_context: fidl::encoding::Context) -> usize {
7562 8
7563 }
7564
7565 #[inline(always)]
7566 fn inline_size(_context: fidl::encoding::Context) -> usize {
7567 24
7568 }
7569 }
7570
7571 unsafe impl<D: fidl::encoding::ResourceDialect>
7572 fidl::encoding::Encode<AudioCoreGetVolumeFromDbRequest, D>
7573 for &AudioCoreGetVolumeFromDbRequest
7574 {
7575 #[inline]
7576 unsafe fn encode(
7577 self,
7578 encoder: &mut fidl::encoding::Encoder<'_, D>,
7579 offset: usize,
7580 _depth: fidl::encoding::Depth,
7581 ) -> fidl::Result<()> {
7582 encoder.debug_check_bounds::<AudioCoreGetVolumeFromDbRequest>(offset);
7583 fidl::encoding::Encode::<AudioCoreGetVolumeFromDbRequest, D>::encode(
7585 (
7586 <Usage as fidl::encoding::ValueTypeMarker>::borrow(&self.usage),
7587 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.gain_db),
7588 ),
7589 encoder,
7590 offset,
7591 _depth,
7592 )
7593 }
7594 }
7595 unsafe impl<
7596 D: fidl::encoding::ResourceDialect,
7597 T0: fidl::encoding::Encode<Usage, D>,
7598 T1: fidl::encoding::Encode<f32, D>,
7599 > fidl::encoding::Encode<AudioCoreGetVolumeFromDbRequest, D> for (T0, T1)
7600 {
7601 #[inline]
7602 unsafe fn encode(
7603 self,
7604 encoder: &mut fidl::encoding::Encoder<'_, D>,
7605 offset: usize,
7606 depth: fidl::encoding::Depth,
7607 ) -> fidl::Result<()> {
7608 encoder.debug_check_bounds::<AudioCoreGetVolumeFromDbRequest>(offset);
7609 unsafe {
7612 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
7613 (ptr as *mut u64).write_unaligned(0);
7614 }
7615 self.0.encode(encoder, offset + 0, depth)?;
7617 self.1.encode(encoder, offset + 16, depth)?;
7618 Ok(())
7619 }
7620 }
7621
7622 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7623 for AudioCoreGetVolumeFromDbRequest
7624 {
7625 #[inline(always)]
7626 fn new_empty() -> Self {
7627 Self { usage: fidl::new_empty!(Usage, D), gain_db: fidl::new_empty!(f32, D) }
7628 }
7629
7630 #[inline]
7631 unsafe fn decode(
7632 &mut self,
7633 decoder: &mut fidl::encoding::Decoder<'_, D>,
7634 offset: usize,
7635 _depth: fidl::encoding::Depth,
7636 ) -> fidl::Result<()> {
7637 decoder.debug_check_bounds::<Self>(offset);
7638 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
7640 let padval = unsafe { (ptr as *const u64).read_unaligned() };
7641 let mask = 0xffffffff00000000u64;
7642 let maskedval = padval & mask;
7643 if maskedval != 0 {
7644 return Err(fidl::Error::NonZeroPadding {
7645 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
7646 });
7647 }
7648 fidl::decode!(Usage, D, &mut self.usage, decoder, offset + 0, _depth)?;
7649 fidl::decode!(f32, D, &mut self.gain_db, decoder, offset + 16, _depth)?;
7650 Ok(())
7651 }
7652 }
7653
7654 impl fidl::encoding::ValueTypeMarker for AudioCoreGetVolumeFromDbResponse {
7655 type Borrowed<'a> = &'a Self;
7656 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7657 value
7658 }
7659 }
7660
7661 unsafe impl fidl::encoding::TypeMarker for AudioCoreGetVolumeFromDbResponse {
7662 type Owned = Self;
7663
7664 #[inline(always)]
7665 fn inline_align(_context: fidl::encoding::Context) -> usize {
7666 4
7667 }
7668
7669 #[inline(always)]
7670 fn inline_size(_context: fidl::encoding::Context) -> usize {
7671 4
7672 }
7673 }
7674
7675 unsafe impl<D: fidl::encoding::ResourceDialect>
7676 fidl::encoding::Encode<AudioCoreGetVolumeFromDbResponse, D>
7677 for &AudioCoreGetVolumeFromDbResponse
7678 {
7679 #[inline]
7680 unsafe fn encode(
7681 self,
7682 encoder: &mut fidl::encoding::Encoder<'_, D>,
7683 offset: usize,
7684 _depth: fidl::encoding::Depth,
7685 ) -> fidl::Result<()> {
7686 encoder.debug_check_bounds::<AudioCoreGetVolumeFromDbResponse>(offset);
7687 fidl::encoding::Encode::<AudioCoreGetVolumeFromDbResponse, D>::encode(
7689 (<f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.volume),),
7690 encoder,
7691 offset,
7692 _depth,
7693 )
7694 }
7695 }
7696 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<f32, D>>
7697 fidl::encoding::Encode<AudioCoreGetVolumeFromDbResponse, D> for (T0,)
7698 {
7699 #[inline]
7700 unsafe fn encode(
7701 self,
7702 encoder: &mut fidl::encoding::Encoder<'_, D>,
7703 offset: usize,
7704 depth: fidl::encoding::Depth,
7705 ) -> fidl::Result<()> {
7706 encoder.debug_check_bounds::<AudioCoreGetVolumeFromDbResponse>(offset);
7707 self.0.encode(encoder, offset + 0, depth)?;
7711 Ok(())
7712 }
7713 }
7714
7715 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7716 for AudioCoreGetVolumeFromDbResponse
7717 {
7718 #[inline(always)]
7719 fn new_empty() -> Self {
7720 Self { volume: fidl::new_empty!(f32, D) }
7721 }
7722
7723 #[inline]
7724 unsafe fn decode(
7725 &mut self,
7726 decoder: &mut fidl::encoding::Decoder<'_, D>,
7727 offset: usize,
7728 _depth: fidl::encoding::Depth,
7729 ) -> fidl::Result<()> {
7730 decoder.debug_check_bounds::<Self>(offset);
7731 fidl::decode!(f32, D, &mut self.volume, decoder, offset + 0, _depth)?;
7733 Ok(())
7734 }
7735 }
7736
7737 impl fidl::encoding::ValueTypeMarker for AudioCoreSetCaptureUsageGain2Request {
7738 type Borrowed<'a> = &'a Self;
7739 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7740 value
7741 }
7742 }
7743
7744 unsafe impl fidl::encoding::TypeMarker for AudioCoreSetCaptureUsageGain2Request {
7745 type Owned = Self;
7746
7747 #[inline(always)]
7748 fn inline_align(_context: fidl::encoding::Context) -> usize {
7749 4
7750 }
7751
7752 #[inline(always)]
7753 fn inline_size(_context: fidl::encoding::Context) -> usize {
7754 8
7755 }
7756 }
7757
7758 unsafe impl<D: fidl::encoding::ResourceDialect>
7759 fidl::encoding::Encode<AudioCoreSetCaptureUsageGain2Request, D>
7760 for &AudioCoreSetCaptureUsageGain2Request
7761 {
7762 #[inline]
7763 unsafe fn encode(
7764 self,
7765 encoder: &mut fidl::encoding::Encoder<'_, D>,
7766 offset: usize,
7767 _depth: fidl::encoding::Depth,
7768 ) -> fidl::Result<()> {
7769 encoder.debug_check_bounds::<AudioCoreSetCaptureUsageGain2Request>(offset);
7770 fidl::encoding::Encode::<AudioCoreSetCaptureUsageGain2Request, D>::encode(
7772 (
7773 <AudioCaptureUsage2 as fidl::encoding::ValueTypeMarker>::borrow(&self.usage),
7774 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.gain_db),
7775 ),
7776 encoder,
7777 offset,
7778 _depth,
7779 )
7780 }
7781 }
7782 unsafe impl<
7783 D: fidl::encoding::ResourceDialect,
7784 T0: fidl::encoding::Encode<AudioCaptureUsage2, D>,
7785 T1: fidl::encoding::Encode<f32, D>,
7786 > fidl::encoding::Encode<AudioCoreSetCaptureUsageGain2Request, D> for (T0, T1)
7787 {
7788 #[inline]
7789 unsafe fn encode(
7790 self,
7791 encoder: &mut fidl::encoding::Encoder<'_, D>,
7792 offset: usize,
7793 depth: fidl::encoding::Depth,
7794 ) -> fidl::Result<()> {
7795 encoder.debug_check_bounds::<AudioCoreSetCaptureUsageGain2Request>(offset);
7796 self.0.encode(encoder, offset + 0, depth)?;
7800 self.1.encode(encoder, offset + 4, depth)?;
7801 Ok(())
7802 }
7803 }
7804
7805 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7806 for AudioCoreSetCaptureUsageGain2Request
7807 {
7808 #[inline(always)]
7809 fn new_empty() -> Self {
7810 Self {
7811 usage: fidl::new_empty!(AudioCaptureUsage2, D),
7812 gain_db: fidl::new_empty!(f32, D),
7813 }
7814 }
7815
7816 #[inline]
7817 unsafe fn decode(
7818 &mut self,
7819 decoder: &mut fidl::encoding::Decoder<'_, D>,
7820 offset: usize,
7821 _depth: fidl::encoding::Depth,
7822 ) -> fidl::Result<()> {
7823 decoder.debug_check_bounds::<Self>(offset);
7824 fidl::decode!(AudioCaptureUsage2, D, &mut self.usage, decoder, offset + 0, _depth)?;
7826 fidl::decode!(f32, D, &mut self.gain_db, decoder, offset + 4, _depth)?;
7827 Ok(())
7828 }
7829 }
7830
7831 impl fidl::encoding::ValueTypeMarker for AudioCoreSetCaptureUsageGainRequest {
7832 type Borrowed<'a> = &'a Self;
7833 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7834 value
7835 }
7836 }
7837
7838 unsafe impl fidl::encoding::TypeMarker for AudioCoreSetCaptureUsageGainRequest {
7839 type Owned = Self;
7840
7841 #[inline(always)]
7842 fn inline_align(_context: fidl::encoding::Context) -> usize {
7843 4
7844 }
7845
7846 #[inline(always)]
7847 fn inline_size(_context: fidl::encoding::Context) -> usize {
7848 8
7849 }
7850 }
7851
7852 unsafe impl<D: fidl::encoding::ResourceDialect>
7853 fidl::encoding::Encode<AudioCoreSetCaptureUsageGainRequest, D>
7854 for &AudioCoreSetCaptureUsageGainRequest
7855 {
7856 #[inline]
7857 unsafe fn encode(
7858 self,
7859 encoder: &mut fidl::encoding::Encoder<'_, D>,
7860 offset: usize,
7861 _depth: fidl::encoding::Depth,
7862 ) -> fidl::Result<()> {
7863 encoder.debug_check_bounds::<AudioCoreSetCaptureUsageGainRequest>(offset);
7864 fidl::encoding::Encode::<AudioCoreSetCaptureUsageGainRequest, D>::encode(
7866 (
7867 <AudioCaptureUsage as fidl::encoding::ValueTypeMarker>::borrow(&self.usage),
7868 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.gain_db),
7869 ),
7870 encoder,
7871 offset,
7872 _depth,
7873 )
7874 }
7875 }
7876 unsafe impl<
7877 D: fidl::encoding::ResourceDialect,
7878 T0: fidl::encoding::Encode<AudioCaptureUsage, D>,
7879 T1: fidl::encoding::Encode<f32, D>,
7880 > fidl::encoding::Encode<AudioCoreSetCaptureUsageGainRequest, D> for (T0, T1)
7881 {
7882 #[inline]
7883 unsafe fn encode(
7884 self,
7885 encoder: &mut fidl::encoding::Encoder<'_, D>,
7886 offset: usize,
7887 depth: fidl::encoding::Depth,
7888 ) -> fidl::Result<()> {
7889 encoder.debug_check_bounds::<AudioCoreSetCaptureUsageGainRequest>(offset);
7890 self.0.encode(encoder, offset + 0, depth)?;
7894 self.1.encode(encoder, offset + 4, depth)?;
7895 Ok(())
7896 }
7897 }
7898
7899 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7900 for AudioCoreSetCaptureUsageGainRequest
7901 {
7902 #[inline(always)]
7903 fn new_empty() -> Self {
7904 Self {
7905 usage: fidl::new_empty!(AudioCaptureUsage, D),
7906 gain_db: fidl::new_empty!(f32, D),
7907 }
7908 }
7909
7910 #[inline]
7911 unsafe fn decode(
7912 &mut self,
7913 decoder: &mut fidl::encoding::Decoder<'_, D>,
7914 offset: usize,
7915 _depth: fidl::encoding::Depth,
7916 ) -> fidl::Result<()> {
7917 decoder.debug_check_bounds::<Self>(offset);
7918 fidl::decode!(AudioCaptureUsage, D, &mut self.usage, decoder, offset + 0, _depth)?;
7920 fidl::decode!(f32, D, &mut self.gain_db, decoder, offset + 4, _depth)?;
7921 Ok(())
7922 }
7923 }
7924
7925 impl fidl::encoding::ValueTypeMarker for AudioCoreSetInteraction2Request {
7926 type Borrowed<'a> = &'a Self;
7927 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7928 value
7929 }
7930 }
7931
7932 unsafe impl fidl::encoding::TypeMarker for AudioCoreSetInteraction2Request {
7933 type Owned = Self;
7934
7935 #[inline(always)]
7936 fn inline_align(_context: fidl::encoding::Context) -> usize {
7937 8
7938 }
7939
7940 #[inline(always)]
7941 fn inline_size(_context: fidl::encoding::Context) -> usize {
7942 40
7943 }
7944 }
7945
7946 unsafe impl<D: fidl::encoding::ResourceDialect>
7947 fidl::encoding::Encode<AudioCoreSetInteraction2Request, D>
7948 for &AudioCoreSetInteraction2Request
7949 {
7950 #[inline]
7951 unsafe fn encode(
7952 self,
7953 encoder: &mut fidl::encoding::Encoder<'_, D>,
7954 offset: usize,
7955 _depth: fidl::encoding::Depth,
7956 ) -> fidl::Result<()> {
7957 encoder.debug_check_bounds::<AudioCoreSetInteraction2Request>(offset);
7958 fidl::encoding::Encode::<AudioCoreSetInteraction2Request, D>::encode(
7960 (
7961 <Usage2 as fidl::encoding::ValueTypeMarker>::borrow(&self.active),
7962 <Usage2 as fidl::encoding::ValueTypeMarker>::borrow(&self.affected),
7963 <Behavior as fidl::encoding::ValueTypeMarker>::borrow(&self.behavior),
7964 ),
7965 encoder,
7966 offset,
7967 _depth,
7968 )
7969 }
7970 }
7971 unsafe impl<
7972 D: fidl::encoding::ResourceDialect,
7973 T0: fidl::encoding::Encode<Usage2, D>,
7974 T1: fidl::encoding::Encode<Usage2, D>,
7975 T2: fidl::encoding::Encode<Behavior, D>,
7976 > fidl::encoding::Encode<AudioCoreSetInteraction2Request, D> for (T0, T1, T2)
7977 {
7978 #[inline]
7979 unsafe fn encode(
7980 self,
7981 encoder: &mut fidl::encoding::Encoder<'_, D>,
7982 offset: usize,
7983 depth: fidl::encoding::Depth,
7984 ) -> fidl::Result<()> {
7985 encoder.debug_check_bounds::<AudioCoreSetInteraction2Request>(offset);
7986 unsafe {
7989 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
7990 (ptr as *mut u64).write_unaligned(0);
7991 }
7992 self.0.encode(encoder, offset + 0, depth)?;
7994 self.1.encode(encoder, offset + 16, depth)?;
7995 self.2.encode(encoder, offset + 32, depth)?;
7996 Ok(())
7997 }
7998 }
7999
8000 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8001 for AudioCoreSetInteraction2Request
8002 {
8003 #[inline(always)]
8004 fn new_empty() -> Self {
8005 Self {
8006 active: fidl::new_empty!(Usage2, D),
8007 affected: fidl::new_empty!(Usage2, D),
8008 behavior: fidl::new_empty!(Behavior, D),
8009 }
8010 }
8011
8012 #[inline]
8013 unsafe fn decode(
8014 &mut self,
8015 decoder: &mut fidl::encoding::Decoder<'_, D>,
8016 offset: usize,
8017 _depth: fidl::encoding::Depth,
8018 ) -> fidl::Result<()> {
8019 decoder.debug_check_bounds::<Self>(offset);
8020 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
8022 let padval = unsafe { (ptr as *const u64).read_unaligned() };
8023 let mask = 0xffffffff00000000u64;
8024 let maskedval = padval & mask;
8025 if maskedval != 0 {
8026 return Err(fidl::Error::NonZeroPadding {
8027 padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
8028 });
8029 }
8030 fidl::decode!(Usage2, D, &mut self.active, decoder, offset + 0, _depth)?;
8031 fidl::decode!(Usage2, D, &mut self.affected, decoder, offset + 16, _depth)?;
8032 fidl::decode!(Behavior, D, &mut self.behavior, decoder, offset + 32, _depth)?;
8033 Ok(())
8034 }
8035 }
8036
8037 impl fidl::encoding::ValueTypeMarker for AudioCoreSetInteractionRequest {
8038 type Borrowed<'a> = &'a Self;
8039 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8040 value
8041 }
8042 }
8043
8044 unsafe impl fidl::encoding::TypeMarker for AudioCoreSetInteractionRequest {
8045 type Owned = Self;
8046
8047 #[inline(always)]
8048 fn inline_align(_context: fidl::encoding::Context) -> usize {
8049 8
8050 }
8051
8052 #[inline(always)]
8053 fn inline_size(_context: fidl::encoding::Context) -> usize {
8054 40
8055 }
8056 }
8057
8058 unsafe impl<D: fidl::encoding::ResourceDialect>
8059 fidl::encoding::Encode<AudioCoreSetInteractionRequest, D>
8060 for &AudioCoreSetInteractionRequest
8061 {
8062 #[inline]
8063 unsafe fn encode(
8064 self,
8065 encoder: &mut fidl::encoding::Encoder<'_, D>,
8066 offset: usize,
8067 _depth: fidl::encoding::Depth,
8068 ) -> fidl::Result<()> {
8069 encoder.debug_check_bounds::<AudioCoreSetInteractionRequest>(offset);
8070 fidl::encoding::Encode::<AudioCoreSetInteractionRequest, D>::encode(
8072 (
8073 <Usage as fidl::encoding::ValueTypeMarker>::borrow(&self.active),
8074 <Usage as fidl::encoding::ValueTypeMarker>::borrow(&self.affected),
8075 <Behavior as fidl::encoding::ValueTypeMarker>::borrow(&self.behavior),
8076 ),
8077 encoder,
8078 offset,
8079 _depth,
8080 )
8081 }
8082 }
8083 unsafe impl<
8084 D: fidl::encoding::ResourceDialect,
8085 T0: fidl::encoding::Encode<Usage, D>,
8086 T1: fidl::encoding::Encode<Usage, D>,
8087 T2: fidl::encoding::Encode<Behavior, D>,
8088 > fidl::encoding::Encode<AudioCoreSetInteractionRequest, D> for (T0, T1, T2)
8089 {
8090 #[inline]
8091 unsafe fn encode(
8092 self,
8093 encoder: &mut fidl::encoding::Encoder<'_, D>,
8094 offset: usize,
8095 depth: fidl::encoding::Depth,
8096 ) -> fidl::Result<()> {
8097 encoder.debug_check_bounds::<AudioCoreSetInteractionRequest>(offset);
8098 unsafe {
8101 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
8102 (ptr as *mut u64).write_unaligned(0);
8103 }
8104 self.0.encode(encoder, offset + 0, depth)?;
8106 self.1.encode(encoder, offset + 16, depth)?;
8107 self.2.encode(encoder, offset + 32, depth)?;
8108 Ok(())
8109 }
8110 }
8111
8112 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8113 for AudioCoreSetInteractionRequest
8114 {
8115 #[inline(always)]
8116 fn new_empty() -> Self {
8117 Self {
8118 active: fidl::new_empty!(Usage, D),
8119 affected: fidl::new_empty!(Usage, D),
8120 behavior: fidl::new_empty!(Behavior, D),
8121 }
8122 }
8123
8124 #[inline]
8125 unsafe fn decode(
8126 &mut self,
8127 decoder: &mut fidl::encoding::Decoder<'_, D>,
8128 offset: usize,
8129 _depth: fidl::encoding::Depth,
8130 ) -> fidl::Result<()> {
8131 decoder.debug_check_bounds::<Self>(offset);
8132 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
8134 let padval = unsafe { (ptr as *const u64).read_unaligned() };
8135 let mask = 0xffffffff00000000u64;
8136 let maskedval = padval & mask;
8137 if maskedval != 0 {
8138 return Err(fidl::Error::NonZeroPadding {
8139 padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
8140 });
8141 }
8142 fidl::decode!(Usage, D, &mut self.active, decoder, offset + 0, _depth)?;
8143 fidl::decode!(Usage, D, &mut self.affected, decoder, offset + 16, _depth)?;
8144 fidl::decode!(Behavior, D, &mut self.behavior, decoder, offset + 32, _depth)?;
8145 Ok(())
8146 }
8147 }
8148
8149 impl fidl::encoding::ValueTypeMarker for AudioCoreSetRenderUsageGain2Request {
8150 type Borrowed<'a> = &'a Self;
8151 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8152 value
8153 }
8154 }
8155
8156 unsafe impl fidl::encoding::TypeMarker for AudioCoreSetRenderUsageGain2Request {
8157 type Owned = Self;
8158
8159 #[inline(always)]
8160 fn inline_align(_context: fidl::encoding::Context) -> usize {
8161 4
8162 }
8163
8164 #[inline(always)]
8165 fn inline_size(_context: fidl::encoding::Context) -> usize {
8166 8
8167 }
8168 }
8169
8170 unsafe impl<D: fidl::encoding::ResourceDialect>
8171 fidl::encoding::Encode<AudioCoreSetRenderUsageGain2Request, D>
8172 for &AudioCoreSetRenderUsageGain2Request
8173 {
8174 #[inline]
8175 unsafe fn encode(
8176 self,
8177 encoder: &mut fidl::encoding::Encoder<'_, D>,
8178 offset: usize,
8179 _depth: fidl::encoding::Depth,
8180 ) -> fidl::Result<()> {
8181 encoder.debug_check_bounds::<AudioCoreSetRenderUsageGain2Request>(offset);
8182 fidl::encoding::Encode::<AudioCoreSetRenderUsageGain2Request, D>::encode(
8184 (
8185 <AudioRenderUsage2 as fidl::encoding::ValueTypeMarker>::borrow(&self.usage),
8186 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.gain_db),
8187 ),
8188 encoder,
8189 offset,
8190 _depth,
8191 )
8192 }
8193 }
8194 unsafe impl<
8195 D: fidl::encoding::ResourceDialect,
8196 T0: fidl::encoding::Encode<AudioRenderUsage2, D>,
8197 T1: fidl::encoding::Encode<f32, D>,
8198 > fidl::encoding::Encode<AudioCoreSetRenderUsageGain2Request, D> for (T0, T1)
8199 {
8200 #[inline]
8201 unsafe fn encode(
8202 self,
8203 encoder: &mut fidl::encoding::Encoder<'_, D>,
8204 offset: usize,
8205 depth: fidl::encoding::Depth,
8206 ) -> fidl::Result<()> {
8207 encoder.debug_check_bounds::<AudioCoreSetRenderUsageGain2Request>(offset);
8208 self.0.encode(encoder, offset + 0, depth)?;
8212 self.1.encode(encoder, offset + 4, depth)?;
8213 Ok(())
8214 }
8215 }
8216
8217 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8218 for AudioCoreSetRenderUsageGain2Request
8219 {
8220 #[inline(always)]
8221 fn new_empty() -> Self {
8222 Self {
8223 usage: fidl::new_empty!(AudioRenderUsage2, D),
8224 gain_db: fidl::new_empty!(f32, D),
8225 }
8226 }
8227
8228 #[inline]
8229 unsafe fn decode(
8230 &mut self,
8231 decoder: &mut fidl::encoding::Decoder<'_, D>,
8232 offset: usize,
8233 _depth: fidl::encoding::Depth,
8234 ) -> fidl::Result<()> {
8235 decoder.debug_check_bounds::<Self>(offset);
8236 fidl::decode!(AudioRenderUsage2, D, &mut self.usage, decoder, offset + 0, _depth)?;
8238 fidl::decode!(f32, D, &mut self.gain_db, decoder, offset + 4, _depth)?;
8239 Ok(())
8240 }
8241 }
8242
8243 impl fidl::encoding::ValueTypeMarker for AudioCoreSetRenderUsageGainRequest {
8244 type Borrowed<'a> = &'a Self;
8245 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8246 value
8247 }
8248 }
8249
8250 unsafe impl fidl::encoding::TypeMarker for AudioCoreSetRenderUsageGainRequest {
8251 type Owned = Self;
8252
8253 #[inline(always)]
8254 fn inline_align(_context: fidl::encoding::Context) -> usize {
8255 4
8256 }
8257
8258 #[inline(always)]
8259 fn inline_size(_context: fidl::encoding::Context) -> usize {
8260 8
8261 }
8262 }
8263
8264 unsafe impl<D: fidl::encoding::ResourceDialect>
8265 fidl::encoding::Encode<AudioCoreSetRenderUsageGainRequest, D>
8266 for &AudioCoreSetRenderUsageGainRequest
8267 {
8268 #[inline]
8269 unsafe fn encode(
8270 self,
8271 encoder: &mut fidl::encoding::Encoder<'_, D>,
8272 offset: usize,
8273 _depth: fidl::encoding::Depth,
8274 ) -> fidl::Result<()> {
8275 encoder.debug_check_bounds::<AudioCoreSetRenderUsageGainRequest>(offset);
8276 fidl::encoding::Encode::<AudioCoreSetRenderUsageGainRequest, D>::encode(
8278 (
8279 <AudioRenderUsage as fidl::encoding::ValueTypeMarker>::borrow(&self.usage),
8280 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.gain_db),
8281 ),
8282 encoder,
8283 offset,
8284 _depth,
8285 )
8286 }
8287 }
8288 unsafe impl<
8289 D: fidl::encoding::ResourceDialect,
8290 T0: fidl::encoding::Encode<AudioRenderUsage, D>,
8291 T1: fidl::encoding::Encode<f32, D>,
8292 > fidl::encoding::Encode<AudioCoreSetRenderUsageGainRequest, D> for (T0, T1)
8293 {
8294 #[inline]
8295 unsafe fn encode(
8296 self,
8297 encoder: &mut fidl::encoding::Encoder<'_, D>,
8298 offset: usize,
8299 depth: fidl::encoding::Depth,
8300 ) -> fidl::Result<()> {
8301 encoder.debug_check_bounds::<AudioCoreSetRenderUsageGainRequest>(offset);
8302 self.0.encode(encoder, offset + 0, depth)?;
8306 self.1.encode(encoder, offset + 4, depth)?;
8307 Ok(())
8308 }
8309 }
8310
8311 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8312 for AudioCoreSetRenderUsageGainRequest
8313 {
8314 #[inline(always)]
8315 fn new_empty() -> Self {
8316 Self { usage: fidl::new_empty!(AudioRenderUsage, D), gain_db: fidl::new_empty!(f32, D) }
8317 }
8318
8319 #[inline]
8320 unsafe fn decode(
8321 &mut self,
8322 decoder: &mut fidl::encoding::Decoder<'_, D>,
8323 offset: usize,
8324 _depth: fidl::encoding::Depth,
8325 ) -> fidl::Result<()> {
8326 decoder.debug_check_bounds::<Self>(offset);
8327 fidl::decode!(AudioRenderUsage, D, &mut self.usage, decoder, offset + 0, _depth)?;
8329 fidl::decode!(f32, D, &mut self.gain_db, decoder, offset + 4, _depth)?;
8330 Ok(())
8331 }
8332 }
8333
8334 impl fidl::encoding::ValueTypeMarker for AudioCoreGetDbFromVolume2Response {
8335 type Borrowed<'a> = &'a Self;
8336 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8337 value
8338 }
8339 }
8340
8341 unsafe impl fidl::encoding::TypeMarker for AudioCoreGetDbFromVolume2Response {
8342 type Owned = Self;
8343
8344 #[inline(always)]
8345 fn inline_align(_context: fidl::encoding::Context) -> usize {
8346 4
8347 }
8348
8349 #[inline(always)]
8350 fn inline_size(_context: fidl::encoding::Context) -> usize {
8351 4
8352 }
8353 }
8354
8355 unsafe impl<D: fidl::encoding::ResourceDialect>
8356 fidl::encoding::Encode<AudioCoreGetDbFromVolume2Response, D>
8357 for &AudioCoreGetDbFromVolume2Response
8358 {
8359 #[inline]
8360 unsafe fn encode(
8361 self,
8362 encoder: &mut fidl::encoding::Encoder<'_, D>,
8363 offset: usize,
8364 _depth: fidl::encoding::Depth,
8365 ) -> fidl::Result<()> {
8366 encoder.debug_check_bounds::<AudioCoreGetDbFromVolume2Response>(offset);
8367 fidl::encoding::Encode::<AudioCoreGetDbFromVolume2Response, D>::encode(
8369 (<f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.gain_db),),
8370 encoder,
8371 offset,
8372 _depth,
8373 )
8374 }
8375 }
8376 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<f32, D>>
8377 fidl::encoding::Encode<AudioCoreGetDbFromVolume2Response, D> for (T0,)
8378 {
8379 #[inline]
8380 unsafe fn encode(
8381 self,
8382 encoder: &mut fidl::encoding::Encoder<'_, D>,
8383 offset: usize,
8384 depth: fidl::encoding::Depth,
8385 ) -> fidl::Result<()> {
8386 encoder.debug_check_bounds::<AudioCoreGetDbFromVolume2Response>(offset);
8387 self.0.encode(encoder, offset + 0, depth)?;
8391 Ok(())
8392 }
8393 }
8394
8395 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8396 for AudioCoreGetDbFromVolume2Response
8397 {
8398 #[inline(always)]
8399 fn new_empty() -> Self {
8400 Self { gain_db: fidl::new_empty!(f32, D) }
8401 }
8402
8403 #[inline]
8404 unsafe fn decode(
8405 &mut self,
8406 decoder: &mut fidl::encoding::Decoder<'_, D>,
8407 offset: usize,
8408 _depth: fidl::encoding::Depth,
8409 ) -> fidl::Result<()> {
8410 decoder.debug_check_bounds::<Self>(offset);
8411 fidl::decode!(f32, D, &mut self.gain_db, decoder, offset + 0, _depth)?;
8413 Ok(())
8414 }
8415 }
8416
8417 impl fidl::encoding::ValueTypeMarker for AudioCoreGetVolumeFromDb2Response {
8418 type Borrowed<'a> = &'a Self;
8419 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8420 value
8421 }
8422 }
8423
8424 unsafe impl fidl::encoding::TypeMarker for AudioCoreGetVolumeFromDb2Response {
8425 type Owned = Self;
8426
8427 #[inline(always)]
8428 fn inline_align(_context: fidl::encoding::Context) -> usize {
8429 4
8430 }
8431
8432 #[inline(always)]
8433 fn inline_size(_context: fidl::encoding::Context) -> usize {
8434 4
8435 }
8436 }
8437
8438 unsafe impl<D: fidl::encoding::ResourceDialect>
8439 fidl::encoding::Encode<AudioCoreGetVolumeFromDb2Response, D>
8440 for &AudioCoreGetVolumeFromDb2Response
8441 {
8442 #[inline]
8443 unsafe fn encode(
8444 self,
8445 encoder: &mut fidl::encoding::Encoder<'_, D>,
8446 offset: usize,
8447 _depth: fidl::encoding::Depth,
8448 ) -> fidl::Result<()> {
8449 encoder.debug_check_bounds::<AudioCoreGetVolumeFromDb2Response>(offset);
8450 fidl::encoding::Encode::<AudioCoreGetVolumeFromDb2Response, D>::encode(
8452 (<f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.volume),),
8453 encoder,
8454 offset,
8455 _depth,
8456 )
8457 }
8458 }
8459 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<f32, D>>
8460 fidl::encoding::Encode<AudioCoreGetVolumeFromDb2Response, D> for (T0,)
8461 {
8462 #[inline]
8463 unsafe fn encode(
8464 self,
8465 encoder: &mut fidl::encoding::Encoder<'_, D>,
8466 offset: usize,
8467 depth: fidl::encoding::Depth,
8468 ) -> fidl::Result<()> {
8469 encoder.debug_check_bounds::<AudioCoreGetVolumeFromDb2Response>(offset);
8470 self.0.encode(encoder, offset + 0, depth)?;
8474 Ok(())
8475 }
8476 }
8477
8478 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8479 for AudioCoreGetVolumeFromDb2Response
8480 {
8481 #[inline(always)]
8482 fn new_empty() -> Self {
8483 Self { volume: fidl::new_empty!(f32, D) }
8484 }
8485
8486 #[inline]
8487 unsafe fn decode(
8488 &mut self,
8489 decoder: &mut fidl::encoding::Decoder<'_, D>,
8490 offset: usize,
8491 _depth: fidl::encoding::Depth,
8492 ) -> fidl::Result<()> {
8493 decoder.debug_check_bounds::<Self>(offset);
8494 fidl::decode!(f32, D, &mut self.volume, decoder, offset + 0, _depth)?;
8496 Ok(())
8497 }
8498 }
8499
8500 impl fidl::encoding::ValueTypeMarker for AudioDeviceEnumeratorGetDeviceGainRequest {
8501 type Borrowed<'a> = &'a Self;
8502 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8503 value
8504 }
8505 }
8506
8507 unsafe impl fidl::encoding::TypeMarker for AudioDeviceEnumeratorGetDeviceGainRequest {
8508 type Owned = Self;
8509
8510 #[inline(always)]
8511 fn inline_align(_context: fidl::encoding::Context) -> usize {
8512 8
8513 }
8514
8515 #[inline(always)]
8516 fn inline_size(_context: fidl::encoding::Context) -> usize {
8517 8
8518 }
8519 #[inline(always)]
8520 fn encode_is_copy() -> bool {
8521 true
8522 }
8523
8524 #[inline(always)]
8525 fn decode_is_copy() -> bool {
8526 true
8527 }
8528 }
8529
8530 unsafe impl<D: fidl::encoding::ResourceDialect>
8531 fidl::encoding::Encode<AudioDeviceEnumeratorGetDeviceGainRequest, D>
8532 for &AudioDeviceEnumeratorGetDeviceGainRequest
8533 {
8534 #[inline]
8535 unsafe fn encode(
8536 self,
8537 encoder: &mut fidl::encoding::Encoder<'_, D>,
8538 offset: usize,
8539 _depth: fidl::encoding::Depth,
8540 ) -> fidl::Result<()> {
8541 encoder.debug_check_bounds::<AudioDeviceEnumeratorGetDeviceGainRequest>(offset);
8542 unsafe {
8543 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
8545 (buf_ptr as *mut AudioDeviceEnumeratorGetDeviceGainRequest).write_unaligned(
8546 (self as *const AudioDeviceEnumeratorGetDeviceGainRequest).read(),
8547 );
8548 }
8551 Ok(())
8552 }
8553 }
8554 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
8555 fidl::encoding::Encode<AudioDeviceEnumeratorGetDeviceGainRequest, D> for (T0,)
8556 {
8557 #[inline]
8558 unsafe fn encode(
8559 self,
8560 encoder: &mut fidl::encoding::Encoder<'_, D>,
8561 offset: usize,
8562 depth: fidl::encoding::Depth,
8563 ) -> fidl::Result<()> {
8564 encoder.debug_check_bounds::<AudioDeviceEnumeratorGetDeviceGainRequest>(offset);
8565 self.0.encode(encoder, offset + 0, depth)?;
8569 Ok(())
8570 }
8571 }
8572
8573 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8574 for AudioDeviceEnumeratorGetDeviceGainRequest
8575 {
8576 #[inline(always)]
8577 fn new_empty() -> Self {
8578 Self { device_token: fidl::new_empty!(u64, D) }
8579 }
8580
8581 #[inline]
8582 unsafe fn decode(
8583 &mut self,
8584 decoder: &mut fidl::encoding::Decoder<'_, D>,
8585 offset: usize,
8586 _depth: fidl::encoding::Depth,
8587 ) -> fidl::Result<()> {
8588 decoder.debug_check_bounds::<Self>(offset);
8589 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
8590 unsafe {
8593 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
8594 }
8595 Ok(())
8596 }
8597 }
8598
8599 impl fidl::encoding::ValueTypeMarker for AudioDeviceEnumeratorGetDeviceGainResponse {
8600 type Borrowed<'a> = &'a Self;
8601 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8602 value
8603 }
8604 }
8605
8606 unsafe impl fidl::encoding::TypeMarker for AudioDeviceEnumeratorGetDeviceGainResponse {
8607 type Owned = Self;
8608
8609 #[inline(always)]
8610 fn inline_align(_context: fidl::encoding::Context) -> usize {
8611 8
8612 }
8613
8614 #[inline(always)]
8615 fn inline_size(_context: fidl::encoding::Context) -> usize {
8616 16
8617 }
8618 }
8619
8620 unsafe impl<D: fidl::encoding::ResourceDialect>
8621 fidl::encoding::Encode<AudioDeviceEnumeratorGetDeviceGainResponse, D>
8622 for &AudioDeviceEnumeratorGetDeviceGainResponse
8623 {
8624 #[inline]
8625 unsafe fn encode(
8626 self,
8627 encoder: &mut fidl::encoding::Encoder<'_, D>,
8628 offset: usize,
8629 _depth: fidl::encoding::Depth,
8630 ) -> fidl::Result<()> {
8631 encoder.debug_check_bounds::<AudioDeviceEnumeratorGetDeviceGainResponse>(offset);
8632 fidl::encoding::Encode::<AudioDeviceEnumeratorGetDeviceGainResponse, D>::encode(
8634 (
8635 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.device_token),
8636 <AudioGainInfo as fidl::encoding::ValueTypeMarker>::borrow(&self.gain_info),
8637 ),
8638 encoder,
8639 offset,
8640 _depth,
8641 )
8642 }
8643 }
8644 unsafe impl<
8645 D: fidl::encoding::ResourceDialect,
8646 T0: fidl::encoding::Encode<u64, D>,
8647 T1: fidl::encoding::Encode<AudioGainInfo, D>,
8648 > fidl::encoding::Encode<AudioDeviceEnumeratorGetDeviceGainResponse, D> for (T0, T1)
8649 {
8650 #[inline]
8651 unsafe fn encode(
8652 self,
8653 encoder: &mut fidl::encoding::Encoder<'_, D>,
8654 offset: usize,
8655 depth: fidl::encoding::Depth,
8656 ) -> fidl::Result<()> {
8657 encoder.debug_check_bounds::<AudioDeviceEnumeratorGetDeviceGainResponse>(offset);
8658 self.0.encode(encoder, offset + 0, depth)?;
8662 self.1.encode(encoder, offset + 8, depth)?;
8663 Ok(())
8664 }
8665 }
8666
8667 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8668 for AudioDeviceEnumeratorGetDeviceGainResponse
8669 {
8670 #[inline(always)]
8671 fn new_empty() -> Self {
8672 Self {
8673 device_token: fidl::new_empty!(u64, D),
8674 gain_info: fidl::new_empty!(AudioGainInfo, D),
8675 }
8676 }
8677
8678 #[inline]
8679 unsafe fn decode(
8680 &mut self,
8681 decoder: &mut fidl::encoding::Decoder<'_, D>,
8682 offset: usize,
8683 _depth: fidl::encoding::Depth,
8684 ) -> fidl::Result<()> {
8685 decoder.debug_check_bounds::<Self>(offset);
8686 fidl::decode!(u64, D, &mut self.device_token, decoder, offset + 0, _depth)?;
8688 fidl::decode!(AudioGainInfo, D, &mut self.gain_info, decoder, offset + 8, _depth)?;
8689 Ok(())
8690 }
8691 }
8692
8693 impl fidl::encoding::ValueTypeMarker for AudioDeviceEnumeratorGetDevicesResponse {
8694 type Borrowed<'a> = &'a Self;
8695 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8696 value
8697 }
8698 }
8699
8700 unsafe impl fidl::encoding::TypeMarker for AudioDeviceEnumeratorGetDevicesResponse {
8701 type Owned = Self;
8702
8703 #[inline(always)]
8704 fn inline_align(_context: fidl::encoding::Context) -> usize {
8705 8
8706 }
8707
8708 #[inline(always)]
8709 fn inline_size(_context: fidl::encoding::Context) -> usize {
8710 16
8711 }
8712 }
8713
8714 unsafe impl<D: fidl::encoding::ResourceDialect>
8715 fidl::encoding::Encode<AudioDeviceEnumeratorGetDevicesResponse, D>
8716 for &AudioDeviceEnumeratorGetDevicesResponse
8717 {
8718 #[inline]
8719 unsafe fn encode(
8720 self,
8721 encoder: &mut fidl::encoding::Encoder<'_, D>,
8722 offset: usize,
8723 _depth: fidl::encoding::Depth,
8724 ) -> fidl::Result<()> {
8725 encoder.debug_check_bounds::<AudioDeviceEnumeratorGetDevicesResponse>(offset);
8726 fidl::encoding::Encode::<AudioDeviceEnumeratorGetDevicesResponse, D>::encode(
8728 (
8729 <fidl::encoding::UnboundedVector<AudioDeviceInfo> as fidl::encoding::ValueTypeMarker>::borrow(&self.devices),
8730 ),
8731 encoder, offset, _depth
8732 )
8733 }
8734 }
8735 unsafe impl<
8736 D: fidl::encoding::ResourceDialect,
8737 T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<AudioDeviceInfo>, D>,
8738 > fidl::encoding::Encode<AudioDeviceEnumeratorGetDevicesResponse, D> for (T0,)
8739 {
8740 #[inline]
8741 unsafe fn encode(
8742 self,
8743 encoder: &mut fidl::encoding::Encoder<'_, D>,
8744 offset: usize,
8745 depth: fidl::encoding::Depth,
8746 ) -> fidl::Result<()> {
8747 encoder.debug_check_bounds::<AudioDeviceEnumeratorGetDevicesResponse>(offset);
8748 self.0.encode(encoder, offset + 0, depth)?;
8752 Ok(())
8753 }
8754 }
8755
8756 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8757 for AudioDeviceEnumeratorGetDevicesResponse
8758 {
8759 #[inline(always)]
8760 fn new_empty() -> Self {
8761 Self { devices: fidl::new_empty!(fidl::encoding::UnboundedVector<AudioDeviceInfo>, D) }
8762 }
8763
8764 #[inline]
8765 unsafe fn decode(
8766 &mut self,
8767 decoder: &mut fidl::encoding::Decoder<'_, D>,
8768 offset: usize,
8769 _depth: fidl::encoding::Depth,
8770 ) -> fidl::Result<()> {
8771 decoder.debug_check_bounds::<Self>(offset);
8772 fidl::decode!(
8774 fidl::encoding::UnboundedVector<AudioDeviceInfo>,
8775 D,
8776 &mut self.devices,
8777 decoder,
8778 offset + 0,
8779 _depth
8780 )?;
8781 Ok(())
8782 }
8783 }
8784
8785 impl fidl::encoding::ValueTypeMarker for AudioDeviceEnumeratorOnDefaultDeviceChangedRequest {
8786 type Borrowed<'a> = &'a Self;
8787 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8788 value
8789 }
8790 }
8791
8792 unsafe impl fidl::encoding::TypeMarker for AudioDeviceEnumeratorOnDefaultDeviceChangedRequest {
8793 type Owned = Self;
8794
8795 #[inline(always)]
8796 fn inline_align(_context: fidl::encoding::Context) -> usize {
8797 8
8798 }
8799
8800 #[inline(always)]
8801 fn inline_size(_context: fidl::encoding::Context) -> usize {
8802 16
8803 }
8804 #[inline(always)]
8805 fn encode_is_copy() -> bool {
8806 true
8807 }
8808
8809 #[inline(always)]
8810 fn decode_is_copy() -> bool {
8811 true
8812 }
8813 }
8814
8815 unsafe impl<D: fidl::encoding::ResourceDialect>
8816 fidl::encoding::Encode<AudioDeviceEnumeratorOnDefaultDeviceChangedRequest, D>
8817 for &AudioDeviceEnumeratorOnDefaultDeviceChangedRequest
8818 {
8819 #[inline]
8820 unsafe fn encode(
8821 self,
8822 encoder: &mut fidl::encoding::Encoder<'_, D>,
8823 offset: usize,
8824 _depth: fidl::encoding::Depth,
8825 ) -> fidl::Result<()> {
8826 encoder
8827 .debug_check_bounds::<AudioDeviceEnumeratorOnDefaultDeviceChangedRequest>(offset);
8828 unsafe {
8829 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
8831 (buf_ptr as *mut AudioDeviceEnumeratorOnDefaultDeviceChangedRequest)
8832 .write_unaligned(
8833 (self as *const AudioDeviceEnumeratorOnDefaultDeviceChangedRequest).read(),
8834 );
8835 }
8838 Ok(())
8839 }
8840 }
8841 unsafe impl<
8842 D: fidl::encoding::ResourceDialect,
8843 T0: fidl::encoding::Encode<u64, D>,
8844 T1: fidl::encoding::Encode<u64, D>,
8845 > fidl::encoding::Encode<AudioDeviceEnumeratorOnDefaultDeviceChangedRequest, D>
8846 for (T0, T1)
8847 {
8848 #[inline]
8849 unsafe fn encode(
8850 self,
8851 encoder: &mut fidl::encoding::Encoder<'_, D>,
8852 offset: usize,
8853 depth: fidl::encoding::Depth,
8854 ) -> fidl::Result<()> {
8855 encoder
8856 .debug_check_bounds::<AudioDeviceEnumeratorOnDefaultDeviceChangedRequest>(offset);
8857 self.0.encode(encoder, offset + 0, depth)?;
8861 self.1.encode(encoder, offset + 8, depth)?;
8862 Ok(())
8863 }
8864 }
8865
8866 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8867 for AudioDeviceEnumeratorOnDefaultDeviceChangedRequest
8868 {
8869 #[inline(always)]
8870 fn new_empty() -> Self {
8871 Self {
8872 old_default_token: fidl::new_empty!(u64, D),
8873 new_default_token: fidl::new_empty!(u64, D),
8874 }
8875 }
8876
8877 #[inline]
8878 unsafe fn decode(
8879 &mut self,
8880 decoder: &mut fidl::encoding::Decoder<'_, D>,
8881 offset: usize,
8882 _depth: fidl::encoding::Depth,
8883 ) -> fidl::Result<()> {
8884 decoder.debug_check_bounds::<Self>(offset);
8885 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
8886 unsafe {
8889 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
8890 }
8891 Ok(())
8892 }
8893 }
8894
8895 impl fidl::encoding::ValueTypeMarker for AudioDeviceEnumeratorOnDeviceAddedRequest {
8896 type Borrowed<'a> = &'a Self;
8897 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8898 value
8899 }
8900 }
8901
8902 unsafe impl fidl::encoding::TypeMarker for AudioDeviceEnumeratorOnDeviceAddedRequest {
8903 type Owned = Self;
8904
8905 #[inline(always)]
8906 fn inline_align(_context: fidl::encoding::Context) -> usize {
8907 8
8908 }
8909
8910 #[inline(always)]
8911 fn inline_size(_context: fidl::encoding::Context) -> usize {
8912 56
8913 }
8914 }
8915
8916 unsafe impl<D: fidl::encoding::ResourceDialect>
8917 fidl::encoding::Encode<AudioDeviceEnumeratorOnDeviceAddedRequest, D>
8918 for &AudioDeviceEnumeratorOnDeviceAddedRequest
8919 {
8920 #[inline]
8921 unsafe fn encode(
8922 self,
8923 encoder: &mut fidl::encoding::Encoder<'_, D>,
8924 offset: usize,
8925 _depth: fidl::encoding::Depth,
8926 ) -> fidl::Result<()> {
8927 encoder.debug_check_bounds::<AudioDeviceEnumeratorOnDeviceAddedRequest>(offset);
8928 fidl::encoding::Encode::<AudioDeviceEnumeratorOnDeviceAddedRequest, D>::encode(
8930 (<AudioDeviceInfo as fidl::encoding::ValueTypeMarker>::borrow(&self.device),),
8931 encoder,
8932 offset,
8933 _depth,
8934 )
8935 }
8936 }
8937 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<AudioDeviceInfo, D>>
8938 fidl::encoding::Encode<AudioDeviceEnumeratorOnDeviceAddedRequest, D> for (T0,)
8939 {
8940 #[inline]
8941 unsafe fn encode(
8942 self,
8943 encoder: &mut fidl::encoding::Encoder<'_, D>,
8944 offset: usize,
8945 depth: fidl::encoding::Depth,
8946 ) -> fidl::Result<()> {
8947 encoder.debug_check_bounds::<AudioDeviceEnumeratorOnDeviceAddedRequest>(offset);
8948 self.0.encode(encoder, offset + 0, depth)?;
8952 Ok(())
8953 }
8954 }
8955
8956 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8957 for AudioDeviceEnumeratorOnDeviceAddedRequest
8958 {
8959 #[inline(always)]
8960 fn new_empty() -> Self {
8961 Self { device: fidl::new_empty!(AudioDeviceInfo, D) }
8962 }
8963
8964 #[inline]
8965 unsafe fn decode(
8966 &mut self,
8967 decoder: &mut fidl::encoding::Decoder<'_, D>,
8968 offset: usize,
8969 _depth: fidl::encoding::Depth,
8970 ) -> fidl::Result<()> {
8971 decoder.debug_check_bounds::<Self>(offset);
8972 fidl::decode!(AudioDeviceInfo, D, &mut self.device, decoder, offset + 0, _depth)?;
8974 Ok(())
8975 }
8976 }
8977
8978 impl fidl::encoding::ValueTypeMarker for AudioDeviceEnumeratorOnDeviceGainChangedRequest {
8979 type Borrowed<'a> = &'a Self;
8980 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8981 value
8982 }
8983 }
8984
8985 unsafe impl fidl::encoding::TypeMarker for AudioDeviceEnumeratorOnDeviceGainChangedRequest {
8986 type Owned = Self;
8987
8988 #[inline(always)]
8989 fn inline_align(_context: fidl::encoding::Context) -> usize {
8990 8
8991 }
8992
8993 #[inline(always)]
8994 fn inline_size(_context: fidl::encoding::Context) -> usize {
8995 16
8996 }
8997 }
8998
8999 unsafe impl<D: fidl::encoding::ResourceDialect>
9000 fidl::encoding::Encode<AudioDeviceEnumeratorOnDeviceGainChangedRequest, D>
9001 for &AudioDeviceEnumeratorOnDeviceGainChangedRequest
9002 {
9003 #[inline]
9004 unsafe fn encode(
9005 self,
9006 encoder: &mut fidl::encoding::Encoder<'_, D>,
9007 offset: usize,
9008 _depth: fidl::encoding::Depth,
9009 ) -> fidl::Result<()> {
9010 encoder.debug_check_bounds::<AudioDeviceEnumeratorOnDeviceGainChangedRequest>(offset);
9011 fidl::encoding::Encode::<AudioDeviceEnumeratorOnDeviceGainChangedRequest, D>::encode(
9013 (
9014 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.device_token),
9015 <AudioGainInfo as fidl::encoding::ValueTypeMarker>::borrow(&self.gain_info),
9016 ),
9017 encoder,
9018 offset,
9019 _depth,
9020 )
9021 }
9022 }
9023 unsafe impl<
9024 D: fidl::encoding::ResourceDialect,
9025 T0: fidl::encoding::Encode<u64, D>,
9026 T1: fidl::encoding::Encode<AudioGainInfo, D>,
9027 > fidl::encoding::Encode<AudioDeviceEnumeratorOnDeviceGainChangedRequest, D> for (T0, T1)
9028 {
9029 #[inline]
9030 unsafe fn encode(
9031 self,
9032 encoder: &mut fidl::encoding::Encoder<'_, D>,
9033 offset: usize,
9034 depth: fidl::encoding::Depth,
9035 ) -> fidl::Result<()> {
9036 encoder.debug_check_bounds::<AudioDeviceEnumeratorOnDeviceGainChangedRequest>(offset);
9037 self.0.encode(encoder, offset + 0, depth)?;
9041 self.1.encode(encoder, offset + 8, depth)?;
9042 Ok(())
9043 }
9044 }
9045
9046 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
9047 for AudioDeviceEnumeratorOnDeviceGainChangedRequest
9048 {
9049 #[inline(always)]
9050 fn new_empty() -> Self {
9051 Self {
9052 device_token: fidl::new_empty!(u64, D),
9053 gain_info: fidl::new_empty!(AudioGainInfo, D),
9054 }
9055 }
9056
9057 #[inline]
9058 unsafe fn decode(
9059 &mut self,
9060 decoder: &mut fidl::encoding::Decoder<'_, D>,
9061 offset: usize,
9062 _depth: fidl::encoding::Depth,
9063 ) -> fidl::Result<()> {
9064 decoder.debug_check_bounds::<Self>(offset);
9065 fidl::decode!(u64, D, &mut self.device_token, decoder, offset + 0, _depth)?;
9067 fidl::decode!(AudioGainInfo, D, &mut self.gain_info, decoder, offset + 8, _depth)?;
9068 Ok(())
9069 }
9070 }
9071
9072 impl fidl::encoding::ValueTypeMarker for AudioDeviceEnumeratorOnDeviceRemovedRequest {
9073 type Borrowed<'a> = &'a Self;
9074 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9075 value
9076 }
9077 }
9078
9079 unsafe impl fidl::encoding::TypeMarker for AudioDeviceEnumeratorOnDeviceRemovedRequest {
9080 type Owned = Self;
9081
9082 #[inline(always)]
9083 fn inline_align(_context: fidl::encoding::Context) -> usize {
9084 8
9085 }
9086
9087 #[inline(always)]
9088 fn inline_size(_context: fidl::encoding::Context) -> usize {
9089 8
9090 }
9091 #[inline(always)]
9092 fn encode_is_copy() -> bool {
9093 true
9094 }
9095
9096 #[inline(always)]
9097 fn decode_is_copy() -> bool {
9098 true
9099 }
9100 }
9101
9102 unsafe impl<D: fidl::encoding::ResourceDialect>
9103 fidl::encoding::Encode<AudioDeviceEnumeratorOnDeviceRemovedRequest, D>
9104 for &AudioDeviceEnumeratorOnDeviceRemovedRequest
9105 {
9106 #[inline]
9107 unsafe fn encode(
9108 self,
9109 encoder: &mut fidl::encoding::Encoder<'_, D>,
9110 offset: usize,
9111 _depth: fidl::encoding::Depth,
9112 ) -> fidl::Result<()> {
9113 encoder.debug_check_bounds::<AudioDeviceEnumeratorOnDeviceRemovedRequest>(offset);
9114 unsafe {
9115 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
9117 (buf_ptr as *mut AudioDeviceEnumeratorOnDeviceRemovedRequest).write_unaligned(
9118 (self as *const AudioDeviceEnumeratorOnDeviceRemovedRequest).read(),
9119 );
9120 }
9123 Ok(())
9124 }
9125 }
9126 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
9127 fidl::encoding::Encode<AudioDeviceEnumeratorOnDeviceRemovedRequest, D> for (T0,)
9128 {
9129 #[inline]
9130 unsafe fn encode(
9131 self,
9132 encoder: &mut fidl::encoding::Encoder<'_, D>,
9133 offset: usize,
9134 depth: fidl::encoding::Depth,
9135 ) -> fidl::Result<()> {
9136 encoder.debug_check_bounds::<AudioDeviceEnumeratorOnDeviceRemovedRequest>(offset);
9137 self.0.encode(encoder, offset + 0, depth)?;
9141 Ok(())
9142 }
9143 }
9144
9145 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
9146 for AudioDeviceEnumeratorOnDeviceRemovedRequest
9147 {
9148 #[inline(always)]
9149 fn new_empty() -> Self {
9150 Self { device_token: fidl::new_empty!(u64, D) }
9151 }
9152
9153 #[inline]
9154 unsafe fn decode(
9155 &mut self,
9156 decoder: &mut fidl::encoding::Decoder<'_, D>,
9157 offset: usize,
9158 _depth: fidl::encoding::Depth,
9159 ) -> fidl::Result<()> {
9160 decoder.debug_check_bounds::<Self>(offset);
9161 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
9162 unsafe {
9165 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
9166 }
9167 Ok(())
9168 }
9169 }
9170
9171 impl fidl::encoding::ValueTypeMarker for AudioDeviceEnumeratorSetDeviceGainRequest {
9172 type Borrowed<'a> = &'a Self;
9173 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9174 value
9175 }
9176 }
9177
9178 unsafe impl fidl::encoding::TypeMarker for AudioDeviceEnumeratorSetDeviceGainRequest {
9179 type Owned = Self;
9180
9181 #[inline(always)]
9182 fn inline_align(_context: fidl::encoding::Context) -> usize {
9183 8
9184 }
9185
9186 #[inline(always)]
9187 fn inline_size(_context: fidl::encoding::Context) -> usize {
9188 24
9189 }
9190 }
9191
9192 unsafe impl<D: fidl::encoding::ResourceDialect>
9193 fidl::encoding::Encode<AudioDeviceEnumeratorSetDeviceGainRequest, D>
9194 for &AudioDeviceEnumeratorSetDeviceGainRequest
9195 {
9196 #[inline]
9197 unsafe fn encode(
9198 self,
9199 encoder: &mut fidl::encoding::Encoder<'_, D>,
9200 offset: usize,
9201 _depth: fidl::encoding::Depth,
9202 ) -> fidl::Result<()> {
9203 encoder.debug_check_bounds::<AudioDeviceEnumeratorSetDeviceGainRequest>(offset);
9204 fidl::encoding::Encode::<AudioDeviceEnumeratorSetDeviceGainRequest, D>::encode(
9206 (
9207 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.device_token),
9208 <AudioGainInfo as fidl::encoding::ValueTypeMarker>::borrow(&self.gain_info),
9209 <AudioGainValidFlags as fidl::encoding::ValueTypeMarker>::borrow(
9210 &self.valid_flags,
9211 ),
9212 ),
9213 encoder,
9214 offset,
9215 _depth,
9216 )
9217 }
9218 }
9219 unsafe impl<
9220 D: fidl::encoding::ResourceDialect,
9221 T0: fidl::encoding::Encode<u64, D>,
9222 T1: fidl::encoding::Encode<AudioGainInfo, D>,
9223 T2: fidl::encoding::Encode<AudioGainValidFlags, D>,
9224 > fidl::encoding::Encode<AudioDeviceEnumeratorSetDeviceGainRequest, D> for (T0, T1, T2)
9225 {
9226 #[inline]
9227 unsafe fn encode(
9228 self,
9229 encoder: &mut fidl::encoding::Encoder<'_, D>,
9230 offset: usize,
9231 depth: fidl::encoding::Depth,
9232 ) -> fidl::Result<()> {
9233 encoder.debug_check_bounds::<AudioDeviceEnumeratorSetDeviceGainRequest>(offset);
9234 unsafe {
9237 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
9238 (ptr as *mut u64).write_unaligned(0);
9239 }
9240 self.0.encode(encoder, offset + 0, depth)?;
9242 self.1.encode(encoder, offset + 8, depth)?;
9243 self.2.encode(encoder, offset + 16, depth)?;
9244 Ok(())
9245 }
9246 }
9247
9248 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
9249 for AudioDeviceEnumeratorSetDeviceGainRequest
9250 {
9251 #[inline(always)]
9252 fn new_empty() -> Self {
9253 Self {
9254 device_token: fidl::new_empty!(u64, D),
9255 gain_info: fidl::new_empty!(AudioGainInfo, D),
9256 valid_flags: fidl::new_empty!(AudioGainValidFlags, D),
9257 }
9258 }
9259
9260 #[inline]
9261 unsafe fn decode(
9262 &mut self,
9263 decoder: &mut fidl::encoding::Decoder<'_, D>,
9264 offset: usize,
9265 _depth: fidl::encoding::Depth,
9266 ) -> fidl::Result<()> {
9267 decoder.debug_check_bounds::<Self>(offset);
9268 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
9270 let padval = unsafe { (ptr as *const u64).read_unaligned() };
9271 let mask = 0xffffffff00000000u64;
9272 let maskedval = padval & mask;
9273 if maskedval != 0 {
9274 return Err(fidl::Error::NonZeroPadding {
9275 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
9276 });
9277 }
9278 fidl::decode!(u64, D, &mut self.device_token, decoder, offset + 0, _depth)?;
9279 fidl::decode!(AudioGainInfo, D, &mut self.gain_info, decoder, offset + 8, _depth)?;
9280 fidl::decode!(
9281 AudioGainValidFlags,
9282 D,
9283 &mut self.valid_flags,
9284 decoder,
9285 offset + 16,
9286 _depth
9287 )?;
9288 Ok(())
9289 }
9290 }
9291
9292 impl fidl::encoding::ValueTypeMarker for AudioDeviceInfo {
9293 type Borrowed<'a> = &'a Self;
9294 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9295 value
9296 }
9297 }
9298
9299 unsafe impl fidl::encoding::TypeMarker for AudioDeviceInfo {
9300 type Owned = Self;
9301
9302 #[inline(always)]
9303 fn inline_align(_context: fidl::encoding::Context) -> usize {
9304 8
9305 }
9306
9307 #[inline(always)]
9308 fn inline_size(_context: fidl::encoding::Context) -> usize {
9309 56
9310 }
9311 }
9312
9313 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AudioDeviceInfo, D>
9314 for &AudioDeviceInfo
9315 {
9316 #[inline]
9317 unsafe fn encode(
9318 self,
9319 encoder: &mut fidl::encoding::Encoder<'_, D>,
9320 offset: usize,
9321 _depth: fidl::encoding::Depth,
9322 ) -> fidl::Result<()> {
9323 encoder.debug_check_bounds::<AudioDeviceInfo>(offset);
9324 fidl::encoding::Encode::<AudioDeviceInfo, D>::encode(
9326 (
9327 <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
9328 &self.name,
9329 ),
9330 <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
9331 &self.unique_id,
9332 ),
9333 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.token_id),
9334 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.is_input),
9335 <AudioGainInfo as fidl::encoding::ValueTypeMarker>::borrow(&self.gain_info),
9336 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.is_default),
9337 ),
9338 encoder,
9339 offset,
9340 _depth,
9341 )
9342 }
9343 }
9344 unsafe impl<
9345 D: fidl::encoding::ResourceDialect,
9346 T0: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
9347 T1: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
9348 T2: fidl::encoding::Encode<u64, D>,
9349 T3: fidl::encoding::Encode<bool, D>,
9350 T4: fidl::encoding::Encode<AudioGainInfo, D>,
9351 T5: fidl::encoding::Encode<bool, D>,
9352 > fidl::encoding::Encode<AudioDeviceInfo, D> for (T0, T1, T2, T3, T4, T5)
9353 {
9354 #[inline]
9355 unsafe fn encode(
9356 self,
9357 encoder: &mut fidl::encoding::Encoder<'_, D>,
9358 offset: usize,
9359 depth: fidl::encoding::Depth,
9360 ) -> fidl::Result<()> {
9361 encoder.debug_check_bounds::<AudioDeviceInfo>(offset);
9362 unsafe {
9365 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(40);
9366 (ptr as *mut u64).write_unaligned(0);
9367 }
9368 unsafe {
9369 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(48);
9370 (ptr as *mut u64).write_unaligned(0);
9371 }
9372 self.0.encode(encoder, offset + 0, depth)?;
9374 self.1.encode(encoder, offset + 16, depth)?;
9375 self.2.encode(encoder, offset + 32, depth)?;
9376 self.3.encode(encoder, offset + 40, depth)?;
9377 self.4.encode(encoder, offset + 44, depth)?;
9378 self.5.encode(encoder, offset + 52, depth)?;
9379 Ok(())
9380 }
9381 }
9382
9383 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AudioDeviceInfo {
9384 #[inline(always)]
9385 fn new_empty() -> Self {
9386 Self {
9387 name: fidl::new_empty!(fidl::encoding::UnboundedString, D),
9388 unique_id: fidl::new_empty!(fidl::encoding::UnboundedString, D),
9389 token_id: fidl::new_empty!(u64, D),
9390 is_input: fidl::new_empty!(bool, D),
9391 gain_info: fidl::new_empty!(AudioGainInfo, D),
9392 is_default: fidl::new_empty!(bool, D),
9393 }
9394 }
9395
9396 #[inline]
9397 unsafe fn decode(
9398 &mut self,
9399 decoder: &mut fidl::encoding::Decoder<'_, D>,
9400 offset: usize,
9401 _depth: fidl::encoding::Depth,
9402 ) -> fidl::Result<()> {
9403 decoder.debug_check_bounds::<Self>(offset);
9404 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(40) };
9406 let padval = unsafe { (ptr as *const u64).read_unaligned() };
9407 let mask = 0xffffff00u64;
9408 let maskedval = padval & mask;
9409 if maskedval != 0 {
9410 return Err(fidl::Error::NonZeroPadding {
9411 padding_start: offset + 40 + ((mask as u64).trailing_zeros() / 8) as usize,
9412 });
9413 }
9414 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(48) };
9415 let padval = unsafe { (ptr as *const u64).read_unaligned() };
9416 let mask = 0xffffff0000000000u64;
9417 let maskedval = padval & mask;
9418 if maskedval != 0 {
9419 return Err(fidl::Error::NonZeroPadding {
9420 padding_start: offset + 48 + ((mask as u64).trailing_zeros() / 8) as usize,
9421 });
9422 }
9423 fidl::decode!(
9424 fidl::encoding::UnboundedString,
9425 D,
9426 &mut self.name,
9427 decoder,
9428 offset + 0,
9429 _depth
9430 )?;
9431 fidl::decode!(
9432 fidl::encoding::UnboundedString,
9433 D,
9434 &mut self.unique_id,
9435 decoder,
9436 offset + 16,
9437 _depth
9438 )?;
9439 fidl::decode!(u64, D, &mut self.token_id, decoder, offset + 32, _depth)?;
9440 fidl::decode!(bool, D, &mut self.is_input, decoder, offset + 40, _depth)?;
9441 fidl::decode!(AudioGainInfo, D, &mut self.gain_info, decoder, offset + 44, _depth)?;
9442 fidl::decode!(bool, D, &mut self.is_default, decoder, offset + 52, _depth)?;
9443 Ok(())
9444 }
9445 }
9446
9447 impl fidl::encoding::ValueTypeMarker for AudioGainInfo {
9448 type Borrowed<'a> = &'a Self;
9449 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9450 value
9451 }
9452 }
9453
9454 unsafe impl fidl::encoding::TypeMarker for AudioGainInfo {
9455 type Owned = Self;
9456
9457 #[inline(always)]
9458 fn inline_align(_context: fidl::encoding::Context) -> usize {
9459 4
9460 }
9461
9462 #[inline(always)]
9463 fn inline_size(_context: fidl::encoding::Context) -> usize {
9464 8
9465 }
9466 }
9467
9468 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AudioGainInfo, D>
9469 for &AudioGainInfo
9470 {
9471 #[inline]
9472 unsafe fn encode(
9473 self,
9474 encoder: &mut fidl::encoding::Encoder<'_, D>,
9475 offset: usize,
9476 _depth: fidl::encoding::Depth,
9477 ) -> fidl::Result<()> {
9478 encoder.debug_check_bounds::<AudioGainInfo>(offset);
9479 fidl::encoding::Encode::<AudioGainInfo, D>::encode(
9481 (
9482 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.gain_db),
9483 <AudioGainInfoFlags as fidl::encoding::ValueTypeMarker>::borrow(&self.flags),
9484 ),
9485 encoder,
9486 offset,
9487 _depth,
9488 )
9489 }
9490 }
9491 unsafe impl<
9492 D: fidl::encoding::ResourceDialect,
9493 T0: fidl::encoding::Encode<f32, D>,
9494 T1: fidl::encoding::Encode<AudioGainInfoFlags, D>,
9495 > fidl::encoding::Encode<AudioGainInfo, D> for (T0, T1)
9496 {
9497 #[inline]
9498 unsafe fn encode(
9499 self,
9500 encoder: &mut fidl::encoding::Encoder<'_, D>,
9501 offset: usize,
9502 depth: fidl::encoding::Depth,
9503 ) -> fidl::Result<()> {
9504 encoder.debug_check_bounds::<AudioGainInfo>(offset);
9505 self.0.encode(encoder, offset + 0, depth)?;
9509 self.1.encode(encoder, offset + 4, depth)?;
9510 Ok(())
9511 }
9512 }
9513
9514 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AudioGainInfo {
9515 #[inline(always)]
9516 fn new_empty() -> Self {
9517 Self {
9518 gain_db: fidl::new_empty!(f32, D),
9519 flags: fidl::new_empty!(AudioGainInfoFlags, D),
9520 }
9521 }
9522
9523 #[inline]
9524 unsafe fn decode(
9525 &mut self,
9526 decoder: &mut fidl::encoding::Decoder<'_, D>,
9527 offset: usize,
9528 _depth: fidl::encoding::Depth,
9529 ) -> fidl::Result<()> {
9530 decoder.debug_check_bounds::<Self>(offset);
9531 fidl::decode!(f32, D, &mut self.gain_db, decoder, offset + 0, _depth)?;
9533 fidl::decode!(AudioGainInfoFlags, D, &mut self.flags, decoder, offset + 4, _depth)?;
9534 Ok(())
9535 }
9536 }
9537
9538 impl fidl::encoding::ValueTypeMarker for AudioRendererEnableMinLeadTimeEventsRequest {
9539 type Borrowed<'a> = &'a Self;
9540 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9541 value
9542 }
9543 }
9544
9545 unsafe impl fidl::encoding::TypeMarker for AudioRendererEnableMinLeadTimeEventsRequest {
9546 type Owned = Self;
9547
9548 #[inline(always)]
9549 fn inline_align(_context: fidl::encoding::Context) -> usize {
9550 1
9551 }
9552
9553 #[inline(always)]
9554 fn inline_size(_context: fidl::encoding::Context) -> usize {
9555 1
9556 }
9557 }
9558
9559 unsafe impl<D: fidl::encoding::ResourceDialect>
9560 fidl::encoding::Encode<AudioRendererEnableMinLeadTimeEventsRequest, D>
9561 for &AudioRendererEnableMinLeadTimeEventsRequest
9562 {
9563 #[inline]
9564 unsafe fn encode(
9565 self,
9566 encoder: &mut fidl::encoding::Encoder<'_, D>,
9567 offset: usize,
9568 _depth: fidl::encoding::Depth,
9569 ) -> fidl::Result<()> {
9570 encoder.debug_check_bounds::<AudioRendererEnableMinLeadTimeEventsRequest>(offset);
9571 fidl::encoding::Encode::<AudioRendererEnableMinLeadTimeEventsRequest, D>::encode(
9573 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.enabled),),
9574 encoder,
9575 offset,
9576 _depth,
9577 )
9578 }
9579 }
9580 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
9581 fidl::encoding::Encode<AudioRendererEnableMinLeadTimeEventsRequest, D> for (T0,)
9582 {
9583 #[inline]
9584 unsafe fn encode(
9585 self,
9586 encoder: &mut fidl::encoding::Encoder<'_, D>,
9587 offset: usize,
9588 depth: fidl::encoding::Depth,
9589 ) -> fidl::Result<()> {
9590 encoder.debug_check_bounds::<AudioRendererEnableMinLeadTimeEventsRequest>(offset);
9591 self.0.encode(encoder, offset + 0, depth)?;
9595 Ok(())
9596 }
9597 }
9598
9599 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
9600 for AudioRendererEnableMinLeadTimeEventsRequest
9601 {
9602 #[inline(always)]
9603 fn new_empty() -> Self {
9604 Self { enabled: fidl::new_empty!(bool, D) }
9605 }
9606
9607 #[inline]
9608 unsafe fn decode(
9609 &mut self,
9610 decoder: &mut fidl::encoding::Decoder<'_, D>,
9611 offset: usize,
9612 _depth: fidl::encoding::Depth,
9613 ) -> fidl::Result<()> {
9614 decoder.debug_check_bounds::<Self>(offset);
9615 fidl::decode!(bool, D, &mut self.enabled, decoder, offset + 0, _depth)?;
9617 Ok(())
9618 }
9619 }
9620
9621 impl fidl::encoding::ValueTypeMarker for AudioRendererGetMinLeadTimeResponse {
9622 type Borrowed<'a> = &'a Self;
9623 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9624 value
9625 }
9626 }
9627
9628 unsafe impl fidl::encoding::TypeMarker for AudioRendererGetMinLeadTimeResponse {
9629 type Owned = Self;
9630
9631 #[inline(always)]
9632 fn inline_align(_context: fidl::encoding::Context) -> usize {
9633 8
9634 }
9635
9636 #[inline(always)]
9637 fn inline_size(_context: fidl::encoding::Context) -> usize {
9638 8
9639 }
9640 #[inline(always)]
9641 fn encode_is_copy() -> bool {
9642 true
9643 }
9644
9645 #[inline(always)]
9646 fn decode_is_copy() -> bool {
9647 true
9648 }
9649 }
9650
9651 unsafe impl<D: fidl::encoding::ResourceDialect>
9652 fidl::encoding::Encode<AudioRendererGetMinLeadTimeResponse, D>
9653 for &AudioRendererGetMinLeadTimeResponse
9654 {
9655 #[inline]
9656 unsafe fn encode(
9657 self,
9658 encoder: &mut fidl::encoding::Encoder<'_, D>,
9659 offset: usize,
9660 _depth: fidl::encoding::Depth,
9661 ) -> fidl::Result<()> {
9662 encoder.debug_check_bounds::<AudioRendererGetMinLeadTimeResponse>(offset);
9663 unsafe {
9664 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
9666 (buf_ptr as *mut AudioRendererGetMinLeadTimeResponse)
9667 .write_unaligned((self as *const AudioRendererGetMinLeadTimeResponse).read());
9668 }
9671 Ok(())
9672 }
9673 }
9674 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i64, D>>
9675 fidl::encoding::Encode<AudioRendererGetMinLeadTimeResponse, D> for (T0,)
9676 {
9677 #[inline]
9678 unsafe fn encode(
9679 self,
9680 encoder: &mut fidl::encoding::Encoder<'_, D>,
9681 offset: usize,
9682 depth: fidl::encoding::Depth,
9683 ) -> fidl::Result<()> {
9684 encoder.debug_check_bounds::<AudioRendererGetMinLeadTimeResponse>(offset);
9685 self.0.encode(encoder, offset + 0, depth)?;
9689 Ok(())
9690 }
9691 }
9692
9693 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
9694 for AudioRendererGetMinLeadTimeResponse
9695 {
9696 #[inline(always)]
9697 fn new_empty() -> Self {
9698 Self { min_lead_time_nsec: fidl::new_empty!(i64, D) }
9699 }
9700
9701 #[inline]
9702 unsafe fn decode(
9703 &mut self,
9704 decoder: &mut fidl::encoding::Decoder<'_, D>,
9705 offset: usize,
9706 _depth: fidl::encoding::Depth,
9707 ) -> fidl::Result<()> {
9708 decoder.debug_check_bounds::<Self>(offset);
9709 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
9710 unsafe {
9713 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
9714 }
9715 Ok(())
9716 }
9717 }
9718
9719 impl fidl::encoding::ValueTypeMarker for AudioRendererOnMinLeadTimeChangedRequest {
9720 type Borrowed<'a> = &'a Self;
9721 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9722 value
9723 }
9724 }
9725
9726 unsafe impl fidl::encoding::TypeMarker for AudioRendererOnMinLeadTimeChangedRequest {
9727 type Owned = Self;
9728
9729 #[inline(always)]
9730 fn inline_align(_context: fidl::encoding::Context) -> usize {
9731 8
9732 }
9733
9734 #[inline(always)]
9735 fn inline_size(_context: fidl::encoding::Context) -> usize {
9736 8
9737 }
9738 #[inline(always)]
9739 fn encode_is_copy() -> bool {
9740 true
9741 }
9742
9743 #[inline(always)]
9744 fn decode_is_copy() -> bool {
9745 true
9746 }
9747 }
9748
9749 unsafe impl<D: fidl::encoding::ResourceDialect>
9750 fidl::encoding::Encode<AudioRendererOnMinLeadTimeChangedRequest, D>
9751 for &AudioRendererOnMinLeadTimeChangedRequest
9752 {
9753 #[inline]
9754 unsafe fn encode(
9755 self,
9756 encoder: &mut fidl::encoding::Encoder<'_, D>,
9757 offset: usize,
9758 _depth: fidl::encoding::Depth,
9759 ) -> fidl::Result<()> {
9760 encoder.debug_check_bounds::<AudioRendererOnMinLeadTimeChangedRequest>(offset);
9761 unsafe {
9762 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
9764 (buf_ptr as *mut AudioRendererOnMinLeadTimeChangedRequest).write_unaligned(
9765 (self as *const AudioRendererOnMinLeadTimeChangedRequest).read(),
9766 );
9767 }
9770 Ok(())
9771 }
9772 }
9773 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i64, D>>
9774 fidl::encoding::Encode<AudioRendererOnMinLeadTimeChangedRequest, D> for (T0,)
9775 {
9776 #[inline]
9777 unsafe fn encode(
9778 self,
9779 encoder: &mut fidl::encoding::Encoder<'_, D>,
9780 offset: usize,
9781 depth: fidl::encoding::Depth,
9782 ) -> fidl::Result<()> {
9783 encoder.debug_check_bounds::<AudioRendererOnMinLeadTimeChangedRequest>(offset);
9784 self.0.encode(encoder, offset + 0, depth)?;
9788 Ok(())
9789 }
9790 }
9791
9792 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
9793 for AudioRendererOnMinLeadTimeChangedRequest
9794 {
9795 #[inline(always)]
9796 fn new_empty() -> Self {
9797 Self { min_lead_time_nsec: fidl::new_empty!(i64, D) }
9798 }
9799
9800 #[inline]
9801 unsafe fn decode(
9802 &mut self,
9803 decoder: &mut fidl::encoding::Decoder<'_, D>,
9804 offset: usize,
9805 _depth: fidl::encoding::Depth,
9806 ) -> fidl::Result<()> {
9807 decoder.debug_check_bounds::<Self>(offset);
9808 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
9809 unsafe {
9812 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
9813 }
9814 Ok(())
9815 }
9816 }
9817
9818 impl fidl::encoding::ValueTypeMarker for AudioRendererPauseResponse {
9819 type Borrowed<'a> = &'a Self;
9820 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9821 value
9822 }
9823 }
9824
9825 unsafe impl fidl::encoding::TypeMarker for AudioRendererPauseResponse {
9826 type Owned = Self;
9827
9828 #[inline(always)]
9829 fn inline_align(_context: fidl::encoding::Context) -> usize {
9830 8
9831 }
9832
9833 #[inline(always)]
9834 fn inline_size(_context: fidl::encoding::Context) -> usize {
9835 16
9836 }
9837 #[inline(always)]
9838 fn encode_is_copy() -> bool {
9839 true
9840 }
9841
9842 #[inline(always)]
9843 fn decode_is_copy() -> bool {
9844 true
9845 }
9846 }
9847
9848 unsafe impl<D: fidl::encoding::ResourceDialect>
9849 fidl::encoding::Encode<AudioRendererPauseResponse, D> for &AudioRendererPauseResponse
9850 {
9851 #[inline]
9852 unsafe fn encode(
9853 self,
9854 encoder: &mut fidl::encoding::Encoder<'_, D>,
9855 offset: usize,
9856 _depth: fidl::encoding::Depth,
9857 ) -> fidl::Result<()> {
9858 encoder.debug_check_bounds::<AudioRendererPauseResponse>(offset);
9859 unsafe {
9860 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
9862 (buf_ptr as *mut AudioRendererPauseResponse)
9863 .write_unaligned((self as *const AudioRendererPauseResponse).read());
9864 }
9867 Ok(())
9868 }
9869 }
9870 unsafe impl<
9871 D: fidl::encoding::ResourceDialect,
9872 T0: fidl::encoding::Encode<i64, D>,
9873 T1: fidl::encoding::Encode<i64, D>,
9874 > fidl::encoding::Encode<AudioRendererPauseResponse, D> for (T0, T1)
9875 {
9876 #[inline]
9877 unsafe fn encode(
9878 self,
9879 encoder: &mut fidl::encoding::Encoder<'_, D>,
9880 offset: usize,
9881 depth: fidl::encoding::Depth,
9882 ) -> fidl::Result<()> {
9883 encoder.debug_check_bounds::<AudioRendererPauseResponse>(offset);
9884 self.0.encode(encoder, offset + 0, depth)?;
9888 self.1.encode(encoder, offset + 8, depth)?;
9889 Ok(())
9890 }
9891 }
9892
9893 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
9894 for AudioRendererPauseResponse
9895 {
9896 #[inline(always)]
9897 fn new_empty() -> Self {
9898 Self { reference_time: fidl::new_empty!(i64, D), media_time: fidl::new_empty!(i64, D) }
9899 }
9900
9901 #[inline]
9902 unsafe fn decode(
9903 &mut self,
9904 decoder: &mut fidl::encoding::Decoder<'_, D>,
9905 offset: usize,
9906 _depth: fidl::encoding::Depth,
9907 ) -> fidl::Result<()> {
9908 decoder.debug_check_bounds::<Self>(offset);
9909 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
9910 unsafe {
9913 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
9914 }
9915 Ok(())
9916 }
9917 }
9918
9919 impl fidl::encoding::ValueTypeMarker for AudioRendererPlayNoReplyRequest {
9920 type Borrowed<'a> = &'a Self;
9921 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9922 value
9923 }
9924 }
9925
9926 unsafe impl fidl::encoding::TypeMarker for AudioRendererPlayNoReplyRequest {
9927 type Owned = Self;
9928
9929 #[inline(always)]
9930 fn inline_align(_context: fidl::encoding::Context) -> usize {
9931 8
9932 }
9933
9934 #[inline(always)]
9935 fn inline_size(_context: fidl::encoding::Context) -> usize {
9936 16
9937 }
9938 #[inline(always)]
9939 fn encode_is_copy() -> bool {
9940 true
9941 }
9942
9943 #[inline(always)]
9944 fn decode_is_copy() -> bool {
9945 true
9946 }
9947 }
9948
9949 unsafe impl<D: fidl::encoding::ResourceDialect>
9950 fidl::encoding::Encode<AudioRendererPlayNoReplyRequest, D>
9951 for &AudioRendererPlayNoReplyRequest
9952 {
9953 #[inline]
9954 unsafe fn encode(
9955 self,
9956 encoder: &mut fidl::encoding::Encoder<'_, D>,
9957 offset: usize,
9958 _depth: fidl::encoding::Depth,
9959 ) -> fidl::Result<()> {
9960 encoder.debug_check_bounds::<AudioRendererPlayNoReplyRequest>(offset);
9961 unsafe {
9962 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
9964 (buf_ptr as *mut AudioRendererPlayNoReplyRequest)
9965 .write_unaligned((self as *const AudioRendererPlayNoReplyRequest).read());
9966 }
9969 Ok(())
9970 }
9971 }
9972 unsafe impl<
9973 D: fidl::encoding::ResourceDialect,
9974 T0: fidl::encoding::Encode<i64, D>,
9975 T1: fidl::encoding::Encode<i64, D>,
9976 > fidl::encoding::Encode<AudioRendererPlayNoReplyRequest, D> for (T0, T1)
9977 {
9978 #[inline]
9979 unsafe fn encode(
9980 self,
9981 encoder: &mut fidl::encoding::Encoder<'_, D>,
9982 offset: usize,
9983 depth: fidl::encoding::Depth,
9984 ) -> fidl::Result<()> {
9985 encoder.debug_check_bounds::<AudioRendererPlayNoReplyRequest>(offset);
9986 self.0.encode(encoder, offset + 0, depth)?;
9990 self.1.encode(encoder, offset + 8, depth)?;
9991 Ok(())
9992 }
9993 }
9994
9995 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
9996 for AudioRendererPlayNoReplyRequest
9997 {
9998 #[inline(always)]
9999 fn new_empty() -> Self {
10000 Self { reference_time: fidl::new_empty!(i64, D), media_time: fidl::new_empty!(i64, D) }
10001 }
10002
10003 #[inline]
10004 unsafe fn decode(
10005 &mut self,
10006 decoder: &mut fidl::encoding::Decoder<'_, D>,
10007 offset: usize,
10008 _depth: fidl::encoding::Depth,
10009 ) -> fidl::Result<()> {
10010 decoder.debug_check_bounds::<Self>(offset);
10011 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
10012 unsafe {
10015 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
10016 }
10017 Ok(())
10018 }
10019 }
10020
10021 impl fidl::encoding::ValueTypeMarker for AudioRendererPlayRequest {
10022 type Borrowed<'a> = &'a Self;
10023 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10024 value
10025 }
10026 }
10027
10028 unsafe impl fidl::encoding::TypeMarker for AudioRendererPlayRequest {
10029 type Owned = Self;
10030
10031 #[inline(always)]
10032 fn inline_align(_context: fidl::encoding::Context) -> usize {
10033 8
10034 }
10035
10036 #[inline(always)]
10037 fn inline_size(_context: fidl::encoding::Context) -> usize {
10038 16
10039 }
10040 #[inline(always)]
10041 fn encode_is_copy() -> bool {
10042 true
10043 }
10044
10045 #[inline(always)]
10046 fn decode_is_copy() -> bool {
10047 true
10048 }
10049 }
10050
10051 unsafe impl<D: fidl::encoding::ResourceDialect>
10052 fidl::encoding::Encode<AudioRendererPlayRequest, D> for &AudioRendererPlayRequest
10053 {
10054 #[inline]
10055 unsafe fn encode(
10056 self,
10057 encoder: &mut fidl::encoding::Encoder<'_, D>,
10058 offset: usize,
10059 _depth: fidl::encoding::Depth,
10060 ) -> fidl::Result<()> {
10061 encoder.debug_check_bounds::<AudioRendererPlayRequest>(offset);
10062 unsafe {
10063 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
10065 (buf_ptr as *mut AudioRendererPlayRequest)
10066 .write_unaligned((self as *const AudioRendererPlayRequest).read());
10067 }
10070 Ok(())
10071 }
10072 }
10073 unsafe impl<
10074 D: fidl::encoding::ResourceDialect,
10075 T0: fidl::encoding::Encode<i64, D>,
10076 T1: fidl::encoding::Encode<i64, D>,
10077 > fidl::encoding::Encode<AudioRendererPlayRequest, D> for (T0, T1)
10078 {
10079 #[inline]
10080 unsafe fn encode(
10081 self,
10082 encoder: &mut fidl::encoding::Encoder<'_, D>,
10083 offset: usize,
10084 depth: fidl::encoding::Depth,
10085 ) -> fidl::Result<()> {
10086 encoder.debug_check_bounds::<AudioRendererPlayRequest>(offset);
10087 self.0.encode(encoder, offset + 0, depth)?;
10091 self.1.encode(encoder, offset + 8, depth)?;
10092 Ok(())
10093 }
10094 }
10095
10096 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
10097 for AudioRendererPlayRequest
10098 {
10099 #[inline(always)]
10100 fn new_empty() -> Self {
10101 Self { reference_time: fidl::new_empty!(i64, D), media_time: fidl::new_empty!(i64, D) }
10102 }
10103
10104 #[inline]
10105 unsafe fn decode(
10106 &mut self,
10107 decoder: &mut fidl::encoding::Decoder<'_, D>,
10108 offset: usize,
10109 _depth: fidl::encoding::Depth,
10110 ) -> fidl::Result<()> {
10111 decoder.debug_check_bounds::<Self>(offset);
10112 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
10113 unsafe {
10116 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
10117 }
10118 Ok(())
10119 }
10120 }
10121
10122 impl fidl::encoding::ValueTypeMarker for AudioRendererPlayResponse {
10123 type Borrowed<'a> = &'a Self;
10124 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10125 value
10126 }
10127 }
10128
10129 unsafe impl fidl::encoding::TypeMarker for AudioRendererPlayResponse {
10130 type Owned = Self;
10131
10132 #[inline(always)]
10133 fn inline_align(_context: fidl::encoding::Context) -> usize {
10134 8
10135 }
10136
10137 #[inline(always)]
10138 fn inline_size(_context: fidl::encoding::Context) -> usize {
10139 16
10140 }
10141 #[inline(always)]
10142 fn encode_is_copy() -> bool {
10143 true
10144 }
10145
10146 #[inline(always)]
10147 fn decode_is_copy() -> bool {
10148 true
10149 }
10150 }
10151
10152 unsafe impl<D: fidl::encoding::ResourceDialect>
10153 fidl::encoding::Encode<AudioRendererPlayResponse, D> for &AudioRendererPlayResponse
10154 {
10155 #[inline]
10156 unsafe fn encode(
10157 self,
10158 encoder: &mut fidl::encoding::Encoder<'_, D>,
10159 offset: usize,
10160 _depth: fidl::encoding::Depth,
10161 ) -> fidl::Result<()> {
10162 encoder.debug_check_bounds::<AudioRendererPlayResponse>(offset);
10163 unsafe {
10164 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
10166 (buf_ptr as *mut AudioRendererPlayResponse)
10167 .write_unaligned((self as *const AudioRendererPlayResponse).read());
10168 }
10171 Ok(())
10172 }
10173 }
10174 unsafe impl<
10175 D: fidl::encoding::ResourceDialect,
10176 T0: fidl::encoding::Encode<i64, D>,
10177 T1: fidl::encoding::Encode<i64, D>,
10178 > fidl::encoding::Encode<AudioRendererPlayResponse, D> for (T0, T1)
10179 {
10180 #[inline]
10181 unsafe fn encode(
10182 self,
10183 encoder: &mut fidl::encoding::Encoder<'_, D>,
10184 offset: usize,
10185 depth: fidl::encoding::Depth,
10186 ) -> fidl::Result<()> {
10187 encoder.debug_check_bounds::<AudioRendererPlayResponse>(offset);
10188 self.0.encode(encoder, offset + 0, depth)?;
10192 self.1.encode(encoder, offset + 8, depth)?;
10193 Ok(())
10194 }
10195 }
10196
10197 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
10198 for AudioRendererPlayResponse
10199 {
10200 #[inline(always)]
10201 fn new_empty() -> Self {
10202 Self { reference_time: fidl::new_empty!(i64, D), media_time: fidl::new_empty!(i64, D) }
10203 }
10204
10205 #[inline]
10206 unsafe fn decode(
10207 &mut self,
10208 decoder: &mut fidl::encoding::Decoder<'_, D>,
10209 offset: usize,
10210 _depth: fidl::encoding::Depth,
10211 ) -> fidl::Result<()> {
10212 decoder.debug_check_bounds::<Self>(offset);
10213 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
10214 unsafe {
10217 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
10218 }
10219 Ok(())
10220 }
10221 }
10222
10223 impl fidl::encoding::ValueTypeMarker for AudioRendererSetPcmStreamTypeRequest {
10224 type Borrowed<'a> = &'a Self;
10225 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10226 value
10227 }
10228 }
10229
10230 unsafe impl fidl::encoding::TypeMarker for AudioRendererSetPcmStreamTypeRequest {
10231 type Owned = Self;
10232
10233 #[inline(always)]
10234 fn inline_align(_context: fidl::encoding::Context) -> usize {
10235 4
10236 }
10237
10238 #[inline(always)]
10239 fn inline_size(_context: fidl::encoding::Context) -> usize {
10240 12
10241 }
10242 }
10243
10244 unsafe impl<D: fidl::encoding::ResourceDialect>
10245 fidl::encoding::Encode<AudioRendererSetPcmStreamTypeRequest, D>
10246 for &AudioRendererSetPcmStreamTypeRequest
10247 {
10248 #[inline]
10249 unsafe fn encode(
10250 self,
10251 encoder: &mut fidl::encoding::Encoder<'_, D>,
10252 offset: usize,
10253 _depth: fidl::encoding::Depth,
10254 ) -> fidl::Result<()> {
10255 encoder.debug_check_bounds::<AudioRendererSetPcmStreamTypeRequest>(offset);
10256 fidl::encoding::Encode::<AudioRendererSetPcmStreamTypeRequest, D>::encode(
10258 (<AudioStreamType as fidl::encoding::ValueTypeMarker>::borrow(&self.type_),),
10259 encoder,
10260 offset,
10261 _depth,
10262 )
10263 }
10264 }
10265 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<AudioStreamType, D>>
10266 fidl::encoding::Encode<AudioRendererSetPcmStreamTypeRequest, D> for (T0,)
10267 {
10268 #[inline]
10269 unsafe fn encode(
10270 self,
10271 encoder: &mut fidl::encoding::Encoder<'_, D>,
10272 offset: usize,
10273 depth: fidl::encoding::Depth,
10274 ) -> fidl::Result<()> {
10275 encoder.debug_check_bounds::<AudioRendererSetPcmStreamTypeRequest>(offset);
10276 self.0.encode(encoder, offset + 0, depth)?;
10280 Ok(())
10281 }
10282 }
10283
10284 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
10285 for AudioRendererSetPcmStreamTypeRequest
10286 {
10287 #[inline(always)]
10288 fn new_empty() -> Self {
10289 Self { type_: fidl::new_empty!(AudioStreamType, D) }
10290 }
10291
10292 #[inline]
10293 unsafe fn decode(
10294 &mut self,
10295 decoder: &mut fidl::encoding::Decoder<'_, D>,
10296 offset: usize,
10297 _depth: fidl::encoding::Depth,
10298 ) -> fidl::Result<()> {
10299 decoder.debug_check_bounds::<Self>(offset);
10300 fidl::decode!(AudioStreamType, D, &mut self.type_, decoder, offset + 0, _depth)?;
10302 Ok(())
10303 }
10304 }
10305
10306 impl fidl::encoding::ValueTypeMarker for AudioRendererSetPtsContinuityThresholdRequest {
10307 type Borrowed<'a> = &'a Self;
10308 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10309 value
10310 }
10311 }
10312
10313 unsafe impl fidl::encoding::TypeMarker for AudioRendererSetPtsContinuityThresholdRequest {
10314 type Owned = Self;
10315
10316 #[inline(always)]
10317 fn inline_align(_context: fidl::encoding::Context) -> usize {
10318 4
10319 }
10320
10321 #[inline(always)]
10322 fn inline_size(_context: fidl::encoding::Context) -> usize {
10323 4
10324 }
10325 }
10326
10327 unsafe impl<D: fidl::encoding::ResourceDialect>
10328 fidl::encoding::Encode<AudioRendererSetPtsContinuityThresholdRequest, D>
10329 for &AudioRendererSetPtsContinuityThresholdRequest
10330 {
10331 #[inline]
10332 unsafe fn encode(
10333 self,
10334 encoder: &mut fidl::encoding::Encoder<'_, D>,
10335 offset: usize,
10336 _depth: fidl::encoding::Depth,
10337 ) -> fidl::Result<()> {
10338 encoder.debug_check_bounds::<AudioRendererSetPtsContinuityThresholdRequest>(offset);
10339 fidl::encoding::Encode::<AudioRendererSetPtsContinuityThresholdRequest, D>::encode(
10341 (<f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.threshold_seconds),),
10342 encoder,
10343 offset,
10344 _depth,
10345 )
10346 }
10347 }
10348 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<f32, D>>
10349 fidl::encoding::Encode<AudioRendererSetPtsContinuityThresholdRequest, D> for (T0,)
10350 {
10351 #[inline]
10352 unsafe fn encode(
10353 self,
10354 encoder: &mut fidl::encoding::Encoder<'_, D>,
10355 offset: usize,
10356 depth: fidl::encoding::Depth,
10357 ) -> fidl::Result<()> {
10358 encoder.debug_check_bounds::<AudioRendererSetPtsContinuityThresholdRequest>(offset);
10359 self.0.encode(encoder, offset + 0, depth)?;
10363 Ok(())
10364 }
10365 }
10366
10367 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
10368 for AudioRendererSetPtsContinuityThresholdRequest
10369 {
10370 #[inline(always)]
10371 fn new_empty() -> Self {
10372 Self { threshold_seconds: fidl::new_empty!(f32, D) }
10373 }
10374
10375 #[inline]
10376 unsafe fn decode(
10377 &mut self,
10378 decoder: &mut fidl::encoding::Decoder<'_, D>,
10379 offset: usize,
10380 _depth: fidl::encoding::Depth,
10381 ) -> fidl::Result<()> {
10382 decoder.debug_check_bounds::<Self>(offset);
10383 fidl::decode!(f32, D, &mut self.threshold_seconds, decoder, offset + 0, _depth)?;
10385 Ok(())
10386 }
10387 }
10388
10389 impl fidl::encoding::ValueTypeMarker for AudioRendererSetPtsUnitsRequest {
10390 type Borrowed<'a> = &'a Self;
10391 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10392 value
10393 }
10394 }
10395
10396 unsafe impl fidl::encoding::TypeMarker for AudioRendererSetPtsUnitsRequest {
10397 type Owned = Self;
10398
10399 #[inline(always)]
10400 fn inline_align(_context: fidl::encoding::Context) -> usize {
10401 4
10402 }
10403
10404 #[inline(always)]
10405 fn inline_size(_context: fidl::encoding::Context) -> usize {
10406 8
10407 }
10408 #[inline(always)]
10409 fn encode_is_copy() -> bool {
10410 true
10411 }
10412
10413 #[inline(always)]
10414 fn decode_is_copy() -> bool {
10415 true
10416 }
10417 }
10418
10419 unsafe impl<D: fidl::encoding::ResourceDialect>
10420 fidl::encoding::Encode<AudioRendererSetPtsUnitsRequest, D>
10421 for &AudioRendererSetPtsUnitsRequest
10422 {
10423 #[inline]
10424 unsafe fn encode(
10425 self,
10426 encoder: &mut fidl::encoding::Encoder<'_, D>,
10427 offset: usize,
10428 _depth: fidl::encoding::Depth,
10429 ) -> fidl::Result<()> {
10430 encoder.debug_check_bounds::<AudioRendererSetPtsUnitsRequest>(offset);
10431 unsafe {
10432 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
10434 (buf_ptr as *mut AudioRendererSetPtsUnitsRequest)
10435 .write_unaligned((self as *const AudioRendererSetPtsUnitsRequest).read());
10436 }
10439 Ok(())
10440 }
10441 }
10442 unsafe impl<
10443 D: fidl::encoding::ResourceDialect,
10444 T0: fidl::encoding::Encode<u32, D>,
10445 T1: fidl::encoding::Encode<u32, D>,
10446 > fidl::encoding::Encode<AudioRendererSetPtsUnitsRequest, D> for (T0, T1)
10447 {
10448 #[inline]
10449 unsafe fn encode(
10450 self,
10451 encoder: &mut fidl::encoding::Encoder<'_, D>,
10452 offset: usize,
10453 depth: fidl::encoding::Depth,
10454 ) -> fidl::Result<()> {
10455 encoder.debug_check_bounds::<AudioRendererSetPtsUnitsRequest>(offset);
10456 self.0.encode(encoder, offset + 0, depth)?;
10460 self.1.encode(encoder, offset + 4, depth)?;
10461 Ok(())
10462 }
10463 }
10464
10465 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
10466 for AudioRendererSetPtsUnitsRequest
10467 {
10468 #[inline(always)]
10469 fn new_empty() -> Self {
10470 Self {
10471 tick_per_second_numerator: fidl::new_empty!(u32, D),
10472 tick_per_second_denominator: fidl::new_empty!(u32, D),
10473 }
10474 }
10475
10476 #[inline]
10477 unsafe fn decode(
10478 &mut self,
10479 decoder: &mut fidl::encoding::Decoder<'_, D>,
10480 offset: usize,
10481 _depth: fidl::encoding::Depth,
10482 ) -> fidl::Result<()> {
10483 decoder.debug_check_bounds::<Self>(offset);
10484 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
10485 unsafe {
10488 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
10489 }
10490 Ok(())
10491 }
10492 }
10493
10494 impl fidl::encoding::ValueTypeMarker for AudioRendererSetUsage2Request {
10495 type Borrowed<'a> = &'a Self;
10496 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10497 value
10498 }
10499 }
10500
10501 unsafe impl fidl::encoding::TypeMarker for AudioRendererSetUsage2Request {
10502 type Owned = Self;
10503
10504 #[inline(always)]
10505 fn inline_align(_context: fidl::encoding::Context) -> usize {
10506 4
10507 }
10508
10509 #[inline(always)]
10510 fn inline_size(_context: fidl::encoding::Context) -> usize {
10511 4
10512 }
10513 }
10514
10515 unsafe impl<D: fidl::encoding::ResourceDialect>
10516 fidl::encoding::Encode<AudioRendererSetUsage2Request, D>
10517 for &AudioRendererSetUsage2Request
10518 {
10519 #[inline]
10520 unsafe fn encode(
10521 self,
10522 encoder: &mut fidl::encoding::Encoder<'_, D>,
10523 offset: usize,
10524 _depth: fidl::encoding::Depth,
10525 ) -> fidl::Result<()> {
10526 encoder.debug_check_bounds::<AudioRendererSetUsage2Request>(offset);
10527 fidl::encoding::Encode::<AudioRendererSetUsage2Request, D>::encode(
10529 (<AudioRenderUsage2 as fidl::encoding::ValueTypeMarker>::borrow(&self.usage2),),
10530 encoder,
10531 offset,
10532 _depth,
10533 )
10534 }
10535 }
10536 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<AudioRenderUsage2, D>>
10537 fidl::encoding::Encode<AudioRendererSetUsage2Request, D> for (T0,)
10538 {
10539 #[inline]
10540 unsafe fn encode(
10541 self,
10542 encoder: &mut fidl::encoding::Encoder<'_, D>,
10543 offset: usize,
10544 depth: fidl::encoding::Depth,
10545 ) -> fidl::Result<()> {
10546 encoder.debug_check_bounds::<AudioRendererSetUsage2Request>(offset);
10547 self.0.encode(encoder, offset + 0, depth)?;
10551 Ok(())
10552 }
10553 }
10554
10555 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
10556 for AudioRendererSetUsage2Request
10557 {
10558 #[inline(always)]
10559 fn new_empty() -> Self {
10560 Self { usage2: fidl::new_empty!(AudioRenderUsage2, D) }
10561 }
10562
10563 #[inline]
10564 unsafe fn decode(
10565 &mut self,
10566 decoder: &mut fidl::encoding::Decoder<'_, D>,
10567 offset: usize,
10568 _depth: fidl::encoding::Depth,
10569 ) -> fidl::Result<()> {
10570 decoder.debug_check_bounds::<Self>(offset);
10571 fidl::decode!(AudioRenderUsage2, D, &mut self.usage2, decoder, offset + 0, _depth)?;
10573 Ok(())
10574 }
10575 }
10576
10577 impl fidl::encoding::ValueTypeMarker for AudioRendererSetUsageRequest {
10578 type Borrowed<'a> = &'a Self;
10579 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10580 value
10581 }
10582 }
10583
10584 unsafe impl fidl::encoding::TypeMarker for AudioRendererSetUsageRequest {
10585 type Owned = Self;
10586
10587 #[inline(always)]
10588 fn inline_align(_context: fidl::encoding::Context) -> usize {
10589 4
10590 }
10591
10592 #[inline(always)]
10593 fn inline_size(_context: fidl::encoding::Context) -> usize {
10594 4
10595 }
10596 }
10597
10598 unsafe impl<D: fidl::encoding::ResourceDialect>
10599 fidl::encoding::Encode<AudioRendererSetUsageRequest, D> for &AudioRendererSetUsageRequest
10600 {
10601 #[inline]
10602 unsafe fn encode(
10603 self,
10604 encoder: &mut fidl::encoding::Encoder<'_, D>,
10605 offset: usize,
10606 _depth: fidl::encoding::Depth,
10607 ) -> fidl::Result<()> {
10608 encoder.debug_check_bounds::<AudioRendererSetUsageRequest>(offset);
10609 fidl::encoding::Encode::<AudioRendererSetUsageRequest, D>::encode(
10611 (<AudioRenderUsage as fidl::encoding::ValueTypeMarker>::borrow(&self.usage),),
10612 encoder,
10613 offset,
10614 _depth,
10615 )
10616 }
10617 }
10618 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<AudioRenderUsage, D>>
10619 fidl::encoding::Encode<AudioRendererSetUsageRequest, D> for (T0,)
10620 {
10621 #[inline]
10622 unsafe fn encode(
10623 self,
10624 encoder: &mut fidl::encoding::Encoder<'_, D>,
10625 offset: usize,
10626 depth: fidl::encoding::Depth,
10627 ) -> fidl::Result<()> {
10628 encoder.debug_check_bounds::<AudioRendererSetUsageRequest>(offset);
10629 self.0.encode(encoder, offset + 0, depth)?;
10633 Ok(())
10634 }
10635 }
10636
10637 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
10638 for AudioRendererSetUsageRequest
10639 {
10640 #[inline(always)]
10641 fn new_empty() -> Self {
10642 Self { usage: fidl::new_empty!(AudioRenderUsage, D) }
10643 }
10644
10645 #[inline]
10646 unsafe fn decode(
10647 &mut self,
10648 decoder: &mut fidl::encoding::Decoder<'_, D>,
10649 offset: usize,
10650 _depth: fidl::encoding::Depth,
10651 ) -> fidl::Result<()> {
10652 decoder.debug_check_bounds::<Self>(offset);
10653 fidl::decode!(AudioRenderUsage, D, &mut self.usage, decoder, offset + 0, _depth)?;
10655 Ok(())
10656 }
10657 }
10658
10659 impl fidl::encoding::ValueTypeMarker for AudioStreamType {
10660 type Borrowed<'a> = &'a Self;
10661 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10662 value
10663 }
10664 }
10665
10666 unsafe impl fidl::encoding::TypeMarker for AudioStreamType {
10667 type Owned = Self;
10668
10669 #[inline(always)]
10670 fn inline_align(_context: fidl::encoding::Context) -> usize {
10671 4
10672 }
10673
10674 #[inline(always)]
10675 fn inline_size(_context: fidl::encoding::Context) -> usize {
10676 12
10677 }
10678 }
10679
10680 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AudioStreamType, D>
10681 for &AudioStreamType
10682 {
10683 #[inline]
10684 unsafe fn encode(
10685 self,
10686 encoder: &mut fidl::encoding::Encoder<'_, D>,
10687 offset: usize,
10688 _depth: fidl::encoding::Depth,
10689 ) -> fidl::Result<()> {
10690 encoder.debug_check_bounds::<AudioStreamType>(offset);
10691 fidl::encoding::Encode::<AudioStreamType, D>::encode(
10693 (
10694 <AudioSampleFormat as fidl::encoding::ValueTypeMarker>::borrow(
10695 &self.sample_format,
10696 ),
10697 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.channels),
10698 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.frames_per_second),
10699 ),
10700 encoder,
10701 offset,
10702 _depth,
10703 )
10704 }
10705 }
10706 unsafe impl<
10707 D: fidl::encoding::ResourceDialect,
10708 T0: fidl::encoding::Encode<AudioSampleFormat, D>,
10709 T1: fidl::encoding::Encode<u32, D>,
10710 T2: fidl::encoding::Encode<u32, D>,
10711 > fidl::encoding::Encode<AudioStreamType, D> for (T0, T1, T2)
10712 {
10713 #[inline]
10714 unsafe fn encode(
10715 self,
10716 encoder: &mut fidl::encoding::Encoder<'_, D>,
10717 offset: usize,
10718 depth: fidl::encoding::Depth,
10719 ) -> fidl::Result<()> {
10720 encoder.debug_check_bounds::<AudioStreamType>(offset);
10721 self.0.encode(encoder, offset + 0, depth)?;
10725 self.1.encode(encoder, offset + 4, depth)?;
10726 self.2.encode(encoder, offset + 8, depth)?;
10727 Ok(())
10728 }
10729 }
10730
10731 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AudioStreamType {
10732 #[inline(always)]
10733 fn new_empty() -> Self {
10734 Self {
10735 sample_format: fidl::new_empty!(AudioSampleFormat, D),
10736 channels: fidl::new_empty!(u32, D),
10737 frames_per_second: fidl::new_empty!(u32, D),
10738 }
10739 }
10740
10741 #[inline]
10742 unsafe fn decode(
10743 &mut self,
10744 decoder: &mut fidl::encoding::Decoder<'_, D>,
10745 offset: usize,
10746 _depth: fidl::encoding::Depth,
10747 ) -> fidl::Result<()> {
10748 decoder.debug_check_bounds::<Self>(offset);
10749 fidl::decode!(
10751 AudioSampleFormat,
10752 D,
10753 &mut self.sample_format,
10754 decoder,
10755 offset + 0,
10756 _depth
10757 )?;
10758 fidl::decode!(u32, D, &mut self.channels, decoder, offset + 4, _depth)?;
10759 fidl::decode!(u32, D, &mut self.frames_per_second, decoder, offset + 8, _depth)?;
10760 Ok(())
10761 }
10762 }
10763
10764 impl fidl::encoding::ValueTypeMarker for Compression {
10765 type Borrowed<'a> = &'a Self;
10766 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10767 value
10768 }
10769 }
10770
10771 unsafe impl fidl::encoding::TypeMarker for Compression {
10772 type Owned = Self;
10773
10774 #[inline(always)]
10775 fn inline_align(_context: fidl::encoding::Context) -> usize {
10776 8
10777 }
10778
10779 #[inline(always)]
10780 fn inline_size(_context: fidl::encoding::Context) -> usize {
10781 32
10782 }
10783 }
10784
10785 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Compression, D>
10786 for &Compression
10787 {
10788 #[inline]
10789 unsafe fn encode(
10790 self,
10791 encoder: &mut fidl::encoding::Encoder<'_, D>,
10792 offset: usize,
10793 _depth: fidl::encoding::Depth,
10794 ) -> fidl::Result<()> {
10795 encoder.debug_check_bounds::<Compression>(offset);
10796 fidl::encoding::Encode::<Compression, D>::encode(
10798 (
10799 <fidl::encoding::BoundedString<256> as fidl::encoding::ValueTypeMarker>::borrow(&self.type_),
10800 <fidl::encoding::Optional<fidl::encoding::Vector<u8, 8192>> as fidl::encoding::ValueTypeMarker>::borrow(&self.parameters),
10801 ),
10802 encoder, offset, _depth
10803 )
10804 }
10805 }
10806 unsafe impl<
10807 D: fidl::encoding::ResourceDialect,
10808 T0: fidl::encoding::Encode<fidl::encoding::BoundedString<256>, D>,
10809 T1: fidl::encoding::Encode<fidl::encoding::Optional<fidl::encoding::Vector<u8, 8192>>, D>,
10810 > fidl::encoding::Encode<Compression, D> for (T0, T1)
10811 {
10812 #[inline]
10813 unsafe fn encode(
10814 self,
10815 encoder: &mut fidl::encoding::Encoder<'_, D>,
10816 offset: usize,
10817 depth: fidl::encoding::Depth,
10818 ) -> fidl::Result<()> {
10819 encoder.debug_check_bounds::<Compression>(offset);
10820 self.0.encode(encoder, offset + 0, depth)?;
10824 self.1.encode(encoder, offset + 16, depth)?;
10825 Ok(())
10826 }
10827 }
10828
10829 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Compression {
10830 #[inline(always)]
10831 fn new_empty() -> Self {
10832 Self {
10833 type_: fidl::new_empty!(fidl::encoding::BoundedString<256>, D),
10834 parameters: fidl::new_empty!(
10835 fidl::encoding::Optional<fidl::encoding::Vector<u8, 8192>>,
10836 D
10837 ),
10838 }
10839 }
10840
10841 #[inline]
10842 unsafe fn decode(
10843 &mut self,
10844 decoder: &mut fidl::encoding::Decoder<'_, D>,
10845 offset: usize,
10846 _depth: fidl::encoding::Depth,
10847 ) -> fidl::Result<()> {
10848 decoder.debug_check_bounds::<Self>(offset);
10849 fidl::decode!(
10851 fidl::encoding::BoundedString<256>,
10852 D,
10853 &mut self.type_,
10854 decoder,
10855 offset + 0,
10856 _depth
10857 )?;
10858 fidl::decode!(
10859 fidl::encoding::Optional<fidl::encoding::Vector<u8, 8192>>,
10860 D,
10861 &mut self.parameters,
10862 decoder,
10863 offset + 16,
10864 _depth
10865 )?;
10866 Ok(())
10867 }
10868 }
10869
10870 impl fidl::encoding::ValueTypeMarker for EncryptionPattern {
10871 type Borrowed<'a> = &'a Self;
10872 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10873 value
10874 }
10875 }
10876
10877 unsafe impl fidl::encoding::TypeMarker for EncryptionPattern {
10878 type Owned = Self;
10879
10880 #[inline(always)]
10881 fn inline_align(_context: fidl::encoding::Context) -> usize {
10882 4
10883 }
10884
10885 #[inline(always)]
10886 fn inline_size(_context: fidl::encoding::Context) -> usize {
10887 8
10888 }
10889 #[inline(always)]
10890 fn encode_is_copy() -> bool {
10891 true
10892 }
10893
10894 #[inline(always)]
10895 fn decode_is_copy() -> bool {
10896 true
10897 }
10898 }
10899
10900 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<EncryptionPattern, D>
10901 for &EncryptionPattern
10902 {
10903 #[inline]
10904 unsafe fn encode(
10905 self,
10906 encoder: &mut fidl::encoding::Encoder<'_, D>,
10907 offset: usize,
10908 _depth: fidl::encoding::Depth,
10909 ) -> fidl::Result<()> {
10910 encoder.debug_check_bounds::<EncryptionPattern>(offset);
10911 unsafe {
10912 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
10914 (buf_ptr as *mut EncryptionPattern)
10915 .write_unaligned((self as *const EncryptionPattern).read());
10916 }
10919 Ok(())
10920 }
10921 }
10922 unsafe impl<
10923 D: fidl::encoding::ResourceDialect,
10924 T0: fidl::encoding::Encode<u32, D>,
10925 T1: fidl::encoding::Encode<u32, D>,
10926 > fidl::encoding::Encode<EncryptionPattern, D> for (T0, T1)
10927 {
10928 #[inline]
10929 unsafe fn encode(
10930 self,
10931 encoder: &mut fidl::encoding::Encoder<'_, D>,
10932 offset: usize,
10933 depth: fidl::encoding::Depth,
10934 ) -> fidl::Result<()> {
10935 encoder.debug_check_bounds::<EncryptionPattern>(offset);
10936 self.0.encode(encoder, offset + 0, depth)?;
10940 self.1.encode(encoder, offset + 4, depth)?;
10941 Ok(())
10942 }
10943 }
10944
10945 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for EncryptionPattern {
10946 #[inline(always)]
10947 fn new_empty() -> Self {
10948 Self {
10949 clear_blocks: fidl::new_empty!(u32, D),
10950 encrypted_blocks: fidl::new_empty!(u32, D),
10951 }
10952 }
10953
10954 #[inline]
10955 unsafe fn decode(
10956 &mut self,
10957 decoder: &mut fidl::encoding::Decoder<'_, D>,
10958 offset: usize,
10959 _depth: fidl::encoding::Depth,
10960 ) -> fidl::Result<()> {
10961 decoder.debug_check_bounds::<Self>(offset);
10962 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
10963 unsafe {
10966 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
10967 }
10968 Ok(())
10969 }
10970 }
10971
10972 impl fidl::encoding::ValueTypeMarker for Metadata {
10973 type Borrowed<'a> = &'a Self;
10974 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10975 value
10976 }
10977 }
10978
10979 unsafe impl fidl::encoding::TypeMarker for Metadata {
10980 type Owned = Self;
10981
10982 #[inline(always)]
10983 fn inline_align(_context: fidl::encoding::Context) -> usize {
10984 8
10985 }
10986
10987 #[inline(always)]
10988 fn inline_size(_context: fidl::encoding::Context) -> usize {
10989 16
10990 }
10991 }
10992
10993 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Metadata, D> for &Metadata {
10994 #[inline]
10995 unsafe fn encode(
10996 self,
10997 encoder: &mut fidl::encoding::Encoder<'_, D>,
10998 offset: usize,
10999 _depth: fidl::encoding::Depth,
11000 ) -> fidl::Result<()> {
11001 encoder.debug_check_bounds::<Metadata>(offset);
11002 fidl::encoding::Encode::<Metadata, D>::encode(
11004 (
11005 <fidl::encoding::UnboundedVector<Property> as fidl::encoding::ValueTypeMarker>::borrow(&self.properties),
11006 ),
11007 encoder, offset, _depth
11008 )
11009 }
11010 }
11011 unsafe impl<
11012 D: fidl::encoding::ResourceDialect,
11013 T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<Property>, D>,
11014 > fidl::encoding::Encode<Metadata, D> for (T0,)
11015 {
11016 #[inline]
11017 unsafe fn encode(
11018 self,
11019 encoder: &mut fidl::encoding::Encoder<'_, D>,
11020 offset: usize,
11021 depth: fidl::encoding::Depth,
11022 ) -> fidl::Result<()> {
11023 encoder.debug_check_bounds::<Metadata>(offset);
11024 self.0.encode(encoder, offset + 0, depth)?;
11028 Ok(())
11029 }
11030 }
11031
11032 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Metadata {
11033 #[inline(always)]
11034 fn new_empty() -> Self {
11035 Self { properties: fidl::new_empty!(fidl::encoding::UnboundedVector<Property>, D) }
11036 }
11037
11038 #[inline]
11039 unsafe fn decode(
11040 &mut self,
11041 decoder: &mut fidl::encoding::Decoder<'_, D>,
11042 offset: usize,
11043 _depth: fidl::encoding::Depth,
11044 ) -> fidl::Result<()> {
11045 decoder.debug_check_bounds::<Self>(offset);
11046 fidl::decode!(
11048 fidl::encoding::UnboundedVector<Property>,
11049 D,
11050 &mut self.properties,
11051 decoder,
11052 offset + 0,
11053 _depth
11054 )?;
11055 Ok(())
11056 }
11057 }
11058
11059 impl fidl::encoding::ValueTypeMarker for Parameter {
11060 type Borrowed<'a> = &'a Self;
11061 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11062 value
11063 }
11064 }
11065
11066 unsafe impl fidl::encoding::TypeMarker for Parameter {
11067 type Owned = Self;
11068
11069 #[inline(always)]
11070 fn inline_align(_context: fidl::encoding::Context) -> usize {
11071 8
11072 }
11073
11074 #[inline(always)]
11075 fn inline_size(_context: fidl::encoding::Context) -> usize {
11076 48
11077 }
11078 }
11079
11080 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Parameter, D>
11081 for &Parameter
11082 {
11083 #[inline]
11084 unsafe fn encode(
11085 self,
11086 encoder: &mut fidl::encoding::Encoder<'_, D>,
11087 offset: usize,
11088 _depth: fidl::encoding::Depth,
11089 ) -> fidl::Result<()> {
11090 encoder.debug_check_bounds::<Parameter>(offset);
11091 fidl::encoding::Encode::<Parameter, D>::encode(
11093 (
11094 <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
11095 &self.scope,
11096 ),
11097 <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
11098 &self.name,
11099 ),
11100 <Value as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
11101 ),
11102 encoder,
11103 offset,
11104 _depth,
11105 )
11106 }
11107 }
11108 unsafe impl<
11109 D: fidl::encoding::ResourceDialect,
11110 T0: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
11111 T1: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
11112 T2: fidl::encoding::Encode<Value, D>,
11113 > fidl::encoding::Encode<Parameter, D> for (T0, T1, T2)
11114 {
11115 #[inline]
11116 unsafe fn encode(
11117 self,
11118 encoder: &mut fidl::encoding::Encoder<'_, D>,
11119 offset: usize,
11120 depth: fidl::encoding::Depth,
11121 ) -> fidl::Result<()> {
11122 encoder.debug_check_bounds::<Parameter>(offset);
11123 self.0.encode(encoder, offset + 0, depth)?;
11127 self.1.encode(encoder, offset + 16, depth)?;
11128 self.2.encode(encoder, offset + 32, depth)?;
11129 Ok(())
11130 }
11131 }
11132
11133 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Parameter {
11134 #[inline(always)]
11135 fn new_empty() -> Self {
11136 Self {
11137 scope: fidl::new_empty!(fidl::encoding::UnboundedString, D),
11138 name: fidl::new_empty!(fidl::encoding::UnboundedString, D),
11139 value: fidl::new_empty!(Value, D),
11140 }
11141 }
11142
11143 #[inline]
11144 unsafe fn decode(
11145 &mut self,
11146 decoder: &mut fidl::encoding::Decoder<'_, D>,
11147 offset: usize,
11148 _depth: fidl::encoding::Depth,
11149 ) -> fidl::Result<()> {
11150 decoder.debug_check_bounds::<Self>(offset);
11151 fidl::decode!(
11153 fidl::encoding::UnboundedString,
11154 D,
11155 &mut self.scope,
11156 decoder,
11157 offset + 0,
11158 _depth
11159 )?;
11160 fidl::decode!(
11161 fidl::encoding::UnboundedString,
11162 D,
11163 &mut self.name,
11164 decoder,
11165 offset + 16,
11166 _depth
11167 )?;
11168 fidl::decode!(Value, D, &mut self.value, decoder, offset + 32, _depth)?;
11169 Ok(())
11170 }
11171 }
11172
11173 impl fidl::encoding::ValueTypeMarker for PcmFormat {
11174 type Borrowed<'a> = &'a Self;
11175 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11176 value
11177 }
11178 }
11179
11180 unsafe impl fidl::encoding::TypeMarker for PcmFormat {
11181 type Owned = Self;
11182
11183 #[inline(always)]
11184 fn inline_align(_context: fidl::encoding::Context) -> usize {
11185 8
11186 }
11187
11188 #[inline(always)]
11189 fn inline_size(_context: fidl::encoding::Context) -> usize {
11190 32
11191 }
11192 }
11193
11194 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<PcmFormat, D>
11195 for &PcmFormat
11196 {
11197 #[inline]
11198 unsafe fn encode(
11199 self,
11200 encoder: &mut fidl::encoding::Encoder<'_, D>,
11201 offset: usize,
11202 _depth: fidl::encoding::Depth,
11203 ) -> fidl::Result<()> {
11204 encoder.debug_check_bounds::<PcmFormat>(offset);
11205 fidl::encoding::Encode::<PcmFormat, D>::encode(
11207 (
11208 <AudioPcmMode as fidl::encoding::ValueTypeMarker>::borrow(&self.pcm_mode),
11209 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.bits_per_sample),
11210 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.frames_per_second),
11211 <fidl::encoding::Vector<AudioChannelId, 16> as fidl::encoding::ValueTypeMarker>::borrow(&self.channel_map),
11212 ),
11213 encoder, offset, _depth
11214 )
11215 }
11216 }
11217 unsafe impl<
11218 D: fidl::encoding::ResourceDialect,
11219 T0: fidl::encoding::Encode<AudioPcmMode, D>,
11220 T1: fidl::encoding::Encode<u32, D>,
11221 T2: fidl::encoding::Encode<u32, D>,
11222 T3: fidl::encoding::Encode<fidl::encoding::Vector<AudioChannelId, 16>, D>,
11223 > fidl::encoding::Encode<PcmFormat, D> for (T0, T1, T2, T3)
11224 {
11225 #[inline]
11226 unsafe fn encode(
11227 self,
11228 encoder: &mut fidl::encoding::Encoder<'_, D>,
11229 offset: usize,
11230 depth: fidl::encoding::Depth,
11231 ) -> fidl::Result<()> {
11232 encoder.debug_check_bounds::<PcmFormat>(offset);
11233 unsafe {
11236 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
11237 (ptr as *mut u64).write_unaligned(0);
11238 }
11239 self.0.encode(encoder, offset + 0, depth)?;
11241 self.1.encode(encoder, offset + 4, depth)?;
11242 self.2.encode(encoder, offset + 8, depth)?;
11243 self.3.encode(encoder, offset + 16, depth)?;
11244 Ok(())
11245 }
11246 }
11247
11248 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for PcmFormat {
11249 #[inline(always)]
11250 fn new_empty() -> Self {
11251 Self {
11252 pcm_mode: fidl::new_empty!(AudioPcmMode, D),
11253 bits_per_sample: fidl::new_empty!(u32, D),
11254 frames_per_second: fidl::new_empty!(u32, D),
11255 channel_map: fidl::new_empty!(fidl::encoding::Vector<AudioChannelId, 16>, D),
11256 }
11257 }
11258
11259 #[inline]
11260 unsafe fn decode(
11261 &mut self,
11262 decoder: &mut fidl::encoding::Decoder<'_, D>,
11263 offset: usize,
11264 _depth: fidl::encoding::Depth,
11265 ) -> fidl::Result<()> {
11266 decoder.debug_check_bounds::<Self>(offset);
11267 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
11269 let padval = unsafe { (ptr as *const u64).read_unaligned() };
11270 let mask = 0xffffffff00000000u64;
11271 let maskedval = padval & mask;
11272 if maskedval != 0 {
11273 return Err(fidl::Error::NonZeroPadding {
11274 padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
11275 });
11276 }
11277 fidl::decode!(AudioPcmMode, D, &mut self.pcm_mode, decoder, offset + 0, _depth)?;
11278 fidl::decode!(u32, D, &mut self.bits_per_sample, decoder, offset + 4, _depth)?;
11279 fidl::decode!(u32, D, &mut self.frames_per_second, decoder, offset + 8, _depth)?;
11280 fidl::decode!(fidl::encoding::Vector<AudioChannelId, 16>, D, &mut self.channel_map, decoder, offset + 16, _depth)?;
11281 Ok(())
11282 }
11283 }
11284
11285 impl fidl::encoding::ValueTypeMarker for ProfileProviderRegisterHandlerWithCapacityResponse {
11286 type Borrowed<'a> = &'a Self;
11287 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11288 value
11289 }
11290 }
11291
11292 unsafe impl fidl::encoding::TypeMarker for ProfileProviderRegisterHandlerWithCapacityResponse {
11293 type Owned = Self;
11294
11295 #[inline(always)]
11296 fn inline_align(_context: fidl::encoding::Context) -> usize {
11297 8
11298 }
11299
11300 #[inline(always)]
11301 fn inline_size(_context: fidl::encoding::Context) -> usize {
11302 16
11303 }
11304 #[inline(always)]
11305 fn encode_is_copy() -> bool {
11306 true
11307 }
11308
11309 #[inline(always)]
11310 fn decode_is_copy() -> bool {
11311 true
11312 }
11313 }
11314
11315 unsafe impl<D: fidl::encoding::ResourceDialect>
11316 fidl::encoding::Encode<ProfileProviderRegisterHandlerWithCapacityResponse, D>
11317 for &ProfileProviderRegisterHandlerWithCapacityResponse
11318 {
11319 #[inline]
11320 unsafe fn encode(
11321 self,
11322 encoder: &mut fidl::encoding::Encoder<'_, D>,
11323 offset: usize,
11324 _depth: fidl::encoding::Depth,
11325 ) -> fidl::Result<()> {
11326 encoder
11327 .debug_check_bounds::<ProfileProviderRegisterHandlerWithCapacityResponse>(offset);
11328 unsafe {
11329 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
11331 (buf_ptr as *mut ProfileProviderRegisterHandlerWithCapacityResponse)
11332 .write_unaligned(
11333 (self as *const ProfileProviderRegisterHandlerWithCapacityResponse).read(),
11334 );
11335 }
11338 Ok(())
11339 }
11340 }
11341 unsafe impl<
11342 D: fidl::encoding::ResourceDialect,
11343 T0: fidl::encoding::Encode<i64, D>,
11344 T1: fidl::encoding::Encode<i64, D>,
11345 > fidl::encoding::Encode<ProfileProviderRegisterHandlerWithCapacityResponse, D>
11346 for (T0, T1)
11347 {
11348 #[inline]
11349 unsafe fn encode(
11350 self,
11351 encoder: &mut fidl::encoding::Encoder<'_, D>,
11352 offset: usize,
11353 depth: fidl::encoding::Depth,
11354 ) -> fidl::Result<()> {
11355 encoder
11356 .debug_check_bounds::<ProfileProviderRegisterHandlerWithCapacityResponse>(offset);
11357 self.0.encode(encoder, offset + 0, depth)?;
11361 self.1.encode(encoder, offset + 8, depth)?;
11362 Ok(())
11363 }
11364 }
11365
11366 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11367 for ProfileProviderRegisterHandlerWithCapacityResponse
11368 {
11369 #[inline(always)]
11370 fn new_empty() -> Self {
11371 Self { period: fidl::new_empty!(i64, D), capacity: fidl::new_empty!(i64, D) }
11372 }
11373
11374 #[inline]
11375 unsafe fn decode(
11376 &mut self,
11377 decoder: &mut fidl::encoding::Decoder<'_, D>,
11378 offset: usize,
11379 _depth: fidl::encoding::Depth,
11380 ) -> fidl::Result<()> {
11381 decoder.debug_check_bounds::<Self>(offset);
11382 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
11383 unsafe {
11386 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
11387 }
11388 Ok(())
11389 }
11390 }
11391
11392 impl fidl::encoding::ValueTypeMarker for Property {
11393 type Borrowed<'a> = &'a Self;
11394 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11395 value
11396 }
11397 }
11398
11399 unsafe impl fidl::encoding::TypeMarker for Property {
11400 type Owned = Self;
11401
11402 #[inline(always)]
11403 fn inline_align(_context: fidl::encoding::Context) -> usize {
11404 8
11405 }
11406
11407 #[inline(always)]
11408 fn inline_size(_context: fidl::encoding::Context) -> usize {
11409 32
11410 }
11411 }
11412
11413 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Property, D> for &Property {
11414 #[inline]
11415 unsafe fn encode(
11416 self,
11417 encoder: &mut fidl::encoding::Encoder<'_, D>,
11418 offset: usize,
11419 _depth: fidl::encoding::Depth,
11420 ) -> fidl::Result<()> {
11421 encoder.debug_check_bounds::<Property>(offset);
11422 fidl::encoding::Encode::<Property, D>::encode(
11424 (
11425 <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
11426 &self.label,
11427 ),
11428 <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
11429 &self.value,
11430 ),
11431 ),
11432 encoder,
11433 offset,
11434 _depth,
11435 )
11436 }
11437 }
11438 unsafe impl<
11439 D: fidl::encoding::ResourceDialect,
11440 T0: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
11441 T1: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
11442 > fidl::encoding::Encode<Property, D> for (T0, T1)
11443 {
11444 #[inline]
11445 unsafe fn encode(
11446 self,
11447 encoder: &mut fidl::encoding::Encoder<'_, D>,
11448 offset: usize,
11449 depth: fidl::encoding::Depth,
11450 ) -> fidl::Result<()> {
11451 encoder.debug_check_bounds::<Property>(offset);
11452 self.0.encode(encoder, offset + 0, depth)?;
11456 self.1.encode(encoder, offset + 16, depth)?;
11457 Ok(())
11458 }
11459 }
11460
11461 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Property {
11462 #[inline(always)]
11463 fn new_empty() -> Self {
11464 Self {
11465 label: fidl::new_empty!(fidl::encoding::UnboundedString, D),
11466 value: fidl::new_empty!(fidl::encoding::UnboundedString, D),
11467 }
11468 }
11469
11470 #[inline]
11471 unsafe fn decode(
11472 &mut self,
11473 decoder: &mut fidl::encoding::Decoder<'_, D>,
11474 offset: usize,
11475 _depth: fidl::encoding::Depth,
11476 ) -> fidl::Result<()> {
11477 decoder.debug_check_bounds::<Self>(offset);
11478 fidl::decode!(
11480 fidl::encoding::UnboundedString,
11481 D,
11482 &mut self.label,
11483 decoder,
11484 offset + 0,
11485 _depth
11486 )?;
11487 fidl::decode!(
11488 fidl::encoding::UnboundedString,
11489 D,
11490 &mut self.value,
11491 decoder,
11492 offset + 16,
11493 _depth
11494 )?;
11495 Ok(())
11496 }
11497 }
11498
11499 impl fidl::encoding::ValueTypeMarker for SbcEncoderSettings {
11500 type Borrowed<'a> = &'a Self;
11501 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11502 value
11503 }
11504 }
11505
11506 unsafe impl fidl::encoding::TypeMarker for SbcEncoderSettings {
11507 type Owned = Self;
11508
11509 #[inline(always)]
11510 fn inline_align(_context: fidl::encoding::Context) -> usize {
11511 8
11512 }
11513
11514 #[inline(always)]
11515 fn inline_size(_context: fidl::encoding::Context) -> usize {
11516 24
11517 }
11518 }
11519
11520 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SbcEncoderSettings, D>
11521 for &SbcEncoderSettings
11522 {
11523 #[inline]
11524 unsafe fn encode(
11525 self,
11526 encoder: &mut fidl::encoding::Encoder<'_, D>,
11527 offset: usize,
11528 _depth: fidl::encoding::Depth,
11529 ) -> fidl::Result<()> {
11530 encoder.debug_check_bounds::<SbcEncoderSettings>(offset);
11531 fidl::encoding::Encode::<SbcEncoderSettings, D>::encode(
11533 (
11534 <SbcSubBands as fidl::encoding::ValueTypeMarker>::borrow(&self.sub_bands),
11535 <SbcAllocation as fidl::encoding::ValueTypeMarker>::borrow(&self.allocation),
11536 <SbcBlockCount as fidl::encoding::ValueTypeMarker>::borrow(&self.block_count),
11537 <SbcChannelMode as fidl::encoding::ValueTypeMarker>::borrow(&self.channel_mode),
11538 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.bit_pool),
11539 ),
11540 encoder,
11541 offset,
11542 _depth,
11543 )
11544 }
11545 }
11546 unsafe impl<
11547 D: fidl::encoding::ResourceDialect,
11548 T0: fidl::encoding::Encode<SbcSubBands, D>,
11549 T1: fidl::encoding::Encode<SbcAllocation, D>,
11550 T2: fidl::encoding::Encode<SbcBlockCount, D>,
11551 T3: fidl::encoding::Encode<SbcChannelMode, D>,
11552 T4: fidl::encoding::Encode<u64, D>,
11553 > fidl::encoding::Encode<SbcEncoderSettings, D> for (T0, T1, T2, T3, T4)
11554 {
11555 #[inline]
11556 unsafe fn encode(
11557 self,
11558 encoder: &mut fidl::encoding::Encoder<'_, D>,
11559 offset: usize,
11560 depth: fidl::encoding::Depth,
11561 ) -> fidl::Result<()> {
11562 encoder.debug_check_bounds::<SbcEncoderSettings>(offset);
11563 self.0.encode(encoder, offset + 0, depth)?;
11567 self.1.encode(encoder, offset + 4, depth)?;
11568 self.2.encode(encoder, offset + 8, depth)?;
11569 self.3.encode(encoder, offset + 12, depth)?;
11570 self.4.encode(encoder, offset + 16, depth)?;
11571 Ok(())
11572 }
11573 }
11574
11575 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SbcEncoderSettings {
11576 #[inline(always)]
11577 fn new_empty() -> Self {
11578 Self {
11579 sub_bands: fidl::new_empty!(SbcSubBands, D),
11580 allocation: fidl::new_empty!(SbcAllocation, D),
11581 block_count: fidl::new_empty!(SbcBlockCount, D),
11582 channel_mode: fidl::new_empty!(SbcChannelMode, D),
11583 bit_pool: fidl::new_empty!(u64, D),
11584 }
11585 }
11586
11587 #[inline]
11588 unsafe fn decode(
11589 &mut self,
11590 decoder: &mut fidl::encoding::Decoder<'_, D>,
11591 offset: usize,
11592 _depth: fidl::encoding::Depth,
11593 ) -> fidl::Result<()> {
11594 decoder.debug_check_bounds::<Self>(offset);
11595 fidl::decode!(SbcSubBands, D, &mut self.sub_bands, decoder, offset + 0, _depth)?;
11597 fidl::decode!(SbcAllocation, D, &mut self.allocation, decoder, offset + 4, _depth)?;
11598 fidl::decode!(SbcBlockCount, D, &mut self.block_count, decoder, offset + 8, _depth)?;
11599 fidl::decode!(SbcChannelMode, D, &mut self.channel_mode, decoder, offset + 12, _depth)?;
11600 fidl::decode!(u64, D, &mut self.bit_pool, decoder, offset + 16, _depth)?;
11601 Ok(())
11602 }
11603 }
11604
11605 impl fidl::encoding::ValueTypeMarker for StreamBufferSetRemovePayloadBufferRequest {
11606 type Borrowed<'a> = &'a Self;
11607 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11608 value
11609 }
11610 }
11611
11612 unsafe impl fidl::encoding::TypeMarker for StreamBufferSetRemovePayloadBufferRequest {
11613 type Owned = Self;
11614
11615 #[inline(always)]
11616 fn inline_align(_context: fidl::encoding::Context) -> usize {
11617 4
11618 }
11619
11620 #[inline(always)]
11621 fn inline_size(_context: fidl::encoding::Context) -> usize {
11622 4
11623 }
11624 #[inline(always)]
11625 fn encode_is_copy() -> bool {
11626 true
11627 }
11628
11629 #[inline(always)]
11630 fn decode_is_copy() -> bool {
11631 true
11632 }
11633 }
11634
11635 unsafe impl<D: fidl::encoding::ResourceDialect>
11636 fidl::encoding::Encode<StreamBufferSetRemovePayloadBufferRequest, D>
11637 for &StreamBufferSetRemovePayloadBufferRequest
11638 {
11639 #[inline]
11640 unsafe fn encode(
11641 self,
11642 encoder: &mut fidl::encoding::Encoder<'_, D>,
11643 offset: usize,
11644 _depth: fidl::encoding::Depth,
11645 ) -> fidl::Result<()> {
11646 encoder.debug_check_bounds::<StreamBufferSetRemovePayloadBufferRequest>(offset);
11647 unsafe {
11648 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
11650 (buf_ptr as *mut StreamBufferSetRemovePayloadBufferRequest).write_unaligned(
11651 (self as *const StreamBufferSetRemovePayloadBufferRequest).read(),
11652 );
11653 }
11656 Ok(())
11657 }
11658 }
11659 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
11660 fidl::encoding::Encode<StreamBufferSetRemovePayloadBufferRequest, D> for (T0,)
11661 {
11662 #[inline]
11663 unsafe fn encode(
11664 self,
11665 encoder: &mut fidl::encoding::Encoder<'_, D>,
11666 offset: usize,
11667 depth: fidl::encoding::Depth,
11668 ) -> fidl::Result<()> {
11669 encoder.debug_check_bounds::<StreamBufferSetRemovePayloadBufferRequest>(offset);
11670 self.0.encode(encoder, offset + 0, depth)?;
11674 Ok(())
11675 }
11676 }
11677
11678 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11679 for StreamBufferSetRemovePayloadBufferRequest
11680 {
11681 #[inline(always)]
11682 fn new_empty() -> Self {
11683 Self { id: fidl::new_empty!(u32, D) }
11684 }
11685
11686 #[inline]
11687 unsafe fn decode(
11688 &mut self,
11689 decoder: &mut fidl::encoding::Decoder<'_, D>,
11690 offset: usize,
11691 _depth: fidl::encoding::Depth,
11692 ) -> fidl::Result<()> {
11693 decoder.debug_check_bounds::<Self>(offset);
11694 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
11695 unsafe {
11698 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
11699 }
11700 Ok(())
11701 }
11702 }
11703
11704 impl fidl::encoding::ValueTypeMarker for StreamPacket {
11705 type Borrowed<'a> = &'a Self;
11706 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11707 value
11708 }
11709 }
11710
11711 unsafe impl fidl::encoding::TypeMarker for StreamPacket {
11712 type Owned = Self;
11713
11714 #[inline(always)]
11715 fn inline_align(_context: fidl::encoding::Context) -> usize {
11716 8
11717 }
11718
11719 #[inline(always)]
11720 fn inline_size(_context: fidl::encoding::Context) -> usize {
11721 56
11722 }
11723 }
11724
11725 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<StreamPacket, D>
11726 for &StreamPacket
11727 {
11728 #[inline]
11729 unsafe fn encode(
11730 self,
11731 encoder: &mut fidl::encoding::Encoder<'_, D>,
11732 offset: usize,
11733 _depth: fidl::encoding::Depth,
11734 ) -> fidl::Result<()> {
11735 encoder.debug_check_bounds::<StreamPacket>(offset);
11736 unsafe {
11737 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
11739 (buf_ptr as *mut StreamPacket)
11740 .write_unaligned((self as *const StreamPacket).read());
11741 let padding_ptr = buf_ptr.offset(8) as *mut u64;
11744 let padding_mask = 0xffffffff00000000u64;
11745 padding_ptr.write_unaligned(padding_ptr.read_unaligned() & !padding_mask);
11746 let padding_ptr = buf_ptr.offset(32) as *mut u64;
11747 let padding_mask = 0xffffffff00000000u64;
11748 padding_ptr.write_unaligned(padding_ptr.read_unaligned() & !padding_mask);
11749 }
11750 Ok(())
11751 }
11752 }
11753 unsafe impl<
11754 D: fidl::encoding::ResourceDialect,
11755 T0: fidl::encoding::Encode<i64, D>,
11756 T1: fidl::encoding::Encode<u32, D>,
11757 T2: fidl::encoding::Encode<u64, D>,
11758 T3: fidl::encoding::Encode<u64, D>,
11759 T4: fidl::encoding::Encode<u32, D>,
11760 T5: fidl::encoding::Encode<u64, D>,
11761 T6: fidl::encoding::Encode<u64, D>,
11762 > fidl::encoding::Encode<StreamPacket, D> for (T0, T1, T2, T3, T4, T5, T6)
11763 {
11764 #[inline]
11765 unsafe fn encode(
11766 self,
11767 encoder: &mut fidl::encoding::Encoder<'_, D>,
11768 offset: usize,
11769 depth: fidl::encoding::Depth,
11770 ) -> fidl::Result<()> {
11771 encoder.debug_check_bounds::<StreamPacket>(offset);
11772 unsafe {
11775 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
11776 (ptr as *mut u64).write_unaligned(0);
11777 }
11778 unsafe {
11779 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
11780 (ptr as *mut u64).write_unaligned(0);
11781 }
11782 self.0.encode(encoder, offset + 0, depth)?;
11784 self.1.encode(encoder, offset + 8, depth)?;
11785 self.2.encode(encoder, offset + 16, depth)?;
11786 self.3.encode(encoder, offset + 24, depth)?;
11787 self.4.encode(encoder, offset + 32, depth)?;
11788 self.5.encode(encoder, offset + 40, depth)?;
11789 self.6.encode(encoder, offset + 48, depth)?;
11790 Ok(())
11791 }
11792 }
11793
11794 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for StreamPacket {
11795 #[inline(always)]
11796 fn new_empty() -> Self {
11797 Self {
11798 pts: fidl::new_empty!(i64, D),
11799 payload_buffer_id: fidl::new_empty!(u32, D),
11800 payload_offset: fidl::new_empty!(u64, D),
11801 payload_size: fidl::new_empty!(u64, D),
11802 flags: fidl::new_empty!(u32, D),
11803 buffer_config: fidl::new_empty!(u64, D),
11804 stream_segment_id: fidl::new_empty!(u64, D),
11805 }
11806 }
11807
11808 #[inline]
11809 unsafe fn decode(
11810 &mut self,
11811 decoder: &mut fidl::encoding::Decoder<'_, D>,
11812 offset: usize,
11813 _depth: fidl::encoding::Depth,
11814 ) -> fidl::Result<()> {
11815 decoder.debug_check_bounds::<Self>(offset);
11816 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
11817 let ptr = unsafe { buf_ptr.offset(8) };
11819 let padval = unsafe { (ptr as *const u64).read_unaligned() };
11820 let mask = 0xffffffff00000000u64;
11821 let maskedval = padval & mask;
11822 if maskedval != 0 {
11823 return Err(fidl::Error::NonZeroPadding {
11824 padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
11825 });
11826 }
11827 let ptr = unsafe { buf_ptr.offset(32) };
11828 let padval = unsafe { (ptr as *const u64).read_unaligned() };
11829 let mask = 0xffffffff00000000u64;
11830 let maskedval = padval & mask;
11831 if maskedval != 0 {
11832 return Err(fidl::Error::NonZeroPadding {
11833 padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
11834 });
11835 }
11836 unsafe {
11838 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 56);
11839 }
11840 Ok(())
11841 }
11842 }
11843
11844 impl fidl::encoding::ValueTypeMarker for StreamProcessorCloseCurrentStreamRequest {
11845 type Borrowed<'a> = &'a Self;
11846 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11847 value
11848 }
11849 }
11850
11851 unsafe impl fidl::encoding::TypeMarker for StreamProcessorCloseCurrentStreamRequest {
11852 type Owned = Self;
11853
11854 #[inline(always)]
11855 fn inline_align(_context: fidl::encoding::Context) -> usize {
11856 8
11857 }
11858
11859 #[inline(always)]
11860 fn inline_size(_context: fidl::encoding::Context) -> usize {
11861 16
11862 }
11863 }
11864
11865 unsafe impl<D: fidl::encoding::ResourceDialect>
11866 fidl::encoding::Encode<StreamProcessorCloseCurrentStreamRequest, D>
11867 for &StreamProcessorCloseCurrentStreamRequest
11868 {
11869 #[inline]
11870 unsafe fn encode(
11871 self,
11872 encoder: &mut fidl::encoding::Encoder<'_, D>,
11873 offset: usize,
11874 _depth: fidl::encoding::Depth,
11875 ) -> fidl::Result<()> {
11876 encoder.debug_check_bounds::<StreamProcessorCloseCurrentStreamRequest>(offset);
11877 fidl::encoding::Encode::<StreamProcessorCloseCurrentStreamRequest, D>::encode(
11879 (
11880 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.stream_lifetime_ordinal),
11881 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.release_input_buffers),
11882 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.release_output_buffers),
11883 ),
11884 encoder,
11885 offset,
11886 _depth,
11887 )
11888 }
11889 }
11890 unsafe impl<
11891 D: fidl::encoding::ResourceDialect,
11892 T0: fidl::encoding::Encode<u64, D>,
11893 T1: fidl::encoding::Encode<bool, D>,
11894 T2: fidl::encoding::Encode<bool, D>,
11895 > fidl::encoding::Encode<StreamProcessorCloseCurrentStreamRequest, D> for (T0, T1, T2)
11896 {
11897 #[inline]
11898 unsafe fn encode(
11899 self,
11900 encoder: &mut fidl::encoding::Encoder<'_, D>,
11901 offset: usize,
11902 depth: fidl::encoding::Depth,
11903 ) -> fidl::Result<()> {
11904 encoder.debug_check_bounds::<StreamProcessorCloseCurrentStreamRequest>(offset);
11905 unsafe {
11908 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
11909 (ptr as *mut u64).write_unaligned(0);
11910 }
11911 self.0.encode(encoder, offset + 0, depth)?;
11913 self.1.encode(encoder, offset + 8, depth)?;
11914 self.2.encode(encoder, offset + 9, depth)?;
11915 Ok(())
11916 }
11917 }
11918
11919 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11920 for StreamProcessorCloseCurrentStreamRequest
11921 {
11922 #[inline(always)]
11923 fn new_empty() -> Self {
11924 Self {
11925 stream_lifetime_ordinal: fidl::new_empty!(u64, D),
11926 release_input_buffers: fidl::new_empty!(bool, D),
11927 release_output_buffers: fidl::new_empty!(bool, D),
11928 }
11929 }
11930
11931 #[inline]
11932 unsafe fn decode(
11933 &mut self,
11934 decoder: &mut fidl::encoding::Decoder<'_, D>,
11935 offset: usize,
11936 _depth: fidl::encoding::Depth,
11937 ) -> fidl::Result<()> {
11938 decoder.debug_check_bounds::<Self>(offset);
11939 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
11941 let padval = unsafe { (ptr as *const u64).read_unaligned() };
11942 let mask = 0xffffffffffff0000u64;
11943 let maskedval = padval & mask;
11944 if maskedval != 0 {
11945 return Err(fidl::Error::NonZeroPadding {
11946 padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
11947 });
11948 }
11949 fidl::decode!(u64, D, &mut self.stream_lifetime_ordinal, decoder, offset + 0, _depth)?;
11950 fidl::decode!(bool, D, &mut self.release_input_buffers, decoder, offset + 8, _depth)?;
11951 fidl::decode!(bool, D, &mut self.release_output_buffers, decoder, offset + 9, _depth)?;
11952 Ok(())
11953 }
11954 }
11955
11956 impl fidl::encoding::ValueTypeMarker for StreamProcessorCompleteOutputBufferPartialSettingsRequest {
11957 type Borrowed<'a> = &'a Self;
11958 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11959 value
11960 }
11961 }
11962
11963 unsafe impl fidl::encoding::TypeMarker
11964 for StreamProcessorCompleteOutputBufferPartialSettingsRequest
11965 {
11966 type Owned = Self;
11967
11968 #[inline(always)]
11969 fn inline_align(_context: fidl::encoding::Context) -> usize {
11970 8
11971 }
11972
11973 #[inline(always)]
11974 fn inline_size(_context: fidl::encoding::Context) -> usize {
11975 8
11976 }
11977 #[inline(always)]
11978 fn encode_is_copy() -> bool {
11979 true
11980 }
11981
11982 #[inline(always)]
11983 fn decode_is_copy() -> bool {
11984 true
11985 }
11986 }
11987
11988 unsafe impl<D: fidl::encoding::ResourceDialect>
11989 fidl::encoding::Encode<StreamProcessorCompleteOutputBufferPartialSettingsRequest, D>
11990 for &StreamProcessorCompleteOutputBufferPartialSettingsRequest
11991 {
11992 #[inline]
11993 unsafe fn encode(
11994 self,
11995 encoder: &mut fidl::encoding::Encoder<'_, D>,
11996 offset: usize,
11997 _depth: fidl::encoding::Depth,
11998 ) -> fidl::Result<()> {
11999 encoder
12000 .debug_check_bounds::<StreamProcessorCompleteOutputBufferPartialSettingsRequest>(
12001 offset,
12002 );
12003 unsafe {
12004 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
12006 (buf_ptr as *mut StreamProcessorCompleteOutputBufferPartialSettingsRequest)
12007 .write_unaligned(
12008 (self as *const StreamProcessorCompleteOutputBufferPartialSettingsRequest)
12009 .read(),
12010 );
12011 }
12014 Ok(())
12015 }
12016 }
12017 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
12018 fidl::encoding::Encode<StreamProcessorCompleteOutputBufferPartialSettingsRequest, D>
12019 for (T0,)
12020 {
12021 #[inline]
12022 unsafe fn encode(
12023 self,
12024 encoder: &mut fidl::encoding::Encoder<'_, D>,
12025 offset: usize,
12026 depth: fidl::encoding::Depth,
12027 ) -> fidl::Result<()> {
12028 encoder
12029 .debug_check_bounds::<StreamProcessorCompleteOutputBufferPartialSettingsRequest>(
12030 offset,
12031 );
12032 self.0.encode(encoder, offset + 0, depth)?;
12036 Ok(())
12037 }
12038 }
12039
12040 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12041 for StreamProcessorCompleteOutputBufferPartialSettingsRequest
12042 {
12043 #[inline(always)]
12044 fn new_empty() -> Self {
12045 Self { buffer_lifetime_ordinal: fidl::new_empty!(u64, D) }
12046 }
12047
12048 #[inline]
12049 unsafe fn decode(
12050 &mut self,
12051 decoder: &mut fidl::encoding::Decoder<'_, D>,
12052 offset: usize,
12053 _depth: fidl::encoding::Depth,
12054 ) -> fidl::Result<()> {
12055 decoder.debug_check_bounds::<Self>(offset);
12056 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
12057 unsafe {
12060 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
12061 }
12062 Ok(())
12063 }
12064 }
12065
12066 impl fidl::encoding::ValueTypeMarker for StreamProcessorFlushEndOfStreamAndCloseStreamRequest {
12067 type Borrowed<'a> = &'a Self;
12068 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12069 value
12070 }
12071 }
12072
12073 unsafe impl fidl::encoding::TypeMarker for StreamProcessorFlushEndOfStreamAndCloseStreamRequest {
12074 type Owned = Self;
12075
12076 #[inline(always)]
12077 fn inline_align(_context: fidl::encoding::Context) -> usize {
12078 8
12079 }
12080
12081 #[inline(always)]
12082 fn inline_size(_context: fidl::encoding::Context) -> usize {
12083 8
12084 }
12085 #[inline(always)]
12086 fn encode_is_copy() -> bool {
12087 true
12088 }
12089
12090 #[inline(always)]
12091 fn decode_is_copy() -> bool {
12092 true
12093 }
12094 }
12095
12096 unsafe impl<D: fidl::encoding::ResourceDialect>
12097 fidl::encoding::Encode<StreamProcessorFlushEndOfStreamAndCloseStreamRequest, D>
12098 for &StreamProcessorFlushEndOfStreamAndCloseStreamRequest
12099 {
12100 #[inline]
12101 unsafe fn encode(
12102 self,
12103 encoder: &mut fidl::encoding::Encoder<'_, D>,
12104 offset: usize,
12105 _depth: fidl::encoding::Depth,
12106 ) -> fidl::Result<()> {
12107 encoder
12108 .debug_check_bounds::<StreamProcessorFlushEndOfStreamAndCloseStreamRequest>(offset);
12109 unsafe {
12110 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
12112 (buf_ptr as *mut StreamProcessorFlushEndOfStreamAndCloseStreamRequest)
12113 .write_unaligned(
12114 (self as *const StreamProcessorFlushEndOfStreamAndCloseStreamRequest)
12115 .read(),
12116 );
12117 }
12120 Ok(())
12121 }
12122 }
12123 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
12124 fidl::encoding::Encode<StreamProcessorFlushEndOfStreamAndCloseStreamRequest, D> for (T0,)
12125 {
12126 #[inline]
12127 unsafe fn encode(
12128 self,
12129 encoder: &mut fidl::encoding::Encoder<'_, D>,
12130 offset: usize,
12131 depth: fidl::encoding::Depth,
12132 ) -> fidl::Result<()> {
12133 encoder
12134 .debug_check_bounds::<StreamProcessorFlushEndOfStreamAndCloseStreamRequest>(offset);
12135 self.0.encode(encoder, offset + 0, depth)?;
12139 Ok(())
12140 }
12141 }
12142
12143 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12144 for StreamProcessorFlushEndOfStreamAndCloseStreamRequest
12145 {
12146 #[inline(always)]
12147 fn new_empty() -> Self {
12148 Self { stream_lifetime_ordinal: fidl::new_empty!(u64, D) }
12149 }
12150
12151 #[inline]
12152 unsafe fn decode(
12153 &mut self,
12154 decoder: &mut fidl::encoding::Decoder<'_, D>,
12155 offset: usize,
12156 _depth: fidl::encoding::Depth,
12157 ) -> fidl::Result<()> {
12158 decoder.debug_check_bounds::<Self>(offset);
12159 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
12160 unsafe {
12163 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
12164 }
12165 Ok(())
12166 }
12167 }
12168
12169 impl fidl::encoding::ValueTypeMarker for StreamProcessorOnFreeInputPacketRequest {
12170 type Borrowed<'a> = &'a Self;
12171 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12172 value
12173 }
12174 }
12175
12176 unsafe impl fidl::encoding::TypeMarker for StreamProcessorOnFreeInputPacketRequest {
12177 type Owned = Self;
12178
12179 #[inline(always)]
12180 fn inline_align(_context: fidl::encoding::Context) -> usize {
12181 8
12182 }
12183
12184 #[inline(always)]
12185 fn inline_size(_context: fidl::encoding::Context) -> usize {
12186 16
12187 }
12188 }
12189
12190 unsafe impl<D: fidl::encoding::ResourceDialect>
12191 fidl::encoding::Encode<StreamProcessorOnFreeInputPacketRequest, D>
12192 for &StreamProcessorOnFreeInputPacketRequest
12193 {
12194 #[inline]
12195 unsafe fn encode(
12196 self,
12197 encoder: &mut fidl::encoding::Encoder<'_, D>,
12198 offset: usize,
12199 _depth: fidl::encoding::Depth,
12200 ) -> fidl::Result<()> {
12201 encoder.debug_check_bounds::<StreamProcessorOnFreeInputPacketRequest>(offset);
12202 fidl::encoding::Encode::<StreamProcessorOnFreeInputPacketRequest, D>::encode(
12204 (<PacketHeader as fidl::encoding::ValueTypeMarker>::borrow(
12205 &self.free_input_packet,
12206 ),),
12207 encoder,
12208 offset,
12209 _depth,
12210 )
12211 }
12212 }
12213 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<PacketHeader, D>>
12214 fidl::encoding::Encode<StreamProcessorOnFreeInputPacketRequest, D> for (T0,)
12215 {
12216 #[inline]
12217 unsafe fn encode(
12218 self,
12219 encoder: &mut fidl::encoding::Encoder<'_, D>,
12220 offset: usize,
12221 depth: fidl::encoding::Depth,
12222 ) -> fidl::Result<()> {
12223 encoder.debug_check_bounds::<StreamProcessorOnFreeInputPacketRequest>(offset);
12224 self.0.encode(encoder, offset + 0, depth)?;
12228 Ok(())
12229 }
12230 }
12231
12232 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12233 for StreamProcessorOnFreeInputPacketRequest
12234 {
12235 #[inline(always)]
12236 fn new_empty() -> Self {
12237 Self { free_input_packet: fidl::new_empty!(PacketHeader, D) }
12238 }
12239
12240 #[inline]
12241 unsafe fn decode(
12242 &mut self,
12243 decoder: &mut fidl::encoding::Decoder<'_, D>,
12244 offset: usize,
12245 _depth: fidl::encoding::Depth,
12246 ) -> fidl::Result<()> {
12247 decoder.debug_check_bounds::<Self>(offset);
12248 fidl::decode!(
12250 PacketHeader,
12251 D,
12252 &mut self.free_input_packet,
12253 decoder,
12254 offset + 0,
12255 _depth
12256 )?;
12257 Ok(())
12258 }
12259 }
12260
12261 impl fidl::encoding::ValueTypeMarker for StreamProcessorOnInputConstraintsRequest {
12262 type Borrowed<'a> = &'a Self;
12263 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12264 value
12265 }
12266 }
12267
12268 unsafe impl fidl::encoding::TypeMarker for StreamProcessorOnInputConstraintsRequest {
12269 type Owned = Self;
12270
12271 #[inline(always)]
12272 fn inline_align(_context: fidl::encoding::Context) -> usize {
12273 8
12274 }
12275
12276 #[inline(always)]
12277 fn inline_size(_context: fidl::encoding::Context) -> usize {
12278 16
12279 }
12280 }
12281
12282 unsafe impl<D: fidl::encoding::ResourceDialect>
12283 fidl::encoding::Encode<StreamProcessorOnInputConstraintsRequest, D>
12284 for &StreamProcessorOnInputConstraintsRequest
12285 {
12286 #[inline]
12287 unsafe fn encode(
12288 self,
12289 encoder: &mut fidl::encoding::Encoder<'_, D>,
12290 offset: usize,
12291 _depth: fidl::encoding::Depth,
12292 ) -> fidl::Result<()> {
12293 encoder.debug_check_bounds::<StreamProcessorOnInputConstraintsRequest>(offset);
12294 fidl::encoding::Encode::<StreamProcessorOnInputConstraintsRequest, D>::encode(
12296 (<StreamBufferConstraints as fidl::encoding::ValueTypeMarker>::borrow(
12297 &self.input_constraints,
12298 ),),
12299 encoder,
12300 offset,
12301 _depth,
12302 )
12303 }
12304 }
12305 unsafe impl<
12306 D: fidl::encoding::ResourceDialect,
12307 T0: fidl::encoding::Encode<StreamBufferConstraints, D>,
12308 > fidl::encoding::Encode<StreamProcessorOnInputConstraintsRequest, D> for (T0,)
12309 {
12310 #[inline]
12311 unsafe fn encode(
12312 self,
12313 encoder: &mut fidl::encoding::Encoder<'_, D>,
12314 offset: usize,
12315 depth: fidl::encoding::Depth,
12316 ) -> fidl::Result<()> {
12317 encoder.debug_check_bounds::<StreamProcessorOnInputConstraintsRequest>(offset);
12318 self.0.encode(encoder, offset + 0, depth)?;
12322 Ok(())
12323 }
12324 }
12325
12326 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12327 for StreamProcessorOnInputConstraintsRequest
12328 {
12329 #[inline(always)]
12330 fn new_empty() -> Self {
12331 Self { input_constraints: fidl::new_empty!(StreamBufferConstraints, D) }
12332 }
12333
12334 #[inline]
12335 unsafe fn decode(
12336 &mut self,
12337 decoder: &mut fidl::encoding::Decoder<'_, D>,
12338 offset: usize,
12339 _depth: fidl::encoding::Depth,
12340 ) -> fidl::Result<()> {
12341 decoder.debug_check_bounds::<Self>(offset);
12342 fidl::decode!(
12344 StreamBufferConstraints,
12345 D,
12346 &mut self.input_constraints,
12347 decoder,
12348 offset + 0,
12349 _depth
12350 )?;
12351 Ok(())
12352 }
12353 }
12354
12355 impl fidl::encoding::ValueTypeMarker for StreamProcessorOnOutputConstraintsRequest {
12356 type Borrowed<'a> = &'a Self;
12357 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12358 value
12359 }
12360 }
12361
12362 unsafe impl fidl::encoding::TypeMarker for StreamProcessorOnOutputConstraintsRequest {
12363 type Owned = Self;
12364
12365 #[inline(always)]
12366 fn inline_align(_context: fidl::encoding::Context) -> usize {
12367 8
12368 }
12369
12370 #[inline(always)]
12371 fn inline_size(_context: fidl::encoding::Context) -> usize {
12372 16
12373 }
12374 }
12375
12376 unsafe impl<D: fidl::encoding::ResourceDialect>
12377 fidl::encoding::Encode<StreamProcessorOnOutputConstraintsRequest, D>
12378 for &StreamProcessorOnOutputConstraintsRequest
12379 {
12380 #[inline]
12381 unsafe fn encode(
12382 self,
12383 encoder: &mut fidl::encoding::Encoder<'_, D>,
12384 offset: usize,
12385 _depth: fidl::encoding::Depth,
12386 ) -> fidl::Result<()> {
12387 encoder.debug_check_bounds::<StreamProcessorOnOutputConstraintsRequest>(offset);
12388 fidl::encoding::Encode::<StreamProcessorOnOutputConstraintsRequest, D>::encode(
12390 (<StreamOutputConstraints as fidl::encoding::ValueTypeMarker>::borrow(
12391 &self.output_config,
12392 ),),
12393 encoder,
12394 offset,
12395 _depth,
12396 )
12397 }
12398 }
12399 unsafe impl<
12400 D: fidl::encoding::ResourceDialect,
12401 T0: fidl::encoding::Encode<StreamOutputConstraints, D>,
12402 > fidl::encoding::Encode<StreamProcessorOnOutputConstraintsRequest, D> for (T0,)
12403 {
12404 #[inline]
12405 unsafe fn encode(
12406 self,
12407 encoder: &mut fidl::encoding::Encoder<'_, D>,
12408 offset: usize,
12409 depth: fidl::encoding::Depth,
12410 ) -> fidl::Result<()> {
12411 encoder.debug_check_bounds::<StreamProcessorOnOutputConstraintsRequest>(offset);
12412 self.0.encode(encoder, offset + 0, depth)?;
12416 Ok(())
12417 }
12418 }
12419
12420 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12421 for StreamProcessorOnOutputConstraintsRequest
12422 {
12423 #[inline(always)]
12424 fn new_empty() -> Self {
12425 Self { output_config: fidl::new_empty!(StreamOutputConstraints, D) }
12426 }
12427
12428 #[inline]
12429 unsafe fn decode(
12430 &mut self,
12431 decoder: &mut fidl::encoding::Decoder<'_, D>,
12432 offset: usize,
12433 _depth: fidl::encoding::Depth,
12434 ) -> fidl::Result<()> {
12435 decoder.debug_check_bounds::<Self>(offset);
12436 fidl::decode!(
12438 StreamOutputConstraints,
12439 D,
12440 &mut self.output_config,
12441 decoder,
12442 offset + 0,
12443 _depth
12444 )?;
12445 Ok(())
12446 }
12447 }
12448
12449 impl fidl::encoding::ValueTypeMarker for StreamProcessorOnOutputEndOfStreamRequest {
12450 type Borrowed<'a> = &'a Self;
12451 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12452 value
12453 }
12454 }
12455
12456 unsafe impl fidl::encoding::TypeMarker for StreamProcessorOnOutputEndOfStreamRequest {
12457 type Owned = Self;
12458
12459 #[inline(always)]
12460 fn inline_align(_context: fidl::encoding::Context) -> usize {
12461 8
12462 }
12463
12464 #[inline(always)]
12465 fn inline_size(_context: fidl::encoding::Context) -> usize {
12466 16
12467 }
12468 }
12469
12470 unsafe impl<D: fidl::encoding::ResourceDialect>
12471 fidl::encoding::Encode<StreamProcessorOnOutputEndOfStreamRequest, D>
12472 for &StreamProcessorOnOutputEndOfStreamRequest
12473 {
12474 #[inline]
12475 unsafe fn encode(
12476 self,
12477 encoder: &mut fidl::encoding::Encoder<'_, D>,
12478 offset: usize,
12479 _depth: fidl::encoding::Depth,
12480 ) -> fidl::Result<()> {
12481 encoder.debug_check_bounds::<StreamProcessorOnOutputEndOfStreamRequest>(offset);
12482 fidl::encoding::Encode::<StreamProcessorOnOutputEndOfStreamRequest, D>::encode(
12484 (
12485 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.stream_lifetime_ordinal),
12486 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.error_detected_before),
12487 ),
12488 encoder,
12489 offset,
12490 _depth,
12491 )
12492 }
12493 }
12494 unsafe impl<
12495 D: fidl::encoding::ResourceDialect,
12496 T0: fidl::encoding::Encode<u64, D>,
12497 T1: fidl::encoding::Encode<bool, D>,
12498 > fidl::encoding::Encode<StreamProcessorOnOutputEndOfStreamRequest, D> for (T0, T1)
12499 {
12500 #[inline]
12501 unsafe fn encode(
12502 self,
12503 encoder: &mut fidl::encoding::Encoder<'_, D>,
12504 offset: usize,
12505 depth: fidl::encoding::Depth,
12506 ) -> fidl::Result<()> {
12507 encoder.debug_check_bounds::<StreamProcessorOnOutputEndOfStreamRequest>(offset);
12508 unsafe {
12511 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
12512 (ptr as *mut u64).write_unaligned(0);
12513 }
12514 self.0.encode(encoder, offset + 0, depth)?;
12516 self.1.encode(encoder, offset + 8, depth)?;
12517 Ok(())
12518 }
12519 }
12520
12521 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12522 for StreamProcessorOnOutputEndOfStreamRequest
12523 {
12524 #[inline(always)]
12525 fn new_empty() -> Self {
12526 Self {
12527 stream_lifetime_ordinal: fidl::new_empty!(u64, D),
12528 error_detected_before: fidl::new_empty!(bool, D),
12529 }
12530 }
12531
12532 #[inline]
12533 unsafe fn decode(
12534 &mut self,
12535 decoder: &mut fidl::encoding::Decoder<'_, D>,
12536 offset: usize,
12537 _depth: fidl::encoding::Depth,
12538 ) -> fidl::Result<()> {
12539 decoder.debug_check_bounds::<Self>(offset);
12540 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
12542 let padval = unsafe { (ptr as *const u64).read_unaligned() };
12543 let mask = 0xffffffffffffff00u64;
12544 let maskedval = padval & mask;
12545 if maskedval != 0 {
12546 return Err(fidl::Error::NonZeroPadding {
12547 padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
12548 });
12549 }
12550 fidl::decode!(u64, D, &mut self.stream_lifetime_ordinal, decoder, offset + 0, _depth)?;
12551 fidl::decode!(bool, D, &mut self.error_detected_before, decoder, offset + 8, _depth)?;
12552 Ok(())
12553 }
12554 }
12555
12556 impl fidl::encoding::ValueTypeMarker for StreamProcessorOnOutputFormatRequest {
12557 type Borrowed<'a> = &'a Self;
12558 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12559 value
12560 }
12561 }
12562
12563 unsafe impl fidl::encoding::TypeMarker for StreamProcessorOnOutputFormatRequest {
12564 type Owned = Self;
12565
12566 #[inline(always)]
12567 fn inline_align(_context: fidl::encoding::Context) -> usize {
12568 8
12569 }
12570
12571 #[inline(always)]
12572 fn inline_size(_context: fidl::encoding::Context) -> usize {
12573 16
12574 }
12575 }
12576
12577 unsafe impl<D: fidl::encoding::ResourceDialect>
12578 fidl::encoding::Encode<StreamProcessorOnOutputFormatRequest, D>
12579 for &StreamProcessorOnOutputFormatRequest
12580 {
12581 #[inline]
12582 unsafe fn encode(
12583 self,
12584 encoder: &mut fidl::encoding::Encoder<'_, D>,
12585 offset: usize,
12586 _depth: fidl::encoding::Depth,
12587 ) -> fidl::Result<()> {
12588 encoder.debug_check_bounds::<StreamProcessorOnOutputFormatRequest>(offset);
12589 fidl::encoding::Encode::<StreamProcessorOnOutputFormatRequest, D>::encode(
12591 (<StreamOutputFormat as fidl::encoding::ValueTypeMarker>::borrow(
12592 &self.output_format,
12593 ),),
12594 encoder,
12595 offset,
12596 _depth,
12597 )
12598 }
12599 }
12600 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<StreamOutputFormat, D>>
12601 fidl::encoding::Encode<StreamProcessorOnOutputFormatRequest, D> for (T0,)
12602 {
12603 #[inline]
12604 unsafe fn encode(
12605 self,
12606 encoder: &mut fidl::encoding::Encoder<'_, D>,
12607 offset: usize,
12608 depth: fidl::encoding::Depth,
12609 ) -> fidl::Result<()> {
12610 encoder.debug_check_bounds::<StreamProcessorOnOutputFormatRequest>(offset);
12611 self.0.encode(encoder, offset + 0, depth)?;
12615 Ok(())
12616 }
12617 }
12618
12619 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12620 for StreamProcessorOnOutputFormatRequest
12621 {
12622 #[inline(always)]
12623 fn new_empty() -> Self {
12624 Self { output_format: fidl::new_empty!(StreamOutputFormat, D) }
12625 }
12626
12627 #[inline]
12628 unsafe fn decode(
12629 &mut self,
12630 decoder: &mut fidl::encoding::Decoder<'_, D>,
12631 offset: usize,
12632 _depth: fidl::encoding::Depth,
12633 ) -> fidl::Result<()> {
12634 decoder.debug_check_bounds::<Self>(offset);
12635 fidl::decode!(
12637 StreamOutputFormat,
12638 D,
12639 &mut self.output_format,
12640 decoder,
12641 offset + 0,
12642 _depth
12643 )?;
12644 Ok(())
12645 }
12646 }
12647
12648 impl fidl::encoding::ValueTypeMarker for StreamProcessorOnOutputPacketRequest {
12649 type Borrowed<'a> = &'a Self;
12650 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12651 value
12652 }
12653 }
12654
12655 unsafe impl fidl::encoding::TypeMarker for StreamProcessorOnOutputPacketRequest {
12656 type Owned = Self;
12657
12658 #[inline(always)]
12659 fn inline_align(_context: fidl::encoding::Context) -> usize {
12660 8
12661 }
12662
12663 #[inline(always)]
12664 fn inline_size(_context: fidl::encoding::Context) -> usize {
12665 24
12666 }
12667 }
12668
12669 unsafe impl<D: fidl::encoding::ResourceDialect>
12670 fidl::encoding::Encode<StreamProcessorOnOutputPacketRequest, D>
12671 for &StreamProcessorOnOutputPacketRequest
12672 {
12673 #[inline]
12674 unsafe fn encode(
12675 self,
12676 encoder: &mut fidl::encoding::Encoder<'_, D>,
12677 offset: usize,
12678 _depth: fidl::encoding::Depth,
12679 ) -> fidl::Result<()> {
12680 encoder.debug_check_bounds::<StreamProcessorOnOutputPacketRequest>(offset);
12681 fidl::encoding::Encode::<StreamProcessorOnOutputPacketRequest, D>::encode(
12683 (
12684 <Packet as fidl::encoding::ValueTypeMarker>::borrow(&self.output_packet),
12685 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.error_detected_before),
12686 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.error_detected_during),
12687 ),
12688 encoder,
12689 offset,
12690 _depth,
12691 )
12692 }
12693 }
12694 unsafe impl<
12695 D: fidl::encoding::ResourceDialect,
12696 T0: fidl::encoding::Encode<Packet, D>,
12697 T1: fidl::encoding::Encode<bool, D>,
12698 T2: fidl::encoding::Encode<bool, D>,
12699 > fidl::encoding::Encode<StreamProcessorOnOutputPacketRequest, D> for (T0, T1, T2)
12700 {
12701 #[inline]
12702 unsafe fn encode(
12703 self,
12704 encoder: &mut fidl::encoding::Encoder<'_, D>,
12705 offset: usize,
12706 depth: fidl::encoding::Depth,
12707 ) -> fidl::Result<()> {
12708 encoder.debug_check_bounds::<StreamProcessorOnOutputPacketRequest>(offset);
12709 unsafe {
12712 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
12713 (ptr as *mut u64).write_unaligned(0);
12714 }
12715 self.0.encode(encoder, offset + 0, depth)?;
12717 self.1.encode(encoder, offset + 16, depth)?;
12718 self.2.encode(encoder, offset + 17, depth)?;
12719 Ok(())
12720 }
12721 }
12722
12723 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12724 for StreamProcessorOnOutputPacketRequest
12725 {
12726 #[inline(always)]
12727 fn new_empty() -> Self {
12728 Self {
12729 output_packet: fidl::new_empty!(Packet, D),
12730 error_detected_before: fidl::new_empty!(bool, D),
12731 error_detected_during: fidl::new_empty!(bool, D),
12732 }
12733 }
12734
12735 #[inline]
12736 unsafe fn decode(
12737 &mut self,
12738 decoder: &mut fidl::encoding::Decoder<'_, D>,
12739 offset: usize,
12740 _depth: fidl::encoding::Depth,
12741 ) -> fidl::Result<()> {
12742 decoder.debug_check_bounds::<Self>(offset);
12743 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
12745 let padval = unsafe { (ptr as *const u64).read_unaligned() };
12746 let mask = 0xffffffffffff0000u64;
12747 let maskedval = padval & mask;
12748 if maskedval != 0 {
12749 return Err(fidl::Error::NonZeroPadding {
12750 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
12751 });
12752 }
12753 fidl::decode!(Packet, D, &mut self.output_packet, decoder, offset + 0, _depth)?;
12754 fidl::decode!(bool, D, &mut self.error_detected_before, decoder, offset + 16, _depth)?;
12755 fidl::decode!(bool, D, &mut self.error_detected_during, decoder, offset + 17, _depth)?;
12756 Ok(())
12757 }
12758 }
12759
12760 impl fidl::encoding::ValueTypeMarker for StreamProcessorOnStreamFailedRequest {
12761 type Borrowed<'a> = &'a Self;
12762 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12763 value
12764 }
12765 }
12766
12767 unsafe impl fidl::encoding::TypeMarker for StreamProcessorOnStreamFailedRequest {
12768 type Owned = Self;
12769
12770 #[inline(always)]
12771 fn inline_align(_context: fidl::encoding::Context) -> usize {
12772 8
12773 }
12774
12775 #[inline(always)]
12776 fn inline_size(_context: fidl::encoding::Context) -> usize {
12777 16
12778 }
12779 }
12780
12781 unsafe impl<D: fidl::encoding::ResourceDialect>
12782 fidl::encoding::Encode<StreamProcessorOnStreamFailedRequest, D>
12783 for &StreamProcessorOnStreamFailedRequest
12784 {
12785 #[inline]
12786 unsafe fn encode(
12787 self,
12788 encoder: &mut fidl::encoding::Encoder<'_, D>,
12789 offset: usize,
12790 _depth: fidl::encoding::Depth,
12791 ) -> fidl::Result<()> {
12792 encoder.debug_check_bounds::<StreamProcessorOnStreamFailedRequest>(offset);
12793 fidl::encoding::Encode::<StreamProcessorOnStreamFailedRequest, D>::encode(
12795 (
12796 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.stream_lifetime_ordinal),
12797 <StreamError as fidl::encoding::ValueTypeMarker>::borrow(&self.error),
12798 ),
12799 encoder,
12800 offset,
12801 _depth,
12802 )
12803 }
12804 }
12805 unsafe impl<
12806 D: fidl::encoding::ResourceDialect,
12807 T0: fidl::encoding::Encode<u64, D>,
12808 T1: fidl::encoding::Encode<StreamError, D>,
12809 > fidl::encoding::Encode<StreamProcessorOnStreamFailedRequest, D> for (T0, T1)
12810 {
12811 #[inline]
12812 unsafe fn encode(
12813 self,
12814 encoder: &mut fidl::encoding::Encoder<'_, D>,
12815 offset: usize,
12816 depth: fidl::encoding::Depth,
12817 ) -> fidl::Result<()> {
12818 encoder.debug_check_bounds::<StreamProcessorOnStreamFailedRequest>(offset);
12819 unsafe {
12822 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
12823 (ptr as *mut u64).write_unaligned(0);
12824 }
12825 self.0.encode(encoder, offset + 0, depth)?;
12827 self.1.encode(encoder, offset + 8, depth)?;
12828 Ok(())
12829 }
12830 }
12831
12832 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12833 for StreamProcessorOnStreamFailedRequest
12834 {
12835 #[inline(always)]
12836 fn new_empty() -> Self {
12837 Self {
12838 stream_lifetime_ordinal: fidl::new_empty!(u64, D),
12839 error: fidl::new_empty!(StreamError, D),
12840 }
12841 }
12842
12843 #[inline]
12844 unsafe fn decode(
12845 &mut self,
12846 decoder: &mut fidl::encoding::Decoder<'_, D>,
12847 offset: usize,
12848 _depth: fidl::encoding::Depth,
12849 ) -> fidl::Result<()> {
12850 decoder.debug_check_bounds::<Self>(offset);
12851 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
12853 let padval = unsafe { (ptr as *const u64).read_unaligned() };
12854 let mask = 0xffffffff00000000u64;
12855 let maskedval = padval & mask;
12856 if maskedval != 0 {
12857 return Err(fidl::Error::NonZeroPadding {
12858 padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
12859 });
12860 }
12861 fidl::decode!(u64, D, &mut self.stream_lifetime_ordinal, decoder, offset + 0, _depth)?;
12862 fidl::decode!(StreamError, D, &mut self.error, decoder, offset + 8, _depth)?;
12863 Ok(())
12864 }
12865 }
12866
12867 impl fidl::encoding::ValueTypeMarker for StreamProcessorQueueInputEndOfStreamRequest {
12868 type Borrowed<'a> = &'a Self;
12869 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12870 value
12871 }
12872 }
12873
12874 unsafe impl fidl::encoding::TypeMarker for StreamProcessorQueueInputEndOfStreamRequest {
12875 type Owned = Self;
12876
12877 #[inline(always)]
12878 fn inline_align(_context: fidl::encoding::Context) -> usize {
12879 8
12880 }
12881
12882 #[inline(always)]
12883 fn inline_size(_context: fidl::encoding::Context) -> usize {
12884 8
12885 }
12886 #[inline(always)]
12887 fn encode_is_copy() -> bool {
12888 true
12889 }
12890
12891 #[inline(always)]
12892 fn decode_is_copy() -> bool {
12893 true
12894 }
12895 }
12896
12897 unsafe impl<D: fidl::encoding::ResourceDialect>
12898 fidl::encoding::Encode<StreamProcessorQueueInputEndOfStreamRequest, D>
12899 for &StreamProcessorQueueInputEndOfStreamRequest
12900 {
12901 #[inline]
12902 unsafe fn encode(
12903 self,
12904 encoder: &mut fidl::encoding::Encoder<'_, D>,
12905 offset: usize,
12906 _depth: fidl::encoding::Depth,
12907 ) -> fidl::Result<()> {
12908 encoder.debug_check_bounds::<StreamProcessorQueueInputEndOfStreamRequest>(offset);
12909 unsafe {
12910 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
12912 (buf_ptr as *mut StreamProcessorQueueInputEndOfStreamRequest).write_unaligned(
12913 (self as *const StreamProcessorQueueInputEndOfStreamRequest).read(),
12914 );
12915 }
12918 Ok(())
12919 }
12920 }
12921 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
12922 fidl::encoding::Encode<StreamProcessorQueueInputEndOfStreamRequest, D> for (T0,)
12923 {
12924 #[inline]
12925 unsafe fn encode(
12926 self,
12927 encoder: &mut fidl::encoding::Encoder<'_, D>,
12928 offset: usize,
12929 depth: fidl::encoding::Depth,
12930 ) -> fidl::Result<()> {
12931 encoder.debug_check_bounds::<StreamProcessorQueueInputEndOfStreamRequest>(offset);
12932 self.0.encode(encoder, offset + 0, depth)?;
12936 Ok(())
12937 }
12938 }
12939
12940 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12941 for StreamProcessorQueueInputEndOfStreamRequest
12942 {
12943 #[inline(always)]
12944 fn new_empty() -> Self {
12945 Self { stream_lifetime_ordinal: fidl::new_empty!(u64, D) }
12946 }
12947
12948 #[inline]
12949 unsafe fn decode(
12950 &mut self,
12951 decoder: &mut fidl::encoding::Decoder<'_, D>,
12952 offset: usize,
12953 _depth: fidl::encoding::Depth,
12954 ) -> fidl::Result<()> {
12955 decoder.debug_check_bounds::<Self>(offset);
12956 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
12957 unsafe {
12960 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
12961 }
12962 Ok(())
12963 }
12964 }
12965
12966 impl fidl::encoding::ValueTypeMarker for StreamProcessorQueueInputFormatDetailsRequest {
12967 type Borrowed<'a> = &'a Self;
12968 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12969 value
12970 }
12971 }
12972
12973 unsafe impl fidl::encoding::TypeMarker for StreamProcessorQueueInputFormatDetailsRequest {
12974 type Owned = Self;
12975
12976 #[inline(always)]
12977 fn inline_align(_context: fidl::encoding::Context) -> usize {
12978 8
12979 }
12980
12981 #[inline(always)]
12982 fn inline_size(_context: fidl::encoding::Context) -> usize {
12983 24
12984 }
12985 }
12986
12987 unsafe impl<D: fidl::encoding::ResourceDialect>
12988 fidl::encoding::Encode<StreamProcessorQueueInputFormatDetailsRequest, D>
12989 for &StreamProcessorQueueInputFormatDetailsRequest
12990 {
12991 #[inline]
12992 unsafe fn encode(
12993 self,
12994 encoder: &mut fidl::encoding::Encoder<'_, D>,
12995 offset: usize,
12996 _depth: fidl::encoding::Depth,
12997 ) -> fidl::Result<()> {
12998 encoder.debug_check_bounds::<StreamProcessorQueueInputFormatDetailsRequest>(offset);
12999 fidl::encoding::Encode::<StreamProcessorQueueInputFormatDetailsRequest, D>::encode(
13001 (
13002 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.stream_lifetime_ordinal),
13003 <FormatDetails as fidl::encoding::ValueTypeMarker>::borrow(
13004 &self.format_details,
13005 ),
13006 ),
13007 encoder,
13008 offset,
13009 _depth,
13010 )
13011 }
13012 }
13013 unsafe impl<
13014 D: fidl::encoding::ResourceDialect,
13015 T0: fidl::encoding::Encode<u64, D>,
13016 T1: fidl::encoding::Encode<FormatDetails, D>,
13017 > fidl::encoding::Encode<StreamProcessorQueueInputFormatDetailsRequest, D> for (T0, T1)
13018 {
13019 #[inline]
13020 unsafe fn encode(
13021 self,
13022 encoder: &mut fidl::encoding::Encoder<'_, D>,
13023 offset: usize,
13024 depth: fidl::encoding::Depth,
13025 ) -> fidl::Result<()> {
13026 encoder.debug_check_bounds::<StreamProcessorQueueInputFormatDetailsRequest>(offset);
13027 self.0.encode(encoder, offset + 0, depth)?;
13031 self.1.encode(encoder, offset + 8, depth)?;
13032 Ok(())
13033 }
13034 }
13035
13036 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
13037 for StreamProcessorQueueInputFormatDetailsRequest
13038 {
13039 #[inline(always)]
13040 fn new_empty() -> Self {
13041 Self {
13042 stream_lifetime_ordinal: fidl::new_empty!(u64, D),
13043 format_details: fidl::new_empty!(FormatDetails, D),
13044 }
13045 }
13046
13047 #[inline]
13048 unsafe fn decode(
13049 &mut self,
13050 decoder: &mut fidl::encoding::Decoder<'_, D>,
13051 offset: usize,
13052 _depth: fidl::encoding::Depth,
13053 ) -> fidl::Result<()> {
13054 decoder.debug_check_bounds::<Self>(offset);
13055 fidl::decode!(u64, D, &mut self.stream_lifetime_ordinal, decoder, offset + 0, _depth)?;
13057 fidl::decode!(FormatDetails, D, &mut self.format_details, decoder, offset + 8, _depth)?;
13058 Ok(())
13059 }
13060 }
13061
13062 impl fidl::encoding::ValueTypeMarker for StreamProcessorQueueInputPacketRequest {
13063 type Borrowed<'a> = &'a Self;
13064 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13065 value
13066 }
13067 }
13068
13069 unsafe impl fidl::encoding::TypeMarker for StreamProcessorQueueInputPacketRequest {
13070 type Owned = Self;
13071
13072 #[inline(always)]
13073 fn inline_align(_context: fidl::encoding::Context) -> usize {
13074 8
13075 }
13076
13077 #[inline(always)]
13078 fn inline_size(_context: fidl::encoding::Context) -> usize {
13079 16
13080 }
13081 }
13082
13083 unsafe impl<D: fidl::encoding::ResourceDialect>
13084 fidl::encoding::Encode<StreamProcessorQueueInputPacketRequest, D>
13085 for &StreamProcessorQueueInputPacketRequest
13086 {
13087 #[inline]
13088 unsafe fn encode(
13089 self,
13090 encoder: &mut fidl::encoding::Encoder<'_, D>,
13091 offset: usize,
13092 _depth: fidl::encoding::Depth,
13093 ) -> fidl::Result<()> {
13094 encoder.debug_check_bounds::<StreamProcessorQueueInputPacketRequest>(offset);
13095 fidl::encoding::Encode::<StreamProcessorQueueInputPacketRequest, D>::encode(
13097 (<Packet as fidl::encoding::ValueTypeMarker>::borrow(&self.packet),),
13098 encoder,
13099 offset,
13100 _depth,
13101 )
13102 }
13103 }
13104 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Packet, D>>
13105 fidl::encoding::Encode<StreamProcessorQueueInputPacketRequest, D> for (T0,)
13106 {
13107 #[inline]
13108 unsafe fn encode(
13109 self,
13110 encoder: &mut fidl::encoding::Encoder<'_, D>,
13111 offset: usize,
13112 depth: fidl::encoding::Depth,
13113 ) -> fidl::Result<()> {
13114 encoder.debug_check_bounds::<StreamProcessorQueueInputPacketRequest>(offset);
13115 self.0.encode(encoder, offset + 0, depth)?;
13119 Ok(())
13120 }
13121 }
13122
13123 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
13124 for StreamProcessorQueueInputPacketRequest
13125 {
13126 #[inline(always)]
13127 fn new_empty() -> Self {
13128 Self { packet: fidl::new_empty!(Packet, D) }
13129 }
13130
13131 #[inline]
13132 unsafe fn decode(
13133 &mut self,
13134 decoder: &mut fidl::encoding::Decoder<'_, D>,
13135 offset: usize,
13136 _depth: fidl::encoding::Depth,
13137 ) -> fidl::Result<()> {
13138 decoder.debug_check_bounds::<Self>(offset);
13139 fidl::decode!(Packet, D, &mut self.packet, decoder, offset + 0, _depth)?;
13141 Ok(())
13142 }
13143 }
13144
13145 impl fidl::encoding::ValueTypeMarker for StreamProcessorRecycleOutputPacketRequest {
13146 type Borrowed<'a> = &'a Self;
13147 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13148 value
13149 }
13150 }
13151
13152 unsafe impl fidl::encoding::TypeMarker for StreamProcessorRecycleOutputPacketRequest {
13153 type Owned = Self;
13154
13155 #[inline(always)]
13156 fn inline_align(_context: fidl::encoding::Context) -> usize {
13157 8
13158 }
13159
13160 #[inline(always)]
13161 fn inline_size(_context: fidl::encoding::Context) -> usize {
13162 16
13163 }
13164 }
13165
13166 unsafe impl<D: fidl::encoding::ResourceDialect>
13167 fidl::encoding::Encode<StreamProcessorRecycleOutputPacketRequest, D>
13168 for &StreamProcessorRecycleOutputPacketRequest
13169 {
13170 #[inline]
13171 unsafe fn encode(
13172 self,
13173 encoder: &mut fidl::encoding::Encoder<'_, D>,
13174 offset: usize,
13175 _depth: fidl::encoding::Depth,
13176 ) -> fidl::Result<()> {
13177 encoder.debug_check_bounds::<StreamProcessorRecycleOutputPacketRequest>(offset);
13178 fidl::encoding::Encode::<StreamProcessorRecycleOutputPacketRequest, D>::encode(
13180 (<PacketHeader as fidl::encoding::ValueTypeMarker>::borrow(
13181 &self.available_output_packet,
13182 ),),
13183 encoder,
13184 offset,
13185 _depth,
13186 )
13187 }
13188 }
13189 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<PacketHeader, D>>
13190 fidl::encoding::Encode<StreamProcessorRecycleOutputPacketRequest, D> for (T0,)
13191 {
13192 #[inline]
13193 unsafe fn encode(
13194 self,
13195 encoder: &mut fidl::encoding::Encoder<'_, D>,
13196 offset: usize,
13197 depth: fidl::encoding::Depth,
13198 ) -> fidl::Result<()> {
13199 encoder.debug_check_bounds::<StreamProcessorRecycleOutputPacketRequest>(offset);
13200 self.0.encode(encoder, offset + 0, depth)?;
13204 Ok(())
13205 }
13206 }
13207
13208 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
13209 for StreamProcessorRecycleOutputPacketRequest
13210 {
13211 #[inline(always)]
13212 fn new_empty() -> Self {
13213 Self { available_output_packet: fidl::new_empty!(PacketHeader, D) }
13214 }
13215
13216 #[inline]
13217 unsafe fn decode(
13218 &mut self,
13219 decoder: &mut fidl::encoding::Decoder<'_, D>,
13220 offset: usize,
13221 _depth: fidl::encoding::Depth,
13222 ) -> fidl::Result<()> {
13223 decoder.debug_check_bounds::<Self>(offset);
13224 fidl::decode!(
13226 PacketHeader,
13227 D,
13228 &mut self.available_output_packet,
13229 decoder,
13230 offset + 0,
13231 _depth
13232 )?;
13233 Ok(())
13234 }
13235 }
13236
13237 impl fidl::encoding::ValueTypeMarker for StreamSinkSendPacketNoReplyRequest {
13238 type Borrowed<'a> = &'a Self;
13239 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13240 value
13241 }
13242 }
13243
13244 unsafe impl fidl::encoding::TypeMarker for StreamSinkSendPacketNoReplyRequest {
13245 type Owned = Self;
13246
13247 #[inline(always)]
13248 fn inline_align(_context: fidl::encoding::Context) -> usize {
13249 8
13250 }
13251
13252 #[inline(always)]
13253 fn inline_size(_context: fidl::encoding::Context) -> usize {
13254 56
13255 }
13256 }
13257
13258 unsafe impl<D: fidl::encoding::ResourceDialect>
13259 fidl::encoding::Encode<StreamSinkSendPacketNoReplyRequest, D>
13260 for &StreamSinkSendPacketNoReplyRequest
13261 {
13262 #[inline]
13263 unsafe fn encode(
13264 self,
13265 encoder: &mut fidl::encoding::Encoder<'_, D>,
13266 offset: usize,
13267 _depth: fidl::encoding::Depth,
13268 ) -> fidl::Result<()> {
13269 encoder.debug_check_bounds::<StreamSinkSendPacketNoReplyRequest>(offset);
13270 unsafe {
13271 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
13273 (buf_ptr as *mut StreamSinkSendPacketNoReplyRequest)
13274 .write_unaligned((self as *const StreamSinkSendPacketNoReplyRequest).read());
13275 let padding_ptr = buf_ptr.offset(8) as *mut u64;
13278 let padding_mask = 0xffffffff00000000u64;
13279 padding_ptr.write_unaligned(padding_ptr.read_unaligned() & !padding_mask);
13280 let padding_ptr = buf_ptr.offset(32) as *mut u64;
13281 let padding_mask = 0xffffffff00000000u64;
13282 padding_ptr.write_unaligned(padding_ptr.read_unaligned() & !padding_mask);
13283 }
13284 Ok(())
13285 }
13286 }
13287 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<StreamPacket, D>>
13288 fidl::encoding::Encode<StreamSinkSendPacketNoReplyRequest, D> for (T0,)
13289 {
13290 #[inline]
13291 unsafe fn encode(
13292 self,
13293 encoder: &mut fidl::encoding::Encoder<'_, D>,
13294 offset: usize,
13295 depth: fidl::encoding::Depth,
13296 ) -> fidl::Result<()> {
13297 encoder.debug_check_bounds::<StreamSinkSendPacketNoReplyRequest>(offset);
13298 self.0.encode(encoder, offset + 0, depth)?;
13302 Ok(())
13303 }
13304 }
13305
13306 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
13307 for StreamSinkSendPacketNoReplyRequest
13308 {
13309 #[inline(always)]
13310 fn new_empty() -> Self {
13311 Self { packet: fidl::new_empty!(StreamPacket, D) }
13312 }
13313
13314 #[inline]
13315 unsafe fn decode(
13316 &mut self,
13317 decoder: &mut fidl::encoding::Decoder<'_, D>,
13318 offset: usize,
13319 _depth: fidl::encoding::Depth,
13320 ) -> fidl::Result<()> {
13321 decoder.debug_check_bounds::<Self>(offset);
13322 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
13323 let ptr = unsafe { buf_ptr.offset(8) };
13325 let padval = unsafe { (ptr as *const u64).read_unaligned() };
13326 let mask = 0xffffffff00000000u64;
13327 let maskedval = padval & mask;
13328 if maskedval != 0 {
13329 return Err(fidl::Error::NonZeroPadding {
13330 padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
13331 });
13332 }
13333 let ptr = unsafe { buf_ptr.offset(32) };
13334 let padval = unsafe { (ptr as *const u64).read_unaligned() };
13335 let mask = 0xffffffff00000000u64;
13336 let maskedval = padval & mask;
13337 if maskedval != 0 {
13338 return Err(fidl::Error::NonZeroPadding {
13339 padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
13340 });
13341 }
13342 unsafe {
13344 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 56);
13345 }
13346 Ok(())
13347 }
13348 }
13349
13350 impl fidl::encoding::ValueTypeMarker for StreamSinkSendPacketRequest {
13351 type Borrowed<'a> = &'a Self;
13352 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13353 value
13354 }
13355 }
13356
13357 unsafe impl fidl::encoding::TypeMarker for StreamSinkSendPacketRequest {
13358 type Owned = Self;
13359
13360 #[inline(always)]
13361 fn inline_align(_context: fidl::encoding::Context) -> usize {
13362 8
13363 }
13364
13365 #[inline(always)]
13366 fn inline_size(_context: fidl::encoding::Context) -> usize {
13367 56
13368 }
13369 }
13370
13371 unsafe impl<D: fidl::encoding::ResourceDialect>
13372 fidl::encoding::Encode<StreamSinkSendPacketRequest, D> for &StreamSinkSendPacketRequest
13373 {
13374 #[inline]
13375 unsafe fn encode(
13376 self,
13377 encoder: &mut fidl::encoding::Encoder<'_, D>,
13378 offset: usize,
13379 _depth: fidl::encoding::Depth,
13380 ) -> fidl::Result<()> {
13381 encoder.debug_check_bounds::<StreamSinkSendPacketRequest>(offset);
13382 unsafe {
13383 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
13385 (buf_ptr as *mut StreamSinkSendPacketRequest)
13386 .write_unaligned((self as *const StreamSinkSendPacketRequest).read());
13387 let padding_ptr = buf_ptr.offset(8) as *mut u64;
13390 let padding_mask = 0xffffffff00000000u64;
13391 padding_ptr.write_unaligned(padding_ptr.read_unaligned() & !padding_mask);
13392 let padding_ptr = buf_ptr.offset(32) as *mut u64;
13393 let padding_mask = 0xffffffff00000000u64;
13394 padding_ptr.write_unaligned(padding_ptr.read_unaligned() & !padding_mask);
13395 }
13396 Ok(())
13397 }
13398 }
13399 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<StreamPacket, D>>
13400 fidl::encoding::Encode<StreamSinkSendPacketRequest, D> for (T0,)
13401 {
13402 #[inline]
13403 unsafe fn encode(
13404 self,
13405 encoder: &mut fidl::encoding::Encoder<'_, D>,
13406 offset: usize,
13407 depth: fidl::encoding::Depth,
13408 ) -> fidl::Result<()> {
13409 encoder.debug_check_bounds::<StreamSinkSendPacketRequest>(offset);
13410 self.0.encode(encoder, offset + 0, depth)?;
13414 Ok(())
13415 }
13416 }
13417
13418 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
13419 for StreamSinkSendPacketRequest
13420 {
13421 #[inline(always)]
13422 fn new_empty() -> Self {
13423 Self { packet: fidl::new_empty!(StreamPacket, D) }
13424 }
13425
13426 #[inline]
13427 unsafe fn decode(
13428 &mut self,
13429 decoder: &mut fidl::encoding::Decoder<'_, D>,
13430 offset: usize,
13431 _depth: fidl::encoding::Depth,
13432 ) -> fidl::Result<()> {
13433 decoder.debug_check_bounds::<Self>(offset);
13434 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
13435 let ptr = unsafe { buf_ptr.offset(8) };
13437 let padval = unsafe { (ptr as *const u64).read_unaligned() };
13438 let mask = 0xffffffff00000000u64;
13439 let maskedval = padval & mask;
13440 if maskedval != 0 {
13441 return Err(fidl::Error::NonZeroPadding {
13442 padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
13443 });
13444 }
13445 let ptr = unsafe { buf_ptr.offset(32) };
13446 let padval = unsafe { (ptr as *const u64).read_unaligned() };
13447 let mask = 0xffffffff00000000u64;
13448 let maskedval = padval & mask;
13449 if maskedval != 0 {
13450 return Err(fidl::Error::NonZeroPadding {
13451 padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
13452 });
13453 }
13454 unsafe {
13456 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 56);
13457 }
13458 Ok(())
13459 }
13460 }
13461
13462 impl fidl::encoding::ValueTypeMarker for StreamSourceOnPacketProducedRequest {
13463 type Borrowed<'a> = &'a Self;
13464 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13465 value
13466 }
13467 }
13468
13469 unsafe impl fidl::encoding::TypeMarker for StreamSourceOnPacketProducedRequest {
13470 type Owned = Self;
13471
13472 #[inline(always)]
13473 fn inline_align(_context: fidl::encoding::Context) -> usize {
13474 8
13475 }
13476
13477 #[inline(always)]
13478 fn inline_size(_context: fidl::encoding::Context) -> usize {
13479 56
13480 }
13481 }
13482
13483 unsafe impl<D: fidl::encoding::ResourceDialect>
13484 fidl::encoding::Encode<StreamSourceOnPacketProducedRequest, D>
13485 for &StreamSourceOnPacketProducedRequest
13486 {
13487 #[inline]
13488 unsafe fn encode(
13489 self,
13490 encoder: &mut fidl::encoding::Encoder<'_, D>,
13491 offset: usize,
13492 _depth: fidl::encoding::Depth,
13493 ) -> fidl::Result<()> {
13494 encoder.debug_check_bounds::<StreamSourceOnPacketProducedRequest>(offset);
13495 unsafe {
13496 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
13498 (buf_ptr as *mut StreamSourceOnPacketProducedRequest)
13499 .write_unaligned((self as *const StreamSourceOnPacketProducedRequest).read());
13500 let padding_ptr = buf_ptr.offset(8) as *mut u64;
13503 let padding_mask = 0xffffffff00000000u64;
13504 padding_ptr.write_unaligned(padding_ptr.read_unaligned() & !padding_mask);
13505 let padding_ptr = buf_ptr.offset(32) as *mut u64;
13506 let padding_mask = 0xffffffff00000000u64;
13507 padding_ptr.write_unaligned(padding_ptr.read_unaligned() & !padding_mask);
13508 }
13509 Ok(())
13510 }
13511 }
13512 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<StreamPacket, D>>
13513 fidl::encoding::Encode<StreamSourceOnPacketProducedRequest, D> for (T0,)
13514 {
13515 #[inline]
13516 unsafe fn encode(
13517 self,
13518 encoder: &mut fidl::encoding::Encoder<'_, D>,
13519 offset: usize,
13520 depth: fidl::encoding::Depth,
13521 ) -> fidl::Result<()> {
13522 encoder.debug_check_bounds::<StreamSourceOnPacketProducedRequest>(offset);
13523 self.0.encode(encoder, offset + 0, depth)?;
13527 Ok(())
13528 }
13529 }
13530
13531 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
13532 for StreamSourceOnPacketProducedRequest
13533 {
13534 #[inline(always)]
13535 fn new_empty() -> Self {
13536 Self { packet: fidl::new_empty!(StreamPacket, D) }
13537 }
13538
13539 #[inline]
13540 unsafe fn decode(
13541 &mut self,
13542 decoder: &mut fidl::encoding::Decoder<'_, D>,
13543 offset: usize,
13544 _depth: fidl::encoding::Depth,
13545 ) -> fidl::Result<()> {
13546 decoder.debug_check_bounds::<Self>(offset);
13547 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
13548 let ptr = unsafe { buf_ptr.offset(8) };
13550 let padval = unsafe { (ptr as *const u64).read_unaligned() };
13551 let mask = 0xffffffff00000000u64;
13552 let maskedval = padval & mask;
13553 if maskedval != 0 {
13554 return Err(fidl::Error::NonZeroPadding {
13555 padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
13556 });
13557 }
13558 let ptr = unsafe { buf_ptr.offset(32) };
13559 let padval = unsafe { (ptr as *const u64).read_unaligned() };
13560 let mask = 0xffffffff00000000u64;
13561 let maskedval = padval & mask;
13562 if maskedval != 0 {
13563 return Err(fidl::Error::NonZeroPadding {
13564 padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
13565 });
13566 }
13567 unsafe {
13569 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 56);
13570 }
13571 Ok(())
13572 }
13573 }
13574
13575 impl fidl::encoding::ValueTypeMarker for StreamSourceReleasePacketRequest {
13576 type Borrowed<'a> = &'a Self;
13577 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13578 value
13579 }
13580 }
13581
13582 unsafe impl fidl::encoding::TypeMarker for StreamSourceReleasePacketRequest {
13583 type Owned = Self;
13584
13585 #[inline(always)]
13586 fn inline_align(_context: fidl::encoding::Context) -> usize {
13587 8
13588 }
13589
13590 #[inline(always)]
13591 fn inline_size(_context: fidl::encoding::Context) -> usize {
13592 56
13593 }
13594 }
13595
13596 unsafe impl<D: fidl::encoding::ResourceDialect>
13597 fidl::encoding::Encode<StreamSourceReleasePacketRequest, D>
13598 for &StreamSourceReleasePacketRequest
13599 {
13600 #[inline]
13601 unsafe fn encode(
13602 self,
13603 encoder: &mut fidl::encoding::Encoder<'_, D>,
13604 offset: usize,
13605 _depth: fidl::encoding::Depth,
13606 ) -> fidl::Result<()> {
13607 encoder.debug_check_bounds::<StreamSourceReleasePacketRequest>(offset);
13608 unsafe {
13609 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
13611 (buf_ptr as *mut StreamSourceReleasePacketRequest)
13612 .write_unaligned((self as *const StreamSourceReleasePacketRequest).read());
13613 let padding_ptr = buf_ptr.offset(8) as *mut u64;
13616 let padding_mask = 0xffffffff00000000u64;
13617 padding_ptr.write_unaligned(padding_ptr.read_unaligned() & !padding_mask);
13618 let padding_ptr = buf_ptr.offset(32) as *mut u64;
13619 let padding_mask = 0xffffffff00000000u64;
13620 padding_ptr.write_unaligned(padding_ptr.read_unaligned() & !padding_mask);
13621 }
13622 Ok(())
13623 }
13624 }
13625 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<StreamPacket, D>>
13626 fidl::encoding::Encode<StreamSourceReleasePacketRequest, D> for (T0,)
13627 {
13628 #[inline]
13629 unsafe fn encode(
13630 self,
13631 encoder: &mut fidl::encoding::Encoder<'_, D>,
13632 offset: usize,
13633 depth: fidl::encoding::Depth,
13634 ) -> fidl::Result<()> {
13635 encoder.debug_check_bounds::<StreamSourceReleasePacketRequest>(offset);
13636 self.0.encode(encoder, offset + 0, depth)?;
13640 Ok(())
13641 }
13642 }
13643
13644 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
13645 for StreamSourceReleasePacketRequest
13646 {
13647 #[inline(always)]
13648 fn new_empty() -> Self {
13649 Self { packet: fidl::new_empty!(StreamPacket, D) }
13650 }
13651
13652 #[inline]
13653 unsafe fn decode(
13654 &mut self,
13655 decoder: &mut fidl::encoding::Decoder<'_, D>,
13656 offset: usize,
13657 _depth: fidl::encoding::Depth,
13658 ) -> fidl::Result<()> {
13659 decoder.debug_check_bounds::<Self>(offset);
13660 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
13661 let ptr = unsafe { buf_ptr.offset(8) };
13663 let padval = unsafe { (ptr as *const u64).read_unaligned() };
13664 let mask = 0xffffffff00000000u64;
13665 let maskedval = padval & mask;
13666 if maskedval != 0 {
13667 return Err(fidl::Error::NonZeroPadding {
13668 padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
13669 });
13670 }
13671 let ptr = unsafe { buf_ptr.offset(32) };
13672 let padval = unsafe { (ptr as *const u64).read_unaligned() };
13673 let mask = 0xffffffff00000000u64;
13674 let maskedval = padval & mask;
13675 if maskedval != 0 {
13676 return Err(fidl::Error::NonZeroPadding {
13677 padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
13678 });
13679 }
13680 unsafe {
13682 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 56);
13683 }
13684 Ok(())
13685 }
13686 }
13687
13688 impl fidl::encoding::ValueTypeMarker for StreamType {
13689 type Borrowed<'a> = &'a Self;
13690 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13691 value
13692 }
13693 }
13694
13695 unsafe impl fidl::encoding::TypeMarker for StreamType {
13696 type Owned = Self;
13697
13698 #[inline(always)]
13699 fn inline_align(_context: fidl::encoding::Context) -> usize {
13700 8
13701 }
13702
13703 #[inline(always)]
13704 fn inline_size(_context: fidl::encoding::Context) -> usize {
13705 48
13706 }
13707 }
13708
13709 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<StreamType, D>
13710 for &StreamType
13711 {
13712 #[inline]
13713 unsafe fn encode(
13714 self,
13715 encoder: &mut fidl::encoding::Encoder<'_, D>,
13716 offset: usize,
13717 _depth: fidl::encoding::Depth,
13718 ) -> fidl::Result<()> {
13719 encoder.debug_check_bounds::<StreamType>(offset);
13720 fidl::encoding::Encode::<StreamType, D>::encode(
13722 (
13723 <MediumSpecificStreamType as fidl::encoding::ValueTypeMarker>::borrow(&self.medium_specific),
13724 <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(&self.encoding),
13725 <fidl::encoding::Optional<fidl::encoding::UnboundedVector<u8>> as fidl::encoding::ValueTypeMarker>::borrow(&self.encoding_parameters),
13726 ),
13727 encoder, offset, _depth
13728 )
13729 }
13730 }
13731 unsafe impl<
13732 D: fidl::encoding::ResourceDialect,
13733 T0: fidl::encoding::Encode<MediumSpecificStreamType, D>,
13734 T1: fidl::encoding::Encode<fidl::encoding::BoundedString<255>, D>,
13735 T2: fidl::encoding::Encode<
13736 fidl::encoding::Optional<fidl::encoding::UnboundedVector<u8>>,
13737 D,
13738 >,
13739 > fidl::encoding::Encode<StreamType, D> for (T0, T1, T2)
13740 {
13741 #[inline]
13742 unsafe fn encode(
13743 self,
13744 encoder: &mut fidl::encoding::Encoder<'_, D>,
13745 offset: usize,
13746 depth: fidl::encoding::Depth,
13747 ) -> fidl::Result<()> {
13748 encoder.debug_check_bounds::<StreamType>(offset);
13749 self.0.encode(encoder, offset + 0, depth)?;
13753 self.1.encode(encoder, offset + 16, depth)?;
13754 self.2.encode(encoder, offset + 32, depth)?;
13755 Ok(())
13756 }
13757 }
13758
13759 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for StreamType {
13760 #[inline(always)]
13761 fn new_empty() -> Self {
13762 Self {
13763 medium_specific: fidl::new_empty!(MediumSpecificStreamType, D),
13764 encoding: fidl::new_empty!(fidl::encoding::BoundedString<255>, D),
13765 encoding_parameters: fidl::new_empty!(
13766 fidl::encoding::Optional<fidl::encoding::UnboundedVector<u8>>,
13767 D
13768 ),
13769 }
13770 }
13771
13772 #[inline]
13773 unsafe fn decode(
13774 &mut self,
13775 decoder: &mut fidl::encoding::Decoder<'_, D>,
13776 offset: usize,
13777 _depth: fidl::encoding::Depth,
13778 ) -> fidl::Result<()> {
13779 decoder.debug_check_bounds::<Self>(offset);
13780 fidl::decode!(
13782 MediumSpecificStreamType,
13783 D,
13784 &mut self.medium_specific,
13785 decoder,
13786 offset + 0,
13787 _depth
13788 )?;
13789 fidl::decode!(
13790 fidl::encoding::BoundedString<255>,
13791 D,
13792 &mut self.encoding,
13793 decoder,
13794 offset + 16,
13795 _depth
13796 )?;
13797 fidl::decode!(
13798 fidl::encoding::Optional<fidl::encoding::UnboundedVector<u8>>,
13799 D,
13800 &mut self.encoding_parameters,
13801 decoder,
13802 offset + 32,
13803 _depth
13804 )?;
13805 Ok(())
13806 }
13807 }
13808
13809 impl fidl::encoding::ValueTypeMarker for SubpictureStreamType {
13810 type Borrowed<'a> = &'a Self;
13811 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13812 value
13813 }
13814 }
13815
13816 unsafe impl fidl::encoding::TypeMarker for SubpictureStreamType {
13817 type Owned = Self;
13818
13819 #[inline(always)]
13820 fn inline_align(_context: fidl::encoding::Context) -> usize {
13821 1
13822 }
13823
13824 #[inline(always)]
13825 fn inline_size(_context: fidl::encoding::Context) -> usize {
13826 1
13827 }
13828 }
13829
13830 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SubpictureStreamType, D>
13831 for &SubpictureStreamType
13832 {
13833 #[inline]
13834 unsafe fn encode(
13835 self,
13836 encoder: &mut fidl::encoding::Encoder<'_, D>,
13837 offset: usize,
13838 _depth: fidl::encoding::Depth,
13839 ) -> fidl::Result<()> {
13840 encoder.debug_check_bounds::<SubpictureStreamType>(offset);
13841 encoder.write_num(0u8, offset);
13842 Ok(())
13843 }
13844 }
13845
13846 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SubpictureStreamType {
13847 #[inline(always)]
13848 fn new_empty() -> Self {
13849 Self
13850 }
13851
13852 #[inline]
13853 unsafe fn decode(
13854 &mut self,
13855 decoder: &mut fidl::encoding::Decoder<'_, D>,
13856 offset: usize,
13857 _depth: fidl::encoding::Depth,
13858 ) -> fidl::Result<()> {
13859 decoder.debug_check_bounds::<Self>(offset);
13860 match decoder.read_num::<u8>(offset) {
13861 0 => Ok(()),
13862 _ => Err(fidl::Error::Invalid),
13863 }
13864 }
13865 }
13866
13867 impl fidl::encoding::ValueTypeMarker for SubsampleEntry {
13868 type Borrowed<'a> = &'a Self;
13869 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13870 value
13871 }
13872 }
13873
13874 unsafe impl fidl::encoding::TypeMarker for SubsampleEntry {
13875 type Owned = Self;
13876
13877 #[inline(always)]
13878 fn inline_align(_context: fidl::encoding::Context) -> usize {
13879 4
13880 }
13881
13882 #[inline(always)]
13883 fn inline_size(_context: fidl::encoding::Context) -> usize {
13884 8
13885 }
13886 #[inline(always)]
13887 fn encode_is_copy() -> bool {
13888 true
13889 }
13890
13891 #[inline(always)]
13892 fn decode_is_copy() -> bool {
13893 true
13894 }
13895 }
13896
13897 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SubsampleEntry, D>
13898 for &SubsampleEntry
13899 {
13900 #[inline]
13901 unsafe fn encode(
13902 self,
13903 encoder: &mut fidl::encoding::Encoder<'_, D>,
13904 offset: usize,
13905 _depth: fidl::encoding::Depth,
13906 ) -> fidl::Result<()> {
13907 encoder.debug_check_bounds::<SubsampleEntry>(offset);
13908 unsafe {
13909 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
13911 (buf_ptr as *mut SubsampleEntry)
13912 .write_unaligned((self as *const SubsampleEntry).read());
13913 }
13916 Ok(())
13917 }
13918 }
13919 unsafe impl<
13920 D: fidl::encoding::ResourceDialect,
13921 T0: fidl::encoding::Encode<u32, D>,
13922 T1: fidl::encoding::Encode<u32, D>,
13923 > fidl::encoding::Encode<SubsampleEntry, D> for (T0, T1)
13924 {
13925 #[inline]
13926 unsafe fn encode(
13927 self,
13928 encoder: &mut fidl::encoding::Encoder<'_, D>,
13929 offset: usize,
13930 depth: fidl::encoding::Depth,
13931 ) -> fidl::Result<()> {
13932 encoder.debug_check_bounds::<SubsampleEntry>(offset);
13933 self.0.encode(encoder, offset + 0, depth)?;
13937 self.1.encode(encoder, offset + 4, depth)?;
13938 Ok(())
13939 }
13940 }
13941
13942 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SubsampleEntry {
13943 #[inline(always)]
13944 fn new_empty() -> Self {
13945 Self {
13946 clear_bytes: fidl::new_empty!(u32, D),
13947 encrypted_bytes: fidl::new_empty!(u32, D),
13948 }
13949 }
13950
13951 #[inline]
13952 unsafe fn decode(
13953 &mut self,
13954 decoder: &mut fidl::encoding::Decoder<'_, D>,
13955 offset: usize,
13956 _depth: fidl::encoding::Depth,
13957 ) -> fidl::Result<()> {
13958 decoder.debug_check_bounds::<Self>(offset);
13959 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
13960 unsafe {
13963 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
13964 }
13965 Ok(())
13966 }
13967 }
13968
13969 impl fidl::encoding::ValueTypeMarker for TextStreamType {
13970 type Borrowed<'a> = &'a Self;
13971 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13972 value
13973 }
13974 }
13975
13976 unsafe impl fidl::encoding::TypeMarker for TextStreamType {
13977 type Owned = Self;
13978
13979 #[inline(always)]
13980 fn inline_align(_context: fidl::encoding::Context) -> usize {
13981 1
13982 }
13983
13984 #[inline(always)]
13985 fn inline_size(_context: fidl::encoding::Context) -> usize {
13986 1
13987 }
13988 }
13989
13990 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<TextStreamType, D>
13991 for &TextStreamType
13992 {
13993 #[inline]
13994 unsafe fn encode(
13995 self,
13996 encoder: &mut fidl::encoding::Encoder<'_, D>,
13997 offset: usize,
13998 _depth: fidl::encoding::Depth,
13999 ) -> fidl::Result<()> {
14000 encoder.debug_check_bounds::<TextStreamType>(offset);
14001 encoder.write_num(0u8, offset);
14002 Ok(())
14003 }
14004 }
14005
14006 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for TextStreamType {
14007 #[inline(always)]
14008 fn new_empty() -> Self {
14009 Self
14010 }
14011
14012 #[inline]
14013 unsafe fn decode(
14014 &mut self,
14015 decoder: &mut fidl::encoding::Decoder<'_, D>,
14016 offset: usize,
14017 _depth: fidl::encoding::Depth,
14018 ) -> fidl::Result<()> {
14019 decoder.debug_check_bounds::<Self>(offset);
14020 match decoder.read_num::<u8>(offset) {
14021 0 => Ok(()),
14022 _ => Err(fidl::Error::Invalid),
14023 }
14024 }
14025 }
14026
14027 impl fidl::encoding::ValueTypeMarker for TimelineFunction {
14028 type Borrowed<'a> = &'a Self;
14029 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
14030 value
14031 }
14032 }
14033
14034 unsafe impl fidl::encoding::TypeMarker for TimelineFunction {
14035 type Owned = Self;
14036
14037 #[inline(always)]
14038 fn inline_align(_context: fidl::encoding::Context) -> usize {
14039 8
14040 }
14041
14042 #[inline(always)]
14043 fn inline_size(_context: fidl::encoding::Context) -> usize {
14044 24
14045 }
14046 #[inline(always)]
14047 fn encode_is_copy() -> bool {
14048 true
14049 }
14050
14051 #[inline(always)]
14052 fn decode_is_copy() -> bool {
14053 true
14054 }
14055 }
14056
14057 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<TimelineFunction, D>
14058 for &TimelineFunction
14059 {
14060 #[inline]
14061 unsafe fn encode(
14062 self,
14063 encoder: &mut fidl::encoding::Encoder<'_, D>,
14064 offset: usize,
14065 _depth: fidl::encoding::Depth,
14066 ) -> fidl::Result<()> {
14067 encoder.debug_check_bounds::<TimelineFunction>(offset);
14068 unsafe {
14069 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
14071 (buf_ptr as *mut TimelineFunction)
14072 .write_unaligned((self as *const TimelineFunction).read());
14073 }
14076 Ok(())
14077 }
14078 }
14079 unsafe impl<
14080 D: fidl::encoding::ResourceDialect,
14081 T0: fidl::encoding::Encode<i64, D>,
14082 T1: fidl::encoding::Encode<i64, D>,
14083 T2: fidl::encoding::Encode<u32, D>,
14084 T3: fidl::encoding::Encode<u32, D>,
14085 > fidl::encoding::Encode<TimelineFunction, D> for (T0, T1, T2, T3)
14086 {
14087 #[inline]
14088 unsafe fn encode(
14089 self,
14090 encoder: &mut fidl::encoding::Encoder<'_, D>,
14091 offset: usize,
14092 depth: fidl::encoding::Depth,
14093 ) -> fidl::Result<()> {
14094 encoder.debug_check_bounds::<TimelineFunction>(offset);
14095 self.0.encode(encoder, offset + 0, depth)?;
14099 self.1.encode(encoder, offset + 8, depth)?;
14100 self.2.encode(encoder, offset + 16, depth)?;
14101 self.3.encode(encoder, offset + 20, depth)?;
14102 Ok(())
14103 }
14104 }
14105
14106 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for TimelineFunction {
14107 #[inline(always)]
14108 fn new_empty() -> Self {
14109 Self {
14110 subject_time: fidl::new_empty!(i64, D),
14111 reference_time: fidl::new_empty!(i64, D),
14112 subject_delta: fidl::new_empty!(u32, D),
14113 reference_delta: fidl::new_empty!(u32, D),
14114 }
14115 }
14116
14117 #[inline]
14118 unsafe fn decode(
14119 &mut self,
14120 decoder: &mut fidl::encoding::Decoder<'_, D>,
14121 offset: usize,
14122 _depth: fidl::encoding::Depth,
14123 ) -> fidl::Result<()> {
14124 decoder.debug_check_bounds::<Self>(offset);
14125 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
14126 unsafe {
14129 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 24);
14130 }
14131 Ok(())
14132 }
14133 }
14134
14135 impl fidl::encoding::ValueTypeMarker for UsageGainListenerOnGainMuteChangedRequest {
14136 type Borrowed<'a> = &'a Self;
14137 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
14138 value
14139 }
14140 }
14141
14142 unsafe impl fidl::encoding::TypeMarker for UsageGainListenerOnGainMuteChangedRequest {
14143 type Owned = Self;
14144
14145 #[inline(always)]
14146 fn inline_align(_context: fidl::encoding::Context) -> usize {
14147 4
14148 }
14149
14150 #[inline(always)]
14151 fn inline_size(_context: fidl::encoding::Context) -> usize {
14152 8
14153 }
14154 }
14155
14156 unsafe impl<D: fidl::encoding::ResourceDialect>
14157 fidl::encoding::Encode<UsageGainListenerOnGainMuteChangedRequest, D>
14158 for &UsageGainListenerOnGainMuteChangedRequest
14159 {
14160 #[inline]
14161 unsafe fn encode(
14162 self,
14163 encoder: &mut fidl::encoding::Encoder<'_, D>,
14164 offset: usize,
14165 _depth: fidl::encoding::Depth,
14166 ) -> fidl::Result<()> {
14167 encoder.debug_check_bounds::<UsageGainListenerOnGainMuteChangedRequest>(offset);
14168 fidl::encoding::Encode::<UsageGainListenerOnGainMuteChangedRequest, D>::encode(
14170 (
14171 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.muted),
14172 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.gain_dbfs),
14173 ),
14174 encoder,
14175 offset,
14176 _depth,
14177 )
14178 }
14179 }
14180 unsafe impl<
14181 D: fidl::encoding::ResourceDialect,
14182 T0: fidl::encoding::Encode<bool, D>,
14183 T1: fidl::encoding::Encode<f32, D>,
14184 > fidl::encoding::Encode<UsageGainListenerOnGainMuteChangedRequest, D> for (T0, T1)
14185 {
14186 #[inline]
14187 unsafe fn encode(
14188 self,
14189 encoder: &mut fidl::encoding::Encoder<'_, D>,
14190 offset: usize,
14191 depth: fidl::encoding::Depth,
14192 ) -> fidl::Result<()> {
14193 encoder.debug_check_bounds::<UsageGainListenerOnGainMuteChangedRequest>(offset);
14194 unsafe {
14197 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
14198 (ptr as *mut u32).write_unaligned(0);
14199 }
14200 self.0.encode(encoder, offset + 0, depth)?;
14202 self.1.encode(encoder, offset + 4, depth)?;
14203 Ok(())
14204 }
14205 }
14206
14207 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
14208 for UsageGainListenerOnGainMuteChangedRequest
14209 {
14210 #[inline(always)]
14211 fn new_empty() -> Self {
14212 Self { muted: fidl::new_empty!(bool, D), gain_dbfs: fidl::new_empty!(f32, D) }
14213 }
14214
14215 #[inline]
14216 unsafe fn decode(
14217 &mut self,
14218 decoder: &mut fidl::encoding::Decoder<'_, D>,
14219 offset: usize,
14220 _depth: fidl::encoding::Depth,
14221 ) -> fidl::Result<()> {
14222 decoder.debug_check_bounds::<Self>(offset);
14223 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
14225 let padval = unsafe { (ptr as *const u32).read_unaligned() };
14226 let mask = 0xffffff00u32;
14227 let maskedval = padval & mask;
14228 if maskedval != 0 {
14229 return Err(fidl::Error::NonZeroPadding {
14230 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
14231 });
14232 }
14233 fidl::decode!(bool, D, &mut self.muted, decoder, offset + 0, _depth)?;
14234 fidl::decode!(f32, D, &mut self.gain_dbfs, decoder, offset + 4, _depth)?;
14235 Ok(())
14236 }
14237 }
14238
14239 impl fidl::encoding::ValueTypeMarker for UsageWatcher2OnStateChangedRequest {
14240 type Borrowed<'a> = &'a Self;
14241 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
14242 value
14243 }
14244 }
14245
14246 unsafe impl fidl::encoding::TypeMarker for UsageWatcher2OnStateChangedRequest {
14247 type Owned = Self;
14248
14249 #[inline(always)]
14250 fn inline_align(_context: fidl::encoding::Context) -> usize {
14251 8
14252 }
14253
14254 #[inline(always)]
14255 fn inline_size(_context: fidl::encoding::Context) -> usize {
14256 32
14257 }
14258 }
14259
14260 unsafe impl<D: fidl::encoding::ResourceDialect>
14261 fidl::encoding::Encode<UsageWatcher2OnStateChangedRequest, D>
14262 for &UsageWatcher2OnStateChangedRequest
14263 {
14264 #[inline]
14265 unsafe fn encode(
14266 self,
14267 encoder: &mut fidl::encoding::Encoder<'_, D>,
14268 offset: usize,
14269 _depth: fidl::encoding::Depth,
14270 ) -> fidl::Result<()> {
14271 encoder.debug_check_bounds::<UsageWatcher2OnStateChangedRequest>(offset);
14272 fidl::encoding::Encode::<UsageWatcher2OnStateChangedRequest, D>::encode(
14274 (
14275 <Usage2 as fidl::encoding::ValueTypeMarker>::borrow(&self.usage),
14276 <UsageState as fidl::encoding::ValueTypeMarker>::borrow(&self.state),
14277 ),
14278 encoder,
14279 offset,
14280 _depth,
14281 )
14282 }
14283 }
14284 unsafe impl<
14285 D: fidl::encoding::ResourceDialect,
14286 T0: fidl::encoding::Encode<Usage2, D>,
14287 T1: fidl::encoding::Encode<UsageState, D>,
14288 > fidl::encoding::Encode<UsageWatcher2OnStateChangedRequest, D> for (T0, T1)
14289 {
14290 #[inline]
14291 unsafe fn encode(
14292 self,
14293 encoder: &mut fidl::encoding::Encoder<'_, D>,
14294 offset: usize,
14295 depth: fidl::encoding::Depth,
14296 ) -> fidl::Result<()> {
14297 encoder.debug_check_bounds::<UsageWatcher2OnStateChangedRequest>(offset);
14298 self.0.encode(encoder, offset + 0, depth)?;
14302 self.1.encode(encoder, offset + 16, depth)?;
14303 Ok(())
14304 }
14305 }
14306
14307 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
14308 for UsageWatcher2OnStateChangedRequest
14309 {
14310 #[inline(always)]
14311 fn new_empty() -> Self {
14312 Self { usage: fidl::new_empty!(Usage2, D), state: fidl::new_empty!(UsageState, D) }
14313 }
14314
14315 #[inline]
14316 unsafe fn decode(
14317 &mut self,
14318 decoder: &mut fidl::encoding::Decoder<'_, D>,
14319 offset: usize,
14320 _depth: fidl::encoding::Depth,
14321 ) -> fidl::Result<()> {
14322 decoder.debug_check_bounds::<Self>(offset);
14323 fidl::decode!(Usage2, D, &mut self.usage, decoder, offset + 0, _depth)?;
14325 fidl::decode!(UsageState, D, &mut self.state, decoder, offset + 16, _depth)?;
14326 Ok(())
14327 }
14328 }
14329
14330 impl fidl::encoding::ValueTypeMarker for UsageWatcherOnStateChangedRequest {
14331 type Borrowed<'a> = &'a Self;
14332 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
14333 value
14334 }
14335 }
14336
14337 unsafe impl fidl::encoding::TypeMarker for UsageWatcherOnStateChangedRequest {
14338 type Owned = Self;
14339
14340 #[inline(always)]
14341 fn inline_align(_context: fidl::encoding::Context) -> usize {
14342 8
14343 }
14344
14345 #[inline(always)]
14346 fn inline_size(_context: fidl::encoding::Context) -> usize {
14347 32
14348 }
14349 }
14350
14351 unsafe impl<D: fidl::encoding::ResourceDialect>
14352 fidl::encoding::Encode<UsageWatcherOnStateChangedRequest, D>
14353 for &UsageWatcherOnStateChangedRequest
14354 {
14355 #[inline]
14356 unsafe fn encode(
14357 self,
14358 encoder: &mut fidl::encoding::Encoder<'_, D>,
14359 offset: usize,
14360 _depth: fidl::encoding::Depth,
14361 ) -> fidl::Result<()> {
14362 encoder.debug_check_bounds::<UsageWatcherOnStateChangedRequest>(offset);
14363 fidl::encoding::Encode::<UsageWatcherOnStateChangedRequest, D>::encode(
14365 (
14366 <Usage as fidl::encoding::ValueTypeMarker>::borrow(&self.usage),
14367 <UsageState as fidl::encoding::ValueTypeMarker>::borrow(&self.state),
14368 ),
14369 encoder,
14370 offset,
14371 _depth,
14372 )
14373 }
14374 }
14375 unsafe impl<
14376 D: fidl::encoding::ResourceDialect,
14377 T0: fidl::encoding::Encode<Usage, D>,
14378 T1: fidl::encoding::Encode<UsageState, D>,
14379 > fidl::encoding::Encode<UsageWatcherOnStateChangedRequest, D> for (T0, T1)
14380 {
14381 #[inline]
14382 unsafe fn encode(
14383 self,
14384 encoder: &mut fidl::encoding::Encoder<'_, D>,
14385 offset: usize,
14386 depth: fidl::encoding::Depth,
14387 ) -> fidl::Result<()> {
14388 encoder.debug_check_bounds::<UsageWatcherOnStateChangedRequest>(offset);
14389 self.0.encode(encoder, offset + 0, depth)?;
14393 self.1.encode(encoder, offset + 16, depth)?;
14394 Ok(())
14395 }
14396 }
14397
14398 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
14399 for UsageWatcherOnStateChangedRequest
14400 {
14401 #[inline(always)]
14402 fn new_empty() -> Self {
14403 Self { usage: fidl::new_empty!(Usage, D), state: fidl::new_empty!(UsageState, D) }
14404 }
14405
14406 #[inline]
14407 unsafe fn decode(
14408 &mut self,
14409 decoder: &mut fidl::encoding::Decoder<'_, D>,
14410 offset: usize,
14411 _depth: fidl::encoding::Depth,
14412 ) -> fidl::Result<()> {
14413 decoder.debug_check_bounds::<Self>(offset);
14414 fidl::decode!(Usage, D, &mut self.usage, decoder, offset + 0, _depth)?;
14416 fidl::decode!(UsageState, D, &mut self.state, decoder, offset + 16, _depth)?;
14417 Ok(())
14418 }
14419 }
14420
14421 impl fidl::encoding::ValueTypeMarker for VideoStreamType {
14422 type Borrowed<'a> = &'a Self;
14423 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
14424 value
14425 }
14426 }
14427
14428 unsafe impl fidl::encoding::TypeMarker for VideoStreamType {
14429 type Owned = Self;
14430
14431 #[inline(always)]
14432 fn inline_align(_context: fidl::encoding::Context) -> usize {
14433 4
14434 }
14435
14436 #[inline(always)]
14437 fn inline_size(_context: fidl::encoding::Context) -> usize {
14438 36
14439 }
14440 }
14441
14442 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<VideoStreamType, D>
14443 for &VideoStreamType
14444 {
14445 #[inline]
14446 unsafe fn encode(
14447 self,
14448 encoder: &mut fidl::encoding::Encoder<'_, D>,
14449 offset: usize,
14450 _depth: fidl::encoding::Depth,
14451 ) -> fidl::Result<()> {
14452 encoder.debug_check_bounds::<VideoStreamType>(offset);
14453 fidl::encoding::Encode::<VideoStreamType, D>::encode(
14455 (
14456 <fidl_fuchsia_images::PixelFormat as fidl::encoding::ValueTypeMarker>::borrow(
14457 &self.pixel_format,
14458 ),
14459 <ColorSpace as fidl::encoding::ValueTypeMarker>::borrow(&self.color_space),
14460 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.width),
14461 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.height),
14462 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.coded_width),
14463 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.coded_height),
14464 <u32 as fidl::encoding::ValueTypeMarker>::borrow(
14465 &self.pixel_aspect_ratio_width,
14466 ),
14467 <u32 as fidl::encoding::ValueTypeMarker>::borrow(
14468 &self.pixel_aspect_ratio_height,
14469 ),
14470 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.stride),
14471 ),
14472 encoder,
14473 offset,
14474 _depth,
14475 )
14476 }
14477 }
14478 unsafe impl<
14479 D: fidl::encoding::ResourceDialect,
14480 T0: fidl::encoding::Encode<fidl_fuchsia_images::PixelFormat, D>,
14481 T1: fidl::encoding::Encode<ColorSpace, D>,
14482 T2: fidl::encoding::Encode<u32, D>,
14483 T3: fidl::encoding::Encode<u32, D>,
14484 T4: fidl::encoding::Encode<u32, D>,
14485 T5: fidl::encoding::Encode<u32, D>,
14486 T6: fidl::encoding::Encode<u32, D>,
14487 T7: fidl::encoding::Encode<u32, D>,
14488 T8: fidl::encoding::Encode<u32, D>,
14489 > fidl::encoding::Encode<VideoStreamType, D> for (T0, T1, T2, T3, T4, T5, T6, T7, T8)
14490 {
14491 #[inline]
14492 unsafe fn encode(
14493 self,
14494 encoder: &mut fidl::encoding::Encoder<'_, D>,
14495 offset: usize,
14496 depth: fidl::encoding::Depth,
14497 ) -> fidl::Result<()> {
14498 encoder.debug_check_bounds::<VideoStreamType>(offset);
14499 self.0.encode(encoder, offset + 0, depth)?;
14503 self.1.encode(encoder, offset + 4, depth)?;
14504 self.2.encode(encoder, offset + 8, depth)?;
14505 self.3.encode(encoder, offset + 12, depth)?;
14506 self.4.encode(encoder, offset + 16, depth)?;
14507 self.5.encode(encoder, offset + 20, depth)?;
14508 self.6.encode(encoder, offset + 24, depth)?;
14509 self.7.encode(encoder, offset + 28, depth)?;
14510 self.8.encode(encoder, offset + 32, depth)?;
14511 Ok(())
14512 }
14513 }
14514
14515 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for VideoStreamType {
14516 #[inline(always)]
14517 fn new_empty() -> Self {
14518 Self {
14519 pixel_format: fidl::new_empty!(fidl_fuchsia_images::PixelFormat, D),
14520 color_space: fidl::new_empty!(ColorSpace, D),
14521 width: fidl::new_empty!(u32, D),
14522 height: fidl::new_empty!(u32, D),
14523 coded_width: fidl::new_empty!(u32, D),
14524 coded_height: fidl::new_empty!(u32, D),
14525 pixel_aspect_ratio_width: fidl::new_empty!(u32, D),
14526 pixel_aspect_ratio_height: fidl::new_empty!(u32, D),
14527 stride: fidl::new_empty!(u32, D),
14528 }
14529 }
14530
14531 #[inline]
14532 unsafe fn decode(
14533 &mut self,
14534 decoder: &mut fidl::encoding::Decoder<'_, D>,
14535 offset: usize,
14536 _depth: fidl::encoding::Depth,
14537 ) -> fidl::Result<()> {
14538 decoder.debug_check_bounds::<Self>(offset);
14539 fidl::decode!(
14541 fidl_fuchsia_images::PixelFormat,
14542 D,
14543 &mut self.pixel_format,
14544 decoder,
14545 offset + 0,
14546 _depth
14547 )?;
14548 fidl::decode!(ColorSpace, D, &mut self.color_space, decoder, offset + 4, _depth)?;
14549 fidl::decode!(u32, D, &mut self.width, decoder, offset + 8, _depth)?;
14550 fidl::decode!(u32, D, &mut self.height, decoder, offset + 12, _depth)?;
14551 fidl::decode!(u32, D, &mut self.coded_width, decoder, offset + 16, _depth)?;
14552 fidl::decode!(u32, D, &mut self.coded_height, decoder, offset + 20, _depth)?;
14553 fidl::decode!(
14554 u32,
14555 D,
14556 &mut self.pixel_aspect_ratio_width,
14557 decoder,
14558 offset + 24,
14559 _depth
14560 )?;
14561 fidl::decode!(
14562 u32,
14563 D,
14564 &mut self.pixel_aspect_ratio_height,
14565 decoder,
14566 offset + 28,
14567 _depth
14568 )?;
14569 fidl::decode!(u32, D, &mut self.stride, decoder, offset + 32, _depth)?;
14570 Ok(())
14571 }
14572 }
14573
14574 impl fidl::encoding::ValueTypeMarker for VideoUncompressedFormat {
14575 type Borrowed<'a> = &'a Self;
14576 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
14577 value
14578 }
14579 }
14580
14581 unsafe impl fidl::encoding::TypeMarker for VideoUncompressedFormat {
14582 type Owned = Self;
14583
14584 #[inline(always)]
14585 fn inline_align(_context: fidl::encoding::Context) -> usize {
14586 8
14587 }
14588
14589 #[inline(always)]
14590 fn inline_size(_context: fidl::encoding::Context) -> usize {
14591 128
14592 }
14593 }
14594
14595 unsafe impl<D: fidl::encoding::ResourceDialect>
14596 fidl::encoding::Encode<VideoUncompressedFormat, D> for &VideoUncompressedFormat
14597 {
14598 #[inline]
14599 unsafe fn encode(
14600 self,
14601 encoder: &mut fidl::encoding::Encoder<'_, D>,
14602 offset: usize,
14603 _depth: fidl::encoding::Depth,
14604 ) -> fidl::Result<()> {
14605 encoder.debug_check_bounds::<VideoUncompressedFormat>(offset);
14606 fidl::encoding::Encode::<VideoUncompressedFormat, D>::encode(
14608 (
14609 <fidl_fuchsia_sysmem::ImageFormat2 as fidl::encoding::ValueTypeMarker>::borrow(
14610 &self.image_format,
14611 ),
14612 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.fourcc),
14613 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.primary_width_pixels),
14614 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.primary_height_pixels),
14615 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.secondary_width_pixels),
14616 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.secondary_height_pixels),
14617 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.planar),
14618 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.swizzled),
14619 <u32 as fidl::encoding::ValueTypeMarker>::borrow(
14620 &self.primary_line_stride_bytes,
14621 ),
14622 <u32 as fidl::encoding::ValueTypeMarker>::borrow(
14623 &self.secondary_line_stride_bytes,
14624 ),
14625 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.primary_start_offset),
14626 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.secondary_start_offset),
14627 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.tertiary_start_offset),
14628 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.primary_pixel_stride),
14629 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.secondary_pixel_stride),
14630 <u32 as fidl::encoding::ValueTypeMarker>::borrow(
14631 &self.primary_display_width_pixels,
14632 ),
14633 <u32 as fidl::encoding::ValueTypeMarker>::borrow(
14634 &self.primary_display_height_pixels,
14635 ),
14636 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.has_pixel_aspect_ratio),
14637 <u32 as fidl::encoding::ValueTypeMarker>::borrow(
14638 &self.pixel_aspect_ratio_width,
14639 ),
14640 <u32 as fidl::encoding::ValueTypeMarker>::borrow(
14641 &self.pixel_aspect_ratio_height,
14642 ),
14643 ),
14644 encoder,
14645 offset,
14646 _depth,
14647 )
14648 }
14649 }
14650 unsafe impl<
14651 D: fidl::encoding::ResourceDialect,
14652 T0: fidl::encoding::Encode<fidl_fuchsia_sysmem::ImageFormat2, D>,
14653 T1: fidl::encoding::Encode<u32, D>,
14654 T2: fidl::encoding::Encode<u32, D>,
14655 T3: fidl::encoding::Encode<u32, D>,
14656 T4: fidl::encoding::Encode<u32, D>,
14657 T5: fidl::encoding::Encode<u32, D>,
14658 T6: fidl::encoding::Encode<bool, D>,
14659 T7: fidl::encoding::Encode<bool, D>,
14660 T8: fidl::encoding::Encode<u32, D>,
14661 T9: fidl::encoding::Encode<u32, D>,
14662 T10: fidl::encoding::Encode<u32, D>,
14663 T11: fidl::encoding::Encode<u32, D>,
14664 T12: fidl::encoding::Encode<u32, D>,
14665 T13: fidl::encoding::Encode<u32, D>,
14666 T14: fidl::encoding::Encode<u32, D>,
14667 T15: fidl::encoding::Encode<u32, D>,
14668 T16: fidl::encoding::Encode<u32, D>,
14669 T17: fidl::encoding::Encode<bool, D>,
14670 T18: fidl::encoding::Encode<u32, D>,
14671 T19: fidl::encoding::Encode<u32, D>,
14672 > fidl::encoding::Encode<VideoUncompressedFormat, D>
14673 for (
14674 T0,
14675 T1,
14676 T2,
14677 T3,
14678 T4,
14679 T5,
14680 T6,
14681 T7,
14682 T8,
14683 T9,
14684 T10,
14685 T11,
14686 T12,
14687 T13,
14688 T14,
14689 T15,
14690 T16,
14691 T17,
14692 T18,
14693 T19,
14694 )
14695 {
14696 #[inline]
14697 unsafe fn encode(
14698 self,
14699 encoder: &mut fidl::encoding::Encoder<'_, D>,
14700 offset: usize,
14701 depth: fidl::encoding::Depth,
14702 ) -> fidl::Result<()> {
14703 encoder.debug_check_bounds::<VideoUncompressedFormat>(offset);
14704 unsafe {
14707 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(72);
14708 (ptr as *mut u64).write_unaligned(0);
14709 }
14710 unsafe {
14711 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(112);
14712 (ptr as *mut u64).write_unaligned(0);
14713 }
14714 self.0.encode(encoder, offset + 0, depth)?;
14716 self.1.encode(encoder, offset + 56, depth)?;
14717 self.2.encode(encoder, offset + 60, depth)?;
14718 self.3.encode(encoder, offset + 64, depth)?;
14719 self.4.encode(encoder, offset + 68, depth)?;
14720 self.5.encode(encoder, offset + 72, depth)?;
14721 self.6.encode(encoder, offset + 76, depth)?;
14722 self.7.encode(encoder, offset + 77, depth)?;
14723 self.8.encode(encoder, offset + 80, depth)?;
14724 self.9.encode(encoder, offset + 84, depth)?;
14725 self.10.encode(encoder, offset + 88, depth)?;
14726 self.11.encode(encoder, offset + 92, depth)?;
14727 self.12.encode(encoder, offset + 96, depth)?;
14728 self.13.encode(encoder, offset + 100, depth)?;
14729 self.14.encode(encoder, offset + 104, depth)?;
14730 self.15.encode(encoder, offset + 108, depth)?;
14731 self.16.encode(encoder, offset + 112, depth)?;
14732 self.17.encode(encoder, offset + 116, depth)?;
14733 self.18.encode(encoder, offset + 120, depth)?;
14734 self.19.encode(encoder, offset + 124, depth)?;
14735 Ok(())
14736 }
14737 }
14738
14739 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
14740 for VideoUncompressedFormat
14741 {
14742 #[inline(always)]
14743 fn new_empty() -> Self {
14744 Self {
14745 image_format: fidl::new_empty!(fidl_fuchsia_sysmem::ImageFormat2, D),
14746 fourcc: fidl::new_empty!(u32, D),
14747 primary_width_pixels: fidl::new_empty!(u32, D),
14748 primary_height_pixels: fidl::new_empty!(u32, D),
14749 secondary_width_pixels: fidl::new_empty!(u32, D),
14750 secondary_height_pixels: fidl::new_empty!(u32, D),
14751 planar: fidl::new_empty!(bool, D),
14752 swizzled: fidl::new_empty!(bool, D),
14753 primary_line_stride_bytes: fidl::new_empty!(u32, D),
14754 secondary_line_stride_bytes: fidl::new_empty!(u32, D),
14755 primary_start_offset: fidl::new_empty!(u32, D),
14756 secondary_start_offset: fidl::new_empty!(u32, D),
14757 tertiary_start_offset: fidl::new_empty!(u32, D),
14758 primary_pixel_stride: fidl::new_empty!(u32, D),
14759 secondary_pixel_stride: fidl::new_empty!(u32, D),
14760 primary_display_width_pixels: fidl::new_empty!(u32, D),
14761 primary_display_height_pixels: fidl::new_empty!(u32, D),
14762 has_pixel_aspect_ratio: fidl::new_empty!(bool, D),
14763 pixel_aspect_ratio_width: fidl::new_empty!(u32, D),
14764 pixel_aspect_ratio_height: fidl::new_empty!(u32, D),
14765 }
14766 }
14767
14768 #[inline]
14769 unsafe fn decode(
14770 &mut self,
14771 decoder: &mut fidl::encoding::Decoder<'_, D>,
14772 offset: usize,
14773 _depth: fidl::encoding::Depth,
14774 ) -> fidl::Result<()> {
14775 decoder.debug_check_bounds::<Self>(offset);
14776 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(72) };
14778 let padval = unsafe { (ptr as *const u64).read_unaligned() };
14779 let mask = 0xffff000000000000u64;
14780 let maskedval = padval & mask;
14781 if maskedval != 0 {
14782 return Err(fidl::Error::NonZeroPadding {
14783 padding_start: offset + 72 + ((mask as u64).trailing_zeros() / 8) as usize,
14784 });
14785 }
14786 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(112) };
14787 let padval = unsafe { (ptr as *const u64).read_unaligned() };
14788 let mask = 0xffffff0000000000u64;
14789 let maskedval = padval & mask;
14790 if maskedval != 0 {
14791 return Err(fidl::Error::NonZeroPadding {
14792 padding_start: offset + 112 + ((mask as u64).trailing_zeros() / 8) as usize,
14793 });
14794 }
14795 fidl::decode!(
14796 fidl_fuchsia_sysmem::ImageFormat2,
14797 D,
14798 &mut self.image_format,
14799 decoder,
14800 offset + 0,
14801 _depth
14802 )?;
14803 fidl::decode!(u32, D, &mut self.fourcc, decoder, offset + 56, _depth)?;
14804 fidl::decode!(u32, D, &mut self.primary_width_pixels, decoder, offset + 60, _depth)?;
14805 fidl::decode!(u32, D, &mut self.primary_height_pixels, decoder, offset + 64, _depth)?;
14806 fidl::decode!(u32, D, &mut self.secondary_width_pixels, decoder, offset + 68, _depth)?;
14807 fidl::decode!(u32, D, &mut self.secondary_height_pixels, decoder, offset + 72, _depth)?;
14808 fidl::decode!(bool, D, &mut self.planar, decoder, offset + 76, _depth)?;
14809 fidl::decode!(bool, D, &mut self.swizzled, decoder, offset + 77, _depth)?;
14810 fidl::decode!(
14811 u32,
14812 D,
14813 &mut self.primary_line_stride_bytes,
14814 decoder,
14815 offset + 80,
14816 _depth
14817 )?;
14818 fidl::decode!(
14819 u32,
14820 D,
14821 &mut self.secondary_line_stride_bytes,
14822 decoder,
14823 offset + 84,
14824 _depth
14825 )?;
14826 fidl::decode!(u32, D, &mut self.primary_start_offset, decoder, offset + 88, _depth)?;
14827 fidl::decode!(u32, D, &mut self.secondary_start_offset, decoder, offset + 92, _depth)?;
14828 fidl::decode!(u32, D, &mut self.tertiary_start_offset, decoder, offset + 96, _depth)?;
14829 fidl::decode!(u32, D, &mut self.primary_pixel_stride, decoder, offset + 100, _depth)?;
14830 fidl::decode!(u32, D, &mut self.secondary_pixel_stride, decoder, offset + 104, _depth)?;
14831 fidl::decode!(
14832 u32,
14833 D,
14834 &mut self.primary_display_width_pixels,
14835 decoder,
14836 offset + 108,
14837 _depth
14838 )?;
14839 fidl::decode!(
14840 u32,
14841 D,
14842 &mut self.primary_display_height_pixels,
14843 decoder,
14844 offset + 112,
14845 _depth
14846 )?;
14847 fidl::decode!(
14848 bool,
14849 D,
14850 &mut self.has_pixel_aspect_ratio,
14851 decoder,
14852 offset + 116,
14853 _depth
14854 )?;
14855 fidl::decode!(
14856 u32,
14857 D,
14858 &mut self.pixel_aspect_ratio_width,
14859 decoder,
14860 offset + 120,
14861 _depth
14862 )?;
14863 fidl::decode!(
14864 u32,
14865 D,
14866 &mut self.pixel_aspect_ratio_height,
14867 decoder,
14868 offset + 124,
14869 _depth
14870 )?;
14871 Ok(())
14872 }
14873 }
14874
14875 impl fidl::encoding::ValueTypeMarker for Void {
14876 type Borrowed<'a> = &'a Self;
14877 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
14878 value
14879 }
14880 }
14881
14882 unsafe impl fidl::encoding::TypeMarker for Void {
14883 type Owned = Self;
14884
14885 #[inline(always)]
14886 fn inline_align(_context: fidl::encoding::Context) -> usize {
14887 1
14888 }
14889
14890 #[inline(always)]
14891 fn inline_size(_context: fidl::encoding::Context) -> usize {
14892 1
14893 }
14894 }
14895
14896 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Void, D> for &Void {
14897 #[inline]
14898 unsafe fn encode(
14899 self,
14900 encoder: &mut fidl::encoding::Encoder<'_, D>,
14901 offset: usize,
14902 _depth: fidl::encoding::Depth,
14903 ) -> fidl::Result<()> {
14904 encoder.debug_check_bounds::<Void>(offset);
14905 encoder.write_num(0u8, offset);
14906 Ok(())
14907 }
14908 }
14909
14910 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Void {
14911 #[inline(always)]
14912 fn new_empty() -> Self {
14913 Self
14914 }
14915
14916 #[inline]
14917 unsafe fn decode(
14918 &mut self,
14919 decoder: &mut fidl::encoding::Decoder<'_, D>,
14920 offset: usize,
14921 _depth: fidl::encoding::Depth,
14922 ) -> fidl::Result<()> {
14923 decoder.debug_check_bounds::<Self>(offset);
14924 match decoder.read_num::<u8>(offset) {
14925 0 => Ok(()),
14926 _ => Err(fidl::Error::Invalid),
14927 }
14928 }
14929 }
14930
14931 impl AudioCompressedFormatCvsd {
14932 #[inline(always)]
14933 fn max_ordinal_present(&self) -> u64 {
14934 0
14935 }
14936 }
14937
14938 impl fidl::encoding::ValueTypeMarker for AudioCompressedFormatCvsd {
14939 type Borrowed<'a> = &'a Self;
14940 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
14941 value
14942 }
14943 }
14944
14945 unsafe impl fidl::encoding::TypeMarker for AudioCompressedFormatCvsd {
14946 type Owned = Self;
14947
14948 #[inline(always)]
14949 fn inline_align(_context: fidl::encoding::Context) -> usize {
14950 8
14951 }
14952
14953 #[inline(always)]
14954 fn inline_size(_context: fidl::encoding::Context) -> usize {
14955 16
14956 }
14957 }
14958
14959 unsafe impl<D: fidl::encoding::ResourceDialect>
14960 fidl::encoding::Encode<AudioCompressedFormatCvsd, D> for &AudioCompressedFormatCvsd
14961 {
14962 unsafe fn encode(
14963 self,
14964 encoder: &mut fidl::encoding::Encoder<'_, D>,
14965 offset: usize,
14966 mut depth: fidl::encoding::Depth,
14967 ) -> fidl::Result<()> {
14968 encoder.debug_check_bounds::<AudioCompressedFormatCvsd>(offset);
14969 let max_ordinal: u64 = self.max_ordinal_present();
14971 encoder.write_num(max_ordinal, offset);
14972 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
14973 if max_ordinal == 0 {
14975 return Ok(());
14976 }
14977 depth.increment()?;
14978 let envelope_size = 8;
14979 let bytes_len = max_ordinal as usize * envelope_size;
14980 #[allow(unused_variables)]
14981 let offset = encoder.out_of_line_offset(bytes_len);
14982 let mut _prev_end_offset: usize = 0;
14983
14984 Ok(())
14985 }
14986 }
14987
14988 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
14989 for AudioCompressedFormatCvsd
14990 {
14991 #[inline(always)]
14992 fn new_empty() -> Self {
14993 Self::default()
14994 }
14995
14996 unsafe fn decode(
14997 &mut self,
14998 decoder: &mut fidl::encoding::Decoder<'_, D>,
14999 offset: usize,
15000 mut depth: fidl::encoding::Depth,
15001 ) -> fidl::Result<()> {
15002 decoder.debug_check_bounds::<Self>(offset);
15003 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
15004 None => return Err(fidl::Error::NotNullable),
15005 Some(len) => len,
15006 };
15007 if len == 0 {
15009 return Ok(());
15010 };
15011 depth.increment()?;
15012 let envelope_size = 8;
15013 let bytes_len = len * envelope_size;
15014 let offset = decoder.out_of_line_offset(bytes_len)?;
15015 let mut _next_ordinal_to_read = 0;
15017 let mut next_offset = offset;
15018 let end_offset = offset + bytes_len;
15019
15020 while next_offset < end_offset {
15022 _next_ordinal_to_read += 1;
15023 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15024 next_offset += envelope_size;
15025 }
15026
15027 Ok(())
15028 }
15029 }
15030
15031 impl AudioCompressedFormatLc3 {
15032 #[inline(always)]
15033 fn max_ordinal_present(&self) -> u64 {
15034 0
15035 }
15036 }
15037
15038 impl fidl::encoding::ValueTypeMarker for AudioCompressedFormatLc3 {
15039 type Borrowed<'a> = &'a Self;
15040 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
15041 value
15042 }
15043 }
15044
15045 unsafe impl fidl::encoding::TypeMarker for AudioCompressedFormatLc3 {
15046 type Owned = Self;
15047
15048 #[inline(always)]
15049 fn inline_align(_context: fidl::encoding::Context) -> usize {
15050 8
15051 }
15052
15053 #[inline(always)]
15054 fn inline_size(_context: fidl::encoding::Context) -> usize {
15055 16
15056 }
15057 }
15058
15059 unsafe impl<D: fidl::encoding::ResourceDialect>
15060 fidl::encoding::Encode<AudioCompressedFormatLc3, D> for &AudioCompressedFormatLc3
15061 {
15062 unsafe fn encode(
15063 self,
15064 encoder: &mut fidl::encoding::Encoder<'_, D>,
15065 offset: usize,
15066 mut depth: fidl::encoding::Depth,
15067 ) -> fidl::Result<()> {
15068 encoder.debug_check_bounds::<AudioCompressedFormatLc3>(offset);
15069 let max_ordinal: u64 = self.max_ordinal_present();
15071 encoder.write_num(max_ordinal, offset);
15072 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
15073 if max_ordinal == 0 {
15075 return Ok(());
15076 }
15077 depth.increment()?;
15078 let envelope_size = 8;
15079 let bytes_len = max_ordinal as usize * envelope_size;
15080 #[allow(unused_variables)]
15081 let offset = encoder.out_of_line_offset(bytes_len);
15082 let mut _prev_end_offset: usize = 0;
15083
15084 Ok(())
15085 }
15086 }
15087
15088 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
15089 for AudioCompressedFormatLc3
15090 {
15091 #[inline(always)]
15092 fn new_empty() -> Self {
15093 Self::default()
15094 }
15095
15096 unsafe fn decode(
15097 &mut self,
15098 decoder: &mut fidl::encoding::Decoder<'_, D>,
15099 offset: usize,
15100 mut depth: fidl::encoding::Depth,
15101 ) -> fidl::Result<()> {
15102 decoder.debug_check_bounds::<Self>(offset);
15103 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
15104 None => return Err(fidl::Error::NotNullable),
15105 Some(len) => len,
15106 };
15107 if len == 0 {
15109 return Ok(());
15110 };
15111 depth.increment()?;
15112 let envelope_size = 8;
15113 let bytes_len = len * envelope_size;
15114 let offset = decoder.out_of_line_offset(bytes_len)?;
15115 let mut _next_ordinal_to_read = 0;
15117 let mut next_offset = offset;
15118 let end_offset = offset + bytes_len;
15119
15120 while next_offset < end_offset {
15122 _next_ordinal_to_read += 1;
15123 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15124 next_offset += envelope_size;
15125 }
15126
15127 Ok(())
15128 }
15129 }
15130
15131 impl AudioConsumerStatus {
15132 #[inline(always)]
15133 fn max_ordinal_present(&self) -> u64 {
15134 if let Some(_) = self.max_lead_time {
15135 return 4;
15136 }
15137 if let Some(_) = self.min_lead_time {
15138 return 3;
15139 }
15140 if let Some(_) = self.presentation_timeline {
15141 return 2;
15142 }
15143 if let Some(_) = self.error {
15144 return 1;
15145 }
15146 0
15147 }
15148 }
15149
15150 impl fidl::encoding::ValueTypeMarker for AudioConsumerStatus {
15151 type Borrowed<'a> = &'a Self;
15152 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
15153 value
15154 }
15155 }
15156
15157 unsafe impl fidl::encoding::TypeMarker for AudioConsumerStatus {
15158 type Owned = Self;
15159
15160 #[inline(always)]
15161 fn inline_align(_context: fidl::encoding::Context) -> usize {
15162 8
15163 }
15164
15165 #[inline(always)]
15166 fn inline_size(_context: fidl::encoding::Context) -> usize {
15167 16
15168 }
15169 }
15170
15171 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AudioConsumerStatus, D>
15172 for &AudioConsumerStatus
15173 {
15174 unsafe fn encode(
15175 self,
15176 encoder: &mut fidl::encoding::Encoder<'_, D>,
15177 offset: usize,
15178 mut depth: fidl::encoding::Depth,
15179 ) -> fidl::Result<()> {
15180 encoder.debug_check_bounds::<AudioConsumerStatus>(offset);
15181 let max_ordinal: u64 = self.max_ordinal_present();
15183 encoder.write_num(max_ordinal, offset);
15184 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
15185 if max_ordinal == 0 {
15187 return Ok(());
15188 }
15189 depth.increment()?;
15190 let envelope_size = 8;
15191 let bytes_len = max_ordinal as usize * envelope_size;
15192 #[allow(unused_variables)]
15193 let offset = encoder.out_of_line_offset(bytes_len);
15194 let mut _prev_end_offset: usize = 0;
15195 if 1 > max_ordinal {
15196 return Ok(());
15197 }
15198
15199 let cur_offset: usize = (1 - 1) * envelope_size;
15202
15203 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15205
15206 fidl::encoding::encode_in_envelope_optional::<AudioConsumerError, D>(
15211 self.error
15212 .as_ref()
15213 .map(<AudioConsumerError as fidl::encoding::ValueTypeMarker>::borrow),
15214 encoder,
15215 offset + cur_offset,
15216 depth,
15217 )?;
15218
15219 _prev_end_offset = cur_offset + envelope_size;
15220 if 2 > max_ordinal {
15221 return Ok(());
15222 }
15223
15224 let cur_offset: usize = (2 - 1) * envelope_size;
15227
15228 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15230
15231 fidl::encoding::encode_in_envelope_optional::<TimelineFunction, D>(
15236 self.presentation_timeline
15237 .as_ref()
15238 .map(<TimelineFunction as fidl::encoding::ValueTypeMarker>::borrow),
15239 encoder,
15240 offset + cur_offset,
15241 depth,
15242 )?;
15243
15244 _prev_end_offset = cur_offset + envelope_size;
15245 if 3 > max_ordinal {
15246 return Ok(());
15247 }
15248
15249 let cur_offset: usize = (3 - 1) * envelope_size;
15252
15253 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15255
15256 fidl::encoding::encode_in_envelope_optional::<u64, D>(
15261 self.min_lead_time.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
15262 encoder,
15263 offset + cur_offset,
15264 depth,
15265 )?;
15266
15267 _prev_end_offset = cur_offset + envelope_size;
15268 if 4 > max_ordinal {
15269 return Ok(());
15270 }
15271
15272 let cur_offset: usize = (4 - 1) * envelope_size;
15275
15276 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15278
15279 fidl::encoding::encode_in_envelope_optional::<u64, D>(
15284 self.max_lead_time.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
15285 encoder,
15286 offset + cur_offset,
15287 depth,
15288 )?;
15289
15290 _prev_end_offset = cur_offset + envelope_size;
15291
15292 Ok(())
15293 }
15294 }
15295
15296 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AudioConsumerStatus {
15297 #[inline(always)]
15298 fn new_empty() -> Self {
15299 Self::default()
15300 }
15301
15302 unsafe fn decode(
15303 &mut self,
15304 decoder: &mut fidl::encoding::Decoder<'_, D>,
15305 offset: usize,
15306 mut depth: fidl::encoding::Depth,
15307 ) -> fidl::Result<()> {
15308 decoder.debug_check_bounds::<Self>(offset);
15309 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
15310 None => return Err(fidl::Error::NotNullable),
15311 Some(len) => len,
15312 };
15313 if len == 0 {
15315 return Ok(());
15316 };
15317 depth.increment()?;
15318 let envelope_size = 8;
15319 let bytes_len = len * envelope_size;
15320 let offset = decoder.out_of_line_offset(bytes_len)?;
15321 let mut _next_ordinal_to_read = 0;
15323 let mut next_offset = offset;
15324 let end_offset = offset + bytes_len;
15325 _next_ordinal_to_read += 1;
15326 if next_offset >= end_offset {
15327 return Ok(());
15328 }
15329
15330 while _next_ordinal_to_read < 1 {
15332 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15333 _next_ordinal_to_read += 1;
15334 next_offset += envelope_size;
15335 }
15336
15337 let next_out_of_line = decoder.next_out_of_line();
15338 let handles_before = decoder.remaining_handles();
15339 if let Some((inlined, num_bytes, num_handles)) =
15340 fidl::encoding::decode_envelope_header(decoder, next_offset)?
15341 {
15342 let member_inline_size =
15343 <AudioConsumerError as fidl::encoding::TypeMarker>::inline_size(
15344 decoder.context,
15345 );
15346 if inlined != (member_inline_size <= 4) {
15347 return Err(fidl::Error::InvalidInlineBitInEnvelope);
15348 }
15349 let inner_offset;
15350 let mut inner_depth = depth.clone();
15351 if inlined {
15352 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15353 inner_offset = next_offset;
15354 } else {
15355 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15356 inner_depth.increment()?;
15357 }
15358 let val_ref =
15359 self.error.get_or_insert_with(|| fidl::new_empty!(AudioConsumerError, D));
15360 fidl::decode!(AudioConsumerError, D, val_ref, decoder, inner_offset, inner_depth)?;
15361 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15362 {
15363 return Err(fidl::Error::InvalidNumBytesInEnvelope);
15364 }
15365 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15366 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15367 }
15368 }
15369
15370 next_offset += envelope_size;
15371 _next_ordinal_to_read += 1;
15372 if next_offset >= end_offset {
15373 return Ok(());
15374 }
15375
15376 while _next_ordinal_to_read < 2 {
15378 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15379 _next_ordinal_to_read += 1;
15380 next_offset += envelope_size;
15381 }
15382
15383 let next_out_of_line = decoder.next_out_of_line();
15384 let handles_before = decoder.remaining_handles();
15385 if let Some((inlined, num_bytes, num_handles)) =
15386 fidl::encoding::decode_envelope_header(decoder, next_offset)?
15387 {
15388 let member_inline_size =
15389 <TimelineFunction as fidl::encoding::TypeMarker>::inline_size(decoder.context);
15390 if inlined != (member_inline_size <= 4) {
15391 return Err(fidl::Error::InvalidInlineBitInEnvelope);
15392 }
15393 let inner_offset;
15394 let mut inner_depth = depth.clone();
15395 if inlined {
15396 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15397 inner_offset = next_offset;
15398 } else {
15399 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15400 inner_depth.increment()?;
15401 }
15402 let val_ref = self
15403 .presentation_timeline
15404 .get_or_insert_with(|| fidl::new_empty!(TimelineFunction, D));
15405 fidl::decode!(TimelineFunction, D, val_ref, decoder, inner_offset, inner_depth)?;
15406 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15407 {
15408 return Err(fidl::Error::InvalidNumBytesInEnvelope);
15409 }
15410 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15411 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15412 }
15413 }
15414
15415 next_offset += envelope_size;
15416 _next_ordinal_to_read += 1;
15417 if next_offset >= end_offset {
15418 return Ok(());
15419 }
15420
15421 while _next_ordinal_to_read < 3 {
15423 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15424 _next_ordinal_to_read += 1;
15425 next_offset += envelope_size;
15426 }
15427
15428 let next_out_of_line = decoder.next_out_of_line();
15429 let handles_before = decoder.remaining_handles();
15430 if let Some((inlined, num_bytes, num_handles)) =
15431 fidl::encoding::decode_envelope_header(decoder, next_offset)?
15432 {
15433 let member_inline_size =
15434 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
15435 if inlined != (member_inline_size <= 4) {
15436 return Err(fidl::Error::InvalidInlineBitInEnvelope);
15437 }
15438 let inner_offset;
15439 let mut inner_depth = depth.clone();
15440 if inlined {
15441 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15442 inner_offset = next_offset;
15443 } else {
15444 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15445 inner_depth.increment()?;
15446 }
15447 let val_ref = self.min_lead_time.get_or_insert_with(|| fidl::new_empty!(u64, D));
15448 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
15449 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15450 {
15451 return Err(fidl::Error::InvalidNumBytesInEnvelope);
15452 }
15453 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15454 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15455 }
15456 }
15457
15458 next_offset += envelope_size;
15459 _next_ordinal_to_read += 1;
15460 if next_offset >= end_offset {
15461 return Ok(());
15462 }
15463
15464 while _next_ordinal_to_read < 4 {
15466 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15467 _next_ordinal_to_read += 1;
15468 next_offset += envelope_size;
15469 }
15470
15471 let next_out_of_line = decoder.next_out_of_line();
15472 let handles_before = decoder.remaining_handles();
15473 if let Some((inlined, num_bytes, num_handles)) =
15474 fidl::encoding::decode_envelope_header(decoder, next_offset)?
15475 {
15476 let member_inline_size =
15477 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
15478 if inlined != (member_inline_size <= 4) {
15479 return Err(fidl::Error::InvalidInlineBitInEnvelope);
15480 }
15481 let inner_offset;
15482 let mut inner_depth = depth.clone();
15483 if inlined {
15484 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15485 inner_offset = next_offset;
15486 } else {
15487 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15488 inner_depth.increment()?;
15489 }
15490 let val_ref = self.max_lead_time.get_or_insert_with(|| fidl::new_empty!(u64, D));
15491 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
15492 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15493 {
15494 return Err(fidl::Error::InvalidNumBytesInEnvelope);
15495 }
15496 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15497 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15498 }
15499 }
15500
15501 next_offset += envelope_size;
15502
15503 while next_offset < end_offset {
15505 _next_ordinal_to_read += 1;
15506 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15507 next_offset += envelope_size;
15508 }
15509
15510 Ok(())
15511 }
15512 }
15513
15514 impl CvsdEncoderSettings {
15515 #[inline(always)]
15516 fn max_ordinal_present(&self) -> u64 {
15517 0
15518 }
15519 }
15520
15521 impl fidl::encoding::ValueTypeMarker for CvsdEncoderSettings {
15522 type Borrowed<'a> = &'a Self;
15523 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
15524 value
15525 }
15526 }
15527
15528 unsafe impl fidl::encoding::TypeMarker for CvsdEncoderSettings {
15529 type Owned = Self;
15530
15531 #[inline(always)]
15532 fn inline_align(_context: fidl::encoding::Context) -> usize {
15533 8
15534 }
15535
15536 #[inline(always)]
15537 fn inline_size(_context: fidl::encoding::Context) -> usize {
15538 16
15539 }
15540 }
15541
15542 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<CvsdEncoderSettings, D>
15543 for &CvsdEncoderSettings
15544 {
15545 unsafe fn encode(
15546 self,
15547 encoder: &mut fidl::encoding::Encoder<'_, D>,
15548 offset: usize,
15549 mut depth: fidl::encoding::Depth,
15550 ) -> fidl::Result<()> {
15551 encoder.debug_check_bounds::<CvsdEncoderSettings>(offset);
15552 let max_ordinal: u64 = self.max_ordinal_present();
15554 encoder.write_num(max_ordinal, offset);
15555 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
15556 if max_ordinal == 0 {
15558 return Ok(());
15559 }
15560 depth.increment()?;
15561 let envelope_size = 8;
15562 let bytes_len = max_ordinal as usize * envelope_size;
15563 #[allow(unused_variables)]
15564 let offset = encoder.out_of_line_offset(bytes_len);
15565 let mut _prev_end_offset: usize = 0;
15566
15567 Ok(())
15568 }
15569 }
15570
15571 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CvsdEncoderSettings {
15572 #[inline(always)]
15573 fn new_empty() -> Self {
15574 Self::default()
15575 }
15576
15577 unsafe fn decode(
15578 &mut self,
15579 decoder: &mut fidl::encoding::Decoder<'_, D>,
15580 offset: usize,
15581 mut depth: fidl::encoding::Depth,
15582 ) -> fidl::Result<()> {
15583 decoder.debug_check_bounds::<Self>(offset);
15584 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
15585 None => return Err(fidl::Error::NotNullable),
15586 Some(len) => len,
15587 };
15588 if len == 0 {
15590 return Ok(());
15591 };
15592 depth.increment()?;
15593 let envelope_size = 8;
15594 let bytes_len = len * envelope_size;
15595 let offset = decoder.out_of_line_offset(bytes_len)?;
15596 let mut _next_ordinal_to_read = 0;
15598 let mut next_offset = offset;
15599 let end_offset = offset + bytes_len;
15600
15601 while next_offset < end_offset {
15603 _next_ordinal_to_read += 1;
15604 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15605 next_offset += envelope_size;
15606 }
15607
15608 Ok(())
15609 }
15610 }
15611
15612 impl DecryptedFormat {
15613 #[inline(always)]
15614 fn max_ordinal_present(&self) -> u64 {
15615 if let Some(_) = self.ignore_this_field {
15616 return 1;
15617 }
15618 0
15619 }
15620 }
15621
15622 impl fidl::encoding::ValueTypeMarker for DecryptedFormat {
15623 type Borrowed<'a> = &'a Self;
15624 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
15625 value
15626 }
15627 }
15628
15629 unsafe impl fidl::encoding::TypeMarker for DecryptedFormat {
15630 type Owned = Self;
15631
15632 #[inline(always)]
15633 fn inline_align(_context: fidl::encoding::Context) -> usize {
15634 8
15635 }
15636
15637 #[inline(always)]
15638 fn inline_size(_context: fidl::encoding::Context) -> usize {
15639 16
15640 }
15641 }
15642
15643 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DecryptedFormat, D>
15644 for &DecryptedFormat
15645 {
15646 unsafe fn encode(
15647 self,
15648 encoder: &mut fidl::encoding::Encoder<'_, D>,
15649 offset: usize,
15650 mut depth: fidl::encoding::Depth,
15651 ) -> fidl::Result<()> {
15652 encoder.debug_check_bounds::<DecryptedFormat>(offset);
15653 let max_ordinal: u64 = self.max_ordinal_present();
15655 encoder.write_num(max_ordinal, offset);
15656 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
15657 if max_ordinal == 0 {
15659 return Ok(());
15660 }
15661 depth.increment()?;
15662 let envelope_size = 8;
15663 let bytes_len = max_ordinal as usize * envelope_size;
15664 #[allow(unused_variables)]
15665 let offset = encoder.out_of_line_offset(bytes_len);
15666 let mut _prev_end_offset: usize = 0;
15667 if 1 > max_ordinal {
15668 return Ok(());
15669 }
15670
15671 let cur_offset: usize = (1 - 1) * envelope_size;
15674
15675 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15677
15678 fidl::encoding::encode_in_envelope_optional::<bool, D>(
15683 self.ignore_this_field
15684 .as_ref()
15685 .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
15686 encoder,
15687 offset + cur_offset,
15688 depth,
15689 )?;
15690
15691 _prev_end_offset = cur_offset + envelope_size;
15692
15693 Ok(())
15694 }
15695 }
15696
15697 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DecryptedFormat {
15698 #[inline(always)]
15699 fn new_empty() -> Self {
15700 Self::default()
15701 }
15702
15703 unsafe fn decode(
15704 &mut self,
15705 decoder: &mut fidl::encoding::Decoder<'_, D>,
15706 offset: usize,
15707 mut depth: fidl::encoding::Depth,
15708 ) -> fidl::Result<()> {
15709 decoder.debug_check_bounds::<Self>(offset);
15710 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
15711 None => return Err(fidl::Error::NotNullable),
15712 Some(len) => len,
15713 };
15714 if len == 0 {
15716 return Ok(());
15717 };
15718 depth.increment()?;
15719 let envelope_size = 8;
15720 let bytes_len = len * envelope_size;
15721 let offset = decoder.out_of_line_offset(bytes_len)?;
15722 let mut _next_ordinal_to_read = 0;
15724 let mut next_offset = offset;
15725 let end_offset = offset + bytes_len;
15726 _next_ordinal_to_read += 1;
15727 if next_offset >= end_offset {
15728 return Ok(());
15729 }
15730
15731 while _next_ordinal_to_read < 1 {
15733 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15734 _next_ordinal_to_read += 1;
15735 next_offset += envelope_size;
15736 }
15737
15738 let next_out_of_line = decoder.next_out_of_line();
15739 let handles_before = decoder.remaining_handles();
15740 if let Some((inlined, num_bytes, num_handles)) =
15741 fidl::encoding::decode_envelope_header(decoder, next_offset)?
15742 {
15743 let member_inline_size =
15744 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
15745 if inlined != (member_inline_size <= 4) {
15746 return Err(fidl::Error::InvalidInlineBitInEnvelope);
15747 }
15748 let inner_offset;
15749 let mut inner_depth = depth.clone();
15750 if inlined {
15751 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15752 inner_offset = next_offset;
15753 } else {
15754 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15755 inner_depth.increment()?;
15756 }
15757 let val_ref =
15758 self.ignore_this_field.get_or_insert_with(|| fidl::new_empty!(bool, D));
15759 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
15760 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15761 {
15762 return Err(fidl::Error::InvalidNumBytesInEnvelope);
15763 }
15764 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15765 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15766 }
15767 }
15768
15769 next_offset += envelope_size;
15770
15771 while next_offset < end_offset {
15773 _next_ordinal_to_read += 1;
15774 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15775 next_offset += envelope_size;
15776 }
15777
15778 Ok(())
15779 }
15780 }
15781
15782 impl EncryptedFormat {
15783 #[inline(always)]
15784 fn max_ordinal_present(&self) -> u64 {
15785 if let Some(_) = self.key_id {
15786 return 8;
15787 }
15788 if let Some(_) = self.scheme {
15789 return 6;
15790 }
15791 if let Some(_) = self.pattern {
15792 return 5;
15793 }
15794 if let Some(_) = self.subsamples {
15795 return 4;
15796 }
15797 if let Some(_) = self.init_vector {
15798 return 3;
15799 }
15800 0
15801 }
15802 }
15803
15804 impl fidl::encoding::ValueTypeMarker for EncryptedFormat {
15805 type Borrowed<'a> = &'a Self;
15806 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
15807 value
15808 }
15809 }
15810
15811 unsafe impl fidl::encoding::TypeMarker for EncryptedFormat {
15812 type Owned = Self;
15813
15814 #[inline(always)]
15815 fn inline_align(_context: fidl::encoding::Context) -> usize {
15816 8
15817 }
15818
15819 #[inline(always)]
15820 fn inline_size(_context: fidl::encoding::Context) -> usize {
15821 16
15822 }
15823 }
15824
15825 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<EncryptedFormat, D>
15826 for &EncryptedFormat
15827 {
15828 unsafe fn encode(
15829 self,
15830 encoder: &mut fidl::encoding::Encoder<'_, D>,
15831 offset: usize,
15832 mut depth: fidl::encoding::Depth,
15833 ) -> fidl::Result<()> {
15834 encoder.debug_check_bounds::<EncryptedFormat>(offset);
15835 let max_ordinal: u64 = self.max_ordinal_present();
15837 encoder.write_num(max_ordinal, offset);
15838 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
15839 if max_ordinal == 0 {
15841 return Ok(());
15842 }
15843 depth.increment()?;
15844 let envelope_size = 8;
15845 let bytes_len = max_ordinal as usize * envelope_size;
15846 #[allow(unused_variables)]
15847 let offset = encoder.out_of_line_offset(bytes_len);
15848 let mut _prev_end_offset: usize = 0;
15849 if 3 > max_ordinal {
15850 return Ok(());
15851 }
15852
15853 let cur_offset: usize = (3 - 1) * envelope_size;
15856
15857 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15859
15860 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u8, 16>, D>(
15865 self.init_vector.as_ref().map(
15866 <fidl::encoding::Vector<u8, 16> as fidl::encoding::ValueTypeMarker>::borrow,
15867 ),
15868 encoder,
15869 offset + cur_offset,
15870 depth,
15871 )?;
15872
15873 _prev_end_offset = cur_offset + envelope_size;
15874 if 4 > max_ordinal {
15875 return Ok(());
15876 }
15877
15878 let cur_offset: usize = (4 - 1) * envelope_size;
15881
15882 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15884
15885 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<SubsampleEntry>, D>(
15890 self.subsamples.as_ref().map(<fidl::encoding::UnboundedVector<SubsampleEntry> as fidl::encoding::ValueTypeMarker>::borrow),
15891 encoder, offset + cur_offset, depth
15892 )?;
15893
15894 _prev_end_offset = cur_offset + envelope_size;
15895 if 5 > max_ordinal {
15896 return Ok(());
15897 }
15898
15899 let cur_offset: usize = (5 - 1) * envelope_size;
15902
15903 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15905
15906 fidl::encoding::encode_in_envelope_optional::<EncryptionPattern, D>(
15911 self.pattern
15912 .as_ref()
15913 .map(<EncryptionPattern as fidl::encoding::ValueTypeMarker>::borrow),
15914 encoder,
15915 offset + cur_offset,
15916 depth,
15917 )?;
15918
15919 _prev_end_offset = cur_offset + envelope_size;
15920 if 6 > max_ordinal {
15921 return Ok(());
15922 }
15923
15924 let cur_offset: usize = (6 - 1) * envelope_size;
15927
15928 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15930
15931 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedString, D>(
15936 self.scheme.as_ref().map(
15937 <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow,
15938 ),
15939 encoder,
15940 offset + cur_offset,
15941 depth,
15942 )?;
15943
15944 _prev_end_offset = cur_offset + envelope_size;
15945 if 8 > max_ordinal {
15946 return Ok(());
15947 }
15948
15949 let cur_offset: usize = (8 - 1) * envelope_size;
15952
15953 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15955
15956 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u8, 16>, D>(
15961 self.key_id.as_ref().map(
15962 <fidl::encoding::Vector<u8, 16> as fidl::encoding::ValueTypeMarker>::borrow,
15963 ),
15964 encoder,
15965 offset + cur_offset,
15966 depth,
15967 )?;
15968
15969 _prev_end_offset = cur_offset + envelope_size;
15970
15971 Ok(())
15972 }
15973 }
15974
15975 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for EncryptedFormat {
15976 #[inline(always)]
15977 fn new_empty() -> Self {
15978 Self::default()
15979 }
15980
15981 unsafe fn decode(
15982 &mut self,
15983 decoder: &mut fidl::encoding::Decoder<'_, D>,
15984 offset: usize,
15985 mut depth: fidl::encoding::Depth,
15986 ) -> fidl::Result<()> {
15987 decoder.debug_check_bounds::<Self>(offset);
15988 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
15989 None => return Err(fidl::Error::NotNullable),
15990 Some(len) => len,
15991 };
15992 if len == 0 {
15994 return Ok(());
15995 };
15996 depth.increment()?;
15997 let envelope_size = 8;
15998 let bytes_len = len * envelope_size;
15999 let offset = decoder.out_of_line_offset(bytes_len)?;
16000 let mut _next_ordinal_to_read = 0;
16002 let mut next_offset = offset;
16003 let end_offset = offset + bytes_len;
16004 _next_ordinal_to_read += 1;
16005 if next_offset >= end_offset {
16006 return Ok(());
16007 }
16008
16009 while _next_ordinal_to_read < 3 {
16011 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16012 _next_ordinal_to_read += 1;
16013 next_offset += envelope_size;
16014 }
16015
16016 let next_out_of_line = decoder.next_out_of_line();
16017 let handles_before = decoder.remaining_handles();
16018 if let Some((inlined, num_bytes, num_handles)) =
16019 fidl::encoding::decode_envelope_header(decoder, next_offset)?
16020 {
16021 let member_inline_size =
16022 <fidl::encoding::Vector<u8, 16> as fidl::encoding::TypeMarker>::inline_size(
16023 decoder.context,
16024 );
16025 if inlined != (member_inline_size <= 4) {
16026 return Err(fidl::Error::InvalidInlineBitInEnvelope);
16027 }
16028 let inner_offset;
16029 let mut inner_depth = depth.clone();
16030 if inlined {
16031 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16032 inner_offset = next_offset;
16033 } else {
16034 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16035 inner_depth.increment()?;
16036 }
16037 let val_ref = self
16038 .init_vector
16039 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 16>, D));
16040 fidl::decode!(fidl::encoding::Vector<u8, 16>, D, val_ref, decoder, inner_offset, inner_depth)?;
16041 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16042 {
16043 return Err(fidl::Error::InvalidNumBytesInEnvelope);
16044 }
16045 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16046 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16047 }
16048 }
16049
16050 next_offset += envelope_size;
16051 _next_ordinal_to_read += 1;
16052 if next_offset >= end_offset {
16053 return Ok(());
16054 }
16055
16056 while _next_ordinal_to_read < 4 {
16058 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16059 _next_ordinal_to_read += 1;
16060 next_offset += envelope_size;
16061 }
16062
16063 let next_out_of_line = decoder.next_out_of_line();
16064 let handles_before = decoder.remaining_handles();
16065 if let Some((inlined, num_bytes, num_handles)) =
16066 fidl::encoding::decode_envelope_header(decoder, next_offset)?
16067 {
16068 let member_inline_size = <fidl::encoding::UnboundedVector<SubsampleEntry> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
16069 if inlined != (member_inline_size <= 4) {
16070 return Err(fidl::Error::InvalidInlineBitInEnvelope);
16071 }
16072 let inner_offset;
16073 let mut inner_depth = depth.clone();
16074 if inlined {
16075 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16076 inner_offset = next_offset;
16077 } else {
16078 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16079 inner_depth.increment()?;
16080 }
16081 let val_ref = self.subsamples.get_or_insert_with(|| {
16082 fidl::new_empty!(fidl::encoding::UnboundedVector<SubsampleEntry>, D)
16083 });
16084 fidl::decode!(
16085 fidl::encoding::UnboundedVector<SubsampleEntry>,
16086 D,
16087 val_ref,
16088 decoder,
16089 inner_offset,
16090 inner_depth
16091 )?;
16092 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16093 {
16094 return Err(fidl::Error::InvalidNumBytesInEnvelope);
16095 }
16096 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16097 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16098 }
16099 }
16100
16101 next_offset += envelope_size;
16102 _next_ordinal_to_read += 1;
16103 if next_offset >= end_offset {
16104 return Ok(());
16105 }
16106
16107 while _next_ordinal_to_read < 5 {
16109 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16110 _next_ordinal_to_read += 1;
16111 next_offset += envelope_size;
16112 }
16113
16114 let next_out_of_line = decoder.next_out_of_line();
16115 let handles_before = decoder.remaining_handles();
16116 if let Some((inlined, num_bytes, num_handles)) =
16117 fidl::encoding::decode_envelope_header(decoder, next_offset)?
16118 {
16119 let member_inline_size =
16120 <EncryptionPattern as fidl::encoding::TypeMarker>::inline_size(decoder.context);
16121 if inlined != (member_inline_size <= 4) {
16122 return Err(fidl::Error::InvalidInlineBitInEnvelope);
16123 }
16124 let inner_offset;
16125 let mut inner_depth = depth.clone();
16126 if inlined {
16127 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16128 inner_offset = next_offset;
16129 } else {
16130 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16131 inner_depth.increment()?;
16132 }
16133 let val_ref =
16134 self.pattern.get_or_insert_with(|| fidl::new_empty!(EncryptionPattern, D));
16135 fidl::decode!(EncryptionPattern, D, val_ref, decoder, inner_offset, inner_depth)?;
16136 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16137 {
16138 return Err(fidl::Error::InvalidNumBytesInEnvelope);
16139 }
16140 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16141 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16142 }
16143 }
16144
16145 next_offset += envelope_size;
16146 _next_ordinal_to_read += 1;
16147 if next_offset >= end_offset {
16148 return Ok(());
16149 }
16150
16151 while _next_ordinal_to_read < 6 {
16153 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16154 _next_ordinal_to_read += 1;
16155 next_offset += envelope_size;
16156 }
16157
16158 let next_out_of_line = decoder.next_out_of_line();
16159 let handles_before = decoder.remaining_handles();
16160 if let Some((inlined, num_bytes, num_handles)) =
16161 fidl::encoding::decode_envelope_header(decoder, next_offset)?
16162 {
16163 let member_inline_size =
16164 <fidl::encoding::UnboundedString as fidl::encoding::TypeMarker>::inline_size(
16165 decoder.context,
16166 );
16167 if inlined != (member_inline_size <= 4) {
16168 return Err(fidl::Error::InvalidInlineBitInEnvelope);
16169 }
16170 let inner_offset;
16171 let mut inner_depth = depth.clone();
16172 if inlined {
16173 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16174 inner_offset = next_offset;
16175 } else {
16176 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16177 inner_depth.increment()?;
16178 }
16179 let val_ref = self
16180 .scheme
16181 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::UnboundedString, D));
16182 fidl::decode!(
16183 fidl::encoding::UnboundedString,
16184 D,
16185 val_ref,
16186 decoder,
16187 inner_offset,
16188 inner_depth
16189 )?;
16190 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16191 {
16192 return Err(fidl::Error::InvalidNumBytesInEnvelope);
16193 }
16194 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16195 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16196 }
16197 }
16198
16199 next_offset += envelope_size;
16200 _next_ordinal_to_read += 1;
16201 if next_offset >= end_offset {
16202 return Ok(());
16203 }
16204
16205 while _next_ordinal_to_read < 8 {
16207 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16208 _next_ordinal_to_read += 1;
16209 next_offset += envelope_size;
16210 }
16211
16212 let next_out_of_line = decoder.next_out_of_line();
16213 let handles_before = decoder.remaining_handles();
16214 if let Some((inlined, num_bytes, num_handles)) =
16215 fidl::encoding::decode_envelope_header(decoder, next_offset)?
16216 {
16217 let member_inline_size =
16218 <fidl::encoding::Vector<u8, 16> as fidl::encoding::TypeMarker>::inline_size(
16219 decoder.context,
16220 );
16221 if inlined != (member_inline_size <= 4) {
16222 return Err(fidl::Error::InvalidInlineBitInEnvelope);
16223 }
16224 let inner_offset;
16225 let mut inner_depth = depth.clone();
16226 if inlined {
16227 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16228 inner_offset = next_offset;
16229 } else {
16230 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16231 inner_depth.increment()?;
16232 }
16233 let val_ref = self
16234 .key_id
16235 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 16>, D));
16236 fidl::decode!(fidl::encoding::Vector<u8, 16>, D, val_ref, decoder, inner_offset, inner_depth)?;
16237 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16238 {
16239 return Err(fidl::Error::InvalidNumBytesInEnvelope);
16240 }
16241 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16242 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16243 }
16244 }
16245
16246 next_offset += envelope_size;
16247
16248 while next_offset < end_offset {
16250 _next_ordinal_to_read += 1;
16251 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16252 next_offset += envelope_size;
16253 }
16254
16255 Ok(())
16256 }
16257 }
16258
16259 impl FormatDetails {
16260 #[inline(always)]
16261 fn max_ordinal_present(&self) -> u64 {
16262 if let Some(_) = self.profile {
16263 return 8;
16264 }
16265 if let Some(_) = self.timebase {
16266 return 7;
16267 }
16268 if let Some(_) = self.encoder_settings {
16269 return 6;
16270 }
16271 if let Some(_) = self.pass_through_parameters {
16272 return 5;
16273 }
16274 if let Some(_) = self.domain {
16275 return 4;
16276 }
16277 if let Some(_) = self.oob_bytes {
16278 return 3;
16279 }
16280 if let Some(_) = self.mime_type {
16281 return 2;
16282 }
16283 if let Some(_) = self.format_details_version_ordinal {
16284 return 1;
16285 }
16286 0
16287 }
16288 }
16289
16290 impl fidl::encoding::ValueTypeMarker for FormatDetails {
16291 type Borrowed<'a> = &'a Self;
16292 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
16293 value
16294 }
16295 }
16296
16297 unsafe impl fidl::encoding::TypeMarker for FormatDetails {
16298 type Owned = Self;
16299
16300 #[inline(always)]
16301 fn inline_align(_context: fidl::encoding::Context) -> usize {
16302 8
16303 }
16304
16305 #[inline(always)]
16306 fn inline_size(_context: fidl::encoding::Context) -> usize {
16307 16
16308 }
16309 }
16310
16311 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<FormatDetails, D>
16312 for &FormatDetails
16313 {
16314 unsafe fn encode(
16315 self,
16316 encoder: &mut fidl::encoding::Encoder<'_, D>,
16317 offset: usize,
16318 mut depth: fidl::encoding::Depth,
16319 ) -> fidl::Result<()> {
16320 encoder.debug_check_bounds::<FormatDetails>(offset);
16321 let max_ordinal: u64 = self.max_ordinal_present();
16323 encoder.write_num(max_ordinal, offset);
16324 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
16325 if max_ordinal == 0 {
16327 return Ok(());
16328 }
16329 depth.increment()?;
16330 let envelope_size = 8;
16331 let bytes_len = max_ordinal as usize * envelope_size;
16332 #[allow(unused_variables)]
16333 let offset = encoder.out_of_line_offset(bytes_len);
16334 let mut _prev_end_offset: usize = 0;
16335 if 1 > max_ordinal {
16336 return Ok(());
16337 }
16338
16339 let cur_offset: usize = (1 - 1) * envelope_size;
16342
16343 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16345
16346 fidl::encoding::encode_in_envelope_optional::<u64, D>(
16351 self.format_details_version_ordinal
16352 .as_ref()
16353 .map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
16354 encoder,
16355 offset + cur_offset,
16356 depth,
16357 )?;
16358
16359 _prev_end_offset = cur_offset + envelope_size;
16360 if 2 > max_ordinal {
16361 return Ok(());
16362 }
16363
16364 let cur_offset: usize = (2 - 1) * envelope_size;
16367
16368 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16370
16371 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedString, D>(
16376 self.mime_type.as_ref().map(
16377 <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow,
16378 ),
16379 encoder,
16380 offset + cur_offset,
16381 depth,
16382 )?;
16383
16384 _prev_end_offset = cur_offset + envelope_size;
16385 if 3 > max_ordinal {
16386 return Ok(());
16387 }
16388
16389 let cur_offset: usize = (3 - 1) * envelope_size;
16392
16393 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16395
16396 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<u8>, D>(
16401 self.oob_bytes.as_ref().map(<fidl::encoding::UnboundedVector<u8> as fidl::encoding::ValueTypeMarker>::borrow),
16402 encoder, offset + cur_offset, depth
16403 )?;
16404
16405 _prev_end_offset = cur_offset + envelope_size;
16406 if 4 > max_ordinal {
16407 return Ok(());
16408 }
16409
16410 let cur_offset: usize = (4 - 1) * envelope_size;
16413
16414 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16416
16417 fidl::encoding::encode_in_envelope_optional::<DomainFormat, D>(
16422 self.domain.as_ref().map(<DomainFormat as fidl::encoding::ValueTypeMarker>::borrow),
16423 encoder,
16424 offset + cur_offset,
16425 depth,
16426 )?;
16427
16428 _prev_end_offset = cur_offset + envelope_size;
16429 if 5 > max_ordinal {
16430 return Ok(());
16431 }
16432
16433 let cur_offset: usize = (5 - 1) * envelope_size;
16436
16437 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16439
16440 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<Parameter>, D>(
16445 self.pass_through_parameters.as_ref().map(<fidl::encoding::UnboundedVector<Parameter> as fidl::encoding::ValueTypeMarker>::borrow),
16446 encoder, offset + cur_offset, depth
16447 )?;
16448
16449 _prev_end_offset = cur_offset + envelope_size;
16450 if 6 > max_ordinal {
16451 return Ok(());
16452 }
16453
16454 let cur_offset: usize = (6 - 1) * envelope_size;
16457
16458 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16460
16461 fidl::encoding::encode_in_envelope_optional::<EncoderSettings, D>(
16466 self.encoder_settings
16467 .as_ref()
16468 .map(<EncoderSettings as fidl::encoding::ValueTypeMarker>::borrow),
16469 encoder,
16470 offset + cur_offset,
16471 depth,
16472 )?;
16473
16474 _prev_end_offset = cur_offset + envelope_size;
16475 if 7 > max_ordinal {
16476 return Ok(());
16477 }
16478
16479 let cur_offset: usize = (7 - 1) * envelope_size;
16482
16483 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16485
16486 fidl::encoding::encode_in_envelope_optional::<u64, D>(
16491 self.timebase.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
16492 encoder,
16493 offset + cur_offset,
16494 depth,
16495 )?;
16496
16497 _prev_end_offset = cur_offset + envelope_size;
16498 if 8 > max_ordinal {
16499 return Ok(());
16500 }
16501
16502 let cur_offset: usize = (8 - 1) * envelope_size;
16505
16506 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16508
16509 fidl::encoding::encode_in_envelope_optional::<CodecProfile, D>(
16514 self.profile
16515 .as_ref()
16516 .map(<CodecProfile as fidl::encoding::ValueTypeMarker>::borrow),
16517 encoder,
16518 offset + cur_offset,
16519 depth,
16520 )?;
16521
16522 _prev_end_offset = cur_offset + envelope_size;
16523
16524 Ok(())
16525 }
16526 }
16527
16528 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FormatDetails {
16529 #[inline(always)]
16530 fn new_empty() -> Self {
16531 Self::default()
16532 }
16533
16534 unsafe fn decode(
16535 &mut self,
16536 decoder: &mut fidl::encoding::Decoder<'_, D>,
16537 offset: usize,
16538 mut depth: fidl::encoding::Depth,
16539 ) -> fidl::Result<()> {
16540 decoder.debug_check_bounds::<Self>(offset);
16541 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
16542 None => return Err(fidl::Error::NotNullable),
16543 Some(len) => len,
16544 };
16545 if len == 0 {
16547 return Ok(());
16548 };
16549 depth.increment()?;
16550 let envelope_size = 8;
16551 let bytes_len = len * envelope_size;
16552 let offset = decoder.out_of_line_offset(bytes_len)?;
16553 let mut _next_ordinal_to_read = 0;
16555 let mut next_offset = offset;
16556 let end_offset = offset + bytes_len;
16557 _next_ordinal_to_read += 1;
16558 if next_offset >= end_offset {
16559 return Ok(());
16560 }
16561
16562 while _next_ordinal_to_read < 1 {
16564 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16565 _next_ordinal_to_read += 1;
16566 next_offset += envelope_size;
16567 }
16568
16569 let next_out_of_line = decoder.next_out_of_line();
16570 let handles_before = decoder.remaining_handles();
16571 if let Some((inlined, num_bytes, num_handles)) =
16572 fidl::encoding::decode_envelope_header(decoder, next_offset)?
16573 {
16574 let member_inline_size =
16575 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
16576 if inlined != (member_inline_size <= 4) {
16577 return Err(fidl::Error::InvalidInlineBitInEnvelope);
16578 }
16579 let inner_offset;
16580 let mut inner_depth = depth.clone();
16581 if inlined {
16582 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16583 inner_offset = next_offset;
16584 } else {
16585 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16586 inner_depth.increment()?;
16587 }
16588 let val_ref = self
16589 .format_details_version_ordinal
16590 .get_or_insert_with(|| fidl::new_empty!(u64, D));
16591 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
16592 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16593 {
16594 return Err(fidl::Error::InvalidNumBytesInEnvelope);
16595 }
16596 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16597 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16598 }
16599 }
16600
16601 next_offset += envelope_size;
16602 _next_ordinal_to_read += 1;
16603 if next_offset >= end_offset {
16604 return Ok(());
16605 }
16606
16607 while _next_ordinal_to_read < 2 {
16609 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16610 _next_ordinal_to_read += 1;
16611 next_offset += envelope_size;
16612 }
16613
16614 let next_out_of_line = decoder.next_out_of_line();
16615 let handles_before = decoder.remaining_handles();
16616 if let Some((inlined, num_bytes, num_handles)) =
16617 fidl::encoding::decode_envelope_header(decoder, next_offset)?
16618 {
16619 let member_inline_size =
16620 <fidl::encoding::UnboundedString as fidl::encoding::TypeMarker>::inline_size(
16621 decoder.context,
16622 );
16623 if inlined != (member_inline_size <= 4) {
16624 return Err(fidl::Error::InvalidInlineBitInEnvelope);
16625 }
16626 let inner_offset;
16627 let mut inner_depth = depth.clone();
16628 if inlined {
16629 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16630 inner_offset = next_offset;
16631 } else {
16632 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16633 inner_depth.increment()?;
16634 }
16635 let val_ref = self
16636 .mime_type
16637 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::UnboundedString, D));
16638 fidl::decode!(
16639 fidl::encoding::UnboundedString,
16640 D,
16641 val_ref,
16642 decoder,
16643 inner_offset,
16644 inner_depth
16645 )?;
16646 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16647 {
16648 return Err(fidl::Error::InvalidNumBytesInEnvelope);
16649 }
16650 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16651 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16652 }
16653 }
16654
16655 next_offset += envelope_size;
16656 _next_ordinal_to_read += 1;
16657 if next_offset >= end_offset {
16658 return Ok(());
16659 }
16660
16661 while _next_ordinal_to_read < 3 {
16663 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16664 _next_ordinal_to_read += 1;
16665 next_offset += envelope_size;
16666 }
16667
16668 let next_out_of_line = decoder.next_out_of_line();
16669 let handles_before = decoder.remaining_handles();
16670 if let Some((inlined, num_bytes, num_handles)) =
16671 fidl::encoding::decode_envelope_header(decoder, next_offset)?
16672 {
16673 let member_inline_size = <fidl::encoding::UnboundedVector<u8> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
16674 if inlined != (member_inline_size <= 4) {
16675 return Err(fidl::Error::InvalidInlineBitInEnvelope);
16676 }
16677 let inner_offset;
16678 let mut inner_depth = depth.clone();
16679 if inlined {
16680 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16681 inner_offset = next_offset;
16682 } else {
16683 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16684 inner_depth.increment()?;
16685 }
16686 let val_ref = self.oob_bytes.get_or_insert_with(|| {
16687 fidl::new_empty!(fidl::encoding::UnboundedVector<u8>, D)
16688 });
16689 fidl::decode!(
16690 fidl::encoding::UnboundedVector<u8>,
16691 D,
16692 val_ref,
16693 decoder,
16694 inner_offset,
16695 inner_depth
16696 )?;
16697 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16698 {
16699 return Err(fidl::Error::InvalidNumBytesInEnvelope);
16700 }
16701 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16702 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16703 }
16704 }
16705
16706 next_offset += envelope_size;
16707 _next_ordinal_to_read += 1;
16708 if next_offset >= end_offset {
16709 return Ok(());
16710 }
16711
16712 while _next_ordinal_to_read < 4 {
16714 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16715 _next_ordinal_to_read += 1;
16716 next_offset += envelope_size;
16717 }
16718
16719 let next_out_of_line = decoder.next_out_of_line();
16720 let handles_before = decoder.remaining_handles();
16721 if let Some((inlined, num_bytes, num_handles)) =
16722 fidl::encoding::decode_envelope_header(decoder, next_offset)?
16723 {
16724 let member_inline_size =
16725 <DomainFormat as fidl::encoding::TypeMarker>::inline_size(decoder.context);
16726 if inlined != (member_inline_size <= 4) {
16727 return Err(fidl::Error::InvalidInlineBitInEnvelope);
16728 }
16729 let inner_offset;
16730 let mut inner_depth = depth.clone();
16731 if inlined {
16732 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16733 inner_offset = next_offset;
16734 } else {
16735 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16736 inner_depth.increment()?;
16737 }
16738 let val_ref = self.domain.get_or_insert_with(|| fidl::new_empty!(DomainFormat, D));
16739 fidl::decode!(DomainFormat, D, val_ref, decoder, inner_offset, inner_depth)?;
16740 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16741 {
16742 return Err(fidl::Error::InvalidNumBytesInEnvelope);
16743 }
16744 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16745 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16746 }
16747 }
16748
16749 next_offset += envelope_size;
16750 _next_ordinal_to_read += 1;
16751 if next_offset >= end_offset {
16752 return Ok(());
16753 }
16754
16755 while _next_ordinal_to_read < 5 {
16757 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16758 _next_ordinal_to_read += 1;
16759 next_offset += envelope_size;
16760 }
16761
16762 let next_out_of_line = decoder.next_out_of_line();
16763 let handles_before = decoder.remaining_handles();
16764 if let Some((inlined, num_bytes, num_handles)) =
16765 fidl::encoding::decode_envelope_header(decoder, next_offset)?
16766 {
16767 let member_inline_size = <fidl::encoding::UnboundedVector<Parameter> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
16768 if inlined != (member_inline_size <= 4) {
16769 return Err(fidl::Error::InvalidInlineBitInEnvelope);
16770 }
16771 let inner_offset;
16772 let mut inner_depth = depth.clone();
16773 if inlined {
16774 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16775 inner_offset = next_offset;
16776 } else {
16777 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16778 inner_depth.increment()?;
16779 }
16780 let val_ref = self.pass_through_parameters.get_or_insert_with(|| {
16781 fidl::new_empty!(fidl::encoding::UnboundedVector<Parameter>, D)
16782 });
16783 fidl::decode!(
16784 fidl::encoding::UnboundedVector<Parameter>,
16785 D,
16786 val_ref,
16787 decoder,
16788 inner_offset,
16789 inner_depth
16790 )?;
16791 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16792 {
16793 return Err(fidl::Error::InvalidNumBytesInEnvelope);
16794 }
16795 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16796 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16797 }
16798 }
16799
16800 next_offset += envelope_size;
16801 _next_ordinal_to_read += 1;
16802 if next_offset >= end_offset {
16803 return Ok(());
16804 }
16805
16806 while _next_ordinal_to_read < 6 {
16808 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16809 _next_ordinal_to_read += 1;
16810 next_offset += envelope_size;
16811 }
16812
16813 let next_out_of_line = decoder.next_out_of_line();
16814 let handles_before = decoder.remaining_handles();
16815 if let Some((inlined, num_bytes, num_handles)) =
16816 fidl::encoding::decode_envelope_header(decoder, next_offset)?
16817 {
16818 let member_inline_size =
16819 <EncoderSettings as fidl::encoding::TypeMarker>::inline_size(decoder.context);
16820 if inlined != (member_inline_size <= 4) {
16821 return Err(fidl::Error::InvalidInlineBitInEnvelope);
16822 }
16823 let inner_offset;
16824 let mut inner_depth = depth.clone();
16825 if inlined {
16826 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16827 inner_offset = next_offset;
16828 } else {
16829 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16830 inner_depth.increment()?;
16831 }
16832 let val_ref = self
16833 .encoder_settings
16834 .get_or_insert_with(|| fidl::new_empty!(EncoderSettings, D));
16835 fidl::decode!(EncoderSettings, D, val_ref, decoder, inner_offset, inner_depth)?;
16836 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16837 {
16838 return Err(fidl::Error::InvalidNumBytesInEnvelope);
16839 }
16840 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16841 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16842 }
16843 }
16844
16845 next_offset += envelope_size;
16846 _next_ordinal_to_read += 1;
16847 if next_offset >= end_offset {
16848 return Ok(());
16849 }
16850
16851 while _next_ordinal_to_read < 7 {
16853 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16854 _next_ordinal_to_read += 1;
16855 next_offset += envelope_size;
16856 }
16857
16858 let next_out_of_line = decoder.next_out_of_line();
16859 let handles_before = decoder.remaining_handles();
16860 if let Some((inlined, num_bytes, num_handles)) =
16861 fidl::encoding::decode_envelope_header(decoder, next_offset)?
16862 {
16863 let member_inline_size =
16864 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
16865 if inlined != (member_inline_size <= 4) {
16866 return Err(fidl::Error::InvalidInlineBitInEnvelope);
16867 }
16868 let inner_offset;
16869 let mut inner_depth = depth.clone();
16870 if inlined {
16871 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16872 inner_offset = next_offset;
16873 } else {
16874 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16875 inner_depth.increment()?;
16876 }
16877 let val_ref = self.timebase.get_or_insert_with(|| fidl::new_empty!(u64, D));
16878 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
16879 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16880 {
16881 return Err(fidl::Error::InvalidNumBytesInEnvelope);
16882 }
16883 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16884 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16885 }
16886 }
16887
16888 next_offset += envelope_size;
16889 _next_ordinal_to_read += 1;
16890 if next_offset >= end_offset {
16891 return Ok(());
16892 }
16893
16894 while _next_ordinal_to_read < 8 {
16896 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16897 _next_ordinal_to_read += 1;
16898 next_offset += envelope_size;
16899 }
16900
16901 let next_out_of_line = decoder.next_out_of_line();
16902 let handles_before = decoder.remaining_handles();
16903 if let Some((inlined, num_bytes, num_handles)) =
16904 fidl::encoding::decode_envelope_header(decoder, next_offset)?
16905 {
16906 let member_inline_size =
16907 <CodecProfile as fidl::encoding::TypeMarker>::inline_size(decoder.context);
16908 if inlined != (member_inline_size <= 4) {
16909 return Err(fidl::Error::InvalidInlineBitInEnvelope);
16910 }
16911 let inner_offset;
16912 let mut inner_depth = depth.clone();
16913 if inlined {
16914 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16915 inner_offset = next_offset;
16916 } else {
16917 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16918 inner_depth.increment()?;
16919 }
16920 let val_ref = self.profile.get_or_insert_with(|| fidl::new_empty!(CodecProfile, D));
16921 fidl::decode!(CodecProfile, D, val_ref, decoder, inner_offset, inner_depth)?;
16922 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16923 {
16924 return Err(fidl::Error::InvalidNumBytesInEnvelope);
16925 }
16926 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16927 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16928 }
16929 }
16930
16931 next_offset += envelope_size;
16932
16933 while next_offset < end_offset {
16935 _next_ordinal_to_read += 1;
16936 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16937 next_offset += envelope_size;
16938 }
16939
16940 Ok(())
16941 }
16942 }
16943
16944 impl H264EncoderSettings {
16945 #[inline(always)]
16946 fn max_ordinal_present(&self) -> u64 {
16947 if let Some(_) = self.quantization_params {
16948 return 7;
16949 }
16950 if let Some(_) = self.force_key_frame {
16951 return 6;
16952 }
16953 if let Some(_) = self.min_frame_rate {
16954 return 5;
16955 }
16956 if let Some(_) = self.variable_frame_rate {
16957 return 4;
16958 }
16959 if let Some(_) = self.gop_size {
16960 return 3;
16961 }
16962 if let Some(_) = self.frame_rate {
16963 return 2;
16964 }
16965 if let Some(_) = self.bit_rate {
16966 return 1;
16967 }
16968 0
16969 }
16970 }
16971
16972 impl fidl::encoding::ValueTypeMarker for H264EncoderSettings {
16973 type Borrowed<'a> = &'a Self;
16974 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
16975 value
16976 }
16977 }
16978
16979 unsafe impl fidl::encoding::TypeMarker for H264EncoderSettings {
16980 type Owned = Self;
16981
16982 #[inline(always)]
16983 fn inline_align(_context: fidl::encoding::Context) -> usize {
16984 8
16985 }
16986
16987 #[inline(always)]
16988 fn inline_size(_context: fidl::encoding::Context) -> usize {
16989 16
16990 }
16991 }
16992
16993 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<H264EncoderSettings, D>
16994 for &H264EncoderSettings
16995 {
16996 unsafe fn encode(
16997 self,
16998 encoder: &mut fidl::encoding::Encoder<'_, D>,
16999 offset: usize,
17000 mut depth: fidl::encoding::Depth,
17001 ) -> fidl::Result<()> {
17002 encoder.debug_check_bounds::<H264EncoderSettings>(offset);
17003 let max_ordinal: u64 = self.max_ordinal_present();
17005 encoder.write_num(max_ordinal, offset);
17006 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
17007 if max_ordinal == 0 {
17009 return Ok(());
17010 }
17011 depth.increment()?;
17012 let envelope_size = 8;
17013 let bytes_len = max_ordinal as usize * envelope_size;
17014 #[allow(unused_variables)]
17015 let offset = encoder.out_of_line_offset(bytes_len);
17016 let mut _prev_end_offset: usize = 0;
17017 if 1 > max_ordinal {
17018 return Ok(());
17019 }
17020
17021 let cur_offset: usize = (1 - 1) * envelope_size;
17024
17025 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17027
17028 fidl::encoding::encode_in_envelope_optional::<u32, D>(
17033 self.bit_rate.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
17034 encoder,
17035 offset + cur_offset,
17036 depth,
17037 )?;
17038
17039 _prev_end_offset = cur_offset + envelope_size;
17040 if 2 > max_ordinal {
17041 return Ok(());
17042 }
17043
17044 let cur_offset: usize = (2 - 1) * envelope_size;
17047
17048 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17050
17051 fidl::encoding::encode_in_envelope_optional::<u32, D>(
17056 self.frame_rate.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
17057 encoder,
17058 offset + cur_offset,
17059 depth,
17060 )?;
17061
17062 _prev_end_offset = cur_offset + envelope_size;
17063 if 3 > max_ordinal {
17064 return Ok(());
17065 }
17066
17067 let cur_offset: usize = (3 - 1) * envelope_size;
17070
17071 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17073
17074 fidl::encoding::encode_in_envelope_optional::<u32, D>(
17079 self.gop_size.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
17080 encoder,
17081 offset + cur_offset,
17082 depth,
17083 )?;
17084
17085 _prev_end_offset = cur_offset + envelope_size;
17086 if 4 > max_ordinal {
17087 return Ok(());
17088 }
17089
17090 let cur_offset: usize = (4 - 1) * envelope_size;
17093
17094 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17096
17097 fidl::encoding::encode_in_envelope_optional::<bool, D>(
17102 self.variable_frame_rate
17103 .as_ref()
17104 .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
17105 encoder,
17106 offset + cur_offset,
17107 depth,
17108 )?;
17109
17110 _prev_end_offset = cur_offset + envelope_size;
17111 if 5 > max_ordinal {
17112 return Ok(());
17113 }
17114
17115 let cur_offset: usize = (5 - 1) * envelope_size;
17118
17119 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17121
17122 fidl::encoding::encode_in_envelope_optional::<u32, D>(
17127 self.min_frame_rate.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
17128 encoder,
17129 offset + cur_offset,
17130 depth,
17131 )?;
17132
17133 _prev_end_offset = cur_offset + envelope_size;
17134 if 6 > max_ordinal {
17135 return Ok(());
17136 }
17137
17138 let cur_offset: usize = (6 - 1) * envelope_size;
17141
17142 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17144
17145 fidl::encoding::encode_in_envelope_optional::<bool, D>(
17150 self.force_key_frame
17151 .as_ref()
17152 .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
17153 encoder,
17154 offset + cur_offset,
17155 depth,
17156 )?;
17157
17158 _prev_end_offset = cur_offset + envelope_size;
17159 if 7 > max_ordinal {
17160 return Ok(());
17161 }
17162
17163 let cur_offset: usize = (7 - 1) * envelope_size;
17166
17167 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17169
17170 fidl::encoding::encode_in_envelope_optional::<H264QuantizationParameters, D>(
17175 self.quantization_params
17176 .as_ref()
17177 .map(<H264QuantizationParameters as fidl::encoding::ValueTypeMarker>::borrow),
17178 encoder,
17179 offset + cur_offset,
17180 depth,
17181 )?;
17182
17183 _prev_end_offset = cur_offset + envelope_size;
17184
17185 Ok(())
17186 }
17187 }
17188
17189 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for H264EncoderSettings {
17190 #[inline(always)]
17191 fn new_empty() -> Self {
17192 Self::default()
17193 }
17194
17195 unsafe fn decode(
17196 &mut self,
17197 decoder: &mut fidl::encoding::Decoder<'_, D>,
17198 offset: usize,
17199 mut depth: fidl::encoding::Depth,
17200 ) -> fidl::Result<()> {
17201 decoder.debug_check_bounds::<Self>(offset);
17202 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
17203 None => return Err(fidl::Error::NotNullable),
17204 Some(len) => len,
17205 };
17206 if len == 0 {
17208 return Ok(());
17209 };
17210 depth.increment()?;
17211 let envelope_size = 8;
17212 let bytes_len = len * envelope_size;
17213 let offset = decoder.out_of_line_offset(bytes_len)?;
17214 let mut _next_ordinal_to_read = 0;
17216 let mut next_offset = offset;
17217 let end_offset = offset + bytes_len;
17218 _next_ordinal_to_read += 1;
17219 if next_offset >= end_offset {
17220 return Ok(());
17221 }
17222
17223 while _next_ordinal_to_read < 1 {
17225 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17226 _next_ordinal_to_read += 1;
17227 next_offset += envelope_size;
17228 }
17229
17230 let next_out_of_line = decoder.next_out_of_line();
17231 let handles_before = decoder.remaining_handles();
17232 if let Some((inlined, num_bytes, num_handles)) =
17233 fidl::encoding::decode_envelope_header(decoder, next_offset)?
17234 {
17235 let member_inline_size =
17236 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
17237 if inlined != (member_inline_size <= 4) {
17238 return Err(fidl::Error::InvalidInlineBitInEnvelope);
17239 }
17240 let inner_offset;
17241 let mut inner_depth = depth.clone();
17242 if inlined {
17243 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17244 inner_offset = next_offset;
17245 } else {
17246 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17247 inner_depth.increment()?;
17248 }
17249 let val_ref = self.bit_rate.get_or_insert_with(|| fidl::new_empty!(u32, D));
17250 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
17251 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17252 {
17253 return Err(fidl::Error::InvalidNumBytesInEnvelope);
17254 }
17255 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17256 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17257 }
17258 }
17259
17260 next_offset += envelope_size;
17261 _next_ordinal_to_read += 1;
17262 if next_offset >= end_offset {
17263 return Ok(());
17264 }
17265
17266 while _next_ordinal_to_read < 2 {
17268 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17269 _next_ordinal_to_read += 1;
17270 next_offset += envelope_size;
17271 }
17272
17273 let next_out_of_line = decoder.next_out_of_line();
17274 let handles_before = decoder.remaining_handles();
17275 if let Some((inlined, num_bytes, num_handles)) =
17276 fidl::encoding::decode_envelope_header(decoder, next_offset)?
17277 {
17278 let member_inline_size =
17279 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
17280 if inlined != (member_inline_size <= 4) {
17281 return Err(fidl::Error::InvalidInlineBitInEnvelope);
17282 }
17283 let inner_offset;
17284 let mut inner_depth = depth.clone();
17285 if inlined {
17286 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17287 inner_offset = next_offset;
17288 } else {
17289 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17290 inner_depth.increment()?;
17291 }
17292 let val_ref = self.frame_rate.get_or_insert_with(|| fidl::new_empty!(u32, D));
17293 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
17294 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17295 {
17296 return Err(fidl::Error::InvalidNumBytesInEnvelope);
17297 }
17298 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17299 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17300 }
17301 }
17302
17303 next_offset += envelope_size;
17304 _next_ordinal_to_read += 1;
17305 if next_offset >= end_offset {
17306 return Ok(());
17307 }
17308
17309 while _next_ordinal_to_read < 3 {
17311 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17312 _next_ordinal_to_read += 1;
17313 next_offset += envelope_size;
17314 }
17315
17316 let next_out_of_line = decoder.next_out_of_line();
17317 let handles_before = decoder.remaining_handles();
17318 if let Some((inlined, num_bytes, num_handles)) =
17319 fidl::encoding::decode_envelope_header(decoder, next_offset)?
17320 {
17321 let member_inline_size =
17322 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
17323 if inlined != (member_inline_size <= 4) {
17324 return Err(fidl::Error::InvalidInlineBitInEnvelope);
17325 }
17326 let inner_offset;
17327 let mut inner_depth = depth.clone();
17328 if inlined {
17329 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17330 inner_offset = next_offset;
17331 } else {
17332 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17333 inner_depth.increment()?;
17334 }
17335 let val_ref = self.gop_size.get_or_insert_with(|| fidl::new_empty!(u32, D));
17336 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
17337 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17338 {
17339 return Err(fidl::Error::InvalidNumBytesInEnvelope);
17340 }
17341 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17342 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17343 }
17344 }
17345
17346 next_offset += envelope_size;
17347 _next_ordinal_to_read += 1;
17348 if next_offset >= end_offset {
17349 return Ok(());
17350 }
17351
17352 while _next_ordinal_to_read < 4 {
17354 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17355 _next_ordinal_to_read += 1;
17356 next_offset += envelope_size;
17357 }
17358
17359 let next_out_of_line = decoder.next_out_of_line();
17360 let handles_before = decoder.remaining_handles();
17361 if let Some((inlined, num_bytes, num_handles)) =
17362 fidl::encoding::decode_envelope_header(decoder, next_offset)?
17363 {
17364 let member_inline_size =
17365 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
17366 if inlined != (member_inline_size <= 4) {
17367 return Err(fidl::Error::InvalidInlineBitInEnvelope);
17368 }
17369 let inner_offset;
17370 let mut inner_depth = depth.clone();
17371 if inlined {
17372 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17373 inner_offset = next_offset;
17374 } else {
17375 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17376 inner_depth.increment()?;
17377 }
17378 let val_ref =
17379 self.variable_frame_rate.get_or_insert_with(|| fidl::new_empty!(bool, D));
17380 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
17381 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17382 {
17383 return Err(fidl::Error::InvalidNumBytesInEnvelope);
17384 }
17385 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17386 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17387 }
17388 }
17389
17390 next_offset += envelope_size;
17391 _next_ordinal_to_read += 1;
17392 if next_offset >= end_offset {
17393 return Ok(());
17394 }
17395
17396 while _next_ordinal_to_read < 5 {
17398 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17399 _next_ordinal_to_read += 1;
17400 next_offset += envelope_size;
17401 }
17402
17403 let next_out_of_line = decoder.next_out_of_line();
17404 let handles_before = decoder.remaining_handles();
17405 if let Some((inlined, num_bytes, num_handles)) =
17406 fidl::encoding::decode_envelope_header(decoder, next_offset)?
17407 {
17408 let member_inline_size =
17409 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
17410 if inlined != (member_inline_size <= 4) {
17411 return Err(fidl::Error::InvalidInlineBitInEnvelope);
17412 }
17413 let inner_offset;
17414 let mut inner_depth = depth.clone();
17415 if inlined {
17416 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17417 inner_offset = next_offset;
17418 } else {
17419 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17420 inner_depth.increment()?;
17421 }
17422 let val_ref = self.min_frame_rate.get_or_insert_with(|| fidl::new_empty!(u32, D));
17423 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
17424 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17425 {
17426 return Err(fidl::Error::InvalidNumBytesInEnvelope);
17427 }
17428 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17429 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17430 }
17431 }
17432
17433 next_offset += envelope_size;
17434 _next_ordinal_to_read += 1;
17435 if next_offset >= end_offset {
17436 return Ok(());
17437 }
17438
17439 while _next_ordinal_to_read < 6 {
17441 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17442 _next_ordinal_to_read += 1;
17443 next_offset += envelope_size;
17444 }
17445
17446 let next_out_of_line = decoder.next_out_of_line();
17447 let handles_before = decoder.remaining_handles();
17448 if let Some((inlined, num_bytes, num_handles)) =
17449 fidl::encoding::decode_envelope_header(decoder, next_offset)?
17450 {
17451 let member_inline_size =
17452 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
17453 if inlined != (member_inline_size <= 4) {
17454 return Err(fidl::Error::InvalidInlineBitInEnvelope);
17455 }
17456 let inner_offset;
17457 let mut inner_depth = depth.clone();
17458 if inlined {
17459 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17460 inner_offset = next_offset;
17461 } else {
17462 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17463 inner_depth.increment()?;
17464 }
17465 let val_ref = self.force_key_frame.get_or_insert_with(|| fidl::new_empty!(bool, D));
17466 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
17467 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17468 {
17469 return Err(fidl::Error::InvalidNumBytesInEnvelope);
17470 }
17471 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17472 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17473 }
17474 }
17475
17476 next_offset += envelope_size;
17477 _next_ordinal_to_read += 1;
17478 if next_offset >= end_offset {
17479 return Ok(());
17480 }
17481
17482 while _next_ordinal_to_read < 7 {
17484 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17485 _next_ordinal_to_read += 1;
17486 next_offset += envelope_size;
17487 }
17488
17489 let next_out_of_line = decoder.next_out_of_line();
17490 let handles_before = decoder.remaining_handles();
17491 if let Some((inlined, num_bytes, num_handles)) =
17492 fidl::encoding::decode_envelope_header(decoder, next_offset)?
17493 {
17494 let member_inline_size =
17495 <H264QuantizationParameters as fidl::encoding::TypeMarker>::inline_size(
17496 decoder.context,
17497 );
17498 if inlined != (member_inline_size <= 4) {
17499 return Err(fidl::Error::InvalidInlineBitInEnvelope);
17500 }
17501 let inner_offset;
17502 let mut inner_depth = depth.clone();
17503 if inlined {
17504 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17505 inner_offset = next_offset;
17506 } else {
17507 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17508 inner_depth.increment()?;
17509 }
17510 let val_ref = self
17511 .quantization_params
17512 .get_or_insert_with(|| fidl::new_empty!(H264QuantizationParameters, D));
17513 fidl::decode!(
17514 H264QuantizationParameters,
17515 D,
17516 val_ref,
17517 decoder,
17518 inner_offset,
17519 inner_depth
17520 )?;
17521 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17522 {
17523 return Err(fidl::Error::InvalidNumBytesInEnvelope);
17524 }
17525 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17526 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17527 }
17528 }
17529
17530 next_offset += envelope_size;
17531
17532 while next_offset < end_offset {
17534 _next_ordinal_to_read += 1;
17535 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17536 next_offset += envelope_size;
17537 }
17538
17539 Ok(())
17540 }
17541 }
17542
17543 impl H264QuantizationParameters {
17544 #[inline(always)]
17545 fn max_ordinal_present(&self) -> u64 {
17546 if let Some(_) = self.p_max {
17547 return 6;
17548 }
17549 if let Some(_) = self.p_min {
17550 return 5;
17551 }
17552 if let Some(_) = self.p_base {
17553 return 4;
17554 }
17555 if let Some(_) = self.i_max {
17556 return 3;
17557 }
17558 if let Some(_) = self.i_min {
17559 return 2;
17560 }
17561 if let Some(_) = self.i_base {
17562 return 1;
17563 }
17564 0
17565 }
17566 }
17567
17568 impl fidl::encoding::ValueTypeMarker for H264QuantizationParameters {
17569 type Borrowed<'a> = &'a Self;
17570 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
17571 value
17572 }
17573 }
17574
17575 unsafe impl fidl::encoding::TypeMarker for H264QuantizationParameters {
17576 type Owned = Self;
17577
17578 #[inline(always)]
17579 fn inline_align(_context: fidl::encoding::Context) -> usize {
17580 8
17581 }
17582
17583 #[inline(always)]
17584 fn inline_size(_context: fidl::encoding::Context) -> usize {
17585 16
17586 }
17587 }
17588
17589 unsafe impl<D: fidl::encoding::ResourceDialect>
17590 fidl::encoding::Encode<H264QuantizationParameters, D> for &H264QuantizationParameters
17591 {
17592 unsafe fn encode(
17593 self,
17594 encoder: &mut fidl::encoding::Encoder<'_, D>,
17595 offset: usize,
17596 mut depth: fidl::encoding::Depth,
17597 ) -> fidl::Result<()> {
17598 encoder.debug_check_bounds::<H264QuantizationParameters>(offset);
17599 let max_ordinal: u64 = self.max_ordinal_present();
17601 encoder.write_num(max_ordinal, offset);
17602 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
17603 if max_ordinal == 0 {
17605 return Ok(());
17606 }
17607 depth.increment()?;
17608 let envelope_size = 8;
17609 let bytes_len = max_ordinal as usize * envelope_size;
17610 #[allow(unused_variables)]
17611 let offset = encoder.out_of_line_offset(bytes_len);
17612 let mut _prev_end_offset: usize = 0;
17613 if 1 > max_ordinal {
17614 return Ok(());
17615 }
17616
17617 let cur_offset: usize = (1 - 1) * envelope_size;
17620
17621 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17623
17624 fidl::encoding::encode_in_envelope_optional::<u32, D>(
17629 self.i_base.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
17630 encoder,
17631 offset + cur_offset,
17632 depth,
17633 )?;
17634
17635 _prev_end_offset = cur_offset + envelope_size;
17636 if 2 > max_ordinal {
17637 return Ok(());
17638 }
17639
17640 let cur_offset: usize = (2 - 1) * envelope_size;
17643
17644 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17646
17647 fidl::encoding::encode_in_envelope_optional::<u32, D>(
17652 self.i_min.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
17653 encoder,
17654 offset + cur_offset,
17655 depth,
17656 )?;
17657
17658 _prev_end_offset = cur_offset + envelope_size;
17659 if 3 > max_ordinal {
17660 return Ok(());
17661 }
17662
17663 let cur_offset: usize = (3 - 1) * envelope_size;
17666
17667 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17669
17670 fidl::encoding::encode_in_envelope_optional::<u32, D>(
17675 self.i_max.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
17676 encoder,
17677 offset + cur_offset,
17678 depth,
17679 )?;
17680
17681 _prev_end_offset = cur_offset + envelope_size;
17682 if 4 > max_ordinal {
17683 return Ok(());
17684 }
17685
17686 let cur_offset: usize = (4 - 1) * envelope_size;
17689
17690 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17692
17693 fidl::encoding::encode_in_envelope_optional::<u32, D>(
17698 self.p_base.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
17699 encoder,
17700 offset + cur_offset,
17701 depth,
17702 )?;
17703
17704 _prev_end_offset = cur_offset + envelope_size;
17705 if 5 > max_ordinal {
17706 return Ok(());
17707 }
17708
17709 let cur_offset: usize = (5 - 1) * envelope_size;
17712
17713 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17715
17716 fidl::encoding::encode_in_envelope_optional::<u32, D>(
17721 self.p_min.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
17722 encoder,
17723 offset + cur_offset,
17724 depth,
17725 )?;
17726
17727 _prev_end_offset = cur_offset + envelope_size;
17728 if 6 > max_ordinal {
17729 return Ok(());
17730 }
17731
17732 let cur_offset: usize = (6 - 1) * envelope_size;
17735
17736 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17738
17739 fidl::encoding::encode_in_envelope_optional::<u32, D>(
17744 self.p_max.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
17745 encoder,
17746 offset + cur_offset,
17747 depth,
17748 )?;
17749
17750 _prev_end_offset = cur_offset + envelope_size;
17751
17752 Ok(())
17753 }
17754 }
17755
17756 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
17757 for H264QuantizationParameters
17758 {
17759 #[inline(always)]
17760 fn new_empty() -> Self {
17761 Self::default()
17762 }
17763
17764 unsafe fn decode(
17765 &mut self,
17766 decoder: &mut fidl::encoding::Decoder<'_, D>,
17767 offset: usize,
17768 mut depth: fidl::encoding::Depth,
17769 ) -> fidl::Result<()> {
17770 decoder.debug_check_bounds::<Self>(offset);
17771 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
17772 None => return Err(fidl::Error::NotNullable),
17773 Some(len) => len,
17774 };
17775 if len == 0 {
17777 return Ok(());
17778 };
17779 depth.increment()?;
17780 let envelope_size = 8;
17781 let bytes_len = len * envelope_size;
17782 let offset = decoder.out_of_line_offset(bytes_len)?;
17783 let mut _next_ordinal_to_read = 0;
17785 let mut next_offset = offset;
17786 let end_offset = offset + bytes_len;
17787 _next_ordinal_to_read += 1;
17788 if next_offset >= end_offset {
17789 return Ok(());
17790 }
17791
17792 while _next_ordinal_to_read < 1 {
17794 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17795 _next_ordinal_to_read += 1;
17796 next_offset += envelope_size;
17797 }
17798
17799 let next_out_of_line = decoder.next_out_of_line();
17800 let handles_before = decoder.remaining_handles();
17801 if let Some((inlined, num_bytes, num_handles)) =
17802 fidl::encoding::decode_envelope_header(decoder, next_offset)?
17803 {
17804 let member_inline_size =
17805 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
17806 if inlined != (member_inline_size <= 4) {
17807 return Err(fidl::Error::InvalidInlineBitInEnvelope);
17808 }
17809 let inner_offset;
17810 let mut inner_depth = depth.clone();
17811 if inlined {
17812 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17813 inner_offset = next_offset;
17814 } else {
17815 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17816 inner_depth.increment()?;
17817 }
17818 let val_ref = self.i_base.get_or_insert_with(|| fidl::new_empty!(u32, D));
17819 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
17820 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17821 {
17822 return Err(fidl::Error::InvalidNumBytesInEnvelope);
17823 }
17824 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17825 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17826 }
17827 }
17828
17829 next_offset += envelope_size;
17830 _next_ordinal_to_read += 1;
17831 if next_offset >= end_offset {
17832 return Ok(());
17833 }
17834
17835 while _next_ordinal_to_read < 2 {
17837 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17838 _next_ordinal_to_read += 1;
17839 next_offset += envelope_size;
17840 }
17841
17842 let next_out_of_line = decoder.next_out_of_line();
17843 let handles_before = decoder.remaining_handles();
17844 if let Some((inlined, num_bytes, num_handles)) =
17845 fidl::encoding::decode_envelope_header(decoder, next_offset)?
17846 {
17847 let member_inline_size =
17848 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
17849 if inlined != (member_inline_size <= 4) {
17850 return Err(fidl::Error::InvalidInlineBitInEnvelope);
17851 }
17852 let inner_offset;
17853 let mut inner_depth = depth.clone();
17854 if inlined {
17855 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17856 inner_offset = next_offset;
17857 } else {
17858 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17859 inner_depth.increment()?;
17860 }
17861 let val_ref = self.i_min.get_or_insert_with(|| fidl::new_empty!(u32, D));
17862 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
17863 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17864 {
17865 return Err(fidl::Error::InvalidNumBytesInEnvelope);
17866 }
17867 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17868 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17869 }
17870 }
17871
17872 next_offset += envelope_size;
17873 _next_ordinal_to_read += 1;
17874 if next_offset >= end_offset {
17875 return Ok(());
17876 }
17877
17878 while _next_ordinal_to_read < 3 {
17880 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17881 _next_ordinal_to_read += 1;
17882 next_offset += envelope_size;
17883 }
17884
17885 let next_out_of_line = decoder.next_out_of_line();
17886 let handles_before = decoder.remaining_handles();
17887 if let Some((inlined, num_bytes, num_handles)) =
17888 fidl::encoding::decode_envelope_header(decoder, next_offset)?
17889 {
17890 let member_inline_size =
17891 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
17892 if inlined != (member_inline_size <= 4) {
17893 return Err(fidl::Error::InvalidInlineBitInEnvelope);
17894 }
17895 let inner_offset;
17896 let mut inner_depth = depth.clone();
17897 if inlined {
17898 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17899 inner_offset = next_offset;
17900 } else {
17901 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17902 inner_depth.increment()?;
17903 }
17904 let val_ref = self.i_max.get_or_insert_with(|| fidl::new_empty!(u32, D));
17905 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
17906 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17907 {
17908 return Err(fidl::Error::InvalidNumBytesInEnvelope);
17909 }
17910 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17911 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17912 }
17913 }
17914
17915 next_offset += envelope_size;
17916 _next_ordinal_to_read += 1;
17917 if next_offset >= end_offset {
17918 return Ok(());
17919 }
17920
17921 while _next_ordinal_to_read < 4 {
17923 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17924 _next_ordinal_to_read += 1;
17925 next_offset += envelope_size;
17926 }
17927
17928 let next_out_of_line = decoder.next_out_of_line();
17929 let handles_before = decoder.remaining_handles();
17930 if let Some((inlined, num_bytes, num_handles)) =
17931 fidl::encoding::decode_envelope_header(decoder, next_offset)?
17932 {
17933 let member_inline_size =
17934 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
17935 if inlined != (member_inline_size <= 4) {
17936 return Err(fidl::Error::InvalidInlineBitInEnvelope);
17937 }
17938 let inner_offset;
17939 let mut inner_depth = depth.clone();
17940 if inlined {
17941 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17942 inner_offset = next_offset;
17943 } else {
17944 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17945 inner_depth.increment()?;
17946 }
17947 let val_ref = self.p_base.get_or_insert_with(|| fidl::new_empty!(u32, D));
17948 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
17949 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17950 {
17951 return Err(fidl::Error::InvalidNumBytesInEnvelope);
17952 }
17953 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17954 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17955 }
17956 }
17957
17958 next_offset += envelope_size;
17959 _next_ordinal_to_read += 1;
17960 if next_offset >= end_offset {
17961 return Ok(());
17962 }
17963
17964 while _next_ordinal_to_read < 5 {
17966 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17967 _next_ordinal_to_read += 1;
17968 next_offset += envelope_size;
17969 }
17970
17971 let next_out_of_line = decoder.next_out_of_line();
17972 let handles_before = decoder.remaining_handles();
17973 if let Some((inlined, num_bytes, num_handles)) =
17974 fidl::encoding::decode_envelope_header(decoder, next_offset)?
17975 {
17976 let member_inline_size =
17977 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
17978 if inlined != (member_inline_size <= 4) {
17979 return Err(fidl::Error::InvalidInlineBitInEnvelope);
17980 }
17981 let inner_offset;
17982 let mut inner_depth = depth.clone();
17983 if inlined {
17984 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17985 inner_offset = next_offset;
17986 } else {
17987 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17988 inner_depth.increment()?;
17989 }
17990 let val_ref = self.p_min.get_or_insert_with(|| fidl::new_empty!(u32, D));
17991 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
17992 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17993 {
17994 return Err(fidl::Error::InvalidNumBytesInEnvelope);
17995 }
17996 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17997 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17998 }
17999 }
18000
18001 next_offset += envelope_size;
18002 _next_ordinal_to_read += 1;
18003 if next_offset >= end_offset {
18004 return Ok(());
18005 }
18006
18007 while _next_ordinal_to_read < 6 {
18009 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18010 _next_ordinal_to_read += 1;
18011 next_offset += envelope_size;
18012 }
18013
18014 let next_out_of_line = decoder.next_out_of_line();
18015 let handles_before = decoder.remaining_handles();
18016 if let Some((inlined, num_bytes, num_handles)) =
18017 fidl::encoding::decode_envelope_header(decoder, next_offset)?
18018 {
18019 let member_inline_size =
18020 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
18021 if inlined != (member_inline_size <= 4) {
18022 return Err(fidl::Error::InvalidInlineBitInEnvelope);
18023 }
18024 let inner_offset;
18025 let mut inner_depth = depth.clone();
18026 if inlined {
18027 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18028 inner_offset = next_offset;
18029 } else {
18030 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18031 inner_depth.increment()?;
18032 }
18033 let val_ref = self.p_max.get_or_insert_with(|| fidl::new_empty!(u32, D));
18034 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
18035 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18036 {
18037 return Err(fidl::Error::InvalidNumBytesInEnvelope);
18038 }
18039 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18040 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18041 }
18042 }
18043
18044 next_offset += envelope_size;
18045
18046 while next_offset < end_offset {
18048 _next_ordinal_to_read += 1;
18049 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18050 next_offset += envelope_size;
18051 }
18052
18053 Ok(())
18054 }
18055 }
18056
18057 impl HevcEncoderSettings {
18058 #[inline(always)]
18059 fn max_ordinal_present(&self) -> u64 {
18060 if let Some(_) = self.gop_size {
18061 return 3;
18062 }
18063 if let Some(_) = self.frame_rate {
18064 return 2;
18065 }
18066 if let Some(_) = self.bit_rate {
18067 return 1;
18068 }
18069 0
18070 }
18071 }
18072
18073 impl fidl::encoding::ValueTypeMarker for HevcEncoderSettings {
18074 type Borrowed<'a> = &'a Self;
18075 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
18076 value
18077 }
18078 }
18079
18080 unsafe impl fidl::encoding::TypeMarker for HevcEncoderSettings {
18081 type Owned = Self;
18082
18083 #[inline(always)]
18084 fn inline_align(_context: fidl::encoding::Context) -> usize {
18085 8
18086 }
18087
18088 #[inline(always)]
18089 fn inline_size(_context: fidl::encoding::Context) -> usize {
18090 16
18091 }
18092 }
18093
18094 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<HevcEncoderSettings, D>
18095 for &HevcEncoderSettings
18096 {
18097 unsafe fn encode(
18098 self,
18099 encoder: &mut fidl::encoding::Encoder<'_, D>,
18100 offset: usize,
18101 mut depth: fidl::encoding::Depth,
18102 ) -> fidl::Result<()> {
18103 encoder.debug_check_bounds::<HevcEncoderSettings>(offset);
18104 let max_ordinal: u64 = self.max_ordinal_present();
18106 encoder.write_num(max_ordinal, offset);
18107 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
18108 if max_ordinal == 0 {
18110 return Ok(());
18111 }
18112 depth.increment()?;
18113 let envelope_size = 8;
18114 let bytes_len = max_ordinal as usize * envelope_size;
18115 #[allow(unused_variables)]
18116 let offset = encoder.out_of_line_offset(bytes_len);
18117 let mut _prev_end_offset: usize = 0;
18118 if 1 > max_ordinal {
18119 return Ok(());
18120 }
18121
18122 let cur_offset: usize = (1 - 1) * envelope_size;
18125
18126 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18128
18129 fidl::encoding::encode_in_envelope_optional::<u32, D>(
18134 self.bit_rate.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
18135 encoder,
18136 offset + cur_offset,
18137 depth,
18138 )?;
18139
18140 _prev_end_offset = cur_offset + envelope_size;
18141 if 2 > max_ordinal {
18142 return Ok(());
18143 }
18144
18145 let cur_offset: usize = (2 - 1) * envelope_size;
18148
18149 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18151
18152 fidl::encoding::encode_in_envelope_optional::<u32, D>(
18157 self.frame_rate.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
18158 encoder,
18159 offset + cur_offset,
18160 depth,
18161 )?;
18162
18163 _prev_end_offset = cur_offset + envelope_size;
18164 if 3 > max_ordinal {
18165 return Ok(());
18166 }
18167
18168 let cur_offset: usize = (3 - 1) * envelope_size;
18171
18172 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18174
18175 fidl::encoding::encode_in_envelope_optional::<u32, D>(
18180 self.gop_size.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
18181 encoder,
18182 offset + cur_offset,
18183 depth,
18184 )?;
18185
18186 _prev_end_offset = cur_offset + envelope_size;
18187
18188 Ok(())
18189 }
18190 }
18191
18192 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for HevcEncoderSettings {
18193 #[inline(always)]
18194 fn new_empty() -> Self {
18195 Self::default()
18196 }
18197
18198 unsafe fn decode(
18199 &mut self,
18200 decoder: &mut fidl::encoding::Decoder<'_, D>,
18201 offset: usize,
18202 mut depth: fidl::encoding::Depth,
18203 ) -> fidl::Result<()> {
18204 decoder.debug_check_bounds::<Self>(offset);
18205 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
18206 None => return Err(fidl::Error::NotNullable),
18207 Some(len) => len,
18208 };
18209 if len == 0 {
18211 return Ok(());
18212 };
18213 depth.increment()?;
18214 let envelope_size = 8;
18215 let bytes_len = len * envelope_size;
18216 let offset = decoder.out_of_line_offset(bytes_len)?;
18217 let mut _next_ordinal_to_read = 0;
18219 let mut next_offset = offset;
18220 let end_offset = offset + bytes_len;
18221 _next_ordinal_to_read += 1;
18222 if next_offset >= end_offset {
18223 return Ok(());
18224 }
18225
18226 while _next_ordinal_to_read < 1 {
18228 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18229 _next_ordinal_to_read += 1;
18230 next_offset += envelope_size;
18231 }
18232
18233 let next_out_of_line = decoder.next_out_of_line();
18234 let handles_before = decoder.remaining_handles();
18235 if let Some((inlined, num_bytes, num_handles)) =
18236 fidl::encoding::decode_envelope_header(decoder, next_offset)?
18237 {
18238 let member_inline_size =
18239 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
18240 if inlined != (member_inline_size <= 4) {
18241 return Err(fidl::Error::InvalidInlineBitInEnvelope);
18242 }
18243 let inner_offset;
18244 let mut inner_depth = depth.clone();
18245 if inlined {
18246 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18247 inner_offset = next_offset;
18248 } else {
18249 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18250 inner_depth.increment()?;
18251 }
18252 let val_ref = self.bit_rate.get_or_insert_with(|| fidl::new_empty!(u32, D));
18253 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
18254 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18255 {
18256 return Err(fidl::Error::InvalidNumBytesInEnvelope);
18257 }
18258 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18259 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18260 }
18261 }
18262
18263 next_offset += envelope_size;
18264 _next_ordinal_to_read += 1;
18265 if next_offset >= end_offset {
18266 return Ok(());
18267 }
18268
18269 while _next_ordinal_to_read < 2 {
18271 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18272 _next_ordinal_to_read += 1;
18273 next_offset += envelope_size;
18274 }
18275
18276 let next_out_of_line = decoder.next_out_of_line();
18277 let handles_before = decoder.remaining_handles();
18278 if let Some((inlined, num_bytes, num_handles)) =
18279 fidl::encoding::decode_envelope_header(decoder, next_offset)?
18280 {
18281 let member_inline_size =
18282 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
18283 if inlined != (member_inline_size <= 4) {
18284 return Err(fidl::Error::InvalidInlineBitInEnvelope);
18285 }
18286 let inner_offset;
18287 let mut inner_depth = depth.clone();
18288 if inlined {
18289 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18290 inner_offset = next_offset;
18291 } else {
18292 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18293 inner_depth.increment()?;
18294 }
18295 let val_ref = self.frame_rate.get_or_insert_with(|| fidl::new_empty!(u32, D));
18296 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
18297 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18298 {
18299 return Err(fidl::Error::InvalidNumBytesInEnvelope);
18300 }
18301 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18302 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18303 }
18304 }
18305
18306 next_offset += envelope_size;
18307 _next_ordinal_to_read += 1;
18308 if next_offset >= end_offset {
18309 return Ok(());
18310 }
18311
18312 while _next_ordinal_to_read < 3 {
18314 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18315 _next_ordinal_to_read += 1;
18316 next_offset += envelope_size;
18317 }
18318
18319 let next_out_of_line = decoder.next_out_of_line();
18320 let handles_before = decoder.remaining_handles();
18321 if let Some((inlined, num_bytes, num_handles)) =
18322 fidl::encoding::decode_envelope_header(decoder, next_offset)?
18323 {
18324 let member_inline_size =
18325 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
18326 if inlined != (member_inline_size <= 4) {
18327 return Err(fidl::Error::InvalidInlineBitInEnvelope);
18328 }
18329 let inner_offset;
18330 let mut inner_depth = depth.clone();
18331 if inlined {
18332 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18333 inner_offset = next_offset;
18334 } else {
18335 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18336 inner_depth.increment()?;
18337 }
18338 let val_ref = self.gop_size.get_or_insert_with(|| fidl::new_empty!(u32, D));
18339 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
18340 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18341 {
18342 return Err(fidl::Error::InvalidNumBytesInEnvelope);
18343 }
18344 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18345 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18346 }
18347 }
18348
18349 next_offset += envelope_size;
18350
18351 while next_offset < end_offset {
18353 _next_ordinal_to_read += 1;
18354 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18355 next_offset += envelope_size;
18356 }
18357
18358 Ok(())
18359 }
18360 }
18361
18362 impl InputAudioCapturerConfiguration {
18363 #[inline(always)]
18364 fn max_ordinal_present(&self) -> u64 {
18365 if let Some(_) = self.usage2 {
18366 return 2;
18367 }
18368 if let Some(_) = self.usage {
18369 return 1;
18370 }
18371 0
18372 }
18373 }
18374
18375 impl fidl::encoding::ValueTypeMarker for InputAudioCapturerConfiguration {
18376 type Borrowed<'a> = &'a Self;
18377 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
18378 value
18379 }
18380 }
18381
18382 unsafe impl fidl::encoding::TypeMarker for InputAudioCapturerConfiguration {
18383 type Owned = Self;
18384
18385 #[inline(always)]
18386 fn inline_align(_context: fidl::encoding::Context) -> usize {
18387 8
18388 }
18389
18390 #[inline(always)]
18391 fn inline_size(_context: fidl::encoding::Context) -> usize {
18392 16
18393 }
18394 }
18395
18396 unsafe impl<D: fidl::encoding::ResourceDialect>
18397 fidl::encoding::Encode<InputAudioCapturerConfiguration, D>
18398 for &InputAudioCapturerConfiguration
18399 {
18400 unsafe fn encode(
18401 self,
18402 encoder: &mut fidl::encoding::Encoder<'_, D>,
18403 offset: usize,
18404 mut depth: fidl::encoding::Depth,
18405 ) -> fidl::Result<()> {
18406 encoder.debug_check_bounds::<InputAudioCapturerConfiguration>(offset);
18407 let max_ordinal: u64 = self.max_ordinal_present();
18409 encoder.write_num(max_ordinal, offset);
18410 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
18411 if max_ordinal == 0 {
18413 return Ok(());
18414 }
18415 depth.increment()?;
18416 let envelope_size = 8;
18417 let bytes_len = max_ordinal as usize * envelope_size;
18418 #[allow(unused_variables)]
18419 let offset = encoder.out_of_line_offset(bytes_len);
18420 let mut _prev_end_offset: usize = 0;
18421 if 1 > max_ordinal {
18422 return Ok(());
18423 }
18424
18425 let cur_offset: usize = (1 - 1) * envelope_size;
18428
18429 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18431
18432 fidl::encoding::encode_in_envelope_optional::<AudioCaptureUsage, D>(
18437 self.usage
18438 .as_ref()
18439 .map(<AudioCaptureUsage as fidl::encoding::ValueTypeMarker>::borrow),
18440 encoder,
18441 offset + cur_offset,
18442 depth,
18443 )?;
18444
18445 _prev_end_offset = cur_offset + envelope_size;
18446 if 2 > max_ordinal {
18447 return Ok(());
18448 }
18449
18450 let cur_offset: usize = (2 - 1) * envelope_size;
18453
18454 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18456
18457 fidl::encoding::encode_in_envelope_optional::<AudioCaptureUsage2, D>(
18462 self.usage2
18463 .as_ref()
18464 .map(<AudioCaptureUsage2 as fidl::encoding::ValueTypeMarker>::borrow),
18465 encoder,
18466 offset + cur_offset,
18467 depth,
18468 )?;
18469
18470 _prev_end_offset = cur_offset + envelope_size;
18471
18472 Ok(())
18473 }
18474 }
18475
18476 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
18477 for InputAudioCapturerConfiguration
18478 {
18479 #[inline(always)]
18480 fn new_empty() -> Self {
18481 Self::default()
18482 }
18483
18484 unsafe fn decode(
18485 &mut self,
18486 decoder: &mut fidl::encoding::Decoder<'_, D>,
18487 offset: usize,
18488 mut depth: fidl::encoding::Depth,
18489 ) -> fidl::Result<()> {
18490 decoder.debug_check_bounds::<Self>(offset);
18491 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
18492 None => return Err(fidl::Error::NotNullable),
18493 Some(len) => len,
18494 };
18495 if len == 0 {
18497 return Ok(());
18498 };
18499 depth.increment()?;
18500 let envelope_size = 8;
18501 let bytes_len = len * envelope_size;
18502 let offset = decoder.out_of_line_offset(bytes_len)?;
18503 let mut _next_ordinal_to_read = 0;
18505 let mut next_offset = offset;
18506 let end_offset = offset + bytes_len;
18507 _next_ordinal_to_read += 1;
18508 if next_offset >= end_offset {
18509 return Ok(());
18510 }
18511
18512 while _next_ordinal_to_read < 1 {
18514 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18515 _next_ordinal_to_read += 1;
18516 next_offset += envelope_size;
18517 }
18518
18519 let next_out_of_line = decoder.next_out_of_line();
18520 let handles_before = decoder.remaining_handles();
18521 if let Some((inlined, num_bytes, num_handles)) =
18522 fidl::encoding::decode_envelope_header(decoder, next_offset)?
18523 {
18524 let member_inline_size =
18525 <AudioCaptureUsage as fidl::encoding::TypeMarker>::inline_size(decoder.context);
18526 if inlined != (member_inline_size <= 4) {
18527 return Err(fidl::Error::InvalidInlineBitInEnvelope);
18528 }
18529 let inner_offset;
18530 let mut inner_depth = depth.clone();
18531 if inlined {
18532 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18533 inner_offset = next_offset;
18534 } else {
18535 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18536 inner_depth.increment()?;
18537 }
18538 let val_ref =
18539 self.usage.get_or_insert_with(|| fidl::new_empty!(AudioCaptureUsage, D));
18540 fidl::decode!(AudioCaptureUsage, D, val_ref, decoder, inner_offset, inner_depth)?;
18541 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18542 {
18543 return Err(fidl::Error::InvalidNumBytesInEnvelope);
18544 }
18545 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18546 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18547 }
18548 }
18549
18550 next_offset += envelope_size;
18551 _next_ordinal_to_read += 1;
18552 if next_offset >= end_offset {
18553 return Ok(());
18554 }
18555
18556 while _next_ordinal_to_read < 2 {
18558 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18559 _next_ordinal_to_read += 1;
18560 next_offset += envelope_size;
18561 }
18562
18563 let next_out_of_line = decoder.next_out_of_line();
18564 let handles_before = decoder.remaining_handles();
18565 if let Some((inlined, num_bytes, num_handles)) =
18566 fidl::encoding::decode_envelope_header(decoder, next_offset)?
18567 {
18568 let member_inline_size =
18569 <AudioCaptureUsage2 as fidl::encoding::TypeMarker>::inline_size(
18570 decoder.context,
18571 );
18572 if inlined != (member_inline_size <= 4) {
18573 return Err(fidl::Error::InvalidInlineBitInEnvelope);
18574 }
18575 let inner_offset;
18576 let mut inner_depth = depth.clone();
18577 if inlined {
18578 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18579 inner_offset = next_offset;
18580 } else {
18581 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18582 inner_depth.increment()?;
18583 }
18584 let val_ref =
18585 self.usage2.get_or_insert_with(|| fidl::new_empty!(AudioCaptureUsage2, D));
18586 fidl::decode!(AudioCaptureUsage2, D, val_ref, decoder, inner_offset, inner_depth)?;
18587 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18588 {
18589 return Err(fidl::Error::InvalidNumBytesInEnvelope);
18590 }
18591 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18592 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18593 }
18594 }
18595
18596 next_offset += envelope_size;
18597
18598 while next_offset < end_offset {
18600 _next_ordinal_to_read += 1;
18601 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18602 next_offset += envelope_size;
18603 }
18604
18605 Ok(())
18606 }
18607 }
18608
18609 impl Lc3EncoderSettings {
18610 #[inline(always)]
18611 fn max_ordinal_present(&self) -> u64 {
18612 if let Some(_) = self.frame_duration {
18613 return 2;
18614 }
18615 if let Some(_) = self.nbytes {
18616 return 1;
18617 }
18618 0
18619 }
18620 }
18621
18622 impl fidl::encoding::ValueTypeMarker for Lc3EncoderSettings {
18623 type Borrowed<'a> = &'a Self;
18624 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
18625 value
18626 }
18627 }
18628
18629 unsafe impl fidl::encoding::TypeMarker for Lc3EncoderSettings {
18630 type Owned = Self;
18631
18632 #[inline(always)]
18633 fn inline_align(_context: fidl::encoding::Context) -> usize {
18634 8
18635 }
18636
18637 #[inline(always)]
18638 fn inline_size(_context: fidl::encoding::Context) -> usize {
18639 16
18640 }
18641 }
18642
18643 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Lc3EncoderSettings, D>
18644 for &Lc3EncoderSettings
18645 {
18646 unsafe fn encode(
18647 self,
18648 encoder: &mut fidl::encoding::Encoder<'_, D>,
18649 offset: usize,
18650 mut depth: fidl::encoding::Depth,
18651 ) -> fidl::Result<()> {
18652 encoder.debug_check_bounds::<Lc3EncoderSettings>(offset);
18653 let max_ordinal: u64 = self.max_ordinal_present();
18655 encoder.write_num(max_ordinal, offset);
18656 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
18657 if max_ordinal == 0 {
18659 return Ok(());
18660 }
18661 depth.increment()?;
18662 let envelope_size = 8;
18663 let bytes_len = max_ordinal as usize * envelope_size;
18664 #[allow(unused_variables)]
18665 let offset = encoder.out_of_line_offset(bytes_len);
18666 let mut _prev_end_offset: usize = 0;
18667 if 1 > max_ordinal {
18668 return Ok(());
18669 }
18670
18671 let cur_offset: usize = (1 - 1) * envelope_size;
18674
18675 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18677
18678 fidl::encoding::encode_in_envelope_optional::<u16, D>(
18683 self.nbytes.as_ref().map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
18684 encoder,
18685 offset + cur_offset,
18686 depth,
18687 )?;
18688
18689 _prev_end_offset = cur_offset + envelope_size;
18690 if 2 > max_ordinal {
18691 return Ok(());
18692 }
18693
18694 let cur_offset: usize = (2 - 1) * envelope_size;
18697
18698 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18700
18701 fidl::encoding::encode_in_envelope_optional::<Lc3FrameDuration, D>(
18706 self.frame_duration
18707 .as_ref()
18708 .map(<Lc3FrameDuration as fidl::encoding::ValueTypeMarker>::borrow),
18709 encoder,
18710 offset + cur_offset,
18711 depth,
18712 )?;
18713
18714 _prev_end_offset = cur_offset + envelope_size;
18715
18716 Ok(())
18717 }
18718 }
18719
18720 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Lc3EncoderSettings {
18721 #[inline(always)]
18722 fn new_empty() -> Self {
18723 Self::default()
18724 }
18725
18726 unsafe fn decode(
18727 &mut self,
18728 decoder: &mut fidl::encoding::Decoder<'_, D>,
18729 offset: usize,
18730 mut depth: fidl::encoding::Depth,
18731 ) -> fidl::Result<()> {
18732 decoder.debug_check_bounds::<Self>(offset);
18733 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
18734 None => return Err(fidl::Error::NotNullable),
18735 Some(len) => len,
18736 };
18737 if len == 0 {
18739 return Ok(());
18740 };
18741 depth.increment()?;
18742 let envelope_size = 8;
18743 let bytes_len = len * envelope_size;
18744 let offset = decoder.out_of_line_offset(bytes_len)?;
18745 let mut _next_ordinal_to_read = 0;
18747 let mut next_offset = offset;
18748 let end_offset = offset + bytes_len;
18749 _next_ordinal_to_read += 1;
18750 if next_offset >= end_offset {
18751 return Ok(());
18752 }
18753
18754 while _next_ordinal_to_read < 1 {
18756 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18757 _next_ordinal_to_read += 1;
18758 next_offset += envelope_size;
18759 }
18760
18761 let next_out_of_line = decoder.next_out_of_line();
18762 let handles_before = decoder.remaining_handles();
18763 if let Some((inlined, num_bytes, num_handles)) =
18764 fidl::encoding::decode_envelope_header(decoder, next_offset)?
18765 {
18766 let member_inline_size =
18767 <u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
18768 if inlined != (member_inline_size <= 4) {
18769 return Err(fidl::Error::InvalidInlineBitInEnvelope);
18770 }
18771 let inner_offset;
18772 let mut inner_depth = depth.clone();
18773 if inlined {
18774 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18775 inner_offset = next_offset;
18776 } else {
18777 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18778 inner_depth.increment()?;
18779 }
18780 let val_ref = self.nbytes.get_or_insert_with(|| fidl::new_empty!(u16, D));
18781 fidl::decode!(u16, D, val_ref, decoder, inner_offset, inner_depth)?;
18782 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18783 {
18784 return Err(fidl::Error::InvalidNumBytesInEnvelope);
18785 }
18786 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18787 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18788 }
18789 }
18790
18791 next_offset += envelope_size;
18792 _next_ordinal_to_read += 1;
18793 if next_offset >= end_offset {
18794 return Ok(());
18795 }
18796
18797 while _next_ordinal_to_read < 2 {
18799 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18800 _next_ordinal_to_read += 1;
18801 next_offset += envelope_size;
18802 }
18803
18804 let next_out_of_line = decoder.next_out_of_line();
18805 let handles_before = decoder.remaining_handles();
18806 if let Some((inlined, num_bytes, num_handles)) =
18807 fidl::encoding::decode_envelope_header(decoder, next_offset)?
18808 {
18809 let member_inline_size =
18810 <Lc3FrameDuration as fidl::encoding::TypeMarker>::inline_size(decoder.context);
18811 if inlined != (member_inline_size <= 4) {
18812 return Err(fidl::Error::InvalidInlineBitInEnvelope);
18813 }
18814 let inner_offset;
18815 let mut inner_depth = depth.clone();
18816 if inlined {
18817 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18818 inner_offset = next_offset;
18819 } else {
18820 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18821 inner_depth.increment()?;
18822 }
18823 let val_ref = self
18824 .frame_duration
18825 .get_or_insert_with(|| fidl::new_empty!(Lc3FrameDuration, D));
18826 fidl::decode!(Lc3FrameDuration, D, val_ref, decoder, inner_offset, inner_depth)?;
18827 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18828 {
18829 return Err(fidl::Error::InvalidNumBytesInEnvelope);
18830 }
18831 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18832 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18833 }
18834 }
18835
18836 next_offset += envelope_size;
18837
18838 while next_offset < end_offset {
18840 _next_ordinal_to_read += 1;
18841 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18842 next_offset += envelope_size;
18843 }
18844
18845 Ok(())
18846 }
18847 }
18848
18849 impl LoopbackAudioCapturerConfiguration {
18850 #[inline(always)]
18851 fn max_ordinal_present(&self) -> u64 {
18852 0
18853 }
18854 }
18855
18856 impl fidl::encoding::ValueTypeMarker for LoopbackAudioCapturerConfiguration {
18857 type Borrowed<'a> = &'a Self;
18858 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
18859 value
18860 }
18861 }
18862
18863 unsafe impl fidl::encoding::TypeMarker for LoopbackAudioCapturerConfiguration {
18864 type Owned = Self;
18865
18866 #[inline(always)]
18867 fn inline_align(_context: fidl::encoding::Context) -> usize {
18868 8
18869 }
18870
18871 #[inline(always)]
18872 fn inline_size(_context: fidl::encoding::Context) -> usize {
18873 16
18874 }
18875 }
18876
18877 unsafe impl<D: fidl::encoding::ResourceDialect>
18878 fidl::encoding::Encode<LoopbackAudioCapturerConfiguration, D>
18879 for &LoopbackAudioCapturerConfiguration
18880 {
18881 unsafe fn encode(
18882 self,
18883 encoder: &mut fidl::encoding::Encoder<'_, D>,
18884 offset: usize,
18885 mut depth: fidl::encoding::Depth,
18886 ) -> fidl::Result<()> {
18887 encoder.debug_check_bounds::<LoopbackAudioCapturerConfiguration>(offset);
18888 let max_ordinal: u64 = self.max_ordinal_present();
18890 encoder.write_num(max_ordinal, offset);
18891 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
18892 if max_ordinal == 0 {
18894 return Ok(());
18895 }
18896 depth.increment()?;
18897 let envelope_size = 8;
18898 let bytes_len = max_ordinal as usize * envelope_size;
18899 #[allow(unused_variables)]
18900 let offset = encoder.out_of_line_offset(bytes_len);
18901 let mut _prev_end_offset: usize = 0;
18902
18903 Ok(())
18904 }
18905 }
18906
18907 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
18908 for LoopbackAudioCapturerConfiguration
18909 {
18910 #[inline(always)]
18911 fn new_empty() -> Self {
18912 Self::default()
18913 }
18914
18915 unsafe fn decode(
18916 &mut self,
18917 decoder: &mut fidl::encoding::Decoder<'_, D>,
18918 offset: usize,
18919 mut depth: fidl::encoding::Depth,
18920 ) -> fidl::Result<()> {
18921 decoder.debug_check_bounds::<Self>(offset);
18922 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
18923 None => return Err(fidl::Error::NotNullable),
18924 Some(len) => len,
18925 };
18926 if len == 0 {
18928 return Ok(());
18929 };
18930 depth.increment()?;
18931 let envelope_size = 8;
18932 let bytes_len = len * envelope_size;
18933 let offset = decoder.out_of_line_offset(bytes_len)?;
18934 let mut _next_ordinal_to_read = 0;
18936 let mut next_offset = offset;
18937 let end_offset = offset + bytes_len;
18938
18939 while next_offset < end_offset {
18941 _next_ordinal_to_read += 1;
18942 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18943 next_offset += envelope_size;
18944 }
18945
18946 Ok(())
18947 }
18948 }
18949
18950 impl MSbcEncoderSettings {
18951 #[inline(always)]
18952 fn max_ordinal_present(&self) -> u64 {
18953 0
18954 }
18955 }
18956
18957 impl fidl::encoding::ValueTypeMarker for MSbcEncoderSettings {
18958 type Borrowed<'a> = &'a Self;
18959 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
18960 value
18961 }
18962 }
18963
18964 unsafe impl fidl::encoding::TypeMarker for MSbcEncoderSettings {
18965 type Owned = Self;
18966
18967 #[inline(always)]
18968 fn inline_align(_context: fidl::encoding::Context) -> usize {
18969 8
18970 }
18971
18972 #[inline(always)]
18973 fn inline_size(_context: fidl::encoding::Context) -> usize {
18974 16
18975 }
18976 }
18977
18978 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<MSbcEncoderSettings, D>
18979 for &MSbcEncoderSettings
18980 {
18981 unsafe fn encode(
18982 self,
18983 encoder: &mut fidl::encoding::Encoder<'_, D>,
18984 offset: usize,
18985 mut depth: fidl::encoding::Depth,
18986 ) -> fidl::Result<()> {
18987 encoder.debug_check_bounds::<MSbcEncoderSettings>(offset);
18988 let max_ordinal: u64 = self.max_ordinal_present();
18990 encoder.write_num(max_ordinal, offset);
18991 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
18992 if max_ordinal == 0 {
18994 return Ok(());
18995 }
18996 depth.increment()?;
18997 let envelope_size = 8;
18998 let bytes_len = max_ordinal as usize * envelope_size;
18999 #[allow(unused_variables)]
19000 let offset = encoder.out_of_line_offset(bytes_len);
19001 let mut _prev_end_offset: usize = 0;
19002
19003 Ok(())
19004 }
19005 }
19006
19007 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for MSbcEncoderSettings {
19008 #[inline(always)]
19009 fn new_empty() -> Self {
19010 Self::default()
19011 }
19012
19013 unsafe fn decode(
19014 &mut self,
19015 decoder: &mut fidl::encoding::Decoder<'_, D>,
19016 offset: usize,
19017 mut depth: fidl::encoding::Depth,
19018 ) -> fidl::Result<()> {
19019 decoder.debug_check_bounds::<Self>(offset);
19020 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
19021 None => return Err(fidl::Error::NotNullable),
19022 Some(len) => len,
19023 };
19024 if len == 0 {
19026 return Ok(());
19027 };
19028 depth.increment()?;
19029 let envelope_size = 8;
19030 let bytes_len = len * envelope_size;
19031 let offset = decoder.out_of_line_offset(bytes_len)?;
19032 let mut _next_ordinal_to_read = 0;
19034 let mut next_offset = offset;
19035 let end_offset = offset + bytes_len;
19036
19037 while next_offset < end_offset {
19039 _next_ordinal_to_read += 1;
19040 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
19041 next_offset += envelope_size;
19042 }
19043
19044 Ok(())
19045 }
19046 }
19047
19048 impl Packet {
19049 #[inline(always)]
19050 fn max_ordinal_present(&self) -> u64 {
19051 if let Some(_) = self.key_frame {
19052 return 9;
19053 }
19054 if let Some(_) = self.known_end_access_unit {
19055 return 8;
19056 }
19057 if let Some(_) = self.start_access_unit {
19058 return 7;
19059 }
19060 if let Some(_) = self.timestamp_ish {
19061 return 6;
19062 }
19063 if let Some(_) = self.valid_length_bytes {
19064 return 5;
19065 }
19066 if let Some(_) = self.start_offset {
19067 return 4;
19068 }
19069 if let Some(_) = self.stream_lifetime_ordinal {
19070 return 3;
19071 }
19072 if let Some(_) = self.buffer_index {
19073 return 2;
19074 }
19075 if let Some(_) = self.header {
19076 return 1;
19077 }
19078 0
19079 }
19080 }
19081
19082 impl fidl::encoding::ValueTypeMarker for Packet {
19083 type Borrowed<'a> = &'a Self;
19084 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
19085 value
19086 }
19087 }
19088
19089 unsafe impl fidl::encoding::TypeMarker for Packet {
19090 type Owned = Self;
19091
19092 #[inline(always)]
19093 fn inline_align(_context: fidl::encoding::Context) -> usize {
19094 8
19095 }
19096
19097 #[inline(always)]
19098 fn inline_size(_context: fidl::encoding::Context) -> usize {
19099 16
19100 }
19101 }
19102
19103 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Packet, D> for &Packet {
19104 unsafe fn encode(
19105 self,
19106 encoder: &mut fidl::encoding::Encoder<'_, D>,
19107 offset: usize,
19108 mut depth: fidl::encoding::Depth,
19109 ) -> fidl::Result<()> {
19110 encoder.debug_check_bounds::<Packet>(offset);
19111 let max_ordinal: u64 = self.max_ordinal_present();
19113 encoder.write_num(max_ordinal, offset);
19114 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
19115 if max_ordinal == 0 {
19117 return Ok(());
19118 }
19119 depth.increment()?;
19120 let envelope_size = 8;
19121 let bytes_len = max_ordinal as usize * envelope_size;
19122 #[allow(unused_variables)]
19123 let offset = encoder.out_of_line_offset(bytes_len);
19124 let mut _prev_end_offset: usize = 0;
19125 if 1 > max_ordinal {
19126 return Ok(());
19127 }
19128
19129 let cur_offset: usize = (1 - 1) * envelope_size;
19132
19133 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
19135
19136 fidl::encoding::encode_in_envelope_optional::<PacketHeader, D>(
19141 self.header.as_ref().map(<PacketHeader as fidl::encoding::ValueTypeMarker>::borrow),
19142 encoder,
19143 offset + cur_offset,
19144 depth,
19145 )?;
19146
19147 _prev_end_offset = cur_offset + envelope_size;
19148 if 2 > max_ordinal {
19149 return Ok(());
19150 }
19151
19152 let cur_offset: usize = (2 - 1) * envelope_size;
19155
19156 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
19158
19159 fidl::encoding::encode_in_envelope_optional::<u32, D>(
19164 self.buffer_index.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
19165 encoder,
19166 offset + cur_offset,
19167 depth,
19168 )?;
19169
19170 _prev_end_offset = cur_offset + envelope_size;
19171 if 3 > max_ordinal {
19172 return Ok(());
19173 }
19174
19175 let cur_offset: usize = (3 - 1) * envelope_size;
19178
19179 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
19181
19182 fidl::encoding::encode_in_envelope_optional::<u64, D>(
19187 self.stream_lifetime_ordinal
19188 .as_ref()
19189 .map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
19190 encoder,
19191 offset + cur_offset,
19192 depth,
19193 )?;
19194
19195 _prev_end_offset = cur_offset + envelope_size;
19196 if 4 > max_ordinal {
19197 return Ok(());
19198 }
19199
19200 let cur_offset: usize = (4 - 1) * envelope_size;
19203
19204 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
19206
19207 fidl::encoding::encode_in_envelope_optional::<u32, D>(
19212 self.start_offset.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
19213 encoder,
19214 offset + cur_offset,
19215 depth,
19216 )?;
19217
19218 _prev_end_offset = cur_offset + envelope_size;
19219 if 5 > max_ordinal {
19220 return Ok(());
19221 }
19222
19223 let cur_offset: usize = (5 - 1) * envelope_size;
19226
19227 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
19229
19230 fidl::encoding::encode_in_envelope_optional::<u32, D>(
19235 self.valid_length_bytes
19236 .as_ref()
19237 .map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
19238 encoder,
19239 offset + cur_offset,
19240 depth,
19241 )?;
19242
19243 _prev_end_offset = cur_offset + envelope_size;
19244 if 6 > max_ordinal {
19245 return Ok(());
19246 }
19247
19248 let cur_offset: usize = (6 - 1) * envelope_size;
19251
19252 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
19254
19255 fidl::encoding::encode_in_envelope_optional::<u64, D>(
19260 self.timestamp_ish.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
19261 encoder,
19262 offset + cur_offset,
19263 depth,
19264 )?;
19265
19266 _prev_end_offset = cur_offset + envelope_size;
19267 if 7 > max_ordinal {
19268 return Ok(());
19269 }
19270
19271 let cur_offset: usize = (7 - 1) * envelope_size;
19274
19275 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
19277
19278 fidl::encoding::encode_in_envelope_optional::<bool, D>(
19283 self.start_access_unit
19284 .as_ref()
19285 .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
19286 encoder,
19287 offset + cur_offset,
19288 depth,
19289 )?;
19290
19291 _prev_end_offset = cur_offset + envelope_size;
19292 if 8 > max_ordinal {
19293 return Ok(());
19294 }
19295
19296 let cur_offset: usize = (8 - 1) * envelope_size;
19299
19300 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
19302
19303 fidl::encoding::encode_in_envelope_optional::<bool, D>(
19308 self.known_end_access_unit
19309 .as_ref()
19310 .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
19311 encoder,
19312 offset + cur_offset,
19313 depth,
19314 )?;
19315
19316 _prev_end_offset = cur_offset + envelope_size;
19317 if 9 > max_ordinal {
19318 return Ok(());
19319 }
19320
19321 let cur_offset: usize = (9 - 1) * envelope_size;
19324
19325 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
19327
19328 fidl::encoding::encode_in_envelope_optional::<bool, D>(
19333 self.key_frame.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
19334 encoder,
19335 offset + cur_offset,
19336 depth,
19337 )?;
19338
19339 _prev_end_offset = cur_offset + envelope_size;
19340
19341 Ok(())
19342 }
19343 }
19344
19345 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Packet {
19346 #[inline(always)]
19347 fn new_empty() -> Self {
19348 Self::default()
19349 }
19350
19351 unsafe fn decode(
19352 &mut self,
19353 decoder: &mut fidl::encoding::Decoder<'_, D>,
19354 offset: usize,
19355 mut depth: fidl::encoding::Depth,
19356 ) -> fidl::Result<()> {
19357 decoder.debug_check_bounds::<Self>(offset);
19358 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
19359 None => return Err(fidl::Error::NotNullable),
19360 Some(len) => len,
19361 };
19362 if len == 0 {
19364 return Ok(());
19365 };
19366 depth.increment()?;
19367 let envelope_size = 8;
19368 let bytes_len = len * envelope_size;
19369 let offset = decoder.out_of_line_offset(bytes_len)?;
19370 let mut _next_ordinal_to_read = 0;
19372 let mut next_offset = offset;
19373 let end_offset = offset + bytes_len;
19374 _next_ordinal_to_read += 1;
19375 if next_offset >= end_offset {
19376 return Ok(());
19377 }
19378
19379 while _next_ordinal_to_read < 1 {
19381 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
19382 _next_ordinal_to_read += 1;
19383 next_offset += envelope_size;
19384 }
19385
19386 let next_out_of_line = decoder.next_out_of_line();
19387 let handles_before = decoder.remaining_handles();
19388 if let Some((inlined, num_bytes, num_handles)) =
19389 fidl::encoding::decode_envelope_header(decoder, next_offset)?
19390 {
19391 let member_inline_size =
19392 <PacketHeader as fidl::encoding::TypeMarker>::inline_size(decoder.context);
19393 if inlined != (member_inline_size <= 4) {
19394 return Err(fidl::Error::InvalidInlineBitInEnvelope);
19395 }
19396 let inner_offset;
19397 let mut inner_depth = depth.clone();
19398 if inlined {
19399 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
19400 inner_offset = next_offset;
19401 } else {
19402 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
19403 inner_depth.increment()?;
19404 }
19405 let val_ref = self.header.get_or_insert_with(|| fidl::new_empty!(PacketHeader, D));
19406 fidl::decode!(PacketHeader, D, val_ref, decoder, inner_offset, inner_depth)?;
19407 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
19408 {
19409 return Err(fidl::Error::InvalidNumBytesInEnvelope);
19410 }
19411 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
19412 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
19413 }
19414 }
19415
19416 next_offset += envelope_size;
19417 _next_ordinal_to_read += 1;
19418 if next_offset >= end_offset {
19419 return Ok(());
19420 }
19421
19422 while _next_ordinal_to_read < 2 {
19424 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
19425 _next_ordinal_to_read += 1;
19426 next_offset += envelope_size;
19427 }
19428
19429 let next_out_of_line = decoder.next_out_of_line();
19430 let handles_before = decoder.remaining_handles();
19431 if let Some((inlined, num_bytes, num_handles)) =
19432 fidl::encoding::decode_envelope_header(decoder, next_offset)?
19433 {
19434 let member_inline_size =
19435 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
19436 if inlined != (member_inline_size <= 4) {
19437 return Err(fidl::Error::InvalidInlineBitInEnvelope);
19438 }
19439 let inner_offset;
19440 let mut inner_depth = depth.clone();
19441 if inlined {
19442 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
19443 inner_offset = next_offset;
19444 } else {
19445 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
19446 inner_depth.increment()?;
19447 }
19448 let val_ref = self.buffer_index.get_or_insert_with(|| fidl::new_empty!(u32, D));
19449 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
19450 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
19451 {
19452 return Err(fidl::Error::InvalidNumBytesInEnvelope);
19453 }
19454 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
19455 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
19456 }
19457 }
19458
19459 next_offset += envelope_size;
19460 _next_ordinal_to_read += 1;
19461 if next_offset >= end_offset {
19462 return Ok(());
19463 }
19464
19465 while _next_ordinal_to_read < 3 {
19467 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
19468 _next_ordinal_to_read += 1;
19469 next_offset += envelope_size;
19470 }
19471
19472 let next_out_of_line = decoder.next_out_of_line();
19473 let handles_before = decoder.remaining_handles();
19474 if let Some((inlined, num_bytes, num_handles)) =
19475 fidl::encoding::decode_envelope_header(decoder, next_offset)?
19476 {
19477 let member_inline_size =
19478 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
19479 if inlined != (member_inline_size <= 4) {
19480 return Err(fidl::Error::InvalidInlineBitInEnvelope);
19481 }
19482 let inner_offset;
19483 let mut inner_depth = depth.clone();
19484 if inlined {
19485 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
19486 inner_offset = next_offset;
19487 } else {
19488 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
19489 inner_depth.increment()?;
19490 }
19491 let val_ref =
19492 self.stream_lifetime_ordinal.get_or_insert_with(|| fidl::new_empty!(u64, D));
19493 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
19494 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
19495 {
19496 return Err(fidl::Error::InvalidNumBytesInEnvelope);
19497 }
19498 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
19499 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
19500 }
19501 }
19502
19503 next_offset += envelope_size;
19504 _next_ordinal_to_read += 1;
19505 if next_offset >= end_offset {
19506 return Ok(());
19507 }
19508
19509 while _next_ordinal_to_read < 4 {
19511 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
19512 _next_ordinal_to_read += 1;
19513 next_offset += envelope_size;
19514 }
19515
19516 let next_out_of_line = decoder.next_out_of_line();
19517 let handles_before = decoder.remaining_handles();
19518 if let Some((inlined, num_bytes, num_handles)) =
19519 fidl::encoding::decode_envelope_header(decoder, next_offset)?
19520 {
19521 let member_inline_size =
19522 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
19523 if inlined != (member_inline_size <= 4) {
19524 return Err(fidl::Error::InvalidInlineBitInEnvelope);
19525 }
19526 let inner_offset;
19527 let mut inner_depth = depth.clone();
19528 if inlined {
19529 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
19530 inner_offset = next_offset;
19531 } else {
19532 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
19533 inner_depth.increment()?;
19534 }
19535 let val_ref = self.start_offset.get_or_insert_with(|| fidl::new_empty!(u32, D));
19536 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
19537 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
19538 {
19539 return Err(fidl::Error::InvalidNumBytesInEnvelope);
19540 }
19541 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
19542 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
19543 }
19544 }
19545
19546 next_offset += envelope_size;
19547 _next_ordinal_to_read += 1;
19548 if next_offset >= end_offset {
19549 return Ok(());
19550 }
19551
19552 while _next_ordinal_to_read < 5 {
19554 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
19555 _next_ordinal_to_read += 1;
19556 next_offset += envelope_size;
19557 }
19558
19559 let next_out_of_line = decoder.next_out_of_line();
19560 let handles_before = decoder.remaining_handles();
19561 if let Some((inlined, num_bytes, num_handles)) =
19562 fidl::encoding::decode_envelope_header(decoder, next_offset)?
19563 {
19564 let member_inline_size =
19565 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
19566 if inlined != (member_inline_size <= 4) {
19567 return Err(fidl::Error::InvalidInlineBitInEnvelope);
19568 }
19569 let inner_offset;
19570 let mut inner_depth = depth.clone();
19571 if inlined {
19572 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
19573 inner_offset = next_offset;
19574 } else {
19575 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
19576 inner_depth.increment()?;
19577 }
19578 let val_ref =
19579 self.valid_length_bytes.get_or_insert_with(|| fidl::new_empty!(u32, D));
19580 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
19581 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
19582 {
19583 return Err(fidl::Error::InvalidNumBytesInEnvelope);
19584 }
19585 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
19586 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
19587 }
19588 }
19589
19590 next_offset += envelope_size;
19591 _next_ordinal_to_read += 1;
19592 if next_offset >= end_offset {
19593 return Ok(());
19594 }
19595
19596 while _next_ordinal_to_read < 6 {
19598 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
19599 _next_ordinal_to_read += 1;
19600 next_offset += envelope_size;
19601 }
19602
19603 let next_out_of_line = decoder.next_out_of_line();
19604 let handles_before = decoder.remaining_handles();
19605 if let Some((inlined, num_bytes, num_handles)) =
19606 fidl::encoding::decode_envelope_header(decoder, next_offset)?
19607 {
19608 let member_inline_size =
19609 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
19610 if inlined != (member_inline_size <= 4) {
19611 return Err(fidl::Error::InvalidInlineBitInEnvelope);
19612 }
19613 let inner_offset;
19614 let mut inner_depth = depth.clone();
19615 if inlined {
19616 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
19617 inner_offset = next_offset;
19618 } else {
19619 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
19620 inner_depth.increment()?;
19621 }
19622 let val_ref = self.timestamp_ish.get_or_insert_with(|| fidl::new_empty!(u64, D));
19623 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
19624 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
19625 {
19626 return Err(fidl::Error::InvalidNumBytesInEnvelope);
19627 }
19628 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
19629 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
19630 }
19631 }
19632
19633 next_offset += envelope_size;
19634 _next_ordinal_to_read += 1;
19635 if next_offset >= end_offset {
19636 return Ok(());
19637 }
19638
19639 while _next_ordinal_to_read < 7 {
19641 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
19642 _next_ordinal_to_read += 1;
19643 next_offset += envelope_size;
19644 }
19645
19646 let next_out_of_line = decoder.next_out_of_line();
19647 let handles_before = decoder.remaining_handles();
19648 if let Some((inlined, num_bytes, num_handles)) =
19649 fidl::encoding::decode_envelope_header(decoder, next_offset)?
19650 {
19651 let member_inline_size =
19652 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
19653 if inlined != (member_inline_size <= 4) {
19654 return Err(fidl::Error::InvalidInlineBitInEnvelope);
19655 }
19656 let inner_offset;
19657 let mut inner_depth = depth.clone();
19658 if inlined {
19659 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
19660 inner_offset = next_offset;
19661 } else {
19662 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
19663 inner_depth.increment()?;
19664 }
19665 let val_ref =
19666 self.start_access_unit.get_or_insert_with(|| fidl::new_empty!(bool, D));
19667 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
19668 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
19669 {
19670 return Err(fidl::Error::InvalidNumBytesInEnvelope);
19671 }
19672 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
19673 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
19674 }
19675 }
19676
19677 next_offset += envelope_size;
19678 _next_ordinal_to_read += 1;
19679 if next_offset >= end_offset {
19680 return Ok(());
19681 }
19682
19683 while _next_ordinal_to_read < 8 {
19685 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
19686 _next_ordinal_to_read += 1;
19687 next_offset += envelope_size;
19688 }
19689
19690 let next_out_of_line = decoder.next_out_of_line();
19691 let handles_before = decoder.remaining_handles();
19692 if let Some((inlined, num_bytes, num_handles)) =
19693 fidl::encoding::decode_envelope_header(decoder, next_offset)?
19694 {
19695 let member_inline_size =
19696 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
19697 if inlined != (member_inline_size <= 4) {
19698 return Err(fidl::Error::InvalidInlineBitInEnvelope);
19699 }
19700 let inner_offset;
19701 let mut inner_depth = depth.clone();
19702 if inlined {
19703 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
19704 inner_offset = next_offset;
19705 } else {
19706 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
19707 inner_depth.increment()?;
19708 }
19709 let val_ref =
19710 self.known_end_access_unit.get_or_insert_with(|| fidl::new_empty!(bool, D));
19711 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
19712 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
19713 {
19714 return Err(fidl::Error::InvalidNumBytesInEnvelope);
19715 }
19716 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
19717 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
19718 }
19719 }
19720
19721 next_offset += envelope_size;
19722 _next_ordinal_to_read += 1;
19723 if next_offset >= end_offset {
19724 return Ok(());
19725 }
19726
19727 while _next_ordinal_to_read < 9 {
19729 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
19730 _next_ordinal_to_read += 1;
19731 next_offset += envelope_size;
19732 }
19733
19734 let next_out_of_line = decoder.next_out_of_line();
19735 let handles_before = decoder.remaining_handles();
19736 if let Some((inlined, num_bytes, num_handles)) =
19737 fidl::encoding::decode_envelope_header(decoder, next_offset)?
19738 {
19739 let member_inline_size =
19740 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
19741 if inlined != (member_inline_size <= 4) {
19742 return Err(fidl::Error::InvalidInlineBitInEnvelope);
19743 }
19744 let inner_offset;
19745 let mut inner_depth = depth.clone();
19746 if inlined {
19747 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
19748 inner_offset = next_offset;
19749 } else {
19750 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
19751 inner_depth.increment()?;
19752 }
19753 let val_ref = self.key_frame.get_or_insert_with(|| fidl::new_empty!(bool, D));
19754 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
19755 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
19756 {
19757 return Err(fidl::Error::InvalidNumBytesInEnvelope);
19758 }
19759 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
19760 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
19761 }
19762 }
19763
19764 next_offset += envelope_size;
19765
19766 while next_offset < end_offset {
19768 _next_ordinal_to_read += 1;
19769 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
19770 next_offset += envelope_size;
19771 }
19772
19773 Ok(())
19774 }
19775 }
19776
19777 impl PacketHeader {
19778 #[inline(always)]
19779 fn max_ordinal_present(&self) -> u64 {
19780 if let Some(_) = self.packet_index {
19781 return 2;
19782 }
19783 if let Some(_) = self.buffer_lifetime_ordinal {
19784 return 1;
19785 }
19786 0
19787 }
19788 }
19789
19790 impl fidl::encoding::ValueTypeMarker for PacketHeader {
19791 type Borrowed<'a> = &'a Self;
19792 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
19793 value
19794 }
19795 }
19796
19797 unsafe impl fidl::encoding::TypeMarker for PacketHeader {
19798 type Owned = Self;
19799
19800 #[inline(always)]
19801 fn inline_align(_context: fidl::encoding::Context) -> usize {
19802 8
19803 }
19804
19805 #[inline(always)]
19806 fn inline_size(_context: fidl::encoding::Context) -> usize {
19807 16
19808 }
19809 }
19810
19811 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<PacketHeader, D>
19812 for &PacketHeader
19813 {
19814 unsafe fn encode(
19815 self,
19816 encoder: &mut fidl::encoding::Encoder<'_, D>,
19817 offset: usize,
19818 mut depth: fidl::encoding::Depth,
19819 ) -> fidl::Result<()> {
19820 encoder.debug_check_bounds::<PacketHeader>(offset);
19821 let max_ordinal: u64 = self.max_ordinal_present();
19823 encoder.write_num(max_ordinal, offset);
19824 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
19825 if max_ordinal == 0 {
19827 return Ok(());
19828 }
19829 depth.increment()?;
19830 let envelope_size = 8;
19831 let bytes_len = max_ordinal as usize * envelope_size;
19832 #[allow(unused_variables)]
19833 let offset = encoder.out_of_line_offset(bytes_len);
19834 let mut _prev_end_offset: usize = 0;
19835 if 1 > max_ordinal {
19836 return Ok(());
19837 }
19838
19839 let cur_offset: usize = (1 - 1) * envelope_size;
19842
19843 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
19845
19846 fidl::encoding::encode_in_envelope_optional::<u64, D>(
19851 self.buffer_lifetime_ordinal
19852 .as_ref()
19853 .map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
19854 encoder,
19855 offset + cur_offset,
19856 depth,
19857 )?;
19858
19859 _prev_end_offset = cur_offset + envelope_size;
19860 if 2 > max_ordinal {
19861 return Ok(());
19862 }
19863
19864 let cur_offset: usize = (2 - 1) * envelope_size;
19867
19868 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
19870
19871 fidl::encoding::encode_in_envelope_optional::<u32, D>(
19876 self.packet_index.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
19877 encoder,
19878 offset + cur_offset,
19879 depth,
19880 )?;
19881
19882 _prev_end_offset = cur_offset + envelope_size;
19883
19884 Ok(())
19885 }
19886 }
19887
19888 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for PacketHeader {
19889 #[inline(always)]
19890 fn new_empty() -> Self {
19891 Self::default()
19892 }
19893
19894 unsafe fn decode(
19895 &mut self,
19896 decoder: &mut fidl::encoding::Decoder<'_, D>,
19897 offset: usize,
19898 mut depth: fidl::encoding::Depth,
19899 ) -> fidl::Result<()> {
19900 decoder.debug_check_bounds::<Self>(offset);
19901 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
19902 None => return Err(fidl::Error::NotNullable),
19903 Some(len) => len,
19904 };
19905 if len == 0 {
19907 return Ok(());
19908 };
19909 depth.increment()?;
19910 let envelope_size = 8;
19911 let bytes_len = len * envelope_size;
19912 let offset = decoder.out_of_line_offset(bytes_len)?;
19913 let mut _next_ordinal_to_read = 0;
19915 let mut next_offset = offset;
19916 let end_offset = offset + bytes_len;
19917 _next_ordinal_to_read += 1;
19918 if next_offset >= end_offset {
19919 return Ok(());
19920 }
19921
19922 while _next_ordinal_to_read < 1 {
19924 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
19925 _next_ordinal_to_read += 1;
19926 next_offset += envelope_size;
19927 }
19928
19929 let next_out_of_line = decoder.next_out_of_line();
19930 let handles_before = decoder.remaining_handles();
19931 if let Some((inlined, num_bytes, num_handles)) =
19932 fidl::encoding::decode_envelope_header(decoder, next_offset)?
19933 {
19934 let member_inline_size =
19935 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
19936 if inlined != (member_inline_size <= 4) {
19937 return Err(fidl::Error::InvalidInlineBitInEnvelope);
19938 }
19939 let inner_offset;
19940 let mut inner_depth = depth.clone();
19941 if inlined {
19942 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
19943 inner_offset = next_offset;
19944 } else {
19945 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
19946 inner_depth.increment()?;
19947 }
19948 let val_ref =
19949 self.buffer_lifetime_ordinal.get_or_insert_with(|| fidl::new_empty!(u64, D));
19950 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
19951 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
19952 {
19953 return Err(fidl::Error::InvalidNumBytesInEnvelope);
19954 }
19955 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
19956 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
19957 }
19958 }
19959
19960 next_offset += envelope_size;
19961 _next_ordinal_to_read += 1;
19962 if next_offset >= end_offset {
19963 return Ok(());
19964 }
19965
19966 while _next_ordinal_to_read < 2 {
19968 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
19969 _next_ordinal_to_read += 1;
19970 next_offset += envelope_size;
19971 }
19972
19973 let next_out_of_line = decoder.next_out_of_line();
19974 let handles_before = decoder.remaining_handles();
19975 if let Some((inlined, num_bytes, num_handles)) =
19976 fidl::encoding::decode_envelope_header(decoder, next_offset)?
19977 {
19978 let member_inline_size =
19979 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
19980 if inlined != (member_inline_size <= 4) {
19981 return Err(fidl::Error::InvalidInlineBitInEnvelope);
19982 }
19983 let inner_offset;
19984 let mut inner_depth = depth.clone();
19985 if inlined {
19986 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
19987 inner_offset = next_offset;
19988 } else {
19989 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
19990 inner_depth.increment()?;
19991 }
19992 let val_ref = self.packet_index.get_or_insert_with(|| fidl::new_empty!(u32, D));
19993 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
19994 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
19995 {
19996 return Err(fidl::Error::InvalidNumBytesInEnvelope);
19997 }
19998 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
19999 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
20000 }
20001 }
20002
20003 next_offset += envelope_size;
20004
20005 while next_offset < end_offset {
20007 _next_ordinal_to_read += 1;
20008 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
20009 next_offset += envelope_size;
20010 }
20011
20012 Ok(())
20013 }
20014 }
20015
20016 impl StreamBufferConstraints {
20017 #[inline(always)]
20018 fn max_ordinal_present(&self) -> u64 {
20019 if let Some(_) = self.is_physically_contiguous_required {
20020 return 13;
20021 }
20022 if let Some(_) = self.single_buffer_mode_allowed {
20023 return 12;
20024 }
20025 if let Some(_) = self.packet_count_for_client_max {
20026 return 11;
20027 }
20028 if let Some(_) = self.packet_count_for_client_min {
20029 return 10;
20030 }
20031 if let Some(_) = self.packet_count_for_server_max {
20032 return 9;
20033 }
20034 if let Some(_) = self.packet_count_for_server_recommended_max {
20035 return 8;
20036 }
20037 if let Some(_) = self.packet_count_for_server_recommended {
20038 return 7;
20039 }
20040 if let Some(_) = self.packet_count_for_server_min {
20041 return 6;
20042 }
20043 if let Some(_) = self.per_packet_buffer_bytes_max {
20044 return 5;
20045 }
20046 if let Some(_) = self.per_packet_buffer_bytes_recommended {
20047 return 4;
20048 }
20049 if let Some(_) = self.per_packet_buffer_bytes_min {
20050 return 3;
20051 }
20052 if let Some(_) = self.default_settings {
20053 return 2;
20054 }
20055 if let Some(_) = self.buffer_constraints_version_ordinal {
20056 return 1;
20057 }
20058 0
20059 }
20060 }
20061
20062 impl fidl::encoding::ValueTypeMarker for StreamBufferConstraints {
20063 type Borrowed<'a> = &'a Self;
20064 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
20065 value
20066 }
20067 }
20068
20069 unsafe impl fidl::encoding::TypeMarker for StreamBufferConstraints {
20070 type Owned = Self;
20071
20072 #[inline(always)]
20073 fn inline_align(_context: fidl::encoding::Context) -> usize {
20074 8
20075 }
20076
20077 #[inline(always)]
20078 fn inline_size(_context: fidl::encoding::Context) -> usize {
20079 16
20080 }
20081 }
20082
20083 unsafe impl<D: fidl::encoding::ResourceDialect>
20084 fidl::encoding::Encode<StreamBufferConstraints, D> for &StreamBufferConstraints
20085 {
20086 unsafe fn encode(
20087 self,
20088 encoder: &mut fidl::encoding::Encoder<'_, D>,
20089 offset: usize,
20090 mut depth: fidl::encoding::Depth,
20091 ) -> fidl::Result<()> {
20092 encoder.debug_check_bounds::<StreamBufferConstraints>(offset);
20093 let max_ordinal: u64 = self.max_ordinal_present();
20095 encoder.write_num(max_ordinal, offset);
20096 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
20097 if max_ordinal == 0 {
20099 return Ok(());
20100 }
20101 depth.increment()?;
20102 let envelope_size = 8;
20103 let bytes_len = max_ordinal as usize * envelope_size;
20104 #[allow(unused_variables)]
20105 let offset = encoder.out_of_line_offset(bytes_len);
20106 let mut _prev_end_offset: usize = 0;
20107 if 1 > max_ordinal {
20108 return Ok(());
20109 }
20110
20111 let cur_offset: usize = (1 - 1) * envelope_size;
20114
20115 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
20117
20118 fidl::encoding::encode_in_envelope_optional::<u64, D>(
20123 self.buffer_constraints_version_ordinal
20124 .as_ref()
20125 .map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
20126 encoder,
20127 offset + cur_offset,
20128 depth,
20129 )?;
20130
20131 _prev_end_offset = cur_offset + envelope_size;
20132 if 2 > max_ordinal {
20133 return Ok(());
20134 }
20135
20136 let cur_offset: usize = (2 - 1) * envelope_size;
20139
20140 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
20142
20143 fidl::encoding::encode_in_envelope_optional::<StreamBufferSettings, D>(
20148 self.default_settings
20149 .as_ref()
20150 .map(<StreamBufferSettings as fidl::encoding::ValueTypeMarker>::borrow),
20151 encoder,
20152 offset + cur_offset,
20153 depth,
20154 )?;
20155
20156 _prev_end_offset = cur_offset + envelope_size;
20157 if 3 > max_ordinal {
20158 return Ok(());
20159 }
20160
20161 let cur_offset: usize = (3 - 1) * envelope_size;
20164
20165 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
20167
20168 fidl::encoding::encode_in_envelope_optional::<u32, D>(
20173 self.per_packet_buffer_bytes_min
20174 .as_ref()
20175 .map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
20176 encoder,
20177 offset + cur_offset,
20178 depth,
20179 )?;
20180
20181 _prev_end_offset = cur_offset + envelope_size;
20182 if 4 > max_ordinal {
20183 return Ok(());
20184 }
20185
20186 let cur_offset: usize = (4 - 1) * envelope_size;
20189
20190 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
20192
20193 fidl::encoding::encode_in_envelope_optional::<u32, D>(
20198 self.per_packet_buffer_bytes_recommended
20199 .as_ref()
20200 .map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
20201 encoder,
20202 offset + cur_offset,
20203 depth,
20204 )?;
20205
20206 _prev_end_offset = cur_offset + envelope_size;
20207 if 5 > max_ordinal {
20208 return Ok(());
20209 }
20210
20211 let cur_offset: usize = (5 - 1) * envelope_size;
20214
20215 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
20217
20218 fidl::encoding::encode_in_envelope_optional::<u32, D>(
20223 self.per_packet_buffer_bytes_max
20224 .as_ref()
20225 .map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
20226 encoder,
20227 offset + cur_offset,
20228 depth,
20229 )?;
20230
20231 _prev_end_offset = cur_offset + envelope_size;
20232 if 6 > max_ordinal {
20233 return Ok(());
20234 }
20235
20236 let cur_offset: usize = (6 - 1) * envelope_size;
20239
20240 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
20242
20243 fidl::encoding::encode_in_envelope_optional::<u32, D>(
20248 self.packet_count_for_server_min
20249 .as_ref()
20250 .map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
20251 encoder,
20252 offset + cur_offset,
20253 depth,
20254 )?;
20255
20256 _prev_end_offset = cur_offset + envelope_size;
20257 if 7 > max_ordinal {
20258 return Ok(());
20259 }
20260
20261 let cur_offset: usize = (7 - 1) * envelope_size;
20264
20265 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
20267
20268 fidl::encoding::encode_in_envelope_optional::<u32, D>(
20273 self.packet_count_for_server_recommended
20274 .as_ref()
20275 .map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
20276 encoder,
20277 offset + cur_offset,
20278 depth,
20279 )?;
20280
20281 _prev_end_offset = cur_offset + envelope_size;
20282 if 8 > max_ordinal {
20283 return Ok(());
20284 }
20285
20286 let cur_offset: usize = (8 - 1) * envelope_size;
20289
20290 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
20292
20293 fidl::encoding::encode_in_envelope_optional::<u32, D>(
20298 self.packet_count_for_server_recommended_max
20299 .as_ref()
20300 .map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
20301 encoder,
20302 offset + cur_offset,
20303 depth,
20304 )?;
20305
20306 _prev_end_offset = cur_offset + envelope_size;
20307 if 9 > max_ordinal {
20308 return Ok(());
20309 }
20310
20311 let cur_offset: usize = (9 - 1) * envelope_size;
20314
20315 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
20317
20318 fidl::encoding::encode_in_envelope_optional::<u32, D>(
20323 self.packet_count_for_server_max
20324 .as_ref()
20325 .map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
20326 encoder,
20327 offset + cur_offset,
20328 depth,
20329 )?;
20330
20331 _prev_end_offset = cur_offset + envelope_size;
20332 if 10 > max_ordinal {
20333 return Ok(());
20334 }
20335
20336 let cur_offset: usize = (10 - 1) * envelope_size;
20339
20340 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
20342
20343 fidl::encoding::encode_in_envelope_optional::<u32, D>(
20348 self.packet_count_for_client_min
20349 .as_ref()
20350 .map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
20351 encoder,
20352 offset + cur_offset,
20353 depth,
20354 )?;
20355
20356 _prev_end_offset = cur_offset + envelope_size;
20357 if 11 > max_ordinal {
20358 return Ok(());
20359 }
20360
20361 let cur_offset: usize = (11 - 1) * envelope_size;
20364
20365 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
20367
20368 fidl::encoding::encode_in_envelope_optional::<u32, D>(
20373 self.packet_count_for_client_max
20374 .as_ref()
20375 .map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
20376 encoder,
20377 offset + cur_offset,
20378 depth,
20379 )?;
20380
20381 _prev_end_offset = cur_offset + envelope_size;
20382 if 12 > max_ordinal {
20383 return Ok(());
20384 }
20385
20386 let cur_offset: usize = (12 - 1) * envelope_size;
20389
20390 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
20392
20393 fidl::encoding::encode_in_envelope_optional::<bool, D>(
20398 self.single_buffer_mode_allowed
20399 .as_ref()
20400 .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
20401 encoder,
20402 offset + cur_offset,
20403 depth,
20404 )?;
20405
20406 _prev_end_offset = cur_offset + envelope_size;
20407 if 13 > max_ordinal {
20408 return Ok(());
20409 }
20410
20411 let cur_offset: usize = (13 - 1) * envelope_size;
20414
20415 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
20417
20418 fidl::encoding::encode_in_envelope_optional::<bool, D>(
20423 self.is_physically_contiguous_required
20424 .as_ref()
20425 .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
20426 encoder,
20427 offset + cur_offset,
20428 depth,
20429 )?;
20430
20431 _prev_end_offset = cur_offset + envelope_size;
20432
20433 Ok(())
20434 }
20435 }
20436
20437 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
20438 for StreamBufferConstraints
20439 {
20440 #[inline(always)]
20441 fn new_empty() -> Self {
20442 Self::default()
20443 }
20444
20445 unsafe fn decode(
20446 &mut self,
20447 decoder: &mut fidl::encoding::Decoder<'_, D>,
20448 offset: usize,
20449 mut depth: fidl::encoding::Depth,
20450 ) -> fidl::Result<()> {
20451 decoder.debug_check_bounds::<Self>(offset);
20452 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
20453 None => return Err(fidl::Error::NotNullable),
20454 Some(len) => len,
20455 };
20456 if len == 0 {
20458 return Ok(());
20459 };
20460 depth.increment()?;
20461 let envelope_size = 8;
20462 let bytes_len = len * envelope_size;
20463 let offset = decoder.out_of_line_offset(bytes_len)?;
20464 let mut _next_ordinal_to_read = 0;
20466 let mut next_offset = offset;
20467 let end_offset = offset + bytes_len;
20468 _next_ordinal_to_read += 1;
20469 if next_offset >= end_offset {
20470 return Ok(());
20471 }
20472
20473 while _next_ordinal_to_read < 1 {
20475 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
20476 _next_ordinal_to_read += 1;
20477 next_offset += envelope_size;
20478 }
20479
20480 let next_out_of_line = decoder.next_out_of_line();
20481 let handles_before = decoder.remaining_handles();
20482 if let Some((inlined, num_bytes, num_handles)) =
20483 fidl::encoding::decode_envelope_header(decoder, next_offset)?
20484 {
20485 let member_inline_size =
20486 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
20487 if inlined != (member_inline_size <= 4) {
20488 return Err(fidl::Error::InvalidInlineBitInEnvelope);
20489 }
20490 let inner_offset;
20491 let mut inner_depth = depth.clone();
20492 if inlined {
20493 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
20494 inner_offset = next_offset;
20495 } else {
20496 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
20497 inner_depth.increment()?;
20498 }
20499 let val_ref = self
20500 .buffer_constraints_version_ordinal
20501 .get_or_insert_with(|| fidl::new_empty!(u64, D));
20502 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
20503 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
20504 {
20505 return Err(fidl::Error::InvalidNumBytesInEnvelope);
20506 }
20507 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
20508 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
20509 }
20510 }
20511
20512 next_offset += envelope_size;
20513 _next_ordinal_to_read += 1;
20514 if next_offset >= end_offset {
20515 return Ok(());
20516 }
20517
20518 while _next_ordinal_to_read < 2 {
20520 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
20521 _next_ordinal_to_read += 1;
20522 next_offset += envelope_size;
20523 }
20524
20525 let next_out_of_line = decoder.next_out_of_line();
20526 let handles_before = decoder.remaining_handles();
20527 if let Some((inlined, num_bytes, num_handles)) =
20528 fidl::encoding::decode_envelope_header(decoder, next_offset)?
20529 {
20530 let member_inline_size =
20531 <StreamBufferSettings as fidl::encoding::TypeMarker>::inline_size(
20532 decoder.context,
20533 );
20534 if inlined != (member_inline_size <= 4) {
20535 return Err(fidl::Error::InvalidInlineBitInEnvelope);
20536 }
20537 let inner_offset;
20538 let mut inner_depth = depth.clone();
20539 if inlined {
20540 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
20541 inner_offset = next_offset;
20542 } else {
20543 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
20544 inner_depth.increment()?;
20545 }
20546 let val_ref = self
20547 .default_settings
20548 .get_or_insert_with(|| fidl::new_empty!(StreamBufferSettings, D));
20549 fidl::decode!(
20550 StreamBufferSettings,
20551 D,
20552 val_ref,
20553 decoder,
20554 inner_offset,
20555 inner_depth
20556 )?;
20557 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
20558 {
20559 return Err(fidl::Error::InvalidNumBytesInEnvelope);
20560 }
20561 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
20562 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
20563 }
20564 }
20565
20566 next_offset += envelope_size;
20567 _next_ordinal_to_read += 1;
20568 if next_offset >= end_offset {
20569 return Ok(());
20570 }
20571
20572 while _next_ordinal_to_read < 3 {
20574 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
20575 _next_ordinal_to_read += 1;
20576 next_offset += envelope_size;
20577 }
20578
20579 let next_out_of_line = decoder.next_out_of_line();
20580 let handles_before = decoder.remaining_handles();
20581 if let Some((inlined, num_bytes, num_handles)) =
20582 fidl::encoding::decode_envelope_header(decoder, next_offset)?
20583 {
20584 let member_inline_size =
20585 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
20586 if inlined != (member_inline_size <= 4) {
20587 return Err(fidl::Error::InvalidInlineBitInEnvelope);
20588 }
20589 let inner_offset;
20590 let mut inner_depth = depth.clone();
20591 if inlined {
20592 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
20593 inner_offset = next_offset;
20594 } else {
20595 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
20596 inner_depth.increment()?;
20597 }
20598 let val_ref = self
20599 .per_packet_buffer_bytes_min
20600 .get_or_insert_with(|| fidl::new_empty!(u32, D));
20601 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
20602 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
20603 {
20604 return Err(fidl::Error::InvalidNumBytesInEnvelope);
20605 }
20606 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
20607 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
20608 }
20609 }
20610
20611 next_offset += envelope_size;
20612 _next_ordinal_to_read += 1;
20613 if next_offset >= end_offset {
20614 return Ok(());
20615 }
20616
20617 while _next_ordinal_to_read < 4 {
20619 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
20620 _next_ordinal_to_read += 1;
20621 next_offset += envelope_size;
20622 }
20623
20624 let next_out_of_line = decoder.next_out_of_line();
20625 let handles_before = decoder.remaining_handles();
20626 if let Some((inlined, num_bytes, num_handles)) =
20627 fidl::encoding::decode_envelope_header(decoder, next_offset)?
20628 {
20629 let member_inline_size =
20630 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
20631 if inlined != (member_inline_size <= 4) {
20632 return Err(fidl::Error::InvalidInlineBitInEnvelope);
20633 }
20634 let inner_offset;
20635 let mut inner_depth = depth.clone();
20636 if inlined {
20637 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
20638 inner_offset = next_offset;
20639 } else {
20640 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
20641 inner_depth.increment()?;
20642 }
20643 let val_ref = self
20644 .per_packet_buffer_bytes_recommended
20645 .get_or_insert_with(|| fidl::new_empty!(u32, D));
20646 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
20647 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
20648 {
20649 return Err(fidl::Error::InvalidNumBytesInEnvelope);
20650 }
20651 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
20652 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
20653 }
20654 }
20655
20656 next_offset += envelope_size;
20657 _next_ordinal_to_read += 1;
20658 if next_offset >= end_offset {
20659 return Ok(());
20660 }
20661
20662 while _next_ordinal_to_read < 5 {
20664 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
20665 _next_ordinal_to_read += 1;
20666 next_offset += envelope_size;
20667 }
20668
20669 let next_out_of_line = decoder.next_out_of_line();
20670 let handles_before = decoder.remaining_handles();
20671 if let Some((inlined, num_bytes, num_handles)) =
20672 fidl::encoding::decode_envelope_header(decoder, next_offset)?
20673 {
20674 let member_inline_size =
20675 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
20676 if inlined != (member_inline_size <= 4) {
20677 return Err(fidl::Error::InvalidInlineBitInEnvelope);
20678 }
20679 let inner_offset;
20680 let mut inner_depth = depth.clone();
20681 if inlined {
20682 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
20683 inner_offset = next_offset;
20684 } else {
20685 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
20686 inner_depth.increment()?;
20687 }
20688 let val_ref = self
20689 .per_packet_buffer_bytes_max
20690 .get_or_insert_with(|| fidl::new_empty!(u32, D));
20691 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
20692 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
20693 {
20694 return Err(fidl::Error::InvalidNumBytesInEnvelope);
20695 }
20696 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
20697 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
20698 }
20699 }
20700
20701 next_offset += envelope_size;
20702 _next_ordinal_to_read += 1;
20703 if next_offset >= end_offset {
20704 return Ok(());
20705 }
20706
20707 while _next_ordinal_to_read < 6 {
20709 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
20710 _next_ordinal_to_read += 1;
20711 next_offset += envelope_size;
20712 }
20713
20714 let next_out_of_line = decoder.next_out_of_line();
20715 let handles_before = decoder.remaining_handles();
20716 if let Some((inlined, num_bytes, num_handles)) =
20717 fidl::encoding::decode_envelope_header(decoder, next_offset)?
20718 {
20719 let member_inline_size =
20720 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
20721 if inlined != (member_inline_size <= 4) {
20722 return Err(fidl::Error::InvalidInlineBitInEnvelope);
20723 }
20724 let inner_offset;
20725 let mut inner_depth = depth.clone();
20726 if inlined {
20727 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
20728 inner_offset = next_offset;
20729 } else {
20730 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
20731 inner_depth.increment()?;
20732 }
20733 let val_ref = self
20734 .packet_count_for_server_min
20735 .get_or_insert_with(|| fidl::new_empty!(u32, D));
20736 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
20737 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
20738 {
20739 return Err(fidl::Error::InvalidNumBytesInEnvelope);
20740 }
20741 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
20742 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
20743 }
20744 }
20745
20746 next_offset += envelope_size;
20747 _next_ordinal_to_read += 1;
20748 if next_offset >= end_offset {
20749 return Ok(());
20750 }
20751
20752 while _next_ordinal_to_read < 7 {
20754 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
20755 _next_ordinal_to_read += 1;
20756 next_offset += envelope_size;
20757 }
20758
20759 let next_out_of_line = decoder.next_out_of_line();
20760 let handles_before = decoder.remaining_handles();
20761 if let Some((inlined, num_bytes, num_handles)) =
20762 fidl::encoding::decode_envelope_header(decoder, next_offset)?
20763 {
20764 let member_inline_size =
20765 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
20766 if inlined != (member_inline_size <= 4) {
20767 return Err(fidl::Error::InvalidInlineBitInEnvelope);
20768 }
20769 let inner_offset;
20770 let mut inner_depth = depth.clone();
20771 if inlined {
20772 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
20773 inner_offset = next_offset;
20774 } else {
20775 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
20776 inner_depth.increment()?;
20777 }
20778 let val_ref = self
20779 .packet_count_for_server_recommended
20780 .get_or_insert_with(|| fidl::new_empty!(u32, D));
20781 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
20782 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
20783 {
20784 return Err(fidl::Error::InvalidNumBytesInEnvelope);
20785 }
20786 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
20787 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
20788 }
20789 }
20790
20791 next_offset += envelope_size;
20792 _next_ordinal_to_read += 1;
20793 if next_offset >= end_offset {
20794 return Ok(());
20795 }
20796
20797 while _next_ordinal_to_read < 8 {
20799 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
20800 _next_ordinal_to_read += 1;
20801 next_offset += envelope_size;
20802 }
20803
20804 let next_out_of_line = decoder.next_out_of_line();
20805 let handles_before = decoder.remaining_handles();
20806 if let Some((inlined, num_bytes, num_handles)) =
20807 fidl::encoding::decode_envelope_header(decoder, next_offset)?
20808 {
20809 let member_inline_size =
20810 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
20811 if inlined != (member_inline_size <= 4) {
20812 return Err(fidl::Error::InvalidInlineBitInEnvelope);
20813 }
20814 let inner_offset;
20815 let mut inner_depth = depth.clone();
20816 if inlined {
20817 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
20818 inner_offset = next_offset;
20819 } else {
20820 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
20821 inner_depth.increment()?;
20822 }
20823 let val_ref = self
20824 .packet_count_for_server_recommended_max
20825 .get_or_insert_with(|| fidl::new_empty!(u32, D));
20826 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
20827 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
20828 {
20829 return Err(fidl::Error::InvalidNumBytesInEnvelope);
20830 }
20831 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
20832 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
20833 }
20834 }
20835
20836 next_offset += envelope_size;
20837 _next_ordinal_to_read += 1;
20838 if next_offset >= end_offset {
20839 return Ok(());
20840 }
20841
20842 while _next_ordinal_to_read < 9 {
20844 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
20845 _next_ordinal_to_read += 1;
20846 next_offset += envelope_size;
20847 }
20848
20849 let next_out_of_line = decoder.next_out_of_line();
20850 let handles_before = decoder.remaining_handles();
20851 if let Some((inlined, num_bytes, num_handles)) =
20852 fidl::encoding::decode_envelope_header(decoder, next_offset)?
20853 {
20854 let member_inline_size =
20855 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
20856 if inlined != (member_inline_size <= 4) {
20857 return Err(fidl::Error::InvalidInlineBitInEnvelope);
20858 }
20859 let inner_offset;
20860 let mut inner_depth = depth.clone();
20861 if inlined {
20862 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
20863 inner_offset = next_offset;
20864 } else {
20865 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
20866 inner_depth.increment()?;
20867 }
20868 let val_ref = self
20869 .packet_count_for_server_max
20870 .get_or_insert_with(|| fidl::new_empty!(u32, D));
20871 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
20872 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
20873 {
20874 return Err(fidl::Error::InvalidNumBytesInEnvelope);
20875 }
20876 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
20877 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
20878 }
20879 }
20880
20881 next_offset += envelope_size;
20882 _next_ordinal_to_read += 1;
20883 if next_offset >= end_offset {
20884 return Ok(());
20885 }
20886
20887 while _next_ordinal_to_read < 10 {
20889 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
20890 _next_ordinal_to_read += 1;
20891 next_offset += envelope_size;
20892 }
20893
20894 let next_out_of_line = decoder.next_out_of_line();
20895 let handles_before = decoder.remaining_handles();
20896 if let Some((inlined, num_bytes, num_handles)) =
20897 fidl::encoding::decode_envelope_header(decoder, next_offset)?
20898 {
20899 let member_inline_size =
20900 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
20901 if inlined != (member_inline_size <= 4) {
20902 return Err(fidl::Error::InvalidInlineBitInEnvelope);
20903 }
20904 let inner_offset;
20905 let mut inner_depth = depth.clone();
20906 if inlined {
20907 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
20908 inner_offset = next_offset;
20909 } else {
20910 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
20911 inner_depth.increment()?;
20912 }
20913 let val_ref = self
20914 .packet_count_for_client_min
20915 .get_or_insert_with(|| fidl::new_empty!(u32, D));
20916 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
20917 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
20918 {
20919 return Err(fidl::Error::InvalidNumBytesInEnvelope);
20920 }
20921 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
20922 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
20923 }
20924 }
20925
20926 next_offset += envelope_size;
20927 _next_ordinal_to_read += 1;
20928 if next_offset >= end_offset {
20929 return Ok(());
20930 }
20931
20932 while _next_ordinal_to_read < 11 {
20934 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
20935 _next_ordinal_to_read += 1;
20936 next_offset += envelope_size;
20937 }
20938
20939 let next_out_of_line = decoder.next_out_of_line();
20940 let handles_before = decoder.remaining_handles();
20941 if let Some((inlined, num_bytes, num_handles)) =
20942 fidl::encoding::decode_envelope_header(decoder, next_offset)?
20943 {
20944 let member_inline_size =
20945 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
20946 if inlined != (member_inline_size <= 4) {
20947 return Err(fidl::Error::InvalidInlineBitInEnvelope);
20948 }
20949 let inner_offset;
20950 let mut inner_depth = depth.clone();
20951 if inlined {
20952 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
20953 inner_offset = next_offset;
20954 } else {
20955 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
20956 inner_depth.increment()?;
20957 }
20958 let val_ref = self
20959 .packet_count_for_client_max
20960 .get_or_insert_with(|| fidl::new_empty!(u32, D));
20961 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
20962 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
20963 {
20964 return Err(fidl::Error::InvalidNumBytesInEnvelope);
20965 }
20966 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
20967 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
20968 }
20969 }
20970
20971 next_offset += envelope_size;
20972 _next_ordinal_to_read += 1;
20973 if next_offset >= end_offset {
20974 return Ok(());
20975 }
20976
20977 while _next_ordinal_to_read < 12 {
20979 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
20980 _next_ordinal_to_read += 1;
20981 next_offset += envelope_size;
20982 }
20983
20984 let next_out_of_line = decoder.next_out_of_line();
20985 let handles_before = decoder.remaining_handles();
20986 if let Some((inlined, num_bytes, num_handles)) =
20987 fidl::encoding::decode_envelope_header(decoder, next_offset)?
20988 {
20989 let member_inline_size =
20990 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
20991 if inlined != (member_inline_size <= 4) {
20992 return Err(fidl::Error::InvalidInlineBitInEnvelope);
20993 }
20994 let inner_offset;
20995 let mut inner_depth = depth.clone();
20996 if inlined {
20997 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
20998 inner_offset = next_offset;
20999 } else {
21000 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
21001 inner_depth.increment()?;
21002 }
21003 let val_ref = self
21004 .single_buffer_mode_allowed
21005 .get_or_insert_with(|| fidl::new_empty!(bool, D));
21006 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
21007 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
21008 {
21009 return Err(fidl::Error::InvalidNumBytesInEnvelope);
21010 }
21011 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
21012 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
21013 }
21014 }
21015
21016 next_offset += envelope_size;
21017 _next_ordinal_to_read += 1;
21018 if next_offset >= end_offset {
21019 return Ok(());
21020 }
21021
21022 while _next_ordinal_to_read < 13 {
21024 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
21025 _next_ordinal_to_read += 1;
21026 next_offset += envelope_size;
21027 }
21028
21029 let next_out_of_line = decoder.next_out_of_line();
21030 let handles_before = decoder.remaining_handles();
21031 if let Some((inlined, num_bytes, num_handles)) =
21032 fidl::encoding::decode_envelope_header(decoder, next_offset)?
21033 {
21034 let member_inline_size =
21035 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
21036 if inlined != (member_inline_size <= 4) {
21037 return Err(fidl::Error::InvalidInlineBitInEnvelope);
21038 }
21039 let inner_offset;
21040 let mut inner_depth = depth.clone();
21041 if inlined {
21042 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
21043 inner_offset = next_offset;
21044 } else {
21045 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
21046 inner_depth.increment()?;
21047 }
21048 let val_ref = self
21049 .is_physically_contiguous_required
21050 .get_or_insert_with(|| fidl::new_empty!(bool, D));
21051 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
21052 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
21053 {
21054 return Err(fidl::Error::InvalidNumBytesInEnvelope);
21055 }
21056 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
21057 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
21058 }
21059 }
21060
21061 next_offset += envelope_size;
21062
21063 while next_offset < end_offset {
21065 _next_ordinal_to_read += 1;
21066 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
21067 next_offset += envelope_size;
21068 }
21069
21070 Ok(())
21071 }
21072 }
21073
21074 impl StreamBufferSettings {
21075 #[inline(always)]
21076 fn max_ordinal_present(&self) -> u64 {
21077 if let Some(_) = self.single_buffer_mode {
21078 return 6;
21079 }
21080 if let Some(_) = self.per_packet_buffer_bytes {
21081 return 5;
21082 }
21083 if let Some(_) = self.packet_count_for_client {
21084 return 4;
21085 }
21086 if let Some(_) = self.packet_count_for_server {
21087 return 3;
21088 }
21089 if let Some(_) = self.buffer_constraints_version_ordinal {
21090 return 2;
21091 }
21092 if let Some(_) = self.buffer_lifetime_ordinal {
21093 return 1;
21094 }
21095 0
21096 }
21097 }
21098
21099 impl fidl::encoding::ValueTypeMarker for StreamBufferSettings {
21100 type Borrowed<'a> = &'a Self;
21101 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
21102 value
21103 }
21104 }
21105
21106 unsafe impl fidl::encoding::TypeMarker for StreamBufferSettings {
21107 type Owned = Self;
21108
21109 #[inline(always)]
21110 fn inline_align(_context: fidl::encoding::Context) -> usize {
21111 8
21112 }
21113
21114 #[inline(always)]
21115 fn inline_size(_context: fidl::encoding::Context) -> usize {
21116 16
21117 }
21118 }
21119
21120 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<StreamBufferSettings, D>
21121 for &StreamBufferSettings
21122 {
21123 unsafe fn encode(
21124 self,
21125 encoder: &mut fidl::encoding::Encoder<'_, D>,
21126 offset: usize,
21127 mut depth: fidl::encoding::Depth,
21128 ) -> fidl::Result<()> {
21129 encoder.debug_check_bounds::<StreamBufferSettings>(offset);
21130 let max_ordinal: u64 = self.max_ordinal_present();
21132 encoder.write_num(max_ordinal, offset);
21133 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
21134 if max_ordinal == 0 {
21136 return Ok(());
21137 }
21138 depth.increment()?;
21139 let envelope_size = 8;
21140 let bytes_len = max_ordinal as usize * envelope_size;
21141 #[allow(unused_variables)]
21142 let offset = encoder.out_of_line_offset(bytes_len);
21143 let mut _prev_end_offset: usize = 0;
21144 if 1 > max_ordinal {
21145 return Ok(());
21146 }
21147
21148 let cur_offset: usize = (1 - 1) * envelope_size;
21151
21152 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
21154
21155 fidl::encoding::encode_in_envelope_optional::<u64, D>(
21160 self.buffer_lifetime_ordinal
21161 .as_ref()
21162 .map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
21163 encoder,
21164 offset + cur_offset,
21165 depth,
21166 )?;
21167
21168 _prev_end_offset = cur_offset + envelope_size;
21169 if 2 > max_ordinal {
21170 return Ok(());
21171 }
21172
21173 let cur_offset: usize = (2 - 1) * envelope_size;
21176
21177 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
21179
21180 fidl::encoding::encode_in_envelope_optional::<u64, D>(
21185 self.buffer_constraints_version_ordinal
21186 .as_ref()
21187 .map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
21188 encoder,
21189 offset + cur_offset,
21190 depth,
21191 )?;
21192
21193 _prev_end_offset = cur_offset + envelope_size;
21194 if 3 > max_ordinal {
21195 return Ok(());
21196 }
21197
21198 let cur_offset: usize = (3 - 1) * envelope_size;
21201
21202 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
21204
21205 fidl::encoding::encode_in_envelope_optional::<u32, D>(
21210 self.packet_count_for_server
21211 .as_ref()
21212 .map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
21213 encoder,
21214 offset + cur_offset,
21215 depth,
21216 )?;
21217
21218 _prev_end_offset = cur_offset + envelope_size;
21219 if 4 > max_ordinal {
21220 return Ok(());
21221 }
21222
21223 let cur_offset: usize = (4 - 1) * envelope_size;
21226
21227 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
21229
21230 fidl::encoding::encode_in_envelope_optional::<u32, D>(
21235 self.packet_count_for_client
21236 .as_ref()
21237 .map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
21238 encoder,
21239 offset + cur_offset,
21240 depth,
21241 )?;
21242
21243 _prev_end_offset = cur_offset + envelope_size;
21244 if 5 > max_ordinal {
21245 return Ok(());
21246 }
21247
21248 let cur_offset: usize = (5 - 1) * envelope_size;
21251
21252 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
21254
21255 fidl::encoding::encode_in_envelope_optional::<u32, D>(
21260 self.per_packet_buffer_bytes
21261 .as_ref()
21262 .map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
21263 encoder,
21264 offset + cur_offset,
21265 depth,
21266 )?;
21267
21268 _prev_end_offset = cur_offset + envelope_size;
21269 if 6 > max_ordinal {
21270 return Ok(());
21271 }
21272
21273 let cur_offset: usize = (6 - 1) * envelope_size;
21276
21277 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
21279
21280 fidl::encoding::encode_in_envelope_optional::<bool, D>(
21285 self.single_buffer_mode
21286 .as_ref()
21287 .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
21288 encoder,
21289 offset + cur_offset,
21290 depth,
21291 )?;
21292
21293 _prev_end_offset = cur_offset + envelope_size;
21294
21295 Ok(())
21296 }
21297 }
21298
21299 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for StreamBufferSettings {
21300 #[inline(always)]
21301 fn new_empty() -> Self {
21302 Self::default()
21303 }
21304
21305 unsafe fn decode(
21306 &mut self,
21307 decoder: &mut fidl::encoding::Decoder<'_, D>,
21308 offset: usize,
21309 mut depth: fidl::encoding::Depth,
21310 ) -> fidl::Result<()> {
21311 decoder.debug_check_bounds::<Self>(offset);
21312 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
21313 None => return Err(fidl::Error::NotNullable),
21314 Some(len) => len,
21315 };
21316 if len == 0 {
21318 return Ok(());
21319 };
21320 depth.increment()?;
21321 let envelope_size = 8;
21322 let bytes_len = len * envelope_size;
21323 let offset = decoder.out_of_line_offset(bytes_len)?;
21324 let mut _next_ordinal_to_read = 0;
21326 let mut next_offset = offset;
21327 let end_offset = offset + bytes_len;
21328 _next_ordinal_to_read += 1;
21329 if next_offset >= end_offset {
21330 return Ok(());
21331 }
21332
21333 while _next_ordinal_to_read < 1 {
21335 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
21336 _next_ordinal_to_read += 1;
21337 next_offset += envelope_size;
21338 }
21339
21340 let next_out_of_line = decoder.next_out_of_line();
21341 let handles_before = decoder.remaining_handles();
21342 if let Some((inlined, num_bytes, num_handles)) =
21343 fidl::encoding::decode_envelope_header(decoder, next_offset)?
21344 {
21345 let member_inline_size =
21346 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
21347 if inlined != (member_inline_size <= 4) {
21348 return Err(fidl::Error::InvalidInlineBitInEnvelope);
21349 }
21350 let inner_offset;
21351 let mut inner_depth = depth.clone();
21352 if inlined {
21353 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
21354 inner_offset = next_offset;
21355 } else {
21356 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
21357 inner_depth.increment()?;
21358 }
21359 let val_ref =
21360 self.buffer_lifetime_ordinal.get_or_insert_with(|| fidl::new_empty!(u64, D));
21361 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
21362 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
21363 {
21364 return Err(fidl::Error::InvalidNumBytesInEnvelope);
21365 }
21366 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
21367 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
21368 }
21369 }
21370
21371 next_offset += envelope_size;
21372 _next_ordinal_to_read += 1;
21373 if next_offset >= end_offset {
21374 return Ok(());
21375 }
21376
21377 while _next_ordinal_to_read < 2 {
21379 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
21380 _next_ordinal_to_read += 1;
21381 next_offset += envelope_size;
21382 }
21383
21384 let next_out_of_line = decoder.next_out_of_line();
21385 let handles_before = decoder.remaining_handles();
21386 if let Some((inlined, num_bytes, num_handles)) =
21387 fidl::encoding::decode_envelope_header(decoder, next_offset)?
21388 {
21389 let member_inline_size =
21390 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
21391 if inlined != (member_inline_size <= 4) {
21392 return Err(fidl::Error::InvalidInlineBitInEnvelope);
21393 }
21394 let inner_offset;
21395 let mut inner_depth = depth.clone();
21396 if inlined {
21397 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
21398 inner_offset = next_offset;
21399 } else {
21400 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
21401 inner_depth.increment()?;
21402 }
21403 let val_ref = self
21404 .buffer_constraints_version_ordinal
21405 .get_or_insert_with(|| fidl::new_empty!(u64, D));
21406 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
21407 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
21408 {
21409 return Err(fidl::Error::InvalidNumBytesInEnvelope);
21410 }
21411 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
21412 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
21413 }
21414 }
21415
21416 next_offset += envelope_size;
21417 _next_ordinal_to_read += 1;
21418 if next_offset >= end_offset {
21419 return Ok(());
21420 }
21421
21422 while _next_ordinal_to_read < 3 {
21424 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
21425 _next_ordinal_to_read += 1;
21426 next_offset += envelope_size;
21427 }
21428
21429 let next_out_of_line = decoder.next_out_of_line();
21430 let handles_before = decoder.remaining_handles();
21431 if let Some((inlined, num_bytes, num_handles)) =
21432 fidl::encoding::decode_envelope_header(decoder, next_offset)?
21433 {
21434 let member_inline_size =
21435 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
21436 if inlined != (member_inline_size <= 4) {
21437 return Err(fidl::Error::InvalidInlineBitInEnvelope);
21438 }
21439 let inner_offset;
21440 let mut inner_depth = depth.clone();
21441 if inlined {
21442 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
21443 inner_offset = next_offset;
21444 } else {
21445 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
21446 inner_depth.increment()?;
21447 }
21448 let val_ref =
21449 self.packet_count_for_server.get_or_insert_with(|| fidl::new_empty!(u32, D));
21450 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
21451 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
21452 {
21453 return Err(fidl::Error::InvalidNumBytesInEnvelope);
21454 }
21455 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
21456 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
21457 }
21458 }
21459
21460 next_offset += envelope_size;
21461 _next_ordinal_to_read += 1;
21462 if next_offset >= end_offset {
21463 return Ok(());
21464 }
21465
21466 while _next_ordinal_to_read < 4 {
21468 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
21469 _next_ordinal_to_read += 1;
21470 next_offset += envelope_size;
21471 }
21472
21473 let next_out_of_line = decoder.next_out_of_line();
21474 let handles_before = decoder.remaining_handles();
21475 if let Some((inlined, num_bytes, num_handles)) =
21476 fidl::encoding::decode_envelope_header(decoder, next_offset)?
21477 {
21478 let member_inline_size =
21479 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
21480 if inlined != (member_inline_size <= 4) {
21481 return Err(fidl::Error::InvalidInlineBitInEnvelope);
21482 }
21483 let inner_offset;
21484 let mut inner_depth = depth.clone();
21485 if inlined {
21486 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
21487 inner_offset = next_offset;
21488 } else {
21489 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
21490 inner_depth.increment()?;
21491 }
21492 let val_ref =
21493 self.packet_count_for_client.get_or_insert_with(|| fidl::new_empty!(u32, D));
21494 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
21495 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
21496 {
21497 return Err(fidl::Error::InvalidNumBytesInEnvelope);
21498 }
21499 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
21500 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
21501 }
21502 }
21503
21504 next_offset += envelope_size;
21505 _next_ordinal_to_read += 1;
21506 if next_offset >= end_offset {
21507 return Ok(());
21508 }
21509
21510 while _next_ordinal_to_read < 5 {
21512 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
21513 _next_ordinal_to_read += 1;
21514 next_offset += envelope_size;
21515 }
21516
21517 let next_out_of_line = decoder.next_out_of_line();
21518 let handles_before = decoder.remaining_handles();
21519 if let Some((inlined, num_bytes, num_handles)) =
21520 fidl::encoding::decode_envelope_header(decoder, next_offset)?
21521 {
21522 let member_inline_size =
21523 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
21524 if inlined != (member_inline_size <= 4) {
21525 return Err(fidl::Error::InvalidInlineBitInEnvelope);
21526 }
21527 let inner_offset;
21528 let mut inner_depth = depth.clone();
21529 if inlined {
21530 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
21531 inner_offset = next_offset;
21532 } else {
21533 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
21534 inner_depth.increment()?;
21535 }
21536 let val_ref =
21537 self.per_packet_buffer_bytes.get_or_insert_with(|| fidl::new_empty!(u32, D));
21538 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
21539 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
21540 {
21541 return Err(fidl::Error::InvalidNumBytesInEnvelope);
21542 }
21543 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
21544 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
21545 }
21546 }
21547
21548 next_offset += envelope_size;
21549 _next_ordinal_to_read += 1;
21550 if next_offset >= end_offset {
21551 return Ok(());
21552 }
21553
21554 while _next_ordinal_to_read < 6 {
21556 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
21557 _next_ordinal_to_read += 1;
21558 next_offset += envelope_size;
21559 }
21560
21561 let next_out_of_line = decoder.next_out_of_line();
21562 let handles_before = decoder.remaining_handles();
21563 if let Some((inlined, num_bytes, num_handles)) =
21564 fidl::encoding::decode_envelope_header(decoder, next_offset)?
21565 {
21566 let member_inline_size =
21567 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
21568 if inlined != (member_inline_size <= 4) {
21569 return Err(fidl::Error::InvalidInlineBitInEnvelope);
21570 }
21571 let inner_offset;
21572 let mut inner_depth = depth.clone();
21573 if inlined {
21574 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
21575 inner_offset = next_offset;
21576 } else {
21577 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
21578 inner_depth.increment()?;
21579 }
21580 let val_ref =
21581 self.single_buffer_mode.get_or_insert_with(|| fidl::new_empty!(bool, D));
21582 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
21583 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
21584 {
21585 return Err(fidl::Error::InvalidNumBytesInEnvelope);
21586 }
21587 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
21588 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
21589 }
21590 }
21591
21592 next_offset += envelope_size;
21593
21594 while next_offset < end_offset {
21596 _next_ordinal_to_read += 1;
21597 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
21598 next_offset += envelope_size;
21599 }
21600
21601 Ok(())
21602 }
21603 }
21604
21605 impl StreamOutputConstraints {
21606 #[inline(always)]
21607 fn max_ordinal_present(&self) -> u64 {
21608 if let Some(_) = self.buffer_constraints {
21609 return 3;
21610 }
21611 if let Some(_) = self.buffer_constraints_action_required {
21612 return 2;
21613 }
21614 if let Some(_) = self.stream_lifetime_ordinal {
21615 return 1;
21616 }
21617 0
21618 }
21619 }
21620
21621 impl fidl::encoding::ValueTypeMarker for StreamOutputConstraints {
21622 type Borrowed<'a> = &'a Self;
21623 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
21624 value
21625 }
21626 }
21627
21628 unsafe impl fidl::encoding::TypeMarker for StreamOutputConstraints {
21629 type Owned = Self;
21630
21631 #[inline(always)]
21632 fn inline_align(_context: fidl::encoding::Context) -> usize {
21633 8
21634 }
21635
21636 #[inline(always)]
21637 fn inline_size(_context: fidl::encoding::Context) -> usize {
21638 16
21639 }
21640 }
21641
21642 unsafe impl<D: fidl::encoding::ResourceDialect>
21643 fidl::encoding::Encode<StreamOutputConstraints, D> for &StreamOutputConstraints
21644 {
21645 unsafe fn encode(
21646 self,
21647 encoder: &mut fidl::encoding::Encoder<'_, D>,
21648 offset: usize,
21649 mut depth: fidl::encoding::Depth,
21650 ) -> fidl::Result<()> {
21651 encoder.debug_check_bounds::<StreamOutputConstraints>(offset);
21652 let max_ordinal: u64 = self.max_ordinal_present();
21654 encoder.write_num(max_ordinal, offset);
21655 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
21656 if max_ordinal == 0 {
21658 return Ok(());
21659 }
21660 depth.increment()?;
21661 let envelope_size = 8;
21662 let bytes_len = max_ordinal as usize * envelope_size;
21663 #[allow(unused_variables)]
21664 let offset = encoder.out_of_line_offset(bytes_len);
21665 let mut _prev_end_offset: usize = 0;
21666 if 1 > max_ordinal {
21667 return Ok(());
21668 }
21669
21670 let cur_offset: usize = (1 - 1) * envelope_size;
21673
21674 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
21676
21677 fidl::encoding::encode_in_envelope_optional::<u64, D>(
21682 self.stream_lifetime_ordinal
21683 .as_ref()
21684 .map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
21685 encoder,
21686 offset + cur_offset,
21687 depth,
21688 )?;
21689
21690 _prev_end_offset = cur_offset + envelope_size;
21691 if 2 > max_ordinal {
21692 return Ok(());
21693 }
21694
21695 let cur_offset: usize = (2 - 1) * envelope_size;
21698
21699 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
21701
21702 fidl::encoding::encode_in_envelope_optional::<bool, D>(
21707 self.buffer_constraints_action_required
21708 .as_ref()
21709 .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
21710 encoder,
21711 offset + cur_offset,
21712 depth,
21713 )?;
21714
21715 _prev_end_offset = cur_offset + envelope_size;
21716 if 3 > max_ordinal {
21717 return Ok(());
21718 }
21719
21720 let cur_offset: usize = (3 - 1) * envelope_size;
21723
21724 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
21726
21727 fidl::encoding::encode_in_envelope_optional::<StreamBufferConstraints, D>(
21732 self.buffer_constraints
21733 .as_ref()
21734 .map(<StreamBufferConstraints as fidl::encoding::ValueTypeMarker>::borrow),
21735 encoder,
21736 offset + cur_offset,
21737 depth,
21738 )?;
21739
21740 _prev_end_offset = cur_offset + envelope_size;
21741
21742 Ok(())
21743 }
21744 }
21745
21746 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
21747 for StreamOutputConstraints
21748 {
21749 #[inline(always)]
21750 fn new_empty() -> Self {
21751 Self::default()
21752 }
21753
21754 unsafe fn decode(
21755 &mut self,
21756 decoder: &mut fidl::encoding::Decoder<'_, D>,
21757 offset: usize,
21758 mut depth: fidl::encoding::Depth,
21759 ) -> fidl::Result<()> {
21760 decoder.debug_check_bounds::<Self>(offset);
21761 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
21762 None => return Err(fidl::Error::NotNullable),
21763 Some(len) => len,
21764 };
21765 if len == 0 {
21767 return Ok(());
21768 };
21769 depth.increment()?;
21770 let envelope_size = 8;
21771 let bytes_len = len * envelope_size;
21772 let offset = decoder.out_of_line_offset(bytes_len)?;
21773 let mut _next_ordinal_to_read = 0;
21775 let mut next_offset = offset;
21776 let end_offset = offset + bytes_len;
21777 _next_ordinal_to_read += 1;
21778 if next_offset >= end_offset {
21779 return Ok(());
21780 }
21781
21782 while _next_ordinal_to_read < 1 {
21784 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
21785 _next_ordinal_to_read += 1;
21786 next_offset += envelope_size;
21787 }
21788
21789 let next_out_of_line = decoder.next_out_of_line();
21790 let handles_before = decoder.remaining_handles();
21791 if let Some((inlined, num_bytes, num_handles)) =
21792 fidl::encoding::decode_envelope_header(decoder, next_offset)?
21793 {
21794 let member_inline_size =
21795 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
21796 if inlined != (member_inline_size <= 4) {
21797 return Err(fidl::Error::InvalidInlineBitInEnvelope);
21798 }
21799 let inner_offset;
21800 let mut inner_depth = depth.clone();
21801 if inlined {
21802 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
21803 inner_offset = next_offset;
21804 } else {
21805 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
21806 inner_depth.increment()?;
21807 }
21808 let val_ref =
21809 self.stream_lifetime_ordinal.get_or_insert_with(|| fidl::new_empty!(u64, D));
21810 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
21811 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
21812 {
21813 return Err(fidl::Error::InvalidNumBytesInEnvelope);
21814 }
21815 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
21816 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
21817 }
21818 }
21819
21820 next_offset += envelope_size;
21821 _next_ordinal_to_read += 1;
21822 if next_offset >= end_offset {
21823 return Ok(());
21824 }
21825
21826 while _next_ordinal_to_read < 2 {
21828 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
21829 _next_ordinal_to_read += 1;
21830 next_offset += envelope_size;
21831 }
21832
21833 let next_out_of_line = decoder.next_out_of_line();
21834 let handles_before = decoder.remaining_handles();
21835 if let Some((inlined, num_bytes, num_handles)) =
21836 fidl::encoding::decode_envelope_header(decoder, next_offset)?
21837 {
21838 let member_inline_size =
21839 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
21840 if inlined != (member_inline_size <= 4) {
21841 return Err(fidl::Error::InvalidInlineBitInEnvelope);
21842 }
21843 let inner_offset;
21844 let mut inner_depth = depth.clone();
21845 if inlined {
21846 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
21847 inner_offset = next_offset;
21848 } else {
21849 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
21850 inner_depth.increment()?;
21851 }
21852 let val_ref = self
21853 .buffer_constraints_action_required
21854 .get_or_insert_with(|| fidl::new_empty!(bool, D));
21855 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
21856 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
21857 {
21858 return Err(fidl::Error::InvalidNumBytesInEnvelope);
21859 }
21860 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
21861 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
21862 }
21863 }
21864
21865 next_offset += envelope_size;
21866 _next_ordinal_to_read += 1;
21867 if next_offset >= end_offset {
21868 return Ok(());
21869 }
21870
21871 while _next_ordinal_to_read < 3 {
21873 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
21874 _next_ordinal_to_read += 1;
21875 next_offset += envelope_size;
21876 }
21877
21878 let next_out_of_line = decoder.next_out_of_line();
21879 let handles_before = decoder.remaining_handles();
21880 if let Some((inlined, num_bytes, num_handles)) =
21881 fidl::encoding::decode_envelope_header(decoder, next_offset)?
21882 {
21883 let member_inline_size =
21884 <StreamBufferConstraints as fidl::encoding::TypeMarker>::inline_size(
21885 decoder.context,
21886 );
21887 if inlined != (member_inline_size <= 4) {
21888 return Err(fidl::Error::InvalidInlineBitInEnvelope);
21889 }
21890 let inner_offset;
21891 let mut inner_depth = depth.clone();
21892 if inlined {
21893 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
21894 inner_offset = next_offset;
21895 } else {
21896 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
21897 inner_depth.increment()?;
21898 }
21899 let val_ref = self
21900 .buffer_constraints
21901 .get_or_insert_with(|| fidl::new_empty!(StreamBufferConstraints, D));
21902 fidl::decode!(
21903 StreamBufferConstraints,
21904 D,
21905 val_ref,
21906 decoder,
21907 inner_offset,
21908 inner_depth
21909 )?;
21910 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
21911 {
21912 return Err(fidl::Error::InvalidNumBytesInEnvelope);
21913 }
21914 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
21915 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
21916 }
21917 }
21918
21919 next_offset += envelope_size;
21920
21921 while next_offset < end_offset {
21923 _next_ordinal_to_read += 1;
21924 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
21925 next_offset += envelope_size;
21926 }
21927
21928 Ok(())
21929 }
21930 }
21931
21932 impl StreamOutputFormat {
21933 #[inline(always)]
21934 fn max_ordinal_present(&self) -> u64 {
21935 if let Some(_) = self.format_details {
21936 return 2;
21937 }
21938 if let Some(_) = self.stream_lifetime_ordinal {
21939 return 1;
21940 }
21941 0
21942 }
21943 }
21944
21945 impl fidl::encoding::ValueTypeMarker for StreamOutputFormat {
21946 type Borrowed<'a> = &'a Self;
21947 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
21948 value
21949 }
21950 }
21951
21952 unsafe impl fidl::encoding::TypeMarker for StreamOutputFormat {
21953 type Owned = Self;
21954
21955 #[inline(always)]
21956 fn inline_align(_context: fidl::encoding::Context) -> usize {
21957 8
21958 }
21959
21960 #[inline(always)]
21961 fn inline_size(_context: fidl::encoding::Context) -> usize {
21962 16
21963 }
21964 }
21965
21966 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<StreamOutputFormat, D>
21967 for &StreamOutputFormat
21968 {
21969 unsafe fn encode(
21970 self,
21971 encoder: &mut fidl::encoding::Encoder<'_, D>,
21972 offset: usize,
21973 mut depth: fidl::encoding::Depth,
21974 ) -> fidl::Result<()> {
21975 encoder.debug_check_bounds::<StreamOutputFormat>(offset);
21976 let max_ordinal: u64 = self.max_ordinal_present();
21978 encoder.write_num(max_ordinal, offset);
21979 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
21980 if max_ordinal == 0 {
21982 return Ok(());
21983 }
21984 depth.increment()?;
21985 let envelope_size = 8;
21986 let bytes_len = max_ordinal as usize * envelope_size;
21987 #[allow(unused_variables)]
21988 let offset = encoder.out_of_line_offset(bytes_len);
21989 let mut _prev_end_offset: usize = 0;
21990 if 1 > max_ordinal {
21991 return Ok(());
21992 }
21993
21994 let cur_offset: usize = (1 - 1) * envelope_size;
21997
21998 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
22000
22001 fidl::encoding::encode_in_envelope_optional::<u64, D>(
22006 self.stream_lifetime_ordinal
22007 .as_ref()
22008 .map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
22009 encoder,
22010 offset + cur_offset,
22011 depth,
22012 )?;
22013
22014 _prev_end_offset = cur_offset + envelope_size;
22015 if 2 > max_ordinal {
22016 return Ok(());
22017 }
22018
22019 let cur_offset: usize = (2 - 1) * envelope_size;
22022
22023 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
22025
22026 fidl::encoding::encode_in_envelope_optional::<FormatDetails, D>(
22031 self.format_details
22032 .as_ref()
22033 .map(<FormatDetails as fidl::encoding::ValueTypeMarker>::borrow),
22034 encoder,
22035 offset + cur_offset,
22036 depth,
22037 )?;
22038
22039 _prev_end_offset = cur_offset + envelope_size;
22040
22041 Ok(())
22042 }
22043 }
22044
22045 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for StreamOutputFormat {
22046 #[inline(always)]
22047 fn new_empty() -> Self {
22048 Self::default()
22049 }
22050
22051 unsafe fn decode(
22052 &mut self,
22053 decoder: &mut fidl::encoding::Decoder<'_, D>,
22054 offset: usize,
22055 mut depth: fidl::encoding::Depth,
22056 ) -> fidl::Result<()> {
22057 decoder.debug_check_bounds::<Self>(offset);
22058 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
22059 None => return Err(fidl::Error::NotNullable),
22060 Some(len) => len,
22061 };
22062 if len == 0 {
22064 return Ok(());
22065 };
22066 depth.increment()?;
22067 let envelope_size = 8;
22068 let bytes_len = len * envelope_size;
22069 let offset = decoder.out_of_line_offset(bytes_len)?;
22070 let mut _next_ordinal_to_read = 0;
22072 let mut next_offset = offset;
22073 let end_offset = offset + bytes_len;
22074 _next_ordinal_to_read += 1;
22075 if next_offset >= end_offset {
22076 return Ok(());
22077 }
22078
22079 while _next_ordinal_to_read < 1 {
22081 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
22082 _next_ordinal_to_read += 1;
22083 next_offset += envelope_size;
22084 }
22085
22086 let next_out_of_line = decoder.next_out_of_line();
22087 let handles_before = decoder.remaining_handles();
22088 if let Some((inlined, num_bytes, num_handles)) =
22089 fidl::encoding::decode_envelope_header(decoder, next_offset)?
22090 {
22091 let member_inline_size =
22092 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
22093 if inlined != (member_inline_size <= 4) {
22094 return Err(fidl::Error::InvalidInlineBitInEnvelope);
22095 }
22096 let inner_offset;
22097 let mut inner_depth = depth.clone();
22098 if inlined {
22099 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
22100 inner_offset = next_offset;
22101 } else {
22102 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
22103 inner_depth.increment()?;
22104 }
22105 let val_ref =
22106 self.stream_lifetime_ordinal.get_or_insert_with(|| fidl::new_empty!(u64, D));
22107 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
22108 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
22109 {
22110 return Err(fidl::Error::InvalidNumBytesInEnvelope);
22111 }
22112 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
22113 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
22114 }
22115 }
22116
22117 next_offset += envelope_size;
22118 _next_ordinal_to_read += 1;
22119 if next_offset >= end_offset {
22120 return Ok(());
22121 }
22122
22123 while _next_ordinal_to_read < 2 {
22125 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
22126 _next_ordinal_to_read += 1;
22127 next_offset += envelope_size;
22128 }
22129
22130 let next_out_of_line = decoder.next_out_of_line();
22131 let handles_before = decoder.remaining_handles();
22132 if let Some((inlined, num_bytes, num_handles)) =
22133 fidl::encoding::decode_envelope_header(decoder, next_offset)?
22134 {
22135 let member_inline_size =
22136 <FormatDetails as fidl::encoding::TypeMarker>::inline_size(decoder.context);
22137 if inlined != (member_inline_size <= 4) {
22138 return Err(fidl::Error::InvalidInlineBitInEnvelope);
22139 }
22140 let inner_offset;
22141 let mut inner_depth = depth.clone();
22142 if inlined {
22143 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
22144 inner_offset = next_offset;
22145 } else {
22146 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
22147 inner_depth.increment()?;
22148 }
22149 let val_ref =
22150 self.format_details.get_or_insert_with(|| fidl::new_empty!(FormatDetails, D));
22151 fidl::decode!(FormatDetails, D, val_ref, decoder, inner_offset, inner_depth)?;
22152 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
22153 {
22154 return Err(fidl::Error::InvalidNumBytesInEnvelope);
22155 }
22156 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
22157 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
22158 }
22159 }
22160
22161 next_offset += envelope_size;
22162
22163 while next_offset < end_offset {
22165 _next_ordinal_to_read += 1;
22166 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
22167 next_offset += envelope_size;
22168 }
22169
22170 Ok(())
22171 }
22172 }
22173
22174 impl UsageStateDucked {
22175 #[inline(always)]
22176 fn max_ordinal_present(&self) -> u64 {
22177 0
22178 }
22179 }
22180
22181 impl fidl::encoding::ValueTypeMarker for UsageStateDucked {
22182 type Borrowed<'a> = &'a Self;
22183 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
22184 value
22185 }
22186 }
22187
22188 unsafe impl fidl::encoding::TypeMarker for UsageStateDucked {
22189 type Owned = Self;
22190
22191 #[inline(always)]
22192 fn inline_align(_context: fidl::encoding::Context) -> usize {
22193 8
22194 }
22195
22196 #[inline(always)]
22197 fn inline_size(_context: fidl::encoding::Context) -> usize {
22198 16
22199 }
22200 }
22201
22202 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<UsageStateDucked, D>
22203 for &UsageStateDucked
22204 {
22205 unsafe fn encode(
22206 self,
22207 encoder: &mut fidl::encoding::Encoder<'_, D>,
22208 offset: usize,
22209 mut depth: fidl::encoding::Depth,
22210 ) -> fidl::Result<()> {
22211 encoder.debug_check_bounds::<UsageStateDucked>(offset);
22212 let max_ordinal: u64 = self.max_ordinal_present();
22214 encoder.write_num(max_ordinal, offset);
22215 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
22216 if max_ordinal == 0 {
22218 return Ok(());
22219 }
22220 depth.increment()?;
22221 let envelope_size = 8;
22222 let bytes_len = max_ordinal as usize * envelope_size;
22223 #[allow(unused_variables)]
22224 let offset = encoder.out_of_line_offset(bytes_len);
22225 let mut _prev_end_offset: usize = 0;
22226
22227 Ok(())
22228 }
22229 }
22230
22231 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for UsageStateDucked {
22232 #[inline(always)]
22233 fn new_empty() -> Self {
22234 Self::default()
22235 }
22236
22237 unsafe fn decode(
22238 &mut self,
22239 decoder: &mut fidl::encoding::Decoder<'_, D>,
22240 offset: usize,
22241 mut depth: fidl::encoding::Depth,
22242 ) -> fidl::Result<()> {
22243 decoder.debug_check_bounds::<Self>(offset);
22244 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
22245 None => return Err(fidl::Error::NotNullable),
22246 Some(len) => len,
22247 };
22248 if len == 0 {
22250 return Ok(());
22251 };
22252 depth.increment()?;
22253 let envelope_size = 8;
22254 let bytes_len = len * envelope_size;
22255 let offset = decoder.out_of_line_offset(bytes_len)?;
22256 let mut _next_ordinal_to_read = 0;
22258 let mut next_offset = offset;
22259 let end_offset = offset + bytes_len;
22260
22261 while next_offset < end_offset {
22263 _next_ordinal_to_read += 1;
22264 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
22265 next_offset += envelope_size;
22266 }
22267
22268 Ok(())
22269 }
22270 }
22271
22272 impl UsageStateMuted {
22273 #[inline(always)]
22274 fn max_ordinal_present(&self) -> u64 {
22275 0
22276 }
22277 }
22278
22279 impl fidl::encoding::ValueTypeMarker for UsageStateMuted {
22280 type Borrowed<'a> = &'a Self;
22281 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
22282 value
22283 }
22284 }
22285
22286 unsafe impl fidl::encoding::TypeMarker for UsageStateMuted {
22287 type Owned = Self;
22288
22289 #[inline(always)]
22290 fn inline_align(_context: fidl::encoding::Context) -> usize {
22291 8
22292 }
22293
22294 #[inline(always)]
22295 fn inline_size(_context: fidl::encoding::Context) -> usize {
22296 16
22297 }
22298 }
22299
22300 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<UsageStateMuted, D>
22301 for &UsageStateMuted
22302 {
22303 unsafe fn encode(
22304 self,
22305 encoder: &mut fidl::encoding::Encoder<'_, D>,
22306 offset: usize,
22307 mut depth: fidl::encoding::Depth,
22308 ) -> fidl::Result<()> {
22309 encoder.debug_check_bounds::<UsageStateMuted>(offset);
22310 let max_ordinal: u64 = self.max_ordinal_present();
22312 encoder.write_num(max_ordinal, offset);
22313 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
22314 if max_ordinal == 0 {
22316 return Ok(());
22317 }
22318 depth.increment()?;
22319 let envelope_size = 8;
22320 let bytes_len = max_ordinal as usize * envelope_size;
22321 #[allow(unused_variables)]
22322 let offset = encoder.out_of_line_offset(bytes_len);
22323 let mut _prev_end_offset: usize = 0;
22324
22325 Ok(())
22326 }
22327 }
22328
22329 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for UsageStateMuted {
22330 #[inline(always)]
22331 fn new_empty() -> Self {
22332 Self::default()
22333 }
22334
22335 unsafe fn decode(
22336 &mut self,
22337 decoder: &mut fidl::encoding::Decoder<'_, D>,
22338 offset: usize,
22339 mut depth: fidl::encoding::Depth,
22340 ) -> fidl::Result<()> {
22341 decoder.debug_check_bounds::<Self>(offset);
22342 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
22343 None => return Err(fidl::Error::NotNullable),
22344 Some(len) => len,
22345 };
22346 if len == 0 {
22348 return Ok(());
22349 };
22350 depth.increment()?;
22351 let envelope_size = 8;
22352 let bytes_len = len * envelope_size;
22353 let offset = decoder.out_of_line_offset(bytes_len)?;
22354 let mut _next_ordinal_to_read = 0;
22356 let mut next_offset = offset;
22357 let end_offset = offset + bytes_len;
22358
22359 while next_offset < end_offset {
22361 _next_ordinal_to_read += 1;
22362 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
22363 next_offset += envelope_size;
22364 }
22365
22366 Ok(())
22367 }
22368 }
22369
22370 impl UsageStateUnadjusted {
22371 #[inline(always)]
22372 fn max_ordinal_present(&self) -> u64 {
22373 0
22374 }
22375 }
22376
22377 impl fidl::encoding::ValueTypeMarker for UsageStateUnadjusted {
22378 type Borrowed<'a> = &'a Self;
22379 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
22380 value
22381 }
22382 }
22383
22384 unsafe impl fidl::encoding::TypeMarker for UsageStateUnadjusted {
22385 type Owned = Self;
22386
22387 #[inline(always)]
22388 fn inline_align(_context: fidl::encoding::Context) -> usize {
22389 8
22390 }
22391
22392 #[inline(always)]
22393 fn inline_size(_context: fidl::encoding::Context) -> usize {
22394 16
22395 }
22396 }
22397
22398 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<UsageStateUnadjusted, D>
22399 for &UsageStateUnadjusted
22400 {
22401 unsafe fn encode(
22402 self,
22403 encoder: &mut fidl::encoding::Encoder<'_, D>,
22404 offset: usize,
22405 mut depth: fidl::encoding::Depth,
22406 ) -> fidl::Result<()> {
22407 encoder.debug_check_bounds::<UsageStateUnadjusted>(offset);
22408 let max_ordinal: u64 = self.max_ordinal_present();
22410 encoder.write_num(max_ordinal, offset);
22411 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
22412 if max_ordinal == 0 {
22414 return Ok(());
22415 }
22416 depth.increment()?;
22417 let envelope_size = 8;
22418 let bytes_len = max_ordinal as usize * envelope_size;
22419 #[allow(unused_variables)]
22420 let offset = encoder.out_of_line_offset(bytes_len);
22421 let mut _prev_end_offset: usize = 0;
22422
22423 Ok(())
22424 }
22425 }
22426
22427 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for UsageStateUnadjusted {
22428 #[inline(always)]
22429 fn new_empty() -> Self {
22430 Self::default()
22431 }
22432
22433 unsafe fn decode(
22434 &mut self,
22435 decoder: &mut fidl::encoding::Decoder<'_, D>,
22436 offset: usize,
22437 mut depth: fidl::encoding::Depth,
22438 ) -> fidl::Result<()> {
22439 decoder.debug_check_bounds::<Self>(offset);
22440 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
22441 None => return Err(fidl::Error::NotNullable),
22442 Some(len) => len,
22443 };
22444 if len == 0 {
22446 return Ok(());
22447 };
22448 depth.increment()?;
22449 let envelope_size = 8;
22450 let bytes_len = len * envelope_size;
22451 let offset = decoder.out_of_line_offset(bytes_len)?;
22452 let mut _next_ordinal_to_read = 0;
22454 let mut next_offset = offset;
22455 let end_offset = offset + bytes_len;
22456
22457 while next_offset < end_offset {
22459 _next_ordinal_to_read += 1;
22460 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
22461 next_offset += envelope_size;
22462 }
22463
22464 Ok(())
22465 }
22466 }
22467
22468 impl fidl::encoding::ValueTypeMarker for AacBitRate {
22469 type Borrowed<'a> = &'a Self;
22470 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
22471 value
22472 }
22473 }
22474
22475 unsafe impl fidl::encoding::TypeMarker for AacBitRate {
22476 type Owned = Self;
22477
22478 #[inline(always)]
22479 fn inline_align(_context: fidl::encoding::Context) -> usize {
22480 8
22481 }
22482
22483 #[inline(always)]
22484 fn inline_size(_context: fidl::encoding::Context) -> usize {
22485 16
22486 }
22487 }
22488
22489 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AacBitRate, D>
22490 for &AacBitRate
22491 {
22492 #[inline]
22493 unsafe fn encode(
22494 self,
22495 encoder: &mut fidl::encoding::Encoder<'_, D>,
22496 offset: usize,
22497 _depth: fidl::encoding::Depth,
22498 ) -> fidl::Result<()> {
22499 encoder.debug_check_bounds::<AacBitRate>(offset);
22500 encoder.write_num::<u64>(self.ordinal(), offset);
22501 match self {
22502 AacBitRate::Constant(ref val) => {
22503 fidl::encoding::encode_in_envelope::<AacConstantBitRate, D>(
22504 <AacConstantBitRate as fidl::encoding::ValueTypeMarker>::borrow(val),
22505 encoder,
22506 offset + 8,
22507 _depth,
22508 )
22509 }
22510 AacBitRate::Variable(ref val) => {
22511 fidl::encoding::encode_in_envelope::<AacVariableBitRate, D>(
22512 <AacVariableBitRate as fidl::encoding::ValueTypeMarker>::borrow(val),
22513 encoder,
22514 offset + 8,
22515 _depth,
22516 )
22517 }
22518 }
22519 }
22520 }
22521
22522 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AacBitRate {
22523 #[inline(always)]
22524 fn new_empty() -> Self {
22525 Self::Constant(fidl::new_empty!(AacConstantBitRate, D))
22526 }
22527
22528 #[inline]
22529 unsafe fn decode(
22530 &mut self,
22531 decoder: &mut fidl::encoding::Decoder<'_, D>,
22532 offset: usize,
22533 mut depth: fidl::encoding::Depth,
22534 ) -> fidl::Result<()> {
22535 decoder.debug_check_bounds::<Self>(offset);
22536 #[allow(unused_variables)]
22537 let next_out_of_line = decoder.next_out_of_line();
22538 let handles_before = decoder.remaining_handles();
22539 let (ordinal, inlined, num_bytes, num_handles) =
22540 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
22541
22542 let member_inline_size = match ordinal {
22543 1 => {
22544 <AacConstantBitRate as fidl::encoding::TypeMarker>::inline_size(decoder.context)
22545 }
22546 2 => {
22547 <AacVariableBitRate as fidl::encoding::TypeMarker>::inline_size(decoder.context)
22548 }
22549 _ => return Err(fidl::Error::UnknownUnionTag),
22550 };
22551
22552 if inlined != (member_inline_size <= 4) {
22553 return Err(fidl::Error::InvalidInlineBitInEnvelope);
22554 }
22555 let _inner_offset;
22556 if inlined {
22557 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
22558 _inner_offset = offset + 8;
22559 } else {
22560 depth.increment()?;
22561 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
22562 }
22563 match ordinal {
22564 1 => {
22565 #[allow(irrefutable_let_patterns)]
22566 if let AacBitRate::Constant(_) = self {
22567 } else {
22569 *self = AacBitRate::Constant(fidl::new_empty!(AacConstantBitRate, D));
22571 }
22572 #[allow(irrefutable_let_patterns)]
22573 if let AacBitRate::Constant(ref mut val) = self {
22574 fidl::decode!(AacConstantBitRate, D, val, decoder, _inner_offset, depth)?;
22575 } else {
22576 unreachable!()
22577 }
22578 }
22579 2 => {
22580 #[allow(irrefutable_let_patterns)]
22581 if let AacBitRate::Variable(_) = self {
22582 } else {
22584 *self = AacBitRate::Variable(fidl::new_empty!(AacVariableBitRate, D));
22586 }
22587 #[allow(irrefutable_let_patterns)]
22588 if let AacBitRate::Variable(ref mut val) = self {
22589 fidl::decode!(AacVariableBitRate, D, val, decoder, _inner_offset, depth)?;
22590 } else {
22591 unreachable!()
22592 }
22593 }
22594 ordinal => panic!("unexpected ordinal {:?}", ordinal),
22595 }
22596 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
22597 return Err(fidl::Error::InvalidNumBytesInEnvelope);
22598 }
22599 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
22600 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
22601 }
22602 Ok(())
22603 }
22604 }
22605
22606 impl fidl::encoding::ValueTypeMarker for AacTransport {
22607 type Borrowed<'a> = &'a Self;
22608 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
22609 value
22610 }
22611 }
22612
22613 unsafe impl fidl::encoding::TypeMarker for AacTransport {
22614 type Owned = Self;
22615
22616 #[inline(always)]
22617 fn inline_align(_context: fidl::encoding::Context) -> usize {
22618 8
22619 }
22620
22621 #[inline(always)]
22622 fn inline_size(_context: fidl::encoding::Context) -> usize {
22623 16
22624 }
22625 }
22626
22627 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AacTransport, D>
22628 for &AacTransport
22629 {
22630 #[inline]
22631 unsafe fn encode(
22632 self,
22633 encoder: &mut fidl::encoding::Encoder<'_, D>,
22634 offset: usize,
22635 _depth: fidl::encoding::Depth,
22636 ) -> fidl::Result<()> {
22637 encoder.debug_check_bounds::<AacTransport>(offset);
22638 encoder.write_num::<u64>(self.ordinal(), offset);
22639 match self {
22640 AacTransport::Raw(ref val) => {
22641 fidl::encoding::encode_in_envelope::<AacTransportRaw, D>(
22642 <AacTransportRaw as fidl::encoding::ValueTypeMarker>::borrow(val),
22643 encoder,
22644 offset + 8,
22645 _depth,
22646 )
22647 }
22648 AacTransport::Latm(ref val) => {
22649 fidl::encoding::encode_in_envelope::<AacTransportLatm, D>(
22650 <AacTransportLatm as fidl::encoding::ValueTypeMarker>::borrow(val),
22651 encoder,
22652 offset + 8,
22653 _depth,
22654 )
22655 }
22656 AacTransport::Adts(ref val) => {
22657 fidl::encoding::encode_in_envelope::<AacTransportAdts, D>(
22658 <AacTransportAdts as fidl::encoding::ValueTypeMarker>::borrow(val),
22659 encoder,
22660 offset + 8,
22661 _depth,
22662 )
22663 }
22664 AacTransport::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
22665 }
22666 }
22667 }
22668
22669 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AacTransport {
22670 #[inline(always)]
22671 fn new_empty() -> Self {
22672 Self::__SourceBreaking { unknown_ordinal: 0 }
22673 }
22674
22675 #[inline]
22676 unsafe fn decode(
22677 &mut self,
22678 decoder: &mut fidl::encoding::Decoder<'_, D>,
22679 offset: usize,
22680 mut depth: fidl::encoding::Depth,
22681 ) -> fidl::Result<()> {
22682 decoder.debug_check_bounds::<Self>(offset);
22683 #[allow(unused_variables)]
22684 let next_out_of_line = decoder.next_out_of_line();
22685 let handles_before = decoder.remaining_handles();
22686 let (ordinal, inlined, num_bytes, num_handles) =
22687 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
22688
22689 let member_inline_size = match ordinal {
22690 1 => <AacTransportRaw as fidl::encoding::TypeMarker>::inline_size(decoder.context),
22691 2 => <AacTransportLatm as fidl::encoding::TypeMarker>::inline_size(decoder.context),
22692 3 => <AacTransportAdts as fidl::encoding::TypeMarker>::inline_size(decoder.context),
22693 0 => return Err(fidl::Error::UnknownUnionTag),
22694 _ => num_bytes as usize,
22695 };
22696
22697 if inlined != (member_inline_size <= 4) {
22698 return Err(fidl::Error::InvalidInlineBitInEnvelope);
22699 }
22700 let _inner_offset;
22701 if inlined {
22702 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
22703 _inner_offset = offset + 8;
22704 } else {
22705 depth.increment()?;
22706 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
22707 }
22708 match ordinal {
22709 1 => {
22710 #[allow(irrefutable_let_patterns)]
22711 if let AacTransport::Raw(_) = self {
22712 } else {
22714 *self = AacTransport::Raw(fidl::new_empty!(AacTransportRaw, D));
22716 }
22717 #[allow(irrefutable_let_patterns)]
22718 if let AacTransport::Raw(ref mut val) = self {
22719 fidl::decode!(AacTransportRaw, D, val, decoder, _inner_offset, depth)?;
22720 } else {
22721 unreachable!()
22722 }
22723 }
22724 2 => {
22725 #[allow(irrefutable_let_patterns)]
22726 if let AacTransport::Latm(_) = self {
22727 } else {
22729 *self = AacTransport::Latm(fidl::new_empty!(AacTransportLatm, D));
22731 }
22732 #[allow(irrefutable_let_patterns)]
22733 if let AacTransport::Latm(ref mut val) = self {
22734 fidl::decode!(AacTransportLatm, D, val, decoder, _inner_offset, depth)?;
22735 } else {
22736 unreachable!()
22737 }
22738 }
22739 3 => {
22740 #[allow(irrefutable_let_patterns)]
22741 if let AacTransport::Adts(_) = self {
22742 } else {
22744 *self = AacTransport::Adts(fidl::new_empty!(AacTransportAdts, D));
22746 }
22747 #[allow(irrefutable_let_patterns)]
22748 if let AacTransport::Adts(ref mut val) = self {
22749 fidl::decode!(AacTransportAdts, D, val, decoder, _inner_offset, depth)?;
22750 } else {
22751 unreachable!()
22752 }
22753 }
22754 #[allow(deprecated)]
22755 ordinal => {
22756 for _ in 0..num_handles {
22757 decoder.drop_next_handle()?;
22758 }
22759 *self = AacTransport::__SourceBreaking { unknown_ordinal: ordinal };
22760 }
22761 }
22762 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
22763 return Err(fidl::Error::InvalidNumBytesInEnvelope);
22764 }
22765 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
22766 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
22767 }
22768 Ok(())
22769 }
22770 }
22771
22772 impl fidl::encoding::ValueTypeMarker for AudioCapturerConfiguration {
22773 type Borrowed<'a> = &'a Self;
22774 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
22775 value
22776 }
22777 }
22778
22779 unsafe impl fidl::encoding::TypeMarker for AudioCapturerConfiguration {
22780 type Owned = Self;
22781
22782 #[inline(always)]
22783 fn inline_align(_context: fidl::encoding::Context) -> usize {
22784 8
22785 }
22786
22787 #[inline(always)]
22788 fn inline_size(_context: fidl::encoding::Context) -> usize {
22789 16
22790 }
22791 }
22792
22793 unsafe impl<D: fidl::encoding::ResourceDialect>
22794 fidl::encoding::Encode<AudioCapturerConfiguration, D> for &AudioCapturerConfiguration
22795 {
22796 #[inline]
22797 unsafe fn encode(
22798 self,
22799 encoder: &mut fidl::encoding::Encoder<'_, D>,
22800 offset: usize,
22801 _depth: fidl::encoding::Depth,
22802 ) -> fidl::Result<()> {
22803 encoder.debug_check_bounds::<AudioCapturerConfiguration>(offset);
22804 encoder.write_num::<u64>(self.ordinal(), offset);
22805 match self {
22806 AudioCapturerConfiguration::Loopback(ref val) => fidl::encoding::encode_in_envelope::<
22807 LoopbackAudioCapturerConfiguration,
22808 D,
22809 >(
22810 <LoopbackAudioCapturerConfiguration as fidl::encoding::ValueTypeMarker>::borrow(
22811 val,
22812 ),
22813 encoder,
22814 offset + 8,
22815 _depth,
22816 ),
22817 AudioCapturerConfiguration::Input(ref val) => fidl::encoding::encode_in_envelope::<
22818 InputAudioCapturerConfiguration,
22819 D,
22820 >(
22821 <InputAudioCapturerConfiguration as fidl::encoding::ValueTypeMarker>::borrow(
22822 val,
22823 ),
22824 encoder,
22825 offset + 8,
22826 _depth,
22827 ),
22828 }
22829 }
22830 }
22831
22832 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
22833 for AudioCapturerConfiguration
22834 {
22835 #[inline(always)]
22836 fn new_empty() -> Self {
22837 Self::Loopback(fidl::new_empty!(LoopbackAudioCapturerConfiguration, D))
22838 }
22839
22840 #[inline]
22841 unsafe fn decode(
22842 &mut self,
22843 decoder: &mut fidl::encoding::Decoder<'_, D>,
22844 offset: usize,
22845 mut depth: fidl::encoding::Depth,
22846 ) -> fidl::Result<()> {
22847 decoder.debug_check_bounds::<Self>(offset);
22848 #[allow(unused_variables)]
22849 let next_out_of_line = decoder.next_out_of_line();
22850 let handles_before = decoder.remaining_handles();
22851 let (ordinal, inlined, num_bytes, num_handles) =
22852 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
22853
22854 let member_inline_size = match ordinal {
22855 1 => {
22856 <LoopbackAudioCapturerConfiguration as fidl::encoding::TypeMarker>::inline_size(
22857 decoder.context,
22858 )
22859 }
22860 2 => <InputAudioCapturerConfiguration as fidl::encoding::TypeMarker>::inline_size(
22861 decoder.context,
22862 ),
22863 _ => return Err(fidl::Error::UnknownUnionTag),
22864 };
22865
22866 if inlined != (member_inline_size <= 4) {
22867 return Err(fidl::Error::InvalidInlineBitInEnvelope);
22868 }
22869 let _inner_offset;
22870 if inlined {
22871 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
22872 _inner_offset = offset + 8;
22873 } else {
22874 depth.increment()?;
22875 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
22876 }
22877 match ordinal {
22878 1 => {
22879 #[allow(irrefutable_let_patterns)]
22880 if let AudioCapturerConfiguration::Loopback(_) = self {
22881 } else {
22883 *self = AudioCapturerConfiguration::Loopback(fidl::new_empty!(
22885 LoopbackAudioCapturerConfiguration,
22886 D
22887 ));
22888 }
22889 #[allow(irrefutable_let_patterns)]
22890 if let AudioCapturerConfiguration::Loopback(ref mut val) = self {
22891 fidl::decode!(
22892 LoopbackAudioCapturerConfiguration,
22893 D,
22894 val,
22895 decoder,
22896 _inner_offset,
22897 depth
22898 )?;
22899 } else {
22900 unreachable!()
22901 }
22902 }
22903 2 => {
22904 #[allow(irrefutable_let_patterns)]
22905 if let AudioCapturerConfiguration::Input(_) = self {
22906 } else {
22908 *self = AudioCapturerConfiguration::Input(fidl::new_empty!(
22910 InputAudioCapturerConfiguration,
22911 D
22912 ));
22913 }
22914 #[allow(irrefutable_let_patterns)]
22915 if let AudioCapturerConfiguration::Input(ref mut val) = self {
22916 fidl::decode!(
22917 InputAudioCapturerConfiguration,
22918 D,
22919 val,
22920 decoder,
22921 _inner_offset,
22922 depth
22923 )?;
22924 } else {
22925 unreachable!()
22926 }
22927 }
22928 ordinal => panic!("unexpected ordinal {:?}", ordinal),
22929 }
22930 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
22931 return Err(fidl::Error::InvalidNumBytesInEnvelope);
22932 }
22933 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
22934 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
22935 }
22936 Ok(())
22937 }
22938 }
22939
22940 impl fidl::encoding::ValueTypeMarker for AudioCompressedFormat {
22941 type Borrowed<'a> = &'a Self;
22942 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
22943 value
22944 }
22945 }
22946
22947 unsafe impl fidl::encoding::TypeMarker for AudioCompressedFormat {
22948 type Owned = Self;
22949
22950 #[inline(always)]
22951 fn inline_align(_context: fidl::encoding::Context) -> usize {
22952 8
22953 }
22954
22955 #[inline(always)]
22956 fn inline_size(_context: fidl::encoding::Context) -> usize {
22957 16
22958 }
22959 }
22960
22961 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AudioCompressedFormat, D>
22962 for &AudioCompressedFormat
22963 {
22964 #[inline]
22965 unsafe fn encode(
22966 self,
22967 encoder: &mut fidl::encoding::Encoder<'_, D>,
22968 offset: usize,
22969 _depth: fidl::encoding::Depth,
22970 ) -> fidl::Result<()> {
22971 encoder.debug_check_bounds::<AudioCompressedFormat>(offset);
22972 encoder.write_num::<u64>(self.ordinal(), offset);
22973 match self {
22974 AudioCompressedFormat::Aac(ref val) => {
22975 fidl::encoding::encode_in_envelope::<AudioCompressedFormatAac, D>(
22976 <AudioCompressedFormatAac as fidl::encoding::ValueTypeMarker>::borrow(val),
22977 encoder,
22978 offset + 8,
22979 _depth,
22980 )
22981 }
22982 AudioCompressedFormat::Sbc(ref val) => {
22983 fidl::encoding::encode_in_envelope::<AudioCompressedFormatSbc, D>(
22984 <AudioCompressedFormatSbc as fidl::encoding::ValueTypeMarker>::borrow(val),
22985 encoder,
22986 offset + 8,
22987 _depth,
22988 )
22989 }
22990 AudioCompressedFormat::Cvsd(ref val) => {
22991 fidl::encoding::encode_in_envelope::<AudioCompressedFormatCvsd, D>(
22992 <AudioCompressedFormatCvsd as fidl::encoding::ValueTypeMarker>::borrow(val),
22993 encoder,
22994 offset + 8,
22995 _depth,
22996 )
22997 }
22998 AudioCompressedFormat::Lc3(ref val) => {
22999 fidl::encoding::encode_in_envelope::<AudioCompressedFormatLc3, D>(
23000 <AudioCompressedFormatLc3 as fidl::encoding::ValueTypeMarker>::borrow(val),
23001 encoder,
23002 offset + 8,
23003 _depth,
23004 )
23005 }
23006 AudioCompressedFormat::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
23007 }
23008 }
23009 }
23010
23011 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AudioCompressedFormat {
23012 #[inline(always)]
23013 fn new_empty() -> Self {
23014 Self::__SourceBreaking { unknown_ordinal: 0 }
23015 }
23016
23017 #[inline]
23018 unsafe fn decode(
23019 &mut self,
23020 decoder: &mut fidl::encoding::Decoder<'_, D>,
23021 offset: usize,
23022 mut depth: fidl::encoding::Depth,
23023 ) -> fidl::Result<()> {
23024 decoder.debug_check_bounds::<Self>(offset);
23025 #[allow(unused_variables)]
23026 let next_out_of_line = decoder.next_out_of_line();
23027 let handles_before = decoder.remaining_handles();
23028 let (ordinal, inlined, num_bytes, num_handles) =
23029 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
23030
23031 let member_inline_size = match ordinal {
23032 1 => <AudioCompressedFormatAac as fidl::encoding::TypeMarker>::inline_size(
23033 decoder.context,
23034 ),
23035 2 => <AudioCompressedFormatSbc as fidl::encoding::TypeMarker>::inline_size(
23036 decoder.context,
23037 ),
23038 3 => <AudioCompressedFormatCvsd as fidl::encoding::TypeMarker>::inline_size(
23039 decoder.context,
23040 ),
23041 4 => <AudioCompressedFormatLc3 as fidl::encoding::TypeMarker>::inline_size(
23042 decoder.context,
23043 ),
23044 0 => return Err(fidl::Error::UnknownUnionTag),
23045 _ => num_bytes as usize,
23046 };
23047
23048 if inlined != (member_inline_size <= 4) {
23049 return Err(fidl::Error::InvalidInlineBitInEnvelope);
23050 }
23051 let _inner_offset;
23052 if inlined {
23053 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
23054 _inner_offset = offset + 8;
23055 } else {
23056 depth.increment()?;
23057 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
23058 }
23059 match ordinal {
23060 1 => {
23061 #[allow(irrefutable_let_patterns)]
23062 if let AudioCompressedFormat::Aac(_) = self {
23063 } else {
23065 *self = AudioCompressedFormat::Aac(fidl::new_empty!(
23067 AudioCompressedFormatAac,
23068 D
23069 ));
23070 }
23071 #[allow(irrefutable_let_patterns)]
23072 if let AudioCompressedFormat::Aac(ref mut val) = self {
23073 fidl::decode!(
23074 AudioCompressedFormatAac,
23075 D,
23076 val,
23077 decoder,
23078 _inner_offset,
23079 depth
23080 )?;
23081 } else {
23082 unreachable!()
23083 }
23084 }
23085 2 => {
23086 #[allow(irrefutable_let_patterns)]
23087 if let AudioCompressedFormat::Sbc(_) = self {
23088 } else {
23090 *self = AudioCompressedFormat::Sbc(fidl::new_empty!(
23092 AudioCompressedFormatSbc,
23093 D
23094 ));
23095 }
23096 #[allow(irrefutable_let_patterns)]
23097 if let AudioCompressedFormat::Sbc(ref mut val) = self {
23098 fidl::decode!(
23099 AudioCompressedFormatSbc,
23100 D,
23101 val,
23102 decoder,
23103 _inner_offset,
23104 depth
23105 )?;
23106 } else {
23107 unreachable!()
23108 }
23109 }
23110 3 => {
23111 #[allow(irrefutable_let_patterns)]
23112 if let AudioCompressedFormat::Cvsd(_) = self {
23113 } else {
23115 *self = AudioCompressedFormat::Cvsd(fidl::new_empty!(
23117 AudioCompressedFormatCvsd,
23118 D
23119 ));
23120 }
23121 #[allow(irrefutable_let_patterns)]
23122 if let AudioCompressedFormat::Cvsd(ref mut val) = self {
23123 fidl::decode!(
23124 AudioCompressedFormatCvsd,
23125 D,
23126 val,
23127 decoder,
23128 _inner_offset,
23129 depth
23130 )?;
23131 } else {
23132 unreachable!()
23133 }
23134 }
23135 4 => {
23136 #[allow(irrefutable_let_patterns)]
23137 if let AudioCompressedFormat::Lc3(_) = self {
23138 } else {
23140 *self = AudioCompressedFormat::Lc3(fidl::new_empty!(
23142 AudioCompressedFormatLc3,
23143 D
23144 ));
23145 }
23146 #[allow(irrefutable_let_patterns)]
23147 if let AudioCompressedFormat::Lc3(ref mut val) = self {
23148 fidl::decode!(
23149 AudioCompressedFormatLc3,
23150 D,
23151 val,
23152 decoder,
23153 _inner_offset,
23154 depth
23155 )?;
23156 } else {
23157 unreachable!()
23158 }
23159 }
23160 #[allow(deprecated)]
23161 ordinal => {
23162 for _ in 0..num_handles {
23163 decoder.drop_next_handle()?;
23164 }
23165 *self = AudioCompressedFormat::__SourceBreaking { unknown_ordinal: ordinal };
23166 }
23167 }
23168 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
23169 return Err(fidl::Error::InvalidNumBytesInEnvelope);
23170 }
23171 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
23172 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
23173 }
23174 Ok(())
23175 }
23176 }
23177
23178 impl fidl::encoding::ValueTypeMarker for AudioConsumerError {
23179 type Borrowed<'a> = &'a Self;
23180 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
23181 value
23182 }
23183 }
23184
23185 unsafe impl fidl::encoding::TypeMarker for AudioConsumerError {
23186 type Owned = Self;
23187
23188 #[inline(always)]
23189 fn inline_align(_context: fidl::encoding::Context) -> usize {
23190 8
23191 }
23192
23193 #[inline(always)]
23194 fn inline_size(_context: fidl::encoding::Context) -> usize {
23195 16
23196 }
23197 }
23198
23199 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AudioConsumerError, D>
23200 for &AudioConsumerError
23201 {
23202 #[inline]
23203 unsafe fn encode(
23204 self,
23205 encoder: &mut fidl::encoding::Encoder<'_, D>,
23206 offset: usize,
23207 _depth: fidl::encoding::Depth,
23208 ) -> fidl::Result<()> {
23209 encoder.debug_check_bounds::<AudioConsumerError>(offset);
23210 encoder.write_num::<u64>(self.ordinal(), offset);
23211 match self {
23212 AudioConsumerError::PlaceHolder(ref val) => {
23213 fidl::encoding::encode_in_envelope::<Void, D>(
23214 <Void as fidl::encoding::ValueTypeMarker>::borrow(val),
23215 encoder,
23216 offset + 8,
23217 _depth,
23218 )
23219 }
23220 }
23221 }
23222 }
23223
23224 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AudioConsumerError {
23225 #[inline(always)]
23226 fn new_empty() -> Self {
23227 Self::PlaceHolder(fidl::new_empty!(Void, D))
23228 }
23229
23230 #[inline]
23231 unsafe fn decode(
23232 &mut self,
23233 decoder: &mut fidl::encoding::Decoder<'_, D>,
23234 offset: usize,
23235 mut depth: fidl::encoding::Depth,
23236 ) -> fidl::Result<()> {
23237 decoder.debug_check_bounds::<Self>(offset);
23238 #[allow(unused_variables)]
23239 let next_out_of_line = decoder.next_out_of_line();
23240 let handles_before = decoder.remaining_handles();
23241 let (ordinal, inlined, num_bytes, num_handles) =
23242 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
23243
23244 let member_inline_size = match ordinal {
23245 1 => <Void as fidl::encoding::TypeMarker>::inline_size(decoder.context),
23246 _ => return Err(fidl::Error::UnknownUnionTag),
23247 };
23248
23249 if inlined != (member_inline_size <= 4) {
23250 return Err(fidl::Error::InvalidInlineBitInEnvelope);
23251 }
23252 let _inner_offset;
23253 if inlined {
23254 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
23255 _inner_offset = offset + 8;
23256 } else {
23257 depth.increment()?;
23258 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
23259 }
23260 match ordinal {
23261 1 => {
23262 #[allow(irrefutable_let_patterns)]
23263 if let AudioConsumerError::PlaceHolder(_) = self {
23264 } else {
23266 *self = AudioConsumerError::PlaceHolder(fidl::new_empty!(Void, D));
23268 }
23269 #[allow(irrefutable_let_patterns)]
23270 if let AudioConsumerError::PlaceHolder(ref mut val) = self {
23271 fidl::decode!(Void, D, val, decoder, _inner_offset, depth)?;
23272 } else {
23273 unreachable!()
23274 }
23275 }
23276 ordinal => panic!("unexpected ordinal {:?}", ordinal),
23277 }
23278 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
23279 return Err(fidl::Error::InvalidNumBytesInEnvelope);
23280 }
23281 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
23282 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
23283 }
23284 Ok(())
23285 }
23286 }
23287
23288 impl fidl::encoding::ValueTypeMarker for AudioFormat {
23289 type Borrowed<'a> = &'a Self;
23290 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
23291 value
23292 }
23293 }
23294
23295 unsafe impl fidl::encoding::TypeMarker for AudioFormat {
23296 type Owned = Self;
23297
23298 #[inline(always)]
23299 fn inline_align(_context: fidl::encoding::Context) -> usize {
23300 8
23301 }
23302
23303 #[inline(always)]
23304 fn inline_size(_context: fidl::encoding::Context) -> usize {
23305 16
23306 }
23307 }
23308
23309 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AudioFormat, D>
23310 for &AudioFormat
23311 {
23312 #[inline]
23313 unsafe fn encode(
23314 self,
23315 encoder: &mut fidl::encoding::Encoder<'_, D>,
23316 offset: usize,
23317 _depth: fidl::encoding::Depth,
23318 ) -> fidl::Result<()> {
23319 encoder.debug_check_bounds::<AudioFormat>(offset);
23320 encoder.write_num::<u64>(self.ordinal(), offset);
23321 match self {
23322 AudioFormat::Compressed(ref val) => {
23323 fidl::encoding::encode_in_envelope::<AudioCompressedFormat, D>(
23324 <AudioCompressedFormat as fidl::encoding::ValueTypeMarker>::borrow(val),
23325 encoder,
23326 offset + 8,
23327 _depth,
23328 )
23329 }
23330 AudioFormat::Uncompressed(ref val) => {
23331 fidl::encoding::encode_in_envelope::<AudioUncompressedFormat, D>(
23332 <AudioUncompressedFormat as fidl::encoding::ValueTypeMarker>::borrow(val),
23333 encoder,
23334 offset + 8,
23335 _depth,
23336 )
23337 }
23338 }
23339 }
23340 }
23341
23342 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AudioFormat {
23343 #[inline(always)]
23344 fn new_empty() -> Self {
23345 Self::Compressed(fidl::new_empty!(AudioCompressedFormat, D))
23346 }
23347
23348 #[inline]
23349 unsafe fn decode(
23350 &mut self,
23351 decoder: &mut fidl::encoding::Decoder<'_, D>,
23352 offset: usize,
23353 mut depth: fidl::encoding::Depth,
23354 ) -> fidl::Result<()> {
23355 decoder.debug_check_bounds::<Self>(offset);
23356 #[allow(unused_variables)]
23357 let next_out_of_line = decoder.next_out_of_line();
23358 let handles_before = decoder.remaining_handles();
23359 let (ordinal, inlined, num_bytes, num_handles) =
23360 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
23361
23362 let member_inline_size = match ordinal {
23363 1 => <AudioCompressedFormat as fidl::encoding::TypeMarker>::inline_size(
23364 decoder.context,
23365 ),
23366 2 => <AudioUncompressedFormat as fidl::encoding::TypeMarker>::inline_size(
23367 decoder.context,
23368 ),
23369 _ => return Err(fidl::Error::UnknownUnionTag),
23370 };
23371
23372 if inlined != (member_inline_size <= 4) {
23373 return Err(fidl::Error::InvalidInlineBitInEnvelope);
23374 }
23375 let _inner_offset;
23376 if inlined {
23377 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
23378 _inner_offset = offset + 8;
23379 } else {
23380 depth.increment()?;
23381 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
23382 }
23383 match ordinal {
23384 1 => {
23385 #[allow(irrefutable_let_patterns)]
23386 if let AudioFormat::Compressed(_) = self {
23387 } else {
23389 *self = AudioFormat::Compressed(fidl::new_empty!(AudioCompressedFormat, D));
23391 }
23392 #[allow(irrefutable_let_patterns)]
23393 if let AudioFormat::Compressed(ref mut val) = self {
23394 fidl::decode!(
23395 AudioCompressedFormat,
23396 D,
23397 val,
23398 decoder,
23399 _inner_offset,
23400 depth
23401 )?;
23402 } else {
23403 unreachable!()
23404 }
23405 }
23406 2 => {
23407 #[allow(irrefutable_let_patterns)]
23408 if let AudioFormat::Uncompressed(_) = self {
23409 } else {
23411 *self =
23413 AudioFormat::Uncompressed(fidl::new_empty!(AudioUncompressedFormat, D));
23414 }
23415 #[allow(irrefutable_let_patterns)]
23416 if let AudioFormat::Uncompressed(ref mut val) = self {
23417 fidl::decode!(
23418 AudioUncompressedFormat,
23419 D,
23420 val,
23421 decoder,
23422 _inner_offset,
23423 depth
23424 )?;
23425 } else {
23426 unreachable!()
23427 }
23428 }
23429 ordinal => panic!("unexpected ordinal {:?}", ordinal),
23430 }
23431 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
23432 return Err(fidl::Error::InvalidNumBytesInEnvelope);
23433 }
23434 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
23435 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
23436 }
23437 Ok(())
23438 }
23439 }
23440
23441 impl fidl::encoding::ValueTypeMarker for AudioUncompressedFormat {
23442 type Borrowed<'a> = &'a Self;
23443 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
23444 value
23445 }
23446 }
23447
23448 unsafe impl fidl::encoding::TypeMarker for AudioUncompressedFormat {
23449 type Owned = Self;
23450
23451 #[inline(always)]
23452 fn inline_align(_context: fidl::encoding::Context) -> usize {
23453 8
23454 }
23455
23456 #[inline(always)]
23457 fn inline_size(_context: fidl::encoding::Context) -> usize {
23458 16
23459 }
23460 }
23461
23462 unsafe impl<D: fidl::encoding::ResourceDialect>
23463 fidl::encoding::Encode<AudioUncompressedFormat, D> for &AudioUncompressedFormat
23464 {
23465 #[inline]
23466 unsafe fn encode(
23467 self,
23468 encoder: &mut fidl::encoding::Encoder<'_, D>,
23469 offset: usize,
23470 _depth: fidl::encoding::Depth,
23471 ) -> fidl::Result<()> {
23472 encoder.debug_check_bounds::<AudioUncompressedFormat>(offset);
23473 encoder.write_num::<u64>(self.ordinal(), offset);
23474 match self {
23475 AudioUncompressedFormat::Pcm(ref val) => {
23476 fidl::encoding::encode_in_envelope::<PcmFormat, D>(
23477 <PcmFormat as fidl::encoding::ValueTypeMarker>::borrow(val),
23478 encoder,
23479 offset + 8,
23480 _depth,
23481 )
23482 }
23483 }
23484 }
23485 }
23486
23487 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
23488 for AudioUncompressedFormat
23489 {
23490 #[inline(always)]
23491 fn new_empty() -> Self {
23492 Self::Pcm(fidl::new_empty!(PcmFormat, D))
23493 }
23494
23495 #[inline]
23496 unsafe fn decode(
23497 &mut self,
23498 decoder: &mut fidl::encoding::Decoder<'_, D>,
23499 offset: usize,
23500 mut depth: fidl::encoding::Depth,
23501 ) -> fidl::Result<()> {
23502 decoder.debug_check_bounds::<Self>(offset);
23503 #[allow(unused_variables)]
23504 let next_out_of_line = decoder.next_out_of_line();
23505 let handles_before = decoder.remaining_handles();
23506 let (ordinal, inlined, num_bytes, num_handles) =
23507 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
23508
23509 let member_inline_size = match ordinal {
23510 1 => <PcmFormat as fidl::encoding::TypeMarker>::inline_size(decoder.context),
23511 _ => return Err(fidl::Error::UnknownUnionTag),
23512 };
23513
23514 if inlined != (member_inline_size <= 4) {
23515 return Err(fidl::Error::InvalidInlineBitInEnvelope);
23516 }
23517 let _inner_offset;
23518 if inlined {
23519 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
23520 _inner_offset = offset + 8;
23521 } else {
23522 depth.increment()?;
23523 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
23524 }
23525 match ordinal {
23526 1 => {
23527 #[allow(irrefutable_let_patterns)]
23528 if let AudioUncompressedFormat::Pcm(_) = self {
23529 } else {
23531 *self = AudioUncompressedFormat::Pcm(fidl::new_empty!(PcmFormat, D));
23533 }
23534 #[allow(irrefutable_let_patterns)]
23535 if let AudioUncompressedFormat::Pcm(ref mut val) = self {
23536 fidl::decode!(PcmFormat, D, val, decoder, _inner_offset, depth)?;
23537 } else {
23538 unreachable!()
23539 }
23540 }
23541 ordinal => panic!("unexpected ordinal {:?}", ordinal),
23542 }
23543 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
23544 return Err(fidl::Error::InvalidNumBytesInEnvelope);
23545 }
23546 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
23547 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
23548 }
23549 Ok(())
23550 }
23551 }
23552
23553 impl fidl::encoding::ValueTypeMarker for CryptoFormat {
23554 type Borrowed<'a> = &'a Self;
23555 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
23556 value
23557 }
23558 }
23559
23560 unsafe impl fidl::encoding::TypeMarker for CryptoFormat {
23561 type Owned = Self;
23562
23563 #[inline(always)]
23564 fn inline_align(_context: fidl::encoding::Context) -> usize {
23565 8
23566 }
23567
23568 #[inline(always)]
23569 fn inline_size(_context: fidl::encoding::Context) -> usize {
23570 16
23571 }
23572 }
23573
23574 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<CryptoFormat, D>
23575 for &CryptoFormat
23576 {
23577 #[inline]
23578 unsafe fn encode(
23579 self,
23580 encoder: &mut fidl::encoding::Encoder<'_, D>,
23581 offset: usize,
23582 _depth: fidl::encoding::Depth,
23583 ) -> fidl::Result<()> {
23584 encoder.debug_check_bounds::<CryptoFormat>(offset);
23585 encoder.write_num::<u64>(self.ordinal(), offset);
23586 match self {
23587 CryptoFormat::Encrypted(ref val) => {
23588 fidl::encoding::encode_in_envelope::<EncryptedFormat, D>(
23589 <EncryptedFormat as fidl::encoding::ValueTypeMarker>::borrow(val),
23590 encoder,
23591 offset + 8,
23592 _depth,
23593 )
23594 }
23595 CryptoFormat::Decrypted(ref val) => {
23596 fidl::encoding::encode_in_envelope::<DecryptedFormat, D>(
23597 <DecryptedFormat as fidl::encoding::ValueTypeMarker>::borrow(val),
23598 encoder,
23599 offset + 8,
23600 _depth,
23601 )
23602 }
23603 CryptoFormat::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
23604 }
23605 }
23606 }
23607
23608 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CryptoFormat {
23609 #[inline(always)]
23610 fn new_empty() -> Self {
23611 Self::__SourceBreaking { unknown_ordinal: 0 }
23612 }
23613
23614 #[inline]
23615 unsafe fn decode(
23616 &mut self,
23617 decoder: &mut fidl::encoding::Decoder<'_, D>,
23618 offset: usize,
23619 mut depth: fidl::encoding::Depth,
23620 ) -> fidl::Result<()> {
23621 decoder.debug_check_bounds::<Self>(offset);
23622 #[allow(unused_variables)]
23623 let next_out_of_line = decoder.next_out_of_line();
23624 let handles_before = decoder.remaining_handles();
23625 let (ordinal, inlined, num_bytes, num_handles) =
23626 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
23627
23628 let member_inline_size = match ordinal {
23629 1 => <EncryptedFormat as fidl::encoding::TypeMarker>::inline_size(decoder.context),
23630 2 => <DecryptedFormat as fidl::encoding::TypeMarker>::inline_size(decoder.context),
23631 0 => return Err(fidl::Error::UnknownUnionTag),
23632 _ => num_bytes as usize,
23633 };
23634
23635 if inlined != (member_inline_size <= 4) {
23636 return Err(fidl::Error::InvalidInlineBitInEnvelope);
23637 }
23638 let _inner_offset;
23639 if inlined {
23640 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
23641 _inner_offset = offset + 8;
23642 } else {
23643 depth.increment()?;
23644 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
23645 }
23646 match ordinal {
23647 1 => {
23648 #[allow(irrefutable_let_patterns)]
23649 if let CryptoFormat::Encrypted(_) = self {
23650 } else {
23652 *self = CryptoFormat::Encrypted(fidl::new_empty!(EncryptedFormat, D));
23654 }
23655 #[allow(irrefutable_let_patterns)]
23656 if let CryptoFormat::Encrypted(ref mut val) = self {
23657 fidl::decode!(EncryptedFormat, D, val, decoder, _inner_offset, depth)?;
23658 } else {
23659 unreachable!()
23660 }
23661 }
23662 2 => {
23663 #[allow(irrefutable_let_patterns)]
23664 if let CryptoFormat::Decrypted(_) = self {
23665 } else {
23667 *self = CryptoFormat::Decrypted(fidl::new_empty!(DecryptedFormat, D));
23669 }
23670 #[allow(irrefutable_let_patterns)]
23671 if let CryptoFormat::Decrypted(ref mut val) = self {
23672 fidl::decode!(DecryptedFormat, D, val, decoder, _inner_offset, depth)?;
23673 } else {
23674 unreachable!()
23675 }
23676 }
23677 #[allow(deprecated)]
23678 ordinal => {
23679 for _ in 0..num_handles {
23680 decoder.drop_next_handle()?;
23681 }
23682 *self = CryptoFormat::__SourceBreaking { unknown_ordinal: ordinal };
23683 }
23684 }
23685 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
23686 return Err(fidl::Error::InvalidNumBytesInEnvelope);
23687 }
23688 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
23689 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
23690 }
23691 Ok(())
23692 }
23693 }
23694
23695 impl fidl::encoding::ValueTypeMarker for DomainFormat {
23696 type Borrowed<'a> = &'a Self;
23697 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
23698 value
23699 }
23700 }
23701
23702 unsafe impl fidl::encoding::TypeMarker for DomainFormat {
23703 type Owned = Self;
23704
23705 #[inline(always)]
23706 fn inline_align(_context: fidl::encoding::Context) -> usize {
23707 8
23708 }
23709
23710 #[inline(always)]
23711 fn inline_size(_context: fidl::encoding::Context) -> usize {
23712 16
23713 }
23714 }
23715
23716 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DomainFormat, D>
23717 for &DomainFormat
23718 {
23719 #[inline]
23720 unsafe fn encode(
23721 self,
23722 encoder: &mut fidl::encoding::Encoder<'_, D>,
23723 offset: usize,
23724 _depth: fidl::encoding::Depth,
23725 ) -> fidl::Result<()> {
23726 encoder.debug_check_bounds::<DomainFormat>(offset);
23727 encoder.write_num::<u64>(self.ordinal(), offset);
23728 match self {
23729 DomainFormat::Audio(ref val) => {
23730 fidl::encoding::encode_in_envelope::<AudioFormat, D>(
23731 <AudioFormat as fidl::encoding::ValueTypeMarker>::borrow(val),
23732 encoder,
23733 offset + 8,
23734 _depth,
23735 )
23736 }
23737 DomainFormat::Video(ref val) => {
23738 fidl::encoding::encode_in_envelope::<VideoFormat, D>(
23739 <VideoFormat as fidl::encoding::ValueTypeMarker>::borrow(val),
23740 encoder,
23741 offset + 8,
23742 _depth,
23743 )
23744 }
23745 DomainFormat::Crypto(ref val) => {
23746 fidl::encoding::encode_in_envelope::<CryptoFormat, D>(
23747 <CryptoFormat as fidl::encoding::ValueTypeMarker>::borrow(val),
23748 encoder,
23749 offset + 8,
23750 _depth,
23751 )
23752 }
23753 }
23754 }
23755 }
23756
23757 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DomainFormat {
23758 #[inline(always)]
23759 fn new_empty() -> Self {
23760 Self::Audio(fidl::new_empty!(AudioFormat, D))
23761 }
23762
23763 #[inline]
23764 unsafe fn decode(
23765 &mut self,
23766 decoder: &mut fidl::encoding::Decoder<'_, D>,
23767 offset: usize,
23768 mut depth: fidl::encoding::Depth,
23769 ) -> fidl::Result<()> {
23770 decoder.debug_check_bounds::<Self>(offset);
23771 #[allow(unused_variables)]
23772 let next_out_of_line = decoder.next_out_of_line();
23773 let handles_before = decoder.remaining_handles();
23774 let (ordinal, inlined, num_bytes, num_handles) =
23775 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
23776
23777 let member_inline_size = match ordinal {
23778 1 => <AudioFormat as fidl::encoding::TypeMarker>::inline_size(decoder.context),
23779 2 => <VideoFormat as fidl::encoding::TypeMarker>::inline_size(decoder.context),
23780 3 => <CryptoFormat as fidl::encoding::TypeMarker>::inline_size(decoder.context),
23781 _ => return Err(fidl::Error::UnknownUnionTag),
23782 };
23783
23784 if inlined != (member_inline_size <= 4) {
23785 return Err(fidl::Error::InvalidInlineBitInEnvelope);
23786 }
23787 let _inner_offset;
23788 if inlined {
23789 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
23790 _inner_offset = offset + 8;
23791 } else {
23792 depth.increment()?;
23793 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
23794 }
23795 match ordinal {
23796 1 => {
23797 #[allow(irrefutable_let_patterns)]
23798 if let DomainFormat::Audio(_) = self {
23799 } else {
23801 *self = DomainFormat::Audio(fidl::new_empty!(AudioFormat, D));
23803 }
23804 #[allow(irrefutable_let_patterns)]
23805 if let DomainFormat::Audio(ref mut val) = self {
23806 fidl::decode!(AudioFormat, D, val, decoder, _inner_offset, depth)?;
23807 } else {
23808 unreachable!()
23809 }
23810 }
23811 2 => {
23812 #[allow(irrefutable_let_patterns)]
23813 if let DomainFormat::Video(_) = self {
23814 } else {
23816 *self = DomainFormat::Video(fidl::new_empty!(VideoFormat, D));
23818 }
23819 #[allow(irrefutable_let_patterns)]
23820 if let DomainFormat::Video(ref mut val) = self {
23821 fidl::decode!(VideoFormat, D, val, decoder, _inner_offset, depth)?;
23822 } else {
23823 unreachable!()
23824 }
23825 }
23826 3 => {
23827 #[allow(irrefutable_let_patterns)]
23828 if let DomainFormat::Crypto(_) = self {
23829 } else {
23831 *self = DomainFormat::Crypto(fidl::new_empty!(CryptoFormat, D));
23833 }
23834 #[allow(irrefutable_let_patterns)]
23835 if let DomainFormat::Crypto(ref mut val) = self {
23836 fidl::decode!(CryptoFormat, D, val, decoder, _inner_offset, depth)?;
23837 } else {
23838 unreachable!()
23839 }
23840 }
23841 ordinal => panic!("unexpected ordinal {:?}", ordinal),
23842 }
23843 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
23844 return Err(fidl::Error::InvalidNumBytesInEnvelope);
23845 }
23846 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
23847 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
23848 }
23849 Ok(())
23850 }
23851 }
23852
23853 impl fidl::encoding::ValueTypeMarker for EncoderSettings {
23854 type Borrowed<'a> = &'a Self;
23855 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
23856 value
23857 }
23858 }
23859
23860 unsafe impl fidl::encoding::TypeMarker for EncoderSettings {
23861 type Owned = Self;
23862
23863 #[inline(always)]
23864 fn inline_align(_context: fidl::encoding::Context) -> usize {
23865 8
23866 }
23867
23868 #[inline(always)]
23869 fn inline_size(_context: fidl::encoding::Context) -> usize {
23870 16
23871 }
23872 }
23873
23874 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<EncoderSettings, D>
23875 for &EncoderSettings
23876 {
23877 #[inline]
23878 unsafe fn encode(
23879 self,
23880 encoder: &mut fidl::encoding::Encoder<'_, D>,
23881 offset: usize,
23882 _depth: fidl::encoding::Depth,
23883 ) -> fidl::Result<()> {
23884 encoder.debug_check_bounds::<EncoderSettings>(offset);
23885 encoder.write_num::<u64>(self.ordinal(), offset);
23886 match self {
23887 EncoderSettings::Sbc(ref val) => {
23888 fidl::encoding::encode_in_envelope::<SbcEncoderSettings, D>(
23889 <SbcEncoderSettings as fidl::encoding::ValueTypeMarker>::borrow(val),
23890 encoder,
23891 offset + 8,
23892 _depth,
23893 )
23894 }
23895 EncoderSettings::Aac(ref val) => {
23896 fidl::encoding::encode_in_envelope::<AacEncoderSettings, D>(
23897 <AacEncoderSettings as fidl::encoding::ValueTypeMarker>::borrow(val),
23898 encoder,
23899 offset + 8,
23900 _depth,
23901 )
23902 }
23903 EncoderSettings::H264(ref val) => {
23904 fidl::encoding::encode_in_envelope::<H264EncoderSettings, D>(
23905 <H264EncoderSettings as fidl::encoding::ValueTypeMarker>::borrow(val),
23906 encoder,
23907 offset + 8,
23908 _depth,
23909 )
23910 }
23911 EncoderSettings::Hevc(ref val) => {
23912 fidl::encoding::encode_in_envelope::<HevcEncoderSettings, D>(
23913 <HevcEncoderSettings as fidl::encoding::ValueTypeMarker>::borrow(val),
23914 encoder,
23915 offset + 8,
23916 _depth,
23917 )
23918 }
23919 EncoderSettings::Cvsd(ref val) => {
23920 fidl::encoding::encode_in_envelope::<CvsdEncoderSettings, D>(
23921 <CvsdEncoderSettings as fidl::encoding::ValueTypeMarker>::borrow(val),
23922 encoder,
23923 offset + 8,
23924 _depth,
23925 )
23926 }
23927 EncoderSettings::Lc3(ref val) => {
23928 fidl::encoding::encode_in_envelope::<Lc3EncoderSettings, D>(
23929 <Lc3EncoderSettings as fidl::encoding::ValueTypeMarker>::borrow(val),
23930 encoder,
23931 offset + 8,
23932 _depth,
23933 )
23934 }
23935 EncoderSettings::Msbc(ref val) => {
23936 fidl::encoding::encode_in_envelope::<MSbcEncoderSettings, D>(
23937 <MSbcEncoderSettings as fidl::encoding::ValueTypeMarker>::borrow(val),
23938 encoder,
23939 offset + 8,
23940 _depth,
23941 )
23942 }
23943 EncoderSettings::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
23944 }
23945 }
23946 }
23947
23948 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for EncoderSettings {
23949 #[inline(always)]
23950 fn new_empty() -> Self {
23951 Self::__SourceBreaking { unknown_ordinal: 0 }
23952 }
23953
23954 #[inline]
23955 unsafe fn decode(
23956 &mut self,
23957 decoder: &mut fidl::encoding::Decoder<'_, D>,
23958 offset: usize,
23959 mut depth: fidl::encoding::Depth,
23960 ) -> fidl::Result<()> {
23961 decoder.debug_check_bounds::<Self>(offset);
23962 #[allow(unused_variables)]
23963 let next_out_of_line = decoder.next_out_of_line();
23964 let handles_before = decoder.remaining_handles();
23965 let (ordinal, inlined, num_bytes, num_handles) =
23966 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
23967
23968 let member_inline_size = match ordinal {
23969 1 => {
23970 <SbcEncoderSettings as fidl::encoding::TypeMarker>::inline_size(decoder.context)
23971 }
23972 2 => {
23973 <AacEncoderSettings as fidl::encoding::TypeMarker>::inline_size(decoder.context)
23974 }
23975 3 => <H264EncoderSettings as fidl::encoding::TypeMarker>::inline_size(
23976 decoder.context,
23977 ),
23978 4 => <HevcEncoderSettings as fidl::encoding::TypeMarker>::inline_size(
23979 decoder.context,
23980 ),
23981 5 => <CvsdEncoderSettings as fidl::encoding::TypeMarker>::inline_size(
23982 decoder.context,
23983 ),
23984 6 => {
23985 <Lc3EncoderSettings as fidl::encoding::TypeMarker>::inline_size(decoder.context)
23986 }
23987 7 => <MSbcEncoderSettings as fidl::encoding::TypeMarker>::inline_size(
23988 decoder.context,
23989 ),
23990 0 => return Err(fidl::Error::UnknownUnionTag),
23991 _ => num_bytes as usize,
23992 };
23993
23994 if inlined != (member_inline_size <= 4) {
23995 return Err(fidl::Error::InvalidInlineBitInEnvelope);
23996 }
23997 let _inner_offset;
23998 if inlined {
23999 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
24000 _inner_offset = offset + 8;
24001 } else {
24002 depth.increment()?;
24003 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
24004 }
24005 match ordinal {
24006 1 => {
24007 #[allow(irrefutable_let_patterns)]
24008 if let EncoderSettings::Sbc(_) = self {
24009 } else {
24011 *self = EncoderSettings::Sbc(fidl::new_empty!(SbcEncoderSettings, D));
24013 }
24014 #[allow(irrefutable_let_patterns)]
24015 if let EncoderSettings::Sbc(ref mut val) = self {
24016 fidl::decode!(SbcEncoderSettings, D, val, decoder, _inner_offset, depth)?;
24017 } else {
24018 unreachable!()
24019 }
24020 }
24021 2 => {
24022 #[allow(irrefutable_let_patterns)]
24023 if let EncoderSettings::Aac(_) = self {
24024 } else {
24026 *self = EncoderSettings::Aac(fidl::new_empty!(AacEncoderSettings, D));
24028 }
24029 #[allow(irrefutable_let_patterns)]
24030 if let EncoderSettings::Aac(ref mut val) = self {
24031 fidl::decode!(AacEncoderSettings, D, val, decoder, _inner_offset, depth)?;
24032 } else {
24033 unreachable!()
24034 }
24035 }
24036 3 => {
24037 #[allow(irrefutable_let_patterns)]
24038 if let EncoderSettings::H264(_) = self {
24039 } else {
24041 *self = EncoderSettings::H264(fidl::new_empty!(H264EncoderSettings, D));
24043 }
24044 #[allow(irrefutable_let_patterns)]
24045 if let EncoderSettings::H264(ref mut val) = self {
24046 fidl::decode!(H264EncoderSettings, D, val, decoder, _inner_offset, depth)?;
24047 } else {
24048 unreachable!()
24049 }
24050 }
24051 4 => {
24052 #[allow(irrefutable_let_patterns)]
24053 if let EncoderSettings::Hevc(_) = self {
24054 } else {
24056 *self = EncoderSettings::Hevc(fidl::new_empty!(HevcEncoderSettings, D));
24058 }
24059 #[allow(irrefutable_let_patterns)]
24060 if let EncoderSettings::Hevc(ref mut val) = self {
24061 fidl::decode!(HevcEncoderSettings, D, val, decoder, _inner_offset, depth)?;
24062 } else {
24063 unreachable!()
24064 }
24065 }
24066 5 => {
24067 #[allow(irrefutable_let_patterns)]
24068 if let EncoderSettings::Cvsd(_) = self {
24069 } else {
24071 *self = EncoderSettings::Cvsd(fidl::new_empty!(CvsdEncoderSettings, D));
24073 }
24074 #[allow(irrefutable_let_patterns)]
24075 if let EncoderSettings::Cvsd(ref mut val) = self {
24076 fidl::decode!(CvsdEncoderSettings, D, val, decoder, _inner_offset, depth)?;
24077 } else {
24078 unreachable!()
24079 }
24080 }
24081 6 => {
24082 #[allow(irrefutable_let_patterns)]
24083 if let EncoderSettings::Lc3(_) = self {
24084 } else {
24086 *self = EncoderSettings::Lc3(fidl::new_empty!(Lc3EncoderSettings, D));
24088 }
24089 #[allow(irrefutable_let_patterns)]
24090 if let EncoderSettings::Lc3(ref mut val) = self {
24091 fidl::decode!(Lc3EncoderSettings, D, val, decoder, _inner_offset, depth)?;
24092 } else {
24093 unreachable!()
24094 }
24095 }
24096 7 => {
24097 #[allow(irrefutable_let_patterns)]
24098 if let EncoderSettings::Msbc(_) = self {
24099 } else {
24101 *self = EncoderSettings::Msbc(fidl::new_empty!(MSbcEncoderSettings, D));
24103 }
24104 #[allow(irrefutable_let_patterns)]
24105 if let EncoderSettings::Msbc(ref mut val) = self {
24106 fidl::decode!(MSbcEncoderSettings, D, val, decoder, _inner_offset, depth)?;
24107 } else {
24108 unreachable!()
24109 }
24110 }
24111 #[allow(deprecated)]
24112 ordinal => {
24113 for _ in 0..num_handles {
24114 decoder.drop_next_handle()?;
24115 }
24116 *self = EncoderSettings::__SourceBreaking { unknown_ordinal: ordinal };
24117 }
24118 }
24119 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
24120 return Err(fidl::Error::InvalidNumBytesInEnvelope);
24121 }
24122 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
24123 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
24124 }
24125 Ok(())
24126 }
24127 }
24128
24129 impl fidl::encoding::ValueTypeMarker for MediumSpecificStreamType {
24130 type Borrowed<'a> = &'a Self;
24131 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
24132 value
24133 }
24134 }
24135
24136 unsafe impl fidl::encoding::TypeMarker for MediumSpecificStreamType {
24137 type Owned = Self;
24138
24139 #[inline(always)]
24140 fn inline_align(_context: fidl::encoding::Context) -> usize {
24141 8
24142 }
24143
24144 #[inline(always)]
24145 fn inline_size(_context: fidl::encoding::Context) -> usize {
24146 16
24147 }
24148 }
24149
24150 unsafe impl<D: fidl::encoding::ResourceDialect>
24151 fidl::encoding::Encode<MediumSpecificStreamType, D> for &MediumSpecificStreamType
24152 {
24153 #[inline]
24154 unsafe fn encode(
24155 self,
24156 encoder: &mut fidl::encoding::Encoder<'_, D>,
24157 offset: usize,
24158 _depth: fidl::encoding::Depth,
24159 ) -> fidl::Result<()> {
24160 encoder.debug_check_bounds::<MediumSpecificStreamType>(offset);
24161 encoder.write_num::<u64>(self.ordinal(), offset);
24162 match self {
24163 MediumSpecificStreamType::Audio(ref val) => {
24164 fidl::encoding::encode_in_envelope::<AudioStreamType, D>(
24165 <AudioStreamType as fidl::encoding::ValueTypeMarker>::borrow(val),
24166 encoder,
24167 offset + 8,
24168 _depth,
24169 )
24170 }
24171 MediumSpecificStreamType::Video(ref val) => {
24172 fidl::encoding::encode_in_envelope::<VideoStreamType, D>(
24173 <VideoStreamType as fidl::encoding::ValueTypeMarker>::borrow(val),
24174 encoder,
24175 offset + 8,
24176 _depth,
24177 )
24178 }
24179 MediumSpecificStreamType::Text(ref val) => {
24180 fidl::encoding::encode_in_envelope::<TextStreamType, D>(
24181 <TextStreamType as fidl::encoding::ValueTypeMarker>::borrow(val),
24182 encoder,
24183 offset + 8,
24184 _depth,
24185 )
24186 }
24187 MediumSpecificStreamType::Subpicture(ref val) => {
24188 fidl::encoding::encode_in_envelope::<SubpictureStreamType, D>(
24189 <SubpictureStreamType as fidl::encoding::ValueTypeMarker>::borrow(val),
24190 encoder,
24191 offset + 8,
24192 _depth,
24193 )
24194 }
24195 }
24196 }
24197 }
24198
24199 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
24200 for MediumSpecificStreamType
24201 {
24202 #[inline(always)]
24203 fn new_empty() -> Self {
24204 Self::Audio(fidl::new_empty!(AudioStreamType, D))
24205 }
24206
24207 #[inline]
24208 unsafe fn decode(
24209 &mut self,
24210 decoder: &mut fidl::encoding::Decoder<'_, D>,
24211 offset: usize,
24212 mut depth: fidl::encoding::Depth,
24213 ) -> fidl::Result<()> {
24214 decoder.debug_check_bounds::<Self>(offset);
24215 #[allow(unused_variables)]
24216 let next_out_of_line = decoder.next_out_of_line();
24217 let handles_before = decoder.remaining_handles();
24218 let (ordinal, inlined, num_bytes, num_handles) =
24219 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
24220
24221 let member_inline_size = match ordinal {
24222 1 => <AudioStreamType as fidl::encoding::TypeMarker>::inline_size(decoder.context),
24223 2 => <VideoStreamType as fidl::encoding::TypeMarker>::inline_size(decoder.context),
24224 3 => <TextStreamType as fidl::encoding::TypeMarker>::inline_size(decoder.context),
24225 4 => <SubpictureStreamType as fidl::encoding::TypeMarker>::inline_size(
24226 decoder.context,
24227 ),
24228 _ => return Err(fidl::Error::UnknownUnionTag),
24229 };
24230
24231 if inlined != (member_inline_size <= 4) {
24232 return Err(fidl::Error::InvalidInlineBitInEnvelope);
24233 }
24234 let _inner_offset;
24235 if inlined {
24236 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
24237 _inner_offset = offset + 8;
24238 } else {
24239 depth.increment()?;
24240 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
24241 }
24242 match ordinal {
24243 1 => {
24244 #[allow(irrefutable_let_patterns)]
24245 if let MediumSpecificStreamType::Audio(_) = self {
24246 } else {
24248 *self =
24250 MediumSpecificStreamType::Audio(fidl::new_empty!(AudioStreamType, D));
24251 }
24252 #[allow(irrefutable_let_patterns)]
24253 if let MediumSpecificStreamType::Audio(ref mut val) = self {
24254 fidl::decode!(AudioStreamType, D, val, decoder, _inner_offset, depth)?;
24255 } else {
24256 unreachable!()
24257 }
24258 }
24259 2 => {
24260 #[allow(irrefutable_let_patterns)]
24261 if let MediumSpecificStreamType::Video(_) = self {
24262 } else {
24264 *self =
24266 MediumSpecificStreamType::Video(fidl::new_empty!(VideoStreamType, D));
24267 }
24268 #[allow(irrefutable_let_patterns)]
24269 if let MediumSpecificStreamType::Video(ref mut val) = self {
24270 fidl::decode!(VideoStreamType, D, val, decoder, _inner_offset, depth)?;
24271 } else {
24272 unreachable!()
24273 }
24274 }
24275 3 => {
24276 #[allow(irrefutable_let_patterns)]
24277 if let MediumSpecificStreamType::Text(_) = self {
24278 } else {
24280 *self = MediumSpecificStreamType::Text(fidl::new_empty!(TextStreamType, D));
24282 }
24283 #[allow(irrefutable_let_patterns)]
24284 if let MediumSpecificStreamType::Text(ref mut val) = self {
24285 fidl::decode!(TextStreamType, D, val, decoder, _inner_offset, depth)?;
24286 } else {
24287 unreachable!()
24288 }
24289 }
24290 4 => {
24291 #[allow(irrefutable_let_patterns)]
24292 if let MediumSpecificStreamType::Subpicture(_) = self {
24293 } else {
24295 *self = MediumSpecificStreamType::Subpicture(fidl::new_empty!(
24297 SubpictureStreamType,
24298 D
24299 ));
24300 }
24301 #[allow(irrefutable_let_patterns)]
24302 if let MediumSpecificStreamType::Subpicture(ref mut val) = self {
24303 fidl::decode!(SubpictureStreamType, D, val, decoder, _inner_offset, depth)?;
24304 } else {
24305 unreachable!()
24306 }
24307 }
24308 ordinal => panic!("unexpected ordinal {:?}", ordinal),
24309 }
24310 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
24311 return Err(fidl::Error::InvalidNumBytesInEnvelope);
24312 }
24313 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
24314 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
24315 }
24316 Ok(())
24317 }
24318 }
24319
24320 impl fidl::encoding::ValueTypeMarker for Usage {
24321 type Borrowed<'a> = &'a Self;
24322 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
24323 value
24324 }
24325 }
24326
24327 unsafe impl fidl::encoding::TypeMarker for Usage {
24328 type Owned = Self;
24329
24330 #[inline(always)]
24331 fn inline_align(_context: fidl::encoding::Context) -> usize {
24332 8
24333 }
24334
24335 #[inline(always)]
24336 fn inline_size(_context: fidl::encoding::Context) -> usize {
24337 16
24338 }
24339 }
24340
24341 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Usage, D> for &Usage {
24342 #[inline]
24343 unsafe fn encode(
24344 self,
24345 encoder: &mut fidl::encoding::Encoder<'_, D>,
24346 offset: usize,
24347 _depth: fidl::encoding::Depth,
24348 ) -> fidl::Result<()> {
24349 encoder.debug_check_bounds::<Usage>(offset);
24350 encoder.write_num::<u64>(self.ordinal(), offset);
24351 match self {
24352 Usage::RenderUsage(ref val) => {
24353 fidl::encoding::encode_in_envelope::<AudioRenderUsage, D>(
24354 <AudioRenderUsage as fidl::encoding::ValueTypeMarker>::borrow(val),
24355 encoder,
24356 offset + 8,
24357 _depth,
24358 )
24359 }
24360 Usage::CaptureUsage(ref val) => {
24361 fidl::encoding::encode_in_envelope::<AudioCaptureUsage, D>(
24362 <AudioCaptureUsage as fidl::encoding::ValueTypeMarker>::borrow(val),
24363 encoder,
24364 offset + 8,
24365 _depth,
24366 )
24367 }
24368 }
24369 }
24370 }
24371
24372 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Usage {
24373 #[inline(always)]
24374 fn new_empty() -> Self {
24375 Self::RenderUsage(fidl::new_empty!(AudioRenderUsage, D))
24376 }
24377
24378 #[inline]
24379 unsafe fn decode(
24380 &mut self,
24381 decoder: &mut fidl::encoding::Decoder<'_, D>,
24382 offset: usize,
24383 mut depth: fidl::encoding::Depth,
24384 ) -> fidl::Result<()> {
24385 decoder.debug_check_bounds::<Self>(offset);
24386 #[allow(unused_variables)]
24387 let next_out_of_line = decoder.next_out_of_line();
24388 let handles_before = decoder.remaining_handles();
24389 let (ordinal, inlined, num_bytes, num_handles) =
24390 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
24391
24392 let member_inline_size = match ordinal {
24393 1 => <AudioRenderUsage as fidl::encoding::TypeMarker>::inline_size(decoder.context),
24394 2 => {
24395 <AudioCaptureUsage as fidl::encoding::TypeMarker>::inline_size(decoder.context)
24396 }
24397 _ => return Err(fidl::Error::UnknownUnionTag),
24398 };
24399
24400 if inlined != (member_inline_size <= 4) {
24401 return Err(fidl::Error::InvalidInlineBitInEnvelope);
24402 }
24403 let _inner_offset;
24404 if inlined {
24405 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
24406 _inner_offset = offset + 8;
24407 } else {
24408 depth.increment()?;
24409 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
24410 }
24411 match ordinal {
24412 1 => {
24413 #[allow(irrefutable_let_patterns)]
24414 if let Usage::RenderUsage(_) = self {
24415 } else {
24417 *self = Usage::RenderUsage(fidl::new_empty!(AudioRenderUsage, D));
24419 }
24420 #[allow(irrefutable_let_patterns)]
24421 if let Usage::RenderUsage(ref mut val) = self {
24422 fidl::decode!(AudioRenderUsage, D, val, decoder, _inner_offset, depth)?;
24423 } else {
24424 unreachable!()
24425 }
24426 }
24427 2 => {
24428 #[allow(irrefutable_let_patterns)]
24429 if let Usage::CaptureUsage(_) = self {
24430 } else {
24432 *self = Usage::CaptureUsage(fidl::new_empty!(AudioCaptureUsage, D));
24434 }
24435 #[allow(irrefutable_let_patterns)]
24436 if let Usage::CaptureUsage(ref mut val) = self {
24437 fidl::decode!(AudioCaptureUsage, D, val, decoder, _inner_offset, depth)?;
24438 } else {
24439 unreachable!()
24440 }
24441 }
24442 ordinal => panic!("unexpected ordinal {:?}", ordinal),
24443 }
24444 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
24445 return Err(fidl::Error::InvalidNumBytesInEnvelope);
24446 }
24447 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
24448 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
24449 }
24450 Ok(())
24451 }
24452 }
24453
24454 impl fidl::encoding::ValueTypeMarker for Usage2 {
24455 type Borrowed<'a> = &'a Self;
24456 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
24457 value
24458 }
24459 }
24460
24461 unsafe impl fidl::encoding::TypeMarker for Usage2 {
24462 type Owned = Self;
24463
24464 #[inline(always)]
24465 fn inline_align(_context: fidl::encoding::Context) -> usize {
24466 8
24467 }
24468
24469 #[inline(always)]
24470 fn inline_size(_context: fidl::encoding::Context) -> usize {
24471 16
24472 }
24473 }
24474
24475 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Usage2, D> for &Usage2 {
24476 #[inline]
24477 unsafe fn encode(
24478 self,
24479 encoder: &mut fidl::encoding::Encoder<'_, D>,
24480 offset: usize,
24481 _depth: fidl::encoding::Depth,
24482 ) -> fidl::Result<()> {
24483 encoder.debug_check_bounds::<Usage2>(offset);
24484 encoder.write_num::<u64>(self.ordinal(), offset);
24485 match self {
24486 Usage2::RenderUsage(ref val) => {
24487 fidl::encoding::encode_in_envelope::<AudioRenderUsage2, D>(
24488 <AudioRenderUsage2 as fidl::encoding::ValueTypeMarker>::borrow(val),
24489 encoder,
24490 offset + 8,
24491 _depth,
24492 )
24493 }
24494 Usage2::CaptureUsage(ref val) => {
24495 fidl::encoding::encode_in_envelope::<AudioCaptureUsage2, D>(
24496 <AudioCaptureUsage2 as fidl::encoding::ValueTypeMarker>::borrow(val),
24497 encoder,
24498 offset + 8,
24499 _depth,
24500 )
24501 }
24502 Usage2::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
24503 }
24504 }
24505 }
24506
24507 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Usage2 {
24508 #[inline(always)]
24509 fn new_empty() -> Self {
24510 Self::__SourceBreaking { unknown_ordinal: 0 }
24511 }
24512
24513 #[inline]
24514 unsafe fn decode(
24515 &mut self,
24516 decoder: &mut fidl::encoding::Decoder<'_, D>,
24517 offset: usize,
24518 mut depth: fidl::encoding::Depth,
24519 ) -> fidl::Result<()> {
24520 decoder.debug_check_bounds::<Self>(offset);
24521 #[allow(unused_variables)]
24522 let next_out_of_line = decoder.next_out_of_line();
24523 let handles_before = decoder.remaining_handles();
24524 let (ordinal, inlined, num_bytes, num_handles) =
24525 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
24526
24527 let member_inline_size = match ordinal {
24528 1 => {
24529 <AudioRenderUsage2 as fidl::encoding::TypeMarker>::inline_size(decoder.context)
24530 }
24531 2 => {
24532 <AudioCaptureUsage2 as fidl::encoding::TypeMarker>::inline_size(decoder.context)
24533 }
24534 0 => return Err(fidl::Error::UnknownUnionTag),
24535 _ => num_bytes as usize,
24536 };
24537
24538 if inlined != (member_inline_size <= 4) {
24539 return Err(fidl::Error::InvalidInlineBitInEnvelope);
24540 }
24541 let _inner_offset;
24542 if inlined {
24543 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
24544 _inner_offset = offset + 8;
24545 } else {
24546 depth.increment()?;
24547 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
24548 }
24549 match ordinal {
24550 1 => {
24551 #[allow(irrefutable_let_patterns)]
24552 if let Usage2::RenderUsage(_) = self {
24553 } else {
24555 *self = Usage2::RenderUsage(fidl::new_empty!(AudioRenderUsage2, D));
24557 }
24558 #[allow(irrefutable_let_patterns)]
24559 if let Usage2::RenderUsage(ref mut val) = self {
24560 fidl::decode!(AudioRenderUsage2, D, val, decoder, _inner_offset, depth)?;
24561 } else {
24562 unreachable!()
24563 }
24564 }
24565 2 => {
24566 #[allow(irrefutable_let_patterns)]
24567 if let Usage2::CaptureUsage(_) = self {
24568 } else {
24570 *self = Usage2::CaptureUsage(fidl::new_empty!(AudioCaptureUsage2, D));
24572 }
24573 #[allow(irrefutable_let_patterns)]
24574 if let Usage2::CaptureUsage(ref mut val) = self {
24575 fidl::decode!(AudioCaptureUsage2, D, val, decoder, _inner_offset, depth)?;
24576 } else {
24577 unreachable!()
24578 }
24579 }
24580 #[allow(deprecated)]
24581 ordinal => {
24582 for _ in 0..num_handles {
24583 decoder.drop_next_handle()?;
24584 }
24585 *self = Usage2::__SourceBreaking { unknown_ordinal: ordinal };
24586 }
24587 }
24588 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
24589 return Err(fidl::Error::InvalidNumBytesInEnvelope);
24590 }
24591 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
24592 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
24593 }
24594 Ok(())
24595 }
24596 }
24597
24598 impl fidl::encoding::ValueTypeMarker for UsageState {
24599 type Borrowed<'a> = &'a Self;
24600 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
24601 value
24602 }
24603 }
24604
24605 unsafe impl fidl::encoding::TypeMarker for UsageState {
24606 type Owned = Self;
24607
24608 #[inline(always)]
24609 fn inline_align(_context: fidl::encoding::Context) -> usize {
24610 8
24611 }
24612
24613 #[inline(always)]
24614 fn inline_size(_context: fidl::encoding::Context) -> usize {
24615 16
24616 }
24617 }
24618
24619 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<UsageState, D>
24620 for &UsageState
24621 {
24622 #[inline]
24623 unsafe fn encode(
24624 self,
24625 encoder: &mut fidl::encoding::Encoder<'_, D>,
24626 offset: usize,
24627 _depth: fidl::encoding::Depth,
24628 ) -> fidl::Result<()> {
24629 encoder.debug_check_bounds::<UsageState>(offset);
24630 encoder.write_num::<u64>(self.ordinal(), offset);
24631 match self {
24632 UsageState::Unadjusted(ref val) => {
24633 fidl::encoding::encode_in_envelope::<UsageStateUnadjusted, D>(
24634 <UsageStateUnadjusted as fidl::encoding::ValueTypeMarker>::borrow(val),
24635 encoder,
24636 offset + 8,
24637 _depth,
24638 )
24639 }
24640 UsageState::Ducked(ref val) => {
24641 fidl::encoding::encode_in_envelope::<UsageStateDucked, D>(
24642 <UsageStateDucked as fidl::encoding::ValueTypeMarker>::borrow(val),
24643 encoder,
24644 offset + 8,
24645 _depth,
24646 )
24647 }
24648 UsageState::Muted(ref val) => {
24649 fidl::encoding::encode_in_envelope::<UsageStateMuted, D>(
24650 <UsageStateMuted as fidl::encoding::ValueTypeMarker>::borrow(val),
24651 encoder,
24652 offset + 8,
24653 _depth,
24654 )
24655 }
24656 UsageState::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
24657 }
24658 }
24659 }
24660
24661 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for UsageState {
24662 #[inline(always)]
24663 fn new_empty() -> Self {
24664 Self::__SourceBreaking { unknown_ordinal: 0 }
24665 }
24666
24667 #[inline]
24668 unsafe fn decode(
24669 &mut self,
24670 decoder: &mut fidl::encoding::Decoder<'_, D>,
24671 offset: usize,
24672 mut depth: fidl::encoding::Depth,
24673 ) -> fidl::Result<()> {
24674 decoder.debug_check_bounds::<Self>(offset);
24675 #[allow(unused_variables)]
24676 let next_out_of_line = decoder.next_out_of_line();
24677 let handles_before = decoder.remaining_handles();
24678 let (ordinal, inlined, num_bytes, num_handles) =
24679 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
24680
24681 let member_inline_size = match ordinal {
24682 1 => <UsageStateUnadjusted as fidl::encoding::TypeMarker>::inline_size(
24683 decoder.context,
24684 ),
24685 2 => <UsageStateDucked as fidl::encoding::TypeMarker>::inline_size(decoder.context),
24686 3 => <UsageStateMuted as fidl::encoding::TypeMarker>::inline_size(decoder.context),
24687 0 => return Err(fidl::Error::UnknownUnionTag),
24688 _ => num_bytes as usize,
24689 };
24690
24691 if inlined != (member_inline_size <= 4) {
24692 return Err(fidl::Error::InvalidInlineBitInEnvelope);
24693 }
24694 let _inner_offset;
24695 if inlined {
24696 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
24697 _inner_offset = offset + 8;
24698 } else {
24699 depth.increment()?;
24700 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
24701 }
24702 match ordinal {
24703 1 => {
24704 #[allow(irrefutable_let_patterns)]
24705 if let UsageState::Unadjusted(_) = self {
24706 } else {
24708 *self = UsageState::Unadjusted(fidl::new_empty!(UsageStateUnadjusted, D));
24710 }
24711 #[allow(irrefutable_let_patterns)]
24712 if let UsageState::Unadjusted(ref mut val) = self {
24713 fidl::decode!(UsageStateUnadjusted, D, val, decoder, _inner_offset, depth)?;
24714 } else {
24715 unreachable!()
24716 }
24717 }
24718 2 => {
24719 #[allow(irrefutable_let_patterns)]
24720 if let UsageState::Ducked(_) = self {
24721 } else {
24723 *self = UsageState::Ducked(fidl::new_empty!(UsageStateDucked, D));
24725 }
24726 #[allow(irrefutable_let_patterns)]
24727 if let UsageState::Ducked(ref mut val) = self {
24728 fidl::decode!(UsageStateDucked, D, val, decoder, _inner_offset, depth)?;
24729 } else {
24730 unreachable!()
24731 }
24732 }
24733 3 => {
24734 #[allow(irrefutable_let_patterns)]
24735 if let UsageState::Muted(_) = self {
24736 } else {
24738 *self = UsageState::Muted(fidl::new_empty!(UsageStateMuted, D));
24740 }
24741 #[allow(irrefutable_let_patterns)]
24742 if let UsageState::Muted(ref mut val) = self {
24743 fidl::decode!(UsageStateMuted, D, val, decoder, _inner_offset, depth)?;
24744 } else {
24745 unreachable!()
24746 }
24747 }
24748 #[allow(deprecated)]
24749 ordinal => {
24750 for _ in 0..num_handles {
24751 decoder.drop_next_handle()?;
24752 }
24753 *self = UsageState::__SourceBreaking { unknown_ordinal: ordinal };
24754 }
24755 }
24756 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
24757 return Err(fidl::Error::InvalidNumBytesInEnvelope);
24758 }
24759 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
24760 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
24761 }
24762 Ok(())
24763 }
24764 }
24765
24766 impl fidl::encoding::ValueTypeMarker for Value {
24767 type Borrowed<'a> = &'a Self;
24768 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
24769 value
24770 }
24771 }
24772
24773 unsafe impl fidl::encoding::TypeMarker for Value {
24774 type Owned = Self;
24775
24776 #[inline(always)]
24777 fn inline_align(_context: fidl::encoding::Context) -> usize {
24778 8
24779 }
24780
24781 #[inline(always)]
24782 fn inline_size(_context: fidl::encoding::Context) -> usize {
24783 16
24784 }
24785 }
24786
24787 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Value, D> for &Value {
24788 #[inline]
24789 unsafe fn encode(
24790 self,
24791 encoder: &mut fidl::encoding::Encoder<'_, D>,
24792 offset: usize,
24793 _depth: fidl::encoding::Depth,
24794 ) -> fidl::Result<()> {
24795 encoder.debug_check_bounds::<Value>(offset);
24796 encoder.write_num::<u64>(self.ordinal(), offset);
24797 match self {
24798 Value::BoolValue(ref val) => {
24799 fidl::encoding::encode_in_envelope::<bool, D>(
24800 <bool as fidl::encoding::ValueTypeMarker>::borrow(val),
24801 encoder, offset + 8, _depth
24802 )
24803 }
24804 Value::Uint64Value(ref val) => {
24805 fidl::encoding::encode_in_envelope::<u64, D>(
24806 <u64 as fidl::encoding::ValueTypeMarker>::borrow(val),
24807 encoder, offset + 8, _depth
24808 )
24809 }
24810 Value::Int64Value(ref val) => {
24811 fidl::encoding::encode_in_envelope::<i64, D>(
24812 <i64 as fidl::encoding::ValueTypeMarker>::borrow(val),
24813 encoder, offset + 8, _depth
24814 )
24815 }
24816 Value::StringValue(ref val) => {
24817 fidl::encoding::encode_in_envelope::<fidl::encoding::UnboundedString, D>(
24818 <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(val),
24819 encoder, offset + 8, _depth
24820 )
24821 }
24822 Value::BytesValue(ref val) => {
24823 fidl::encoding::encode_in_envelope::<fidl::encoding::UnboundedVector<u8>, D>(
24824 <fidl::encoding::UnboundedVector<u8> as fidl::encoding::ValueTypeMarker>::borrow(val),
24825 encoder, offset + 8, _depth
24826 )
24827 }
24828 }
24829 }
24830 }
24831
24832 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Value {
24833 #[inline(always)]
24834 fn new_empty() -> Self {
24835 Self::BoolValue(fidl::new_empty!(bool, D))
24836 }
24837
24838 #[inline]
24839 unsafe fn decode(
24840 &mut self,
24841 decoder: &mut fidl::encoding::Decoder<'_, D>,
24842 offset: usize,
24843 mut depth: fidl::encoding::Depth,
24844 ) -> fidl::Result<()> {
24845 decoder.debug_check_bounds::<Self>(offset);
24846 #[allow(unused_variables)]
24847 let next_out_of_line = decoder.next_out_of_line();
24848 let handles_before = decoder.remaining_handles();
24849 let (ordinal, inlined, num_bytes, num_handles) =
24850 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
24851
24852 let member_inline_size = match ordinal {
24853 1 => <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context),
24854 2 => <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
24855 3 => <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
24856 4 => <fidl::encoding::UnboundedString as fidl::encoding::TypeMarker>::inline_size(
24857 decoder.context,
24858 ),
24859 5 => {
24860 <fidl::encoding::UnboundedVector<u8> as fidl::encoding::TypeMarker>::inline_size(
24861 decoder.context,
24862 )
24863 }
24864 _ => return Err(fidl::Error::UnknownUnionTag),
24865 };
24866
24867 if inlined != (member_inline_size <= 4) {
24868 return Err(fidl::Error::InvalidInlineBitInEnvelope);
24869 }
24870 let _inner_offset;
24871 if inlined {
24872 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
24873 _inner_offset = offset + 8;
24874 } else {
24875 depth.increment()?;
24876 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
24877 }
24878 match ordinal {
24879 1 => {
24880 #[allow(irrefutable_let_patterns)]
24881 if let Value::BoolValue(_) = self {
24882 } else {
24884 *self = Value::BoolValue(fidl::new_empty!(bool, D));
24886 }
24887 #[allow(irrefutable_let_patterns)]
24888 if let Value::BoolValue(ref mut val) = self {
24889 fidl::decode!(bool, D, val, decoder, _inner_offset, depth)?;
24890 } else {
24891 unreachable!()
24892 }
24893 }
24894 2 => {
24895 #[allow(irrefutable_let_patterns)]
24896 if let Value::Uint64Value(_) = self {
24897 } else {
24899 *self = Value::Uint64Value(fidl::new_empty!(u64, D));
24901 }
24902 #[allow(irrefutable_let_patterns)]
24903 if let Value::Uint64Value(ref mut val) = self {
24904 fidl::decode!(u64, D, val, decoder, _inner_offset, depth)?;
24905 } else {
24906 unreachable!()
24907 }
24908 }
24909 3 => {
24910 #[allow(irrefutable_let_patterns)]
24911 if let Value::Int64Value(_) = self {
24912 } else {
24914 *self = Value::Int64Value(fidl::new_empty!(i64, D));
24916 }
24917 #[allow(irrefutable_let_patterns)]
24918 if let Value::Int64Value(ref mut val) = self {
24919 fidl::decode!(i64, D, val, decoder, _inner_offset, depth)?;
24920 } else {
24921 unreachable!()
24922 }
24923 }
24924 4 => {
24925 #[allow(irrefutable_let_patterns)]
24926 if let Value::StringValue(_) = self {
24927 } else {
24929 *self = Value::StringValue(fidl::new_empty!(
24931 fidl::encoding::UnboundedString,
24932 D
24933 ));
24934 }
24935 #[allow(irrefutable_let_patterns)]
24936 if let Value::StringValue(ref mut val) = self {
24937 fidl::decode!(
24938 fidl::encoding::UnboundedString,
24939 D,
24940 val,
24941 decoder,
24942 _inner_offset,
24943 depth
24944 )?;
24945 } else {
24946 unreachable!()
24947 }
24948 }
24949 5 => {
24950 #[allow(irrefutable_let_patterns)]
24951 if let Value::BytesValue(_) = self {
24952 } else {
24954 *self = Value::BytesValue(fidl::new_empty!(
24956 fidl::encoding::UnboundedVector<u8>,
24957 D
24958 ));
24959 }
24960 #[allow(irrefutable_let_patterns)]
24961 if let Value::BytesValue(ref mut val) = self {
24962 fidl::decode!(
24963 fidl::encoding::UnboundedVector<u8>,
24964 D,
24965 val,
24966 decoder,
24967 _inner_offset,
24968 depth
24969 )?;
24970 } else {
24971 unreachable!()
24972 }
24973 }
24974 ordinal => panic!("unexpected ordinal {:?}", ordinal),
24975 }
24976 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
24977 return Err(fidl::Error::InvalidNumBytesInEnvelope);
24978 }
24979 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
24980 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
24981 }
24982 Ok(())
24983 }
24984 }
24985
24986 impl fidl::encoding::ValueTypeMarker for VideoCompressedFormat {
24987 type Borrowed<'a> = &'a Self;
24988 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
24989 value
24990 }
24991 }
24992
24993 unsafe impl fidl::encoding::TypeMarker for VideoCompressedFormat {
24994 type Owned = Self;
24995
24996 #[inline(always)]
24997 fn inline_align(_context: fidl::encoding::Context) -> usize {
24998 8
24999 }
25000
25001 #[inline(always)]
25002 fn inline_size(_context: fidl::encoding::Context) -> usize {
25003 16
25004 }
25005 }
25006
25007 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<VideoCompressedFormat, D>
25008 for &VideoCompressedFormat
25009 {
25010 #[inline]
25011 unsafe fn encode(
25012 self,
25013 encoder: &mut fidl::encoding::Encoder<'_, D>,
25014 offset: usize,
25015 _depth: fidl::encoding::Depth,
25016 ) -> fidl::Result<()> {
25017 encoder.debug_check_bounds::<VideoCompressedFormat>(offset);
25018 encoder.write_num::<u64>(self.ordinal(), offset);
25019 match self {
25020 VideoCompressedFormat::TempFieldTodoRemove(ref val) => {
25021 fidl::encoding::encode_in_envelope::<u32, D>(
25022 <u32 as fidl::encoding::ValueTypeMarker>::borrow(val),
25023 encoder,
25024 offset + 8,
25025 _depth,
25026 )
25027 }
25028 }
25029 }
25030 }
25031
25032 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for VideoCompressedFormat {
25033 #[inline(always)]
25034 fn new_empty() -> Self {
25035 Self::TempFieldTodoRemove(fidl::new_empty!(u32, D))
25036 }
25037
25038 #[inline]
25039 unsafe fn decode(
25040 &mut self,
25041 decoder: &mut fidl::encoding::Decoder<'_, D>,
25042 offset: usize,
25043 mut depth: fidl::encoding::Depth,
25044 ) -> fidl::Result<()> {
25045 decoder.debug_check_bounds::<Self>(offset);
25046 #[allow(unused_variables)]
25047 let next_out_of_line = decoder.next_out_of_line();
25048 let handles_before = decoder.remaining_handles();
25049 let (ordinal, inlined, num_bytes, num_handles) =
25050 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
25051
25052 let member_inline_size = match ordinal {
25053 1 => <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
25054 _ => return Err(fidl::Error::UnknownUnionTag),
25055 };
25056
25057 if inlined != (member_inline_size <= 4) {
25058 return Err(fidl::Error::InvalidInlineBitInEnvelope);
25059 }
25060 let _inner_offset;
25061 if inlined {
25062 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
25063 _inner_offset = offset + 8;
25064 } else {
25065 depth.increment()?;
25066 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
25067 }
25068 match ordinal {
25069 1 => {
25070 #[allow(irrefutable_let_patterns)]
25071 if let VideoCompressedFormat::TempFieldTodoRemove(_) = self {
25072 } else {
25074 *self =
25076 VideoCompressedFormat::TempFieldTodoRemove(fidl::new_empty!(u32, D));
25077 }
25078 #[allow(irrefutable_let_patterns)]
25079 if let VideoCompressedFormat::TempFieldTodoRemove(ref mut val) = self {
25080 fidl::decode!(u32, D, val, decoder, _inner_offset, depth)?;
25081 } else {
25082 unreachable!()
25083 }
25084 }
25085 ordinal => panic!("unexpected ordinal {:?}", ordinal),
25086 }
25087 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
25088 return Err(fidl::Error::InvalidNumBytesInEnvelope);
25089 }
25090 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
25091 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
25092 }
25093 Ok(())
25094 }
25095 }
25096
25097 impl fidl::encoding::ValueTypeMarker for VideoFormat {
25098 type Borrowed<'a> = &'a Self;
25099 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
25100 value
25101 }
25102 }
25103
25104 unsafe impl fidl::encoding::TypeMarker for VideoFormat {
25105 type Owned = Self;
25106
25107 #[inline(always)]
25108 fn inline_align(_context: fidl::encoding::Context) -> usize {
25109 8
25110 }
25111
25112 #[inline(always)]
25113 fn inline_size(_context: fidl::encoding::Context) -> usize {
25114 16
25115 }
25116 }
25117
25118 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<VideoFormat, D>
25119 for &VideoFormat
25120 {
25121 #[inline]
25122 unsafe fn encode(
25123 self,
25124 encoder: &mut fidl::encoding::Encoder<'_, D>,
25125 offset: usize,
25126 _depth: fidl::encoding::Depth,
25127 ) -> fidl::Result<()> {
25128 encoder.debug_check_bounds::<VideoFormat>(offset);
25129 encoder.write_num::<u64>(self.ordinal(), offset);
25130 match self {
25131 VideoFormat::Compressed(ref val) => {
25132 fidl::encoding::encode_in_envelope::<VideoCompressedFormat, D>(
25133 <VideoCompressedFormat as fidl::encoding::ValueTypeMarker>::borrow(val),
25134 encoder,
25135 offset + 8,
25136 _depth,
25137 )
25138 }
25139 VideoFormat::Uncompressed(ref val) => {
25140 fidl::encoding::encode_in_envelope::<VideoUncompressedFormat, D>(
25141 <VideoUncompressedFormat as fidl::encoding::ValueTypeMarker>::borrow(val),
25142 encoder,
25143 offset + 8,
25144 _depth,
25145 )
25146 }
25147 }
25148 }
25149 }
25150
25151 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for VideoFormat {
25152 #[inline(always)]
25153 fn new_empty() -> Self {
25154 Self::Compressed(fidl::new_empty!(VideoCompressedFormat, D))
25155 }
25156
25157 #[inline]
25158 unsafe fn decode(
25159 &mut self,
25160 decoder: &mut fidl::encoding::Decoder<'_, D>,
25161 offset: usize,
25162 mut depth: fidl::encoding::Depth,
25163 ) -> fidl::Result<()> {
25164 decoder.debug_check_bounds::<Self>(offset);
25165 #[allow(unused_variables)]
25166 let next_out_of_line = decoder.next_out_of_line();
25167 let handles_before = decoder.remaining_handles();
25168 let (ordinal, inlined, num_bytes, num_handles) =
25169 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
25170
25171 let member_inline_size = match ordinal {
25172 1 => <VideoCompressedFormat as fidl::encoding::TypeMarker>::inline_size(
25173 decoder.context,
25174 ),
25175 2 => <VideoUncompressedFormat as fidl::encoding::TypeMarker>::inline_size(
25176 decoder.context,
25177 ),
25178 _ => return Err(fidl::Error::UnknownUnionTag),
25179 };
25180
25181 if inlined != (member_inline_size <= 4) {
25182 return Err(fidl::Error::InvalidInlineBitInEnvelope);
25183 }
25184 let _inner_offset;
25185 if inlined {
25186 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
25187 _inner_offset = offset + 8;
25188 } else {
25189 depth.increment()?;
25190 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
25191 }
25192 match ordinal {
25193 1 => {
25194 #[allow(irrefutable_let_patterns)]
25195 if let VideoFormat::Compressed(_) = self {
25196 } else {
25198 *self = VideoFormat::Compressed(fidl::new_empty!(VideoCompressedFormat, D));
25200 }
25201 #[allow(irrefutable_let_patterns)]
25202 if let VideoFormat::Compressed(ref mut val) = self {
25203 fidl::decode!(
25204 VideoCompressedFormat,
25205 D,
25206 val,
25207 decoder,
25208 _inner_offset,
25209 depth
25210 )?;
25211 } else {
25212 unreachable!()
25213 }
25214 }
25215 2 => {
25216 #[allow(irrefutable_let_patterns)]
25217 if let VideoFormat::Uncompressed(_) = self {
25218 } else {
25220 *self =
25222 VideoFormat::Uncompressed(fidl::new_empty!(VideoUncompressedFormat, D));
25223 }
25224 #[allow(irrefutable_let_patterns)]
25225 if let VideoFormat::Uncompressed(ref mut val) = self {
25226 fidl::decode!(
25227 VideoUncompressedFormat,
25228 D,
25229 val,
25230 decoder,
25231 _inner_offset,
25232 depth
25233 )?;
25234 } else {
25235 unreachable!()
25236 }
25237 }
25238 ordinal => panic!("unexpected ordinal {:?}", ordinal),
25239 }
25240 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
25241 return Err(fidl::Error::InvalidNumBytesInEnvelope);
25242 }
25243 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
25244 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
25245 }
25246 Ok(())
25247 }
25248 }
25249}