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 BEHAVIOR_COUNT: u8 = 3;
50
51pub const CAPTURE_USAGE2_COUNT: u8 = 4;
52
53pub const CAPTURE_USAGE_COUNT: u8 = 4;
54
55pub const ENCRYPTION_SCHEME_CBC1: &str = "cbc1";
56
57pub const ENCRYPTION_SCHEME_CBCS: &str = "cbcs";
58
59pub const ENCRYPTION_SCHEME_CENC: &str = "cenc";
60
61pub const ENCRYPTION_SCHEME_CENS: &str = "cens";
62
63pub const ENCRYPTION_SCHEME_UNENCRYPTED: &str = "unencrypted";
64
65pub const MAX_ENCRYPTION_SCHEME_SIZE: u32 = 100;
66
67pub const MAX_FRAMES_PER_RENDERER_PACKET: i64 = 262143;
69
70pub const MAX_INIT_VECTOR_SIZE: u32 = 16;
71
72pub const MAX_KEY_ID_SIZE: u32 = 16;
73
74pub const MAX_PCM_CHANNEL_COUNT: u32 = 8;
75
76pub const MAX_PCM_FRAMES_PER_SECOND: u32 = 192000;
77
78pub const MAX_USAGE_COUNT: u8 = 8;
82
83pub const METADATA_LABEL_ALBUM: &str = "fuchsia.media.album";
84
85pub const METADATA_LABEL_ARTIST: &str = "fuchsia.media.artist";
86
87pub const METADATA_LABEL_COMPOSER: &str = "fuchsia.media.composer";
88
89pub const METADATA_LABEL_EPISODE: &str = "fuchsia.media.episode";
90
91pub const METADATA_LABEL_GENRE: &str = "fuchsia.media.genre";
92
93pub const METADATA_LABEL_PUBLISHER: &str = "fuchsia.media.publisher";
94
95pub const METADATA_LABEL_RELEASE_DATE: &str = "fuchsia.media.release_date";
96
97pub const METADATA_LABEL_SEASON: &str = "fuchsia.media.season";
98
99pub const METADATA_LABEL_STUDIO: &str = "fuchsia.media.studio";
100
101pub const METADATA_LABEL_SUBTITLE: &str = "fuchsia.media.subtitle";
102
103pub const METADATA_LABEL_TITLE: &str = "fuchsia.media.title";
104
105pub const METADATA_LABEL_TRACK_NUMBER: &str = "fuchsia.media.track_number";
106
107pub const METADATA_SOURCE_TITLE: &str = "fuchsia.media.source_title";
110
111pub const MIN_PCM_CHANNEL_COUNT: u32 = 1;
113
114pub const MIN_PCM_FRAMES_PER_SECOND: u32 = 1000;
115
116pub const NO_TIMESTAMP: i64 = 9223372036854775807;
120
121pub const RENDER_USAGE2_COUNT: u8 = 6;
122
123pub const RENDER_USAGE_COUNT: u8 = 5;
124
125pub const STREAM_PACKET_FLAG_DISCONTINUITY: u32 = 4;
129
130pub const STREAM_PACKET_FLAG_DROPPABLE: u32 = 2;
135
136pub const STREAM_PACKET_FLAG_KEY_FRAME: u32 = 1;
140
141pub const VIDEO_ENCODING_H263: &str = "fuchsia.media.h263";
143
144pub const VIDEO_ENCODING_H264: &str = "fuchsia.media.h264";
145
146pub const VIDEO_ENCODING_MPEG4: &str = "fuchsia.media.mpeg4";
147
148pub const VIDEO_ENCODING_THEORA: &str = "fuchsia.media.theora";
149
150pub const VIDEO_ENCODING_UNCOMPRESSED: &str = "fuchsia.media.uncompressed_video";
151
152pub const VIDEO_ENCODING_VP3: &str = "fuchsia.media.vp3";
153
154pub const VIDEO_ENCODING_VP8: &str = "fuchsia.media.vp8";
155
156pub const VIDEO_ENCODING_VP9: &str = "fuchsia.media.vp9";
157
158pub const MAX_OOB_BYTES_SIZE: u64 = 8192;
159
160bitflags! {
161 #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
163 pub struct AudioConsumerStartFlags: u32 {
164 const LOW_LATENCY = 1;
166 const SUPPLY_DRIVEN = 2;
171 }
172}
173
174impl AudioConsumerStartFlags {}
175
176bitflags! {
177 #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
178 pub struct AudioGainInfoFlags: u32 {
179 const MUTE = 1;
180 const AGC_SUPPORTED = 2;
181 const AGC_ENABLED = 4;
182 }
183}
184
185impl AudioGainInfoFlags {}
186
187bitflags! {
188 #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
189 pub struct AudioGainValidFlags: u32 {
190 const GAIN_VALID = 1;
191 const MUTE_VALID = 2;
192 const AGC_VALID = 4;
193 }
194}
195
196impl AudioGainValidFlags {}
197
198#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
199#[repr(u32)]
200pub enum AacAudioObjectType {
201 Mpeg2AacLc = 0,
203 Mpeg4AacLc = 1,
205}
206
207impl AacAudioObjectType {
208 #[inline]
209 pub fn from_primitive(prim: u32) -> Option<Self> {
210 match prim {
211 0 => Some(Self::Mpeg2AacLc),
212 1 => Some(Self::Mpeg4AacLc),
213 _ => None,
214 }
215 }
216
217 #[inline]
218 pub const fn into_primitive(self) -> u32 {
219 self as u32
220 }
221}
222
223#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
224#[repr(u32)]
225pub enum AacChannelMode {
226 Mono = 0,
227 Stereo = 2,
228}
229
230impl AacChannelMode {
231 #[inline]
232 pub fn from_primitive(prim: u32) -> Option<Self> {
233 match prim {
234 0 => Some(Self::Mono),
235 2 => Some(Self::Stereo),
236 _ => None,
237 }
238 }
239
240 #[inline]
241 pub const fn into_primitive(self) -> u32 {
242 self as u32
243 }
244}
245
246#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
251#[repr(u32)]
252pub enum AacVariableBitRate {
253 V1 = 1,
254 V2 = 2,
255 V3 = 3,
256 V4 = 4,
257 V5 = 5,
258}
259
260impl AacVariableBitRate {
261 #[inline]
262 pub fn from_primitive(prim: u32) -> Option<Self> {
263 match prim {
264 1 => Some(Self::V1),
265 2 => Some(Self::V2),
266 3 => Some(Self::V3),
267 4 => Some(Self::V4),
268 5 => Some(Self::V5),
269 _ => None,
270 }
271 }
272
273 #[inline]
274 pub const fn into_primitive(self) -> u32 {
275 self as u32
276 }
277}
278
279#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
280#[repr(u32)]
281pub enum AudioBitrateMode {
282 Unspecified = 0,
283 Cbr = 1,
284 Vbr = 2,
285}
286
287impl AudioBitrateMode {
288 #[inline]
289 pub fn from_primitive(prim: u32) -> Option<Self> {
290 match prim {
291 0 => Some(Self::Unspecified),
292 1 => Some(Self::Cbr),
293 2 => Some(Self::Vbr),
294 _ => None,
295 }
296 }
297
298 #[inline]
299 pub const fn into_primitive(self) -> u32 {
300 self as u32
301 }
302}
303
304#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
308#[repr(u32)]
309pub enum AudioCaptureUsage {
310 Background = 0,
314 Foreground = 1,
319 SystemAgent = 2,
324 Communication = 3,
327}
328
329impl AudioCaptureUsage {
330 #[inline]
331 pub fn from_primitive(prim: u32) -> Option<Self> {
332 match prim {
333 0 => Some(Self::Background),
334 1 => Some(Self::Foreground),
335 2 => Some(Self::SystemAgent),
336 3 => Some(Self::Communication),
337 _ => None,
338 }
339 }
340
341 #[inline]
342 pub const fn into_primitive(self) -> u32 {
343 self as u32
344 }
345}
346
347#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
351pub enum AudioCaptureUsage2 {
352 Background,
356 Foreground,
360 SystemAgent,
364 Communication,
367 #[doc(hidden)]
368 __SourceBreaking { unknown_ordinal: u32 },
369}
370
371#[macro_export]
373macro_rules! AudioCaptureUsage2Unknown {
374 () => {
375 _
376 };
377}
378
379impl AudioCaptureUsage2 {
380 #[inline]
381 pub fn from_primitive(prim: u32) -> Option<Self> {
382 match prim {
383 0 => Some(Self::Background),
384 1 => Some(Self::Foreground),
385 2 => Some(Self::SystemAgent),
386 3 => Some(Self::Communication),
387 _ => None,
388 }
389 }
390
391 #[inline]
392 pub fn from_primitive_allow_unknown(prim: u32) -> Self {
393 match prim {
394 0 => Self::Background,
395 1 => Self::Foreground,
396 2 => Self::SystemAgent,
397 3 => Self::Communication,
398 unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
399 }
400 }
401
402 #[inline]
403 pub fn unknown() -> Self {
404 Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
405 }
406
407 #[inline]
408 pub const fn into_primitive(self) -> u32 {
409 match self {
410 Self::Background => 0,
411 Self::Foreground => 1,
412 Self::SystemAgent => 2,
413 Self::Communication => 3,
414 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
415 }
416 }
417
418 #[inline]
419 pub fn is_unknown(&self) -> bool {
420 match self {
421 Self::__SourceBreaking { unknown_ordinal: _ } => true,
422 _ => false,
423 }
424 }
425}
426
427#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
433#[repr(u32)]
434pub enum AudioChannelId {
435 Skip = 0,
436 Lf = 1,
437 Rf = 2,
438 Cf = 3,
439 Ls = 4,
440 Rs = 5,
441 Lfe = 6,
442 Cs = 7,
443 Lr = 8,
444 Rr = 9,
445 EndDefined = 10,
446 ExtendedChannelIdBase = 1862270976,
447 Max = 2147483647,
448}
449
450impl AudioChannelId {
451 #[inline]
452 pub fn from_primitive(prim: u32) -> Option<Self> {
453 match prim {
454 0 => Some(Self::Skip),
455 1 => Some(Self::Lf),
456 2 => Some(Self::Rf),
457 3 => Some(Self::Cf),
458 4 => Some(Self::Ls),
459 5 => Some(Self::Rs),
460 6 => Some(Self::Lfe),
461 7 => Some(Self::Cs),
462 8 => Some(Self::Lr),
463 9 => Some(Self::Rr),
464 10 => Some(Self::EndDefined),
465 1862270976 => Some(Self::ExtendedChannelIdBase),
466 2147483647 => Some(Self::Max),
467 _ => None,
468 }
469 }
470
471 #[inline]
472 pub const fn into_primitive(self) -> u32 {
473 self as u32
474 }
475}
476
477#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
478#[repr(u32)]
479pub enum AudioOutputRoutingPolicy {
480 AllPluggedOutputs = 0,
481 LastPluggedOutput = 1,
482}
483
484impl AudioOutputRoutingPolicy {
485 #[inline]
486 pub fn from_primitive(prim: u32) -> Option<Self> {
487 match prim {
488 0 => Some(Self::AllPluggedOutputs),
489 1 => Some(Self::LastPluggedOutput),
490 _ => None,
491 }
492 }
493
494 #[inline]
495 pub const fn into_primitive(self) -> u32 {
496 self as u32
497 }
498}
499
500#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
501#[repr(u32)]
502pub enum AudioPcmMode {
503 Linear = 0,
504 Alaw = 1,
505 Mulaw = 2,
506}
507
508impl AudioPcmMode {
509 #[inline]
510 pub fn from_primitive(prim: u32) -> Option<Self> {
511 match prim {
512 0 => Some(Self::Linear),
513 1 => Some(Self::Alaw),
514 2 => Some(Self::Mulaw),
515 _ => None,
516 }
517 }
518
519 #[inline]
520 pub const fn into_primitive(self) -> u32 {
521 self as u32
522 }
523}
524
525#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
530#[repr(u32)]
531pub enum AudioRenderUsage {
532 Background = 0,
535 Media = 1,
538 Interruption = 2,
542 SystemAgent = 3,
545 Communication = 4,
548}
549
550impl AudioRenderUsage {
551 #[inline]
552 pub fn from_primitive(prim: u32) -> Option<Self> {
553 match prim {
554 0 => Some(Self::Background),
555 1 => Some(Self::Media),
556 2 => Some(Self::Interruption),
557 3 => Some(Self::SystemAgent),
558 4 => Some(Self::Communication),
559 _ => None,
560 }
561 }
562
563 #[inline]
564 pub const fn into_primitive(self) -> u32 {
565 self as u32
566 }
567}
568
569#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
574pub enum AudioRenderUsage2 {
575 Background,
578 Media,
581 Interruption,
585 SystemAgent,
588 Communication,
591 Accessibility,
594 #[doc(hidden)]
595 __SourceBreaking { unknown_ordinal: u32 },
596}
597
598#[macro_export]
600macro_rules! AudioRenderUsage2Unknown {
601 () => {
602 _
603 };
604}
605
606impl AudioRenderUsage2 {
607 #[inline]
608 pub fn from_primitive(prim: u32) -> Option<Self> {
609 match prim {
610 0 => Some(Self::Background),
611 1 => Some(Self::Media),
612 2 => Some(Self::Interruption),
613 3 => Some(Self::SystemAgent),
614 4 => Some(Self::Communication),
615 5 => Some(Self::Accessibility),
616 _ => None,
617 }
618 }
619
620 #[inline]
621 pub fn from_primitive_allow_unknown(prim: u32) -> Self {
622 match prim {
623 0 => Self::Background,
624 1 => Self::Media,
625 2 => Self::Interruption,
626 3 => Self::SystemAgent,
627 4 => Self::Communication,
628 5 => Self::Accessibility,
629 unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
630 }
631 }
632
633 #[inline]
634 pub fn unknown() -> Self {
635 Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
636 }
637
638 #[inline]
639 pub const fn into_primitive(self) -> u32 {
640 match self {
641 Self::Background => 0,
642 Self::Media => 1,
643 Self::Interruption => 2,
644 Self::SystemAgent => 3,
645 Self::Communication => 4,
646 Self::Accessibility => 5,
647 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
648 }
649 }
650
651 #[inline]
652 pub fn is_unknown(&self) -> bool {
653 match self {
654 Self::__SourceBreaking { unknown_ordinal: _ } => true,
655 _ => false,
656 }
657 }
658}
659
660#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
662#[repr(u32)]
663pub enum AudioSampleFormat {
664 Unsigned8 = 1,
666 Signed16 = 2,
668 Signed24In32 = 3,
670 Float = 4,
672}
673
674impl AudioSampleFormat {
675 #[inline]
676 pub fn from_primitive(prim: u32) -> Option<Self> {
677 match prim {
678 1 => Some(Self::Unsigned8),
679 2 => Some(Self::Signed16),
680 3 => Some(Self::Signed24In32),
681 4 => Some(Self::Float),
682 _ => None,
683 }
684 }
685
686 #[inline]
687 pub const fn into_primitive(self) -> u32 {
688 self as u32
689 }
690}
691
692#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
694pub enum Behavior {
695 None,
697 Duck,
699 Mute,
701 #[doc(hidden)]
702 __SourceBreaking { unknown_ordinal: u32 },
703}
704
705#[macro_export]
707macro_rules! BehaviorUnknown {
708 () => {
709 _
710 };
711}
712
713impl Behavior {
714 #[inline]
715 pub fn from_primitive(prim: u32) -> Option<Self> {
716 match prim {
717 0 => Some(Self::None),
718 1 => Some(Self::Duck),
719 2 => Some(Self::Mute),
720 _ => None,
721 }
722 }
723
724 #[inline]
725 pub fn from_primitive_allow_unknown(prim: u32) -> Self {
726 match prim {
727 0 => Self::None,
728 1 => Self::Duck,
729 2 => Self::Mute,
730 unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
731 }
732 }
733
734 #[inline]
735 pub fn unknown() -> Self {
736 Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
737 }
738
739 #[inline]
740 pub const fn into_primitive(self) -> u32 {
741 match self {
742 Self::None => 0,
743 Self::Duck => 1,
744 Self::Mute => 2,
745 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
746 }
747 }
748
749 #[inline]
750 pub fn is_unknown(&self) -> bool {
751 match self {
752 Self::__SourceBreaking { unknown_ordinal: _ } => true,
753 _ => false,
754 }
755 }
756}
757
758#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
761pub enum CodecProfile {
762 H264ProfileBaseline,
763 H264ProfileMain,
764 H264ProfileExtended,
765 H264ProfileHigh,
766 H264ProfileHigh10Profile,
767 H264ProfileHigh422Profile,
768 H264ProfileHigh444Predictiveprofile,
769 H264ProfileScalablebaseline,
770 H264ProfileScalablehigh,
771 H264ProfileStereohigh,
772 H264ProfileMultiviewhigh,
773 Vp8ProfileAny,
774 Vp9ProfileProfile0,
775 Vp9ProfileProfile1,
776 Vp9ProfileProfile2,
777 Vp9ProfileProfile3,
778 HevcprofileMain,
779 HevcprofileMain10,
780 HevcprofileMainStillPicture,
781 MjpegBaseline,
782 #[doc(hidden)]
783 __SourceBreaking {
784 unknown_ordinal: u32,
785 },
786}
787
788#[macro_export]
790macro_rules! CodecProfileUnknown {
791 () => {
792 _
793 };
794}
795
796impl CodecProfile {
797 #[inline]
798 pub fn from_primitive(prim: u32) -> Option<Self> {
799 match prim {
800 0 => Some(Self::H264ProfileBaseline),
801 1 => Some(Self::H264ProfileMain),
802 2 => Some(Self::H264ProfileExtended),
803 3 => Some(Self::H264ProfileHigh),
804 4 => Some(Self::H264ProfileHigh10Profile),
805 5 => Some(Self::H264ProfileHigh422Profile),
806 6 => Some(Self::H264ProfileHigh444Predictiveprofile),
807 7 => Some(Self::H264ProfileScalablebaseline),
808 8 => Some(Self::H264ProfileScalablehigh),
809 9 => Some(Self::H264ProfileStereohigh),
810 10 => Some(Self::H264ProfileMultiviewhigh),
811 11 => Some(Self::Vp8ProfileAny),
812 12 => Some(Self::Vp9ProfileProfile0),
813 13 => Some(Self::Vp9ProfileProfile1),
814 14 => Some(Self::Vp9ProfileProfile2),
815 15 => Some(Self::Vp9ProfileProfile3),
816 16 => Some(Self::HevcprofileMain),
817 17 => Some(Self::HevcprofileMain10),
818 18 => Some(Self::HevcprofileMainStillPicture),
819 19 => Some(Self::MjpegBaseline),
820 _ => None,
821 }
822 }
823
824 #[inline]
825 pub fn from_primitive_allow_unknown(prim: u32) -> Self {
826 match prim {
827 0 => Self::H264ProfileBaseline,
828 1 => Self::H264ProfileMain,
829 2 => Self::H264ProfileExtended,
830 3 => Self::H264ProfileHigh,
831 4 => Self::H264ProfileHigh10Profile,
832 5 => Self::H264ProfileHigh422Profile,
833 6 => Self::H264ProfileHigh444Predictiveprofile,
834 7 => Self::H264ProfileScalablebaseline,
835 8 => Self::H264ProfileScalablehigh,
836 9 => Self::H264ProfileStereohigh,
837 10 => Self::H264ProfileMultiviewhigh,
838 11 => Self::Vp8ProfileAny,
839 12 => Self::Vp9ProfileProfile0,
840 13 => Self::Vp9ProfileProfile1,
841 14 => Self::Vp9ProfileProfile2,
842 15 => Self::Vp9ProfileProfile3,
843 16 => Self::HevcprofileMain,
844 17 => Self::HevcprofileMain10,
845 18 => Self::HevcprofileMainStillPicture,
846 19 => Self::MjpegBaseline,
847 unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
848 }
849 }
850
851 #[inline]
852 pub fn unknown() -> Self {
853 Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
854 }
855
856 #[inline]
857 pub const fn into_primitive(self) -> u32 {
858 match self {
859 Self::H264ProfileBaseline => 0,
860 Self::H264ProfileMain => 1,
861 Self::H264ProfileExtended => 2,
862 Self::H264ProfileHigh => 3,
863 Self::H264ProfileHigh10Profile => 4,
864 Self::H264ProfileHigh422Profile => 5,
865 Self::H264ProfileHigh444Predictiveprofile => 6,
866 Self::H264ProfileScalablebaseline => 7,
867 Self::H264ProfileScalablehigh => 8,
868 Self::H264ProfileStereohigh => 9,
869 Self::H264ProfileMultiviewhigh => 10,
870 Self::Vp8ProfileAny => 11,
871 Self::Vp9ProfileProfile0 => 12,
872 Self::Vp9ProfileProfile1 => 13,
873 Self::Vp9ProfileProfile2 => 14,
874 Self::Vp9ProfileProfile3 => 15,
875 Self::HevcprofileMain => 16,
876 Self::HevcprofileMain10 => 17,
877 Self::HevcprofileMainStillPicture => 18,
878 Self::MjpegBaseline => 19,
879 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
880 }
881 }
882
883 #[inline]
884 pub fn is_unknown(&self) -> bool {
885 match self {
886 Self::__SourceBreaking { unknown_ordinal: _ } => true,
887 _ => false,
888 }
889 }
890}
891
892#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
893#[repr(u32)]
894pub enum ColorSpace {
895 Unknown = 0,
896 NotApplicable = 1,
897 Jpeg = 2,
898 HdRec709 = 3,
899 SdRec601 = 4,
900}
901
902impl ColorSpace {
903 #[inline]
904 pub fn from_primitive(prim: u32) -> Option<Self> {
905 match prim {
906 0 => Some(Self::Unknown),
907 1 => Some(Self::NotApplicable),
908 2 => Some(Self::Jpeg),
909 3 => Some(Self::HdRec709),
910 4 => Some(Self::SdRec601),
911 _ => None,
912 }
913 }
914
915 #[inline]
916 pub const fn into_primitive(self) -> u32 {
917 self as u32
918 }
919}
920
921#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
922pub enum Lc3FrameDuration {
923 D10Ms,
924 D7P5Ms,
925 #[doc(hidden)]
926 __SourceBreaking {
927 unknown_ordinal: u32,
928 },
929}
930
931#[macro_export]
933macro_rules! Lc3FrameDurationUnknown {
934 () => {
935 _
936 };
937}
938
939impl Lc3FrameDuration {
940 #[inline]
941 pub fn from_primitive(prim: u32) -> Option<Self> {
942 match prim {
943 1 => Some(Self::D10Ms),
944 2 => Some(Self::D7P5Ms),
945 _ => None,
946 }
947 }
948
949 #[inline]
950 pub fn from_primitive_allow_unknown(prim: u32) -> Self {
951 match prim {
952 1 => Self::D10Ms,
953 2 => Self::D7P5Ms,
954 unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
955 }
956 }
957
958 #[inline]
959 pub fn unknown() -> Self {
960 Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
961 }
962
963 #[inline]
964 pub const fn into_primitive(self) -> u32 {
965 match self {
966 Self::D10Ms => 1,
967 Self::D7P5Ms => 2,
968 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
969 }
970 }
971
972 #[inline]
973 pub fn is_unknown(&self) -> bool {
974 match self {
975 Self::__SourceBreaking { unknown_ordinal: _ } => true,
976 _ => false,
977 }
978 }
979}
980
981#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
986pub enum Port {
987 Invalid,
988 Input,
989 Output,
990 #[doc(hidden)]
991 __SourceBreaking {
992 unknown_ordinal: u32,
993 },
994}
995
996#[macro_export]
998macro_rules! PortUnknown {
999 () => {
1000 _
1001 };
1002}
1003
1004impl Port {
1005 #[inline]
1006 pub fn from_primitive(prim: u32) -> Option<Self> {
1007 match prim {
1008 0 => Some(Self::Invalid),
1009 1 => Some(Self::Input),
1010 2 => Some(Self::Output),
1011 _ => None,
1012 }
1013 }
1014
1015 #[inline]
1016 pub fn from_primitive_allow_unknown(prim: u32) -> Self {
1017 match prim {
1018 0 => Self::Invalid,
1019 1 => Self::Input,
1020 2 => Self::Output,
1021 unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
1022 }
1023 }
1024
1025 #[inline]
1026 pub fn unknown() -> Self {
1027 Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
1028 }
1029
1030 #[inline]
1031 pub const fn into_primitive(self) -> u32 {
1032 match self {
1033 Self::Invalid => 0,
1034 Self::Input => 1,
1035 Self::Output => 2,
1036 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
1037 }
1038 }
1039
1040 #[inline]
1041 pub fn is_unknown(&self) -> bool {
1042 match self {
1043 Self::__SourceBreaking { unknown_ordinal: _ } => true,
1044 _ => false,
1045 }
1046 }
1047}
1048
1049#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
1050#[repr(u32)]
1051pub enum SbcAllocation {
1052 AllocLoudness = 0,
1053 AllocSnr = 1,
1054}
1055
1056impl SbcAllocation {
1057 #[inline]
1058 pub fn from_primitive(prim: u32) -> Option<Self> {
1059 match prim {
1060 0 => Some(Self::AllocLoudness),
1061 1 => Some(Self::AllocSnr),
1062 _ => None,
1063 }
1064 }
1065
1066 #[inline]
1067 pub const fn into_primitive(self) -> u32 {
1068 self as u32
1069 }
1070}
1071
1072#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
1073#[repr(u32)]
1074pub enum SbcBlockCount {
1075 BlockCount4 = 4,
1076 BlockCount8 = 8,
1077 BlockCount12 = 12,
1078 BlockCount16 = 16,
1079}
1080
1081impl SbcBlockCount {
1082 #[inline]
1083 pub fn from_primitive(prim: u32) -> Option<Self> {
1084 match prim {
1085 4 => Some(Self::BlockCount4),
1086 8 => Some(Self::BlockCount8),
1087 12 => Some(Self::BlockCount12),
1088 16 => Some(Self::BlockCount16),
1089 _ => None,
1090 }
1091 }
1092
1093 #[inline]
1094 pub const fn into_primitive(self) -> u32 {
1095 self as u32
1096 }
1097}
1098
1099#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
1100#[repr(u32)]
1101pub enum SbcChannelMode {
1102 Mono = 0,
1103 Dual = 1,
1104 Stereo = 2,
1105 JointStereo = 3,
1106}
1107
1108impl SbcChannelMode {
1109 #[inline]
1110 pub fn from_primitive(prim: u32) -> Option<Self> {
1111 match prim {
1112 0 => Some(Self::Mono),
1113 1 => Some(Self::Dual),
1114 2 => Some(Self::Stereo),
1115 3 => Some(Self::JointStereo),
1116 _ => None,
1117 }
1118 }
1119
1120 #[inline]
1121 pub const fn into_primitive(self) -> u32 {
1122 self as u32
1123 }
1124}
1125
1126#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
1127#[repr(u32)]
1128pub enum SbcSubBands {
1129 SubBands4 = 4,
1130 SubBands8 = 8,
1131}
1132
1133impl SbcSubBands {
1134 #[inline]
1135 pub fn from_primitive(prim: u32) -> Option<Self> {
1136 match prim {
1137 4 => Some(Self::SubBands4),
1138 8 => Some(Self::SubBands8),
1139 _ => None,
1140 }
1141 }
1142
1143 #[inline]
1144 pub const fn into_primitive(self) -> u32 {
1145 self as u32
1146 }
1147}
1148
1149#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
1155#[repr(u32)]
1156pub enum StreamError {
1157 Unknown = 1,
1159 InvalidInputFormatDetails = 2,
1161 IncompatibleBuffersProvided = 3,
1165 EosProcessing = 4,
1169 DecoderUnknown = 16777217,
1171 DecoderDataParsing = 16777218,
1175 EncoderUnknown = 33554433,
1177 DecryptorUnknown = 50331649,
1179 DecryptorNoKey = 50331650,
1182}
1183
1184impl StreamError {
1185 #[inline]
1186 pub fn from_primitive(prim: u32) -> Option<Self> {
1187 match prim {
1188 1 => Some(Self::Unknown),
1189 2 => Some(Self::InvalidInputFormatDetails),
1190 3 => Some(Self::IncompatibleBuffersProvided),
1191 4 => Some(Self::EosProcessing),
1192 16777217 => Some(Self::DecoderUnknown),
1193 16777218 => Some(Self::DecoderDataParsing),
1194 33554433 => Some(Self::EncoderUnknown),
1195 50331649 => Some(Self::DecryptorUnknown),
1196 50331650 => Some(Self::DecryptorNoKey),
1197 _ => None,
1198 }
1199 }
1200
1201 #[inline]
1202 pub const fn into_primitive(self) -> u32 {
1203 self as u32
1204 }
1205}
1206
1207#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
1208#[repr(u32)]
1209pub enum VideoColorSpace {
1210 Invalid = 0,
1211}
1212
1213impl VideoColorSpace {
1214 #[inline]
1215 pub fn from_primitive(prim: u32) -> Option<Self> {
1216 match prim {
1217 0 => Some(Self::Invalid),
1218 _ => None,
1219 }
1220 }
1221
1222 #[inline]
1223 pub const fn into_primitive(self) -> u32 {
1224 self as u32
1225 }
1226}
1227
1228#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1229#[repr(C)]
1230pub struct AacConstantBitRate {
1231 pub bit_rate: u32,
1233}
1234
1235impl fidl::Persistable for AacConstantBitRate {}
1236
1237#[derive(Clone, Debug, PartialEq)]
1238pub struct AacEncoderSettings {
1239 pub transport: AacTransport,
1240 pub channel_mode: AacChannelMode,
1241 pub bit_rate: AacBitRate,
1242 pub aot: AacAudioObjectType,
1243}
1244
1245impl fidl::Persistable for AacEncoderSettings {}
1246
1247#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1249pub struct AacTransportAdts;
1250
1251impl fidl::Persistable for AacTransportAdts {}
1252
1253#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1255pub struct AacTransportLatm {
1256 pub mux_config_present: bool,
1258}
1259
1260impl fidl::Persistable for AacTransportLatm {}
1261
1262#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1264pub struct AacTransportRaw;
1265
1266impl fidl::Persistable for AacTransportRaw {}
1267
1268#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1269pub struct ActivityReporterWatchCaptureActivityResponse {
1270 pub active_usages: Vec<AudioCaptureUsage>,
1271}
1272
1273impl fidl::Persistable for ActivityReporterWatchCaptureActivityResponse {}
1274
1275#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1276pub struct ActivityReporterWatchRenderActivityResponse {
1277 pub active_usages: Vec<AudioRenderUsage>,
1278}
1279
1280impl fidl::Persistable for ActivityReporterWatchRenderActivityResponse {}
1281
1282#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1283pub struct ActivityReporterWatchCaptureActivity2Response {
1284 pub active_usages: Vec<AudioCaptureUsage2>,
1285}
1286
1287impl fidl::Persistable for ActivityReporterWatchCaptureActivity2Response {}
1288
1289#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1290pub struct ActivityReporterWatchRenderActivity2Response {
1291 pub active_usages: Vec<AudioRenderUsage2>,
1292}
1293
1294impl fidl::Persistable for ActivityReporterWatchRenderActivity2Response {}
1295
1296#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1297#[repr(C)]
1298pub struct AudioCapturerCaptureAtRequest {
1299 pub payload_buffer_id: u32,
1300 pub payload_offset: u32,
1301 pub frames: u32,
1302}
1303
1304impl fidl::Persistable for AudioCapturerCaptureAtRequest {}
1305
1306#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1307#[repr(C)]
1308pub struct AudioCapturerCaptureAtResponse {
1309 pub captured_packet: StreamPacket,
1310}
1311
1312impl fidl::Persistable for AudioCapturerCaptureAtResponse {}
1313
1314#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1315pub struct AudioCapturerGetStreamTypeResponse {
1316 pub stream_type: StreamType,
1317}
1318
1319impl fidl::Persistable for AudioCapturerGetStreamTypeResponse {}
1320
1321#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1322pub struct AudioCapturerSetPcmStreamTypeRequest {
1323 pub stream_type: AudioStreamType,
1324}
1325
1326impl fidl::Persistable for AudioCapturerSetPcmStreamTypeRequest {}
1327
1328#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1329pub struct AudioCapturerSetUsage2Request {
1330 pub usage: AudioCaptureUsage2,
1331}
1332
1333impl fidl::Persistable for AudioCapturerSetUsage2Request {}
1334
1335#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1336pub struct AudioCapturerSetUsageRequest {
1337 pub usage: AudioCaptureUsage,
1338}
1339
1340impl fidl::Persistable for AudioCapturerSetUsageRequest {}
1341
1342#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1343#[repr(C)]
1344pub struct AudioCapturerStartAsyncCaptureRequest {
1345 pub frames_per_packet: u32,
1346}
1347
1348impl fidl::Persistable for AudioCapturerStartAsyncCaptureRequest {}
1349
1350#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1351pub struct AudioCompressedFormatAac;
1352
1353impl fidl::Persistable for AudioCompressedFormatAac {}
1354
1355#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1356pub struct AudioCompressedFormatSbc;
1357
1358impl fidl::Persistable for AudioCompressedFormatSbc {}
1359
1360#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1361pub struct AudioConsumerSetRateRequest {
1362 pub rate: f32,
1363}
1364
1365impl fidl::Persistable for AudioConsumerSetRateRequest {}
1366
1367#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1368pub struct AudioConsumerStartRequest {
1369 pub flags: AudioConsumerStartFlags,
1370 pub reference_time: i64,
1371 pub media_time: i64,
1372}
1373
1374impl fidl::Persistable for AudioConsumerStartRequest {}
1375
1376#[derive(Clone, Debug, PartialEq)]
1377pub struct AudioConsumerWatchStatusResponse {
1378 pub status: AudioConsumerStatus,
1379}
1380
1381impl fidl::Persistable for AudioConsumerWatchStatusResponse {}
1382
1383#[derive(Clone, Debug, PartialEq)]
1384pub struct AudioCoreGetDbFromVolume2Request {
1385 pub usage: Usage2,
1386 pub volume: f32,
1387}
1388
1389impl fidl::Persistable for AudioCoreGetDbFromVolume2Request {}
1390
1391#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1392pub struct AudioCoreGetDbFromVolumeRequest {
1393 pub usage: Usage,
1394 pub volume: f32,
1395}
1396
1397impl fidl::Persistable for AudioCoreGetDbFromVolumeRequest {}
1398
1399#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1400pub struct AudioCoreGetDbFromVolumeResponse {
1401 pub gain_db: f32,
1402}
1403
1404impl fidl::Persistable for AudioCoreGetDbFromVolumeResponse {}
1405
1406#[derive(Clone, Debug, PartialEq)]
1407pub struct AudioCoreGetVolumeFromDb2Request {
1408 pub usage: Usage2,
1409 pub gain_db: f32,
1410}
1411
1412impl fidl::Persistable for AudioCoreGetVolumeFromDb2Request {}
1413
1414#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1415pub struct AudioCoreGetVolumeFromDbRequest {
1416 pub usage: Usage,
1417 pub gain_db: f32,
1418}
1419
1420impl fidl::Persistable for AudioCoreGetVolumeFromDbRequest {}
1421
1422#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1423pub struct AudioCoreGetVolumeFromDbResponse {
1424 pub volume: f32,
1425}
1426
1427impl fidl::Persistable for AudioCoreGetVolumeFromDbResponse {}
1428
1429#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1430pub struct AudioCoreSetCaptureUsageGain2Request {
1431 pub usage: AudioCaptureUsage2,
1432 pub gain_db: f32,
1433}
1434
1435impl fidl::Persistable for AudioCoreSetCaptureUsageGain2Request {}
1436
1437#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1438pub struct AudioCoreSetCaptureUsageGainRequest {
1439 pub usage: AudioCaptureUsage,
1440 pub gain_db: f32,
1441}
1442
1443impl fidl::Persistable for AudioCoreSetCaptureUsageGainRequest {}
1444
1445#[derive(Clone, Debug, PartialEq)]
1446pub struct AudioCoreSetInteraction2Request {
1447 pub active: Usage2,
1448 pub affected: Usage2,
1449 pub behavior: Behavior,
1450}
1451
1452impl fidl::Persistable for AudioCoreSetInteraction2Request {}
1453
1454#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1455pub struct AudioCoreSetInteractionRequest {
1456 pub active: Usage,
1457 pub affected: Usage,
1458 pub behavior: Behavior,
1459}
1460
1461impl fidl::Persistable for AudioCoreSetInteractionRequest {}
1462
1463#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1464pub struct AudioCoreSetRenderUsageGain2Request {
1465 pub usage: AudioRenderUsage2,
1466 pub gain_db: f32,
1467}
1468
1469impl fidl::Persistable for AudioCoreSetRenderUsageGain2Request {}
1470
1471#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1472pub struct AudioCoreSetRenderUsageGainRequest {
1473 pub usage: AudioRenderUsage,
1474 pub gain_db: f32,
1475}
1476
1477impl fidl::Persistable for AudioCoreSetRenderUsageGainRequest {}
1478
1479#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1480pub struct AudioCoreGetDbFromVolume2Response {
1481 pub gain_db: f32,
1482}
1483
1484impl fidl::Persistable for AudioCoreGetDbFromVolume2Response {}
1485
1486#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1487pub struct AudioCoreGetVolumeFromDb2Response {
1488 pub volume: f32,
1489}
1490
1491impl fidl::Persistable for AudioCoreGetVolumeFromDb2Response {}
1492
1493#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1494#[repr(C)]
1495pub struct AudioDeviceEnumeratorGetDeviceGainRequest {
1496 pub device_token: u64,
1497}
1498
1499impl fidl::Persistable for AudioDeviceEnumeratorGetDeviceGainRequest {}
1500
1501#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1502pub struct AudioDeviceEnumeratorGetDeviceGainResponse {
1503 pub device_token: u64,
1504 pub gain_info: AudioGainInfo,
1505}
1506
1507impl fidl::Persistable for AudioDeviceEnumeratorGetDeviceGainResponse {}
1508
1509#[derive(Clone, Debug, PartialEq, PartialOrd)]
1510pub struct AudioDeviceEnumeratorGetDevicesResponse {
1511 pub devices: Vec<AudioDeviceInfo>,
1512}
1513
1514impl fidl::Persistable for AudioDeviceEnumeratorGetDevicesResponse {}
1515
1516#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1517#[repr(C)]
1518pub struct AudioDeviceEnumeratorOnDefaultDeviceChangedRequest {
1519 pub old_default_token: u64,
1520 pub new_default_token: u64,
1521}
1522
1523impl fidl::Persistable for AudioDeviceEnumeratorOnDefaultDeviceChangedRequest {}
1524
1525#[derive(Clone, Debug, PartialEq, PartialOrd)]
1526pub struct AudioDeviceEnumeratorOnDeviceAddedRequest {
1527 pub device: AudioDeviceInfo,
1528}
1529
1530impl fidl::Persistable for AudioDeviceEnumeratorOnDeviceAddedRequest {}
1531
1532#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1533pub struct AudioDeviceEnumeratorOnDeviceGainChangedRequest {
1534 pub device_token: u64,
1535 pub gain_info: AudioGainInfo,
1536}
1537
1538impl fidl::Persistable for AudioDeviceEnumeratorOnDeviceGainChangedRequest {}
1539
1540#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1541#[repr(C)]
1542pub struct AudioDeviceEnumeratorOnDeviceRemovedRequest {
1543 pub device_token: u64,
1544}
1545
1546impl fidl::Persistable for AudioDeviceEnumeratorOnDeviceRemovedRequest {}
1547
1548#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1549pub struct AudioDeviceEnumeratorSetDeviceGainRequest {
1550 pub device_token: u64,
1551 pub gain_info: AudioGainInfo,
1552 pub valid_flags: AudioGainValidFlags,
1553}
1554
1555impl fidl::Persistable for AudioDeviceEnumeratorSetDeviceGainRequest {}
1556
1557#[derive(Clone, Debug, PartialEq, PartialOrd)]
1558pub struct AudioDeviceInfo {
1559 pub name: String,
1560 pub unique_id: String,
1561 pub token_id: u64,
1562 pub is_input: bool,
1563 pub gain_info: AudioGainInfo,
1564 pub is_default: bool,
1565}
1566
1567impl fidl::Persistable for AudioDeviceInfo {}
1568
1569#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1570pub struct AudioGainInfo {
1571 pub gain_db: f32,
1572 pub flags: AudioGainInfoFlags,
1573}
1574
1575impl fidl::Persistable for AudioGainInfo {}
1576
1577#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1578pub struct AudioRendererEnableMinLeadTimeEventsRequest {
1579 pub enabled: bool,
1580}
1581
1582impl fidl::Persistable for AudioRendererEnableMinLeadTimeEventsRequest {}
1583
1584#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1585#[repr(C)]
1586pub struct AudioRendererGetMinLeadTimeResponse {
1587 pub min_lead_time_nsec: i64,
1588}
1589
1590impl fidl::Persistable for AudioRendererGetMinLeadTimeResponse {}
1591
1592#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1593#[repr(C)]
1594pub struct AudioRendererOnMinLeadTimeChangedRequest {
1595 pub min_lead_time_nsec: i64,
1596}
1597
1598impl fidl::Persistable for AudioRendererOnMinLeadTimeChangedRequest {}
1599
1600#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1601#[repr(C)]
1602pub struct AudioRendererPauseResponse {
1603 pub reference_time: i64,
1604 pub media_time: i64,
1605}
1606
1607impl fidl::Persistable for AudioRendererPauseResponse {}
1608
1609#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1610#[repr(C)]
1611pub struct AudioRendererPlayNoReplyRequest {
1612 pub reference_time: i64,
1613 pub media_time: i64,
1614}
1615
1616impl fidl::Persistable for AudioRendererPlayNoReplyRequest {}
1617
1618#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1619#[repr(C)]
1620pub struct AudioRendererPlayRequest {
1621 pub reference_time: i64,
1622 pub media_time: i64,
1623}
1624
1625impl fidl::Persistable for AudioRendererPlayRequest {}
1626
1627#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1628#[repr(C)]
1629pub struct AudioRendererPlayResponse {
1630 pub reference_time: i64,
1631 pub media_time: i64,
1632}
1633
1634impl fidl::Persistable for AudioRendererPlayResponse {}
1635
1636#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1637pub struct AudioRendererSetPcmStreamTypeRequest {
1638 pub type_: AudioStreamType,
1639}
1640
1641impl fidl::Persistable for AudioRendererSetPcmStreamTypeRequest {}
1642
1643#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
1644pub struct AudioRendererSetPtsContinuityThresholdRequest {
1645 pub threshold_seconds: f32,
1646}
1647
1648impl fidl::Persistable for AudioRendererSetPtsContinuityThresholdRequest {}
1649
1650#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1651#[repr(C)]
1652pub struct AudioRendererSetPtsUnitsRequest {
1653 pub tick_per_second_numerator: u32,
1654 pub tick_per_second_denominator: u32,
1655}
1656
1657impl fidl::Persistable for AudioRendererSetPtsUnitsRequest {}
1658
1659#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1660pub struct AudioRendererSetUsage2Request {
1661 pub usage2: AudioRenderUsage2,
1662}
1663
1664impl fidl::Persistable for AudioRendererSetUsage2Request {}
1665
1666#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1667pub struct AudioRendererSetUsageRequest {
1668 pub usage: AudioRenderUsage,
1669}
1670
1671impl fidl::Persistable for AudioRendererSetUsageRequest {}
1672
1673#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1675pub struct AudioStreamType {
1676 pub sample_format: AudioSampleFormat,
1677 pub channels: u32,
1678 pub frames_per_second: u32,
1679}
1680
1681impl fidl::Persistable for AudioStreamType {}
1682
1683#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1686pub struct Compression {
1687 pub type_: String,
1691 pub parameters: Option<Vec<u8>>,
1693}
1694
1695impl fidl::Persistable for Compression {}
1696
1697#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1704#[repr(C)]
1705pub struct EncryptionPattern {
1706 pub clear_blocks: u32,
1707 pub encrypted_blocks: u32,
1708}
1709
1710impl fidl::Persistable for EncryptionPattern {}
1711
1712#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1713pub struct Metadata {
1714 pub properties: Vec<Property>,
1715}
1716
1717impl fidl::Persistable for Metadata {}
1718
1719#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1726pub struct Parameter {
1727 pub scope: String,
1728 pub name: String,
1729 pub value: Value,
1730}
1731
1732impl fidl::Persistable for Parameter {}
1733
1734#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1738pub struct PcmFormat {
1739 pub pcm_mode: AudioPcmMode,
1740 pub bits_per_sample: u32,
1741 pub frames_per_second: u32,
1742 pub channel_map: Vec<AudioChannelId>,
1743}
1744
1745impl fidl::Persistable for PcmFormat {}
1746
1747#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1748#[repr(C)]
1749pub struct ProfileProviderRegisterHandlerWithCapacityResponse {
1750 pub period: i64,
1751 pub capacity: i64,
1752}
1753
1754impl fidl::Persistable for ProfileProviderRegisterHandlerWithCapacityResponse {}
1755
1756#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1757pub struct Property {
1758 pub label: String,
1759 pub value: String,
1760}
1761
1762impl fidl::Persistable for Property {}
1763
1764#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1772pub struct SbcEncoderSettings {
1773 pub sub_bands: SbcSubBands,
1774 pub allocation: SbcAllocation,
1775 pub block_count: SbcBlockCount,
1776 pub channel_mode: SbcChannelMode,
1777 pub bit_pool: u64,
1779}
1780
1781impl fidl::Persistable for SbcEncoderSettings {}
1782
1783#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1784#[repr(C)]
1785pub struct StreamBufferSetRemovePayloadBufferRequest {
1786 pub id: u32,
1787}
1788
1789impl fidl::Persistable for StreamBufferSetRemovePayloadBufferRequest {}
1790
1791#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1793#[repr(C)]
1794pub struct StreamPacket {
1795 pub pts: i64,
1798 pub payload_buffer_id: u32,
1805 pub payload_offset: u64,
1810 pub payload_size: u64,
1815 pub flags: u32,
1818 pub buffer_config: u64,
1826 pub stream_segment_id: u64,
1832}
1833
1834impl fidl::Persistable for StreamPacket {}
1835
1836#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1837pub struct StreamProcessorCloseCurrentStreamRequest {
1838 pub stream_lifetime_ordinal: u64,
1839 pub release_input_buffers: bool,
1840 pub release_output_buffers: bool,
1841}
1842
1843impl fidl::Persistable for StreamProcessorCloseCurrentStreamRequest {}
1844
1845#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1846#[repr(C)]
1847pub struct StreamProcessorCompleteOutputBufferPartialSettingsRequest {
1848 pub buffer_lifetime_ordinal: u64,
1849}
1850
1851impl fidl::Persistable for StreamProcessorCompleteOutputBufferPartialSettingsRequest {}
1852
1853#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1854#[repr(C)]
1855pub struct StreamProcessorFlushEndOfStreamAndCloseStreamRequest {
1856 pub stream_lifetime_ordinal: u64,
1857}
1858
1859impl fidl::Persistable for StreamProcessorFlushEndOfStreamAndCloseStreamRequest {}
1860
1861#[derive(Clone, Debug, PartialEq)]
1862pub struct StreamProcessorOnFreeInputPacketRequest {
1863 pub free_input_packet: PacketHeader,
1864}
1865
1866impl fidl::Persistable for StreamProcessorOnFreeInputPacketRequest {}
1867
1868#[derive(Clone, Debug, PartialEq)]
1869pub struct StreamProcessorOnInputConstraintsRequest {
1870 pub input_constraints: StreamBufferConstraints,
1871}
1872
1873impl fidl::Persistable for StreamProcessorOnInputConstraintsRequest {}
1874
1875#[derive(Clone, Debug, PartialEq)]
1876pub struct StreamProcessorOnOutputConstraintsRequest {
1877 pub output_config: StreamOutputConstraints,
1878}
1879
1880impl fidl::Persistable for StreamProcessorOnOutputConstraintsRequest {}
1881
1882#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1883pub struct StreamProcessorOnOutputEndOfStreamRequest {
1884 pub stream_lifetime_ordinal: u64,
1885 pub error_detected_before: bool,
1886}
1887
1888impl fidl::Persistable for StreamProcessorOnOutputEndOfStreamRequest {}
1889
1890#[derive(Clone, Debug, PartialEq)]
1891pub struct StreamProcessorOnOutputFormatRequest {
1892 pub output_format: StreamOutputFormat,
1893}
1894
1895impl fidl::Persistable for StreamProcessorOnOutputFormatRequest {}
1896
1897#[derive(Clone, Debug, PartialEq)]
1898pub struct StreamProcessorOnOutputPacketRequest {
1899 pub output_packet: Packet,
1900 pub error_detected_before: bool,
1901 pub error_detected_during: bool,
1902}
1903
1904impl fidl::Persistable for StreamProcessorOnOutputPacketRequest {}
1905
1906#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1907pub struct StreamProcessorOnStreamFailedRequest {
1908 pub stream_lifetime_ordinal: u64,
1909 pub error: StreamError,
1910}
1911
1912impl fidl::Persistable for StreamProcessorOnStreamFailedRequest {}
1913
1914#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1915#[repr(C)]
1916pub struct StreamProcessorQueueInputEndOfStreamRequest {
1917 pub stream_lifetime_ordinal: u64,
1918}
1919
1920impl fidl::Persistable for StreamProcessorQueueInputEndOfStreamRequest {}
1921
1922#[derive(Clone, Debug, PartialEq)]
1923pub struct StreamProcessorQueueInputFormatDetailsRequest {
1924 pub stream_lifetime_ordinal: u64,
1925 pub format_details: FormatDetails,
1926}
1927
1928impl fidl::Persistable for StreamProcessorQueueInputFormatDetailsRequest {}
1929
1930#[derive(Clone, Debug, PartialEq)]
1931pub struct StreamProcessorQueueInputPacketRequest {
1932 pub packet: Packet,
1933}
1934
1935impl fidl::Persistable for StreamProcessorQueueInputPacketRequest {}
1936
1937#[derive(Clone, Debug, PartialEq)]
1938pub struct StreamProcessorRecycleOutputPacketRequest {
1939 pub available_output_packet: PacketHeader,
1940}
1941
1942impl fidl::Persistable for StreamProcessorRecycleOutputPacketRequest {}
1943
1944#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1945#[repr(C)]
1946pub struct StreamSinkSendPacketNoReplyRequest {
1947 pub packet: StreamPacket,
1948}
1949
1950impl fidl::Persistable for StreamSinkSendPacketNoReplyRequest {}
1951
1952#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1953#[repr(C)]
1954pub struct StreamSinkSendPacketRequest {
1955 pub packet: StreamPacket,
1956}
1957
1958impl fidl::Persistable for StreamSinkSendPacketRequest {}
1959
1960#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1961#[repr(C)]
1962pub struct StreamSourceOnPacketProducedRequest {
1963 pub packet: StreamPacket,
1964}
1965
1966impl fidl::Persistable for StreamSourceOnPacketProducedRequest {}
1967
1968#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1969#[repr(C)]
1970pub struct StreamSourceReleasePacketRequest {
1971 pub packet: StreamPacket,
1972}
1973
1974impl fidl::Persistable for StreamSourceReleasePacketRequest {}
1975
1976#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1978pub struct StreamType {
1979 pub medium_specific: MediumSpecificStreamType,
1981 pub encoding: String,
1984 pub encoding_parameters: Option<Vec<u8>>,
1990}
1991
1992impl fidl::Persistable for StreamType {}
1993
1994#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1996pub struct SubpictureStreamType;
1997
1998impl fidl::Persistable for SubpictureStreamType {}
1999
2000#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
2006#[repr(C)]
2007pub struct SubsampleEntry {
2008 pub clear_bytes: u32,
2009 pub encrypted_bytes: u32,
2010}
2011
2012impl fidl::Persistable for SubsampleEntry {}
2013
2014#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
2016pub struct TextStreamType;
2017
2018impl fidl::Persistable for TextStreamType {}
2019
2020#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
2056#[repr(C)]
2057pub struct TimelineFunction {
2058 pub subject_time: i64,
2059 pub reference_time: i64,
2060 pub subject_delta: u32,
2061 pub reference_delta: u32,
2062}
2063
2064impl fidl::Persistable for TimelineFunction {}
2065
2066#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
2067pub struct UsageGainListenerOnGainMuteChangedRequest {
2068 pub muted: bool,
2069 pub gain_dbfs: f32,
2070}
2071
2072impl fidl::Persistable for UsageGainListenerOnGainMuteChangedRequest {}
2073
2074#[derive(Clone, Debug, PartialEq)]
2075pub struct UsageWatcher2OnStateChangedRequest {
2076 pub usage: Usage2,
2077 pub state: UsageState,
2078}
2079
2080impl fidl::Persistable for UsageWatcher2OnStateChangedRequest {}
2081
2082#[derive(Clone, Debug, PartialEq)]
2083pub struct UsageWatcherOnStateChangedRequest {
2084 pub usage: Usage,
2085 pub state: UsageState,
2086}
2087
2088impl fidl::Persistable for UsageWatcherOnStateChangedRequest {}
2089
2090#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
2092pub struct VideoStreamType {
2093 pub pixel_format: fidl_fuchsia_images_common::PixelFormat,
2094 pub color_space: ColorSpace,
2095 pub width: u32,
2097 pub height: u32,
2098 pub coded_width: u32,
2101 pub coded_height: u32,
2102 pub pixel_aspect_ratio_width: u32,
2105 pub pixel_aspect_ratio_height: u32,
2106 pub stride: u32,
2108}
2109
2110impl fidl::Persistable for VideoStreamType {}
2111
2112#[derive(Clone, Debug, PartialEq)]
2116pub struct VideoUncompressedFormat {
2117 pub image_format: fidl_fuchsia_sysmem_common::ImageFormat2,
2118 pub fourcc: u32,
2119 pub primary_width_pixels: u32,
2120 pub primary_height_pixels: u32,
2121 pub secondary_width_pixels: u32,
2122 pub secondary_height_pixels: u32,
2123 pub planar: bool,
2124 pub swizzled: bool,
2125 pub primary_line_stride_bytes: u32,
2126 pub secondary_line_stride_bytes: u32,
2127 pub primary_start_offset: u32,
2128 pub secondary_start_offset: u32,
2129 pub tertiary_start_offset: u32,
2130 pub primary_pixel_stride: u32,
2131 pub secondary_pixel_stride: u32,
2132 pub primary_display_width_pixels: u32,
2133 pub primary_display_height_pixels: u32,
2134 pub has_pixel_aspect_ratio: bool,
2135 pub pixel_aspect_ratio_width: u32,
2136 pub pixel_aspect_ratio_height: u32,
2137}
2138
2139impl fidl::Persistable for VideoUncompressedFormat {}
2140
2141#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
2142pub struct Void;
2143
2144impl fidl::Persistable for Void {}
2145
2146#[derive(Clone, Debug, Default, PartialEq)]
2150pub struct AudioCompressedFormatCvsd {
2151 #[doc(hidden)]
2152 pub __source_breaking: fidl::marker::SourceBreaking,
2153}
2154
2155impl fidl::Persistable for AudioCompressedFormatCvsd {}
2156
2157#[derive(Clone, Debug, Default, PartialEq)]
2161pub struct AudioCompressedFormatLc3 {
2162 #[doc(hidden)]
2163 pub __source_breaking: fidl::marker::SourceBreaking,
2164}
2165
2166impl fidl::Persistable for AudioCompressedFormatLc3 {}
2167
2168#[derive(Clone, Debug, Default, PartialEq)]
2171pub struct AudioConsumerStatus {
2172 pub error: Option<AudioConsumerError>,
2174 pub presentation_timeline: Option<TimelineFunction>,
2182 pub min_lead_time: Option<u64>,
2187 pub max_lead_time: Option<u64>,
2192 #[doc(hidden)]
2193 pub __source_breaking: fidl::marker::SourceBreaking,
2194}
2195
2196impl fidl::Persistable for AudioConsumerStatus {}
2197
2198#[derive(Clone, Debug, Default, PartialEq)]
2202pub struct CvsdEncoderSettings {
2203 #[doc(hidden)]
2204 pub __source_breaking: fidl::marker::SourceBreaking,
2205}
2206
2207impl fidl::Persistable for CvsdEncoderSettings {}
2208
2209#[derive(Clone, Debug, Default, PartialEq)]
2215pub struct DecryptedFormat {
2216 pub ignore_this_field: Option<bool>,
2217 #[doc(hidden)]
2218 pub __source_breaking: fidl::marker::SourceBreaking,
2219}
2220
2221impl fidl::Persistable for DecryptedFormat {}
2222
2223#[derive(Clone, Debug, Default, PartialEq)]
2230pub struct EncryptedFormat {
2231 pub init_vector: Option<Vec<u8>>,
2239 pub subsamples: Option<Vec<SubsampleEntry>>,
2245 pub pattern: Option<EncryptionPattern>,
2253 pub scheme: Option<String>,
2263 pub key_id: Option<Vec<u8>>,
2270 #[doc(hidden)]
2271 pub __source_breaking: fidl::marker::SourceBreaking,
2272}
2273
2274impl fidl::Persistable for EncryptedFormat {}
2275
2276#[derive(Clone, Debug, Default, PartialEq)]
2281pub struct FormatDetails {
2282 pub format_details_version_ordinal: Option<u64>,
2308 pub mime_type: Option<String>,
2309 pub oob_bytes: Option<Vec<u8>>,
2310 pub domain: Option<DomainFormat>,
2311 pub pass_through_parameters: Option<Vec<Parameter>>,
2312 pub encoder_settings: Option<EncoderSettings>,
2317 pub timebase: Option<u64>,
2331 pub profile: Option<CodecProfile>,
2344 #[doc(hidden)]
2345 pub __source_breaking: fidl::marker::SourceBreaking,
2346}
2347
2348impl fidl::Persistable for FormatDetails {}
2349
2350#[derive(Clone, Debug, Default, PartialEq)]
2352pub struct H264EncoderSettings {
2353 pub bit_rate: Option<u32>,
2356 pub frame_rate: Option<u32>,
2359 pub gop_size: Option<u32>,
2363 pub variable_frame_rate: Option<bool>,
2366 pub min_frame_rate: Option<u32>,
2369 pub force_key_frame: Option<bool>,
2372 pub quantization_params: Option<H264QuantizationParameters>,
2376 #[doc(hidden)]
2377 pub __source_breaking: fidl::marker::SourceBreaking,
2378}
2379
2380impl fidl::Persistable for H264EncoderSettings {}
2381
2382#[derive(Clone, Debug, Default, PartialEq)]
2391pub struct H264QuantizationParameters {
2392 pub i_base: Option<u32>,
2394 pub i_min: Option<u32>,
2396 pub i_max: Option<u32>,
2398 pub p_base: Option<u32>,
2400 pub p_min: Option<u32>,
2402 pub p_max: Option<u32>,
2404 #[doc(hidden)]
2405 pub __source_breaking: fidl::marker::SourceBreaking,
2406}
2407
2408impl fidl::Persistable for H264QuantizationParameters {}
2409
2410#[derive(Clone, Debug, Default, PartialEq)]
2412pub struct HevcEncoderSettings {
2413 pub bit_rate: Option<u32>,
2416 pub frame_rate: Option<u32>,
2418 pub gop_size: Option<u32>,
2420 #[doc(hidden)]
2421 pub __source_breaking: fidl::marker::SourceBreaking,
2422}
2423
2424impl fidl::Persistable for HevcEncoderSettings {}
2425
2426#[derive(Clone, Debug, Default, PartialEq)]
2429pub struct InputAudioCapturerConfiguration {
2430 pub usage: Option<AudioCaptureUsage>,
2431 pub usage2: Option<AudioCaptureUsage2>,
2432 #[doc(hidden)]
2433 pub __source_breaking: fidl::marker::SourceBreaking,
2434}
2435
2436impl fidl::Persistable for InputAudioCapturerConfiguration {}
2437
2438#[derive(Clone, Debug, Default, PartialEq)]
2441pub struct Lc3EncoderSettings {
2442 pub nbytes: Option<u16>,
2447 pub frame_duration: Option<Lc3FrameDuration>,
2450 #[doc(hidden)]
2451 pub __source_breaking: fidl::marker::SourceBreaking,
2452}
2453
2454impl fidl::Persistable for Lc3EncoderSettings {}
2455
2456#[derive(Clone, Debug, Default, PartialEq)]
2459pub struct LoopbackAudioCapturerConfiguration {
2460 #[doc(hidden)]
2461 pub __source_breaking: fidl::marker::SourceBreaking,
2462}
2463
2464impl fidl::Persistable for LoopbackAudioCapturerConfiguration {}
2465
2466#[derive(Clone, Debug, Default, PartialEq)]
2469pub struct MSbcEncoderSettings {
2470 #[doc(hidden)]
2471 pub __source_breaking: fidl::marker::SourceBreaking,
2472}
2473
2474impl fidl::Persistable for MSbcEncoderSettings {}
2475
2476#[derive(Clone, Debug, Default, PartialEq)]
2493pub struct Packet {
2494 pub header: Option<PacketHeader>,
2495 pub buffer_index: Option<u32>,
2559 pub stream_lifetime_ordinal: Option<u64>,
2568 pub start_offset: Option<u32>,
2587 pub valid_length_bytes: Option<u32>,
2610 pub timestamp_ish: Option<u64>,
2631 pub start_access_unit: Option<bool>,
2642 pub known_end_access_unit: Option<bool>,
2668 pub key_frame: Option<bool>,
2672 #[doc(hidden)]
2673 pub __source_breaking: fidl::marker::SourceBreaking,
2674}
2675
2676impl fidl::Persistable for Packet {}
2677
2678#[derive(Clone, Debug, Default, PartialEq)]
2686pub struct PacketHeader {
2687 pub buffer_lifetime_ordinal: Option<u64>,
2703 pub packet_index: Option<u32>,
2779 #[doc(hidden)]
2780 pub __source_breaking: fidl::marker::SourceBreaking,
2781}
2782
2783impl fidl::Persistable for PacketHeader {}
2784
2785#[derive(Clone, Debug, Default, PartialEq)]
2798pub struct StreamBufferConstraints {
2799 pub buffer_constraints_version_ordinal: Option<u64>,
2814 pub default_settings: Option<StreamBufferSettings>,
2815 pub per_packet_buffer_bytes_min: Option<u32>,
2816 pub per_packet_buffer_bytes_recommended: Option<u32>,
2817 pub per_packet_buffer_bytes_max: Option<u32>,
2818 pub packet_count_for_server_min: Option<u32>,
2819 pub packet_count_for_server_recommended: Option<u32>,
2820 pub packet_count_for_server_recommended_max: Option<u32>,
2821 pub packet_count_for_server_max: Option<u32>,
2822 pub packet_count_for_client_min: Option<u32>,
2823 pub packet_count_for_client_max: Option<u32>,
2824 pub single_buffer_mode_allowed: Option<bool>,
2825 pub is_physically_contiguous_required: Option<bool>,
2826 pub buffer_count_for_server_current: Option<u32>,
2930 pub size: Option<fidl_fuchsia_math_common::SizeU>,
2957 pub pixel_format: Option<fidl_fuchsia_images2_common::PixelFormat>,
2993 #[doc(hidden)]
2994 pub __source_breaking: fidl::marker::SourceBreaking,
2995}
2996
2997impl fidl::Persistable for StreamBufferConstraints {}
2998
2999#[derive(Clone, Debug, Default, PartialEq)]
3002pub struct StreamBufferSettings {
3003 pub buffer_lifetime_ordinal: Option<u64>,
3004 pub buffer_constraints_version_ordinal: Option<u64>,
3005 pub packet_count_for_server: Option<u32>,
3006 pub packet_count_for_client: Option<u32>,
3007 pub per_packet_buffer_bytes: Option<u32>,
3008 pub single_buffer_mode: Option<bool>,
3009 #[doc(hidden)]
3010 pub __source_breaking: fidl::marker::SourceBreaking,
3011}
3012
3013impl fidl::Persistable for StreamBufferSettings {}
3014
3015#[derive(Clone, Debug, Default, PartialEq)]
3018pub struct StreamOutputConstraints {
3019 pub stream_lifetime_ordinal: Option<u64>,
3033 pub buffer_constraints_action_required: Option<bool>,
3086 pub buffer_constraints: Option<StreamBufferConstraints>,
3087 #[doc(hidden)]
3088 pub __source_breaking: fidl::marker::SourceBreaking,
3089}
3090
3091impl fidl::Persistable for StreamOutputConstraints {}
3092
3093#[derive(Clone, Debug, Default, PartialEq)]
3094pub struct StreamOutputFormat {
3095 pub stream_lifetime_ordinal: Option<u64>,
3108 pub format_details: Option<FormatDetails>,
3165 #[doc(hidden)]
3166 pub __source_breaking: fidl::marker::SourceBreaking,
3167}
3168
3169impl fidl::Persistable for StreamOutputFormat {}
3170
3171#[derive(Clone, Debug, Default, PartialEq)]
3172pub struct StreamProcessorOnOutputTimestampHasNoOutputRequest {
3173 pub stream_lifetime_ordinal: Option<u64>,
3177 pub timestamp_ish: Option<u64>,
3182 #[doc(hidden)]
3183 pub __source_breaking: fidl::marker::SourceBreaking,
3184}
3185
3186impl fidl::Persistable for StreamProcessorOnOutputTimestampHasNoOutputRequest {}
3187
3188#[derive(Clone, Debug, Default, PartialEq)]
3191pub struct UsageStateDucked {
3192 #[doc(hidden)]
3193 pub __source_breaking: fidl::marker::SourceBreaking,
3194}
3195
3196impl fidl::Persistable for UsageStateDucked {}
3197
3198#[derive(Clone, Debug, Default, PartialEq)]
3201pub struct UsageStateMuted {
3202 #[doc(hidden)]
3203 pub __source_breaking: fidl::marker::SourceBreaking,
3204}
3205
3206impl fidl::Persistable for UsageStateMuted {}
3207
3208#[derive(Clone, Debug, Default, PartialEq)]
3210pub struct UsageStateUnadjusted {
3211 #[doc(hidden)]
3212 pub __source_breaking: fidl::marker::SourceBreaking,
3213}
3214
3215impl fidl::Persistable for UsageStateUnadjusted {}
3216
3217#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
3218pub enum AacBitRate {
3219 Constant(AacConstantBitRate),
3220 Variable(AacVariableBitRate),
3221}
3222
3223impl AacBitRate {
3224 #[inline]
3225 pub fn ordinal(&self) -> u64 {
3226 match *self {
3227 Self::Constant(_) => 1,
3228 Self::Variable(_) => 2,
3229 }
3230 }
3231}
3232
3233impl fidl::Persistable for AacBitRate {}
3234
3235#[derive(Clone, Debug)]
3236pub enum AacTransport {
3237 Raw(AacTransportRaw),
3238 Latm(AacTransportLatm),
3239 Adts(AacTransportAdts),
3240 #[doc(hidden)]
3241 __SourceBreaking {
3242 unknown_ordinal: u64,
3243 },
3244}
3245
3246#[macro_export]
3248macro_rules! AacTransportUnknown {
3249 () => {
3250 _
3251 };
3252}
3253
3254impl PartialEq for AacTransport {
3256 fn eq(&self, other: &Self) -> bool {
3257 match (self, other) {
3258 (Self::Raw(x), Self::Raw(y)) => *x == *y,
3259 (Self::Latm(x), Self::Latm(y)) => *x == *y,
3260 (Self::Adts(x), Self::Adts(y)) => *x == *y,
3261 _ => false,
3262 }
3263 }
3264}
3265
3266impl AacTransport {
3267 #[inline]
3268 pub fn ordinal(&self) -> u64 {
3269 match *self {
3270 Self::Raw(_) => 1,
3271 Self::Latm(_) => 2,
3272 Self::Adts(_) => 3,
3273 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
3274 }
3275 }
3276
3277 #[inline]
3278 pub fn unknown_variant_for_testing() -> Self {
3279 Self::__SourceBreaking { unknown_ordinal: 0 }
3280 }
3281
3282 #[inline]
3283 pub fn is_unknown(&self) -> bool {
3284 match self {
3285 Self::__SourceBreaking { .. } => true,
3286 _ => false,
3287 }
3288 }
3289}
3290
3291impl fidl::Persistable for AacTransport {}
3292
3293#[derive(Clone, Debug, PartialEq)]
3295pub enum AudioCapturerConfiguration {
3296 Loopback(LoopbackAudioCapturerConfiguration),
3297 Input(InputAudioCapturerConfiguration),
3298}
3299
3300impl AudioCapturerConfiguration {
3301 #[inline]
3302 pub fn ordinal(&self) -> u64 {
3303 match *self {
3304 Self::Loopback(_) => 1,
3305 Self::Input(_) => 2,
3306 }
3307 }
3308}
3309
3310impl fidl::Persistable for AudioCapturerConfiguration {}
3311
3312#[derive(Clone, Debug)]
3313pub enum AudioCompressedFormat {
3314 Aac(AudioCompressedFormatAac),
3315 Sbc(AudioCompressedFormatSbc),
3316 Cvsd(AudioCompressedFormatCvsd),
3317 Lc3(AudioCompressedFormatLc3),
3318 #[doc(hidden)]
3319 __SourceBreaking {
3320 unknown_ordinal: u64,
3321 },
3322}
3323
3324#[macro_export]
3326macro_rules! AudioCompressedFormatUnknown {
3327 () => {
3328 _
3329 };
3330}
3331
3332impl PartialEq for AudioCompressedFormat {
3334 fn eq(&self, other: &Self) -> bool {
3335 match (self, other) {
3336 (Self::Aac(x), Self::Aac(y)) => *x == *y,
3337 (Self::Sbc(x), Self::Sbc(y)) => *x == *y,
3338 (Self::Cvsd(x), Self::Cvsd(y)) => *x == *y,
3339 (Self::Lc3(x), Self::Lc3(y)) => *x == *y,
3340 _ => false,
3341 }
3342 }
3343}
3344
3345impl AudioCompressedFormat {
3346 #[inline]
3347 pub fn ordinal(&self) -> u64 {
3348 match *self {
3349 Self::Aac(_) => 1,
3350 Self::Sbc(_) => 2,
3351 Self::Cvsd(_) => 3,
3352 Self::Lc3(_) => 4,
3353 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
3354 }
3355 }
3356
3357 #[inline]
3358 pub fn unknown_variant_for_testing() -> Self {
3359 Self::__SourceBreaking { unknown_ordinal: 0 }
3360 }
3361
3362 #[inline]
3363 pub fn is_unknown(&self) -> bool {
3364 match self {
3365 Self::__SourceBreaking { .. } => true,
3366 _ => false,
3367 }
3368 }
3369}
3370
3371impl fidl::Persistable for AudioCompressedFormat {}
3372
3373#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
3375pub enum AudioConsumerError {
3376 PlaceHolder(Void),
3377}
3378
3379impl AudioConsumerError {
3380 #[inline]
3381 pub fn ordinal(&self) -> u64 {
3382 match *self {
3383 Self::PlaceHolder(_) => 1,
3384 }
3385 }
3386}
3387
3388impl fidl::Persistable for AudioConsumerError {}
3389
3390#[derive(Clone, Debug, PartialEq)]
3392pub enum AudioFormat {
3393 Compressed(AudioCompressedFormat),
3394 Uncompressed(AudioUncompressedFormat),
3395}
3396
3397impl AudioFormat {
3398 #[inline]
3399 pub fn ordinal(&self) -> u64 {
3400 match *self {
3401 Self::Compressed(_) => 1,
3402 Self::Uncompressed(_) => 2,
3403 }
3404 }
3405}
3406
3407impl fidl::Persistable for AudioFormat {}
3408
3409#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
3411pub enum AudioUncompressedFormat {
3412 Pcm(PcmFormat),
3413}
3414
3415impl AudioUncompressedFormat {
3416 #[inline]
3417 pub fn ordinal(&self) -> u64 {
3418 match *self {
3419 Self::Pcm(_) => 1,
3420 }
3421 }
3422}
3423
3424impl fidl::Persistable for AudioUncompressedFormat {}
3425
3426#[derive(Clone, Debug)]
3430pub enum CryptoFormat {
3431 Encrypted(EncryptedFormat),
3432 Decrypted(DecryptedFormat),
3433 #[doc(hidden)]
3434 __SourceBreaking {
3435 unknown_ordinal: u64,
3436 },
3437}
3438
3439#[macro_export]
3441macro_rules! CryptoFormatUnknown {
3442 () => {
3443 _
3444 };
3445}
3446
3447impl PartialEq for CryptoFormat {
3449 fn eq(&self, other: &Self) -> bool {
3450 match (self, other) {
3451 (Self::Encrypted(x), Self::Encrypted(y)) => *x == *y,
3452 (Self::Decrypted(x), Self::Decrypted(y)) => *x == *y,
3453 _ => false,
3454 }
3455 }
3456}
3457
3458impl CryptoFormat {
3459 #[inline]
3460 pub fn ordinal(&self) -> u64 {
3461 match *self {
3462 Self::Encrypted(_) => 1,
3463 Self::Decrypted(_) => 2,
3464 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
3465 }
3466 }
3467
3468 #[inline]
3469 pub fn unknown_variant_for_testing() -> Self {
3470 Self::__SourceBreaking { unknown_ordinal: 0 }
3471 }
3472
3473 #[inline]
3474 pub fn is_unknown(&self) -> bool {
3475 match self {
3476 Self::__SourceBreaking { .. } => true,
3477 _ => false,
3478 }
3479 }
3480}
3481
3482impl fidl::Persistable for CryptoFormat {}
3483
3484#[derive(Clone, Debug, PartialEq)]
3486pub enum DomainFormat {
3487 Audio(AudioFormat),
3488 Video(VideoFormat),
3489 Crypto(CryptoFormat),
3490}
3491
3492impl DomainFormat {
3493 #[inline]
3494 pub fn ordinal(&self) -> u64 {
3495 match *self {
3496 Self::Audio(_) => 1,
3497 Self::Video(_) => 2,
3498 Self::Crypto(_) => 3,
3499 }
3500 }
3501}
3502
3503impl fidl::Persistable for DomainFormat {}
3504
3505#[derive(Clone, Debug)]
3508pub enum EncoderSettings {
3509 Sbc(SbcEncoderSettings),
3510 Aac(AacEncoderSettings),
3511 H264(H264EncoderSettings),
3512 Hevc(HevcEncoderSettings),
3513 Cvsd(CvsdEncoderSettings),
3514 Lc3(Lc3EncoderSettings),
3515 Msbc(MSbcEncoderSettings),
3516 #[doc(hidden)]
3517 __SourceBreaking {
3518 unknown_ordinal: u64,
3519 },
3520}
3521
3522#[macro_export]
3524macro_rules! EncoderSettingsUnknown {
3525 () => {
3526 _
3527 };
3528}
3529
3530impl PartialEq for EncoderSettings {
3532 fn eq(&self, other: &Self) -> bool {
3533 match (self, other) {
3534 (Self::Sbc(x), Self::Sbc(y)) => *x == *y,
3535 (Self::Aac(x), Self::Aac(y)) => *x == *y,
3536 (Self::H264(x), Self::H264(y)) => *x == *y,
3537 (Self::Hevc(x), Self::Hevc(y)) => *x == *y,
3538 (Self::Cvsd(x), Self::Cvsd(y)) => *x == *y,
3539 (Self::Lc3(x), Self::Lc3(y)) => *x == *y,
3540 (Self::Msbc(x), Self::Msbc(y)) => *x == *y,
3541 _ => false,
3542 }
3543 }
3544}
3545
3546impl EncoderSettings {
3547 #[inline]
3548 pub fn ordinal(&self) -> u64 {
3549 match *self {
3550 Self::Sbc(_) => 1,
3551 Self::Aac(_) => 2,
3552 Self::H264(_) => 3,
3553 Self::Hevc(_) => 4,
3554 Self::Cvsd(_) => 5,
3555 Self::Lc3(_) => 6,
3556 Self::Msbc(_) => 7,
3557 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
3558 }
3559 }
3560
3561 #[inline]
3562 pub fn unknown_variant_for_testing() -> Self {
3563 Self::__SourceBreaking { unknown_ordinal: 0 }
3564 }
3565
3566 #[inline]
3567 pub fn is_unknown(&self) -> bool {
3568 match self {
3569 Self::__SourceBreaking { .. } => true,
3570 _ => false,
3571 }
3572 }
3573}
3574
3575impl fidl::Persistable for EncoderSettings {}
3576
3577#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
3579pub enum MediumSpecificStreamType {
3580 Audio(AudioStreamType),
3581 Video(VideoStreamType),
3582 Text(TextStreamType),
3583 Subpicture(SubpictureStreamType),
3584}
3585
3586impl MediumSpecificStreamType {
3587 #[inline]
3588 pub fn ordinal(&self) -> u64 {
3589 match *self {
3590 Self::Audio(_) => 1,
3591 Self::Video(_) => 2,
3592 Self::Text(_) => 3,
3593 Self::Subpicture(_) => 4,
3594 }
3595 }
3596}
3597
3598impl fidl::Persistable for MediumSpecificStreamType {}
3599
3600#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
3601pub enum Usage {
3602 RenderUsage(AudioRenderUsage),
3603 CaptureUsage(AudioCaptureUsage),
3604}
3605
3606impl Usage {
3607 #[inline]
3608 pub fn ordinal(&self) -> u64 {
3609 match *self {
3610 Self::RenderUsage(_) => 1,
3611 Self::CaptureUsage(_) => 2,
3612 }
3613 }
3614}
3615
3616impl fidl::Persistable for Usage {}
3617
3618#[derive(Clone, Debug)]
3619pub enum Usage2 {
3620 RenderUsage(AudioRenderUsage2),
3621 CaptureUsage(AudioCaptureUsage2),
3622 #[doc(hidden)]
3623 __SourceBreaking {
3624 unknown_ordinal: u64,
3625 },
3626}
3627
3628#[macro_export]
3630macro_rules! Usage2Unknown {
3631 () => {
3632 _
3633 };
3634}
3635
3636impl PartialEq for Usage2 {
3638 fn eq(&self, other: &Self) -> bool {
3639 match (self, other) {
3640 (Self::RenderUsage(x), Self::RenderUsage(y)) => *x == *y,
3641 (Self::CaptureUsage(x), Self::CaptureUsage(y)) => *x == *y,
3642 _ => false,
3643 }
3644 }
3645}
3646
3647impl Usage2 {
3648 #[inline]
3649 pub fn ordinal(&self) -> u64 {
3650 match *self {
3651 Self::RenderUsage(_) => 1,
3652 Self::CaptureUsage(_) => 2,
3653 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
3654 }
3655 }
3656
3657 #[inline]
3658 pub fn unknown_variant_for_testing() -> Self {
3659 Self::__SourceBreaking { unknown_ordinal: 0 }
3660 }
3661
3662 #[inline]
3663 pub fn is_unknown(&self) -> bool {
3664 match self {
3665 Self::__SourceBreaking { .. } => true,
3666 _ => false,
3667 }
3668 }
3669}
3670
3671impl fidl::Persistable for Usage2 {}
3672
3673#[derive(Clone, Debug)]
3675pub enum UsageState {
3676 Unadjusted(UsageStateUnadjusted),
3677 Ducked(UsageStateDucked),
3678 Muted(UsageStateMuted),
3679 #[doc(hidden)]
3680 __SourceBreaking {
3681 unknown_ordinal: u64,
3682 },
3683}
3684
3685#[macro_export]
3687macro_rules! UsageStateUnknown {
3688 () => {
3689 _
3690 };
3691}
3692
3693impl PartialEq for UsageState {
3695 fn eq(&self, other: &Self) -> bool {
3696 match (self, other) {
3697 (Self::Unadjusted(x), Self::Unadjusted(y)) => *x == *y,
3698 (Self::Ducked(x), Self::Ducked(y)) => *x == *y,
3699 (Self::Muted(x), Self::Muted(y)) => *x == *y,
3700 _ => false,
3701 }
3702 }
3703}
3704
3705impl UsageState {
3706 #[inline]
3707 pub fn ordinal(&self) -> u64 {
3708 match *self {
3709 Self::Unadjusted(_) => 1,
3710 Self::Ducked(_) => 2,
3711 Self::Muted(_) => 3,
3712 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
3713 }
3714 }
3715
3716 #[inline]
3717 pub fn unknown_variant_for_testing() -> Self {
3718 Self::__SourceBreaking { unknown_ordinal: 0 }
3719 }
3720
3721 #[inline]
3722 pub fn is_unknown(&self) -> bool {
3723 match self {
3724 Self::__SourceBreaking { .. } => true,
3725 _ => false,
3726 }
3727 }
3728}
3729
3730impl fidl::Persistable for UsageState {}
3731
3732#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
3736pub enum Value {
3737 BoolValue(bool),
3738 Uint64Value(u64),
3739 Int64Value(i64),
3740 StringValue(String),
3741 BytesValue(Vec<u8>),
3742}
3743
3744impl Value {
3745 #[inline]
3746 pub fn ordinal(&self) -> u64 {
3747 match *self {
3748 Self::BoolValue(_) => 1,
3749 Self::Uint64Value(_) => 2,
3750 Self::Int64Value(_) => 3,
3751 Self::StringValue(_) => 4,
3752 Self::BytesValue(_) => 5,
3753 }
3754 }
3755}
3756
3757impl fidl::Persistable for Value {}
3758
3759#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
3763pub enum VideoCompressedFormat {
3764 TempFieldTodoRemove(u32),
3767}
3768
3769impl VideoCompressedFormat {
3770 #[inline]
3771 pub fn ordinal(&self) -> u64 {
3772 match *self {
3773 Self::TempFieldTodoRemove(_) => 1,
3774 }
3775 }
3776}
3777
3778impl fidl::Persistable for VideoCompressedFormat {}
3779
3780#[derive(Clone, Debug, PartialEq)]
3786pub enum VideoFormat {
3787 Compressed(VideoCompressedFormat),
3788 Uncompressed(VideoUncompressedFormat),
3789}
3790
3791impl VideoFormat {
3792 #[inline]
3793 pub fn ordinal(&self) -> u64 {
3794 match *self {
3795 Self::Compressed(_) => 1,
3796 Self::Uncompressed(_) => 2,
3797 }
3798 }
3799}
3800
3801impl fidl::Persistable for VideoFormat {}
3802
3803pub mod activity_reporter_ordinals {
3804 pub const WATCH_RENDER_ACTIVITY: u64 = 0x2974e9f5880b2f1f;
3805 pub const WATCH_RENDER_ACTIVITY2: u64 = 0x484236fc11b363e6;
3806 pub const WATCH_CAPTURE_ACTIVITY: u64 = 0x70e7038e9658e128;
3807 pub const WATCH_CAPTURE_ACTIVITY2: u64 = 0x3d137e0364f9d550;
3808}
3809
3810pub mod audio_ordinals {
3811 pub const CREATE_AUDIO_RENDERER: u64 = 0x572f413566fd58f1;
3812 pub const CREATE_AUDIO_CAPTURER: u64 = 0x44660fc63a6202f;
3813}
3814
3815pub mod audio_capturer_ordinals {
3816 pub const ADD_PAYLOAD_BUFFER: u64 = 0x3b3a37fc34fe5b56;
3817 pub const REMOVE_PAYLOAD_BUFFER: u64 = 0x5d1e4f74c3658262;
3818 pub const ON_PACKET_PRODUCED: u64 = 0x6bbe69746a3c8bd9;
3819 pub const ON_END_OF_STREAM: u64 = 0x550e69b41d03e2c2;
3820 pub const RELEASE_PACKET: u64 = 0x7a7b57f0f7d9e4bb;
3821 pub const DISCARD_ALL_PACKETS: u64 = 0x27afd605e97b09d2;
3822 pub const DISCARD_ALL_PACKETS_NO_REPLY: u64 = 0x35f9d721e905b831;
3823 pub const SET_PCM_STREAM_TYPE: u64 = 0x1531ea9ea2c852cd;
3824 pub const CAPTURE_AT: u64 = 0x784e25df72cea780;
3825 pub const START_ASYNC_CAPTURE: u64 = 0x7768adbb1ccfd7a6;
3826 pub const STOP_ASYNC_CAPTURE: u64 = 0x5bfc8790a8cef8cb;
3827 pub const STOP_ASYNC_CAPTURE_NO_REPLY: u64 = 0x33223cb2962c95e3;
3828 pub const BIND_GAIN_CONTROL: u64 = 0x658a6a17ddb3a8e0;
3829 pub const GET_REFERENCE_CLOCK: u64 = 0x50d037aa5a4b4d71;
3830 pub const SET_REFERENCE_CLOCK: u64 = 0x732b2c496d521bcf;
3831 pub const SET_USAGE: u64 = 0x42a16f392bd21b25;
3832 pub const SET_USAGE2: u64 = 0x7a73e251b8d2382b;
3833 pub const GET_STREAM_TYPE: u64 = 0x5dcaaa670b433088;
3834}
3835
3836pub mod audio_consumer_ordinals {
3837 pub const CREATE_STREAM_SINK: u64 = 0x525b3b97fdf7d884;
3838 pub const ON_END_OF_STREAM: u64 = 0x53a64e6d0e8f8a20;
3839 pub const START: u64 = 0x4fdbd44b3f2a3a3c;
3840 pub const STOP: u64 = 0x3d46c3741686c40d;
3841 pub const SET_RATE: u64 = 0x45342b73968bfafe;
3842 pub const BIND_VOLUME_CONTROL: u64 = 0x6f1b01fd887f5748;
3843 pub const WATCH_STATUS: u64 = 0x35cf702c721e2cc6;
3844}
3845
3846pub mod audio_core_ordinals {
3847 pub const CREATE_AUDIO_RENDERER: u64 = 0x2ac9beba47f83435;
3848 pub const CREATE_AUDIO_CAPTURER_WITH_CONFIGURATION: u64 = 0x459de383b0d76d97;
3849 pub const CREATE_AUDIO_CAPTURER: u64 = 0x787db169df99aed0;
3850 pub const SET_RENDER_USAGE_GAIN: u64 = 0x48097f45f6e2b8e7;
3851 pub const SET_RENDER_USAGE_GAIN2: u64 = 0x779b1531dc9e64f4;
3852 pub const SET_CAPTURE_USAGE_GAIN: u64 = 0x457d29217d4ea248;
3853 pub const SET_CAPTURE_USAGE_GAIN2: u64 = 0x15065ee308f44af0;
3854 pub const BIND_USAGE_VOLUME_CONTROL: u64 = 0x7225be116aadc137;
3855 pub const BIND_USAGE_VOLUME_CONTROL2: u64 = 0x729dff93019d055;
3856 pub const GET_VOLUME_FROM_DB: u64 = 0x50e3ca45509770bf;
3857 pub const GET_VOLUME_FROM_DB2: u64 = 0x165c811091ef99da;
3858 pub const GET_DB_FROM_VOLUME: u64 = 0x3e8eec27dd5a8bda;
3859 pub const GET_DB_FROM_VOLUME2: u64 = 0x5f421a8ebf265bf3;
3860 pub const SET_INTERACTION: u64 = 0x7bfed14345ece7b7;
3861 pub const SET_INTERACTION2: u64 = 0x7226c7c6e6edc62f;
3862 pub const RESET_INTERACTIONS: u64 = 0x65bd94d9d0a28b5e;
3863 pub const LOAD_DEFAULTS: u64 = 0x54a0bebca85f6b31;
3864}
3865
3866pub mod audio_device_enumerator_ordinals {
3867 pub const GET_DEVICES: u64 = 0x4ce1aa218aeb12a6;
3868 pub const ON_DEVICE_ADDED: u64 = 0xe0fbe40057c4b44;
3869 pub const ON_DEVICE_REMOVED: u64 = 0x6f3b7574463d9ff8;
3870 pub const ON_DEVICE_GAIN_CHANGED: u64 = 0x14aefcbbb076b0e9;
3871 pub const ON_DEFAULT_DEVICE_CHANGED: u64 = 0x16357b42d4c16e11;
3872 pub const GET_DEVICE_GAIN: u64 = 0x25dd4723403c414b;
3873 pub const SET_DEVICE_GAIN: u64 = 0x5bdabc8ebe83591;
3874 pub const ADD_DEVICE_BY_CHANNEL: u64 = 0x72cdbada4d70ed67;
3875}
3876
3877pub mod audio_renderer_ordinals {
3878 pub const ADD_PAYLOAD_BUFFER: u64 = 0x3b3a37fc34fe5b56;
3879 pub const REMOVE_PAYLOAD_BUFFER: u64 = 0x5d1e4f74c3658262;
3880 pub const SEND_PACKET: u64 = 0x67cddd607442775f;
3881 pub const SEND_PACKET_NO_REPLY: u64 = 0x8d9b8b413ceba9d;
3882 pub const END_OF_STREAM: u64 = 0x6180fd6f7e793b71;
3883 pub const DISCARD_ALL_PACKETS: u64 = 0x6f4dad7af2917665;
3884 pub const DISCARD_ALL_PACKETS_NO_REPLY: u64 = 0x50d36d0d23081bc4;
3885 pub const BIND_GAIN_CONTROL: u64 = 0x293f5c7f8fba2bdc;
3886 pub const SET_PTS_UNITS: u64 = 0xf68cd108785a27c;
3887 pub const SET_PTS_CONTINUITY_THRESHOLD: u64 = 0x2849ba571d1971ba;
3888 pub const GET_REFERENCE_CLOCK: u64 = 0x2f7a7f011a172f7e;
3889 pub const SET_REFERENCE_CLOCK: u64 = 0x39acd05d832b5fed;
3890 pub const SET_USAGE: u64 = 0x3994bd23b55a733e;
3891 pub const SET_USAGE2: u64 = 0x2904035c7132b103;
3892 pub const SET_PCM_STREAM_TYPE: u64 = 0x27aa715d8901fa19;
3893 pub const ENABLE_MIN_LEAD_TIME_EVENTS: u64 = 0x62808dfad72bf890;
3894 pub const ON_MIN_LEAD_TIME_CHANGED: u64 = 0x4feff7d278978c4e;
3895 pub const GET_MIN_LEAD_TIME: u64 = 0x1cf3c3ecd8fec26b;
3896 pub const PLAY: u64 = 0x3c0162db084f74a3;
3897 pub const PLAY_NO_REPLY: u64 = 0x1b7fe832b68c22ef;
3898 pub const PAUSE: u64 = 0x41d557588d93d153;
3899 pub const PAUSE_NO_REPLY: u64 = 0x24cc45d4f3855ab;
3900}
3901
3902pub mod profile_provider_ordinals {
3903 pub const REGISTER_HANDLER_WITH_CAPACITY: u64 = 0x60459ecef7458176;
3904 pub const UNREGISTER_HANDLER: u64 = 0x724d9d5fd8ef544c;
3905 pub const REGISTER_MEMORY_RANGE: u64 = 0x2f509d3523e9562d;
3906 pub const UNREGISTER_MEMORY_RANGE: u64 = 0x2dc313d6aa81ad27;
3907}
3908
3909pub mod session_audio_consumer_factory_ordinals {
3910 pub const CREATE_AUDIO_CONSUMER: u64 = 0x6fab96f988e7d7fb;
3911}
3912
3913pub mod simple_stream_sink_ordinals {
3914 pub const ADD_PAYLOAD_BUFFER: u64 = 0x3b3a37fc34fe5b56;
3915 pub const REMOVE_PAYLOAD_BUFFER: u64 = 0x5d1e4f74c3658262;
3916 pub const SEND_PACKET: u64 = 0x67cddd607442775f;
3917 pub const SEND_PACKET_NO_REPLY: u64 = 0x8d9b8b413ceba9d;
3918 pub const END_OF_STREAM: u64 = 0x6180fd6f7e793b71;
3919 pub const DISCARD_ALL_PACKETS: u64 = 0x6f4dad7af2917665;
3920 pub const DISCARD_ALL_PACKETS_NO_REPLY: u64 = 0x50d36d0d23081bc4;
3921}
3922
3923pub mod stream_buffer_set_ordinals {
3924 pub const ADD_PAYLOAD_BUFFER: u64 = 0x3b3a37fc34fe5b56;
3925 pub const REMOVE_PAYLOAD_BUFFER: u64 = 0x5d1e4f74c3658262;
3926}
3927
3928pub mod stream_processor_ordinals {
3929 pub const ENABLE_ON_STREAM_FAILED: u64 = 0x3940929617dbf02b;
3930 pub const ON_STREAM_FAILED: u64 = 0x77ccf70bb061cf8e;
3931 pub const ON_INPUT_CONSTRAINTS: u64 = 0x211da9966a8ca0;
3932 pub const SET_INPUT_BUFFER_PARTIAL_SETTINGS: u64 = 0xb02e0663a40e4c4;
3933 pub const ON_OUTPUT_CONSTRAINTS: u64 = 0x40d8234504c170f3;
3934 pub const ON_OUTPUT_FORMAT: u64 = 0x131b77ae120360bc;
3935 pub const SET_OUTPUT_BUFFER_PARTIAL_SETTINGS: u64 = 0x118bb8c819a7bbbb;
3936 pub const COMPLETE_OUTPUT_BUFFER_PARTIAL_SETTINGS: u64 = 0x50529e5c680ae3ab;
3937 pub const FLUSH_END_OF_STREAM_AND_CLOSE_STREAM: u64 = 0x2b62c3e26d0667e6;
3938 pub const CLOSE_CURRENT_STREAM: u64 = 0x1d8a67522170ca07;
3939 pub const SYNC: u64 = 0x4b3e44300b0ec6aa;
3940 pub const ON_OUTPUT_PACKET: u64 = 0x5c2029be1090ce93;
3941 pub const RECYCLE_OUTPUT_PACKET: u64 = 0x32763632b94e0bd5;
3942 pub const ON_OUTPUT_END_OF_STREAM: u64 = 0x3bb65d237cfa50e6;
3943 pub const QUEUE_INPUT_FORMAT_DETAILS: u64 = 0x170dc0979d52231;
3944 pub const QUEUE_INPUT_PACKET: u64 = 0x47173d2652d9df3b;
3945 pub const ON_FREE_INPUT_PACKET: u64 = 0xeef799b28708bbd;
3946 pub const QUEUE_INPUT_END_OF_STREAM: u64 = 0x2051b6ad00f20b37;
3947 pub const PARTICIPATE_IN_BUFFER_ALLOCATION: u64 = 0x122be3b0096183cb;
3948 pub const ADD_BUFFER: u64 = 0x6eca773e923e0ada;
3949 pub const REMOVE_BUFFER: u64 = 0x40b967ffa6b2da43;
3950 pub const ENABLE_OLD_OUTPUT_BUFFERS: u64 = 0x3aedefeedf3898b0;
3951 pub const ENABLE_SAME_OUTPUT_BUFFER_CONCURRENTLY_IN_FLIGHT: u64 = 0x244e9f43b29709e7;
3952 pub const ENABLE_FORCE_OUTPUT_BUFFERS_FIXED_IMAGE_SIZE: u64 = 0x3994b040f91dc1e9;
3953 pub const ON_OUTPUT_TIMESTAMP_HAS_NO_OUTPUT: u64 = 0x7436457799a25cd4;
3954}
3955
3956pub mod stream_sink_ordinals {
3957 pub const SEND_PACKET: u64 = 0x67cddd607442775f;
3958 pub const SEND_PACKET_NO_REPLY: u64 = 0x8d9b8b413ceba9d;
3959 pub const END_OF_STREAM: u64 = 0x6180fd6f7e793b71;
3960 pub const DISCARD_ALL_PACKETS: u64 = 0x6f4dad7af2917665;
3961 pub const DISCARD_ALL_PACKETS_NO_REPLY: u64 = 0x50d36d0d23081bc4;
3962}
3963
3964pub mod stream_source_ordinals {
3965 pub const ON_PACKET_PRODUCED: u64 = 0x6bbe69746a3c8bd9;
3966 pub const ON_END_OF_STREAM: u64 = 0x550e69b41d03e2c2;
3967 pub const RELEASE_PACKET: u64 = 0x7a7b57f0f7d9e4bb;
3968 pub const DISCARD_ALL_PACKETS: u64 = 0x27afd605e97b09d2;
3969 pub const DISCARD_ALL_PACKETS_NO_REPLY: u64 = 0x35f9d721e905b831;
3970}
3971
3972pub mod usage2_audio_consumer_factory_ordinals {
3973 pub const CREATE_AUDIO_CONSUMER: u64 = 0x767722302a171873;
3974}
3975
3976pub mod usage_audio_consumer_factory_ordinals {
3977 pub const CREATE_AUDIO_CONSUMER: u64 = 0x4d975ca9b8f625a3;
3978}
3979
3980pub mod usage_gain_listener_ordinals {
3981 pub const ON_GAIN_MUTE_CHANGED: u64 = 0x681570258eac3a8d;
3982}
3983
3984pub mod usage_gain_reporter_ordinals {
3985 pub const REGISTER_LISTENER: u64 = 0x767107c168c226af;
3986 pub const REGISTER_LISTENER2: u64 = 0x760a8e1c5873629c;
3987}
3988
3989pub mod usage_reporter_ordinals {
3990 pub const WATCH: u64 = 0x769e6fb17075c959;
3991 pub const WATCH2: u64 = 0x4a43c4c82f5d8ce8;
3992}
3993
3994pub mod usage_watcher_ordinals {
3995 pub const ON_STATE_CHANGED: u64 = 0x5b955c5768ec75c5;
3996}
3997
3998pub mod usage_watcher2_ordinals {
3999 pub const ON_STATE_CHANGED: u64 = 0xca31a8b13c324d4;
4000}
4001
4002mod internal {
4003 use super::*;
4004 unsafe impl fidl::encoding::TypeMarker for AudioConsumerStartFlags {
4005 type Owned = Self;
4006
4007 #[inline(always)]
4008 fn inline_align(_context: fidl::encoding::Context) -> usize {
4009 4
4010 }
4011
4012 #[inline(always)]
4013 fn inline_size(_context: fidl::encoding::Context) -> usize {
4014 4
4015 }
4016 }
4017
4018 impl fidl::encoding::ValueTypeMarker for AudioConsumerStartFlags {
4019 type Borrowed<'a> = Self;
4020 #[inline(always)]
4021 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4022 *value
4023 }
4024 }
4025
4026 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
4027 for AudioConsumerStartFlags
4028 {
4029 #[inline]
4030 unsafe fn encode(
4031 self,
4032 encoder: &mut fidl::encoding::Encoder<'_, D>,
4033 offset: usize,
4034 _depth: fidl::encoding::Depth,
4035 ) -> fidl::Result<()> {
4036 encoder.debug_check_bounds::<Self>(offset);
4037 if self.bits() & Self::all().bits() != self.bits() {
4038 return Err(fidl::Error::InvalidBitsValue);
4039 }
4040 encoder.write_num(self.bits(), offset);
4041 Ok(())
4042 }
4043 }
4044
4045 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4046 for AudioConsumerStartFlags
4047 {
4048 #[inline(always)]
4049 fn new_empty() -> Self {
4050 Self::empty()
4051 }
4052
4053 #[inline]
4054 unsafe fn decode(
4055 &mut self,
4056 decoder: &mut fidl::encoding::Decoder<'_, D>,
4057 offset: usize,
4058 _depth: fidl::encoding::Depth,
4059 ) -> fidl::Result<()> {
4060 decoder.debug_check_bounds::<Self>(offset);
4061 let prim = decoder.read_num::<u32>(offset);
4062 *self = Self::from_bits(prim).ok_or(fidl::Error::InvalidBitsValue)?;
4063 Ok(())
4064 }
4065 }
4066 unsafe impl fidl::encoding::TypeMarker for AudioGainInfoFlags {
4067 type Owned = Self;
4068
4069 #[inline(always)]
4070 fn inline_align(_context: fidl::encoding::Context) -> usize {
4071 4
4072 }
4073
4074 #[inline(always)]
4075 fn inline_size(_context: fidl::encoding::Context) -> usize {
4076 4
4077 }
4078 }
4079
4080 impl fidl::encoding::ValueTypeMarker for AudioGainInfoFlags {
4081 type Borrowed<'a> = Self;
4082 #[inline(always)]
4083 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4084 *value
4085 }
4086 }
4087
4088 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
4089 for AudioGainInfoFlags
4090 {
4091 #[inline]
4092 unsafe fn encode(
4093 self,
4094 encoder: &mut fidl::encoding::Encoder<'_, D>,
4095 offset: usize,
4096 _depth: fidl::encoding::Depth,
4097 ) -> fidl::Result<()> {
4098 encoder.debug_check_bounds::<Self>(offset);
4099 if self.bits() & Self::all().bits() != self.bits() {
4100 return Err(fidl::Error::InvalidBitsValue);
4101 }
4102 encoder.write_num(self.bits(), offset);
4103 Ok(())
4104 }
4105 }
4106
4107 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AudioGainInfoFlags {
4108 #[inline(always)]
4109 fn new_empty() -> Self {
4110 Self::empty()
4111 }
4112
4113 #[inline]
4114 unsafe fn decode(
4115 &mut self,
4116 decoder: &mut fidl::encoding::Decoder<'_, D>,
4117 offset: usize,
4118 _depth: fidl::encoding::Depth,
4119 ) -> fidl::Result<()> {
4120 decoder.debug_check_bounds::<Self>(offset);
4121 let prim = decoder.read_num::<u32>(offset);
4122 *self = Self::from_bits(prim).ok_or(fidl::Error::InvalidBitsValue)?;
4123 Ok(())
4124 }
4125 }
4126 unsafe impl fidl::encoding::TypeMarker for AudioGainValidFlags {
4127 type Owned = Self;
4128
4129 #[inline(always)]
4130 fn inline_align(_context: fidl::encoding::Context) -> usize {
4131 4
4132 }
4133
4134 #[inline(always)]
4135 fn inline_size(_context: fidl::encoding::Context) -> usize {
4136 4
4137 }
4138 }
4139
4140 impl fidl::encoding::ValueTypeMarker for AudioGainValidFlags {
4141 type Borrowed<'a> = Self;
4142 #[inline(always)]
4143 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4144 *value
4145 }
4146 }
4147
4148 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
4149 for AudioGainValidFlags
4150 {
4151 #[inline]
4152 unsafe fn encode(
4153 self,
4154 encoder: &mut fidl::encoding::Encoder<'_, D>,
4155 offset: usize,
4156 _depth: fidl::encoding::Depth,
4157 ) -> fidl::Result<()> {
4158 encoder.debug_check_bounds::<Self>(offset);
4159 if self.bits() & Self::all().bits() != self.bits() {
4160 return Err(fidl::Error::InvalidBitsValue);
4161 }
4162 encoder.write_num(self.bits(), offset);
4163 Ok(())
4164 }
4165 }
4166
4167 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AudioGainValidFlags {
4168 #[inline(always)]
4169 fn new_empty() -> Self {
4170 Self::empty()
4171 }
4172
4173 #[inline]
4174 unsafe fn decode(
4175 &mut self,
4176 decoder: &mut fidl::encoding::Decoder<'_, D>,
4177 offset: usize,
4178 _depth: fidl::encoding::Depth,
4179 ) -> fidl::Result<()> {
4180 decoder.debug_check_bounds::<Self>(offset);
4181 let prim = decoder.read_num::<u32>(offset);
4182 *self = Self::from_bits(prim).ok_or(fidl::Error::InvalidBitsValue)?;
4183 Ok(())
4184 }
4185 }
4186 unsafe impl fidl::encoding::TypeMarker for AacAudioObjectType {
4187 type Owned = Self;
4188
4189 #[inline(always)]
4190 fn inline_align(_context: fidl::encoding::Context) -> usize {
4191 std::mem::align_of::<u32>()
4192 }
4193
4194 #[inline(always)]
4195 fn inline_size(_context: fidl::encoding::Context) -> usize {
4196 std::mem::size_of::<u32>()
4197 }
4198
4199 #[inline(always)]
4200 fn encode_is_copy() -> bool {
4201 true
4202 }
4203
4204 #[inline(always)]
4205 fn decode_is_copy() -> bool {
4206 false
4207 }
4208 }
4209
4210 impl fidl::encoding::ValueTypeMarker for AacAudioObjectType {
4211 type Borrowed<'a> = Self;
4212 #[inline(always)]
4213 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4214 *value
4215 }
4216 }
4217
4218 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
4219 for AacAudioObjectType
4220 {
4221 #[inline]
4222 unsafe fn encode(
4223 self,
4224 encoder: &mut fidl::encoding::Encoder<'_, D>,
4225 offset: usize,
4226 _depth: fidl::encoding::Depth,
4227 ) -> fidl::Result<()> {
4228 encoder.debug_check_bounds::<Self>(offset);
4229 encoder.write_num(self.into_primitive(), offset);
4230 Ok(())
4231 }
4232 }
4233
4234 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AacAudioObjectType {
4235 #[inline(always)]
4236 fn new_empty() -> Self {
4237 Self::Mpeg2AacLc
4238 }
4239
4240 #[inline]
4241 unsafe fn decode(
4242 &mut self,
4243 decoder: &mut fidl::encoding::Decoder<'_, D>,
4244 offset: usize,
4245 _depth: fidl::encoding::Depth,
4246 ) -> fidl::Result<()> {
4247 decoder.debug_check_bounds::<Self>(offset);
4248 let prim = decoder.read_num::<u32>(offset);
4249
4250 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
4251 Ok(())
4252 }
4253 }
4254 unsafe impl fidl::encoding::TypeMarker for AacChannelMode {
4255 type Owned = Self;
4256
4257 #[inline(always)]
4258 fn inline_align(_context: fidl::encoding::Context) -> usize {
4259 std::mem::align_of::<u32>()
4260 }
4261
4262 #[inline(always)]
4263 fn inline_size(_context: fidl::encoding::Context) -> usize {
4264 std::mem::size_of::<u32>()
4265 }
4266
4267 #[inline(always)]
4268 fn encode_is_copy() -> bool {
4269 true
4270 }
4271
4272 #[inline(always)]
4273 fn decode_is_copy() -> bool {
4274 false
4275 }
4276 }
4277
4278 impl fidl::encoding::ValueTypeMarker for AacChannelMode {
4279 type Borrowed<'a> = Self;
4280 #[inline(always)]
4281 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4282 *value
4283 }
4284 }
4285
4286 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for AacChannelMode {
4287 #[inline]
4288 unsafe fn encode(
4289 self,
4290 encoder: &mut fidl::encoding::Encoder<'_, D>,
4291 offset: usize,
4292 _depth: fidl::encoding::Depth,
4293 ) -> fidl::Result<()> {
4294 encoder.debug_check_bounds::<Self>(offset);
4295 encoder.write_num(self.into_primitive(), offset);
4296 Ok(())
4297 }
4298 }
4299
4300 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AacChannelMode {
4301 #[inline(always)]
4302 fn new_empty() -> Self {
4303 Self::Mono
4304 }
4305
4306 #[inline]
4307 unsafe fn decode(
4308 &mut self,
4309 decoder: &mut fidl::encoding::Decoder<'_, D>,
4310 offset: usize,
4311 _depth: fidl::encoding::Depth,
4312 ) -> fidl::Result<()> {
4313 decoder.debug_check_bounds::<Self>(offset);
4314 let prim = decoder.read_num::<u32>(offset);
4315
4316 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
4317 Ok(())
4318 }
4319 }
4320 unsafe impl fidl::encoding::TypeMarker for AacVariableBitRate {
4321 type Owned = Self;
4322
4323 #[inline(always)]
4324 fn inline_align(_context: fidl::encoding::Context) -> usize {
4325 std::mem::align_of::<u32>()
4326 }
4327
4328 #[inline(always)]
4329 fn inline_size(_context: fidl::encoding::Context) -> usize {
4330 std::mem::size_of::<u32>()
4331 }
4332
4333 #[inline(always)]
4334 fn encode_is_copy() -> bool {
4335 true
4336 }
4337
4338 #[inline(always)]
4339 fn decode_is_copy() -> bool {
4340 false
4341 }
4342 }
4343
4344 impl fidl::encoding::ValueTypeMarker for AacVariableBitRate {
4345 type Borrowed<'a> = Self;
4346 #[inline(always)]
4347 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4348 *value
4349 }
4350 }
4351
4352 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
4353 for AacVariableBitRate
4354 {
4355 #[inline]
4356 unsafe fn encode(
4357 self,
4358 encoder: &mut fidl::encoding::Encoder<'_, D>,
4359 offset: usize,
4360 _depth: fidl::encoding::Depth,
4361 ) -> fidl::Result<()> {
4362 encoder.debug_check_bounds::<Self>(offset);
4363 encoder.write_num(self.into_primitive(), offset);
4364 Ok(())
4365 }
4366 }
4367
4368 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AacVariableBitRate {
4369 #[inline(always)]
4370 fn new_empty() -> Self {
4371 Self::V1
4372 }
4373
4374 #[inline]
4375 unsafe fn decode(
4376 &mut self,
4377 decoder: &mut fidl::encoding::Decoder<'_, D>,
4378 offset: usize,
4379 _depth: fidl::encoding::Depth,
4380 ) -> fidl::Result<()> {
4381 decoder.debug_check_bounds::<Self>(offset);
4382 let prim = decoder.read_num::<u32>(offset);
4383
4384 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
4385 Ok(())
4386 }
4387 }
4388 unsafe impl fidl::encoding::TypeMarker for AudioBitrateMode {
4389 type Owned = Self;
4390
4391 #[inline(always)]
4392 fn inline_align(_context: fidl::encoding::Context) -> usize {
4393 std::mem::align_of::<u32>()
4394 }
4395
4396 #[inline(always)]
4397 fn inline_size(_context: fidl::encoding::Context) -> usize {
4398 std::mem::size_of::<u32>()
4399 }
4400
4401 #[inline(always)]
4402 fn encode_is_copy() -> bool {
4403 true
4404 }
4405
4406 #[inline(always)]
4407 fn decode_is_copy() -> bool {
4408 false
4409 }
4410 }
4411
4412 impl fidl::encoding::ValueTypeMarker for AudioBitrateMode {
4413 type Borrowed<'a> = Self;
4414 #[inline(always)]
4415 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4416 *value
4417 }
4418 }
4419
4420 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
4421 for AudioBitrateMode
4422 {
4423 #[inline]
4424 unsafe fn encode(
4425 self,
4426 encoder: &mut fidl::encoding::Encoder<'_, D>,
4427 offset: usize,
4428 _depth: fidl::encoding::Depth,
4429 ) -> fidl::Result<()> {
4430 encoder.debug_check_bounds::<Self>(offset);
4431 encoder.write_num(self.into_primitive(), offset);
4432 Ok(())
4433 }
4434 }
4435
4436 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AudioBitrateMode {
4437 #[inline(always)]
4438 fn new_empty() -> Self {
4439 Self::Unspecified
4440 }
4441
4442 #[inline]
4443 unsafe fn decode(
4444 &mut self,
4445 decoder: &mut fidl::encoding::Decoder<'_, D>,
4446 offset: usize,
4447 _depth: fidl::encoding::Depth,
4448 ) -> fidl::Result<()> {
4449 decoder.debug_check_bounds::<Self>(offset);
4450 let prim = decoder.read_num::<u32>(offset);
4451
4452 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
4453 Ok(())
4454 }
4455 }
4456 unsafe impl fidl::encoding::TypeMarker for AudioCaptureUsage {
4457 type Owned = Self;
4458
4459 #[inline(always)]
4460 fn inline_align(_context: fidl::encoding::Context) -> usize {
4461 std::mem::align_of::<u32>()
4462 }
4463
4464 #[inline(always)]
4465 fn inline_size(_context: fidl::encoding::Context) -> usize {
4466 std::mem::size_of::<u32>()
4467 }
4468
4469 #[inline(always)]
4470 fn encode_is_copy() -> bool {
4471 true
4472 }
4473
4474 #[inline(always)]
4475 fn decode_is_copy() -> bool {
4476 false
4477 }
4478 }
4479
4480 impl fidl::encoding::ValueTypeMarker for AudioCaptureUsage {
4481 type Borrowed<'a> = Self;
4482 #[inline(always)]
4483 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4484 *value
4485 }
4486 }
4487
4488 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
4489 for AudioCaptureUsage
4490 {
4491 #[inline]
4492 unsafe fn encode(
4493 self,
4494 encoder: &mut fidl::encoding::Encoder<'_, D>,
4495 offset: usize,
4496 _depth: fidl::encoding::Depth,
4497 ) -> fidl::Result<()> {
4498 encoder.debug_check_bounds::<Self>(offset);
4499 encoder.write_num(self.into_primitive(), offset);
4500 Ok(())
4501 }
4502 }
4503
4504 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AudioCaptureUsage {
4505 #[inline(always)]
4506 fn new_empty() -> Self {
4507 Self::Background
4508 }
4509
4510 #[inline]
4511 unsafe fn decode(
4512 &mut self,
4513 decoder: &mut fidl::encoding::Decoder<'_, D>,
4514 offset: usize,
4515 _depth: fidl::encoding::Depth,
4516 ) -> fidl::Result<()> {
4517 decoder.debug_check_bounds::<Self>(offset);
4518 let prim = decoder.read_num::<u32>(offset);
4519
4520 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
4521 Ok(())
4522 }
4523 }
4524 unsafe impl fidl::encoding::TypeMarker for AudioCaptureUsage2 {
4525 type Owned = Self;
4526
4527 #[inline(always)]
4528 fn inline_align(_context: fidl::encoding::Context) -> usize {
4529 std::mem::align_of::<u32>()
4530 }
4531
4532 #[inline(always)]
4533 fn inline_size(_context: fidl::encoding::Context) -> usize {
4534 std::mem::size_of::<u32>()
4535 }
4536
4537 #[inline(always)]
4538 fn encode_is_copy() -> bool {
4539 false
4540 }
4541
4542 #[inline(always)]
4543 fn decode_is_copy() -> bool {
4544 false
4545 }
4546 }
4547
4548 impl fidl::encoding::ValueTypeMarker for AudioCaptureUsage2 {
4549 type Borrowed<'a> = Self;
4550 #[inline(always)]
4551 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4552 *value
4553 }
4554 }
4555
4556 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
4557 for AudioCaptureUsage2
4558 {
4559 #[inline]
4560 unsafe fn encode(
4561 self,
4562 encoder: &mut fidl::encoding::Encoder<'_, D>,
4563 offset: usize,
4564 _depth: fidl::encoding::Depth,
4565 ) -> fidl::Result<()> {
4566 encoder.debug_check_bounds::<Self>(offset);
4567 encoder.write_num(self.into_primitive(), offset);
4568 Ok(())
4569 }
4570 }
4571
4572 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AudioCaptureUsage2 {
4573 #[inline(always)]
4574 fn new_empty() -> Self {
4575 Self::unknown()
4576 }
4577
4578 #[inline]
4579 unsafe fn decode(
4580 &mut self,
4581 decoder: &mut fidl::encoding::Decoder<'_, D>,
4582 offset: usize,
4583 _depth: fidl::encoding::Depth,
4584 ) -> fidl::Result<()> {
4585 decoder.debug_check_bounds::<Self>(offset);
4586 let prim = decoder.read_num::<u32>(offset);
4587
4588 *self = Self::from_primitive_allow_unknown(prim);
4589 Ok(())
4590 }
4591 }
4592 unsafe impl fidl::encoding::TypeMarker for AudioChannelId {
4593 type Owned = Self;
4594
4595 #[inline(always)]
4596 fn inline_align(_context: fidl::encoding::Context) -> usize {
4597 std::mem::align_of::<u32>()
4598 }
4599
4600 #[inline(always)]
4601 fn inline_size(_context: fidl::encoding::Context) -> usize {
4602 std::mem::size_of::<u32>()
4603 }
4604
4605 #[inline(always)]
4606 fn encode_is_copy() -> bool {
4607 true
4608 }
4609
4610 #[inline(always)]
4611 fn decode_is_copy() -> bool {
4612 false
4613 }
4614 }
4615
4616 impl fidl::encoding::ValueTypeMarker for AudioChannelId {
4617 type Borrowed<'a> = Self;
4618 #[inline(always)]
4619 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4620 *value
4621 }
4622 }
4623
4624 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for AudioChannelId {
4625 #[inline]
4626 unsafe fn encode(
4627 self,
4628 encoder: &mut fidl::encoding::Encoder<'_, D>,
4629 offset: usize,
4630 _depth: fidl::encoding::Depth,
4631 ) -> fidl::Result<()> {
4632 encoder.debug_check_bounds::<Self>(offset);
4633 encoder.write_num(self.into_primitive(), offset);
4634 Ok(())
4635 }
4636 }
4637
4638 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AudioChannelId {
4639 #[inline(always)]
4640 fn new_empty() -> Self {
4641 Self::Skip
4642 }
4643
4644 #[inline]
4645 unsafe fn decode(
4646 &mut self,
4647 decoder: &mut fidl::encoding::Decoder<'_, D>,
4648 offset: usize,
4649 _depth: fidl::encoding::Depth,
4650 ) -> fidl::Result<()> {
4651 decoder.debug_check_bounds::<Self>(offset);
4652 let prim = decoder.read_num::<u32>(offset);
4653
4654 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
4655 Ok(())
4656 }
4657 }
4658 unsafe impl fidl::encoding::TypeMarker for AudioOutputRoutingPolicy {
4659 type Owned = Self;
4660
4661 #[inline(always)]
4662 fn inline_align(_context: fidl::encoding::Context) -> usize {
4663 std::mem::align_of::<u32>()
4664 }
4665
4666 #[inline(always)]
4667 fn inline_size(_context: fidl::encoding::Context) -> usize {
4668 std::mem::size_of::<u32>()
4669 }
4670
4671 #[inline(always)]
4672 fn encode_is_copy() -> bool {
4673 true
4674 }
4675
4676 #[inline(always)]
4677 fn decode_is_copy() -> bool {
4678 false
4679 }
4680 }
4681
4682 impl fidl::encoding::ValueTypeMarker for AudioOutputRoutingPolicy {
4683 type Borrowed<'a> = Self;
4684 #[inline(always)]
4685 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4686 *value
4687 }
4688 }
4689
4690 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
4691 for AudioOutputRoutingPolicy
4692 {
4693 #[inline]
4694 unsafe fn encode(
4695 self,
4696 encoder: &mut fidl::encoding::Encoder<'_, D>,
4697 offset: usize,
4698 _depth: fidl::encoding::Depth,
4699 ) -> fidl::Result<()> {
4700 encoder.debug_check_bounds::<Self>(offset);
4701 encoder.write_num(self.into_primitive(), offset);
4702 Ok(())
4703 }
4704 }
4705
4706 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4707 for AudioOutputRoutingPolicy
4708 {
4709 #[inline(always)]
4710 fn new_empty() -> Self {
4711 Self::AllPluggedOutputs
4712 }
4713
4714 #[inline]
4715 unsafe fn decode(
4716 &mut self,
4717 decoder: &mut fidl::encoding::Decoder<'_, D>,
4718 offset: usize,
4719 _depth: fidl::encoding::Depth,
4720 ) -> fidl::Result<()> {
4721 decoder.debug_check_bounds::<Self>(offset);
4722 let prim = decoder.read_num::<u32>(offset);
4723
4724 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
4725 Ok(())
4726 }
4727 }
4728 unsafe impl fidl::encoding::TypeMarker for AudioPcmMode {
4729 type Owned = Self;
4730
4731 #[inline(always)]
4732 fn inline_align(_context: fidl::encoding::Context) -> usize {
4733 std::mem::align_of::<u32>()
4734 }
4735
4736 #[inline(always)]
4737 fn inline_size(_context: fidl::encoding::Context) -> usize {
4738 std::mem::size_of::<u32>()
4739 }
4740
4741 #[inline(always)]
4742 fn encode_is_copy() -> bool {
4743 true
4744 }
4745
4746 #[inline(always)]
4747 fn decode_is_copy() -> bool {
4748 false
4749 }
4750 }
4751
4752 impl fidl::encoding::ValueTypeMarker for AudioPcmMode {
4753 type Borrowed<'a> = Self;
4754 #[inline(always)]
4755 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4756 *value
4757 }
4758 }
4759
4760 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for AudioPcmMode {
4761 #[inline]
4762 unsafe fn encode(
4763 self,
4764 encoder: &mut fidl::encoding::Encoder<'_, D>,
4765 offset: usize,
4766 _depth: fidl::encoding::Depth,
4767 ) -> fidl::Result<()> {
4768 encoder.debug_check_bounds::<Self>(offset);
4769 encoder.write_num(self.into_primitive(), offset);
4770 Ok(())
4771 }
4772 }
4773
4774 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AudioPcmMode {
4775 #[inline(always)]
4776 fn new_empty() -> Self {
4777 Self::Linear
4778 }
4779
4780 #[inline]
4781 unsafe fn decode(
4782 &mut self,
4783 decoder: &mut fidl::encoding::Decoder<'_, D>,
4784 offset: usize,
4785 _depth: fidl::encoding::Depth,
4786 ) -> fidl::Result<()> {
4787 decoder.debug_check_bounds::<Self>(offset);
4788 let prim = decoder.read_num::<u32>(offset);
4789
4790 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
4791 Ok(())
4792 }
4793 }
4794 unsafe impl fidl::encoding::TypeMarker for AudioRenderUsage {
4795 type Owned = Self;
4796
4797 #[inline(always)]
4798 fn inline_align(_context: fidl::encoding::Context) -> usize {
4799 std::mem::align_of::<u32>()
4800 }
4801
4802 #[inline(always)]
4803 fn inline_size(_context: fidl::encoding::Context) -> usize {
4804 std::mem::size_of::<u32>()
4805 }
4806
4807 #[inline(always)]
4808 fn encode_is_copy() -> bool {
4809 true
4810 }
4811
4812 #[inline(always)]
4813 fn decode_is_copy() -> bool {
4814 false
4815 }
4816 }
4817
4818 impl fidl::encoding::ValueTypeMarker for AudioRenderUsage {
4819 type Borrowed<'a> = Self;
4820 #[inline(always)]
4821 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4822 *value
4823 }
4824 }
4825
4826 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
4827 for AudioRenderUsage
4828 {
4829 #[inline]
4830 unsafe fn encode(
4831 self,
4832 encoder: &mut fidl::encoding::Encoder<'_, D>,
4833 offset: usize,
4834 _depth: fidl::encoding::Depth,
4835 ) -> fidl::Result<()> {
4836 encoder.debug_check_bounds::<Self>(offset);
4837 encoder.write_num(self.into_primitive(), offset);
4838 Ok(())
4839 }
4840 }
4841
4842 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AudioRenderUsage {
4843 #[inline(always)]
4844 fn new_empty() -> Self {
4845 Self::Background
4846 }
4847
4848 #[inline]
4849 unsafe fn decode(
4850 &mut self,
4851 decoder: &mut fidl::encoding::Decoder<'_, D>,
4852 offset: usize,
4853 _depth: fidl::encoding::Depth,
4854 ) -> fidl::Result<()> {
4855 decoder.debug_check_bounds::<Self>(offset);
4856 let prim = decoder.read_num::<u32>(offset);
4857
4858 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
4859 Ok(())
4860 }
4861 }
4862 unsafe impl fidl::encoding::TypeMarker for AudioRenderUsage2 {
4863 type Owned = Self;
4864
4865 #[inline(always)]
4866 fn inline_align(_context: fidl::encoding::Context) -> usize {
4867 std::mem::align_of::<u32>()
4868 }
4869
4870 #[inline(always)]
4871 fn inline_size(_context: fidl::encoding::Context) -> usize {
4872 std::mem::size_of::<u32>()
4873 }
4874
4875 #[inline(always)]
4876 fn encode_is_copy() -> bool {
4877 false
4878 }
4879
4880 #[inline(always)]
4881 fn decode_is_copy() -> bool {
4882 false
4883 }
4884 }
4885
4886 impl fidl::encoding::ValueTypeMarker for AudioRenderUsage2 {
4887 type Borrowed<'a> = Self;
4888 #[inline(always)]
4889 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4890 *value
4891 }
4892 }
4893
4894 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
4895 for AudioRenderUsage2
4896 {
4897 #[inline]
4898 unsafe fn encode(
4899 self,
4900 encoder: &mut fidl::encoding::Encoder<'_, D>,
4901 offset: usize,
4902 _depth: fidl::encoding::Depth,
4903 ) -> fidl::Result<()> {
4904 encoder.debug_check_bounds::<Self>(offset);
4905 encoder.write_num(self.into_primitive(), offset);
4906 Ok(())
4907 }
4908 }
4909
4910 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AudioRenderUsage2 {
4911 #[inline(always)]
4912 fn new_empty() -> Self {
4913 Self::unknown()
4914 }
4915
4916 #[inline]
4917 unsafe fn decode(
4918 &mut self,
4919 decoder: &mut fidl::encoding::Decoder<'_, D>,
4920 offset: usize,
4921 _depth: fidl::encoding::Depth,
4922 ) -> fidl::Result<()> {
4923 decoder.debug_check_bounds::<Self>(offset);
4924 let prim = decoder.read_num::<u32>(offset);
4925
4926 *self = Self::from_primitive_allow_unknown(prim);
4927 Ok(())
4928 }
4929 }
4930 unsafe impl fidl::encoding::TypeMarker for AudioSampleFormat {
4931 type Owned = Self;
4932
4933 #[inline(always)]
4934 fn inline_align(_context: fidl::encoding::Context) -> usize {
4935 std::mem::align_of::<u32>()
4936 }
4937
4938 #[inline(always)]
4939 fn inline_size(_context: fidl::encoding::Context) -> usize {
4940 std::mem::size_of::<u32>()
4941 }
4942
4943 #[inline(always)]
4944 fn encode_is_copy() -> bool {
4945 true
4946 }
4947
4948 #[inline(always)]
4949 fn decode_is_copy() -> bool {
4950 false
4951 }
4952 }
4953
4954 impl fidl::encoding::ValueTypeMarker for AudioSampleFormat {
4955 type Borrowed<'a> = Self;
4956 #[inline(always)]
4957 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4958 *value
4959 }
4960 }
4961
4962 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
4963 for AudioSampleFormat
4964 {
4965 #[inline]
4966 unsafe fn encode(
4967 self,
4968 encoder: &mut fidl::encoding::Encoder<'_, D>,
4969 offset: usize,
4970 _depth: fidl::encoding::Depth,
4971 ) -> fidl::Result<()> {
4972 encoder.debug_check_bounds::<Self>(offset);
4973 encoder.write_num(self.into_primitive(), offset);
4974 Ok(())
4975 }
4976 }
4977
4978 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AudioSampleFormat {
4979 #[inline(always)]
4980 fn new_empty() -> Self {
4981 Self::Unsigned8
4982 }
4983
4984 #[inline]
4985 unsafe fn decode(
4986 &mut self,
4987 decoder: &mut fidl::encoding::Decoder<'_, D>,
4988 offset: usize,
4989 _depth: fidl::encoding::Depth,
4990 ) -> fidl::Result<()> {
4991 decoder.debug_check_bounds::<Self>(offset);
4992 let prim = decoder.read_num::<u32>(offset);
4993
4994 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
4995 Ok(())
4996 }
4997 }
4998 unsafe impl fidl::encoding::TypeMarker for Behavior {
4999 type Owned = Self;
5000
5001 #[inline(always)]
5002 fn inline_align(_context: fidl::encoding::Context) -> usize {
5003 std::mem::align_of::<u32>()
5004 }
5005
5006 #[inline(always)]
5007 fn inline_size(_context: fidl::encoding::Context) -> usize {
5008 std::mem::size_of::<u32>()
5009 }
5010
5011 #[inline(always)]
5012 fn encode_is_copy() -> bool {
5013 false
5014 }
5015
5016 #[inline(always)]
5017 fn decode_is_copy() -> bool {
5018 false
5019 }
5020 }
5021
5022 impl fidl::encoding::ValueTypeMarker for Behavior {
5023 type Borrowed<'a> = Self;
5024 #[inline(always)]
5025 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5026 *value
5027 }
5028 }
5029
5030 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for Behavior {
5031 #[inline]
5032 unsafe fn encode(
5033 self,
5034 encoder: &mut fidl::encoding::Encoder<'_, D>,
5035 offset: usize,
5036 _depth: fidl::encoding::Depth,
5037 ) -> fidl::Result<()> {
5038 encoder.debug_check_bounds::<Self>(offset);
5039 encoder.write_num(self.into_primitive(), offset);
5040 Ok(())
5041 }
5042 }
5043
5044 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Behavior {
5045 #[inline(always)]
5046 fn new_empty() -> Self {
5047 Self::unknown()
5048 }
5049
5050 #[inline]
5051 unsafe fn decode(
5052 &mut self,
5053 decoder: &mut fidl::encoding::Decoder<'_, D>,
5054 offset: usize,
5055 _depth: fidl::encoding::Depth,
5056 ) -> fidl::Result<()> {
5057 decoder.debug_check_bounds::<Self>(offset);
5058 let prim = decoder.read_num::<u32>(offset);
5059
5060 *self = Self::from_primitive_allow_unknown(prim);
5061 Ok(())
5062 }
5063 }
5064 unsafe impl fidl::encoding::TypeMarker for CodecProfile {
5065 type Owned = Self;
5066
5067 #[inline(always)]
5068 fn inline_align(_context: fidl::encoding::Context) -> usize {
5069 std::mem::align_of::<u32>()
5070 }
5071
5072 #[inline(always)]
5073 fn inline_size(_context: fidl::encoding::Context) -> usize {
5074 std::mem::size_of::<u32>()
5075 }
5076
5077 #[inline(always)]
5078 fn encode_is_copy() -> bool {
5079 false
5080 }
5081
5082 #[inline(always)]
5083 fn decode_is_copy() -> bool {
5084 false
5085 }
5086 }
5087
5088 impl fidl::encoding::ValueTypeMarker for CodecProfile {
5089 type Borrowed<'a> = Self;
5090 #[inline(always)]
5091 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5092 *value
5093 }
5094 }
5095
5096 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for CodecProfile {
5097 #[inline]
5098 unsafe fn encode(
5099 self,
5100 encoder: &mut fidl::encoding::Encoder<'_, D>,
5101 offset: usize,
5102 _depth: fidl::encoding::Depth,
5103 ) -> fidl::Result<()> {
5104 encoder.debug_check_bounds::<Self>(offset);
5105 encoder.write_num(self.into_primitive(), offset);
5106 Ok(())
5107 }
5108 }
5109
5110 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CodecProfile {
5111 #[inline(always)]
5112 fn new_empty() -> Self {
5113 Self::unknown()
5114 }
5115
5116 #[inline]
5117 unsafe fn decode(
5118 &mut self,
5119 decoder: &mut fidl::encoding::Decoder<'_, D>,
5120 offset: usize,
5121 _depth: fidl::encoding::Depth,
5122 ) -> fidl::Result<()> {
5123 decoder.debug_check_bounds::<Self>(offset);
5124 let prim = decoder.read_num::<u32>(offset);
5125
5126 *self = Self::from_primitive_allow_unknown(prim);
5127 Ok(())
5128 }
5129 }
5130 unsafe impl fidl::encoding::TypeMarker for ColorSpace {
5131 type Owned = Self;
5132
5133 #[inline(always)]
5134 fn inline_align(_context: fidl::encoding::Context) -> usize {
5135 std::mem::align_of::<u32>()
5136 }
5137
5138 #[inline(always)]
5139 fn inline_size(_context: fidl::encoding::Context) -> usize {
5140 std::mem::size_of::<u32>()
5141 }
5142
5143 #[inline(always)]
5144 fn encode_is_copy() -> bool {
5145 true
5146 }
5147
5148 #[inline(always)]
5149 fn decode_is_copy() -> bool {
5150 false
5151 }
5152 }
5153
5154 impl fidl::encoding::ValueTypeMarker for ColorSpace {
5155 type Borrowed<'a> = Self;
5156 #[inline(always)]
5157 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5158 *value
5159 }
5160 }
5161
5162 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for ColorSpace {
5163 #[inline]
5164 unsafe fn encode(
5165 self,
5166 encoder: &mut fidl::encoding::Encoder<'_, D>,
5167 offset: usize,
5168 _depth: fidl::encoding::Depth,
5169 ) -> fidl::Result<()> {
5170 encoder.debug_check_bounds::<Self>(offset);
5171 encoder.write_num(self.into_primitive(), offset);
5172 Ok(())
5173 }
5174 }
5175
5176 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ColorSpace {
5177 #[inline(always)]
5178 fn new_empty() -> Self {
5179 Self::Unknown
5180 }
5181
5182 #[inline]
5183 unsafe fn decode(
5184 &mut self,
5185 decoder: &mut fidl::encoding::Decoder<'_, D>,
5186 offset: usize,
5187 _depth: fidl::encoding::Depth,
5188 ) -> fidl::Result<()> {
5189 decoder.debug_check_bounds::<Self>(offset);
5190 let prim = decoder.read_num::<u32>(offset);
5191
5192 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
5193 Ok(())
5194 }
5195 }
5196 unsafe impl fidl::encoding::TypeMarker for Lc3FrameDuration {
5197 type Owned = Self;
5198
5199 #[inline(always)]
5200 fn inline_align(_context: fidl::encoding::Context) -> usize {
5201 std::mem::align_of::<u32>()
5202 }
5203
5204 #[inline(always)]
5205 fn inline_size(_context: fidl::encoding::Context) -> usize {
5206 std::mem::size_of::<u32>()
5207 }
5208
5209 #[inline(always)]
5210 fn encode_is_copy() -> bool {
5211 false
5212 }
5213
5214 #[inline(always)]
5215 fn decode_is_copy() -> bool {
5216 false
5217 }
5218 }
5219
5220 impl fidl::encoding::ValueTypeMarker for Lc3FrameDuration {
5221 type Borrowed<'a> = Self;
5222 #[inline(always)]
5223 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5224 *value
5225 }
5226 }
5227
5228 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
5229 for Lc3FrameDuration
5230 {
5231 #[inline]
5232 unsafe fn encode(
5233 self,
5234 encoder: &mut fidl::encoding::Encoder<'_, D>,
5235 offset: usize,
5236 _depth: fidl::encoding::Depth,
5237 ) -> fidl::Result<()> {
5238 encoder.debug_check_bounds::<Self>(offset);
5239 encoder.write_num(self.into_primitive(), offset);
5240 Ok(())
5241 }
5242 }
5243
5244 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Lc3FrameDuration {
5245 #[inline(always)]
5246 fn new_empty() -> Self {
5247 Self::unknown()
5248 }
5249
5250 #[inline]
5251 unsafe fn decode(
5252 &mut self,
5253 decoder: &mut fidl::encoding::Decoder<'_, D>,
5254 offset: usize,
5255 _depth: fidl::encoding::Depth,
5256 ) -> fidl::Result<()> {
5257 decoder.debug_check_bounds::<Self>(offset);
5258 let prim = decoder.read_num::<u32>(offset);
5259
5260 *self = Self::from_primitive_allow_unknown(prim);
5261 Ok(())
5262 }
5263 }
5264 unsafe impl fidl::encoding::TypeMarker for Port {
5265 type Owned = Self;
5266
5267 #[inline(always)]
5268 fn inline_align(_context: fidl::encoding::Context) -> usize {
5269 std::mem::align_of::<u32>()
5270 }
5271
5272 #[inline(always)]
5273 fn inline_size(_context: fidl::encoding::Context) -> usize {
5274 std::mem::size_of::<u32>()
5275 }
5276
5277 #[inline(always)]
5278 fn encode_is_copy() -> bool {
5279 false
5280 }
5281
5282 #[inline(always)]
5283 fn decode_is_copy() -> bool {
5284 false
5285 }
5286 }
5287
5288 impl fidl::encoding::ValueTypeMarker for Port {
5289 type Borrowed<'a> = Self;
5290 #[inline(always)]
5291 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5292 *value
5293 }
5294 }
5295
5296 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for Port {
5297 #[inline]
5298 unsafe fn encode(
5299 self,
5300 encoder: &mut fidl::encoding::Encoder<'_, D>,
5301 offset: usize,
5302 _depth: fidl::encoding::Depth,
5303 ) -> fidl::Result<()> {
5304 encoder.debug_check_bounds::<Self>(offset);
5305 encoder.write_num(self.into_primitive(), offset);
5306 Ok(())
5307 }
5308 }
5309
5310 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Port {
5311 #[inline(always)]
5312 fn new_empty() -> Self {
5313 Self::unknown()
5314 }
5315
5316 #[inline]
5317 unsafe fn decode(
5318 &mut self,
5319 decoder: &mut fidl::encoding::Decoder<'_, D>,
5320 offset: usize,
5321 _depth: fidl::encoding::Depth,
5322 ) -> fidl::Result<()> {
5323 decoder.debug_check_bounds::<Self>(offset);
5324 let prim = decoder.read_num::<u32>(offset);
5325
5326 *self = Self::from_primitive_allow_unknown(prim);
5327 Ok(())
5328 }
5329 }
5330 unsafe impl fidl::encoding::TypeMarker for SbcAllocation {
5331 type Owned = Self;
5332
5333 #[inline(always)]
5334 fn inline_align(_context: fidl::encoding::Context) -> usize {
5335 std::mem::align_of::<u32>()
5336 }
5337
5338 #[inline(always)]
5339 fn inline_size(_context: fidl::encoding::Context) -> usize {
5340 std::mem::size_of::<u32>()
5341 }
5342
5343 #[inline(always)]
5344 fn encode_is_copy() -> bool {
5345 true
5346 }
5347
5348 #[inline(always)]
5349 fn decode_is_copy() -> bool {
5350 false
5351 }
5352 }
5353
5354 impl fidl::encoding::ValueTypeMarker for SbcAllocation {
5355 type Borrowed<'a> = Self;
5356 #[inline(always)]
5357 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5358 *value
5359 }
5360 }
5361
5362 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for SbcAllocation {
5363 #[inline]
5364 unsafe fn encode(
5365 self,
5366 encoder: &mut fidl::encoding::Encoder<'_, D>,
5367 offset: usize,
5368 _depth: fidl::encoding::Depth,
5369 ) -> fidl::Result<()> {
5370 encoder.debug_check_bounds::<Self>(offset);
5371 encoder.write_num(self.into_primitive(), offset);
5372 Ok(())
5373 }
5374 }
5375
5376 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SbcAllocation {
5377 #[inline(always)]
5378 fn new_empty() -> Self {
5379 Self::AllocLoudness
5380 }
5381
5382 #[inline]
5383 unsafe fn decode(
5384 &mut self,
5385 decoder: &mut fidl::encoding::Decoder<'_, D>,
5386 offset: usize,
5387 _depth: fidl::encoding::Depth,
5388 ) -> fidl::Result<()> {
5389 decoder.debug_check_bounds::<Self>(offset);
5390 let prim = decoder.read_num::<u32>(offset);
5391
5392 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
5393 Ok(())
5394 }
5395 }
5396 unsafe impl fidl::encoding::TypeMarker for SbcBlockCount {
5397 type Owned = Self;
5398
5399 #[inline(always)]
5400 fn inline_align(_context: fidl::encoding::Context) -> usize {
5401 std::mem::align_of::<u32>()
5402 }
5403
5404 #[inline(always)]
5405 fn inline_size(_context: fidl::encoding::Context) -> usize {
5406 std::mem::size_of::<u32>()
5407 }
5408
5409 #[inline(always)]
5410 fn encode_is_copy() -> bool {
5411 true
5412 }
5413
5414 #[inline(always)]
5415 fn decode_is_copy() -> bool {
5416 false
5417 }
5418 }
5419
5420 impl fidl::encoding::ValueTypeMarker for SbcBlockCount {
5421 type Borrowed<'a> = Self;
5422 #[inline(always)]
5423 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5424 *value
5425 }
5426 }
5427
5428 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for SbcBlockCount {
5429 #[inline]
5430 unsafe fn encode(
5431 self,
5432 encoder: &mut fidl::encoding::Encoder<'_, D>,
5433 offset: usize,
5434 _depth: fidl::encoding::Depth,
5435 ) -> fidl::Result<()> {
5436 encoder.debug_check_bounds::<Self>(offset);
5437 encoder.write_num(self.into_primitive(), offset);
5438 Ok(())
5439 }
5440 }
5441
5442 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SbcBlockCount {
5443 #[inline(always)]
5444 fn new_empty() -> Self {
5445 Self::BlockCount4
5446 }
5447
5448 #[inline]
5449 unsafe fn decode(
5450 &mut self,
5451 decoder: &mut fidl::encoding::Decoder<'_, D>,
5452 offset: usize,
5453 _depth: fidl::encoding::Depth,
5454 ) -> fidl::Result<()> {
5455 decoder.debug_check_bounds::<Self>(offset);
5456 let prim = decoder.read_num::<u32>(offset);
5457
5458 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
5459 Ok(())
5460 }
5461 }
5462 unsafe impl fidl::encoding::TypeMarker for SbcChannelMode {
5463 type Owned = Self;
5464
5465 #[inline(always)]
5466 fn inline_align(_context: fidl::encoding::Context) -> usize {
5467 std::mem::align_of::<u32>()
5468 }
5469
5470 #[inline(always)]
5471 fn inline_size(_context: fidl::encoding::Context) -> usize {
5472 std::mem::size_of::<u32>()
5473 }
5474
5475 #[inline(always)]
5476 fn encode_is_copy() -> bool {
5477 true
5478 }
5479
5480 #[inline(always)]
5481 fn decode_is_copy() -> bool {
5482 false
5483 }
5484 }
5485
5486 impl fidl::encoding::ValueTypeMarker for SbcChannelMode {
5487 type Borrowed<'a> = Self;
5488 #[inline(always)]
5489 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5490 *value
5491 }
5492 }
5493
5494 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for SbcChannelMode {
5495 #[inline]
5496 unsafe fn encode(
5497 self,
5498 encoder: &mut fidl::encoding::Encoder<'_, D>,
5499 offset: usize,
5500 _depth: fidl::encoding::Depth,
5501 ) -> fidl::Result<()> {
5502 encoder.debug_check_bounds::<Self>(offset);
5503 encoder.write_num(self.into_primitive(), offset);
5504 Ok(())
5505 }
5506 }
5507
5508 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SbcChannelMode {
5509 #[inline(always)]
5510 fn new_empty() -> Self {
5511 Self::Mono
5512 }
5513
5514 #[inline]
5515 unsafe fn decode(
5516 &mut self,
5517 decoder: &mut fidl::encoding::Decoder<'_, D>,
5518 offset: usize,
5519 _depth: fidl::encoding::Depth,
5520 ) -> fidl::Result<()> {
5521 decoder.debug_check_bounds::<Self>(offset);
5522 let prim = decoder.read_num::<u32>(offset);
5523
5524 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
5525 Ok(())
5526 }
5527 }
5528 unsafe impl fidl::encoding::TypeMarker for SbcSubBands {
5529 type Owned = Self;
5530
5531 #[inline(always)]
5532 fn inline_align(_context: fidl::encoding::Context) -> usize {
5533 std::mem::align_of::<u32>()
5534 }
5535
5536 #[inline(always)]
5537 fn inline_size(_context: fidl::encoding::Context) -> usize {
5538 std::mem::size_of::<u32>()
5539 }
5540
5541 #[inline(always)]
5542 fn encode_is_copy() -> bool {
5543 true
5544 }
5545
5546 #[inline(always)]
5547 fn decode_is_copy() -> bool {
5548 false
5549 }
5550 }
5551
5552 impl fidl::encoding::ValueTypeMarker for SbcSubBands {
5553 type Borrowed<'a> = Self;
5554 #[inline(always)]
5555 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5556 *value
5557 }
5558 }
5559
5560 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for SbcSubBands {
5561 #[inline]
5562 unsafe fn encode(
5563 self,
5564 encoder: &mut fidl::encoding::Encoder<'_, D>,
5565 offset: usize,
5566 _depth: fidl::encoding::Depth,
5567 ) -> fidl::Result<()> {
5568 encoder.debug_check_bounds::<Self>(offset);
5569 encoder.write_num(self.into_primitive(), offset);
5570 Ok(())
5571 }
5572 }
5573
5574 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SbcSubBands {
5575 #[inline(always)]
5576 fn new_empty() -> Self {
5577 Self::SubBands4
5578 }
5579
5580 #[inline]
5581 unsafe fn decode(
5582 &mut self,
5583 decoder: &mut fidl::encoding::Decoder<'_, D>,
5584 offset: usize,
5585 _depth: fidl::encoding::Depth,
5586 ) -> fidl::Result<()> {
5587 decoder.debug_check_bounds::<Self>(offset);
5588 let prim = decoder.read_num::<u32>(offset);
5589
5590 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
5591 Ok(())
5592 }
5593 }
5594 unsafe impl fidl::encoding::TypeMarker for StreamError {
5595 type Owned = Self;
5596
5597 #[inline(always)]
5598 fn inline_align(_context: fidl::encoding::Context) -> usize {
5599 std::mem::align_of::<u32>()
5600 }
5601
5602 #[inline(always)]
5603 fn inline_size(_context: fidl::encoding::Context) -> usize {
5604 std::mem::size_of::<u32>()
5605 }
5606
5607 #[inline(always)]
5608 fn encode_is_copy() -> bool {
5609 true
5610 }
5611
5612 #[inline(always)]
5613 fn decode_is_copy() -> bool {
5614 false
5615 }
5616 }
5617
5618 impl fidl::encoding::ValueTypeMarker for StreamError {
5619 type Borrowed<'a> = Self;
5620 #[inline(always)]
5621 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5622 *value
5623 }
5624 }
5625
5626 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for StreamError {
5627 #[inline]
5628 unsafe fn encode(
5629 self,
5630 encoder: &mut fidl::encoding::Encoder<'_, D>,
5631 offset: usize,
5632 _depth: fidl::encoding::Depth,
5633 ) -> fidl::Result<()> {
5634 encoder.debug_check_bounds::<Self>(offset);
5635 encoder.write_num(self.into_primitive(), offset);
5636 Ok(())
5637 }
5638 }
5639
5640 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for StreamError {
5641 #[inline(always)]
5642 fn new_empty() -> Self {
5643 Self::Unknown
5644 }
5645
5646 #[inline]
5647 unsafe fn decode(
5648 &mut self,
5649 decoder: &mut fidl::encoding::Decoder<'_, D>,
5650 offset: usize,
5651 _depth: fidl::encoding::Depth,
5652 ) -> fidl::Result<()> {
5653 decoder.debug_check_bounds::<Self>(offset);
5654 let prim = decoder.read_num::<u32>(offset);
5655
5656 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
5657 Ok(())
5658 }
5659 }
5660 unsafe impl fidl::encoding::TypeMarker for VideoColorSpace {
5661 type Owned = Self;
5662
5663 #[inline(always)]
5664 fn inline_align(_context: fidl::encoding::Context) -> usize {
5665 std::mem::align_of::<u32>()
5666 }
5667
5668 #[inline(always)]
5669 fn inline_size(_context: fidl::encoding::Context) -> usize {
5670 std::mem::size_of::<u32>()
5671 }
5672
5673 #[inline(always)]
5674 fn encode_is_copy() -> bool {
5675 true
5676 }
5677
5678 #[inline(always)]
5679 fn decode_is_copy() -> bool {
5680 false
5681 }
5682 }
5683
5684 impl fidl::encoding::ValueTypeMarker for VideoColorSpace {
5685 type Borrowed<'a> = Self;
5686 #[inline(always)]
5687 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5688 *value
5689 }
5690 }
5691
5692 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
5693 for VideoColorSpace
5694 {
5695 #[inline]
5696 unsafe fn encode(
5697 self,
5698 encoder: &mut fidl::encoding::Encoder<'_, D>,
5699 offset: usize,
5700 _depth: fidl::encoding::Depth,
5701 ) -> fidl::Result<()> {
5702 encoder.debug_check_bounds::<Self>(offset);
5703 encoder.write_num(self.into_primitive(), offset);
5704 Ok(())
5705 }
5706 }
5707
5708 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for VideoColorSpace {
5709 #[inline(always)]
5710 fn new_empty() -> Self {
5711 Self::Invalid
5712 }
5713
5714 #[inline]
5715 unsafe fn decode(
5716 &mut self,
5717 decoder: &mut fidl::encoding::Decoder<'_, D>,
5718 offset: usize,
5719 _depth: fidl::encoding::Depth,
5720 ) -> fidl::Result<()> {
5721 decoder.debug_check_bounds::<Self>(offset);
5722 let prim = decoder.read_num::<u32>(offset);
5723
5724 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
5725 Ok(())
5726 }
5727 }
5728
5729 impl fidl::encoding::ValueTypeMarker for AacConstantBitRate {
5730 type Borrowed<'a> = &'a Self;
5731 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5732 value
5733 }
5734 }
5735
5736 unsafe impl fidl::encoding::TypeMarker for AacConstantBitRate {
5737 type Owned = Self;
5738
5739 #[inline(always)]
5740 fn inline_align(_context: fidl::encoding::Context) -> usize {
5741 4
5742 }
5743
5744 #[inline(always)]
5745 fn inline_size(_context: fidl::encoding::Context) -> usize {
5746 4
5747 }
5748 #[inline(always)]
5749 fn encode_is_copy() -> bool {
5750 true
5751 }
5752
5753 #[inline(always)]
5754 fn decode_is_copy() -> bool {
5755 true
5756 }
5757 }
5758
5759 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AacConstantBitRate, D>
5760 for &AacConstantBitRate
5761 {
5762 #[inline]
5763 unsafe fn encode(
5764 self,
5765 encoder: &mut fidl::encoding::Encoder<'_, D>,
5766 offset: usize,
5767 _depth: fidl::encoding::Depth,
5768 ) -> fidl::Result<()> {
5769 encoder.debug_check_bounds::<AacConstantBitRate>(offset);
5770 unsafe {
5771 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
5773 (buf_ptr as *mut AacConstantBitRate)
5774 .write_unaligned((self as *const AacConstantBitRate).read());
5775 }
5778 Ok(())
5779 }
5780 }
5781 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
5782 fidl::encoding::Encode<AacConstantBitRate, D> for (T0,)
5783 {
5784 #[inline]
5785 unsafe fn encode(
5786 self,
5787 encoder: &mut fidl::encoding::Encoder<'_, D>,
5788 offset: usize,
5789 depth: fidl::encoding::Depth,
5790 ) -> fidl::Result<()> {
5791 encoder.debug_check_bounds::<AacConstantBitRate>(offset);
5792 self.0.encode(encoder, offset + 0, depth)?;
5796 Ok(())
5797 }
5798 }
5799
5800 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AacConstantBitRate {
5801 #[inline(always)]
5802 fn new_empty() -> Self {
5803 Self { bit_rate: fidl::new_empty!(u32, D) }
5804 }
5805
5806 #[inline]
5807 unsafe fn decode(
5808 &mut self,
5809 decoder: &mut fidl::encoding::Decoder<'_, D>,
5810 offset: usize,
5811 _depth: fidl::encoding::Depth,
5812 ) -> fidl::Result<()> {
5813 decoder.debug_check_bounds::<Self>(offset);
5814 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
5815 unsafe {
5818 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
5819 }
5820 Ok(())
5821 }
5822 }
5823
5824 impl fidl::encoding::ValueTypeMarker for AacEncoderSettings {
5825 type Borrowed<'a> = &'a Self;
5826 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5827 value
5828 }
5829 }
5830
5831 unsafe impl fidl::encoding::TypeMarker for AacEncoderSettings {
5832 type Owned = Self;
5833
5834 #[inline(always)]
5835 fn inline_align(_context: fidl::encoding::Context) -> usize {
5836 8
5837 }
5838
5839 #[inline(always)]
5840 fn inline_size(_context: fidl::encoding::Context) -> usize {
5841 48
5842 }
5843 }
5844
5845 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AacEncoderSettings, D>
5846 for &AacEncoderSettings
5847 {
5848 #[inline]
5849 unsafe fn encode(
5850 self,
5851 encoder: &mut fidl::encoding::Encoder<'_, D>,
5852 offset: usize,
5853 _depth: fidl::encoding::Depth,
5854 ) -> fidl::Result<()> {
5855 encoder.debug_check_bounds::<AacEncoderSettings>(offset);
5856 fidl::encoding::Encode::<AacEncoderSettings, D>::encode(
5858 (
5859 <AacTransport as fidl::encoding::ValueTypeMarker>::borrow(&self.transport),
5860 <AacChannelMode as fidl::encoding::ValueTypeMarker>::borrow(&self.channel_mode),
5861 <AacBitRate as fidl::encoding::ValueTypeMarker>::borrow(&self.bit_rate),
5862 <AacAudioObjectType as fidl::encoding::ValueTypeMarker>::borrow(&self.aot),
5863 ),
5864 encoder,
5865 offset,
5866 _depth,
5867 )
5868 }
5869 }
5870 unsafe impl<
5871 D: fidl::encoding::ResourceDialect,
5872 T0: fidl::encoding::Encode<AacTransport, D>,
5873 T1: fidl::encoding::Encode<AacChannelMode, D>,
5874 T2: fidl::encoding::Encode<AacBitRate, D>,
5875 T3: fidl::encoding::Encode<AacAudioObjectType, D>,
5876 > fidl::encoding::Encode<AacEncoderSettings, D> for (T0, T1, T2, T3)
5877 {
5878 #[inline]
5879 unsafe fn encode(
5880 self,
5881 encoder: &mut fidl::encoding::Encoder<'_, D>,
5882 offset: usize,
5883 depth: fidl::encoding::Depth,
5884 ) -> fidl::Result<()> {
5885 encoder.debug_check_bounds::<AacEncoderSettings>(offset);
5886 unsafe {
5889 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
5890 (ptr as *mut u64).write_unaligned(0);
5891 }
5892 unsafe {
5893 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(40);
5894 (ptr as *mut u64).write_unaligned(0);
5895 }
5896 self.0.encode(encoder, offset + 0, depth)?;
5898 self.1.encode(encoder, offset + 16, depth)?;
5899 self.2.encode(encoder, offset + 24, depth)?;
5900 self.3.encode(encoder, offset + 40, depth)?;
5901 Ok(())
5902 }
5903 }
5904
5905 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AacEncoderSettings {
5906 #[inline(always)]
5907 fn new_empty() -> Self {
5908 Self {
5909 transport: fidl::new_empty!(AacTransport, D),
5910 channel_mode: fidl::new_empty!(AacChannelMode, D),
5911 bit_rate: fidl::new_empty!(AacBitRate, D),
5912 aot: fidl::new_empty!(AacAudioObjectType, D),
5913 }
5914 }
5915
5916 #[inline]
5917 unsafe fn decode(
5918 &mut self,
5919 decoder: &mut fidl::encoding::Decoder<'_, D>,
5920 offset: usize,
5921 _depth: fidl::encoding::Depth,
5922 ) -> fidl::Result<()> {
5923 decoder.debug_check_bounds::<Self>(offset);
5924 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
5926 let padval = unsafe { (ptr as *const u64).read_unaligned() };
5927 let mask = 0xffffffff00000000u64;
5928 let maskedval = padval & mask;
5929 if maskedval != 0 {
5930 return Err(fidl::Error::NonZeroPadding {
5931 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
5932 });
5933 }
5934 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(40) };
5935 let padval = unsafe { (ptr as *const u64).read_unaligned() };
5936 let mask = 0xffffffff00000000u64;
5937 let maskedval = padval & mask;
5938 if maskedval != 0 {
5939 return Err(fidl::Error::NonZeroPadding {
5940 padding_start: offset + 40 + ((mask as u64).trailing_zeros() / 8) as usize,
5941 });
5942 }
5943 fidl::decode!(AacTransport, D, &mut self.transport, decoder, offset + 0, _depth)?;
5944 fidl::decode!(AacChannelMode, D, &mut self.channel_mode, decoder, offset + 16, _depth)?;
5945 fidl::decode!(AacBitRate, D, &mut self.bit_rate, decoder, offset + 24, _depth)?;
5946 fidl::decode!(AacAudioObjectType, D, &mut self.aot, decoder, offset + 40, _depth)?;
5947 Ok(())
5948 }
5949 }
5950
5951 impl fidl::encoding::ValueTypeMarker for AacTransportAdts {
5952 type Borrowed<'a> = &'a Self;
5953 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5954 value
5955 }
5956 }
5957
5958 unsafe impl fidl::encoding::TypeMarker for AacTransportAdts {
5959 type Owned = Self;
5960
5961 #[inline(always)]
5962 fn inline_align(_context: fidl::encoding::Context) -> usize {
5963 1
5964 }
5965
5966 #[inline(always)]
5967 fn inline_size(_context: fidl::encoding::Context) -> usize {
5968 1
5969 }
5970 }
5971
5972 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AacTransportAdts, D>
5973 for &AacTransportAdts
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::<AacTransportAdts>(offset);
5983 encoder.write_num(0u8, offset);
5984 Ok(())
5985 }
5986 }
5987
5988 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AacTransportAdts {
5989 #[inline(always)]
5990 fn new_empty() -> Self {
5991 Self
5992 }
5993
5994 #[inline]
5995 unsafe fn decode(
5996 &mut self,
5997 decoder: &mut fidl::encoding::Decoder<'_, D>,
5998 offset: usize,
5999 _depth: fidl::encoding::Depth,
6000 ) -> fidl::Result<()> {
6001 decoder.debug_check_bounds::<Self>(offset);
6002 match decoder.read_num::<u8>(offset) {
6003 0 => Ok(()),
6004 _ => Err(fidl::Error::Invalid),
6005 }
6006 }
6007 }
6008
6009 impl fidl::encoding::ValueTypeMarker for AacTransportLatm {
6010 type Borrowed<'a> = &'a Self;
6011 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6012 value
6013 }
6014 }
6015
6016 unsafe impl fidl::encoding::TypeMarker for AacTransportLatm {
6017 type Owned = Self;
6018
6019 #[inline(always)]
6020 fn inline_align(_context: fidl::encoding::Context) -> usize {
6021 1
6022 }
6023
6024 #[inline(always)]
6025 fn inline_size(_context: fidl::encoding::Context) -> usize {
6026 1
6027 }
6028 }
6029
6030 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AacTransportLatm, D>
6031 for &AacTransportLatm
6032 {
6033 #[inline]
6034 unsafe fn encode(
6035 self,
6036 encoder: &mut fidl::encoding::Encoder<'_, D>,
6037 offset: usize,
6038 _depth: fidl::encoding::Depth,
6039 ) -> fidl::Result<()> {
6040 encoder.debug_check_bounds::<AacTransportLatm>(offset);
6041 fidl::encoding::Encode::<AacTransportLatm, D>::encode(
6043 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.mux_config_present),),
6044 encoder,
6045 offset,
6046 _depth,
6047 )
6048 }
6049 }
6050 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
6051 fidl::encoding::Encode<AacTransportLatm, D> for (T0,)
6052 {
6053 #[inline]
6054 unsafe fn encode(
6055 self,
6056 encoder: &mut fidl::encoding::Encoder<'_, D>,
6057 offset: usize,
6058 depth: fidl::encoding::Depth,
6059 ) -> fidl::Result<()> {
6060 encoder.debug_check_bounds::<AacTransportLatm>(offset);
6061 self.0.encode(encoder, offset + 0, depth)?;
6065 Ok(())
6066 }
6067 }
6068
6069 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AacTransportLatm {
6070 #[inline(always)]
6071 fn new_empty() -> Self {
6072 Self { mux_config_present: fidl::new_empty!(bool, D) }
6073 }
6074
6075 #[inline]
6076 unsafe fn decode(
6077 &mut self,
6078 decoder: &mut fidl::encoding::Decoder<'_, D>,
6079 offset: usize,
6080 _depth: fidl::encoding::Depth,
6081 ) -> fidl::Result<()> {
6082 decoder.debug_check_bounds::<Self>(offset);
6083 fidl::decode!(bool, D, &mut self.mux_config_present, decoder, offset + 0, _depth)?;
6085 Ok(())
6086 }
6087 }
6088
6089 impl fidl::encoding::ValueTypeMarker for AacTransportRaw {
6090 type Borrowed<'a> = &'a Self;
6091 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6092 value
6093 }
6094 }
6095
6096 unsafe impl fidl::encoding::TypeMarker for AacTransportRaw {
6097 type Owned = Self;
6098
6099 #[inline(always)]
6100 fn inline_align(_context: fidl::encoding::Context) -> usize {
6101 1
6102 }
6103
6104 #[inline(always)]
6105 fn inline_size(_context: fidl::encoding::Context) -> usize {
6106 1
6107 }
6108 }
6109
6110 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AacTransportRaw, D>
6111 for &AacTransportRaw
6112 {
6113 #[inline]
6114 unsafe fn encode(
6115 self,
6116 encoder: &mut fidl::encoding::Encoder<'_, D>,
6117 offset: usize,
6118 _depth: fidl::encoding::Depth,
6119 ) -> fidl::Result<()> {
6120 encoder.debug_check_bounds::<AacTransportRaw>(offset);
6121 encoder.write_num(0u8, offset);
6122 Ok(())
6123 }
6124 }
6125
6126 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AacTransportRaw {
6127 #[inline(always)]
6128 fn new_empty() -> Self {
6129 Self
6130 }
6131
6132 #[inline]
6133 unsafe fn decode(
6134 &mut self,
6135 decoder: &mut fidl::encoding::Decoder<'_, D>,
6136 offset: usize,
6137 _depth: fidl::encoding::Depth,
6138 ) -> fidl::Result<()> {
6139 decoder.debug_check_bounds::<Self>(offset);
6140 match decoder.read_num::<u8>(offset) {
6141 0 => Ok(()),
6142 _ => Err(fidl::Error::Invalid),
6143 }
6144 }
6145 }
6146
6147 impl fidl::encoding::ValueTypeMarker for ActivityReporterWatchCaptureActivityResponse {
6148 type Borrowed<'a> = &'a Self;
6149 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6150 value
6151 }
6152 }
6153
6154 unsafe impl fidl::encoding::TypeMarker for ActivityReporterWatchCaptureActivityResponse {
6155 type Owned = Self;
6156
6157 #[inline(always)]
6158 fn inline_align(_context: fidl::encoding::Context) -> usize {
6159 8
6160 }
6161
6162 #[inline(always)]
6163 fn inline_size(_context: fidl::encoding::Context) -> usize {
6164 16
6165 }
6166 }
6167
6168 unsafe impl<D: fidl::encoding::ResourceDialect>
6169 fidl::encoding::Encode<ActivityReporterWatchCaptureActivityResponse, D>
6170 for &ActivityReporterWatchCaptureActivityResponse
6171 {
6172 #[inline]
6173 unsafe fn encode(
6174 self,
6175 encoder: &mut fidl::encoding::Encoder<'_, D>,
6176 offset: usize,
6177 _depth: fidl::encoding::Depth,
6178 ) -> fidl::Result<()> {
6179 encoder.debug_check_bounds::<ActivityReporterWatchCaptureActivityResponse>(offset);
6180 fidl::encoding::Encode::<ActivityReporterWatchCaptureActivityResponse, D>::encode(
6182 (
6183 <fidl::encoding::Vector<AudioCaptureUsage, 4> as fidl::encoding::ValueTypeMarker>::borrow(&self.active_usages),
6184 ),
6185 encoder, offset, _depth
6186 )
6187 }
6188 }
6189 unsafe impl<
6190 D: fidl::encoding::ResourceDialect,
6191 T0: fidl::encoding::Encode<fidl::encoding::Vector<AudioCaptureUsage, 4>, D>,
6192 > fidl::encoding::Encode<ActivityReporterWatchCaptureActivityResponse, D> for (T0,)
6193 {
6194 #[inline]
6195 unsafe fn encode(
6196 self,
6197 encoder: &mut fidl::encoding::Encoder<'_, D>,
6198 offset: usize,
6199 depth: fidl::encoding::Depth,
6200 ) -> fidl::Result<()> {
6201 encoder.debug_check_bounds::<ActivityReporterWatchCaptureActivityResponse>(offset);
6202 self.0.encode(encoder, offset + 0, depth)?;
6206 Ok(())
6207 }
6208 }
6209
6210 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6211 for ActivityReporterWatchCaptureActivityResponse
6212 {
6213 #[inline(always)]
6214 fn new_empty() -> Self {
6215 Self {
6216 active_usages: fidl::new_empty!(fidl::encoding::Vector<AudioCaptureUsage, 4>, D),
6217 }
6218 }
6219
6220 #[inline]
6221 unsafe fn decode(
6222 &mut self,
6223 decoder: &mut fidl::encoding::Decoder<'_, D>,
6224 offset: usize,
6225 _depth: fidl::encoding::Depth,
6226 ) -> fidl::Result<()> {
6227 decoder.debug_check_bounds::<Self>(offset);
6228 fidl::decode!(fidl::encoding::Vector<AudioCaptureUsage, 4>, D, &mut self.active_usages, decoder, offset + 0, _depth)?;
6230 Ok(())
6231 }
6232 }
6233
6234 impl fidl::encoding::ValueTypeMarker for ActivityReporterWatchRenderActivityResponse {
6235 type Borrowed<'a> = &'a Self;
6236 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6237 value
6238 }
6239 }
6240
6241 unsafe impl fidl::encoding::TypeMarker for ActivityReporterWatchRenderActivityResponse {
6242 type Owned = Self;
6243
6244 #[inline(always)]
6245 fn inline_align(_context: fidl::encoding::Context) -> usize {
6246 8
6247 }
6248
6249 #[inline(always)]
6250 fn inline_size(_context: fidl::encoding::Context) -> usize {
6251 16
6252 }
6253 }
6254
6255 unsafe impl<D: fidl::encoding::ResourceDialect>
6256 fidl::encoding::Encode<ActivityReporterWatchRenderActivityResponse, D>
6257 for &ActivityReporterWatchRenderActivityResponse
6258 {
6259 #[inline]
6260 unsafe fn encode(
6261 self,
6262 encoder: &mut fidl::encoding::Encoder<'_, D>,
6263 offset: usize,
6264 _depth: fidl::encoding::Depth,
6265 ) -> fidl::Result<()> {
6266 encoder.debug_check_bounds::<ActivityReporterWatchRenderActivityResponse>(offset);
6267 fidl::encoding::Encode::<ActivityReporterWatchRenderActivityResponse, D>::encode(
6269 (
6270 <fidl::encoding::Vector<AudioRenderUsage, 5> as fidl::encoding::ValueTypeMarker>::borrow(&self.active_usages),
6271 ),
6272 encoder, offset, _depth
6273 )
6274 }
6275 }
6276 unsafe impl<
6277 D: fidl::encoding::ResourceDialect,
6278 T0: fidl::encoding::Encode<fidl::encoding::Vector<AudioRenderUsage, 5>, D>,
6279 > fidl::encoding::Encode<ActivityReporterWatchRenderActivityResponse, 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::<ActivityReporterWatchRenderActivityResponse>(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 ActivityReporterWatchRenderActivityResponse
6299 {
6300 #[inline(always)]
6301 fn new_empty() -> Self {
6302 Self { active_usages: fidl::new_empty!(fidl::encoding::Vector<AudioRenderUsage, 5>, 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!(fidl::encoding::Vector<AudioRenderUsage, 5>, D, &mut self.active_usages, decoder, offset + 0, _depth)?;
6315 Ok(())
6316 }
6317 }
6318
6319 impl fidl::encoding::ValueTypeMarker for ActivityReporterWatchCaptureActivity2Response {
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 ActivityReporterWatchCaptureActivity2Response {
6327 type Owned = Self;
6328
6329 #[inline(always)]
6330 fn inline_align(_context: fidl::encoding::Context) -> usize {
6331 8
6332 }
6333
6334 #[inline(always)]
6335 fn inline_size(_context: fidl::encoding::Context) -> usize {
6336 16
6337 }
6338 }
6339
6340 unsafe impl<D: fidl::encoding::ResourceDialect>
6341 fidl::encoding::Encode<ActivityReporterWatchCaptureActivity2Response, D>
6342 for &ActivityReporterWatchCaptureActivity2Response
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::<ActivityReporterWatchCaptureActivity2Response>(offset);
6352 fidl::encoding::Encode::<ActivityReporterWatchCaptureActivity2Response, D>::encode(
6354 (
6355 <fidl::encoding::Vector<AudioCaptureUsage2, 8> as fidl::encoding::ValueTypeMarker>::borrow(&self.active_usages),
6356 ),
6357 encoder, offset, _depth
6358 )
6359 }
6360 }
6361 unsafe impl<
6362 D: fidl::encoding::ResourceDialect,
6363 T0: fidl::encoding::Encode<fidl::encoding::Vector<AudioCaptureUsage2, 8>, D>,
6364 > fidl::encoding::Encode<ActivityReporterWatchCaptureActivity2Response, D> for (T0,)
6365 {
6366 #[inline]
6367 unsafe fn encode(
6368 self,
6369 encoder: &mut fidl::encoding::Encoder<'_, D>,
6370 offset: usize,
6371 depth: fidl::encoding::Depth,
6372 ) -> fidl::Result<()> {
6373 encoder.debug_check_bounds::<ActivityReporterWatchCaptureActivity2Response>(offset);
6374 self.0.encode(encoder, offset + 0, depth)?;
6378 Ok(())
6379 }
6380 }
6381
6382 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6383 for ActivityReporterWatchCaptureActivity2Response
6384 {
6385 #[inline(always)]
6386 fn new_empty() -> Self {
6387 Self {
6388 active_usages: fidl::new_empty!(fidl::encoding::Vector<AudioCaptureUsage2, 8>, D),
6389 }
6390 }
6391
6392 #[inline]
6393 unsafe fn decode(
6394 &mut self,
6395 decoder: &mut fidl::encoding::Decoder<'_, D>,
6396 offset: usize,
6397 _depth: fidl::encoding::Depth,
6398 ) -> fidl::Result<()> {
6399 decoder.debug_check_bounds::<Self>(offset);
6400 fidl::decode!(fidl::encoding::Vector<AudioCaptureUsage2, 8>, D, &mut self.active_usages, decoder, offset + 0, _depth)?;
6402 Ok(())
6403 }
6404 }
6405
6406 impl fidl::encoding::ValueTypeMarker for ActivityReporterWatchRenderActivity2Response {
6407 type Borrowed<'a> = &'a Self;
6408 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6409 value
6410 }
6411 }
6412
6413 unsafe impl fidl::encoding::TypeMarker for ActivityReporterWatchRenderActivity2Response {
6414 type Owned = Self;
6415
6416 #[inline(always)]
6417 fn inline_align(_context: fidl::encoding::Context) -> usize {
6418 8
6419 }
6420
6421 #[inline(always)]
6422 fn inline_size(_context: fidl::encoding::Context) -> usize {
6423 16
6424 }
6425 }
6426
6427 unsafe impl<D: fidl::encoding::ResourceDialect>
6428 fidl::encoding::Encode<ActivityReporterWatchRenderActivity2Response, D>
6429 for &ActivityReporterWatchRenderActivity2Response
6430 {
6431 #[inline]
6432 unsafe fn encode(
6433 self,
6434 encoder: &mut fidl::encoding::Encoder<'_, D>,
6435 offset: usize,
6436 _depth: fidl::encoding::Depth,
6437 ) -> fidl::Result<()> {
6438 encoder.debug_check_bounds::<ActivityReporterWatchRenderActivity2Response>(offset);
6439 fidl::encoding::Encode::<ActivityReporterWatchRenderActivity2Response, D>::encode(
6441 (
6442 <fidl::encoding::Vector<AudioRenderUsage2, 8> as fidl::encoding::ValueTypeMarker>::borrow(&self.active_usages),
6443 ),
6444 encoder, offset, _depth
6445 )
6446 }
6447 }
6448 unsafe impl<
6449 D: fidl::encoding::ResourceDialect,
6450 T0: fidl::encoding::Encode<fidl::encoding::Vector<AudioRenderUsage2, 8>, D>,
6451 > fidl::encoding::Encode<ActivityReporterWatchRenderActivity2Response, D> for (T0,)
6452 {
6453 #[inline]
6454 unsafe fn encode(
6455 self,
6456 encoder: &mut fidl::encoding::Encoder<'_, D>,
6457 offset: usize,
6458 depth: fidl::encoding::Depth,
6459 ) -> fidl::Result<()> {
6460 encoder.debug_check_bounds::<ActivityReporterWatchRenderActivity2Response>(offset);
6461 self.0.encode(encoder, offset + 0, depth)?;
6465 Ok(())
6466 }
6467 }
6468
6469 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6470 for ActivityReporterWatchRenderActivity2Response
6471 {
6472 #[inline(always)]
6473 fn new_empty() -> Self {
6474 Self {
6475 active_usages: fidl::new_empty!(fidl::encoding::Vector<AudioRenderUsage2, 8>, D),
6476 }
6477 }
6478
6479 #[inline]
6480 unsafe fn decode(
6481 &mut self,
6482 decoder: &mut fidl::encoding::Decoder<'_, D>,
6483 offset: usize,
6484 _depth: fidl::encoding::Depth,
6485 ) -> fidl::Result<()> {
6486 decoder.debug_check_bounds::<Self>(offset);
6487 fidl::decode!(fidl::encoding::Vector<AudioRenderUsage2, 8>, D, &mut self.active_usages, decoder, offset + 0, _depth)?;
6489 Ok(())
6490 }
6491 }
6492
6493 impl fidl::encoding::ValueTypeMarker for AudioCapturerCaptureAtRequest {
6494 type Borrowed<'a> = &'a Self;
6495 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6496 value
6497 }
6498 }
6499
6500 unsafe impl fidl::encoding::TypeMarker for AudioCapturerCaptureAtRequest {
6501 type Owned = Self;
6502
6503 #[inline(always)]
6504 fn inline_align(_context: fidl::encoding::Context) -> usize {
6505 4
6506 }
6507
6508 #[inline(always)]
6509 fn inline_size(_context: fidl::encoding::Context) -> usize {
6510 12
6511 }
6512 #[inline(always)]
6513 fn encode_is_copy() -> bool {
6514 true
6515 }
6516
6517 #[inline(always)]
6518 fn decode_is_copy() -> bool {
6519 true
6520 }
6521 }
6522
6523 unsafe impl<D: fidl::encoding::ResourceDialect>
6524 fidl::encoding::Encode<AudioCapturerCaptureAtRequest, D>
6525 for &AudioCapturerCaptureAtRequest
6526 {
6527 #[inline]
6528 unsafe fn encode(
6529 self,
6530 encoder: &mut fidl::encoding::Encoder<'_, D>,
6531 offset: usize,
6532 _depth: fidl::encoding::Depth,
6533 ) -> fidl::Result<()> {
6534 encoder.debug_check_bounds::<AudioCapturerCaptureAtRequest>(offset);
6535 unsafe {
6536 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
6538 (buf_ptr as *mut AudioCapturerCaptureAtRequest)
6539 .write_unaligned((self as *const AudioCapturerCaptureAtRequest).read());
6540 }
6543 Ok(())
6544 }
6545 }
6546 unsafe impl<
6547 D: fidl::encoding::ResourceDialect,
6548 T0: fidl::encoding::Encode<u32, D>,
6549 T1: fidl::encoding::Encode<u32, D>,
6550 T2: fidl::encoding::Encode<u32, D>,
6551 > fidl::encoding::Encode<AudioCapturerCaptureAtRequest, D> for (T0, T1, T2)
6552 {
6553 #[inline]
6554 unsafe fn encode(
6555 self,
6556 encoder: &mut fidl::encoding::Encoder<'_, D>,
6557 offset: usize,
6558 depth: fidl::encoding::Depth,
6559 ) -> fidl::Result<()> {
6560 encoder.debug_check_bounds::<AudioCapturerCaptureAtRequest>(offset);
6561 self.0.encode(encoder, offset + 0, depth)?;
6565 self.1.encode(encoder, offset + 4, depth)?;
6566 self.2.encode(encoder, offset + 8, depth)?;
6567 Ok(())
6568 }
6569 }
6570
6571 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6572 for AudioCapturerCaptureAtRequest
6573 {
6574 #[inline(always)]
6575 fn new_empty() -> Self {
6576 Self {
6577 payload_buffer_id: fidl::new_empty!(u32, D),
6578 payload_offset: fidl::new_empty!(u32, D),
6579 frames: fidl::new_empty!(u32, D),
6580 }
6581 }
6582
6583 #[inline]
6584 unsafe fn decode(
6585 &mut self,
6586 decoder: &mut fidl::encoding::Decoder<'_, D>,
6587 offset: usize,
6588 _depth: fidl::encoding::Depth,
6589 ) -> fidl::Result<()> {
6590 decoder.debug_check_bounds::<Self>(offset);
6591 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
6592 unsafe {
6595 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 12);
6596 }
6597 Ok(())
6598 }
6599 }
6600
6601 impl fidl::encoding::ValueTypeMarker for AudioCapturerCaptureAtResponse {
6602 type Borrowed<'a> = &'a Self;
6603 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6604 value
6605 }
6606 }
6607
6608 unsafe impl fidl::encoding::TypeMarker for AudioCapturerCaptureAtResponse {
6609 type Owned = Self;
6610
6611 #[inline(always)]
6612 fn inline_align(_context: fidl::encoding::Context) -> usize {
6613 8
6614 }
6615
6616 #[inline(always)]
6617 fn inline_size(_context: fidl::encoding::Context) -> usize {
6618 56
6619 }
6620 }
6621
6622 unsafe impl<D: fidl::encoding::ResourceDialect>
6623 fidl::encoding::Encode<AudioCapturerCaptureAtResponse, D>
6624 for &AudioCapturerCaptureAtResponse
6625 {
6626 #[inline]
6627 unsafe fn encode(
6628 self,
6629 encoder: &mut fidl::encoding::Encoder<'_, D>,
6630 offset: usize,
6631 _depth: fidl::encoding::Depth,
6632 ) -> fidl::Result<()> {
6633 encoder.debug_check_bounds::<AudioCapturerCaptureAtResponse>(offset);
6634 unsafe {
6635 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
6637 (buf_ptr as *mut AudioCapturerCaptureAtResponse)
6638 .write_unaligned((self as *const AudioCapturerCaptureAtResponse).read());
6639 let padding_ptr = buf_ptr.offset(8) as *mut u64;
6642 let padding_mask = 0xffffffff00000000u64;
6643 padding_ptr.write_unaligned(padding_ptr.read_unaligned() & !padding_mask);
6644 let padding_ptr = buf_ptr.offset(32) as *mut u64;
6645 let padding_mask = 0xffffffff00000000u64;
6646 padding_ptr.write_unaligned(padding_ptr.read_unaligned() & !padding_mask);
6647 }
6648 Ok(())
6649 }
6650 }
6651 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<StreamPacket, D>>
6652 fidl::encoding::Encode<AudioCapturerCaptureAtResponse, D> for (T0,)
6653 {
6654 #[inline]
6655 unsafe fn encode(
6656 self,
6657 encoder: &mut fidl::encoding::Encoder<'_, D>,
6658 offset: usize,
6659 depth: fidl::encoding::Depth,
6660 ) -> fidl::Result<()> {
6661 encoder.debug_check_bounds::<AudioCapturerCaptureAtResponse>(offset);
6662 self.0.encode(encoder, offset + 0, depth)?;
6666 Ok(())
6667 }
6668 }
6669
6670 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6671 for AudioCapturerCaptureAtResponse
6672 {
6673 #[inline(always)]
6674 fn new_empty() -> Self {
6675 Self { captured_packet: fidl::new_empty!(StreamPacket, D) }
6676 }
6677
6678 #[inline]
6679 unsafe fn decode(
6680 &mut self,
6681 decoder: &mut fidl::encoding::Decoder<'_, D>,
6682 offset: usize,
6683 _depth: fidl::encoding::Depth,
6684 ) -> fidl::Result<()> {
6685 decoder.debug_check_bounds::<Self>(offset);
6686 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
6687 let ptr = unsafe { buf_ptr.offset(8) };
6689 let padval = unsafe { (ptr as *const u64).read_unaligned() };
6690 let mask = 0xffffffff00000000u64;
6691 let maskedval = padval & mask;
6692 if maskedval != 0 {
6693 return Err(fidl::Error::NonZeroPadding {
6694 padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
6695 });
6696 }
6697 let ptr = unsafe { buf_ptr.offset(32) };
6698 let padval = unsafe { (ptr as *const u64).read_unaligned() };
6699 let mask = 0xffffffff00000000u64;
6700 let maskedval = padval & mask;
6701 if maskedval != 0 {
6702 return Err(fidl::Error::NonZeroPadding {
6703 padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
6704 });
6705 }
6706 unsafe {
6708 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 56);
6709 }
6710 Ok(())
6711 }
6712 }
6713
6714 impl fidl::encoding::ValueTypeMarker for AudioCapturerGetStreamTypeResponse {
6715 type Borrowed<'a> = &'a Self;
6716 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6717 value
6718 }
6719 }
6720
6721 unsafe impl fidl::encoding::TypeMarker for AudioCapturerGetStreamTypeResponse {
6722 type Owned = Self;
6723
6724 #[inline(always)]
6725 fn inline_align(_context: fidl::encoding::Context) -> usize {
6726 8
6727 }
6728
6729 #[inline(always)]
6730 fn inline_size(_context: fidl::encoding::Context) -> usize {
6731 48
6732 }
6733 }
6734
6735 unsafe impl<D: fidl::encoding::ResourceDialect>
6736 fidl::encoding::Encode<AudioCapturerGetStreamTypeResponse, D>
6737 for &AudioCapturerGetStreamTypeResponse
6738 {
6739 #[inline]
6740 unsafe fn encode(
6741 self,
6742 encoder: &mut fidl::encoding::Encoder<'_, D>,
6743 offset: usize,
6744 _depth: fidl::encoding::Depth,
6745 ) -> fidl::Result<()> {
6746 encoder.debug_check_bounds::<AudioCapturerGetStreamTypeResponse>(offset);
6747 fidl::encoding::Encode::<AudioCapturerGetStreamTypeResponse, D>::encode(
6749 (<StreamType as fidl::encoding::ValueTypeMarker>::borrow(&self.stream_type),),
6750 encoder,
6751 offset,
6752 _depth,
6753 )
6754 }
6755 }
6756 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<StreamType, D>>
6757 fidl::encoding::Encode<AudioCapturerGetStreamTypeResponse, D> for (T0,)
6758 {
6759 #[inline]
6760 unsafe fn encode(
6761 self,
6762 encoder: &mut fidl::encoding::Encoder<'_, D>,
6763 offset: usize,
6764 depth: fidl::encoding::Depth,
6765 ) -> fidl::Result<()> {
6766 encoder.debug_check_bounds::<AudioCapturerGetStreamTypeResponse>(offset);
6767 self.0.encode(encoder, offset + 0, depth)?;
6771 Ok(())
6772 }
6773 }
6774
6775 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6776 for AudioCapturerGetStreamTypeResponse
6777 {
6778 #[inline(always)]
6779 fn new_empty() -> Self {
6780 Self { stream_type: fidl::new_empty!(StreamType, D) }
6781 }
6782
6783 #[inline]
6784 unsafe fn decode(
6785 &mut self,
6786 decoder: &mut fidl::encoding::Decoder<'_, D>,
6787 offset: usize,
6788 _depth: fidl::encoding::Depth,
6789 ) -> fidl::Result<()> {
6790 decoder.debug_check_bounds::<Self>(offset);
6791 fidl::decode!(StreamType, D, &mut self.stream_type, decoder, offset + 0, _depth)?;
6793 Ok(())
6794 }
6795 }
6796
6797 impl fidl::encoding::ValueTypeMarker for AudioCapturerSetPcmStreamTypeRequest {
6798 type Borrowed<'a> = &'a Self;
6799 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6800 value
6801 }
6802 }
6803
6804 unsafe impl fidl::encoding::TypeMarker for AudioCapturerSetPcmStreamTypeRequest {
6805 type Owned = Self;
6806
6807 #[inline(always)]
6808 fn inline_align(_context: fidl::encoding::Context) -> usize {
6809 4
6810 }
6811
6812 #[inline(always)]
6813 fn inline_size(_context: fidl::encoding::Context) -> usize {
6814 12
6815 }
6816 }
6817
6818 unsafe impl<D: fidl::encoding::ResourceDialect>
6819 fidl::encoding::Encode<AudioCapturerSetPcmStreamTypeRequest, D>
6820 for &AudioCapturerSetPcmStreamTypeRequest
6821 {
6822 #[inline]
6823 unsafe fn encode(
6824 self,
6825 encoder: &mut fidl::encoding::Encoder<'_, D>,
6826 offset: usize,
6827 _depth: fidl::encoding::Depth,
6828 ) -> fidl::Result<()> {
6829 encoder.debug_check_bounds::<AudioCapturerSetPcmStreamTypeRequest>(offset);
6830 fidl::encoding::Encode::<AudioCapturerSetPcmStreamTypeRequest, D>::encode(
6832 (<AudioStreamType as fidl::encoding::ValueTypeMarker>::borrow(&self.stream_type),),
6833 encoder,
6834 offset,
6835 _depth,
6836 )
6837 }
6838 }
6839 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<AudioStreamType, D>>
6840 fidl::encoding::Encode<AudioCapturerSetPcmStreamTypeRequest, D> for (T0,)
6841 {
6842 #[inline]
6843 unsafe fn encode(
6844 self,
6845 encoder: &mut fidl::encoding::Encoder<'_, D>,
6846 offset: usize,
6847 depth: fidl::encoding::Depth,
6848 ) -> fidl::Result<()> {
6849 encoder.debug_check_bounds::<AudioCapturerSetPcmStreamTypeRequest>(offset);
6850 self.0.encode(encoder, offset + 0, depth)?;
6854 Ok(())
6855 }
6856 }
6857
6858 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6859 for AudioCapturerSetPcmStreamTypeRequest
6860 {
6861 #[inline(always)]
6862 fn new_empty() -> Self {
6863 Self { stream_type: fidl::new_empty!(AudioStreamType, D) }
6864 }
6865
6866 #[inline]
6867 unsafe fn decode(
6868 &mut self,
6869 decoder: &mut fidl::encoding::Decoder<'_, D>,
6870 offset: usize,
6871 _depth: fidl::encoding::Depth,
6872 ) -> fidl::Result<()> {
6873 decoder.debug_check_bounds::<Self>(offset);
6874 fidl::decode!(AudioStreamType, D, &mut self.stream_type, decoder, offset + 0, _depth)?;
6876 Ok(())
6877 }
6878 }
6879
6880 impl fidl::encoding::ValueTypeMarker for AudioCapturerSetUsage2Request {
6881 type Borrowed<'a> = &'a Self;
6882 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6883 value
6884 }
6885 }
6886
6887 unsafe impl fidl::encoding::TypeMarker for AudioCapturerSetUsage2Request {
6888 type Owned = Self;
6889
6890 #[inline(always)]
6891 fn inline_align(_context: fidl::encoding::Context) -> usize {
6892 4
6893 }
6894
6895 #[inline(always)]
6896 fn inline_size(_context: fidl::encoding::Context) -> usize {
6897 4
6898 }
6899 }
6900
6901 unsafe impl<D: fidl::encoding::ResourceDialect>
6902 fidl::encoding::Encode<AudioCapturerSetUsage2Request, D>
6903 for &AudioCapturerSetUsage2Request
6904 {
6905 #[inline]
6906 unsafe fn encode(
6907 self,
6908 encoder: &mut fidl::encoding::Encoder<'_, D>,
6909 offset: usize,
6910 _depth: fidl::encoding::Depth,
6911 ) -> fidl::Result<()> {
6912 encoder.debug_check_bounds::<AudioCapturerSetUsage2Request>(offset);
6913 fidl::encoding::Encode::<AudioCapturerSetUsage2Request, D>::encode(
6915 (<AudioCaptureUsage2 as fidl::encoding::ValueTypeMarker>::borrow(&self.usage),),
6916 encoder,
6917 offset,
6918 _depth,
6919 )
6920 }
6921 }
6922 unsafe impl<
6923 D: fidl::encoding::ResourceDialect,
6924 T0: fidl::encoding::Encode<AudioCaptureUsage2, D>,
6925 > fidl::encoding::Encode<AudioCapturerSetUsage2Request, D> for (T0,)
6926 {
6927 #[inline]
6928 unsafe fn encode(
6929 self,
6930 encoder: &mut fidl::encoding::Encoder<'_, D>,
6931 offset: usize,
6932 depth: fidl::encoding::Depth,
6933 ) -> fidl::Result<()> {
6934 encoder.debug_check_bounds::<AudioCapturerSetUsage2Request>(offset);
6935 self.0.encode(encoder, offset + 0, depth)?;
6939 Ok(())
6940 }
6941 }
6942
6943 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6944 for AudioCapturerSetUsage2Request
6945 {
6946 #[inline(always)]
6947 fn new_empty() -> Self {
6948 Self { usage: fidl::new_empty!(AudioCaptureUsage2, D) }
6949 }
6950
6951 #[inline]
6952 unsafe fn decode(
6953 &mut self,
6954 decoder: &mut fidl::encoding::Decoder<'_, D>,
6955 offset: usize,
6956 _depth: fidl::encoding::Depth,
6957 ) -> fidl::Result<()> {
6958 decoder.debug_check_bounds::<Self>(offset);
6959 fidl::decode!(AudioCaptureUsage2, D, &mut self.usage, decoder, offset + 0, _depth)?;
6961 Ok(())
6962 }
6963 }
6964
6965 impl fidl::encoding::ValueTypeMarker for AudioCapturerSetUsageRequest {
6966 type Borrowed<'a> = &'a Self;
6967 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6968 value
6969 }
6970 }
6971
6972 unsafe impl fidl::encoding::TypeMarker for AudioCapturerSetUsageRequest {
6973 type Owned = Self;
6974
6975 #[inline(always)]
6976 fn inline_align(_context: fidl::encoding::Context) -> usize {
6977 4
6978 }
6979
6980 #[inline(always)]
6981 fn inline_size(_context: fidl::encoding::Context) -> usize {
6982 4
6983 }
6984 }
6985
6986 unsafe impl<D: fidl::encoding::ResourceDialect>
6987 fidl::encoding::Encode<AudioCapturerSetUsageRequest, D> for &AudioCapturerSetUsageRequest
6988 {
6989 #[inline]
6990 unsafe fn encode(
6991 self,
6992 encoder: &mut fidl::encoding::Encoder<'_, D>,
6993 offset: usize,
6994 _depth: fidl::encoding::Depth,
6995 ) -> fidl::Result<()> {
6996 encoder.debug_check_bounds::<AudioCapturerSetUsageRequest>(offset);
6997 fidl::encoding::Encode::<AudioCapturerSetUsageRequest, D>::encode(
6999 (<AudioCaptureUsage as fidl::encoding::ValueTypeMarker>::borrow(&self.usage),),
7000 encoder,
7001 offset,
7002 _depth,
7003 )
7004 }
7005 }
7006 unsafe impl<
7007 D: fidl::encoding::ResourceDialect,
7008 T0: fidl::encoding::Encode<AudioCaptureUsage, D>,
7009 > fidl::encoding::Encode<AudioCapturerSetUsageRequest, D> for (T0,)
7010 {
7011 #[inline]
7012 unsafe fn encode(
7013 self,
7014 encoder: &mut fidl::encoding::Encoder<'_, D>,
7015 offset: usize,
7016 depth: fidl::encoding::Depth,
7017 ) -> fidl::Result<()> {
7018 encoder.debug_check_bounds::<AudioCapturerSetUsageRequest>(offset);
7019 self.0.encode(encoder, offset + 0, depth)?;
7023 Ok(())
7024 }
7025 }
7026
7027 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7028 for AudioCapturerSetUsageRequest
7029 {
7030 #[inline(always)]
7031 fn new_empty() -> Self {
7032 Self { usage: fidl::new_empty!(AudioCaptureUsage, D) }
7033 }
7034
7035 #[inline]
7036 unsafe fn decode(
7037 &mut self,
7038 decoder: &mut fidl::encoding::Decoder<'_, D>,
7039 offset: usize,
7040 _depth: fidl::encoding::Depth,
7041 ) -> fidl::Result<()> {
7042 decoder.debug_check_bounds::<Self>(offset);
7043 fidl::decode!(AudioCaptureUsage, D, &mut self.usage, decoder, offset + 0, _depth)?;
7045 Ok(())
7046 }
7047 }
7048
7049 impl fidl::encoding::ValueTypeMarker for AudioCapturerStartAsyncCaptureRequest {
7050 type Borrowed<'a> = &'a Self;
7051 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7052 value
7053 }
7054 }
7055
7056 unsafe impl fidl::encoding::TypeMarker for AudioCapturerStartAsyncCaptureRequest {
7057 type Owned = Self;
7058
7059 #[inline(always)]
7060 fn inline_align(_context: fidl::encoding::Context) -> usize {
7061 4
7062 }
7063
7064 #[inline(always)]
7065 fn inline_size(_context: fidl::encoding::Context) -> usize {
7066 4
7067 }
7068 #[inline(always)]
7069 fn encode_is_copy() -> bool {
7070 true
7071 }
7072
7073 #[inline(always)]
7074 fn decode_is_copy() -> bool {
7075 true
7076 }
7077 }
7078
7079 unsafe impl<D: fidl::encoding::ResourceDialect>
7080 fidl::encoding::Encode<AudioCapturerStartAsyncCaptureRequest, D>
7081 for &AudioCapturerStartAsyncCaptureRequest
7082 {
7083 #[inline]
7084 unsafe fn encode(
7085 self,
7086 encoder: &mut fidl::encoding::Encoder<'_, D>,
7087 offset: usize,
7088 _depth: fidl::encoding::Depth,
7089 ) -> fidl::Result<()> {
7090 encoder.debug_check_bounds::<AudioCapturerStartAsyncCaptureRequest>(offset);
7091 unsafe {
7092 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
7094 (buf_ptr as *mut AudioCapturerStartAsyncCaptureRequest)
7095 .write_unaligned((self as *const AudioCapturerStartAsyncCaptureRequest).read());
7096 }
7099 Ok(())
7100 }
7101 }
7102 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
7103 fidl::encoding::Encode<AudioCapturerStartAsyncCaptureRequest, D> for (T0,)
7104 {
7105 #[inline]
7106 unsafe fn encode(
7107 self,
7108 encoder: &mut fidl::encoding::Encoder<'_, D>,
7109 offset: usize,
7110 depth: fidl::encoding::Depth,
7111 ) -> fidl::Result<()> {
7112 encoder.debug_check_bounds::<AudioCapturerStartAsyncCaptureRequest>(offset);
7113 self.0.encode(encoder, offset + 0, depth)?;
7117 Ok(())
7118 }
7119 }
7120
7121 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7122 for AudioCapturerStartAsyncCaptureRequest
7123 {
7124 #[inline(always)]
7125 fn new_empty() -> Self {
7126 Self { frames_per_packet: fidl::new_empty!(u32, D) }
7127 }
7128
7129 #[inline]
7130 unsafe fn decode(
7131 &mut self,
7132 decoder: &mut fidl::encoding::Decoder<'_, D>,
7133 offset: usize,
7134 _depth: fidl::encoding::Depth,
7135 ) -> fidl::Result<()> {
7136 decoder.debug_check_bounds::<Self>(offset);
7137 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
7138 unsafe {
7141 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
7142 }
7143 Ok(())
7144 }
7145 }
7146
7147 impl fidl::encoding::ValueTypeMarker for AudioCompressedFormatAac {
7148 type Borrowed<'a> = &'a Self;
7149 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7150 value
7151 }
7152 }
7153
7154 unsafe impl fidl::encoding::TypeMarker for AudioCompressedFormatAac {
7155 type Owned = Self;
7156
7157 #[inline(always)]
7158 fn inline_align(_context: fidl::encoding::Context) -> usize {
7159 1
7160 }
7161
7162 #[inline(always)]
7163 fn inline_size(_context: fidl::encoding::Context) -> usize {
7164 1
7165 }
7166 }
7167
7168 unsafe impl<D: fidl::encoding::ResourceDialect>
7169 fidl::encoding::Encode<AudioCompressedFormatAac, D> for &AudioCompressedFormatAac
7170 {
7171 #[inline]
7172 unsafe fn encode(
7173 self,
7174 encoder: &mut fidl::encoding::Encoder<'_, D>,
7175 offset: usize,
7176 _depth: fidl::encoding::Depth,
7177 ) -> fidl::Result<()> {
7178 encoder.debug_check_bounds::<AudioCompressedFormatAac>(offset);
7179 encoder.write_num(0u8, offset);
7180 Ok(())
7181 }
7182 }
7183
7184 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7185 for AudioCompressedFormatAac
7186 {
7187 #[inline(always)]
7188 fn new_empty() -> Self {
7189 Self
7190 }
7191
7192 #[inline]
7193 unsafe fn decode(
7194 &mut self,
7195 decoder: &mut fidl::encoding::Decoder<'_, D>,
7196 offset: usize,
7197 _depth: fidl::encoding::Depth,
7198 ) -> fidl::Result<()> {
7199 decoder.debug_check_bounds::<Self>(offset);
7200 match decoder.read_num::<u8>(offset) {
7201 0 => Ok(()),
7202 _ => Err(fidl::Error::Invalid),
7203 }
7204 }
7205 }
7206
7207 impl fidl::encoding::ValueTypeMarker for AudioCompressedFormatSbc {
7208 type Borrowed<'a> = &'a Self;
7209 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7210 value
7211 }
7212 }
7213
7214 unsafe impl fidl::encoding::TypeMarker for AudioCompressedFormatSbc {
7215 type Owned = Self;
7216
7217 #[inline(always)]
7218 fn inline_align(_context: fidl::encoding::Context) -> usize {
7219 1
7220 }
7221
7222 #[inline(always)]
7223 fn inline_size(_context: fidl::encoding::Context) -> usize {
7224 1
7225 }
7226 }
7227
7228 unsafe impl<D: fidl::encoding::ResourceDialect>
7229 fidl::encoding::Encode<AudioCompressedFormatSbc, D> for &AudioCompressedFormatSbc
7230 {
7231 #[inline]
7232 unsafe fn encode(
7233 self,
7234 encoder: &mut fidl::encoding::Encoder<'_, D>,
7235 offset: usize,
7236 _depth: fidl::encoding::Depth,
7237 ) -> fidl::Result<()> {
7238 encoder.debug_check_bounds::<AudioCompressedFormatSbc>(offset);
7239 encoder.write_num(0u8, offset);
7240 Ok(())
7241 }
7242 }
7243
7244 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7245 for AudioCompressedFormatSbc
7246 {
7247 #[inline(always)]
7248 fn new_empty() -> Self {
7249 Self
7250 }
7251
7252 #[inline]
7253 unsafe fn decode(
7254 &mut self,
7255 decoder: &mut fidl::encoding::Decoder<'_, D>,
7256 offset: usize,
7257 _depth: fidl::encoding::Depth,
7258 ) -> fidl::Result<()> {
7259 decoder.debug_check_bounds::<Self>(offset);
7260 match decoder.read_num::<u8>(offset) {
7261 0 => Ok(()),
7262 _ => Err(fidl::Error::Invalid),
7263 }
7264 }
7265 }
7266
7267 impl fidl::encoding::ValueTypeMarker for AudioConsumerSetRateRequest {
7268 type Borrowed<'a> = &'a Self;
7269 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7270 value
7271 }
7272 }
7273
7274 unsafe impl fidl::encoding::TypeMarker for AudioConsumerSetRateRequest {
7275 type Owned = Self;
7276
7277 #[inline(always)]
7278 fn inline_align(_context: fidl::encoding::Context) -> usize {
7279 4
7280 }
7281
7282 #[inline(always)]
7283 fn inline_size(_context: fidl::encoding::Context) -> usize {
7284 4
7285 }
7286 }
7287
7288 unsafe impl<D: fidl::encoding::ResourceDialect>
7289 fidl::encoding::Encode<AudioConsumerSetRateRequest, D> for &AudioConsumerSetRateRequest
7290 {
7291 #[inline]
7292 unsafe fn encode(
7293 self,
7294 encoder: &mut fidl::encoding::Encoder<'_, D>,
7295 offset: usize,
7296 _depth: fidl::encoding::Depth,
7297 ) -> fidl::Result<()> {
7298 encoder.debug_check_bounds::<AudioConsumerSetRateRequest>(offset);
7299 fidl::encoding::Encode::<AudioConsumerSetRateRequest, D>::encode(
7301 (<f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.rate),),
7302 encoder,
7303 offset,
7304 _depth,
7305 )
7306 }
7307 }
7308 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<f32, D>>
7309 fidl::encoding::Encode<AudioConsumerSetRateRequest, D> for (T0,)
7310 {
7311 #[inline]
7312 unsafe fn encode(
7313 self,
7314 encoder: &mut fidl::encoding::Encoder<'_, D>,
7315 offset: usize,
7316 depth: fidl::encoding::Depth,
7317 ) -> fidl::Result<()> {
7318 encoder.debug_check_bounds::<AudioConsumerSetRateRequest>(offset);
7319 self.0.encode(encoder, offset + 0, depth)?;
7323 Ok(())
7324 }
7325 }
7326
7327 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7328 for AudioConsumerSetRateRequest
7329 {
7330 #[inline(always)]
7331 fn new_empty() -> Self {
7332 Self { rate: fidl::new_empty!(f32, D) }
7333 }
7334
7335 #[inline]
7336 unsafe fn decode(
7337 &mut self,
7338 decoder: &mut fidl::encoding::Decoder<'_, D>,
7339 offset: usize,
7340 _depth: fidl::encoding::Depth,
7341 ) -> fidl::Result<()> {
7342 decoder.debug_check_bounds::<Self>(offset);
7343 fidl::decode!(f32, D, &mut self.rate, decoder, offset + 0, _depth)?;
7345 Ok(())
7346 }
7347 }
7348
7349 impl fidl::encoding::ValueTypeMarker for AudioConsumerStartRequest {
7350 type Borrowed<'a> = &'a Self;
7351 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7352 value
7353 }
7354 }
7355
7356 unsafe impl fidl::encoding::TypeMarker for AudioConsumerStartRequest {
7357 type Owned = Self;
7358
7359 #[inline(always)]
7360 fn inline_align(_context: fidl::encoding::Context) -> usize {
7361 8
7362 }
7363
7364 #[inline(always)]
7365 fn inline_size(_context: fidl::encoding::Context) -> usize {
7366 24
7367 }
7368 }
7369
7370 unsafe impl<D: fidl::encoding::ResourceDialect>
7371 fidl::encoding::Encode<AudioConsumerStartRequest, D> for &AudioConsumerStartRequest
7372 {
7373 #[inline]
7374 unsafe fn encode(
7375 self,
7376 encoder: &mut fidl::encoding::Encoder<'_, D>,
7377 offset: usize,
7378 _depth: fidl::encoding::Depth,
7379 ) -> fidl::Result<()> {
7380 encoder.debug_check_bounds::<AudioConsumerStartRequest>(offset);
7381 fidl::encoding::Encode::<AudioConsumerStartRequest, D>::encode(
7383 (
7384 <AudioConsumerStartFlags as fidl::encoding::ValueTypeMarker>::borrow(
7385 &self.flags,
7386 ),
7387 <i64 as fidl::encoding::ValueTypeMarker>::borrow(&self.reference_time),
7388 <i64 as fidl::encoding::ValueTypeMarker>::borrow(&self.media_time),
7389 ),
7390 encoder,
7391 offset,
7392 _depth,
7393 )
7394 }
7395 }
7396 unsafe impl<
7397 D: fidl::encoding::ResourceDialect,
7398 T0: fidl::encoding::Encode<AudioConsumerStartFlags, D>,
7399 T1: fidl::encoding::Encode<i64, D>,
7400 T2: fidl::encoding::Encode<i64, D>,
7401 > fidl::encoding::Encode<AudioConsumerStartRequest, D> for (T0, T1, T2)
7402 {
7403 #[inline]
7404 unsafe fn encode(
7405 self,
7406 encoder: &mut fidl::encoding::Encoder<'_, D>,
7407 offset: usize,
7408 depth: fidl::encoding::Depth,
7409 ) -> fidl::Result<()> {
7410 encoder.debug_check_bounds::<AudioConsumerStartRequest>(offset);
7411 unsafe {
7414 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
7415 (ptr as *mut u64).write_unaligned(0);
7416 }
7417 self.0.encode(encoder, offset + 0, depth)?;
7419 self.1.encode(encoder, offset + 8, depth)?;
7420 self.2.encode(encoder, offset + 16, depth)?;
7421 Ok(())
7422 }
7423 }
7424
7425 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7426 for AudioConsumerStartRequest
7427 {
7428 #[inline(always)]
7429 fn new_empty() -> Self {
7430 Self {
7431 flags: fidl::new_empty!(AudioConsumerStartFlags, D),
7432 reference_time: fidl::new_empty!(i64, D),
7433 media_time: fidl::new_empty!(i64, D),
7434 }
7435 }
7436
7437 #[inline]
7438 unsafe fn decode(
7439 &mut self,
7440 decoder: &mut fidl::encoding::Decoder<'_, D>,
7441 offset: usize,
7442 _depth: fidl::encoding::Depth,
7443 ) -> fidl::Result<()> {
7444 decoder.debug_check_bounds::<Self>(offset);
7445 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
7447 let padval = unsafe { (ptr as *const u64).read_unaligned() };
7448 let mask = 0xffffffff00000000u64;
7449 let maskedval = padval & mask;
7450 if maskedval != 0 {
7451 return Err(fidl::Error::NonZeroPadding {
7452 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
7453 });
7454 }
7455 fidl::decode!(
7456 AudioConsumerStartFlags,
7457 D,
7458 &mut self.flags,
7459 decoder,
7460 offset + 0,
7461 _depth
7462 )?;
7463 fidl::decode!(i64, D, &mut self.reference_time, decoder, offset + 8, _depth)?;
7464 fidl::decode!(i64, D, &mut self.media_time, decoder, offset + 16, _depth)?;
7465 Ok(())
7466 }
7467 }
7468
7469 impl fidl::encoding::ValueTypeMarker for AudioConsumerWatchStatusResponse {
7470 type Borrowed<'a> = &'a Self;
7471 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7472 value
7473 }
7474 }
7475
7476 unsafe impl fidl::encoding::TypeMarker for AudioConsumerWatchStatusResponse {
7477 type Owned = Self;
7478
7479 #[inline(always)]
7480 fn inline_align(_context: fidl::encoding::Context) -> usize {
7481 8
7482 }
7483
7484 #[inline(always)]
7485 fn inline_size(_context: fidl::encoding::Context) -> usize {
7486 16
7487 }
7488 }
7489
7490 unsafe impl<D: fidl::encoding::ResourceDialect>
7491 fidl::encoding::Encode<AudioConsumerWatchStatusResponse, D>
7492 for &AudioConsumerWatchStatusResponse
7493 {
7494 #[inline]
7495 unsafe fn encode(
7496 self,
7497 encoder: &mut fidl::encoding::Encoder<'_, D>,
7498 offset: usize,
7499 _depth: fidl::encoding::Depth,
7500 ) -> fidl::Result<()> {
7501 encoder.debug_check_bounds::<AudioConsumerWatchStatusResponse>(offset);
7502 fidl::encoding::Encode::<AudioConsumerWatchStatusResponse, D>::encode(
7504 (<AudioConsumerStatus as fidl::encoding::ValueTypeMarker>::borrow(&self.status),),
7505 encoder,
7506 offset,
7507 _depth,
7508 )
7509 }
7510 }
7511 unsafe impl<
7512 D: fidl::encoding::ResourceDialect,
7513 T0: fidl::encoding::Encode<AudioConsumerStatus, D>,
7514 > fidl::encoding::Encode<AudioConsumerWatchStatusResponse, D> for (T0,)
7515 {
7516 #[inline]
7517 unsafe fn encode(
7518 self,
7519 encoder: &mut fidl::encoding::Encoder<'_, D>,
7520 offset: usize,
7521 depth: fidl::encoding::Depth,
7522 ) -> fidl::Result<()> {
7523 encoder.debug_check_bounds::<AudioConsumerWatchStatusResponse>(offset);
7524 self.0.encode(encoder, offset + 0, depth)?;
7528 Ok(())
7529 }
7530 }
7531
7532 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7533 for AudioConsumerWatchStatusResponse
7534 {
7535 #[inline(always)]
7536 fn new_empty() -> Self {
7537 Self { status: fidl::new_empty!(AudioConsumerStatus, D) }
7538 }
7539
7540 #[inline]
7541 unsafe fn decode(
7542 &mut self,
7543 decoder: &mut fidl::encoding::Decoder<'_, D>,
7544 offset: usize,
7545 _depth: fidl::encoding::Depth,
7546 ) -> fidl::Result<()> {
7547 decoder.debug_check_bounds::<Self>(offset);
7548 fidl::decode!(AudioConsumerStatus, D, &mut self.status, decoder, offset + 0, _depth)?;
7550 Ok(())
7551 }
7552 }
7553
7554 impl fidl::encoding::ValueTypeMarker for AudioCoreGetDbFromVolume2Request {
7555 type Borrowed<'a> = &'a Self;
7556 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7557 value
7558 }
7559 }
7560
7561 unsafe impl fidl::encoding::TypeMarker for AudioCoreGetDbFromVolume2Request {
7562 type Owned = Self;
7563
7564 #[inline(always)]
7565 fn inline_align(_context: fidl::encoding::Context) -> usize {
7566 8
7567 }
7568
7569 #[inline(always)]
7570 fn inline_size(_context: fidl::encoding::Context) -> usize {
7571 24
7572 }
7573 }
7574
7575 unsafe impl<D: fidl::encoding::ResourceDialect>
7576 fidl::encoding::Encode<AudioCoreGetDbFromVolume2Request, D>
7577 for &AudioCoreGetDbFromVolume2Request
7578 {
7579 #[inline]
7580 unsafe fn encode(
7581 self,
7582 encoder: &mut fidl::encoding::Encoder<'_, D>,
7583 offset: usize,
7584 _depth: fidl::encoding::Depth,
7585 ) -> fidl::Result<()> {
7586 encoder.debug_check_bounds::<AudioCoreGetDbFromVolume2Request>(offset);
7587 fidl::encoding::Encode::<AudioCoreGetDbFromVolume2Request, D>::encode(
7589 (
7590 <Usage2 as fidl::encoding::ValueTypeMarker>::borrow(&self.usage),
7591 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.volume),
7592 ),
7593 encoder,
7594 offset,
7595 _depth,
7596 )
7597 }
7598 }
7599 unsafe impl<
7600 D: fidl::encoding::ResourceDialect,
7601 T0: fidl::encoding::Encode<Usage2, D>,
7602 T1: fidl::encoding::Encode<f32, D>,
7603 > fidl::encoding::Encode<AudioCoreGetDbFromVolume2Request, D> for (T0, T1)
7604 {
7605 #[inline]
7606 unsafe fn encode(
7607 self,
7608 encoder: &mut fidl::encoding::Encoder<'_, D>,
7609 offset: usize,
7610 depth: fidl::encoding::Depth,
7611 ) -> fidl::Result<()> {
7612 encoder.debug_check_bounds::<AudioCoreGetDbFromVolume2Request>(offset);
7613 unsafe {
7616 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
7617 (ptr as *mut u64).write_unaligned(0);
7618 }
7619 self.0.encode(encoder, offset + 0, depth)?;
7621 self.1.encode(encoder, offset + 16, depth)?;
7622 Ok(())
7623 }
7624 }
7625
7626 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7627 for AudioCoreGetDbFromVolume2Request
7628 {
7629 #[inline(always)]
7630 fn new_empty() -> Self {
7631 Self { usage: fidl::new_empty!(Usage2, D), volume: fidl::new_empty!(f32, D) }
7632 }
7633
7634 #[inline]
7635 unsafe fn decode(
7636 &mut self,
7637 decoder: &mut fidl::encoding::Decoder<'_, D>,
7638 offset: usize,
7639 _depth: fidl::encoding::Depth,
7640 ) -> fidl::Result<()> {
7641 decoder.debug_check_bounds::<Self>(offset);
7642 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
7644 let padval = unsafe { (ptr as *const u64).read_unaligned() };
7645 let mask = 0xffffffff00000000u64;
7646 let maskedval = padval & mask;
7647 if maskedval != 0 {
7648 return Err(fidl::Error::NonZeroPadding {
7649 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
7650 });
7651 }
7652 fidl::decode!(Usage2, D, &mut self.usage, decoder, offset + 0, _depth)?;
7653 fidl::decode!(f32, D, &mut self.volume, decoder, offset + 16, _depth)?;
7654 Ok(())
7655 }
7656 }
7657
7658 impl fidl::encoding::ValueTypeMarker for AudioCoreGetDbFromVolumeRequest {
7659 type Borrowed<'a> = &'a Self;
7660 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7661 value
7662 }
7663 }
7664
7665 unsafe impl fidl::encoding::TypeMarker for AudioCoreGetDbFromVolumeRequest {
7666 type Owned = Self;
7667
7668 #[inline(always)]
7669 fn inline_align(_context: fidl::encoding::Context) -> usize {
7670 8
7671 }
7672
7673 #[inline(always)]
7674 fn inline_size(_context: fidl::encoding::Context) -> usize {
7675 24
7676 }
7677 }
7678
7679 unsafe impl<D: fidl::encoding::ResourceDialect>
7680 fidl::encoding::Encode<AudioCoreGetDbFromVolumeRequest, D>
7681 for &AudioCoreGetDbFromVolumeRequest
7682 {
7683 #[inline]
7684 unsafe fn encode(
7685 self,
7686 encoder: &mut fidl::encoding::Encoder<'_, D>,
7687 offset: usize,
7688 _depth: fidl::encoding::Depth,
7689 ) -> fidl::Result<()> {
7690 encoder.debug_check_bounds::<AudioCoreGetDbFromVolumeRequest>(offset);
7691 fidl::encoding::Encode::<AudioCoreGetDbFromVolumeRequest, D>::encode(
7693 (
7694 <Usage as fidl::encoding::ValueTypeMarker>::borrow(&self.usage),
7695 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.volume),
7696 ),
7697 encoder,
7698 offset,
7699 _depth,
7700 )
7701 }
7702 }
7703 unsafe impl<
7704 D: fidl::encoding::ResourceDialect,
7705 T0: fidl::encoding::Encode<Usage, D>,
7706 T1: fidl::encoding::Encode<f32, D>,
7707 > fidl::encoding::Encode<AudioCoreGetDbFromVolumeRequest, D> for (T0, T1)
7708 {
7709 #[inline]
7710 unsafe fn encode(
7711 self,
7712 encoder: &mut fidl::encoding::Encoder<'_, D>,
7713 offset: usize,
7714 depth: fidl::encoding::Depth,
7715 ) -> fidl::Result<()> {
7716 encoder.debug_check_bounds::<AudioCoreGetDbFromVolumeRequest>(offset);
7717 unsafe {
7720 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
7721 (ptr as *mut u64).write_unaligned(0);
7722 }
7723 self.0.encode(encoder, offset + 0, depth)?;
7725 self.1.encode(encoder, offset + 16, depth)?;
7726 Ok(())
7727 }
7728 }
7729
7730 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7731 for AudioCoreGetDbFromVolumeRequest
7732 {
7733 #[inline(always)]
7734 fn new_empty() -> Self {
7735 Self { usage: fidl::new_empty!(Usage, D), volume: fidl::new_empty!(f32, D) }
7736 }
7737
7738 #[inline]
7739 unsafe fn decode(
7740 &mut self,
7741 decoder: &mut fidl::encoding::Decoder<'_, D>,
7742 offset: usize,
7743 _depth: fidl::encoding::Depth,
7744 ) -> fidl::Result<()> {
7745 decoder.debug_check_bounds::<Self>(offset);
7746 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
7748 let padval = unsafe { (ptr as *const u64).read_unaligned() };
7749 let mask = 0xffffffff00000000u64;
7750 let maskedval = padval & mask;
7751 if maskedval != 0 {
7752 return Err(fidl::Error::NonZeroPadding {
7753 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
7754 });
7755 }
7756 fidl::decode!(Usage, D, &mut self.usage, decoder, offset + 0, _depth)?;
7757 fidl::decode!(f32, D, &mut self.volume, decoder, offset + 16, _depth)?;
7758 Ok(())
7759 }
7760 }
7761
7762 impl fidl::encoding::ValueTypeMarker for AudioCoreGetDbFromVolumeResponse {
7763 type Borrowed<'a> = &'a Self;
7764 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7765 value
7766 }
7767 }
7768
7769 unsafe impl fidl::encoding::TypeMarker for AudioCoreGetDbFromVolumeResponse {
7770 type Owned = Self;
7771
7772 #[inline(always)]
7773 fn inline_align(_context: fidl::encoding::Context) -> usize {
7774 4
7775 }
7776
7777 #[inline(always)]
7778 fn inline_size(_context: fidl::encoding::Context) -> usize {
7779 4
7780 }
7781 }
7782
7783 unsafe impl<D: fidl::encoding::ResourceDialect>
7784 fidl::encoding::Encode<AudioCoreGetDbFromVolumeResponse, D>
7785 for &AudioCoreGetDbFromVolumeResponse
7786 {
7787 #[inline]
7788 unsafe fn encode(
7789 self,
7790 encoder: &mut fidl::encoding::Encoder<'_, D>,
7791 offset: usize,
7792 _depth: fidl::encoding::Depth,
7793 ) -> fidl::Result<()> {
7794 encoder.debug_check_bounds::<AudioCoreGetDbFromVolumeResponse>(offset);
7795 fidl::encoding::Encode::<AudioCoreGetDbFromVolumeResponse, D>::encode(
7797 (<f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.gain_db),),
7798 encoder,
7799 offset,
7800 _depth,
7801 )
7802 }
7803 }
7804 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<f32, D>>
7805 fidl::encoding::Encode<AudioCoreGetDbFromVolumeResponse, D> for (T0,)
7806 {
7807 #[inline]
7808 unsafe fn encode(
7809 self,
7810 encoder: &mut fidl::encoding::Encoder<'_, D>,
7811 offset: usize,
7812 depth: fidl::encoding::Depth,
7813 ) -> fidl::Result<()> {
7814 encoder.debug_check_bounds::<AudioCoreGetDbFromVolumeResponse>(offset);
7815 self.0.encode(encoder, offset + 0, depth)?;
7819 Ok(())
7820 }
7821 }
7822
7823 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7824 for AudioCoreGetDbFromVolumeResponse
7825 {
7826 #[inline(always)]
7827 fn new_empty() -> Self {
7828 Self { gain_db: fidl::new_empty!(f32, D) }
7829 }
7830
7831 #[inline]
7832 unsafe fn decode(
7833 &mut self,
7834 decoder: &mut fidl::encoding::Decoder<'_, D>,
7835 offset: usize,
7836 _depth: fidl::encoding::Depth,
7837 ) -> fidl::Result<()> {
7838 decoder.debug_check_bounds::<Self>(offset);
7839 fidl::decode!(f32, D, &mut self.gain_db, decoder, offset + 0, _depth)?;
7841 Ok(())
7842 }
7843 }
7844
7845 impl fidl::encoding::ValueTypeMarker for AudioCoreGetVolumeFromDb2Request {
7846 type Borrowed<'a> = &'a Self;
7847 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7848 value
7849 }
7850 }
7851
7852 unsafe impl fidl::encoding::TypeMarker for AudioCoreGetVolumeFromDb2Request {
7853 type Owned = Self;
7854
7855 #[inline(always)]
7856 fn inline_align(_context: fidl::encoding::Context) -> usize {
7857 8
7858 }
7859
7860 #[inline(always)]
7861 fn inline_size(_context: fidl::encoding::Context) -> usize {
7862 24
7863 }
7864 }
7865
7866 unsafe impl<D: fidl::encoding::ResourceDialect>
7867 fidl::encoding::Encode<AudioCoreGetVolumeFromDb2Request, D>
7868 for &AudioCoreGetVolumeFromDb2Request
7869 {
7870 #[inline]
7871 unsafe fn encode(
7872 self,
7873 encoder: &mut fidl::encoding::Encoder<'_, D>,
7874 offset: usize,
7875 _depth: fidl::encoding::Depth,
7876 ) -> fidl::Result<()> {
7877 encoder.debug_check_bounds::<AudioCoreGetVolumeFromDb2Request>(offset);
7878 fidl::encoding::Encode::<AudioCoreGetVolumeFromDb2Request, D>::encode(
7880 (
7881 <Usage2 as fidl::encoding::ValueTypeMarker>::borrow(&self.usage),
7882 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.gain_db),
7883 ),
7884 encoder,
7885 offset,
7886 _depth,
7887 )
7888 }
7889 }
7890 unsafe impl<
7891 D: fidl::encoding::ResourceDialect,
7892 T0: fidl::encoding::Encode<Usage2, D>,
7893 T1: fidl::encoding::Encode<f32, D>,
7894 > fidl::encoding::Encode<AudioCoreGetVolumeFromDb2Request, D> for (T0, T1)
7895 {
7896 #[inline]
7897 unsafe fn encode(
7898 self,
7899 encoder: &mut fidl::encoding::Encoder<'_, D>,
7900 offset: usize,
7901 depth: fidl::encoding::Depth,
7902 ) -> fidl::Result<()> {
7903 encoder.debug_check_bounds::<AudioCoreGetVolumeFromDb2Request>(offset);
7904 unsafe {
7907 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
7908 (ptr as *mut u64).write_unaligned(0);
7909 }
7910 self.0.encode(encoder, offset + 0, depth)?;
7912 self.1.encode(encoder, offset + 16, depth)?;
7913 Ok(())
7914 }
7915 }
7916
7917 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7918 for AudioCoreGetVolumeFromDb2Request
7919 {
7920 #[inline(always)]
7921 fn new_empty() -> Self {
7922 Self { usage: fidl::new_empty!(Usage2, D), gain_db: fidl::new_empty!(f32, D) }
7923 }
7924
7925 #[inline]
7926 unsafe fn decode(
7927 &mut self,
7928 decoder: &mut fidl::encoding::Decoder<'_, D>,
7929 offset: usize,
7930 _depth: fidl::encoding::Depth,
7931 ) -> fidl::Result<()> {
7932 decoder.debug_check_bounds::<Self>(offset);
7933 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
7935 let padval = unsafe { (ptr as *const u64).read_unaligned() };
7936 let mask = 0xffffffff00000000u64;
7937 let maskedval = padval & mask;
7938 if maskedval != 0 {
7939 return Err(fidl::Error::NonZeroPadding {
7940 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
7941 });
7942 }
7943 fidl::decode!(Usage2, D, &mut self.usage, decoder, offset + 0, _depth)?;
7944 fidl::decode!(f32, D, &mut self.gain_db, decoder, offset + 16, _depth)?;
7945 Ok(())
7946 }
7947 }
7948
7949 impl fidl::encoding::ValueTypeMarker for AudioCoreGetVolumeFromDbRequest {
7950 type Borrowed<'a> = &'a Self;
7951 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7952 value
7953 }
7954 }
7955
7956 unsafe impl fidl::encoding::TypeMarker for AudioCoreGetVolumeFromDbRequest {
7957 type Owned = Self;
7958
7959 #[inline(always)]
7960 fn inline_align(_context: fidl::encoding::Context) -> usize {
7961 8
7962 }
7963
7964 #[inline(always)]
7965 fn inline_size(_context: fidl::encoding::Context) -> usize {
7966 24
7967 }
7968 }
7969
7970 unsafe impl<D: fidl::encoding::ResourceDialect>
7971 fidl::encoding::Encode<AudioCoreGetVolumeFromDbRequest, D>
7972 for &AudioCoreGetVolumeFromDbRequest
7973 {
7974 #[inline]
7975 unsafe fn encode(
7976 self,
7977 encoder: &mut fidl::encoding::Encoder<'_, D>,
7978 offset: usize,
7979 _depth: fidl::encoding::Depth,
7980 ) -> fidl::Result<()> {
7981 encoder.debug_check_bounds::<AudioCoreGetVolumeFromDbRequest>(offset);
7982 fidl::encoding::Encode::<AudioCoreGetVolumeFromDbRequest, D>::encode(
7984 (
7985 <Usage as fidl::encoding::ValueTypeMarker>::borrow(&self.usage),
7986 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.gain_db),
7987 ),
7988 encoder,
7989 offset,
7990 _depth,
7991 )
7992 }
7993 }
7994 unsafe impl<
7995 D: fidl::encoding::ResourceDialect,
7996 T0: fidl::encoding::Encode<Usage, D>,
7997 T1: fidl::encoding::Encode<f32, D>,
7998 > fidl::encoding::Encode<AudioCoreGetVolumeFromDbRequest, D> for (T0, T1)
7999 {
8000 #[inline]
8001 unsafe fn encode(
8002 self,
8003 encoder: &mut fidl::encoding::Encoder<'_, D>,
8004 offset: usize,
8005 depth: fidl::encoding::Depth,
8006 ) -> fidl::Result<()> {
8007 encoder.debug_check_bounds::<AudioCoreGetVolumeFromDbRequest>(offset);
8008 unsafe {
8011 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
8012 (ptr as *mut u64).write_unaligned(0);
8013 }
8014 self.0.encode(encoder, offset + 0, depth)?;
8016 self.1.encode(encoder, offset + 16, depth)?;
8017 Ok(())
8018 }
8019 }
8020
8021 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8022 for AudioCoreGetVolumeFromDbRequest
8023 {
8024 #[inline(always)]
8025 fn new_empty() -> Self {
8026 Self { usage: fidl::new_empty!(Usage, D), gain_db: fidl::new_empty!(f32, D) }
8027 }
8028
8029 #[inline]
8030 unsafe fn decode(
8031 &mut self,
8032 decoder: &mut fidl::encoding::Decoder<'_, D>,
8033 offset: usize,
8034 _depth: fidl::encoding::Depth,
8035 ) -> fidl::Result<()> {
8036 decoder.debug_check_bounds::<Self>(offset);
8037 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
8039 let padval = unsafe { (ptr as *const u64).read_unaligned() };
8040 let mask = 0xffffffff00000000u64;
8041 let maskedval = padval & mask;
8042 if maskedval != 0 {
8043 return Err(fidl::Error::NonZeroPadding {
8044 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
8045 });
8046 }
8047 fidl::decode!(Usage, D, &mut self.usage, decoder, offset + 0, _depth)?;
8048 fidl::decode!(f32, D, &mut self.gain_db, decoder, offset + 16, _depth)?;
8049 Ok(())
8050 }
8051 }
8052
8053 impl fidl::encoding::ValueTypeMarker for AudioCoreGetVolumeFromDbResponse {
8054 type Borrowed<'a> = &'a Self;
8055 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8056 value
8057 }
8058 }
8059
8060 unsafe impl fidl::encoding::TypeMarker for AudioCoreGetVolumeFromDbResponse {
8061 type Owned = Self;
8062
8063 #[inline(always)]
8064 fn inline_align(_context: fidl::encoding::Context) -> usize {
8065 4
8066 }
8067
8068 #[inline(always)]
8069 fn inline_size(_context: fidl::encoding::Context) -> usize {
8070 4
8071 }
8072 }
8073
8074 unsafe impl<D: fidl::encoding::ResourceDialect>
8075 fidl::encoding::Encode<AudioCoreGetVolumeFromDbResponse, D>
8076 for &AudioCoreGetVolumeFromDbResponse
8077 {
8078 #[inline]
8079 unsafe fn encode(
8080 self,
8081 encoder: &mut fidl::encoding::Encoder<'_, D>,
8082 offset: usize,
8083 _depth: fidl::encoding::Depth,
8084 ) -> fidl::Result<()> {
8085 encoder.debug_check_bounds::<AudioCoreGetVolumeFromDbResponse>(offset);
8086 fidl::encoding::Encode::<AudioCoreGetVolumeFromDbResponse, D>::encode(
8088 (<f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.volume),),
8089 encoder,
8090 offset,
8091 _depth,
8092 )
8093 }
8094 }
8095 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<f32, D>>
8096 fidl::encoding::Encode<AudioCoreGetVolumeFromDbResponse, D> for (T0,)
8097 {
8098 #[inline]
8099 unsafe fn encode(
8100 self,
8101 encoder: &mut fidl::encoding::Encoder<'_, D>,
8102 offset: usize,
8103 depth: fidl::encoding::Depth,
8104 ) -> fidl::Result<()> {
8105 encoder.debug_check_bounds::<AudioCoreGetVolumeFromDbResponse>(offset);
8106 self.0.encode(encoder, offset + 0, depth)?;
8110 Ok(())
8111 }
8112 }
8113
8114 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8115 for AudioCoreGetVolumeFromDbResponse
8116 {
8117 #[inline(always)]
8118 fn new_empty() -> Self {
8119 Self { volume: fidl::new_empty!(f32, D) }
8120 }
8121
8122 #[inline]
8123 unsafe fn decode(
8124 &mut self,
8125 decoder: &mut fidl::encoding::Decoder<'_, D>,
8126 offset: usize,
8127 _depth: fidl::encoding::Depth,
8128 ) -> fidl::Result<()> {
8129 decoder.debug_check_bounds::<Self>(offset);
8130 fidl::decode!(f32, D, &mut self.volume, decoder, offset + 0, _depth)?;
8132 Ok(())
8133 }
8134 }
8135
8136 impl fidl::encoding::ValueTypeMarker for AudioCoreSetCaptureUsageGain2Request {
8137 type Borrowed<'a> = &'a Self;
8138 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8139 value
8140 }
8141 }
8142
8143 unsafe impl fidl::encoding::TypeMarker for AudioCoreSetCaptureUsageGain2Request {
8144 type Owned = Self;
8145
8146 #[inline(always)]
8147 fn inline_align(_context: fidl::encoding::Context) -> usize {
8148 4
8149 }
8150
8151 #[inline(always)]
8152 fn inline_size(_context: fidl::encoding::Context) -> usize {
8153 8
8154 }
8155 }
8156
8157 unsafe impl<D: fidl::encoding::ResourceDialect>
8158 fidl::encoding::Encode<AudioCoreSetCaptureUsageGain2Request, D>
8159 for &AudioCoreSetCaptureUsageGain2Request
8160 {
8161 #[inline]
8162 unsafe fn encode(
8163 self,
8164 encoder: &mut fidl::encoding::Encoder<'_, D>,
8165 offset: usize,
8166 _depth: fidl::encoding::Depth,
8167 ) -> fidl::Result<()> {
8168 encoder.debug_check_bounds::<AudioCoreSetCaptureUsageGain2Request>(offset);
8169 fidl::encoding::Encode::<AudioCoreSetCaptureUsageGain2Request, D>::encode(
8171 (
8172 <AudioCaptureUsage2 as fidl::encoding::ValueTypeMarker>::borrow(&self.usage),
8173 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.gain_db),
8174 ),
8175 encoder,
8176 offset,
8177 _depth,
8178 )
8179 }
8180 }
8181 unsafe impl<
8182 D: fidl::encoding::ResourceDialect,
8183 T0: fidl::encoding::Encode<AudioCaptureUsage2, D>,
8184 T1: fidl::encoding::Encode<f32, D>,
8185 > fidl::encoding::Encode<AudioCoreSetCaptureUsageGain2Request, D> for (T0, T1)
8186 {
8187 #[inline]
8188 unsafe fn encode(
8189 self,
8190 encoder: &mut fidl::encoding::Encoder<'_, D>,
8191 offset: usize,
8192 depth: fidl::encoding::Depth,
8193 ) -> fidl::Result<()> {
8194 encoder.debug_check_bounds::<AudioCoreSetCaptureUsageGain2Request>(offset);
8195 self.0.encode(encoder, offset + 0, depth)?;
8199 self.1.encode(encoder, offset + 4, depth)?;
8200 Ok(())
8201 }
8202 }
8203
8204 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8205 for AudioCoreSetCaptureUsageGain2Request
8206 {
8207 #[inline(always)]
8208 fn new_empty() -> Self {
8209 Self {
8210 usage: fidl::new_empty!(AudioCaptureUsage2, D),
8211 gain_db: fidl::new_empty!(f32, D),
8212 }
8213 }
8214
8215 #[inline]
8216 unsafe fn decode(
8217 &mut self,
8218 decoder: &mut fidl::encoding::Decoder<'_, D>,
8219 offset: usize,
8220 _depth: fidl::encoding::Depth,
8221 ) -> fidl::Result<()> {
8222 decoder.debug_check_bounds::<Self>(offset);
8223 fidl::decode!(AudioCaptureUsage2, D, &mut self.usage, decoder, offset + 0, _depth)?;
8225 fidl::decode!(f32, D, &mut self.gain_db, decoder, offset + 4, _depth)?;
8226 Ok(())
8227 }
8228 }
8229
8230 impl fidl::encoding::ValueTypeMarker for AudioCoreSetCaptureUsageGainRequest {
8231 type Borrowed<'a> = &'a Self;
8232 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8233 value
8234 }
8235 }
8236
8237 unsafe impl fidl::encoding::TypeMarker for AudioCoreSetCaptureUsageGainRequest {
8238 type Owned = Self;
8239
8240 #[inline(always)]
8241 fn inline_align(_context: fidl::encoding::Context) -> usize {
8242 4
8243 }
8244
8245 #[inline(always)]
8246 fn inline_size(_context: fidl::encoding::Context) -> usize {
8247 8
8248 }
8249 }
8250
8251 unsafe impl<D: fidl::encoding::ResourceDialect>
8252 fidl::encoding::Encode<AudioCoreSetCaptureUsageGainRequest, D>
8253 for &AudioCoreSetCaptureUsageGainRequest
8254 {
8255 #[inline]
8256 unsafe fn encode(
8257 self,
8258 encoder: &mut fidl::encoding::Encoder<'_, D>,
8259 offset: usize,
8260 _depth: fidl::encoding::Depth,
8261 ) -> fidl::Result<()> {
8262 encoder.debug_check_bounds::<AudioCoreSetCaptureUsageGainRequest>(offset);
8263 fidl::encoding::Encode::<AudioCoreSetCaptureUsageGainRequest, D>::encode(
8265 (
8266 <AudioCaptureUsage as fidl::encoding::ValueTypeMarker>::borrow(&self.usage),
8267 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.gain_db),
8268 ),
8269 encoder,
8270 offset,
8271 _depth,
8272 )
8273 }
8274 }
8275 unsafe impl<
8276 D: fidl::encoding::ResourceDialect,
8277 T0: fidl::encoding::Encode<AudioCaptureUsage, D>,
8278 T1: fidl::encoding::Encode<f32, D>,
8279 > fidl::encoding::Encode<AudioCoreSetCaptureUsageGainRequest, D> for (T0, T1)
8280 {
8281 #[inline]
8282 unsafe fn encode(
8283 self,
8284 encoder: &mut fidl::encoding::Encoder<'_, D>,
8285 offset: usize,
8286 depth: fidl::encoding::Depth,
8287 ) -> fidl::Result<()> {
8288 encoder.debug_check_bounds::<AudioCoreSetCaptureUsageGainRequest>(offset);
8289 self.0.encode(encoder, offset + 0, depth)?;
8293 self.1.encode(encoder, offset + 4, depth)?;
8294 Ok(())
8295 }
8296 }
8297
8298 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8299 for AudioCoreSetCaptureUsageGainRequest
8300 {
8301 #[inline(always)]
8302 fn new_empty() -> Self {
8303 Self {
8304 usage: fidl::new_empty!(AudioCaptureUsage, D),
8305 gain_db: fidl::new_empty!(f32, D),
8306 }
8307 }
8308
8309 #[inline]
8310 unsafe fn decode(
8311 &mut self,
8312 decoder: &mut fidl::encoding::Decoder<'_, D>,
8313 offset: usize,
8314 _depth: fidl::encoding::Depth,
8315 ) -> fidl::Result<()> {
8316 decoder.debug_check_bounds::<Self>(offset);
8317 fidl::decode!(AudioCaptureUsage, D, &mut self.usage, decoder, offset + 0, _depth)?;
8319 fidl::decode!(f32, D, &mut self.gain_db, decoder, offset + 4, _depth)?;
8320 Ok(())
8321 }
8322 }
8323
8324 impl fidl::encoding::ValueTypeMarker for AudioCoreSetInteraction2Request {
8325 type Borrowed<'a> = &'a Self;
8326 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8327 value
8328 }
8329 }
8330
8331 unsafe impl fidl::encoding::TypeMarker for AudioCoreSetInteraction2Request {
8332 type Owned = Self;
8333
8334 #[inline(always)]
8335 fn inline_align(_context: fidl::encoding::Context) -> usize {
8336 8
8337 }
8338
8339 #[inline(always)]
8340 fn inline_size(_context: fidl::encoding::Context) -> usize {
8341 40
8342 }
8343 }
8344
8345 unsafe impl<D: fidl::encoding::ResourceDialect>
8346 fidl::encoding::Encode<AudioCoreSetInteraction2Request, D>
8347 for &AudioCoreSetInteraction2Request
8348 {
8349 #[inline]
8350 unsafe fn encode(
8351 self,
8352 encoder: &mut fidl::encoding::Encoder<'_, D>,
8353 offset: usize,
8354 _depth: fidl::encoding::Depth,
8355 ) -> fidl::Result<()> {
8356 encoder.debug_check_bounds::<AudioCoreSetInteraction2Request>(offset);
8357 fidl::encoding::Encode::<AudioCoreSetInteraction2Request, D>::encode(
8359 (
8360 <Usage2 as fidl::encoding::ValueTypeMarker>::borrow(&self.active),
8361 <Usage2 as fidl::encoding::ValueTypeMarker>::borrow(&self.affected),
8362 <Behavior as fidl::encoding::ValueTypeMarker>::borrow(&self.behavior),
8363 ),
8364 encoder,
8365 offset,
8366 _depth,
8367 )
8368 }
8369 }
8370 unsafe impl<
8371 D: fidl::encoding::ResourceDialect,
8372 T0: fidl::encoding::Encode<Usage2, D>,
8373 T1: fidl::encoding::Encode<Usage2, D>,
8374 T2: fidl::encoding::Encode<Behavior, D>,
8375 > fidl::encoding::Encode<AudioCoreSetInteraction2Request, D> for (T0, T1, T2)
8376 {
8377 #[inline]
8378 unsafe fn encode(
8379 self,
8380 encoder: &mut fidl::encoding::Encoder<'_, D>,
8381 offset: usize,
8382 depth: fidl::encoding::Depth,
8383 ) -> fidl::Result<()> {
8384 encoder.debug_check_bounds::<AudioCoreSetInteraction2Request>(offset);
8385 unsafe {
8388 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
8389 (ptr as *mut u64).write_unaligned(0);
8390 }
8391 self.0.encode(encoder, offset + 0, depth)?;
8393 self.1.encode(encoder, offset + 16, depth)?;
8394 self.2.encode(encoder, offset + 32, depth)?;
8395 Ok(())
8396 }
8397 }
8398
8399 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8400 for AudioCoreSetInteraction2Request
8401 {
8402 #[inline(always)]
8403 fn new_empty() -> Self {
8404 Self {
8405 active: fidl::new_empty!(Usage2, D),
8406 affected: fidl::new_empty!(Usage2, D),
8407 behavior: fidl::new_empty!(Behavior, D),
8408 }
8409 }
8410
8411 #[inline]
8412 unsafe fn decode(
8413 &mut self,
8414 decoder: &mut fidl::encoding::Decoder<'_, D>,
8415 offset: usize,
8416 _depth: fidl::encoding::Depth,
8417 ) -> fidl::Result<()> {
8418 decoder.debug_check_bounds::<Self>(offset);
8419 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
8421 let padval = unsafe { (ptr as *const u64).read_unaligned() };
8422 let mask = 0xffffffff00000000u64;
8423 let maskedval = padval & mask;
8424 if maskedval != 0 {
8425 return Err(fidl::Error::NonZeroPadding {
8426 padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
8427 });
8428 }
8429 fidl::decode!(Usage2, D, &mut self.active, decoder, offset + 0, _depth)?;
8430 fidl::decode!(Usage2, D, &mut self.affected, decoder, offset + 16, _depth)?;
8431 fidl::decode!(Behavior, D, &mut self.behavior, decoder, offset + 32, _depth)?;
8432 Ok(())
8433 }
8434 }
8435
8436 impl fidl::encoding::ValueTypeMarker for AudioCoreSetInteractionRequest {
8437 type Borrowed<'a> = &'a Self;
8438 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8439 value
8440 }
8441 }
8442
8443 unsafe impl fidl::encoding::TypeMarker for AudioCoreSetInteractionRequest {
8444 type Owned = Self;
8445
8446 #[inline(always)]
8447 fn inline_align(_context: fidl::encoding::Context) -> usize {
8448 8
8449 }
8450
8451 #[inline(always)]
8452 fn inline_size(_context: fidl::encoding::Context) -> usize {
8453 40
8454 }
8455 }
8456
8457 unsafe impl<D: fidl::encoding::ResourceDialect>
8458 fidl::encoding::Encode<AudioCoreSetInteractionRequest, D>
8459 for &AudioCoreSetInteractionRequest
8460 {
8461 #[inline]
8462 unsafe fn encode(
8463 self,
8464 encoder: &mut fidl::encoding::Encoder<'_, D>,
8465 offset: usize,
8466 _depth: fidl::encoding::Depth,
8467 ) -> fidl::Result<()> {
8468 encoder.debug_check_bounds::<AudioCoreSetInteractionRequest>(offset);
8469 fidl::encoding::Encode::<AudioCoreSetInteractionRequest, D>::encode(
8471 (
8472 <Usage as fidl::encoding::ValueTypeMarker>::borrow(&self.active),
8473 <Usage as fidl::encoding::ValueTypeMarker>::borrow(&self.affected),
8474 <Behavior as fidl::encoding::ValueTypeMarker>::borrow(&self.behavior),
8475 ),
8476 encoder,
8477 offset,
8478 _depth,
8479 )
8480 }
8481 }
8482 unsafe impl<
8483 D: fidl::encoding::ResourceDialect,
8484 T0: fidl::encoding::Encode<Usage, D>,
8485 T1: fidl::encoding::Encode<Usage, D>,
8486 T2: fidl::encoding::Encode<Behavior, D>,
8487 > fidl::encoding::Encode<AudioCoreSetInteractionRequest, D> for (T0, T1, T2)
8488 {
8489 #[inline]
8490 unsafe fn encode(
8491 self,
8492 encoder: &mut fidl::encoding::Encoder<'_, D>,
8493 offset: usize,
8494 depth: fidl::encoding::Depth,
8495 ) -> fidl::Result<()> {
8496 encoder.debug_check_bounds::<AudioCoreSetInteractionRequest>(offset);
8497 unsafe {
8500 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
8501 (ptr as *mut u64).write_unaligned(0);
8502 }
8503 self.0.encode(encoder, offset + 0, depth)?;
8505 self.1.encode(encoder, offset + 16, depth)?;
8506 self.2.encode(encoder, offset + 32, depth)?;
8507 Ok(())
8508 }
8509 }
8510
8511 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8512 for AudioCoreSetInteractionRequest
8513 {
8514 #[inline(always)]
8515 fn new_empty() -> Self {
8516 Self {
8517 active: fidl::new_empty!(Usage, D),
8518 affected: fidl::new_empty!(Usage, D),
8519 behavior: fidl::new_empty!(Behavior, D),
8520 }
8521 }
8522
8523 #[inline]
8524 unsafe fn decode(
8525 &mut self,
8526 decoder: &mut fidl::encoding::Decoder<'_, D>,
8527 offset: usize,
8528 _depth: fidl::encoding::Depth,
8529 ) -> fidl::Result<()> {
8530 decoder.debug_check_bounds::<Self>(offset);
8531 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
8533 let padval = unsafe { (ptr as *const u64).read_unaligned() };
8534 let mask = 0xffffffff00000000u64;
8535 let maskedval = padval & mask;
8536 if maskedval != 0 {
8537 return Err(fidl::Error::NonZeroPadding {
8538 padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
8539 });
8540 }
8541 fidl::decode!(Usage, D, &mut self.active, decoder, offset + 0, _depth)?;
8542 fidl::decode!(Usage, D, &mut self.affected, decoder, offset + 16, _depth)?;
8543 fidl::decode!(Behavior, D, &mut self.behavior, decoder, offset + 32, _depth)?;
8544 Ok(())
8545 }
8546 }
8547
8548 impl fidl::encoding::ValueTypeMarker for AudioCoreSetRenderUsageGain2Request {
8549 type Borrowed<'a> = &'a Self;
8550 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8551 value
8552 }
8553 }
8554
8555 unsafe impl fidl::encoding::TypeMarker for AudioCoreSetRenderUsageGain2Request {
8556 type Owned = Self;
8557
8558 #[inline(always)]
8559 fn inline_align(_context: fidl::encoding::Context) -> usize {
8560 4
8561 }
8562
8563 #[inline(always)]
8564 fn inline_size(_context: fidl::encoding::Context) -> usize {
8565 8
8566 }
8567 }
8568
8569 unsafe impl<D: fidl::encoding::ResourceDialect>
8570 fidl::encoding::Encode<AudioCoreSetRenderUsageGain2Request, D>
8571 for &AudioCoreSetRenderUsageGain2Request
8572 {
8573 #[inline]
8574 unsafe fn encode(
8575 self,
8576 encoder: &mut fidl::encoding::Encoder<'_, D>,
8577 offset: usize,
8578 _depth: fidl::encoding::Depth,
8579 ) -> fidl::Result<()> {
8580 encoder.debug_check_bounds::<AudioCoreSetRenderUsageGain2Request>(offset);
8581 fidl::encoding::Encode::<AudioCoreSetRenderUsageGain2Request, D>::encode(
8583 (
8584 <AudioRenderUsage2 as fidl::encoding::ValueTypeMarker>::borrow(&self.usage),
8585 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.gain_db),
8586 ),
8587 encoder,
8588 offset,
8589 _depth,
8590 )
8591 }
8592 }
8593 unsafe impl<
8594 D: fidl::encoding::ResourceDialect,
8595 T0: fidl::encoding::Encode<AudioRenderUsage2, D>,
8596 T1: fidl::encoding::Encode<f32, D>,
8597 > fidl::encoding::Encode<AudioCoreSetRenderUsageGain2Request, D> for (T0, T1)
8598 {
8599 #[inline]
8600 unsafe fn encode(
8601 self,
8602 encoder: &mut fidl::encoding::Encoder<'_, D>,
8603 offset: usize,
8604 depth: fidl::encoding::Depth,
8605 ) -> fidl::Result<()> {
8606 encoder.debug_check_bounds::<AudioCoreSetRenderUsageGain2Request>(offset);
8607 self.0.encode(encoder, offset + 0, depth)?;
8611 self.1.encode(encoder, offset + 4, depth)?;
8612 Ok(())
8613 }
8614 }
8615
8616 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8617 for AudioCoreSetRenderUsageGain2Request
8618 {
8619 #[inline(always)]
8620 fn new_empty() -> Self {
8621 Self {
8622 usage: fidl::new_empty!(AudioRenderUsage2, D),
8623 gain_db: fidl::new_empty!(f32, D),
8624 }
8625 }
8626
8627 #[inline]
8628 unsafe fn decode(
8629 &mut self,
8630 decoder: &mut fidl::encoding::Decoder<'_, D>,
8631 offset: usize,
8632 _depth: fidl::encoding::Depth,
8633 ) -> fidl::Result<()> {
8634 decoder.debug_check_bounds::<Self>(offset);
8635 fidl::decode!(AudioRenderUsage2, D, &mut self.usage, decoder, offset + 0, _depth)?;
8637 fidl::decode!(f32, D, &mut self.gain_db, decoder, offset + 4, _depth)?;
8638 Ok(())
8639 }
8640 }
8641
8642 impl fidl::encoding::ValueTypeMarker for AudioCoreSetRenderUsageGainRequest {
8643 type Borrowed<'a> = &'a Self;
8644 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8645 value
8646 }
8647 }
8648
8649 unsafe impl fidl::encoding::TypeMarker for AudioCoreSetRenderUsageGainRequest {
8650 type Owned = Self;
8651
8652 #[inline(always)]
8653 fn inline_align(_context: fidl::encoding::Context) -> usize {
8654 4
8655 }
8656
8657 #[inline(always)]
8658 fn inline_size(_context: fidl::encoding::Context) -> usize {
8659 8
8660 }
8661 }
8662
8663 unsafe impl<D: fidl::encoding::ResourceDialect>
8664 fidl::encoding::Encode<AudioCoreSetRenderUsageGainRequest, D>
8665 for &AudioCoreSetRenderUsageGainRequest
8666 {
8667 #[inline]
8668 unsafe fn encode(
8669 self,
8670 encoder: &mut fidl::encoding::Encoder<'_, D>,
8671 offset: usize,
8672 _depth: fidl::encoding::Depth,
8673 ) -> fidl::Result<()> {
8674 encoder.debug_check_bounds::<AudioCoreSetRenderUsageGainRequest>(offset);
8675 fidl::encoding::Encode::<AudioCoreSetRenderUsageGainRequest, D>::encode(
8677 (
8678 <AudioRenderUsage as fidl::encoding::ValueTypeMarker>::borrow(&self.usage),
8679 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.gain_db),
8680 ),
8681 encoder,
8682 offset,
8683 _depth,
8684 )
8685 }
8686 }
8687 unsafe impl<
8688 D: fidl::encoding::ResourceDialect,
8689 T0: fidl::encoding::Encode<AudioRenderUsage, D>,
8690 T1: fidl::encoding::Encode<f32, D>,
8691 > fidl::encoding::Encode<AudioCoreSetRenderUsageGainRequest, D> for (T0, T1)
8692 {
8693 #[inline]
8694 unsafe fn encode(
8695 self,
8696 encoder: &mut fidl::encoding::Encoder<'_, D>,
8697 offset: usize,
8698 depth: fidl::encoding::Depth,
8699 ) -> fidl::Result<()> {
8700 encoder.debug_check_bounds::<AudioCoreSetRenderUsageGainRequest>(offset);
8701 self.0.encode(encoder, offset + 0, depth)?;
8705 self.1.encode(encoder, offset + 4, depth)?;
8706 Ok(())
8707 }
8708 }
8709
8710 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8711 for AudioCoreSetRenderUsageGainRequest
8712 {
8713 #[inline(always)]
8714 fn new_empty() -> Self {
8715 Self { usage: fidl::new_empty!(AudioRenderUsage, D), gain_db: fidl::new_empty!(f32, D) }
8716 }
8717
8718 #[inline]
8719 unsafe fn decode(
8720 &mut self,
8721 decoder: &mut fidl::encoding::Decoder<'_, D>,
8722 offset: usize,
8723 _depth: fidl::encoding::Depth,
8724 ) -> fidl::Result<()> {
8725 decoder.debug_check_bounds::<Self>(offset);
8726 fidl::decode!(AudioRenderUsage, D, &mut self.usage, decoder, offset + 0, _depth)?;
8728 fidl::decode!(f32, D, &mut self.gain_db, decoder, offset + 4, _depth)?;
8729 Ok(())
8730 }
8731 }
8732
8733 impl fidl::encoding::ValueTypeMarker for AudioCoreGetDbFromVolume2Response {
8734 type Borrowed<'a> = &'a Self;
8735 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8736 value
8737 }
8738 }
8739
8740 unsafe impl fidl::encoding::TypeMarker for AudioCoreGetDbFromVolume2Response {
8741 type Owned = Self;
8742
8743 #[inline(always)]
8744 fn inline_align(_context: fidl::encoding::Context) -> usize {
8745 4
8746 }
8747
8748 #[inline(always)]
8749 fn inline_size(_context: fidl::encoding::Context) -> usize {
8750 4
8751 }
8752 }
8753
8754 unsafe impl<D: fidl::encoding::ResourceDialect>
8755 fidl::encoding::Encode<AudioCoreGetDbFromVolume2Response, D>
8756 for &AudioCoreGetDbFromVolume2Response
8757 {
8758 #[inline]
8759 unsafe fn encode(
8760 self,
8761 encoder: &mut fidl::encoding::Encoder<'_, D>,
8762 offset: usize,
8763 _depth: fidl::encoding::Depth,
8764 ) -> fidl::Result<()> {
8765 encoder.debug_check_bounds::<AudioCoreGetDbFromVolume2Response>(offset);
8766 fidl::encoding::Encode::<AudioCoreGetDbFromVolume2Response, D>::encode(
8768 (<f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.gain_db),),
8769 encoder,
8770 offset,
8771 _depth,
8772 )
8773 }
8774 }
8775 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<f32, D>>
8776 fidl::encoding::Encode<AudioCoreGetDbFromVolume2Response, D> for (T0,)
8777 {
8778 #[inline]
8779 unsafe fn encode(
8780 self,
8781 encoder: &mut fidl::encoding::Encoder<'_, D>,
8782 offset: usize,
8783 depth: fidl::encoding::Depth,
8784 ) -> fidl::Result<()> {
8785 encoder.debug_check_bounds::<AudioCoreGetDbFromVolume2Response>(offset);
8786 self.0.encode(encoder, offset + 0, depth)?;
8790 Ok(())
8791 }
8792 }
8793
8794 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8795 for AudioCoreGetDbFromVolume2Response
8796 {
8797 #[inline(always)]
8798 fn new_empty() -> Self {
8799 Self { gain_db: fidl::new_empty!(f32, D) }
8800 }
8801
8802 #[inline]
8803 unsafe fn decode(
8804 &mut self,
8805 decoder: &mut fidl::encoding::Decoder<'_, D>,
8806 offset: usize,
8807 _depth: fidl::encoding::Depth,
8808 ) -> fidl::Result<()> {
8809 decoder.debug_check_bounds::<Self>(offset);
8810 fidl::decode!(f32, D, &mut self.gain_db, decoder, offset + 0, _depth)?;
8812 Ok(())
8813 }
8814 }
8815
8816 impl fidl::encoding::ValueTypeMarker for AudioCoreGetVolumeFromDb2Response {
8817 type Borrowed<'a> = &'a Self;
8818 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8819 value
8820 }
8821 }
8822
8823 unsafe impl fidl::encoding::TypeMarker for AudioCoreGetVolumeFromDb2Response {
8824 type Owned = Self;
8825
8826 #[inline(always)]
8827 fn inline_align(_context: fidl::encoding::Context) -> usize {
8828 4
8829 }
8830
8831 #[inline(always)]
8832 fn inline_size(_context: fidl::encoding::Context) -> usize {
8833 4
8834 }
8835 }
8836
8837 unsafe impl<D: fidl::encoding::ResourceDialect>
8838 fidl::encoding::Encode<AudioCoreGetVolumeFromDb2Response, D>
8839 for &AudioCoreGetVolumeFromDb2Response
8840 {
8841 #[inline]
8842 unsafe fn encode(
8843 self,
8844 encoder: &mut fidl::encoding::Encoder<'_, D>,
8845 offset: usize,
8846 _depth: fidl::encoding::Depth,
8847 ) -> fidl::Result<()> {
8848 encoder.debug_check_bounds::<AudioCoreGetVolumeFromDb2Response>(offset);
8849 fidl::encoding::Encode::<AudioCoreGetVolumeFromDb2Response, D>::encode(
8851 (<f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.volume),),
8852 encoder,
8853 offset,
8854 _depth,
8855 )
8856 }
8857 }
8858 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<f32, D>>
8859 fidl::encoding::Encode<AudioCoreGetVolumeFromDb2Response, D> for (T0,)
8860 {
8861 #[inline]
8862 unsafe fn encode(
8863 self,
8864 encoder: &mut fidl::encoding::Encoder<'_, D>,
8865 offset: usize,
8866 depth: fidl::encoding::Depth,
8867 ) -> fidl::Result<()> {
8868 encoder.debug_check_bounds::<AudioCoreGetVolumeFromDb2Response>(offset);
8869 self.0.encode(encoder, offset + 0, depth)?;
8873 Ok(())
8874 }
8875 }
8876
8877 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8878 for AudioCoreGetVolumeFromDb2Response
8879 {
8880 #[inline(always)]
8881 fn new_empty() -> Self {
8882 Self { volume: fidl::new_empty!(f32, D) }
8883 }
8884
8885 #[inline]
8886 unsafe fn decode(
8887 &mut self,
8888 decoder: &mut fidl::encoding::Decoder<'_, D>,
8889 offset: usize,
8890 _depth: fidl::encoding::Depth,
8891 ) -> fidl::Result<()> {
8892 decoder.debug_check_bounds::<Self>(offset);
8893 fidl::decode!(f32, D, &mut self.volume, decoder, offset + 0, _depth)?;
8895 Ok(())
8896 }
8897 }
8898
8899 impl fidl::encoding::ValueTypeMarker for AudioDeviceEnumeratorGetDeviceGainRequest {
8900 type Borrowed<'a> = &'a Self;
8901 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8902 value
8903 }
8904 }
8905
8906 unsafe impl fidl::encoding::TypeMarker for AudioDeviceEnumeratorGetDeviceGainRequest {
8907 type Owned = Self;
8908
8909 #[inline(always)]
8910 fn inline_align(_context: fidl::encoding::Context) -> usize {
8911 8
8912 }
8913
8914 #[inline(always)]
8915 fn inline_size(_context: fidl::encoding::Context) -> usize {
8916 8
8917 }
8918 #[inline(always)]
8919 fn encode_is_copy() -> bool {
8920 true
8921 }
8922
8923 #[inline(always)]
8924 fn decode_is_copy() -> bool {
8925 true
8926 }
8927 }
8928
8929 unsafe impl<D: fidl::encoding::ResourceDialect>
8930 fidl::encoding::Encode<AudioDeviceEnumeratorGetDeviceGainRequest, D>
8931 for &AudioDeviceEnumeratorGetDeviceGainRequest
8932 {
8933 #[inline]
8934 unsafe fn encode(
8935 self,
8936 encoder: &mut fidl::encoding::Encoder<'_, D>,
8937 offset: usize,
8938 _depth: fidl::encoding::Depth,
8939 ) -> fidl::Result<()> {
8940 encoder.debug_check_bounds::<AudioDeviceEnumeratorGetDeviceGainRequest>(offset);
8941 unsafe {
8942 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
8944 (buf_ptr as *mut AudioDeviceEnumeratorGetDeviceGainRequest).write_unaligned(
8945 (self as *const AudioDeviceEnumeratorGetDeviceGainRequest).read(),
8946 );
8947 }
8950 Ok(())
8951 }
8952 }
8953 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
8954 fidl::encoding::Encode<AudioDeviceEnumeratorGetDeviceGainRequest, D> for (T0,)
8955 {
8956 #[inline]
8957 unsafe fn encode(
8958 self,
8959 encoder: &mut fidl::encoding::Encoder<'_, D>,
8960 offset: usize,
8961 depth: fidl::encoding::Depth,
8962 ) -> fidl::Result<()> {
8963 encoder.debug_check_bounds::<AudioDeviceEnumeratorGetDeviceGainRequest>(offset);
8964 self.0.encode(encoder, offset + 0, depth)?;
8968 Ok(())
8969 }
8970 }
8971
8972 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8973 for AudioDeviceEnumeratorGetDeviceGainRequest
8974 {
8975 #[inline(always)]
8976 fn new_empty() -> Self {
8977 Self { device_token: fidl::new_empty!(u64, D) }
8978 }
8979
8980 #[inline]
8981 unsafe fn decode(
8982 &mut self,
8983 decoder: &mut fidl::encoding::Decoder<'_, D>,
8984 offset: usize,
8985 _depth: fidl::encoding::Depth,
8986 ) -> fidl::Result<()> {
8987 decoder.debug_check_bounds::<Self>(offset);
8988 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
8989 unsafe {
8992 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
8993 }
8994 Ok(())
8995 }
8996 }
8997
8998 impl fidl::encoding::ValueTypeMarker for AudioDeviceEnumeratorGetDeviceGainResponse {
8999 type Borrowed<'a> = &'a Self;
9000 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9001 value
9002 }
9003 }
9004
9005 unsafe impl fidl::encoding::TypeMarker for AudioDeviceEnumeratorGetDeviceGainResponse {
9006 type Owned = Self;
9007
9008 #[inline(always)]
9009 fn inline_align(_context: fidl::encoding::Context) -> usize {
9010 8
9011 }
9012
9013 #[inline(always)]
9014 fn inline_size(_context: fidl::encoding::Context) -> usize {
9015 16
9016 }
9017 }
9018
9019 unsafe impl<D: fidl::encoding::ResourceDialect>
9020 fidl::encoding::Encode<AudioDeviceEnumeratorGetDeviceGainResponse, D>
9021 for &AudioDeviceEnumeratorGetDeviceGainResponse
9022 {
9023 #[inline]
9024 unsafe fn encode(
9025 self,
9026 encoder: &mut fidl::encoding::Encoder<'_, D>,
9027 offset: usize,
9028 _depth: fidl::encoding::Depth,
9029 ) -> fidl::Result<()> {
9030 encoder.debug_check_bounds::<AudioDeviceEnumeratorGetDeviceGainResponse>(offset);
9031 fidl::encoding::Encode::<AudioDeviceEnumeratorGetDeviceGainResponse, D>::encode(
9033 (
9034 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.device_token),
9035 <AudioGainInfo as fidl::encoding::ValueTypeMarker>::borrow(&self.gain_info),
9036 ),
9037 encoder,
9038 offset,
9039 _depth,
9040 )
9041 }
9042 }
9043 unsafe impl<
9044 D: fidl::encoding::ResourceDialect,
9045 T0: fidl::encoding::Encode<u64, D>,
9046 T1: fidl::encoding::Encode<AudioGainInfo, D>,
9047 > fidl::encoding::Encode<AudioDeviceEnumeratorGetDeviceGainResponse, D> for (T0, T1)
9048 {
9049 #[inline]
9050 unsafe fn encode(
9051 self,
9052 encoder: &mut fidl::encoding::Encoder<'_, D>,
9053 offset: usize,
9054 depth: fidl::encoding::Depth,
9055 ) -> fidl::Result<()> {
9056 encoder.debug_check_bounds::<AudioDeviceEnumeratorGetDeviceGainResponse>(offset);
9057 self.0.encode(encoder, offset + 0, depth)?;
9061 self.1.encode(encoder, offset + 8, depth)?;
9062 Ok(())
9063 }
9064 }
9065
9066 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
9067 for AudioDeviceEnumeratorGetDeviceGainResponse
9068 {
9069 #[inline(always)]
9070 fn new_empty() -> Self {
9071 Self {
9072 device_token: fidl::new_empty!(u64, D),
9073 gain_info: fidl::new_empty!(AudioGainInfo, D),
9074 }
9075 }
9076
9077 #[inline]
9078 unsafe fn decode(
9079 &mut self,
9080 decoder: &mut fidl::encoding::Decoder<'_, D>,
9081 offset: usize,
9082 _depth: fidl::encoding::Depth,
9083 ) -> fidl::Result<()> {
9084 decoder.debug_check_bounds::<Self>(offset);
9085 fidl::decode!(u64, D, &mut self.device_token, decoder, offset + 0, _depth)?;
9087 fidl::decode!(AudioGainInfo, D, &mut self.gain_info, decoder, offset + 8, _depth)?;
9088 Ok(())
9089 }
9090 }
9091
9092 impl fidl::encoding::ValueTypeMarker for AudioDeviceEnumeratorGetDevicesResponse {
9093 type Borrowed<'a> = &'a Self;
9094 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9095 value
9096 }
9097 }
9098
9099 unsafe impl fidl::encoding::TypeMarker for AudioDeviceEnumeratorGetDevicesResponse {
9100 type Owned = Self;
9101
9102 #[inline(always)]
9103 fn inline_align(_context: fidl::encoding::Context) -> usize {
9104 8
9105 }
9106
9107 #[inline(always)]
9108 fn inline_size(_context: fidl::encoding::Context) -> usize {
9109 16
9110 }
9111 }
9112
9113 unsafe impl<D: fidl::encoding::ResourceDialect>
9114 fidl::encoding::Encode<AudioDeviceEnumeratorGetDevicesResponse, D>
9115 for &AudioDeviceEnumeratorGetDevicesResponse
9116 {
9117 #[inline]
9118 unsafe fn encode(
9119 self,
9120 encoder: &mut fidl::encoding::Encoder<'_, D>,
9121 offset: usize,
9122 _depth: fidl::encoding::Depth,
9123 ) -> fidl::Result<()> {
9124 encoder.debug_check_bounds::<AudioDeviceEnumeratorGetDevicesResponse>(offset);
9125 fidl::encoding::Encode::<AudioDeviceEnumeratorGetDevicesResponse, D>::encode(
9127 (
9128 <fidl::encoding::UnboundedVector<AudioDeviceInfo> as fidl::encoding::ValueTypeMarker>::borrow(&self.devices),
9129 ),
9130 encoder, offset, _depth
9131 )
9132 }
9133 }
9134 unsafe impl<
9135 D: fidl::encoding::ResourceDialect,
9136 T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<AudioDeviceInfo>, D>,
9137 > fidl::encoding::Encode<AudioDeviceEnumeratorGetDevicesResponse, D> for (T0,)
9138 {
9139 #[inline]
9140 unsafe fn encode(
9141 self,
9142 encoder: &mut fidl::encoding::Encoder<'_, D>,
9143 offset: usize,
9144 depth: fidl::encoding::Depth,
9145 ) -> fidl::Result<()> {
9146 encoder.debug_check_bounds::<AudioDeviceEnumeratorGetDevicesResponse>(offset);
9147 self.0.encode(encoder, offset + 0, depth)?;
9151 Ok(())
9152 }
9153 }
9154
9155 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
9156 for AudioDeviceEnumeratorGetDevicesResponse
9157 {
9158 #[inline(always)]
9159 fn new_empty() -> Self {
9160 Self { devices: fidl::new_empty!(fidl::encoding::UnboundedVector<AudioDeviceInfo>, D) }
9161 }
9162
9163 #[inline]
9164 unsafe fn decode(
9165 &mut self,
9166 decoder: &mut fidl::encoding::Decoder<'_, D>,
9167 offset: usize,
9168 _depth: fidl::encoding::Depth,
9169 ) -> fidl::Result<()> {
9170 decoder.debug_check_bounds::<Self>(offset);
9171 fidl::decode!(
9173 fidl::encoding::UnboundedVector<AudioDeviceInfo>,
9174 D,
9175 &mut self.devices,
9176 decoder,
9177 offset + 0,
9178 _depth
9179 )?;
9180 Ok(())
9181 }
9182 }
9183
9184 impl fidl::encoding::ValueTypeMarker for AudioDeviceEnumeratorOnDefaultDeviceChangedRequest {
9185 type Borrowed<'a> = &'a Self;
9186 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9187 value
9188 }
9189 }
9190
9191 unsafe impl fidl::encoding::TypeMarker for AudioDeviceEnumeratorOnDefaultDeviceChangedRequest {
9192 type Owned = Self;
9193
9194 #[inline(always)]
9195 fn inline_align(_context: fidl::encoding::Context) -> usize {
9196 8
9197 }
9198
9199 #[inline(always)]
9200 fn inline_size(_context: fidl::encoding::Context) -> usize {
9201 16
9202 }
9203 #[inline(always)]
9204 fn encode_is_copy() -> bool {
9205 true
9206 }
9207
9208 #[inline(always)]
9209 fn decode_is_copy() -> bool {
9210 true
9211 }
9212 }
9213
9214 unsafe impl<D: fidl::encoding::ResourceDialect>
9215 fidl::encoding::Encode<AudioDeviceEnumeratorOnDefaultDeviceChangedRequest, D>
9216 for &AudioDeviceEnumeratorOnDefaultDeviceChangedRequest
9217 {
9218 #[inline]
9219 unsafe fn encode(
9220 self,
9221 encoder: &mut fidl::encoding::Encoder<'_, D>,
9222 offset: usize,
9223 _depth: fidl::encoding::Depth,
9224 ) -> fidl::Result<()> {
9225 encoder
9226 .debug_check_bounds::<AudioDeviceEnumeratorOnDefaultDeviceChangedRequest>(offset);
9227 unsafe {
9228 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
9230 (buf_ptr as *mut AudioDeviceEnumeratorOnDefaultDeviceChangedRequest)
9231 .write_unaligned(
9232 (self as *const AudioDeviceEnumeratorOnDefaultDeviceChangedRequest).read(),
9233 );
9234 }
9237 Ok(())
9238 }
9239 }
9240 unsafe impl<
9241 D: fidl::encoding::ResourceDialect,
9242 T0: fidl::encoding::Encode<u64, D>,
9243 T1: fidl::encoding::Encode<u64, D>,
9244 > fidl::encoding::Encode<AudioDeviceEnumeratorOnDefaultDeviceChangedRequest, D> for (T0, T1)
9245 {
9246 #[inline]
9247 unsafe fn encode(
9248 self,
9249 encoder: &mut fidl::encoding::Encoder<'_, D>,
9250 offset: usize,
9251 depth: fidl::encoding::Depth,
9252 ) -> fidl::Result<()> {
9253 encoder
9254 .debug_check_bounds::<AudioDeviceEnumeratorOnDefaultDeviceChangedRequest>(offset);
9255 self.0.encode(encoder, offset + 0, depth)?;
9259 self.1.encode(encoder, offset + 8, depth)?;
9260 Ok(())
9261 }
9262 }
9263
9264 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
9265 for AudioDeviceEnumeratorOnDefaultDeviceChangedRequest
9266 {
9267 #[inline(always)]
9268 fn new_empty() -> Self {
9269 Self {
9270 old_default_token: fidl::new_empty!(u64, D),
9271 new_default_token: fidl::new_empty!(u64, D),
9272 }
9273 }
9274
9275 #[inline]
9276 unsafe fn decode(
9277 &mut self,
9278 decoder: &mut fidl::encoding::Decoder<'_, D>,
9279 offset: usize,
9280 _depth: fidl::encoding::Depth,
9281 ) -> fidl::Result<()> {
9282 decoder.debug_check_bounds::<Self>(offset);
9283 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
9284 unsafe {
9287 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
9288 }
9289 Ok(())
9290 }
9291 }
9292
9293 impl fidl::encoding::ValueTypeMarker for AudioDeviceEnumeratorOnDeviceAddedRequest {
9294 type Borrowed<'a> = &'a Self;
9295 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9296 value
9297 }
9298 }
9299
9300 unsafe impl fidl::encoding::TypeMarker for AudioDeviceEnumeratorOnDeviceAddedRequest {
9301 type Owned = Self;
9302
9303 #[inline(always)]
9304 fn inline_align(_context: fidl::encoding::Context) -> usize {
9305 8
9306 }
9307
9308 #[inline(always)]
9309 fn inline_size(_context: fidl::encoding::Context) -> usize {
9310 56
9311 }
9312 }
9313
9314 unsafe impl<D: fidl::encoding::ResourceDialect>
9315 fidl::encoding::Encode<AudioDeviceEnumeratorOnDeviceAddedRequest, D>
9316 for &AudioDeviceEnumeratorOnDeviceAddedRequest
9317 {
9318 #[inline]
9319 unsafe fn encode(
9320 self,
9321 encoder: &mut fidl::encoding::Encoder<'_, D>,
9322 offset: usize,
9323 _depth: fidl::encoding::Depth,
9324 ) -> fidl::Result<()> {
9325 encoder.debug_check_bounds::<AudioDeviceEnumeratorOnDeviceAddedRequest>(offset);
9326 fidl::encoding::Encode::<AudioDeviceEnumeratorOnDeviceAddedRequest, D>::encode(
9328 (<AudioDeviceInfo as fidl::encoding::ValueTypeMarker>::borrow(&self.device),),
9329 encoder,
9330 offset,
9331 _depth,
9332 )
9333 }
9334 }
9335 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<AudioDeviceInfo, D>>
9336 fidl::encoding::Encode<AudioDeviceEnumeratorOnDeviceAddedRequest, D> for (T0,)
9337 {
9338 #[inline]
9339 unsafe fn encode(
9340 self,
9341 encoder: &mut fidl::encoding::Encoder<'_, D>,
9342 offset: usize,
9343 depth: fidl::encoding::Depth,
9344 ) -> fidl::Result<()> {
9345 encoder.debug_check_bounds::<AudioDeviceEnumeratorOnDeviceAddedRequest>(offset);
9346 self.0.encode(encoder, offset + 0, depth)?;
9350 Ok(())
9351 }
9352 }
9353
9354 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
9355 for AudioDeviceEnumeratorOnDeviceAddedRequest
9356 {
9357 #[inline(always)]
9358 fn new_empty() -> Self {
9359 Self { device: fidl::new_empty!(AudioDeviceInfo, D) }
9360 }
9361
9362 #[inline]
9363 unsafe fn decode(
9364 &mut self,
9365 decoder: &mut fidl::encoding::Decoder<'_, D>,
9366 offset: usize,
9367 _depth: fidl::encoding::Depth,
9368 ) -> fidl::Result<()> {
9369 decoder.debug_check_bounds::<Self>(offset);
9370 fidl::decode!(AudioDeviceInfo, D, &mut self.device, decoder, offset + 0, _depth)?;
9372 Ok(())
9373 }
9374 }
9375
9376 impl fidl::encoding::ValueTypeMarker for AudioDeviceEnumeratorOnDeviceGainChangedRequest {
9377 type Borrowed<'a> = &'a Self;
9378 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9379 value
9380 }
9381 }
9382
9383 unsafe impl fidl::encoding::TypeMarker for AudioDeviceEnumeratorOnDeviceGainChangedRequest {
9384 type Owned = Self;
9385
9386 #[inline(always)]
9387 fn inline_align(_context: fidl::encoding::Context) -> usize {
9388 8
9389 }
9390
9391 #[inline(always)]
9392 fn inline_size(_context: fidl::encoding::Context) -> usize {
9393 16
9394 }
9395 }
9396
9397 unsafe impl<D: fidl::encoding::ResourceDialect>
9398 fidl::encoding::Encode<AudioDeviceEnumeratorOnDeviceGainChangedRequest, D>
9399 for &AudioDeviceEnumeratorOnDeviceGainChangedRequest
9400 {
9401 #[inline]
9402 unsafe fn encode(
9403 self,
9404 encoder: &mut fidl::encoding::Encoder<'_, D>,
9405 offset: usize,
9406 _depth: fidl::encoding::Depth,
9407 ) -> fidl::Result<()> {
9408 encoder.debug_check_bounds::<AudioDeviceEnumeratorOnDeviceGainChangedRequest>(offset);
9409 fidl::encoding::Encode::<AudioDeviceEnumeratorOnDeviceGainChangedRequest, D>::encode(
9411 (
9412 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.device_token),
9413 <AudioGainInfo as fidl::encoding::ValueTypeMarker>::borrow(&self.gain_info),
9414 ),
9415 encoder,
9416 offset,
9417 _depth,
9418 )
9419 }
9420 }
9421 unsafe impl<
9422 D: fidl::encoding::ResourceDialect,
9423 T0: fidl::encoding::Encode<u64, D>,
9424 T1: fidl::encoding::Encode<AudioGainInfo, D>,
9425 > fidl::encoding::Encode<AudioDeviceEnumeratorOnDeviceGainChangedRequest, D> for (T0, T1)
9426 {
9427 #[inline]
9428 unsafe fn encode(
9429 self,
9430 encoder: &mut fidl::encoding::Encoder<'_, D>,
9431 offset: usize,
9432 depth: fidl::encoding::Depth,
9433 ) -> fidl::Result<()> {
9434 encoder.debug_check_bounds::<AudioDeviceEnumeratorOnDeviceGainChangedRequest>(offset);
9435 self.0.encode(encoder, offset + 0, depth)?;
9439 self.1.encode(encoder, offset + 8, depth)?;
9440 Ok(())
9441 }
9442 }
9443
9444 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
9445 for AudioDeviceEnumeratorOnDeviceGainChangedRequest
9446 {
9447 #[inline(always)]
9448 fn new_empty() -> Self {
9449 Self {
9450 device_token: fidl::new_empty!(u64, D),
9451 gain_info: fidl::new_empty!(AudioGainInfo, D),
9452 }
9453 }
9454
9455 #[inline]
9456 unsafe fn decode(
9457 &mut self,
9458 decoder: &mut fidl::encoding::Decoder<'_, D>,
9459 offset: usize,
9460 _depth: fidl::encoding::Depth,
9461 ) -> fidl::Result<()> {
9462 decoder.debug_check_bounds::<Self>(offset);
9463 fidl::decode!(u64, D, &mut self.device_token, decoder, offset + 0, _depth)?;
9465 fidl::decode!(AudioGainInfo, D, &mut self.gain_info, decoder, offset + 8, _depth)?;
9466 Ok(())
9467 }
9468 }
9469
9470 impl fidl::encoding::ValueTypeMarker for AudioDeviceEnumeratorOnDeviceRemovedRequest {
9471 type Borrowed<'a> = &'a Self;
9472 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9473 value
9474 }
9475 }
9476
9477 unsafe impl fidl::encoding::TypeMarker for AudioDeviceEnumeratorOnDeviceRemovedRequest {
9478 type Owned = Self;
9479
9480 #[inline(always)]
9481 fn inline_align(_context: fidl::encoding::Context) -> usize {
9482 8
9483 }
9484
9485 #[inline(always)]
9486 fn inline_size(_context: fidl::encoding::Context) -> usize {
9487 8
9488 }
9489 #[inline(always)]
9490 fn encode_is_copy() -> bool {
9491 true
9492 }
9493
9494 #[inline(always)]
9495 fn decode_is_copy() -> bool {
9496 true
9497 }
9498 }
9499
9500 unsafe impl<D: fidl::encoding::ResourceDialect>
9501 fidl::encoding::Encode<AudioDeviceEnumeratorOnDeviceRemovedRequest, D>
9502 for &AudioDeviceEnumeratorOnDeviceRemovedRequest
9503 {
9504 #[inline]
9505 unsafe fn encode(
9506 self,
9507 encoder: &mut fidl::encoding::Encoder<'_, D>,
9508 offset: usize,
9509 _depth: fidl::encoding::Depth,
9510 ) -> fidl::Result<()> {
9511 encoder.debug_check_bounds::<AudioDeviceEnumeratorOnDeviceRemovedRequest>(offset);
9512 unsafe {
9513 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
9515 (buf_ptr as *mut AudioDeviceEnumeratorOnDeviceRemovedRequest).write_unaligned(
9516 (self as *const AudioDeviceEnumeratorOnDeviceRemovedRequest).read(),
9517 );
9518 }
9521 Ok(())
9522 }
9523 }
9524 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
9525 fidl::encoding::Encode<AudioDeviceEnumeratorOnDeviceRemovedRequest, D> for (T0,)
9526 {
9527 #[inline]
9528 unsafe fn encode(
9529 self,
9530 encoder: &mut fidl::encoding::Encoder<'_, D>,
9531 offset: usize,
9532 depth: fidl::encoding::Depth,
9533 ) -> fidl::Result<()> {
9534 encoder.debug_check_bounds::<AudioDeviceEnumeratorOnDeviceRemovedRequest>(offset);
9535 self.0.encode(encoder, offset + 0, depth)?;
9539 Ok(())
9540 }
9541 }
9542
9543 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
9544 for AudioDeviceEnumeratorOnDeviceRemovedRequest
9545 {
9546 #[inline(always)]
9547 fn new_empty() -> Self {
9548 Self { device_token: fidl::new_empty!(u64, D) }
9549 }
9550
9551 #[inline]
9552 unsafe fn decode(
9553 &mut self,
9554 decoder: &mut fidl::encoding::Decoder<'_, D>,
9555 offset: usize,
9556 _depth: fidl::encoding::Depth,
9557 ) -> fidl::Result<()> {
9558 decoder.debug_check_bounds::<Self>(offset);
9559 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
9560 unsafe {
9563 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
9564 }
9565 Ok(())
9566 }
9567 }
9568
9569 impl fidl::encoding::ValueTypeMarker for AudioDeviceEnumeratorSetDeviceGainRequest {
9570 type Borrowed<'a> = &'a Self;
9571 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9572 value
9573 }
9574 }
9575
9576 unsafe impl fidl::encoding::TypeMarker for AudioDeviceEnumeratorSetDeviceGainRequest {
9577 type Owned = Self;
9578
9579 #[inline(always)]
9580 fn inline_align(_context: fidl::encoding::Context) -> usize {
9581 8
9582 }
9583
9584 #[inline(always)]
9585 fn inline_size(_context: fidl::encoding::Context) -> usize {
9586 24
9587 }
9588 }
9589
9590 unsafe impl<D: fidl::encoding::ResourceDialect>
9591 fidl::encoding::Encode<AudioDeviceEnumeratorSetDeviceGainRequest, D>
9592 for &AudioDeviceEnumeratorSetDeviceGainRequest
9593 {
9594 #[inline]
9595 unsafe fn encode(
9596 self,
9597 encoder: &mut fidl::encoding::Encoder<'_, D>,
9598 offset: usize,
9599 _depth: fidl::encoding::Depth,
9600 ) -> fidl::Result<()> {
9601 encoder.debug_check_bounds::<AudioDeviceEnumeratorSetDeviceGainRequest>(offset);
9602 fidl::encoding::Encode::<AudioDeviceEnumeratorSetDeviceGainRequest, D>::encode(
9604 (
9605 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.device_token),
9606 <AudioGainInfo as fidl::encoding::ValueTypeMarker>::borrow(&self.gain_info),
9607 <AudioGainValidFlags as fidl::encoding::ValueTypeMarker>::borrow(
9608 &self.valid_flags,
9609 ),
9610 ),
9611 encoder,
9612 offset,
9613 _depth,
9614 )
9615 }
9616 }
9617 unsafe impl<
9618 D: fidl::encoding::ResourceDialect,
9619 T0: fidl::encoding::Encode<u64, D>,
9620 T1: fidl::encoding::Encode<AudioGainInfo, D>,
9621 T2: fidl::encoding::Encode<AudioGainValidFlags, D>,
9622 > fidl::encoding::Encode<AudioDeviceEnumeratorSetDeviceGainRequest, D> for (T0, T1, T2)
9623 {
9624 #[inline]
9625 unsafe fn encode(
9626 self,
9627 encoder: &mut fidl::encoding::Encoder<'_, D>,
9628 offset: usize,
9629 depth: fidl::encoding::Depth,
9630 ) -> fidl::Result<()> {
9631 encoder.debug_check_bounds::<AudioDeviceEnumeratorSetDeviceGainRequest>(offset);
9632 unsafe {
9635 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
9636 (ptr as *mut u64).write_unaligned(0);
9637 }
9638 self.0.encode(encoder, offset + 0, depth)?;
9640 self.1.encode(encoder, offset + 8, depth)?;
9641 self.2.encode(encoder, offset + 16, depth)?;
9642 Ok(())
9643 }
9644 }
9645
9646 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
9647 for AudioDeviceEnumeratorSetDeviceGainRequest
9648 {
9649 #[inline(always)]
9650 fn new_empty() -> Self {
9651 Self {
9652 device_token: fidl::new_empty!(u64, D),
9653 gain_info: fidl::new_empty!(AudioGainInfo, D),
9654 valid_flags: fidl::new_empty!(AudioGainValidFlags, D),
9655 }
9656 }
9657
9658 #[inline]
9659 unsafe fn decode(
9660 &mut self,
9661 decoder: &mut fidl::encoding::Decoder<'_, D>,
9662 offset: usize,
9663 _depth: fidl::encoding::Depth,
9664 ) -> fidl::Result<()> {
9665 decoder.debug_check_bounds::<Self>(offset);
9666 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
9668 let padval = unsafe { (ptr as *const u64).read_unaligned() };
9669 let mask = 0xffffffff00000000u64;
9670 let maskedval = padval & mask;
9671 if maskedval != 0 {
9672 return Err(fidl::Error::NonZeroPadding {
9673 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
9674 });
9675 }
9676 fidl::decode!(u64, D, &mut self.device_token, decoder, offset + 0, _depth)?;
9677 fidl::decode!(AudioGainInfo, D, &mut self.gain_info, decoder, offset + 8, _depth)?;
9678 fidl::decode!(
9679 AudioGainValidFlags,
9680 D,
9681 &mut self.valid_flags,
9682 decoder,
9683 offset + 16,
9684 _depth
9685 )?;
9686 Ok(())
9687 }
9688 }
9689
9690 impl fidl::encoding::ValueTypeMarker for AudioDeviceInfo {
9691 type Borrowed<'a> = &'a Self;
9692 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9693 value
9694 }
9695 }
9696
9697 unsafe impl fidl::encoding::TypeMarker for AudioDeviceInfo {
9698 type Owned = Self;
9699
9700 #[inline(always)]
9701 fn inline_align(_context: fidl::encoding::Context) -> usize {
9702 8
9703 }
9704
9705 #[inline(always)]
9706 fn inline_size(_context: fidl::encoding::Context) -> usize {
9707 56
9708 }
9709 }
9710
9711 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AudioDeviceInfo, D>
9712 for &AudioDeviceInfo
9713 {
9714 #[inline]
9715 unsafe fn encode(
9716 self,
9717 encoder: &mut fidl::encoding::Encoder<'_, D>,
9718 offset: usize,
9719 _depth: fidl::encoding::Depth,
9720 ) -> fidl::Result<()> {
9721 encoder.debug_check_bounds::<AudioDeviceInfo>(offset);
9722 fidl::encoding::Encode::<AudioDeviceInfo, D>::encode(
9724 (
9725 <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
9726 &self.name,
9727 ),
9728 <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
9729 &self.unique_id,
9730 ),
9731 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.token_id),
9732 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.is_input),
9733 <AudioGainInfo as fidl::encoding::ValueTypeMarker>::borrow(&self.gain_info),
9734 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.is_default),
9735 ),
9736 encoder,
9737 offset,
9738 _depth,
9739 )
9740 }
9741 }
9742 unsafe impl<
9743 D: fidl::encoding::ResourceDialect,
9744 T0: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
9745 T1: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
9746 T2: fidl::encoding::Encode<u64, D>,
9747 T3: fidl::encoding::Encode<bool, D>,
9748 T4: fidl::encoding::Encode<AudioGainInfo, D>,
9749 T5: fidl::encoding::Encode<bool, D>,
9750 > fidl::encoding::Encode<AudioDeviceInfo, D> for (T0, T1, T2, T3, T4, T5)
9751 {
9752 #[inline]
9753 unsafe fn encode(
9754 self,
9755 encoder: &mut fidl::encoding::Encoder<'_, D>,
9756 offset: usize,
9757 depth: fidl::encoding::Depth,
9758 ) -> fidl::Result<()> {
9759 encoder.debug_check_bounds::<AudioDeviceInfo>(offset);
9760 unsafe {
9763 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(40);
9764 (ptr as *mut u64).write_unaligned(0);
9765 }
9766 unsafe {
9767 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(48);
9768 (ptr as *mut u64).write_unaligned(0);
9769 }
9770 self.0.encode(encoder, offset + 0, depth)?;
9772 self.1.encode(encoder, offset + 16, depth)?;
9773 self.2.encode(encoder, offset + 32, depth)?;
9774 self.3.encode(encoder, offset + 40, depth)?;
9775 self.4.encode(encoder, offset + 44, depth)?;
9776 self.5.encode(encoder, offset + 52, depth)?;
9777 Ok(())
9778 }
9779 }
9780
9781 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AudioDeviceInfo {
9782 #[inline(always)]
9783 fn new_empty() -> Self {
9784 Self {
9785 name: fidl::new_empty!(fidl::encoding::UnboundedString, D),
9786 unique_id: fidl::new_empty!(fidl::encoding::UnboundedString, D),
9787 token_id: fidl::new_empty!(u64, D),
9788 is_input: fidl::new_empty!(bool, D),
9789 gain_info: fidl::new_empty!(AudioGainInfo, D),
9790 is_default: fidl::new_empty!(bool, D),
9791 }
9792 }
9793
9794 #[inline]
9795 unsafe fn decode(
9796 &mut self,
9797 decoder: &mut fidl::encoding::Decoder<'_, D>,
9798 offset: usize,
9799 _depth: fidl::encoding::Depth,
9800 ) -> fidl::Result<()> {
9801 decoder.debug_check_bounds::<Self>(offset);
9802 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(40) };
9804 let padval = unsafe { (ptr as *const u64).read_unaligned() };
9805 let mask = 0xffffff00u64;
9806 let maskedval = padval & mask;
9807 if maskedval != 0 {
9808 return Err(fidl::Error::NonZeroPadding {
9809 padding_start: offset + 40 + ((mask as u64).trailing_zeros() / 8) as usize,
9810 });
9811 }
9812 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(48) };
9813 let padval = unsafe { (ptr as *const u64).read_unaligned() };
9814 let mask = 0xffffff0000000000u64;
9815 let maskedval = padval & mask;
9816 if maskedval != 0 {
9817 return Err(fidl::Error::NonZeroPadding {
9818 padding_start: offset + 48 + ((mask as u64).trailing_zeros() / 8) as usize,
9819 });
9820 }
9821 fidl::decode!(
9822 fidl::encoding::UnboundedString,
9823 D,
9824 &mut self.name,
9825 decoder,
9826 offset + 0,
9827 _depth
9828 )?;
9829 fidl::decode!(
9830 fidl::encoding::UnboundedString,
9831 D,
9832 &mut self.unique_id,
9833 decoder,
9834 offset + 16,
9835 _depth
9836 )?;
9837 fidl::decode!(u64, D, &mut self.token_id, decoder, offset + 32, _depth)?;
9838 fidl::decode!(bool, D, &mut self.is_input, decoder, offset + 40, _depth)?;
9839 fidl::decode!(AudioGainInfo, D, &mut self.gain_info, decoder, offset + 44, _depth)?;
9840 fidl::decode!(bool, D, &mut self.is_default, decoder, offset + 52, _depth)?;
9841 Ok(())
9842 }
9843 }
9844
9845 impl fidl::encoding::ValueTypeMarker for AudioGainInfo {
9846 type Borrowed<'a> = &'a Self;
9847 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9848 value
9849 }
9850 }
9851
9852 unsafe impl fidl::encoding::TypeMarker for AudioGainInfo {
9853 type Owned = Self;
9854
9855 #[inline(always)]
9856 fn inline_align(_context: fidl::encoding::Context) -> usize {
9857 4
9858 }
9859
9860 #[inline(always)]
9861 fn inline_size(_context: fidl::encoding::Context) -> usize {
9862 8
9863 }
9864 }
9865
9866 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AudioGainInfo, D>
9867 for &AudioGainInfo
9868 {
9869 #[inline]
9870 unsafe fn encode(
9871 self,
9872 encoder: &mut fidl::encoding::Encoder<'_, D>,
9873 offset: usize,
9874 _depth: fidl::encoding::Depth,
9875 ) -> fidl::Result<()> {
9876 encoder.debug_check_bounds::<AudioGainInfo>(offset);
9877 fidl::encoding::Encode::<AudioGainInfo, D>::encode(
9879 (
9880 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.gain_db),
9881 <AudioGainInfoFlags as fidl::encoding::ValueTypeMarker>::borrow(&self.flags),
9882 ),
9883 encoder,
9884 offset,
9885 _depth,
9886 )
9887 }
9888 }
9889 unsafe impl<
9890 D: fidl::encoding::ResourceDialect,
9891 T0: fidl::encoding::Encode<f32, D>,
9892 T1: fidl::encoding::Encode<AudioGainInfoFlags, D>,
9893 > fidl::encoding::Encode<AudioGainInfo, D> for (T0, T1)
9894 {
9895 #[inline]
9896 unsafe fn encode(
9897 self,
9898 encoder: &mut fidl::encoding::Encoder<'_, D>,
9899 offset: usize,
9900 depth: fidl::encoding::Depth,
9901 ) -> fidl::Result<()> {
9902 encoder.debug_check_bounds::<AudioGainInfo>(offset);
9903 self.0.encode(encoder, offset + 0, depth)?;
9907 self.1.encode(encoder, offset + 4, depth)?;
9908 Ok(())
9909 }
9910 }
9911
9912 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AudioGainInfo {
9913 #[inline(always)]
9914 fn new_empty() -> Self {
9915 Self {
9916 gain_db: fidl::new_empty!(f32, D),
9917 flags: fidl::new_empty!(AudioGainInfoFlags, D),
9918 }
9919 }
9920
9921 #[inline]
9922 unsafe fn decode(
9923 &mut self,
9924 decoder: &mut fidl::encoding::Decoder<'_, D>,
9925 offset: usize,
9926 _depth: fidl::encoding::Depth,
9927 ) -> fidl::Result<()> {
9928 decoder.debug_check_bounds::<Self>(offset);
9929 fidl::decode!(f32, D, &mut self.gain_db, decoder, offset + 0, _depth)?;
9931 fidl::decode!(AudioGainInfoFlags, D, &mut self.flags, decoder, offset + 4, _depth)?;
9932 Ok(())
9933 }
9934 }
9935
9936 impl fidl::encoding::ValueTypeMarker for AudioRendererEnableMinLeadTimeEventsRequest {
9937 type Borrowed<'a> = &'a Self;
9938 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9939 value
9940 }
9941 }
9942
9943 unsafe impl fidl::encoding::TypeMarker for AudioRendererEnableMinLeadTimeEventsRequest {
9944 type Owned = Self;
9945
9946 #[inline(always)]
9947 fn inline_align(_context: fidl::encoding::Context) -> usize {
9948 1
9949 }
9950
9951 #[inline(always)]
9952 fn inline_size(_context: fidl::encoding::Context) -> usize {
9953 1
9954 }
9955 }
9956
9957 unsafe impl<D: fidl::encoding::ResourceDialect>
9958 fidl::encoding::Encode<AudioRendererEnableMinLeadTimeEventsRequest, D>
9959 for &AudioRendererEnableMinLeadTimeEventsRequest
9960 {
9961 #[inline]
9962 unsafe fn encode(
9963 self,
9964 encoder: &mut fidl::encoding::Encoder<'_, D>,
9965 offset: usize,
9966 _depth: fidl::encoding::Depth,
9967 ) -> fidl::Result<()> {
9968 encoder.debug_check_bounds::<AudioRendererEnableMinLeadTimeEventsRequest>(offset);
9969 fidl::encoding::Encode::<AudioRendererEnableMinLeadTimeEventsRequest, D>::encode(
9971 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.enabled),),
9972 encoder,
9973 offset,
9974 _depth,
9975 )
9976 }
9977 }
9978 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
9979 fidl::encoding::Encode<AudioRendererEnableMinLeadTimeEventsRequest, D> for (T0,)
9980 {
9981 #[inline]
9982 unsafe fn encode(
9983 self,
9984 encoder: &mut fidl::encoding::Encoder<'_, D>,
9985 offset: usize,
9986 depth: fidl::encoding::Depth,
9987 ) -> fidl::Result<()> {
9988 encoder.debug_check_bounds::<AudioRendererEnableMinLeadTimeEventsRequest>(offset);
9989 self.0.encode(encoder, offset + 0, depth)?;
9993 Ok(())
9994 }
9995 }
9996
9997 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
9998 for AudioRendererEnableMinLeadTimeEventsRequest
9999 {
10000 #[inline(always)]
10001 fn new_empty() -> Self {
10002 Self { enabled: fidl::new_empty!(bool, D) }
10003 }
10004
10005 #[inline]
10006 unsafe fn decode(
10007 &mut self,
10008 decoder: &mut fidl::encoding::Decoder<'_, D>,
10009 offset: usize,
10010 _depth: fidl::encoding::Depth,
10011 ) -> fidl::Result<()> {
10012 decoder.debug_check_bounds::<Self>(offset);
10013 fidl::decode!(bool, D, &mut self.enabled, decoder, offset + 0, _depth)?;
10015 Ok(())
10016 }
10017 }
10018
10019 impl fidl::encoding::ValueTypeMarker for AudioRendererGetMinLeadTimeResponse {
10020 type Borrowed<'a> = &'a Self;
10021 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10022 value
10023 }
10024 }
10025
10026 unsafe impl fidl::encoding::TypeMarker for AudioRendererGetMinLeadTimeResponse {
10027 type Owned = Self;
10028
10029 #[inline(always)]
10030 fn inline_align(_context: fidl::encoding::Context) -> usize {
10031 8
10032 }
10033
10034 #[inline(always)]
10035 fn inline_size(_context: fidl::encoding::Context) -> usize {
10036 8
10037 }
10038 #[inline(always)]
10039 fn encode_is_copy() -> bool {
10040 true
10041 }
10042
10043 #[inline(always)]
10044 fn decode_is_copy() -> bool {
10045 true
10046 }
10047 }
10048
10049 unsafe impl<D: fidl::encoding::ResourceDialect>
10050 fidl::encoding::Encode<AudioRendererGetMinLeadTimeResponse, D>
10051 for &AudioRendererGetMinLeadTimeResponse
10052 {
10053 #[inline]
10054 unsafe fn encode(
10055 self,
10056 encoder: &mut fidl::encoding::Encoder<'_, D>,
10057 offset: usize,
10058 _depth: fidl::encoding::Depth,
10059 ) -> fidl::Result<()> {
10060 encoder.debug_check_bounds::<AudioRendererGetMinLeadTimeResponse>(offset);
10061 unsafe {
10062 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
10064 (buf_ptr as *mut AudioRendererGetMinLeadTimeResponse)
10065 .write_unaligned((self as *const AudioRendererGetMinLeadTimeResponse).read());
10066 }
10069 Ok(())
10070 }
10071 }
10072 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i64, D>>
10073 fidl::encoding::Encode<AudioRendererGetMinLeadTimeResponse, D> for (T0,)
10074 {
10075 #[inline]
10076 unsafe fn encode(
10077 self,
10078 encoder: &mut fidl::encoding::Encoder<'_, D>,
10079 offset: usize,
10080 depth: fidl::encoding::Depth,
10081 ) -> fidl::Result<()> {
10082 encoder.debug_check_bounds::<AudioRendererGetMinLeadTimeResponse>(offset);
10083 self.0.encode(encoder, offset + 0, depth)?;
10087 Ok(())
10088 }
10089 }
10090
10091 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
10092 for AudioRendererGetMinLeadTimeResponse
10093 {
10094 #[inline(always)]
10095 fn new_empty() -> Self {
10096 Self { min_lead_time_nsec: fidl::new_empty!(i64, D) }
10097 }
10098
10099 #[inline]
10100 unsafe fn decode(
10101 &mut self,
10102 decoder: &mut fidl::encoding::Decoder<'_, D>,
10103 offset: usize,
10104 _depth: fidl::encoding::Depth,
10105 ) -> fidl::Result<()> {
10106 decoder.debug_check_bounds::<Self>(offset);
10107 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
10108 unsafe {
10111 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
10112 }
10113 Ok(())
10114 }
10115 }
10116
10117 impl fidl::encoding::ValueTypeMarker for AudioRendererOnMinLeadTimeChangedRequest {
10118 type Borrowed<'a> = &'a Self;
10119 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10120 value
10121 }
10122 }
10123
10124 unsafe impl fidl::encoding::TypeMarker for AudioRendererOnMinLeadTimeChangedRequest {
10125 type Owned = Self;
10126
10127 #[inline(always)]
10128 fn inline_align(_context: fidl::encoding::Context) -> usize {
10129 8
10130 }
10131
10132 #[inline(always)]
10133 fn inline_size(_context: fidl::encoding::Context) -> usize {
10134 8
10135 }
10136 #[inline(always)]
10137 fn encode_is_copy() -> bool {
10138 true
10139 }
10140
10141 #[inline(always)]
10142 fn decode_is_copy() -> bool {
10143 true
10144 }
10145 }
10146
10147 unsafe impl<D: fidl::encoding::ResourceDialect>
10148 fidl::encoding::Encode<AudioRendererOnMinLeadTimeChangedRequest, D>
10149 for &AudioRendererOnMinLeadTimeChangedRequest
10150 {
10151 #[inline]
10152 unsafe fn encode(
10153 self,
10154 encoder: &mut fidl::encoding::Encoder<'_, D>,
10155 offset: usize,
10156 _depth: fidl::encoding::Depth,
10157 ) -> fidl::Result<()> {
10158 encoder.debug_check_bounds::<AudioRendererOnMinLeadTimeChangedRequest>(offset);
10159 unsafe {
10160 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
10162 (buf_ptr as *mut AudioRendererOnMinLeadTimeChangedRequest).write_unaligned(
10163 (self as *const AudioRendererOnMinLeadTimeChangedRequest).read(),
10164 );
10165 }
10168 Ok(())
10169 }
10170 }
10171 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i64, D>>
10172 fidl::encoding::Encode<AudioRendererOnMinLeadTimeChangedRequest, D> for (T0,)
10173 {
10174 #[inline]
10175 unsafe fn encode(
10176 self,
10177 encoder: &mut fidl::encoding::Encoder<'_, D>,
10178 offset: usize,
10179 depth: fidl::encoding::Depth,
10180 ) -> fidl::Result<()> {
10181 encoder.debug_check_bounds::<AudioRendererOnMinLeadTimeChangedRequest>(offset);
10182 self.0.encode(encoder, offset + 0, depth)?;
10186 Ok(())
10187 }
10188 }
10189
10190 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
10191 for AudioRendererOnMinLeadTimeChangedRequest
10192 {
10193 #[inline(always)]
10194 fn new_empty() -> Self {
10195 Self { min_lead_time_nsec: fidl::new_empty!(i64, D) }
10196 }
10197
10198 #[inline]
10199 unsafe fn decode(
10200 &mut self,
10201 decoder: &mut fidl::encoding::Decoder<'_, D>,
10202 offset: usize,
10203 _depth: fidl::encoding::Depth,
10204 ) -> fidl::Result<()> {
10205 decoder.debug_check_bounds::<Self>(offset);
10206 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
10207 unsafe {
10210 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
10211 }
10212 Ok(())
10213 }
10214 }
10215
10216 impl fidl::encoding::ValueTypeMarker for AudioRendererPauseResponse {
10217 type Borrowed<'a> = &'a Self;
10218 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10219 value
10220 }
10221 }
10222
10223 unsafe impl fidl::encoding::TypeMarker for AudioRendererPauseResponse {
10224 type Owned = Self;
10225
10226 #[inline(always)]
10227 fn inline_align(_context: fidl::encoding::Context) -> usize {
10228 8
10229 }
10230
10231 #[inline(always)]
10232 fn inline_size(_context: fidl::encoding::Context) -> usize {
10233 16
10234 }
10235 #[inline(always)]
10236 fn encode_is_copy() -> bool {
10237 true
10238 }
10239
10240 #[inline(always)]
10241 fn decode_is_copy() -> bool {
10242 true
10243 }
10244 }
10245
10246 unsafe impl<D: fidl::encoding::ResourceDialect>
10247 fidl::encoding::Encode<AudioRendererPauseResponse, D> for &AudioRendererPauseResponse
10248 {
10249 #[inline]
10250 unsafe fn encode(
10251 self,
10252 encoder: &mut fidl::encoding::Encoder<'_, D>,
10253 offset: usize,
10254 _depth: fidl::encoding::Depth,
10255 ) -> fidl::Result<()> {
10256 encoder.debug_check_bounds::<AudioRendererPauseResponse>(offset);
10257 unsafe {
10258 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
10260 (buf_ptr as *mut AudioRendererPauseResponse)
10261 .write_unaligned((self as *const AudioRendererPauseResponse).read());
10262 }
10265 Ok(())
10266 }
10267 }
10268 unsafe impl<
10269 D: fidl::encoding::ResourceDialect,
10270 T0: fidl::encoding::Encode<i64, D>,
10271 T1: fidl::encoding::Encode<i64, D>,
10272 > fidl::encoding::Encode<AudioRendererPauseResponse, D> for (T0, T1)
10273 {
10274 #[inline]
10275 unsafe fn encode(
10276 self,
10277 encoder: &mut fidl::encoding::Encoder<'_, D>,
10278 offset: usize,
10279 depth: fidl::encoding::Depth,
10280 ) -> fidl::Result<()> {
10281 encoder.debug_check_bounds::<AudioRendererPauseResponse>(offset);
10282 self.0.encode(encoder, offset + 0, depth)?;
10286 self.1.encode(encoder, offset + 8, depth)?;
10287 Ok(())
10288 }
10289 }
10290
10291 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
10292 for AudioRendererPauseResponse
10293 {
10294 #[inline(always)]
10295 fn new_empty() -> Self {
10296 Self { reference_time: fidl::new_empty!(i64, D), media_time: fidl::new_empty!(i64, D) }
10297 }
10298
10299 #[inline]
10300 unsafe fn decode(
10301 &mut self,
10302 decoder: &mut fidl::encoding::Decoder<'_, D>,
10303 offset: usize,
10304 _depth: fidl::encoding::Depth,
10305 ) -> fidl::Result<()> {
10306 decoder.debug_check_bounds::<Self>(offset);
10307 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
10308 unsafe {
10311 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
10312 }
10313 Ok(())
10314 }
10315 }
10316
10317 impl fidl::encoding::ValueTypeMarker for AudioRendererPlayNoReplyRequest {
10318 type Borrowed<'a> = &'a Self;
10319 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10320 value
10321 }
10322 }
10323
10324 unsafe impl fidl::encoding::TypeMarker for AudioRendererPlayNoReplyRequest {
10325 type Owned = Self;
10326
10327 #[inline(always)]
10328 fn inline_align(_context: fidl::encoding::Context) -> usize {
10329 8
10330 }
10331
10332 #[inline(always)]
10333 fn inline_size(_context: fidl::encoding::Context) -> usize {
10334 16
10335 }
10336 #[inline(always)]
10337 fn encode_is_copy() -> bool {
10338 true
10339 }
10340
10341 #[inline(always)]
10342 fn decode_is_copy() -> bool {
10343 true
10344 }
10345 }
10346
10347 unsafe impl<D: fidl::encoding::ResourceDialect>
10348 fidl::encoding::Encode<AudioRendererPlayNoReplyRequest, D>
10349 for &AudioRendererPlayNoReplyRequest
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::<AudioRendererPlayNoReplyRequest>(offset);
10359 unsafe {
10360 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
10362 (buf_ptr as *mut AudioRendererPlayNoReplyRequest)
10363 .write_unaligned((self as *const AudioRendererPlayNoReplyRequest).read());
10364 }
10367 Ok(())
10368 }
10369 }
10370 unsafe impl<
10371 D: fidl::encoding::ResourceDialect,
10372 T0: fidl::encoding::Encode<i64, D>,
10373 T1: fidl::encoding::Encode<i64, D>,
10374 > fidl::encoding::Encode<AudioRendererPlayNoReplyRequest, D> for (T0, T1)
10375 {
10376 #[inline]
10377 unsafe fn encode(
10378 self,
10379 encoder: &mut fidl::encoding::Encoder<'_, D>,
10380 offset: usize,
10381 depth: fidl::encoding::Depth,
10382 ) -> fidl::Result<()> {
10383 encoder.debug_check_bounds::<AudioRendererPlayNoReplyRequest>(offset);
10384 self.0.encode(encoder, offset + 0, depth)?;
10388 self.1.encode(encoder, offset + 8, depth)?;
10389 Ok(())
10390 }
10391 }
10392
10393 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
10394 for AudioRendererPlayNoReplyRequest
10395 {
10396 #[inline(always)]
10397 fn new_empty() -> Self {
10398 Self { reference_time: fidl::new_empty!(i64, D), media_time: fidl::new_empty!(i64, D) }
10399 }
10400
10401 #[inline]
10402 unsafe fn decode(
10403 &mut self,
10404 decoder: &mut fidl::encoding::Decoder<'_, D>,
10405 offset: usize,
10406 _depth: fidl::encoding::Depth,
10407 ) -> fidl::Result<()> {
10408 decoder.debug_check_bounds::<Self>(offset);
10409 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
10410 unsafe {
10413 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
10414 }
10415 Ok(())
10416 }
10417 }
10418
10419 impl fidl::encoding::ValueTypeMarker for AudioRendererPlayRequest {
10420 type Borrowed<'a> = &'a Self;
10421 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10422 value
10423 }
10424 }
10425
10426 unsafe impl fidl::encoding::TypeMarker for AudioRendererPlayRequest {
10427 type Owned = Self;
10428
10429 #[inline(always)]
10430 fn inline_align(_context: fidl::encoding::Context) -> usize {
10431 8
10432 }
10433
10434 #[inline(always)]
10435 fn inline_size(_context: fidl::encoding::Context) -> usize {
10436 16
10437 }
10438 #[inline(always)]
10439 fn encode_is_copy() -> bool {
10440 true
10441 }
10442
10443 #[inline(always)]
10444 fn decode_is_copy() -> bool {
10445 true
10446 }
10447 }
10448
10449 unsafe impl<D: fidl::encoding::ResourceDialect>
10450 fidl::encoding::Encode<AudioRendererPlayRequest, D> for &AudioRendererPlayRequest
10451 {
10452 #[inline]
10453 unsafe fn encode(
10454 self,
10455 encoder: &mut fidl::encoding::Encoder<'_, D>,
10456 offset: usize,
10457 _depth: fidl::encoding::Depth,
10458 ) -> fidl::Result<()> {
10459 encoder.debug_check_bounds::<AudioRendererPlayRequest>(offset);
10460 unsafe {
10461 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
10463 (buf_ptr as *mut AudioRendererPlayRequest)
10464 .write_unaligned((self as *const AudioRendererPlayRequest).read());
10465 }
10468 Ok(())
10469 }
10470 }
10471 unsafe impl<
10472 D: fidl::encoding::ResourceDialect,
10473 T0: fidl::encoding::Encode<i64, D>,
10474 T1: fidl::encoding::Encode<i64, D>,
10475 > fidl::encoding::Encode<AudioRendererPlayRequest, D> for (T0, T1)
10476 {
10477 #[inline]
10478 unsafe fn encode(
10479 self,
10480 encoder: &mut fidl::encoding::Encoder<'_, D>,
10481 offset: usize,
10482 depth: fidl::encoding::Depth,
10483 ) -> fidl::Result<()> {
10484 encoder.debug_check_bounds::<AudioRendererPlayRequest>(offset);
10485 self.0.encode(encoder, offset + 0, depth)?;
10489 self.1.encode(encoder, offset + 8, depth)?;
10490 Ok(())
10491 }
10492 }
10493
10494 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
10495 for AudioRendererPlayRequest
10496 {
10497 #[inline(always)]
10498 fn new_empty() -> Self {
10499 Self { reference_time: fidl::new_empty!(i64, D), media_time: fidl::new_empty!(i64, D) }
10500 }
10501
10502 #[inline]
10503 unsafe fn decode(
10504 &mut self,
10505 decoder: &mut fidl::encoding::Decoder<'_, D>,
10506 offset: usize,
10507 _depth: fidl::encoding::Depth,
10508 ) -> fidl::Result<()> {
10509 decoder.debug_check_bounds::<Self>(offset);
10510 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
10511 unsafe {
10514 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
10515 }
10516 Ok(())
10517 }
10518 }
10519
10520 impl fidl::encoding::ValueTypeMarker for AudioRendererPlayResponse {
10521 type Borrowed<'a> = &'a Self;
10522 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10523 value
10524 }
10525 }
10526
10527 unsafe impl fidl::encoding::TypeMarker for AudioRendererPlayResponse {
10528 type Owned = Self;
10529
10530 #[inline(always)]
10531 fn inline_align(_context: fidl::encoding::Context) -> usize {
10532 8
10533 }
10534
10535 #[inline(always)]
10536 fn inline_size(_context: fidl::encoding::Context) -> usize {
10537 16
10538 }
10539 #[inline(always)]
10540 fn encode_is_copy() -> bool {
10541 true
10542 }
10543
10544 #[inline(always)]
10545 fn decode_is_copy() -> bool {
10546 true
10547 }
10548 }
10549
10550 unsafe impl<D: fidl::encoding::ResourceDialect>
10551 fidl::encoding::Encode<AudioRendererPlayResponse, D> for &AudioRendererPlayResponse
10552 {
10553 #[inline]
10554 unsafe fn encode(
10555 self,
10556 encoder: &mut fidl::encoding::Encoder<'_, D>,
10557 offset: usize,
10558 _depth: fidl::encoding::Depth,
10559 ) -> fidl::Result<()> {
10560 encoder.debug_check_bounds::<AudioRendererPlayResponse>(offset);
10561 unsafe {
10562 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
10564 (buf_ptr as *mut AudioRendererPlayResponse)
10565 .write_unaligned((self as *const AudioRendererPlayResponse).read());
10566 }
10569 Ok(())
10570 }
10571 }
10572 unsafe impl<
10573 D: fidl::encoding::ResourceDialect,
10574 T0: fidl::encoding::Encode<i64, D>,
10575 T1: fidl::encoding::Encode<i64, D>,
10576 > fidl::encoding::Encode<AudioRendererPlayResponse, D> for (T0, T1)
10577 {
10578 #[inline]
10579 unsafe fn encode(
10580 self,
10581 encoder: &mut fidl::encoding::Encoder<'_, D>,
10582 offset: usize,
10583 depth: fidl::encoding::Depth,
10584 ) -> fidl::Result<()> {
10585 encoder.debug_check_bounds::<AudioRendererPlayResponse>(offset);
10586 self.0.encode(encoder, offset + 0, depth)?;
10590 self.1.encode(encoder, offset + 8, depth)?;
10591 Ok(())
10592 }
10593 }
10594
10595 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
10596 for AudioRendererPlayResponse
10597 {
10598 #[inline(always)]
10599 fn new_empty() -> Self {
10600 Self { reference_time: fidl::new_empty!(i64, D), media_time: fidl::new_empty!(i64, D) }
10601 }
10602
10603 #[inline]
10604 unsafe fn decode(
10605 &mut self,
10606 decoder: &mut fidl::encoding::Decoder<'_, D>,
10607 offset: usize,
10608 _depth: fidl::encoding::Depth,
10609 ) -> fidl::Result<()> {
10610 decoder.debug_check_bounds::<Self>(offset);
10611 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
10612 unsafe {
10615 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
10616 }
10617 Ok(())
10618 }
10619 }
10620
10621 impl fidl::encoding::ValueTypeMarker for AudioRendererSetPcmStreamTypeRequest {
10622 type Borrowed<'a> = &'a Self;
10623 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10624 value
10625 }
10626 }
10627
10628 unsafe impl fidl::encoding::TypeMarker for AudioRendererSetPcmStreamTypeRequest {
10629 type Owned = Self;
10630
10631 #[inline(always)]
10632 fn inline_align(_context: fidl::encoding::Context) -> usize {
10633 4
10634 }
10635
10636 #[inline(always)]
10637 fn inline_size(_context: fidl::encoding::Context) -> usize {
10638 12
10639 }
10640 }
10641
10642 unsafe impl<D: fidl::encoding::ResourceDialect>
10643 fidl::encoding::Encode<AudioRendererSetPcmStreamTypeRequest, D>
10644 for &AudioRendererSetPcmStreamTypeRequest
10645 {
10646 #[inline]
10647 unsafe fn encode(
10648 self,
10649 encoder: &mut fidl::encoding::Encoder<'_, D>,
10650 offset: usize,
10651 _depth: fidl::encoding::Depth,
10652 ) -> fidl::Result<()> {
10653 encoder.debug_check_bounds::<AudioRendererSetPcmStreamTypeRequest>(offset);
10654 fidl::encoding::Encode::<AudioRendererSetPcmStreamTypeRequest, D>::encode(
10656 (<AudioStreamType as fidl::encoding::ValueTypeMarker>::borrow(&self.type_),),
10657 encoder,
10658 offset,
10659 _depth,
10660 )
10661 }
10662 }
10663 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<AudioStreamType, D>>
10664 fidl::encoding::Encode<AudioRendererSetPcmStreamTypeRequest, D> for (T0,)
10665 {
10666 #[inline]
10667 unsafe fn encode(
10668 self,
10669 encoder: &mut fidl::encoding::Encoder<'_, D>,
10670 offset: usize,
10671 depth: fidl::encoding::Depth,
10672 ) -> fidl::Result<()> {
10673 encoder.debug_check_bounds::<AudioRendererSetPcmStreamTypeRequest>(offset);
10674 self.0.encode(encoder, offset + 0, depth)?;
10678 Ok(())
10679 }
10680 }
10681
10682 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
10683 for AudioRendererSetPcmStreamTypeRequest
10684 {
10685 #[inline(always)]
10686 fn new_empty() -> Self {
10687 Self { type_: fidl::new_empty!(AudioStreamType, D) }
10688 }
10689
10690 #[inline]
10691 unsafe fn decode(
10692 &mut self,
10693 decoder: &mut fidl::encoding::Decoder<'_, D>,
10694 offset: usize,
10695 _depth: fidl::encoding::Depth,
10696 ) -> fidl::Result<()> {
10697 decoder.debug_check_bounds::<Self>(offset);
10698 fidl::decode!(AudioStreamType, D, &mut self.type_, decoder, offset + 0, _depth)?;
10700 Ok(())
10701 }
10702 }
10703
10704 impl fidl::encoding::ValueTypeMarker for AudioRendererSetPtsContinuityThresholdRequest {
10705 type Borrowed<'a> = &'a Self;
10706 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10707 value
10708 }
10709 }
10710
10711 unsafe impl fidl::encoding::TypeMarker for AudioRendererSetPtsContinuityThresholdRequest {
10712 type Owned = Self;
10713
10714 #[inline(always)]
10715 fn inline_align(_context: fidl::encoding::Context) -> usize {
10716 4
10717 }
10718
10719 #[inline(always)]
10720 fn inline_size(_context: fidl::encoding::Context) -> usize {
10721 4
10722 }
10723 }
10724
10725 unsafe impl<D: fidl::encoding::ResourceDialect>
10726 fidl::encoding::Encode<AudioRendererSetPtsContinuityThresholdRequest, D>
10727 for &AudioRendererSetPtsContinuityThresholdRequest
10728 {
10729 #[inline]
10730 unsafe fn encode(
10731 self,
10732 encoder: &mut fidl::encoding::Encoder<'_, D>,
10733 offset: usize,
10734 _depth: fidl::encoding::Depth,
10735 ) -> fidl::Result<()> {
10736 encoder.debug_check_bounds::<AudioRendererSetPtsContinuityThresholdRequest>(offset);
10737 fidl::encoding::Encode::<AudioRendererSetPtsContinuityThresholdRequest, D>::encode(
10739 (<f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.threshold_seconds),),
10740 encoder,
10741 offset,
10742 _depth,
10743 )
10744 }
10745 }
10746 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<f32, D>>
10747 fidl::encoding::Encode<AudioRendererSetPtsContinuityThresholdRequest, D> for (T0,)
10748 {
10749 #[inline]
10750 unsafe fn encode(
10751 self,
10752 encoder: &mut fidl::encoding::Encoder<'_, D>,
10753 offset: usize,
10754 depth: fidl::encoding::Depth,
10755 ) -> fidl::Result<()> {
10756 encoder.debug_check_bounds::<AudioRendererSetPtsContinuityThresholdRequest>(offset);
10757 self.0.encode(encoder, offset + 0, depth)?;
10761 Ok(())
10762 }
10763 }
10764
10765 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
10766 for AudioRendererSetPtsContinuityThresholdRequest
10767 {
10768 #[inline(always)]
10769 fn new_empty() -> Self {
10770 Self { threshold_seconds: fidl::new_empty!(f32, D) }
10771 }
10772
10773 #[inline]
10774 unsafe fn decode(
10775 &mut self,
10776 decoder: &mut fidl::encoding::Decoder<'_, D>,
10777 offset: usize,
10778 _depth: fidl::encoding::Depth,
10779 ) -> fidl::Result<()> {
10780 decoder.debug_check_bounds::<Self>(offset);
10781 fidl::decode!(f32, D, &mut self.threshold_seconds, decoder, offset + 0, _depth)?;
10783 Ok(())
10784 }
10785 }
10786
10787 impl fidl::encoding::ValueTypeMarker for AudioRendererSetPtsUnitsRequest {
10788 type Borrowed<'a> = &'a Self;
10789 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10790 value
10791 }
10792 }
10793
10794 unsafe impl fidl::encoding::TypeMarker for AudioRendererSetPtsUnitsRequest {
10795 type Owned = Self;
10796
10797 #[inline(always)]
10798 fn inline_align(_context: fidl::encoding::Context) -> usize {
10799 4
10800 }
10801
10802 #[inline(always)]
10803 fn inline_size(_context: fidl::encoding::Context) -> usize {
10804 8
10805 }
10806 #[inline(always)]
10807 fn encode_is_copy() -> bool {
10808 true
10809 }
10810
10811 #[inline(always)]
10812 fn decode_is_copy() -> bool {
10813 true
10814 }
10815 }
10816
10817 unsafe impl<D: fidl::encoding::ResourceDialect>
10818 fidl::encoding::Encode<AudioRendererSetPtsUnitsRequest, D>
10819 for &AudioRendererSetPtsUnitsRequest
10820 {
10821 #[inline]
10822 unsafe fn encode(
10823 self,
10824 encoder: &mut fidl::encoding::Encoder<'_, D>,
10825 offset: usize,
10826 _depth: fidl::encoding::Depth,
10827 ) -> fidl::Result<()> {
10828 encoder.debug_check_bounds::<AudioRendererSetPtsUnitsRequest>(offset);
10829 unsafe {
10830 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
10832 (buf_ptr as *mut AudioRendererSetPtsUnitsRequest)
10833 .write_unaligned((self as *const AudioRendererSetPtsUnitsRequest).read());
10834 }
10837 Ok(())
10838 }
10839 }
10840 unsafe impl<
10841 D: fidl::encoding::ResourceDialect,
10842 T0: fidl::encoding::Encode<u32, D>,
10843 T1: fidl::encoding::Encode<u32, D>,
10844 > fidl::encoding::Encode<AudioRendererSetPtsUnitsRequest, D> for (T0, T1)
10845 {
10846 #[inline]
10847 unsafe fn encode(
10848 self,
10849 encoder: &mut fidl::encoding::Encoder<'_, D>,
10850 offset: usize,
10851 depth: fidl::encoding::Depth,
10852 ) -> fidl::Result<()> {
10853 encoder.debug_check_bounds::<AudioRendererSetPtsUnitsRequest>(offset);
10854 self.0.encode(encoder, offset + 0, depth)?;
10858 self.1.encode(encoder, offset + 4, depth)?;
10859 Ok(())
10860 }
10861 }
10862
10863 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
10864 for AudioRendererSetPtsUnitsRequest
10865 {
10866 #[inline(always)]
10867 fn new_empty() -> Self {
10868 Self {
10869 tick_per_second_numerator: fidl::new_empty!(u32, D),
10870 tick_per_second_denominator: fidl::new_empty!(u32, D),
10871 }
10872 }
10873
10874 #[inline]
10875 unsafe fn decode(
10876 &mut self,
10877 decoder: &mut fidl::encoding::Decoder<'_, D>,
10878 offset: usize,
10879 _depth: fidl::encoding::Depth,
10880 ) -> fidl::Result<()> {
10881 decoder.debug_check_bounds::<Self>(offset);
10882 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
10883 unsafe {
10886 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
10887 }
10888 Ok(())
10889 }
10890 }
10891
10892 impl fidl::encoding::ValueTypeMarker for AudioRendererSetUsage2Request {
10893 type Borrowed<'a> = &'a Self;
10894 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10895 value
10896 }
10897 }
10898
10899 unsafe impl fidl::encoding::TypeMarker for AudioRendererSetUsage2Request {
10900 type Owned = Self;
10901
10902 #[inline(always)]
10903 fn inline_align(_context: fidl::encoding::Context) -> usize {
10904 4
10905 }
10906
10907 #[inline(always)]
10908 fn inline_size(_context: fidl::encoding::Context) -> usize {
10909 4
10910 }
10911 }
10912
10913 unsafe impl<D: fidl::encoding::ResourceDialect>
10914 fidl::encoding::Encode<AudioRendererSetUsage2Request, D>
10915 for &AudioRendererSetUsage2Request
10916 {
10917 #[inline]
10918 unsafe fn encode(
10919 self,
10920 encoder: &mut fidl::encoding::Encoder<'_, D>,
10921 offset: usize,
10922 _depth: fidl::encoding::Depth,
10923 ) -> fidl::Result<()> {
10924 encoder.debug_check_bounds::<AudioRendererSetUsage2Request>(offset);
10925 fidl::encoding::Encode::<AudioRendererSetUsage2Request, D>::encode(
10927 (<AudioRenderUsage2 as fidl::encoding::ValueTypeMarker>::borrow(&self.usage2),),
10928 encoder,
10929 offset,
10930 _depth,
10931 )
10932 }
10933 }
10934 unsafe impl<
10935 D: fidl::encoding::ResourceDialect,
10936 T0: fidl::encoding::Encode<AudioRenderUsage2, D>,
10937 > fidl::encoding::Encode<AudioRendererSetUsage2Request, D> for (T0,)
10938 {
10939 #[inline]
10940 unsafe fn encode(
10941 self,
10942 encoder: &mut fidl::encoding::Encoder<'_, D>,
10943 offset: usize,
10944 depth: fidl::encoding::Depth,
10945 ) -> fidl::Result<()> {
10946 encoder.debug_check_bounds::<AudioRendererSetUsage2Request>(offset);
10947 self.0.encode(encoder, offset + 0, depth)?;
10951 Ok(())
10952 }
10953 }
10954
10955 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
10956 for AudioRendererSetUsage2Request
10957 {
10958 #[inline(always)]
10959 fn new_empty() -> Self {
10960 Self { usage2: fidl::new_empty!(AudioRenderUsage2, D) }
10961 }
10962
10963 #[inline]
10964 unsafe fn decode(
10965 &mut self,
10966 decoder: &mut fidl::encoding::Decoder<'_, D>,
10967 offset: usize,
10968 _depth: fidl::encoding::Depth,
10969 ) -> fidl::Result<()> {
10970 decoder.debug_check_bounds::<Self>(offset);
10971 fidl::decode!(AudioRenderUsage2, D, &mut self.usage2, decoder, offset + 0, _depth)?;
10973 Ok(())
10974 }
10975 }
10976
10977 impl fidl::encoding::ValueTypeMarker for AudioRendererSetUsageRequest {
10978 type Borrowed<'a> = &'a Self;
10979 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10980 value
10981 }
10982 }
10983
10984 unsafe impl fidl::encoding::TypeMarker for AudioRendererSetUsageRequest {
10985 type Owned = Self;
10986
10987 #[inline(always)]
10988 fn inline_align(_context: fidl::encoding::Context) -> usize {
10989 4
10990 }
10991
10992 #[inline(always)]
10993 fn inline_size(_context: fidl::encoding::Context) -> usize {
10994 4
10995 }
10996 }
10997
10998 unsafe impl<D: fidl::encoding::ResourceDialect>
10999 fidl::encoding::Encode<AudioRendererSetUsageRequest, D> for &AudioRendererSetUsageRequest
11000 {
11001 #[inline]
11002 unsafe fn encode(
11003 self,
11004 encoder: &mut fidl::encoding::Encoder<'_, D>,
11005 offset: usize,
11006 _depth: fidl::encoding::Depth,
11007 ) -> fidl::Result<()> {
11008 encoder.debug_check_bounds::<AudioRendererSetUsageRequest>(offset);
11009 fidl::encoding::Encode::<AudioRendererSetUsageRequest, D>::encode(
11011 (<AudioRenderUsage as fidl::encoding::ValueTypeMarker>::borrow(&self.usage),),
11012 encoder,
11013 offset,
11014 _depth,
11015 )
11016 }
11017 }
11018 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<AudioRenderUsage, D>>
11019 fidl::encoding::Encode<AudioRendererSetUsageRequest, D> for (T0,)
11020 {
11021 #[inline]
11022 unsafe fn encode(
11023 self,
11024 encoder: &mut fidl::encoding::Encoder<'_, D>,
11025 offset: usize,
11026 depth: fidl::encoding::Depth,
11027 ) -> fidl::Result<()> {
11028 encoder.debug_check_bounds::<AudioRendererSetUsageRequest>(offset);
11029 self.0.encode(encoder, offset + 0, depth)?;
11033 Ok(())
11034 }
11035 }
11036
11037 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11038 for AudioRendererSetUsageRequest
11039 {
11040 #[inline(always)]
11041 fn new_empty() -> Self {
11042 Self { usage: fidl::new_empty!(AudioRenderUsage, D) }
11043 }
11044
11045 #[inline]
11046 unsafe fn decode(
11047 &mut self,
11048 decoder: &mut fidl::encoding::Decoder<'_, D>,
11049 offset: usize,
11050 _depth: fidl::encoding::Depth,
11051 ) -> fidl::Result<()> {
11052 decoder.debug_check_bounds::<Self>(offset);
11053 fidl::decode!(AudioRenderUsage, D, &mut self.usage, decoder, offset + 0, _depth)?;
11055 Ok(())
11056 }
11057 }
11058
11059 impl fidl::encoding::ValueTypeMarker for AudioStreamType {
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 AudioStreamType {
11067 type Owned = Self;
11068
11069 #[inline(always)]
11070 fn inline_align(_context: fidl::encoding::Context) -> usize {
11071 4
11072 }
11073
11074 #[inline(always)]
11075 fn inline_size(_context: fidl::encoding::Context) -> usize {
11076 12
11077 }
11078 }
11079
11080 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AudioStreamType, D>
11081 for &AudioStreamType
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::<AudioStreamType>(offset);
11091 fidl::encoding::Encode::<AudioStreamType, D>::encode(
11093 (
11094 <AudioSampleFormat as fidl::encoding::ValueTypeMarker>::borrow(
11095 &self.sample_format,
11096 ),
11097 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.channels),
11098 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.frames_per_second),
11099 ),
11100 encoder,
11101 offset,
11102 _depth,
11103 )
11104 }
11105 }
11106 unsafe impl<
11107 D: fidl::encoding::ResourceDialect,
11108 T0: fidl::encoding::Encode<AudioSampleFormat, D>,
11109 T1: fidl::encoding::Encode<u32, D>,
11110 T2: fidl::encoding::Encode<u32, D>,
11111 > fidl::encoding::Encode<AudioStreamType, D> for (T0, T1, T2)
11112 {
11113 #[inline]
11114 unsafe fn encode(
11115 self,
11116 encoder: &mut fidl::encoding::Encoder<'_, D>,
11117 offset: usize,
11118 depth: fidl::encoding::Depth,
11119 ) -> fidl::Result<()> {
11120 encoder.debug_check_bounds::<AudioStreamType>(offset);
11121 self.0.encode(encoder, offset + 0, depth)?;
11125 self.1.encode(encoder, offset + 4, depth)?;
11126 self.2.encode(encoder, offset + 8, depth)?;
11127 Ok(())
11128 }
11129 }
11130
11131 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AudioStreamType {
11132 #[inline(always)]
11133 fn new_empty() -> Self {
11134 Self {
11135 sample_format: fidl::new_empty!(AudioSampleFormat, D),
11136 channels: fidl::new_empty!(u32, D),
11137 frames_per_second: fidl::new_empty!(u32, D),
11138 }
11139 }
11140
11141 #[inline]
11142 unsafe fn decode(
11143 &mut self,
11144 decoder: &mut fidl::encoding::Decoder<'_, D>,
11145 offset: usize,
11146 _depth: fidl::encoding::Depth,
11147 ) -> fidl::Result<()> {
11148 decoder.debug_check_bounds::<Self>(offset);
11149 fidl::decode!(
11151 AudioSampleFormat,
11152 D,
11153 &mut self.sample_format,
11154 decoder,
11155 offset + 0,
11156 _depth
11157 )?;
11158 fidl::decode!(u32, D, &mut self.channels, decoder, offset + 4, _depth)?;
11159 fidl::decode!(u32, D, &mut self.frames_per_second, decoder, offset + 8, _depth)?;
11160 Ok(())
11161 }
11162 }
11163
11164 impl fidl::encoding::ValueTypeMarker for Compression {
11165 type Borrowed<'a> = &'a Self;
11166 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11167 value
11168 }
11169 }
11170
11171 unsafe impl fidl::encoding::TypeMarker for Compression {
11172 type Owned = Self;
11173
11174 #[inline(always)]
11175 fn inline_align(_context: fidl::encoding::Context) -> usize {
11176 8
11177 }
11178
11179 #[inline(always)]
11180 fn inline_size(_context: fidl::encoding::Context) -> usize {
11181 32
11182 }
11183 }
11184
11185 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Compression, D>
11186 for &Compression
11187 {
11188 #[inline]
11189 unsafe fn encode(
11190 self,
11191 encoder: &mut fidl::encoding::Encoder<'_, D>,
11192 offset: usize,
11193 _depth: fidl::encoding::Depth,
11194 ) -> fidl::Result<()> {
11195 encoder.debug_check_bounds::<Compression>(offset);
11196 fidl::encoding::Encode::<Compression, D>::encode(
11198 (
11199 <fidl::encoding::BoundedString<256> as fidl::encoding::ValueTypeMarker>::borrow(&self.type_),
11200 <fidl::encoding::Optional<fidl::encoding::Vector<u8, 8192>> as fidl::encoding::ValueTypeMarker>::borrow(&self.parameters),
11201 ),
11202 encoder, offset, _depth
11203 )
11204 }
11205 }
11206 unsafe impl<
11207 D: fidl::encoding::ResourceDialect,
11208 T0: fidl::encoding::Encode<fidl::encoding::BoundedString<256>, D>,
11209 T1: fidl::encoding::Encode<fidl::encoding::Optional<fidl::encoding::Vector<u8, 8192>>, D>,
11210 > fidl::encoding::Encode<Compression, D> for (T0, T1)
11211 {
11212 #[inline]
11213 unsafe fn encode(
11214 self,
11215 encoder: &mut fidl::encoding::Encoder<'_, D>,
11216 offset: usize,
11217 depth: fidl::encoding::Depth,
11218 ) -> fidl::Result<()> {
11219 encoder.debug_check_bounds::<Compression>(offset);
11220 self.0.encode(encoder, offset + 0, depth)?;
11224 self.1.encode(encoder, offset + 16, depth)?;
11225 Ok(())
11226 }
11227 }
11228
11229 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Compression {
11230 #[inline(always)]
11231 fn new_empty() -> Self {
11232 Self {
11233 type_: fidl::new_empty!(fidl::encoding::BoundedString<256>, D),
11234 parameters: fidl::new_empty!(
11235 fidl::encoding::Optional<fidl::encoding::Vector<u8, 8192>>,
11236 D
11237 ),
11238 }
11239 }
11240
11241 #[inline]
11242 unsafe fn decode(
11243 &mut self,
11244 decoder: &mut fidl::encoding::Decoder<'_, D>,
11245 offset: usize,
11246 _depth: fidl::encoding::Depth,
11247 ) -> fidl::Result<()> {
11248 decoder.debug_check_bounds::<Self>(offset);
11249 fidl::decode!(
11251 fidl::encoding::BoundedString<256>,
11252 D,
11253 &mut self.type_,
11254 decoder,
11255 offset + 0,
11256 _depth
11257 )?;
11258 fidl::decode!(
11259 fidl::encoding::Optional<fidl::encoding::Vector<u8, 8192>>,
11260 D,
11261 &mut self.parameters,
11262 decoder,
11263 offset + 16,
11264 _depth
11265 )?;
11266 Ok(())
11267 }
11268 }
11269
11270 impl fidl::encoding::ValueTypeMarker for EncryptionPattern {
11271 type Borrowed<'a> = &'a Self;
11272 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11273 value
11274 }
11275 }
11276
11277 unsafe impl fidl::encoding::TypeMarker for EncryptionPattern {
11278 type Owned = Self;
11279
11280 #[inline(always)]
11281 fn inline_align(_context: fidl::encoding::Context) -> usize {
11282 4
11283 }
11284
11285 #[inline(always)]
11286 fn inline_size(_context: fidl::encoding::Context) -> usize {
11287 8
11288 }
11289 #[inline(always)]
11290 fn encode_is_copy() -> bool {
11291 true
11292 }
11293
11294 #[inline(always)]
11295 fn decode_is_copy() -> bool {
11296 true
11297 }
11298 }
11299
11300 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<EncryptionPattern, D>
11301 for &EncryptionPattern
11302 {
11303 #[inline]
11304 unsafe fn encode(
11305 self,
11306 encoder: &mut fidl::encoding::Encoder<'_, D>,
11307 offset: usize,
11308 _depth: fidl::encoding::Depth,
11309 ) -> fidl::Result<()> {
11310 encoder.debug_check_bounds::<EncryptionPattern>(offset);
11311 unsafe {
11312 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
11314 (buf_ptr as *mut EncryptionPattern)
11315 .write_unaligned((self as *const EncryptionPattern).read());
11316 }
11319 Ok(())
11320 }
11321 }
11322 unsafe impl<
11323 D: fidl::encoding::ResourceDialect,
11324 T0: fidl::encoding::Encode<u32, D>,
11325 T1: fidl::encoding::Encode<u32, D>,
11326 > fidl::encoding::Encode<EncryptionPattern, D> for (T0, T1)
11327 {
11328 #[inline]
11329 unsafe fn encode(
11330 self,
11331 encoder: &mut fidl::encoding::Encoder<'_, D>,
11332 offset: usize,
11333 depth: fidl::encoding::Depth,
11334 ) -> fidl::Result<()> {
11335 encoder.debug_check_bounds::<EncryptionPattern>(offset);
11336 self.0.encode(encoder, offset + 0, depth)?;
11340 self.1.encode(encoder, offset + 4, depth)?;
11341 Ok(())
11342 }
11343 }
11344
11345 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for EncryptionPattern {
11346 #[inline(always)]
11347 fn new_empty() -> Self {
11348 Self {
11349 clear_blocks: fidl::new_empty!(u32, D),
11350 encrypted_blocks: fidl::new_empty!(u32, D),
11351 }
11352 }
11353
11354 #[inline]
11355 unsafe fn decode(
11356 &mut self,
11357 decoder: &mut fidl::encoding::Decoder<'_, D>,
11358 offset: usize,
11359 _depth: fidl::encoding::Depth,
11360 ) -> fidl::Result<()> {
11361 decoder.debug_check_bounds::<Self>(offset);
11362 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
11363 unsafe {
11366 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
11367 }
11368 Ok(())
11369 }
11370 }
11371
11372 impl fidl::encoding::ValueTypeMarker for Metadata {
11373 type Borrowed<'a> = &'a Self;
11374 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11375 value
11376 }
11377 }
11378
11379 unsafe impl fidl::encoding::TypeMarker for Metadata {
11380 type Owned = Self;
11381
11382 #[inline(always)]
11383 fn inline_align(_context: fidl::encoding::Context) -> usize {
11384 8
11385 }
11386
11387 #[inline(always)]
11388 fn inline_size(_context: fidl::encoding::Context) -> usize {
11389 16
11390 }
11391 }
11392
11393 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Metadata, D> for &Metadata {
11394 #[inline]
11395 unsafe fn encode(
11396 self,
11397 encoder: &mut fidl::encoding::Encoder<'_, D>,
11398 offset: usize,
11399 _depth: fidl::encoding::Depth,
11400 ) -> fidl::Result<()> {
11401 encoder.debug_check_bounds::<Metadata>(offset);
11402 fidl::encoding::Encode::<Metadata, D>::encode(
11404 (
11405 <fidl::encoding::UnboundedVector<Property> as fidl::encoding::ValueTypeMarker>::borrow(&self.properties),
11406 ),
11407 encoder, offset, _depth
11408 )
11409 }
11410 }
11411 unsafe impl<
11412 D: fidl::encoding::ResourceDialect,
11413 T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<Property>, D>,
11414 > fidl::encoding::Encode<Metadata, D> for (T0,)
11415 {
11416 #[inline]
11417 unsafe fn encode(
11418 self,
11419 encoder: &mut fidl::encoding::Encoder<'_, D>,
11420 offset: usize,
11421 depth: fidl::encoding::Depth,
11422 ) -> fidl::Result<()> {
11423 encoder.debug_check_bounds::<Metadata>(offset);
11424 self.0.encode(encoder, offset + 0, depth)?;
11428 Ok(())
11429 }
11430 }
11431
11432 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Metadata {
11433 #[inline(always)]
11434 fn new_empty() -> Self {
11435 Self { properties: fidl::new_empty!(fidl::encoding::UnboundedVector<Property>, D) }
11436 }
11437
11438 #[inline]
11439 unsafe fn decode(
11440 &mut self,
11441 decoder: &mut fidl::encoding::Decoder<'_, D>,
11442 offset: usize,
11443 _depth: fidl::encoding::Depth,
11444 ) -> fidl::Result<()> {
11445 decoder.debug_check_bounds::<Self>(offset);
11446 fidl::decode!(
11448 fidl::encoding::UnboundedVector<Property>,
11449 D,
11450 &mut self.properties,
11451 decoder,
11452 offset + 0,
11453 _depth
11454 )?;
11455 Ok(())
11456 }
11457 }
11458
11459 impl fidl::encoding::ValueTypeMarker for Parameter {
11460 type Borrowed<'a> = &'a Self;
11461 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11462 value
11463 }
11464 }
11465
11466 unsafe impl fidl::encoding::TypeMarker for Parameter {
11467 type Owned = Self;
11468
11469 #[inline(always)]
11470 fn inline_align(_context: fidl::encoding::Context) -> usize {
11471 8
11472 }
11473
11474 #[inline(always)]
11475 fn inline_size(_context: fidl::encoding::Context) -> usize {
11476 48
11477 }
11478 }
11479
11480 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Parameter, D>
11481 for &Parameter
11482 {
11483 #[inline]
11484 unsafe fn encode(
11485 self,
11486 encoder: &mut fidl::encoding::Encoder<'_, D>,
11487 offset: usize,
11488 _depth: fidl::encoding::Depth,
11489 ) -> fidl::Result<()> {
11490 encoder.debug_check_bounds::<Parameter>(offset);
11491 fidl::encoding::Encode::<Parameter, D>::encode(
11493 (
11494 <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
11495 &self.scope,
11496 ),
11497 <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
11498 &self.name,
11499 ),
11500 <Value as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
11501 ),
11502 encoder,
11503 offset,
11504 _depth,
11505 )
11506 }
11507 }
11508 unsafe impl<
11509 D: fidl::encoding::ResourceDialect,
11510 T0: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
11511 T1: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
11512 T2: fidl::encoding::Encode<Value, D>,
11513 > fidl::encoding::Encode<Parameter, D> for (T0, T1, T2)
11514 {
11515 #[inline]
11516 unsafe fn encode(
11517 self,
11518 encoder: &mut fidl::encoding::Encoder<'_, D>,
11519 offset: usize,
11520 depth: fidl::encoding::Depth,
11521 ) -> fidl::Result<()> {
11522 encoder.debug_check_bounds::<Parameter>(offset);
11523 self.0.encode(encoder, offset + 0, depth)?;
11527 self.1.encode(encoder, offset + 16, depth)?;
11528 self.2.encode(encoder, offset + 32, depth)?;
11529 Ok(())
11530 }
11531 }
11532
11533 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Parameter {
11534 #[inline(always)]
11535 fn new_empty() -> Self {
11536 Self {
11537 scope: fidl::new_empty!(fidl::encoding::UnboundedString, D),
11538 name: fidl::new_empty!(fidl::encoding::UnboundedString, D),
11539 value: fidl::new_empty!(Value, D),
11540 }
11541 }
11542
11543 #[inline]
11544 unsafe fn decode(
11545 &mut self,
11546 decoder: &mut fidl::encoding::Decoder<'_, D>,
11547 offset: usize,
11548 _depth: fidl::encoding::Depth,
11549 ) -> fidl::Result<()> {
11550 decoder.debug_check_bounds::<Self>(offset);
11551 fidl::decode!(
11553 fidl::encoding::UnboundedString,
11554 D,
11555 &mut self.scope,
11556 decoder,
11557 offset + 0,
11558 _depth
11559 )?;
11560 fidl::decode!(
11561 fidl::encoding::UnboundedString,
11562 D,
11563 &mut self.name,
11564 decoder,
11565 offset + 16,
11566 _depth
11567 )?;
11568 fidl::decode!(Value, D, &mut self.value, decoder, offset + 32, _depth)?;
11569 Ok(())
11570 }
11571 }
11572
11573 impl fidl::encoding::ValueTypeMarker for PcmFormat {
11574 type Borrowed<'a> = &'a Self;
11575 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11576 value
11577 }
11578 }
11579
11580 unsafe impl fidl::encoding::TypeMarker for PcmFormat {
11581 type Owned = Self;
11582
11583 #[inline(always)]
11584 fn inline_align(_context: fidl::encoding::Context) -> usize {
11585 8
11586 }
11587
11588 #[inline(always)]
11589 fn inline_size(_context: fidl::encoding::Context) -> usize {
11590 32
11591 }
11592 }
11593
11594 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<PcmFormat, D>
11595 for &PcmFormat
11596 {
11597 #[inline]
11598 unsafe fn encode(
11599 self,
11600 encoder: &mut fidl::encoding::Encoder<'_, D>,
11601 offset: usize,
11602 _depth: fidl::encoding::Depth,
11603 ) -> fidl::Result<()> {
11604 encoder.debug_check_bounds::<PcmFormat>(offset);
11605 fidl::encoding::Encode::<PcmFormat, D>::encode(
11607 (
11608 <AudioPcmMode as fidl::encoding::ValueTypeMarker>::borrow(&self.pcm_mode),
11609 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.bits_per_sample),
11610 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.frames_per_second),
11611 <fidl::encoding::Vector<AudioChannelId, 16> as fidl::encoding::ValueTypeMarker>::borrow(&self.channel_map),
11612 ),
11613 encoder, offset, _depth
11614 )
11615 }
11616 }
11617 unsafe impl<
11618 D: fidl::encoding::ResourceDialect,
11619 T0: fidl::encoding::Encode<AudioPcmMode, D>,
11620 T1: fidl::encoding::Encode<u32, D>,
11621 T2: fidl::encoding::Encode<u32, D>,
11622 T3: fidl::encoding::Encode<fidl::encoding::Vector<AudioChannelId, 16>, D>,
11623 > fidl::encoding::Encode<PcmFormat, D> for (T0, T1, T2, T3)
11624 {
11625 #[inline]
11626 unsafe fn encode(
11627 self,
11628 encoder: &mut fidl::encoding::Encoder<'_, D>,
11629 offset: usize,
11630 depth: fidl::encoding::Depth,
11631 ) -> fidl::Result<()> {
11632 encoder.debug_check_bounds::<PcmFormat>(offset);
11633 unsafe {
11636 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
11637 (ptr as *mut u64).write_unaligned(0);
11638 }
11639 self.0.encode(encoder, offset + 0, depth)?;
11641 self.1.encode(encoder, offset + 4, depth)?;
11642 self.2.encode(encoder, offset + 8, depth)?;
11643 self.3.encode(encoder, offset + 16, depth)?;
11644 Ok(())
11645 }
11646 }
11647
11648 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for PcmFormat {
11649 #[inline(always)]
11650 fn new_empty() -> Self {
11651 Self {
11652 pcm_mode: fidl::new_empty!(AudioPcmMode, D),
11653 bits_per_sample: fidl::new_empty!(u32, D),
11654 frames_per_second: fidl::new_empty!(u32, D),
11655 channel_map: fidl::new_empty!(fidl::encoding::Vector<AudioChannelId, 16>, D),
11656 }
11657 }
11658
11659 #[inline]
11660 unsafe fn decode(
11661 &mut self,
11662 decoder: &mut fidl::encoding::Decoder<'_, D>,
11663 offset: usize,
11664 _depth: fidl::encoding::Depth,
11665 ) -> fidl::Result<()> {
11666 decoder.debug_check_bounds::<Self>(offset);
11667 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
11669 let padval = unsafe { (ptr as *const u64).read_unaligned() };
11670 let mask = 0xffffffff00000000u64;
11671 let maskedval = padval & mask;
11672 if maskedval != 0 {
11673 return Err(fidl::Error::NonZeroPadding {
11674 padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
11675 });
11676 }
11677 fidl::decode!(AudioPcmMode, D, &mut self.pcm_mode, decoder, offset + 0, _depth)?;
11678 fidl::decode!(u32, D, &mut self.bits_per_sample, decoder, offset + 4, _depth)?;
11679 fidl::decode!(u32, D, &mut self.frames_per_second, decoder, offset + 8, _depth)?;
11680 fidl::decode!(fidl::encoding::Vector<AudioChannelId, 16>, D, &mut self.channel_map, decoder, offset + 16, _depth)?;
11681 Ok(())
11682 }
11683 }
11684
11685 impl fidl::encoding::ValueTypeMarker for ProfileProviderRegisterHandlerWithCapacityResponse {
11686 type Borrowed<'a> = &'a Self;
11687 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11688 value
11689 }
11690 }
11691
11692 unsafe impl fidl::encoding::TypeMarker for ProfileProviderRegisterHandlerWithCapacityResponse {
11693 type Owned = Self;
11694
11695 #[inline(always)]
11696 fn inline_align(_context: fidl::encoding::Context) -> usize {
11697 8
11698 }
11699
11700 #[inline(always)]
11701 fn inline_size(_context: fidl::encoding::Context) -> usize {
11702 16
11703 }
11704 #[inline(always)]
11705 fn encode_is_copy() -> bool {
11706 true
11707 }
11708
11709 #[inline(always)]
11710 fn decode_is_copy() -> bool {
11711 true
11712 }
11713 }
11714
11715 unsafe impl<D: fidl::encoding::ResourceDialect>
11716 fidl::encoding::Encode<ProfileProviderRegisterHandlerWithCapacityResponse, D>
11717 for &ProfileProviderRegisterHandlerWithCapacityResponse
11718 {
11719 #[inline]
11720 unsafe fn encode(
11721 self,
11722 encoder: &mut fidl::encoding::Encoder<'_, D>,
11723 offset: usize,
11724 _depth: fidl::encoding::Depth,
11725 ) -> fidl::Result<()> {
11726 encoder
11727 .debug_check_bounds::<ProfileProviderRegisterHandlerWithCapacityResponse>(offset);
11728 unsafe {
11729 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
11731 (buf_ptr as *mut ProfileProviderRegisterHandlerWithCapacityResponse)
11732 .write_unaligned(
11733 (self as *const ProfileProviderRegisterHandlerWithCapacityResponse).read(),
11734 );
11735 }
11738 Ok(())
11739 }
11740 }
11741 unsafe impl<
11742 D: fidl::encoding::ResourceDialect,
11743 T0: fidl::encoding::Encode<i64, D>,
11744 T1: fidl::encoding::Encode<i64, D>,
11745 > fidl::encoding::Encode<ProfileProviderRegisterHandlerWithCapacityResponse, D> for (T0, T1)
11746 {
11747 #[inline]
11748 unsafe fn encode(
11749 self,
11750 encoder: &mut fidl::encoding::Encoder<'_, D>,
11751 offset: usize,
11752 depth: fidl::encoding::Depth,
11753 ) -> fidl::Result<()> {
11754 encoder
11755 .debug_check_bounds::<ProfileProviderRegisterHandlerWithCapacityResponse>(offset);
11756 self.0.encode(encoder, offset + 0, depth)?;
11760 self.1.encode(encoder, offset + 8, depth)?;
11761 Ok(())
11762 }
11763 }
11764
11765 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11766 for ProfileProviderRegisterHandlerWithCapacityResponse
11767 {
11768 #[inline(always)]
11769 fn new_empty() -> Self {
11770 Self { period: fidl::new_empty!(i64, D), capacity: fidl::new_empty!(i64, D) }
11771 }
11772
11773 #[inline]
11774 unsafe fn decode(
11775 &mut self,
11776 decoder: &mut fidl::encoding::Decoder<'_, D>,
11777 offset: usize,
11778 _depth: fidl::encoding::Depth,
11779 ) -> fidl::Result<()> {
11780 decoder.debug_check_bounds::<Self>(offset);
11781 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
11782 unsafe {
11785 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
11786 }
11787 Ok(())
11788 }
11789 }
11790
11791 impl fidl::encoding::ValueTypeMarker for Property {
11792 type Borrowed<'a> = &'a Self;
11793 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11794 value
11795 }
11796 }
11797
11798 unsafe impl fidl::encoding::TypeMarker for Property {
11799 type Owned = Self;
11800
11801 #[inline(always)]
11802 fn inline_align(_context: fidl::encoding::Context) -> usize {
11803 8
11804 }
11805
11806 #[inline(always)]
11807 fn inline_size(_context: fidl::encoding::Context) -> usize {
11808 32
11809 }
11810 }
11811
11812 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Property, D> for &Property {
11813 #[inline]
11814 unsafe fn encode(
11815 self,
11816 encoder: &mut fidl::encoding::Encoder<'_, D>,
11817 offset: usize,
11818 _depth: fidl::encoding::Depth,
11819 ) -> fidl::Result<()> {
11820 encoder.debug_check_bounds::<Property>(offset);
11821 fidl::encoding::Encode::<Property, D>::encode(
11823 (
11824 <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
11825 &self.label,
11826 ),
11827 <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
11828 &self.value,
11829 ),
11830 ),
11831 encoder,
11832 offset,
11833 _depth,
11834 )
11835 }
11836 }
11837 unsafe impl<
11838 D: fidl::encoding::ResourceDialect,
11839 T0: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
11840 T1: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
11841 > fidl::encoding::Encode<Property, D> for (T0, T1)
11842 {
11843 #[inline]
11844 unsafe fn encode(
11845 self,
11846 encoder: &mut fidl::encoding::Encoder<'_, D>,
11847 offset: usize,
11848 depth: fidl::encoding::Depth,
11849 ) -> fidl::Result<()> {
11850 encoder.debug_check_bounds::<Property>(offset);
11851 self.0.encode(encoder, offset + 0, depth)?;
11855 self.1.encode(encoder, offset + 16, depth)?;
11856 Ok(())
11857 }
11858 }
11859
11860 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Property {
11861 #[inline(always)]
11862 fn new_empty() -> Self {
11863 Self {
11864 label: fidl::new_empty!(fidl::encoding::UnboundedString, D),
11865 value: fidl::new_empty!(fidl::encoding::UnboundedString, D),
11866 }
11867 }
11868
11869 #[inline]
11870 unsafe fn decode(
11871 &mut self,
11872 decoder: &mut fidl::encoding::Decoder<'_, D>,
11873 offset: usize,
11874 _depth: fidl::encoding::Depth,
11875 ) -> fidl::Result<()> {
11876 decoder.debug_check_bounds::<Self>(offset);
11877 fidl::decode!(
11879 fidl::encoding::UnboundedString,
11880 D,
11881 &mut self.label,
11882 decoder,
11883 offset + 0,
11884 _depth
11885 )?;
11886 fidl::decode!(
11887 fidl::encoding::UnboundedString,
11888 D,
11889 &mut self.value,
11890 decoder,
11891 offset + 16,
11892 _depth
11893 )?;
11894 Ok(())
11895 }
11896 }
11897
11898 impl fidl::encoding::ValueTypeMarker for SbcEncoderSettings {
11899 type Borrowed<'a> = &'a Self;
11900 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11901 value
11902 }
11903 }
11904
11905 unsafe impl fidl::encoding::TypeMarker for SbcEncoderSettings {
11906 type Owned = Self;
11907
11908 #[inline(always)]
11909 fn inline_align(_context: fidl::encoding::Context) -> usize {
11910 8
11911 }
11912
11913 #[inline(always)]
11914 fn inline_size(_context: fidl::encoding::Context) -> usize {
11915 24
11916 }
11917 }
11918
11919 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SbcEncoderSettings, D>
11920 for &SbcEncoderSettings
11921 {
11922 #[inline]
11923 unsafe fn encode(
11924 self,
11925 encoder: &mut fidl::encoding::Encoder<'_, D>,
11926 offset: usize,
11927 _depth: fidl::encoding::Depth,
11928 ) -> fidl::Result<()> {
11929 encoder.debug_check_bounds::<SbcEncoderSettings>(offset);
11930 fidl::encoding::Encode::<SbcEncoderSettings, D>::encode(
11932 (
11933 <SbcSubBands as fidl::encoding::ValueTypeMarker>::borrow(&self.sub_bands),
11934 <SbcAllocation as fidl::encoding::ValueTypeMarker>::borrow(&self.allocation),
11935 <SbcBlockCount as fidl::encoding::ValueTypeMarker>::borrow(&self.block_count),
11936 <SbcChannelMode as fidl::encoding::ValueTypeMarker>::borrow(&self.channel_mode),
11937 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.bit_pool),
11938 ),
11939 encoder,
11940 offset,
11941 _depth,
11942 )
11943 }
11944 }
11945 unsafe impl<
11946 D: fidl::encoding::ResourceDialect,
11947 T0: fidl::encoding::Encode<SbcSubBands, D>,
11948 T1: fidl::encoding::Encode<SbcAllocation, D>,
11949 T2: fidl::encoding::Encode<SbcBlockCount, D>,
11950 T3: fidl::encoding::Encode<SbcChannelMode, D>,
11951 T4: fidl::encoding::Encode<u64, D>,
11952 > fidl::encoding::Encode<SbcEncoderSettings, D> for (T0, T1, T2, T3, T4)
11953 {
11954 #[inline]
11955 unsafe fn encode(
11956 self,
11957 encoder: &mut fidl::encoding::Encoder<'_, D>,
11958 offset: usize,
11959 depth: fidl::encoding::Depth,
11960 ) -> fidl::Result<()> {
11961 encoder.debug_check_bounds::<SbcEncoderSettings>(offset);
11962 self.0.encode(encoder, offset + 0, depth)?;
11966 self.1.encode(encoder, offset + 4, depth)?;
11967 self.2.encode(encoder, offset + 8, depth)?;
11968 self.3.encode(encoder, offset + 12, depth)?;
11969 self.4.encode(encoder, offset + 16, depth)?;
11970 Ok(())
11971 }
11972 }
11973
11974 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SbcEncoderSettings {
11975 #[inline(always)]
11976 fn new_empty() -> Self {
11977 Self {
11978 sub_bands: fidl::new_empty!(SbcSubBands, D),
11979 allocation: fidl::new_empty!(SbcAllocation, D),
11980 block_count: fidl::new_empty!(SbcBlockCount, D),
11981 channel_mode: fidl::new_empty!(SbcChannelMode, D),
11982 bit_pool: fidl::new_empty!(u64, D),
11983 }
11984 }
11985
11986 #[inline]
11987 unsafe fn decode(
11988 &mut self,
11989 decoder: &mut fidl::encoding::Decoder<'_, D>,
11990 offset: usize,
11991 _depth: fidl::encoding::Depth,
11992 ) -> fidl::Result<()> {
11993 decoder.debug_check_bounds::<Self>(offset);
11994 fidl::decode!(SbcSubBands, D, &mut self.sub_bands, decoder, offset + 0, _depth)?;
11996 fidl::decode!(SbcAllocation, D, &mut self.allocation, decoder, offset + 4, _depth)?;
11997 fidl::decode!(SbcBlockCount, D, &mut self.block_count, decoder, offset + 8, _depth)?;
11998 fidl::decode!(SbcChannelMode, D, &mut self.channel_mode, decoder, offset + 12, _depth)?;
11999 fidl::decode!(u64, D, &mut self.bit_pool, decoder, offset + 16, _depth)?;
12000 Ok(())
12001 }
12002 }
12003
12004 impl fidl::encoding::ValueTypeMarker for StreamBufferSetRemovePayloadBufferRequest {
12005 type Borrowed<'a> = &'a Self;
12006 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12007 value
12008 }
12009 }
12010
12011 unsafe impl fidl::encoding::TypeMarker for StreamBufferSetRemovePayloadBufferRequest {
12012 type Owned = Self;
12013
12014 #[inline(always)]
12015 fn inline_align(_context: fidl::encoding::Context) -> usize {
12016 4
12017 }
12018
12019 #[inline(always)]
12020 fn inline_size(_context: fidl::encoding::Context) -> usize {
12021 4
12022 }
12023 #[inline(always)]
12024 fn encode_is_copy() -> bool {
12025 true
12026 }
12027
12028 #[inline(always)]
12029 fn decode_is_copy() -> bool {
12030 true
12031 }
12032 }
12033
12034 unsafe impl<D: fidl::encoding::ResourceDialect>
12035 fidl::encoding::Encode<StreamBufferSetRemovePayloadBufferRequest, D>
12036 for &StreamBufferSetRemovePayloadBufferRequest
12037 {
12038 #[inline]
12039 unsafe fn encode(
12040 self,
12041 encoder: &mut fidl::encoding::Encoder<'_, D>,
12042 offset: usize,
12043 _depth: fidl::encoding::Depth,
12044 ) -> fidl::Result<()> {
12045 encoder.debug_check_bounds::<StreamBufferSetRemovePayloadBufferRequest>(offset);
12046 unsafe {
12047 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
12049 (buf_ptr as *mut StreamBufferSetRemovePayloadBufferRequest).write_unaligned(
12050 (self as *const StreamBufferSetRemovePayloadBufferRequest).read(),
12051 );
12052 }
12055 Ok(())
12056 }
12057 }
12058 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
12059 fidl::encoding::Encode<StreamBufferSetRemovePayloadBufferRequest, D> for (T0,)
12060 {
12061 #[inline]
12062 unsafe fn encode(
12063 self,
12064 encoder: &mut fidl::encoding::Encoder<'_, D>,
12065 offset: usize,
12066 depth: fidl::encoding::Depth,
12067 ) -> fidl::Result<()> {
12068 encoder.debug_check_bounds::<StreamBufferSetRemovePayloadBufferRequest>(offset);
12069 self.0.encode(encoder, offset + 0, depth)?;
12073 Ok(())
12074 }
12075 }
12076
12077 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12078 for StreamBufferSetRemovePayloadBufferRequest
12079 {
12080 #[inline(always)]
12081 fn new_empty() -> Self {
12082 Self { id: fidl::new_empty!(u32, D) }
12083 }
12084
12085 #[inline]
12086 unsafe fn decode(
12087 &mut self,
12088 decoder: &mut fidl::encoding::Decoder<'_, D>,
12089 offset: usize,
12090 _depth: fidl::encoding::Depth,
12091 ) -> fidl::Result<()> {
12092 decoder.debug_check_bounds::<Self>(offset);
12093 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
12094 unsafe {
12097 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
12098 }
12099 Ok(())
12100 }
12101 }
12102
12103 impl fidl::encoding::ValueTypeMarker for StreamPacket {
12104 type Borrowed<'a> = &'a Self;
12105 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12106 value
12107 }
12108 }
12109
12110 unsafe impl fidl::encoding::TypeMarker for StreamPacket {
12111 type Owned = Self;
12112
12113 #[inline(always)]
12114 fn inline_align(_context: fidl::encoding::Context) -> usize {
12115 8
12116 }
12117
12118 #[inline(always)]
12119 fn inline_size(_context: fidl::encoding::Context) -> usize {
12120 56
12121 }
12122 }
12123
12124 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<StreamPacket, D>
12125 for &StreamPacket
12126 {
12127 #[inline]
12128 unsafe fn encode(
12129 self,
12130 encoder: &mut fidl::encoding::Encoder<'_, D>,
12131 offset: usize,
12132 _depth: fidl::encoding::Depth,
12133 ) -> fidl::Result<()> {
12134 encoder.debug_check_bounds::<StreamPacket>(offset);
12135 unsafe {
12136 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
12138 (buf_ptr as *mut StreamPacket)
12139 .write_unaligned((self as *const StreamPacket).read());
12140 let padding_ptr = buf_ptr.offset(8) as *mut u64;
12143 let padding_mask = 0xffffffff00000000u64;
12144 padding_ptr.write_unaligned(padding_ptr.read_unaligned() & !padding_mask);
12145 let padding_ptr = buf_ptr.offset(32) as *mut u64;
12146 let padding_mask = 0xffffffff00000000u64;
12147 padding_ptr.write_unaligned(padding_ptr.read_unaligned() & !padding_mask);
12148 }
12149 Ok(())
12150 }
12151 }
12152 unsafe impl<
12153 D: fidl::encoding::ResourceDialect,
12154 T0: fidl::encoding::Encode<i64, D>,
12155 T1: fidl::encoding::Encode<u32, D>,
12156 T2: fidl::encoding::Encode<u64, D>,
12157 T3: fidl::encoding::Encode<u64, D>,
12158 T4: fidl::encoding::Encode<u32, D>,
12159 T5: fidl::encoding::Encode<u64, D>,
12160 T6: fidl::encoding::Encode<u64, D>,
12161 > fidl::encoding::Encode<StreamPacket, D> for (T0, T1, T2, T3, T4, T5, T6)
12162 {
12163 #[inline]
12164 unsafe fn encode(
12165 self,
12166 encoder: &mut fidl::encoding::Encoder<'_, D>,
12167 offset: usize,
12168 depth: fidl::encoding::Depth,
12169 ) -> fidl::Result<()> {
12170 encoder.debug_check_bounds::<StreamPacket>(offset);
12171 unsafe {
12174 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
12175 (ptr as *mut u64).write_unaligned(0);
12176 }
12177 unsafe {
12178 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
12179 (ptr as *mut u64).write_unaligned(0);
12180 }
12181 self.0.encode(encoder, offset + 0, depth)?;
12183 self.1.encode(encoder, offset + 8, depth)?;
12184 self.2.encode(encoder, offset + 16, depth)?;
12185 self.3.encode(encoder, offset + 24, depth)?;
12186 self.4.encode(encoder, offset + 32, depth)?;
12187 self.5.encode(encoder, offset + 40, depth)?;
12188 self.6.encode(encoder, offset + 48, depth)?;
12189 Ok(())
12190 }
12191 }
12192
12193 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for StreamPacket {
12194 #[inline(always)]
12195 fn new_empty() -> Self {
12196 Self {
12197 pts: fidl::new_empty!(i64, D),
12198 payload_buffer_id: fidl::new_empty!(u32, D),
12199 payload_offset: fidl::new_empty!(u64, D),
12200 payload_size: fidl::new_empty!(u64, D),
12201 flags: fidl::new_empty!(u32, D),
12202 buffer_config: fidl::new_empty!(u64, D),
12203 stream_segment_id: fidl::new_empty!(u64, D),
12204 }
12205 }
12206
12207 #[inline]
12208 unsafe fn decode(
12209 &mut self,
12210 decoder: &mut fidl::encoding::Decoder<'_, D>,
12211 offset: usize,
12212 _depth: fidl::encoding::Depth,
12213 ) -> fidl::Result<()> {
12214 decoder.debug_check_bounds::<Self>(offset);
12215 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
12216 let ptr = unsafe { buf_ptr.offset(8) };
12218 let padval = unsafe { (ptr as *const u64).read_unaligned() };
12219 let mask = 0xffffffff00000000u64;
12220 let maskedval = padval & mask;
12221 if maskedval != 0 {
12222 return Err(fidl::Error::NonZeroPadding {
12223 padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
12224 });
12225 }
12226 let ptr = unsafe { buf_ptr.offset(32) };
12227 let padval = unsafe { (ptr as *const u64).read_unaligned() };
12228 let mask = 0xffffffff00000000u64;
12229 let maskedval = padval & mask;
12230 if maskedval != 0 {
12231 return Err(fidl::Error::NonZeroPadding {
12232 padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
12233 });
12234 }
12235 unsafe {
12237 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 56);
12238 }
12239 Ok(())
12240 }
12241 }
12242
12243 impl fidl::encoding::ValueTypeMarker for StreamProcessorCloseCurrentStreamRequest {
12244 type Borrowed<'a> = &'a Self;
12245 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12246 value
12247 }
12248 }
12249
12250 unsafe impl fidl::encoding::TypeMarker for StreamProcessorCloseCurrentStreamRequest {
12251 type Owned = Self;
12252
12253 #[inline(always)]
12254 fn inline_align(_context: fidl::encoding::Context) -> usize {
12255 8
12256 }
12257
12258 #[inline(always)]
12259 fn inline_size(_context: fidl::encoding::Context) -> usize {
12260 16
12261 }
12262 }
12263
12264 unsafe impl<D: fidl::encoding::ResourceDialect>
12265 fidl::encoding::Encode<StreamProcessorCloseCurrentStreamRequest, D>
12266 for &StreamProcessorCloseCurrentStreamRequest
12267 {
12268 #[inline]
12269 unsafe fn encode(
12270 self,
12271 encoder: &mut fidl::encoding::Encoder<'_, D>,
12272 offset: usize,
12273 _depth: fidl::encoding::Depth,
12274 ) -> fidl::Result<()> {
12275 encoder.debug_check_bounds::<StreamProcessorCloseCurrentStreamRequest>(offset);
12276 fidl::encoding::Encode::<StreamProcessorCloseCurrentStreamRequest, D>::encode(
12278 (
12279 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.stream_lifetime_ordinal),
12280 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.release_input_buffers),
12281 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.release_output_buffers),
12282 ),
12283 encoder,
12284 offset,
12285 _depth,
12286 )
12287 }
12288 }
12289 unsafe impl<
12290 D: fidl::encoding::ResourceDialect,
12291 T0: fidl::encoding::Encode<u64, D>,
12292 T1: fidl::encoding::Encode<bool, D>,
12293 T2: fidl::encoding::Encode<bool, D>,
12294 > fidl::encoding::Encode<StreamProcessorCloseCurrentStreamRequest, D> for (T0, T1, T2)
12295 {
12296 #[inline]
12297 unsafe fn encode(
12298 self,
12299 encoder: &mut fidl::encoding::Encoder<'_, D>,
12300 offset: usize,
12301 depth: fidl::encoding::Depth,
12302 ) -> fidl::Result<()> {
12303 encoder.debug_check_bounds::<StreamProcessorCloseCurrentStreamRequest>(offset);
12304 unsafe {
12307 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
12308 (ptr as *mut u64).write_unaligned(0);
12309 }
12310 self.0.encode(encoder, offset + 0, depth)?;
12312 self.1.encode(encoder, offset + 8, depth)?;
12313 self.2.encode(encoder, offset + 9, depth)?;
12314 Ok(())
12315 }
12316 }
12317
12318 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12319 for StreamProcessorCloseCurrentStreamRequest
12320 {
12321 #[inline(always)]
12322 fn new_empty() -> Self {
12323 Self {
12324 stream_lifetime_ordinal: fidl::new_empty!(u64, D),
12325 release_input_buffers: fidl::new_empty!(bool, D),
12326 release_output_buffers: fidl::new_empty!(bool, D),
12327 }
12328 }
12329
12330 #[inline]
12331 unsafe fn decode(
12332 &mut self,
12333 decoder: &mut fidl::encoding::Decoder<'_, D>,
12334 offset: usize,
12335 _depth: fidl::encoding::Depth,
12336 ) -> fidl::Result<()> {
12337 decoder.debug_check_bounds::<Self>(offset);
12338 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
12340 let padval = unsafe { (ptr as *const u64).read_unaligned() };
12341 let mask = 0xffffffffffff0000u64;
12342 let maskedval = padval & mask;
12343 if maskedval != 0 {
12344 return Err(fidl::Error::NonZeroPadding {
12345 padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
12346 });
12347 }
12348 fidl::decode!(u64, D, &mut self.stream_lifetime_ordinal, decoder, offset + 0, _depth)?;
12349 fidl::decode!(bool, D, &mut self.release_input_buffers, decoder, offset + 8, _depth)?;
12350 fidl::decode!(bool, D, &mut self.release_output_buffers, decoder, offset + 9, _depth)?;
12351 Ok(())
12352 }
12353 }
12354
12355 impl fidl::encoding::ValueTypeMarker for StreamProcessorCompleteOutputBufferPartialSettingsRequest {
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
12363 for StreamProcessorCompleteOutputBufferPartialSettingsRequest
12364 {
12365 type Owned = Self;
12366
12367 #[inline(always)]
12368 fn inline_align(_context: fidl::encoding::Context) -> usize {
12369 8
12370 }
12371
12372 #[inline(always)]
12373 fn inline_size(_context: fidl::encoding::Context) -> usize {
12374 8
12375 }
12376 #[inline(always)]
12377 fn encode_is_copy() -> bool {
12378 true
12379 }
12380
12381 #[inline(always)]
12382 fn decode_is_copy() -> bool {
12383 true
12384 }
12385 }
12386
12387 unsafe impl<D: fidl::encoding::ResourceDialect>
12388 fidl::encoding::Encode<StreamProcessorCompleteOutputBufferPartialSettingsRequest, D>
12389 for &StreamProcessorCompleteOutputBufferPartialSettingsRequest
12390 {
12391 #[inline]
12392 unsafe fn encode(
12393 self,
12394 encoder: &mut fidl::encoding::Encoder<'_, D>,
12395 offset: usize,
12396 _depth: fidl::encoding::Depth,
12397 ) -> fidl::Result<()> {
12398 encoder
12399 .debug_check_bounds::<StreamProcessorCompleteOutputBufferPartialSettingsRequest>(
12400 offset,
12401 );
12402 unsafe {
12403 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
12405 (buf_ptr as *mut StreamProcessorCompleteOutputBufferPartialSettingsRequest)
12406 .write_unaligned(
12407 (self as *const StreamProcessorCompleteOutputBufferPartialSettingsRequest)
12408 .read(),
12409 );
12410 }
12413 Ok(())
12414 }
12415 }
12416 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
12417 fidl::encoding::Encode<StreamProcessorCompleteOutputBufferPartialSettingsRequest, D>
12418 for (T0,)
12419 {
12420 #[inline]
12421 unsafe fn encode(
12422 self,
12423 encoder: &mut fidl::encoding::Encoder<'_, D>,
12424 offset: usize,
12425 depth: fidl::encoding::Depth,
12426 ) -> fidl::Result<()> {
12427 encoder
12428 .debug_check_bounds::<StreamProcessorCompleteOutputBufferPartialSettingsRequest>(
12429 offset,
12430 );
12431 self.0.encode(encoder, offset + 0, depth)?;
12435 Ok(())
12436 }
12437 }
12438
12439 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12440 for StreamProcessorCompleteOutputBufferPartialSettingsRequest
12441 {
12442 #[inline(always)]
12443 fn new_empty() -> Self {
12444 Self { buffer_lifetime_ordinal: fidl::new_empty!(u64, D) }
12445 }
12446
12447 #[inline]
12448 unsafe fn decode(
12449 &mut self,
12450 decoder: &mut fidl::encoding::Decoder<'_, D>,
12451 offset: usize,
12452 _depth: fidl::encoding::Depth,
12453 ) -> fidl::Result<()> {
12454 decoder.debug_check_bounds::<Self>(offset);
12455 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
12456 unsafe {
12459 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
12460 }
12461 Ok(())
12462 }
12463 }
12464
12465 impl fidl::encoding::ValueTypeMarker for StreamProcessorFlushEndOfStreamAndCloseStreamRequest {
12466 type Borrowed<'a> = &'a Self;
12467 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12468 value
12469 }
12470 }
12471
12472 unsafe impl fidl::encoding::TypeMarker for StreamProcessorFlushEndOfStreamAndCloseStreamRequest {
12473 type Owned = Self;
12474
12475 #[inline(always)]
12476 fn inline_align(_context: fidl::encoding::Context) -> usize {
12477 8
12478 }
12479
12480 #[inline(always)]
12481 fn inline_size(_context: fidl::encoding::Context) -> usize {
12482 8
12483 }
12484 #[inline(always)]
12485 fn encode_is_copy() -> bool {
12486 true
12487 }
12488
12489 #[inline(always)]
12490 fn decode_is_copy() -> bool {
12491 true
12492 }
12493 }
12494
12495 unsafe impl<D: fidl::encoding::ResourceDialect>
12496 fidl::encoding::Encode<StreamProcessorFlushEndOfStreamAndCloseStreamRequest, D>
12497 for &StreamProcessorFlushEndOfStreamAndCloseStreamRequest
12498 {
12499 #[inline]
12500 unsafe fn encode(
12501 self,
12502 encoder: &mut fidl::encoding::Encoder<'_, D>,
12503 offset: usize,
12504 _depth: fidl::encoding::Depth,
12505 ) -> fidl::Result<()> {
12506 encoder
12507 .debug_check_bounds::<StreamProcessorFlushEndOfStreamAndCloseStreamRequest>(offset);
12508 unsafe {
12509 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
12511 (buf_ptr as *mut StreamProcessorFlushEndOfStreamAndCloseStreamRequest)
12512 .write_unaligned(
12513 (self as *const StreamProcessorFlushEndOfStreamAndCloseStreamRequest)
12514 .read(),
12515 );
12516 }
12519 Ok(())
12520 }
12521 }
12522 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
12523 fidl::encoding::Encode<StreamProcessorFlushEndOfStreamAndCloseStreamRequest, D> for (T0,)
12524 {
12525 #[inline]
12526 unsafe fn encode(
12527 self,
12528 encoder: &mut fidl::encoding::Encoder<'_, D>,
12529 offset: usize,
12530 depth: fidl::encoding::Depth,
12531 ) -> fidl::Result<()> {
12532 encoder
12533 .debug_check_bounds::<StreamProcessorFlushEndOfStreamAndCloseStreamRequest>(offset);
12534 self.0.encode(encoder, offset + 0, depth)?;
12538 Ok(())
12539 }
12540 }
12541
12542 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12543 for StreamProcessorFlushEndOfStreamAndCloseStreamRequest
12544 {
12545 #[inline(always)]
12546 fn new_empty() -> Self {
12547 Self { stream_lifetime_ordinal: fidl::new_empty!(u64, D) }
12548 }
12549
12550 #[inline]
12551 unsafe fn decode(
12552 &mut self,
12553 decoder: &mut fidl::encoding::Decoder<'_, D>,
12554 offset: usize,
12555 _depth: fidl::encoding::Depth,
12556 ) -> fidl::Result<()> {
12557 decoder.debug_check_bounds::<Self>(offset);
12558 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
12559 unsafe {
12562 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
12563 }
12564 Ok(())
12565 }
12566 }
12567
12568 impl fidl::encoding::ValueTypeMarker for StreamProcessorOnFreeInputPacketRequest {
12569 type Borrowed<'a> = &'a Self;
12570 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12571 value
12572 }
12573 }
12574
12575 unsafe impl fidl::encoding::TypeMarker for StreamProcessorOnFreeInputPacketRequest {
12576 type Owned = Self;
12577
12578 #[inline(always)]
12579 fn inline_align(_context: fidl::encoding::Context) -> usize {
12580 8
12581 }
12582
12583 #[inline(always)]
12584 fn inline_size(_context: fidl::encoding::Context) -> usize {
12585 16
12586 }
12587 }
12588
12589 unsafe impl<D: fidl::encoding::ResourceDialect>
12590 fidl::encoding::Encode<StreamProcessorOnFreeInputPacketRequest, D>
12591 for &StreamProcessorOnFreeInputPacketRequest
12592 {
12593 #[inline]
12594 unsafe fn encode(
12595 self,
12596 encoder: &mut fidl::encoding::Encoder<'_, D>,
12597 offset: usize,
12598 _depth: fidl::encoding::Depth,
12599 ) -> fidl::Result<()> {
12600 encoder.debug_check_bounds::<StreamProcessorOnFreeInputPacketRequest>(offset);
12601 fidl::encoding::Encode::<StreamProcessorOnFreeInputPacketRequest, D>::encode(
12603 (<PacketHeader as fidl::encoding::ValueTypeMarker>::borrow(
12604 &self.free_input_packet,
12605 ),),
12606 encoder,
12607 offset,
12608 _depth,
12609 )
12610 }
12611 }
12612 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<PacketHeader, D>>
12613 fidl::encoding::Encode<StreamProcessorOnFreeInputPacketRequest, D> for (T0,)
12614 {
12615 #[inline]
12616 unsafe fn encode(
12617 self,
12618 encoder: &mut fidl::encoding::Encoder<'_, D>,
12619 offset: usize,
12620 depth: fidl::encoding::Depth,
12621 ) -> fidl::Result<()> {
12622 encoder.debug_check_bounds::<StreamProcessorOnFreeInputPacketRequest>(offset);
12623 self.0.encode(encoder, offset + 0, depth)?;
12627 Ok(())
12628 }
12629 }
12630
12631 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12632 for StreamProcessorOnFreeInputPacketRequest
12633 {
12634 #[inline(always)]
12635 fn new_empty() -> Self {
12636 Self { free_input_packet: fidl::new_empty!(PacketHeader, D) }
12637 }
12638
12639 #[inline]
12640 unsafe fn decode(
12641 &mut self,
12642 decoder: &mut fidl::encoding::Decoder<'_, D>,
12643 offset: usize,
12644 _depth: fidl::encoding::Depth,
12645 ) -> fidl::Result<()> {
12646 decoder.debug_check_bounds::<Self>(offset);
12647 fidl::decode!(
12649 PacketHeader,
12650 D,
12651 &mut self.free_input_packet,
12652 decoder,
12653 offset + 0,
12654 _depth
12655 )?;
12656 Ok(())
12657 }
12658 }
12659
12660 impl fidl::encoding::ValueTypeMarker for StreamProcessorOnInputConstraintsRequest {
12661 type Borrowed<'a> = &'a Self;
12662 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12663 value
12664 }
12665 }
12666
12667 unsafe impl fidl::encoding::TypeMarker for StreamProcessorOnInputConstraintsRequest {
12668 type Owned = Self;
12669
12670 #[inline(always)]
12671 fn inline_align(_context: fidl::encoding::Context) -> usize {
12672 8
12673 }
12674
12675 #[inline(always)]
12676 fn inline_size(_context: fidl::encoding::Context) -> usize {
12677 16
12678 }
12679 }
12680
12681 unsafe impl<D: fidl::encoding::ResourceDialect>
12682 fidl::encoding::Encode<StreamProcessorOnInputConstraintsRequest, D>
12683 for &StreamProcessorOnInputConstraintsRequest
12684 {
12685 #[inline]
12686 unsafe fn encode(
12687 self,
12688 encoder: &mut fidl::encoding::Encoder<'_, D>,
12689 offset: usize,
12690 _depth: fidl::encoding::Depth,
12691 ) -> fidl::Result<()> {
12692 encoder.debug_check_bounds::<StreamProcessorOnInputConstraintsRequest>(offset);
12693 fidl::encoding::Encode::<StreamProcessorOnInputConstraintsRequest, D>::encode(
12695 (<StreamBufferConstraints as fidl::encoding::ValueTypeMarker>::borrow(
12696 &self.input_constraints,
12697 ),),
12698 encoder,
12699 offset,
12700 _depth,
12701 )
12702 }
12703 }
12704 unsafe impl<
12705 D: fidl::encoding::ResourceDialect,
12706 T0: fidl::encoding::Encode<StreamBufferConstraints, D>,
12707 > fidl::encoding::Encode<StreamProcessorOnInputConstraintsRequest, D> for (T0,)
12708 {
12709 #[inline]
12710 unsafe fn encode(
12711 self,
12712 encoder: &mut fidl::encoding::Encoder<'_, D>,
12713 offset: usize,
12714 depth: fidl::encoding::Depth,
12715 ) -> fidl::Result<()> {
12716 encoder.debug_check_bounds::<StreamProcessorOnInputConstraintsRequest>(offset);
12717 self.0.encode(encoder, offset + 0, depth)?;
12721 Ok(())
12722 }
12723 }
12724
12725 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12726 for StreamProcessorOnInputConstraintsRequest
12727 {
12728 #[inline(always)]
12729 fn new_empty() -> Self {
12730 Self { input_constraints: fidl::new_empty!(StreamBufferConstraints, D) }
12731 }
12732
12733 #[inline]
12734 unsafe fn decode(
12735 &mut self,
12736 decoder: &mut fidl::encoding::Decoder<'_, D>,
12737 offset: usize,
12738 _depth: fidl::encoding::Depth,
12739 ) -> fidl::Result<()> {
12740 decoder.debug_check_bounds::<Self>(offset);
12741 fidl::decode!(
12743 StreamBufferConstraints,
12744 D,
12745 &mut self.input_constraints,
12746 decoder,
12747 offset + 0,
12748 _depth
12749 )?;
12750 Ok(())
12751 }
12752 }
12753
12754 impl fidl::encoding::ValueTypeMarker for StreamProcessorOnOutputConstraintsRequest {
12755 type Borrowed<'a> = &'a Self;
12756 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12757 value
12758 }
12759 }
12760
12761 unsafe impl fidl::encoding::TypeMarker for StreamProcessorOnOutputConstraintsRequest {
12762 type Owned = Self;
12763
12764 #[inline(always)]
12765 fn inline_align(_context: fidl::encoding::Context) -> usize {
12766 8
12767 }
12768
12769 #[inline(always)]
12770 fn inline_size(_context: fidl::encoding::Context) -> usize {
12771 16
12772 }
12773 }
12774
12775 unsafe impl<D: fidl::encoding::ResourceDialect>
12776 fidl::encoding::Encode<StreamProcessorOnOutputConstraintsRequest, D>
12777 for &StreamProcessorOnOutputConstraintsRequest
12778 {
12779 #[inline]
12780 unsafe fn encode(
12781 self,
12782 encoder: &mut fidl::encoding::Encoder<'_, D>,
12783 offset: usize,
12784 _depth: fidl::encoding::Depth,
12785 ) -> fidl::Result<()> {
12786 encoder.debug_check_bounds::<StreamProcessorOnOutputConstraintsRequest>(offset);
12787 fidl::encoding::Encode::<StreamProcessorOnOutputConstraintsRequest, D>::encode(
12789 (<StreamOutputConstraints as fidl::encoding::ValueTypeMarker>::borrow(
12790 &self.output_config,
12791 ),),
12792 encoder,
12793 offset,
12794 _depth,
12795 )
12796 }
12797 }
12798 unsafe impl<
12799 D: fidl::encoding::ResourceDialect,
12800 T0: fidl::encoding::Encode<StreamOutputConstraints, D>,
12801 > fidl::encoding::Encode<StreamProcessorOnOutputConstraintsRequest, D> for (T0,)
12802 {
12803 #[inline]
12804 unsafe fn encode(
12805 self,
12806 encoder: &mut fidl::encoding::Encoder<'_, D>,
12807 offset: usize,
12808 depth: fidl::encoding::Depth,
12809 ) -> fidl::Result<()> {
12810 encoder.debug_check_bounds::<StreamProcessorOnOutputConstraintsRequest>(offset);
12811 self.0.encode(encoder, offset + 0, depth)?;
12815 Ok(())
12816 }
12817 }
12818
12819 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12820 for StreamProcessorOnOutputConstraintsRequest
12821 {
12822 #[inline(always)]
12823 fn new_empty() -> Self {
12824 Self { output_config: fidl::new_empty!(StreamOutputConstraints, D) }
12825 }
12826
12827 #[inline]
12828 unsafe fn decode(
12829 &mut self,
12830 decoder: &mut fidl::encoding::Decoder<'_, D>,
12831 offset: usize,
12832 _depth: fidl::encoding::Depth,
12833 ) -> fidl::Result<()> {
12834 decoder.debug_check_bounds::<Self>(offset);
12835 fidl::decode!(
12837 StreamOutputConstraints,
12838 D,
12839 &mut self.output_config,
12840 decoder,
12841 offset + 0,
12842 _depth
12843 )?;
12844 Ok(())
12845 }
12846 }
12847
12848 impl fidl::encoding::ValueTypeMarker for StreamProcessorOnOutputEndOfStreamRequest {
12849 type Borrowed<'a> = &'a Self;
12850 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12851 value
12852 }
12853 }
12854
12855 unsafe impl fidl::encoding::TypeMarker for StreamProcessorOnOutputEndOfStreamRequest {
12856 type Owned = Self;
12857
12858 #[inline(always)]
12859 fn inline_align(_context: fidl::encoding::Context) -> usize {
12860 8
12861 }
12862
12863 #[inline(always)]
12864 fn inline_size(_context: fidl::encoding::Context) -> usize {
12865 16
12866 }
12867 }
12868
12869 unsafe impl<D: fidl::encoding::ResourceDialect>
12870 fidl::encoding::Encode<StreamProcessorOnOutputEndOfStreamRequest, D>
12871 for &StreamProcessorOnOutputEndOfStreamRequest
12872 {
12873 #[inline]
12874 unsafe fn encode(
12875 self,
12876 encoder: &mut fidl::encoding::Encoder<'_, D>,
12877 offset: usize,
12878 _depth: fidl::encoding::Depth,
12879 ) -> fidl::Result<()> {
12880 encoder.debug_check_bounds::<StreamProcessorOnOutputEndOfStreamRequest>(offset);
12881 fidl::encoding::Encode::<StreamProcessorOnOutputEndOfStreamRequest, D>::encode(
12883 (
12884 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.stream_lifetime_ordinal),
12885 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.error_detected_before),
12886 ),
12887 encoder,
12888 offset,
12889 _depth,
12890 )
12891 }
12892 }
12893 unsafe impl<
12894 D: fidl::encoding::ResourceDialect,
12895 T0: fidl::encoding::Encode<u64, D>,
12896 T1: fidl::encoding::Encode<bool, D>,
12897 > fidl::encoding::Encode<StreamProcessorOnOutputEndOfStreamRequest, D> for (T0, T1)
12898 {
12899 #[inline]
12900 unsafe fn encode(
12901 self,
12902 encoder: &mut fidl::encoding::Encoder<'_, D>,
12903 offset: usize,
12904 depth: fidl::encoding::Depth,
12905 ) -> fidl::Result<()> {
12906 encoder.debug_check_bounds::<StreamProcessorOnOutputEndOfStreamRequest>(offset);
12907 unsafe {
12910 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
12911 (ptr as *mut u64).write_unaligned(0);
12912 }
12913 self.0.encode(encoder, offset + 0, depth)?;
12915 self.1.encode(encoder, offset + 8, depth)?;
12916 Ok(())
12917 }
12918 }
12919
12920 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12921 for StreamProcessorOnOutputEndOfStreamRequest
12922 {
12923 #[inline(always)]
12924 fn new_empty() -> Self {
12925 Self {
12926 stream_lifetime_ordinal: fidl::new_empty!(u64, D),
12927 error_detected_before: fidl::new_empty!(bool, D),
12928 }
12929 }
12930
12931 #[inline]
12932 unsafe fn decode(
12933 &mut self,
12934 decoder: &mut fidl::encoding::Decoder<'_, D>,
12935 offset: usize,
12936 _depth: fidl::encoding::Depth,
12937 ) -> fidl::Result<()> {
12938 decoder.debug_check_bounds::<Self>(offset);
12939 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
12941 let padval = unsafe { (ptr as *const u64).read_unaligned() };
12942 let mask = 0xffffffffffffff00u64;
12943 let maskedval = padval & mask;
12944 if maskedval != 0 {
12945 return Err(fidl::Error::NonZeroPadding {
12946 padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
12947 });
12948 }
12949 fidl::decode!(u64, D, &mut self.stream_lifetime_ordinal, decoder, offset + 0, _depth)?;
12950 fidl::decode!(bool, D, &mut self.error_detected_before, decoder, offset + 8, _depth)?;
12951 Ok(())
12952 }
12953 }
12954
12955 impl fidl::encoding::ValueTypeMarker for StreamProcessorOnOutputFormatRequest {
12956 type Borrowed<'a> = &'a Self;
12957 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12958 value
12959 }
12960 }
12961
12962 unsafe impl fidl::encoding::TypeMarker for StreamProcessorOnOutputFormatRequest {
12963 type Owned = Self;
12964
12965 #[inline(always)]
12966 fn inline_align(_context: fidl::encoding::Context) -> usize {
12967 8
12968 }
12969
12970 #[inline(always)]
12971 fn inline_size(_context: fidl::encoding::Context) -> usize {
12972 16
12973 }
12974 }
12975
12976 unsafe impl<D: fidl::encoding::ResourceDialect>
12977 fidl::encoding::Encode<StreamProcessorOnOutputFormatRequest, D>
12978 for &StreamProcessorOnOutputFormatRequest
12979 {
12980 #[inline]
12981 unsafe fn encode(
12982 self,
12983 encoder: &mut fidl::encoding::Encoder<'_, D>,
12984 offset: usize,
12985 _depth: fidl::encoding::Depth,
12986 ) -> fidl::Result<()> {
12987 encoder.debug_check_bounds::<StreamProcessorOnOutputFormatRequest>(offset);
12988 fidl::encoding::Encode::<StreamProcessorOnOutputFormatRequest, D>::encode(
12990 (<StreamOutputFormat as fidl::encoding::ValueTypeMarker>::borrow(
12991 &self.output_format,
12992 ),),
12993 encoder,
12994 offset,
12995 _depth,
12996 )
12997 }
12998 }
12999 unsafe impl<
13000 D: fidl::encoding::ResourceDialect,
13001 T0: fidl::encoding::Encode<StreamOutputFormat, D>,
13002 > fidl::encoding::Encode<StreamProcessorOnOutputFormatRequest, D> for (T0,)
13003 {
13004 #[inline]
13005 unsafe fn encode(
13006 self,
13007 encoder: &mut fidl::encoding::Encoder<'_, D>,
13008 offset: usize,
13009 depth: fidl::encoding::Depth,
13010 ) -> fidl::Result<()> {
13011 encoder.debug_check_bounds::<StreamProcessorOnOutputFormatRequest>(offset);
13012 self.0.encode(encoder, offset + 0, depth)?;
13016 Ok(())
13017 }
13018 }
13019
13020 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
13021 for StreamProcessorOnOutputFormatRequest
13022 {
13023 #[inline(always)]
13024 fn new_empty() -> Self {
13025 Self { output_format: fidl::new_empty!(StreamOutputFormat, D) }
13026 }
13027
13028 #[inline]
13029 unsafe fn decode(
13030 &mut self,
13031 decoder: &mut fidl::encoding::Decoder<'_, D>,
13032 offset: usize,
13033 _depth: fidl::encoding::Depth,
13034 ) -> fidl::Result<()> {
13035 decoder.debug_check_bounds::<Self>(offset);
13036 fidl::decode!(
13038 StreamOutputFormat,
13039 D,
13040 &mut self.output_format,
13041 decoder,
13042 offset + 0,
13043 _depth
13044 )?;
13045 Ok(())
13046 }
13047 }
13048
13049 impl fidl::encoding::ValueTypeMarker for StreamProcessorOnOutputPacketRequest {
13050 type Borrowed<'a> = &'a Self;
13051 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13052 value
13053 }
13054 }
13055
13056 unsafe impl fidl::encoding::TypeMarker for StreamProcessorOnOutputPacketRequest {
13057 type Owned = Self;
13058
13059 #[inline(always)]
13060 fn inline_align(_context: fidl::encoding::Context) -> usize {
13061 8
13062 }
13063
13064 #[inline(always)]
13065 fn inline_size(_context: fidl::encoding::Context) -> usize {
13066 24
13067 }
13068 }
13069
13070 unsafe impl<D: fidl::encoding::ResourceDialect>
13071 fidl::encoding::Encode<StreamProcessorOnOutputPacketRequest, D>
13072 for &StreamProcessorOnOutputPacketRequest
13073 {
13074 #[inline]
13075 unsafe fn encode(
13076 self,
13077 encoder: &mut fidl::encoding::Encoder<'_, D>,
13078 offset: usize,
13079 _depth: fidl::encoding::Depth,
13080 ) -> fidl::Result<()> {
13081 encoder.debug_check_bounds::<StreamProcessorOnOutputPacketRequest>(offset);
13082 fidl::encoding::Encode::<StreamProcessorOnOutputPacketRequest, D>::encode(
13084 (
13085 <Packet as fidl::encoding::ValueTypeMarker>::borrow(&self.output_packet),
13086 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.error_detected_before),
13087 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.error_detected_during),
13088 ),
13089 encoder,
13090 offset,
13091 _depth,
13092 )
13093 }
13094 }
13095 unsafe impl<
13096 D: fidl::encoding::ResourceDialect,
13097 T0: fidl::encoding::Encode<Packet, D>,
13098 T1: fidl::encoding::Encode<bool, D>,
13099 T2: fidl::encoding::Encode<bool, D>,
13100 > fidl::encoding::Encode<StreamProcessorOnOutputPacketRequest, D> for (T0, T1, T2)
13101 {
13102 #[inline]
13103 unsafe fn encode(
13104 self,
13105 encoder: &mut fidl::encoding::Encoder<'_, D>,
13106 offset: usize,
13107 depth: fidl::encoding::Depth,
13108 ) -> fidl::Result<()> {
13109 encoder.debug_check_bounds::<StreamProcessorOnOutputPacketRequest>(offset);
13110 unsafe {
13113 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
13114 (ptr as *mut u64).write_unaligned(0);
13115 }
13116 self.0.encode(encoder, offset + 0, depth)?;
13118 self.1.encode(encoder, offset + 16, depth)?;
13119 self.2.encode(encoder, offset + 17, depth)?;
13120 Ok(())
13121 }
13122 }
13123
13124 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
13125 for StreamProcessorOnOutputPacketRequest
13126 {
13127 #[inline(always)]
13128 fn new_empty() -> Self {
13129 Self {
13130 output_packet: fidl::new_empty!(Packet, D),
13131 error_detected_before: fidl::new_empty!(bool, D),
13132 error_detected_during: fidl::new_empty!(bool, D),
13133 }
13134 }
13135
13136 #[inline]
13137 unsafe fn decode(
13138 &mut self,
13139 decoder: &mut fidl::encoding::Decoder<'_, D>,
13140 offset: usize,
13141 _depth: fidl::encoding::Depth,
13142 ) -> fidl::Result<()> {
13143 decoder.debug_check_bounds::<Self>(offset);
13144 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
13146 let padval = unsafe { (ptr as *const u64).read_unaligned() };
13147 let mask = 0xffffffffffff0000u64;
13148 let maskedval = padval & mask;
13149 if maskedval != 0 {
13150 return Err(fidl::Error::NonZeroPadding {
13151 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
13152 });
13153 }
13154 fidl::decode!(Packet, D, &mut self.output_packet, decoder, offset + 0, _depth)?;
13155 fidl::decode!(bool, D, &mut self.error_detected_before, decoder, offset + 16, _depth)?;
13156 fidl::decode!(bool, D, &mut self.error_detected_during, decoder, offset + 17, _depth)?;
13157 Ok(())
13158 }
13159 }
13160
13161 impl fidl::encoding::ValueTypeMarker for StreamProcessorOnStreamFailedRequest {
13162 type Borrowed<'a> = &'a Self;
13163 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13164 value
13165 }
13166 }
13167
13168 unsafe impl fidl::encoding::TypeMarker for StreamProcessorOnStreamFailedRequest {
13169 type Owned = Self;
13170
13171 #[inline(always)]
13172 fn inline_align(_context: fidl::encoding::Context) -> usize {
13173 8
13174 }
13175
13176 #[inline(always)]
13177 fn inline_size(_context: fidl::encoding::Context) -> usize {
13178 16
13179 }
13180 }
13181
13182 unsafe impl<D: fidl::encoding::ResourceDialect>
13183 fidl::encoding::Encode<StreamProcessorOnStreamFailedRequest, D>
13184 for &StreamProcessorOnStreamFailedRequest
13185 {
13186 #[inline]
13187 unsafe fn encode(
13188 self,
13189 encoder: &mut fidl::encoding::Encoder<'_, D>,
13190 offset: usize,
13191 _depth: fidl::encoding::Depth,
13192 ) -> fidl::Result<()> {
13193 encoder.debug_check_bounds::<StreamProcessorOnStreamFailedRequest>(offset);
13194 fidl::encoding::Encode::<StreamProcessorOnStreamFailedRequest, D>::encode(
13196 (
13197 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.stream_lifetime_ordinal),
13198 <StreamError as fidl::encoding::ValueTypeMarker>::borrow(&self.error),
13199 ),
13200 encoder,
13201 offset,
13202 _depth,
13203 )
13204 }
13205 }
13206 unsafe impl<
13207 D: fidl::encoding::ResourceDialect,
13208 T0: fidl::encoding::Encode<u64, D>,
13209 T1: fidl::encoding::Encode<StreamError, D>,
13210 > fidl::encoding::Encode<StreamProcessorOnStreamFailedRequest, D> for (T0, T1)
13211 {
13212 #[inline]
13213 unsafe fn encode(
13214 self,
13215 encoder: &mut fidl::encoding::Encoder<'_, D>,
13216 offset: usize,
13217 depth: fidl::encoding::Depth,
13218 ) -> fidl::Result<()> {
13219 encoder.debug_check_bounds::<StreamProcessorOnStreamFailedRequest>(offset);
13220 unsafe {
13223 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
13224 (ptr as *mut u64).write_unaligned(0);
13225 }
13226 self.0.encode(encoder, offset + 0, depth)?;
13228 self.1.encode(encoder, offset + 8, depth)?;
13229 Ok(())
13230 }
13231 }
13232
13233 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
13234 for StreamProcessorOnStreamFailedRequest
13235 {
13236 #[inline(always)]
13237 fn new_empty() -> Self {
13238 Self {
13239 stream_lifetime_ordinal: fidl::new_empty!(u64, D),
13240 error: fidl::new_empty!(StreamError, D),
13241 }
13242 }
13243
13244 #[inline]
13245 unsafe fn decode(
13246 &mut self,
13247 decoder: &mut fidl::encoding::Decoder<'_, D>,
13248 offset: usize,
13249 _depth: fidl::encoding::Depth,
13250 ) -> fidl::Result<()> {
13251 decoder.debug_check_bounds::<Self>(offset);
13252 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
13254 let padval = unsafe { (ptr as *const u64).read_unaligned() };
13255 let mask = 0xffffffff00000000u64;
13256 let maskedval = padval & mask;
13257 if maskedval != 0 {
13258 return Err(fidl::Error::NonZeroPadding {
13259 padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
13260 });
13261 }
13262 fidl::decode!(u64, D, &mut self.stream_lifetime_ordinal, decoder, offset + 0, _depth)?;
13263 fidl::decode!(StreamError, D, &mut self.error, decoder, offset + 8, _depth)?;
13264 Ok(())
13265 }
13266 }
13267
13268 impl fidl::encoding::ValueTypeMarker for StreamProcessorQueueInputEndOfStreamRequest {
13269 type Borrowed<'a> = &'a Self;
13270 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13271 value
13272 }
13273 }
13274
13275 unsafe impl fidl::encoding::TypeMarker for StreamProcessorQueueInputEndOfStreamRequest {
13276 type Owned = Self;
13277
13278 #[inline(always)]
13279 fn inline_align(_context: fidl::encoding::Context) -> usize {
13280 8
13281 }
13282
13283 #[inline(always)]
13284 fn inline_size(_context: fidl::encoding::Context) -> usize {
13285 8
13286 }
13287 #[inline(always)]
13288 fn encode_is_copy() -> bool {
13289 true
13290 }
13291
13292 #[inline(always)]
13293 fn decode_is_copy() -> bool {
13294 true
13295 }
13296 }
13297
13298 unsafe impl<D: fidl::encoding::ResourceDialect>
13299 fidl::encoding::Encode<StreamProcessorQueueInputEndOfStreamRequest, D>
13300 for &StreamProcessorQueueInputEndOfStreamRequest
13301 {
13302 #[inline]
13303 unsafe fn encode(
13304 self,
13305 encoder: &mut fidl::encoding::Encoder<'_, D>,
13306 offset: usize,
13307 _depth: fidl::encoding::Depth,
13308 ) -> fidl::Result<()> {
13309 encoder.debug_check_bounds::<StreamProcessorQueueInputEndOfStreamRequest>(offset);
13310 unsafe {
13311 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
13313 (buf_ptr as *mut StreamProcessorQueueInputEndOfStreamRequest).write_unaligned(
13314 (self as *const StreamProcessorQueueInputEndOfStreamRequest).read(),
13315 );
13316 }
13319 Ok(())
13320 }
13321 }
13322 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
13323 fidl::encoding::Encode<StreamProcessorQueueInputEndOfStreamRequest, D> for (T0,)
13324 {
13325 #[inline]
13326 unsafe fn encode(
13327 self,
13328 encoder: &mut fidl::encoding::Encoder<'_, D>,
13329 offset: usize,
13330 depth: fidl::encoding::Depth,
13331 ) -> fidl::Result<()> {
13332 encoder.debug_check_bounds::<StreamProcessorQueueInputEndOfStreamRequest>(offset);
13333 self.0.encode(encoder, offset + 0, depth)?;
13337 Ok(())
13338 }
13339 }
13340
13341 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
13342 for StreamProcessorQueueInputEndOfStreamRequest
13343 {
13344 #[inline(always)]
13345 fn new_empty() -> Self {
13346 Self { stream_lifetime_ordinal: fidl::new_empty!(u64, D) }
13347 }
13348
13349 #[inline]
13350 unsafe fn decode(
13351 &mut self,
13352 decoder: &mut fidl::encoding::Decoder<'_, D>,
13353 offset: usize,
13354 _depth: fidl::encoding::Depth,
13355 ) -> fidl::Result<()> {
13356 decoder.debug_check_bounds::<Self>(offset);
13357 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
13358 unsafe {
13361 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
13362 }
13363 Ok(())
13364 }
13365 }
13366
13367 impl fidl::encoding::ValueTypeMarker for StreamProcessorQueueInputFormatDetailsRequest {
13368 type Borrowed<'a> = &'a Self;
13369 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13370 value
13371 }
13372 }
13373
13374 unsafe impl fidl::encoding::TypeMarker for StreamProcessorQueueInputFormatDetailsRequest {
13375 type Owned = Self;
13376
13377 #[inline(always)]
13378 fn inline_align(_context: fidl::encoding::Context) -> usize {
13379 8
13380 }
13381
13382 #[inline(always)]
13383 fn inline_size(_context: fidl::encoding::Context) -> usize {
13384 24
13385 }
13386 }
13387
13388 unsafe impl<D: fidl::encoding::ResourceDialect>
13389 fidl::encoding::Encode<StreamProcessorQueueInputFormatDetailsRequest, D>
13390 for &StreamProcessorQueueInputFormatDetailsRequest
13391 {
13392 #[inline]
13393 unsafe fn encode(
13394 self,
13395 encoder: &mut fidl::encoding::Encoder<'_, D>,
13396 offset: usize,
13397 _depth: fidl::encoding::Depth,
13398 ) -> fidl::Result<()> {
13399 encoder.debug_check_bounds::<StreamProcessorQueueInputFormatDetailsRequest>(offset);
13400 fidl::encoding::Encode::<StreamProcessorQueueInputFormatDetailsRequest, D>::encode(
13402 (
13403 <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.stream_lifetime_ordinal),
13404 <FormatDetails as fidl::encoding::ValueTypeMarker>::borrow(
13405 &self.format_details,
13406 ),
13407 ),
13408 encoder,
13409 offset,
13410 _depth,
13411 )
13412 }
13413 }
13414 unsafe impl<
13415 D: fidl::encoding::ResourceDialect,
13416 T0: fidl::encoding::Encode<u64, D>,
13417 T1: fidl::encoding::Encode<FormatDetails, D>,
13418 > fidl::encoding::Encode<StreamProcessorQueueInputFormatDetailsRequest, D> for (T0, T1)
13419 {
13420 #[inline]
13421 unsafe fn encode(
13422 self,
13423 encoder: &mut fidl::encoding::Encoder<'_, D>,
13424 offset: usize,
13425 depth: fidl::encoding::Depth,
13426 ) -> fidl::Result<()> {
13427 encoder.debug_check_bounds::<StreamProcessorQueueInputFormatDetailsRequest>(offset);
13428 self.0.encode(encoder, offset + 0, depth)?;
13432 self.1.encode(encoder, offset + 8, depth)?;
13433 Ok(())
13434 }
13435 }
13436
13437 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
13438 for StreamProcessorQueueInputFormatDetailsRequest
13439 {
13440 #[inline(always)]
13441 fn new_empty() -> Self {
13442 Self {
13443 stream_lifetime_ordinal: fidl::new_empty!(u64, D),
13444 format_details: fidl::new_empty!(FormatDetails, D),
13445 }
13446 }
13447
13448 #[inline]
13449 unsafe fn decode(
13450 &mut self,
13451 decoder: &mut fidl::encoding::Decoder<'_, D>,
13452 offset: usize,
13453 _depth: fidl::encoding::Depth,
13454 ) -> fidl::Result<()> {
13455 decoder.debug_check_bounds::<Self>(offset);
13456 fidl::decode!(u64, D, &mut self.stream_lifetime_ordinal, decoder, offset + 0, _depth)?;
13458 fidl::decode!(FormatDetails, D, &mut self.format_details, decoder, offset + 8, _depth)?;
13459 Ok(())
13460 }
13461 }
13462
13463 impl fidl::encoding::ValueTypeMarker for StreamProcessorQueueInputPacketRequest {
13464 type Borrowed<'a> = &'a Self;
13465 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13466 value
13467 }
13468 }
13469
13470 unsafe impl fidl::encoding::TypeMarker for StreamProcessorQueueInputPacketRequest {
13471 type Owned = Self;
13472
13473 #[inline(always)]
13474 fn inline_align(_context: fidl::encoding::Context) -> usize {
13475 8
13476 }
13477
13478 #[inline(always)]
13479 fn inline_size(_context: fidl::encoding::Context) -> usize {
13480 16
13481 }
13482 }
13483
13484 unsafe impl<D: fidl::encoding::ResourceDialect>
13485 fidl::encoding::Encode<StreamProcessorQueueInputPacketRequest, D>
13486 for &StreamProcessorQueueInputPacketRequest
13487 {
13488 #[inline]
13489 unsafe fn encode(
13490 self,
13491 encoder: &mut fidl::encoding::Encoder<'_, D>,
13492 offset: usize,
13493 _depth: fidl::encoding::Depth,
13494 ) -> fidl::Result<()> {
13495 encoder.debug_check_bounds::<StreamProcessorQueueInputPacketRequest>(offset);
13496 fidl::encoding::Encode::<StreamProcessorQueueInputPacketRequest, D>::encode(
13498 (<Packet as fidl::encoding::ValueTypeMarker>::borrow(&self.packet),),
13499 encoder,
13500 offset,
13501 _depth,
13502 )
13503 }
13504 }
13505 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Packet, D>>
13506 fidl::encoding::Encode<StreamProcessorQueueInputPacketRequest, D> for (T0,)
13507 {
13508 #[inline]
13509 unsafe fn encode(
13510 self,
13511 encoder: &mut fidl::encoding::Encoder<'_, D>,
13512 offset: usize,
13513 depth: fidl::encoding::Depth,
13514 ) -> fidl::Result<()> {
13515 encoder.debug_check_bounds::<StreamProcessorQueueInputPacketRequest>(offset);
13516 self.0.encode(encoder, offset + 0, depth)?;
13520 Ok(())
13521 }
13522 }
13523
13524 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
13525 for StreamProcessorQueueInputPacketRequest
13526 {
13527 #[inline(always)]
13528 fn new_empty() -> Self {
13529 Self { packet: fidl::new_empty!(Packet, D) }
13530 }
13531
13532 #[inline]
13533 unsafe fn decode(
13534 &mut self,
13535 decoder: &mut fidl::encoding::Decoder<'_, D>,
13536 offset: usize,
13537 _depth: fidl::encoding::Depth,
13538 ) -> fidl::Result<()> {
13539 decoder.debug_check_bounds::<Self>(offset);
13540 fidl::decode!(Packet, D, &mut self.packet, decoder, offset + 0, _depth)?;
13542 Ok(())
13543 }
13544 }
13545
13546 impl fidl::encoding::ValueTypeMarker for StreamProcessorRecycleOutputPacketRequest {
13547 type Borrowed<'a> = &'a Self;
13548 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13549 value
13550 }
13551 }
13552
13553 unsafe impl fidl::encoding::TypeMarker for StreamProcessorRecycleOutputPacketRequest {
13554 type Owned = Self;
13555
13556 #[inline(always)]
13557 fn inline_align(_context: fidl::encoding::Context) -> usize {
13558 8
13559 }
13560
13561 #[inline(always)]
13562 fn inline_size(_context: fidl::encoding::Context) -> usize {
13563 16
13564 }
13565 }
13566
13567 unsafe impl<D: fidl::encoding::ResourceDialect>
13568 fidl::encoding::Encode<StreamProcessorRecycleOutputPacketRequest, D>
13569 for &StreamProcessorRecycleOutputPacketRequest
13570 {
13571 #[inline]
13572 unsafe fn encode(
13573 self,
13574 encoder: &mut fidl::encoding::Encoder<'_, D>,
13575 offset: usize,
13576 _depth: fidl::encoding::Depth,
13577 ) -> fidl::Result<()> {
13578 encoder.debug_check_bounds::<StreamProcessorRecycleOutputPacketRequest>(offset);
13579 fidl::encoding::Encode::<StreamProcessorRecycleOutputPacketRequest, D>::encode(
13581 (<PacketHeader as fidl::encoding::ValueTypeMarker>::borrow(
13582 &self.available_output_packet,
13583 ),),
13584 encoder,
13585 offset,
13586 _depth,
13587 )
13588 }
13589 }
13590 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<PacketHeader, D>>
13591 fidl::encoding::Encode<StreamProcessorRecycleOutputPacketRequest, D> for (T0,)
13592 {
13593 #[inline]
13594 unsafe fn encode(
13595 self,
13596 encoder: &mut fidl::encoding::Encoder<'_, D>,
13597 offset: usize,
13598 depth: fidl::encoding::Depth,
13599 ) -> fidl::Result<()> {
13600 encoder.debug_check_bounds::<StreamProcessorRecycleOutputPacketRequest>(offset);
13601 self.0.encode(encoder, offset + 0, depth)?;
13605 Ok(())
13606 }
13607 }
13608
13609 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
13610 for StreamProcessorRecycleOutputPacketRequest
13611 {
13612 #[inline(always)]
13613 fn new_empty() -> Self {
13614 Self { available_output_packet: fidl::new_empty!(PacketHeader, D) }
13615 }
13616
13617 #[inline]
13618 unsafe fn decode(
13619 &mut self,
13620 decoder: &mut fidl::encoding::Decoder<'_, D>,
13621 offset: usize,
13622 _depth: fidl::encoding::Depth,
13623 ) -> fidl::Result<()> {
13624 decoder.debug_check_bounds::<Self>(offset);
13625 fidl::decode!(
13627 PacketHeader,
13628 D,
13629 &mut self.available_output_packet,
13630 decoder,
13631 offset + 0,
13632 _depth
13633 )?;
13634 Ok(())
13635 }
13636 }
13637
13638 impl fidl::encoding::ValueTypeMarker for StreamSinkSendPacketNoReplyRequest {
13639 type Borrowed<'a> = &'a Self;
13640 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13641 value
13642 }
13643 }
13644
13645 unsafe impl fidl::encoding::TypeMarker for StreamSinkSendPacketNoReplyRequest {
13646 type Owned = Self;
13647
13648 #[inline(always)]
13649 fn inline_align(_context: fidl::encoding::Context) -> usize {
13650 8
13651 }
13652
13653 #[inline(always)]
13654 fn inline_size(_context: fidl::encoding::Context) -> usize {
13655 56
13656 }
13657 }
13658
13659 unsafe impl<D: fidl::encoding::ResourceDialect>
13660 fidl::encoding::Encode<StreamSinkSendPacketNoReplyRequest, D>
13661 for &StreamSinkSendPacketNoReplyRequest
13662 {
13663 #[inline]
13664 unsafe fn encode(
13665 self,
13666 encoder: &mut fidl::encoding::Encoder<'_, D>,
13667 offset: usize,
13668 _depth: fidl::encoding::Depth,
13669 ) -> fidl::Result<()> {
13670 encoder.debug_check_bounds::<StreamSinkSendPacketNoReplyRequest>(offset);
13671 unsafe {
13672 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
13674 (buf_ptr as *mut StreamSinkSendPacketNoReplyRequest)
13675 .write_unaligned((self as *const StreamSinkSendPacketNoReplyRequest).read());
13676 let padding_ptr = buf_ptr.offset(8) as *mut u64;
13679 let padding_mask = 0xffffffff00000000u64;
13680 padding_ptr.write_unaligned(padding_ptr.read_unaligned() & !padding_mask);
13681 let padding_ptr = buf_ptr.offset(32) as *mut u64;
13682 let padding_mask = 0xffffffff00000000u64;
13683 padding_ptr.write_unaligned(padding_ptr.read_unaligned() & !padding_mask);
13684 }
13685 Ok(())
13686 }
13687 }
13688 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<StreamPacket, D>>
13689 fidl::encoding::Encode<StreamSinkSendPacketNoReplyRequest, D> for (T0,)
13690 {
13691 #[inline]
13692 unsafe fn encode(
13693 self,
13694 encoder: &mut fidl::encoding::Encoder<'_, D>,
13695 offset: usize,
13696 depth: fidl::encoding::Depth,
13697 ) -> fidl::Result<()> {
13698 encoder.debug_check_bounds::<StreamSinkSendPacketNoReplyRequest>(offset);
13699 self.0.encode(encoder, offset + 0, depth)?;
13703 Ok(())
13704 }
13705 }
13706
13707 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
13708 for StreamSinkSendPacketNoReplyRequest
13709 {
13710 #[inline(always)]
13711 fn new_empty() -> Self {
13712 Self { packet: fidl::new_empty!(StreamPacket, D) }
13713 }
13714
13715 #[inline]
13716 unsafe fn decode(
13717 &mut self,
13718 decoder: &mut fidl::encoding::Decoder<'_, D>,
13719 offset: usize,
13720 _depth: fidl::encoding::Depth,
13721 ) -> fidl::Result<()> {
13722 decoder.debug_check_bounds::<Self>(offset);
13723 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
13724 let ptr = unsafe { buf_ptr.offset(8) };
13726 let padval = unsafe { (ptr as *const u64).read_unaligned() };
13727 let mask = 0xffffffff00000000u64;
13728 let maskedval = padval & mask;
13729 if maskedval != 0 {
13730 return Err(fidl::Error::NonZeroPadding {
13731 padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
13732 });
13733 }
13734 let ptr = unsafe { buf_ptr.offset(32) };
13735 let padval = unsafe { (ptr as *const u64).read_unaligned() };
13736 let mask = 0xffffffff00000000u64;
13737 let maskedval = padval & mask;
13738 if maskedval != 0 {
13739 return Err(fidl::Error::NonZeroPadding {
13740 padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
13741 });
13742 }
13743 unsafe {
13745 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 56);
13746 }
13747 Ok(())
13748 }
13749 }
13750
13751 impl fidl::encoding::ValueTypeMarker for StreamSinkSendPacketRequest {
13752 type Borrowed<'a> = &'a Self;
13753 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13754 value
13755 }
13756 }
13757
13758 unsafe impl fidl::encoding::TypeMarker for StreamSinkSendPacketRequest {
13759 type Owned = Self;
13760
13761 #[inline(always)]
13762 fn inline_align(_context: fidl::encoding::Context) -> usize {
13763 8
13764 }
13765
13766 #[inline(always)]
13767 fn inline_size(_context: fidl::encoding::Context) -> usize {
13768 56
13769 }
13770 }
13771
13772 unsafe impl<D: fidl::encoding::ResourceDialect>
13773 fidl::encoding::Encode<StreamSinkSendPacketRequest, D> for &StreamSinkSendPacketRequest
13774 {
13775 #[inline]
13776 unsafe fn encode(
13777 self,
13778 encoder: &mut fidl::encoding::Encoder<'_, D>,
13779 offset: usize,
13780 _depth: fidl::encoding::Depth,
13781 ) -> fidl::Result<()> {
13782 encoder.debug_check_bounds::<StreamSinkSendPacketRequest>(offset);
13783 unsafe {
13784 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
13786 (buf_ptr as *mut StreamSinkSendPacketRequest)
13787 .write_unaligned((self as *const StreamSinkSendPacketRequest).read());
13788 let padding_ptr = buf_ptr.offset(8) as *mut u64;
13791 let padding_mask = 0xffffffff00000000u64;
13792 padding_ptr.write_unaligned(padding_ptr.read_unaligned() & !padding_mask);
13793 let padding_ptr = buf_ptr.offset(32) as *mut u64;
13794 let padding_mask = 0xffffffff00000000u64;
13795 padding_ptr.write_unaligned(padding_ptr.read_unaligned() & !padding_mask);
13796 }
13797 Ok(())
13798 }
13799 }
13800 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<StreamPacket, D>>
13801 fidl::encoding::Encode<StreamSinkSendPacketRequest, D> for (T0,)
13802 {
13803 #[inline]
13804 unsafe fn encode(
13805 self,
13806 encoder: &mut fidl::encoding::Encoder<'_, D>,
13807 offset: usize,
13808 depth: fidl::encoding::Depth,
13809 ) -> fidl::Result<()> {
13810 encoder.debug_check_bounds::<StreamSinkSendPacketRequest>(offset);
13811 self.0.encode(encoder, offset + 0, depth)?;
13815 Ok(())
13816 }
13817 }
13818
13819 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
13820 for StreamSinkSendPacketRequest
13821 {
13822 #[inline(always)]
13823 fn new_empty() -> Self {
13824 Self { packet: fidl::new_empty!(StreamPacket, D) }
13825 }
13826
13827 #[inline]
13828 unsafe fn decode(
13829 &mut self,
13830 decoder: &mut fidl::encoding::Decoder<'_, D>,
13831 offset: usize,
13832 _depth: fidl::encoding::Depth,
13833 ) -> fidl::Result<()> {
13834 decoder.debug_check_bounds::<Self>(offset);
13835 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
13836 let ptr = unsafe { buf_ptr.offset(8) };
13838 let padval = unsafe { (ptr as *const u64).read_unaligned() };
13839 let mask = 0xffffffff00000000u64;
13840 let maskedval = padval & mask;
13841 if maskedval != 0 {
13842 return Err(fidl::Error::NonZeroPadding {
13843 padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
13844 });
13845 }
13846 let ptr = unsafe { buf_ptr.offset(32) };
13847 let padval = unsafe { (ptr as *const u64).read_unaligned() };
13848 let mask = 0xffffffff00000000u64;
13849 let maskedval = padval & mask;
13850 if maskedval != 0 {
13851 return Err(fidl::Error::NonZeroPadding {
13852 padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
13853 });
13854 }
13855 unsafe {
13857 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 56);
13858 }
13859 Ok(())
13860 }
13861 }
13862
13863 impl fidl::encoding::ValueTypeMarker for StreamSourceOnPacketProducedRequest {
13864 type Borrowed<'a> = &'a Self;
13865 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13866 value
13867 }
13868 }
13869
13870 unsafe impl fidl::encoding::TypeMarker for StreamSourceOnPacketProducedRequest {
13871 type Owned = Self;
13872
13873 #[inline(always)]
13874 fn inline_align(_context: fidl::encoding::Context) -> usize {
13875 8
13876 }
13877
13878 #[inline(always)]
13879 fn inline_size(_context: fidl::encoding::Context) -> usize {
13880 56
13881 }
13882 }
13883
13884 unsafe impl<D: fidl::encoding::ResourceDialect>
13885 fidl::encoding::Encode<StreamSourceOnPacketProducedRequest, D>
13886 for &StreamSourceOnPacketProducedRequest
13887 {
13888 #[inline]
13889 unsafe fn encode(
13890 self,
13891 encoder: &mut fidl::encoding::Encoder<'_, D>,
13892 offset: usize,
13893 _depth: fidl::encoding::Depth,
13894 ) -> fidl::Result<()> {
13895 encoder.debug_check_bounds::<StreamSourceOnPacketProducedRequest>(offset);
13896 unsafe {
13897 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
13899 (buf_ptr as *mut StreamSourceOnPacketProducedRequest)
13900 .write_unaligned((self as *const StreamSourceOnPacketProducedRequest).read());
13901 let padding_ptr = buf_ptr.offset(8) as *mut u64;
13904 let padding_mask = 0xffffffff00000000u64;
13905 padding_ptr.write_unaligned(padding_ptr.read_unaligned() & !padding_mask);
13906 let padding_ptr = buf_ptr.offset(32) as *mut u64;
13907 let padding_mask = 0xffffffff00000000u64;
13908 padding_ptr.write_unaligned(padding_ptr.read_unaligned() & !padding_mask);
13909 }
13910 Ok(())
13911 }
13912 }
13913 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<StreamPacket, D>>
13914 fidl::encoding::Encode<StreamSourceOnPacketProducedRequest, D> for (T0,)
13915 {
13916 #[inline]
13917 unsafe fn encode(
13918 self,
13919 encoder: &mut fidl::encoding::Encoder<'_, D>,
13920 offset: usize,
13921 depth: fidl::encoding::Depth,
13922 ) -> fidl::Result<()> {
13923 encoder.debug_check_bounds::<StreamSourceOnPacketProducedRequest>(offset);
13924 self.0.encode(encoder, offset + 0, depth)?;
13928 Ok(())
13929 }
13930 }
13931
13932 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
13933 for StreamSourceOnPacketProducedRequest
13934 {
13935 #[inline(always)]
13936 fn new_empty() -> Self {
13937 Self { packet: fidl::new_empty!(StreamPacket, D) }
13938 }
13939
13940 #[inline]
13941 unsafe fn decode(
13942 &mut self,
13943 decoder: &mut fidl::encoding::Decoder<'_, D>,
13944 offset: usize,
13945 _depth: fidl::encoding::Depth,
13946 ) -> fidl::Result<()> {
13947 decoder.debug_check_bounds::<Self>(offset);
13948 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
13949 let ptr = unsafe { buf_ptr.offset(8) };
13951 let padval = unsafe { (ptr as *const u64).read_unaligned() };
13952 let mask = 0xffffffff00000000u64;
13953 let maskedval = padval & mask;
13954 if maskedval != 0 {
13955 return Err(fidl::Error::NonZeroPadding {
13956 padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
13957 });
13958 }
13959 let ptr = unsafe { buf_ptr.offset(32) };
13960 let padval = unsafe { (ptr as *const u64).read_unaligned() };
13961 let mask = 0xffffffff00000000u64;
13962 let maskedval = padval & mask;
13963 if maskedval != 0 {
13964 return Err(fidl::Error::NonZeroPadding {
13965 padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
13966 });
13967 }
13968 unsafe {
13970 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 56);
13971 }
13972 Ok(())
13973 }
13974 }
13975
13976 impl fidl::encoding::ValueTypeMarker for StreamSourceReleasePacketRequest {
13977 type Borrowed<'a> = &'a Self;
13978 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13979 value
13980 }
13981 }
13982
13983 unsafe impl fidl::encoding::TypeMarker for StreamSourceReleasePacketRequest {
13984 type Owned = Self;
13985
13986 #[inline(always)]
13987 fn inline_align(_context: fidl::encoding::Context) -> usize {
13988 8
13989 }
13990
13991 #[inline(always)]
13992 fn inline_size(_context: fidl::encoding::Context) -> usize {
13993 56
13994 }
13995 }
13996
13997 unsafe impl<D: fidl::encoding::ResourceDialect>
13998 fidl::encoding::Encode<StreamSourceReleasePacketRequest, D>
13999 for &StreamSourceReleasePacketRequest
14000 {
14001 #[inline]
14002 unsafe fn encode(
14003 self,
14004 encoder: &mut fidl::encoding::Encoder<'_, D>,
14005 offset: usize,
14006 _depth: fidl::encoding::Depth,
14007 ) -> fidl::Result<()> {
14008 encoder.debug_check_bounds::<StreamSourceReleasePacketRequest>(offset);
14009 unsafe {
14010 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
14012 (buf_ptr as *mut StreamSourceReleasePacketRequest)
14013 .write_unaligned((self as *const StreamSourceReleasePacketRequest).read());
14014 let padding_ptr = buf_ptr.offset(8) as *mut u64;
14017 let padding_mask = 0xffffffff00000000u64;
14018 padding_ptr.write_unaligned(padding_ptr.read_unaligned() & !padding_mask);
14019 let padding_ptr = buf_ptr.offset(32) as *mut u64;
14020 let padding_mask = 0xffffffff00000000u64;
14021 padding_ptr.write_unaligned(padding_ptr.read_unaligned() & !padding_mask);
14022 }
14023 Ok(())
14024 }
14025 }
14026 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<StreamPacket, D>>
14027 fidl::encoding::Encode<StreamSourceReleasePacketRequest, D> for (T0,)
14028 {
14029 #[inline]
14030 unsafe fn encode(
14031 self,
14032 encoder: &mut fidl::encoding::Encoder<'_, D>,
14033 offset: usize,
14034 depth: fidl::encoding::Depth,
14035 ) -> fidl::Result<()> {
14036 encoder.debug_check_bounds::<StreamSourceReleasePacketRequest>(offset);
14037 self.0.encode(encoder, offset + 0, depth)?;
14041 Ok(())
14042 }
14043 }
14044
14045 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
14046 for StreamSourceReleasePacketRequest
14047 {
14048 #[inline(always)]
14049 fn new_empty() -> Self {
14050 Self { packet: fidl::new_empty!(StreamPacket, D) }
14051 }
14052
14053 #[inline]
14054 unsafe fn decode(
14055 &mut self,
14056 decoder: &mut fidl::encoding::Decoder<'_, D>,
14057 offset: usize,
14058 _depth: fidl::encoding::Depth,
14059 ) -> fidl::Result<()> {
14060 decoder.debug_check_bounds::<Self>(offset);
14061 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
14062 let ptr = unsafe { buf_ptr.offset(8) };
14064 let padval = unsafe { (ptr as *const u64).read_unaligned() };
14065 let mask = 0xffffffff00000000u64;
14066 let maskedval = padval & mask;
14067 if maskedval != 0 {
14068 return Err(fidl::Error::NonZeroPadding {
14069 padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
14070 });
14071 }
14072 let ptr = unsafe { buf_ptr.offset(32) };
14073 let padval = unsafe { (ptr as *const u64).read_unaligned() };
14074 let mask = 0xffffffff00000000u64;
14075 let maskedval = padval & mask;
14076 if maskedval != 0 {
14077 return Err(fidl::Error::NonZeroPadding {
14078 padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
14079 });
14080 }
14081 unsafe {
14083 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 56);
14084 }
14085 Ok(())
14086 }
14087 }
14088
14089 impl fidl::encoding::ValueTypeMarker for StreamType {
14090 type Borrowed<'a> = &'a Self;
14091 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
14092 value
14093 }
14094 }
14095
14096 unsafe impl fidl::encoding::TypeMarker for StreamType {
14097 type Owned = Self;
14098
14099 #[inline(always)]
14100 fn inline_align(_context: fidl::encoding::Context) -> usize {
14101 8
14102 }
14103
14104 #[inline(always)]
14105 fn inline_size(_context: fidl::encoding::Context) -> usize {
14106 48
14107 }
14108 }
14109
14110 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<StreamType, D>
14111 for &StreamType
14112 {
14113 #[inline]
14114 unsafe fn encode(
14115 self,
14116 encoder: &mut fidl::encoding::Encoder<'_, D>,
14117 offset: usize,
14118 _depth: fidl::encoding::Depth,
14119 ) -> fidl::Result<()> {
14120 encoder.debug_check_bounds::<StreamType>(offset);
14121 fidl::encoding::Encode::<StreamType, D>::encode(
14123 (
14124 <MediumSpecificStreamType as fidl::encoding::ValueTypeMarker>::borrow(&self.medium_specific),
14125 <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(&self.encoding),
14126 <fidl::encoding::Optional<fidl::encoding::UnboundedVector<u8>> as fidl::encoding::ValueTypeMarker>::borrow(&self.encoding_parameters),
14127 ),
14128 encoder, offset, _depth
14129 )
14130 }
14131 }
14132 unsafe impl<
14133 D: fidl::encoding::ResourceDialect,
14134 T0: fidl::encoding::Encode<MediumSpecificStreamType, D>,
14135 T1: fidl::encoding::Encode<fidl::encoding::BoundedString<255>, D>,
14136 T2: fidl::encoding::Encode<fidl::encoding::Optional<fidl::encoding::UnboundedVector<u8>>, D>,
14137 > fidl::encoding::Encode<StreamType, D> for (T0, T1, T2)
14138 {
14139 #[inline]
14140 unsafe fn encode(
14141 self,
14142 encoder: &mut fidl::encoding::Encoder<'_, D>,
14143 offset: usize,
14144 depth: fidl::encoding::Depth,
14145 ) -> fidl::Result<()> {
14146 encoder.debug_check_bounds::<StreamType>(offset);
14147 self.0.encode(encoder, offset + 0, depth)?;
14151 self.1.encode(encoder, offset + 16, depth)?;
14152 self.2.encode(encoder, offset + 32, depth)?;
14153 Ok(())
14154 }
14155 }
14156
14157 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for StreamType {
14158 #[inline(always)]
14159 fn new_empty() -> Self {
14160 Self {
14161 medium_specific: fidl::new_empty!(MediumSpecificStreamType, D),
14162 encoding: fidl::new_empty!(fidl::encoding::BoundedString<255>, D),
14163 encoding_parameters: fidl::new_empty!(
14164 fidl::encoding::Optional<fidl::encoding::UnboundedVector<u8>>,
14165 D
14166 ),
14167 }
14168 }
14169
14170 #[inline]
14171 unsafe fn decode(
14172 &mut self,
14173 decoder: &mut fidl::encoding::Decoder<'_, D>,
14174 offset: usize,
14175 _depth: fidl::encoding::Depth,
14176 ) -> fidl::Result<()> {
14177 decoder.debug_check_bounds::<Self>(offset);
14178 fidl::decode!(
14180 MediumSpecificStreamType,
14181 D,
14182 &mut self.medium_specific,
14183 decoder,
14184 offset + 0,
14185 _depth
14186 )?;
14187 fidl::decode!(
14188 fidl::encoding::BoundedString<255>,
14189 D,
14190 &mut self.encoding,
14191 decoder,
14192 offset + 16,
14193 _depth
14194 )?;
14195 fidl::decode!(
14196 fidl::encoding::Optional<fidl::encoding::UnboundedVector<u8>>,
14197 D,
14198 &mut self.encoding_parameters,
14199 decoder,
14200 offset + 32,
14201 _depth
14202 )?;
14203 Ok(())
14204 }
14205 }
14206
14207 impl fidl::encoding::ValueTypeMarker for SubpictureStreamType {
14208 type Borrowed<'a> = &'a Self;
14209 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
14210 value
14211 }
14212 }
14213
14214 unsafe impl fidl::encoding::TypeMarker for SubpictureStreamType {
14215 type Owned = Self;
14216
14217 #[inline(always)]
14218 fn inline_align(_context: fidl::encoding::Context) -> usize {
14219 1
14220 }
14221
14222 #[inline(always)]
14223 fn inline_size(_context: fidl::encoding::Context) -> usize {
14224 1
14225 }
14226 }
14227
14228 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SubpictureStreamType, D>
14229 for &SubpictureStreamType
14230 {
14231 #[inline]
14232 unsafe fn encode(
14233 self,
14234 encoder: &mut fidl::encoding::Encoder<'_, D>,
14235 offset: usize,
14236 _depth: fidl::encoding::Depth,
14237 ) -> fidl::Result<()> {
14238 encoder.debug_check_bounds::<SubpictureStreamType>(offset);
14239 encoder.write_num(0u8, offset);
14240 Ok(())
14241 }
14242 }
14243
14244 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SubpictureStreamType {
14245 #[inline(always)]
14246 fn new_empty() -> Self {
14247 Self
14248 }
14249
14250 #[inline]
14251 unsafe fn decode(
14252 &mut self,
14253 decoder: &mut fidl::encoding::Decoder<'_, D>,
14254 offset: usize,
14255 _depth: fidl::encoding::Depth,
14256 ) -> fidl::Result<()> {
14257 decoder.debug_check_bounds::<Self>(offset);
14258 match decoder.read_num::<u8>(offset) {
14259 0 => Ok(()),
14260 _ => Err(fidl::Error::Invalid),
14261 }
14262 }
14263 }
14264
14265 impl fidl::encoding::ValueTypeMarker for SubsampleEntry {
14266 type Borrowed<'a> = &'a Self;
14267 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
14268 value
14269 }
14270 }
14271
14272 unsafe impl fidl::encoding::TypeMarker for SubsampleEntry {
14273 type Owned = Self;
14274
14275 #[inline(always)]
14276 fn inline_align(_context: fidl::encoding::Context) -> usize {
14277 4
14278 }
14279
14280 #[inline(always)]
14281 fn inline_size(_context: fidl::encoding::Context) -> usize {
14282 8
14283 }
14284 #[inline(always)]
14285 fn encode_is_copy() -> bool {
14286 true
14287 }
14288
14289 #[inline(always)]
14290 fn decode_is_copy() -> bool {
14291 true
14292 }
14293 }
14294
14295 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SubsampleEntry, D>
14296 for &SubsampleEntry
14297 {
14298 #[inline]
14299 unsafe fn encode(
14300 self,
14301 encoder: &mut fidl::encoding::Encoder<'_, D>,
14302 offset: usize,
14303 _depth: fidl::encoding::Depth,
14304 ) -> fidl::Result<()> {
14305 encoder.debug_check_bounds::<SubsampleEntry>(offset);
14306 unsafe {
14307 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
14309 (buf_ptr as *mut SubsampleEntry)
14310 .write_unaligned((self as *const SubsampleEntry).read());
14311 }
14314 Ok(())
14315 }
14316 }
14317 unsafe impl<
14318 D: fidl::encoding::ResourceDialect,
14319 T0: fidl::encoding::Encode<u32, D>,
14320 T1: fidl::encoding::Encode<u32, D>,
14321 > fidl::encoding::Encode<SubsampleEntry, D> for (T0, T1)
14322 {
14323 #[inline]
14324 unsafe fn encode(
14325 self,
14326 encoder: &mut fidl::encoding::Encoder<'_, D>,
14327 offset: usize,
14328 depth: fidl::encoding::Depth,
14329 ) -> fidl::Result<()> {
14330 encoder.debug_check_bounds::<SubsampleEntry>(offset);
14331 self.0.encode(encoder, offset + 0, depth)?;
14335 self.1.encode(encoder, offset + 4, depth)?;
14336 Ok(())
14337 }
14338 }
14339
14340 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SubsampleEntry {
14341 #[inline(always)]
14342 fn new_empty() -> Self {
14343 Self {
14344 clear_bytes: fidl::new_empty!(u32, D),
14345 encrypted_bytes: fidl::new_empty!(u32, D),
14346 }
14347 }
14348
14349 #[inline]
14350 unsafe fn decode(
14351 &mut self,
14352 decoder: &mut fidl::encoding::Decoder<'_, D>,
14353 offset: usize,
14354 _depth: fidl::encoding::Depth,
14355 ) -> fidl::Result<()> {
14356 decoder.debug_check_bounds::<Self>(offset);
14357 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
14358 unsafe {
14361 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
14362 }
14363 Ok(())
14364 }
14365 }
14366
14367 impl fidl::encoding::ValueTypeMarker for TextStreamType {
14368 type Borrowed<'a> = &'a Self;
14369 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
14370 value
14371 }
14372 }
14373
14374 unsafe impl fidl::encoding::TypeMarker for TextStreamType {
14375 type Owned = Self;
14376
14377 #[inline(always)]
14378 fn inline_align(_context: fidl::encoding::Context) -> usize {
14379 1
14380 }
14381
14382 #[inline(always)]
14383 fn inline_size(_context: fidl::encoding::Context) -> usize {
14384 1
14385 }
14386 }
14387
14388 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<TextStreamType, D>
14389 for &TextStreamType
14390 {
14391 #[inline]
14392 unsafe fn encode(
14393 self,
14394 encoder: &mut fidl::encoding::Encoder<'_, D>,
14395 offset: usize,
14396 _depth: fidl::encoding::Depth,
14397 ) -> fidl::Result<()> {
14398 encoder.debug_check_bounds::<TextStreamType>(offset);
14399 encoder.write_num(0u8, offset);
14400 Ok(())
14401 }
14402 }
14403
14404 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for TextStreamType {
14405 #[inline(always)]
14406 fn new_empty() -> Self {
14407 Self
14408 }
14409
14410 #[inline]
14411 unsafe fn decode(
14412 &mut self,
14413 decoder: &mut fidl::encoding::Decoder<'_, D>,
14414 offset: usize,
14415 _depth: fidl::encoding::Depth,
14416 ) -> fidl::Result<()> {
14417 decoder.debug_check_bounds::<Self>(offset);
14418 match decoder.read_num::<u8>(offset) {
14419 0 => Ok(()),
14420 _ => Err(fidl::Error::Invalid),
14421 }
14422 }
14423 }
14424
14425 impl fidl::encoding::ValueTypeMarker for TimelineFunction {
14426 type Borrowed<'a> = &'a Self;
14427 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
14428 value
14429 }
14430 }
14431
14432 unsafe impl fidl::encoding::TypeMarker for TimelineFunction {
14433 type Owned = Self;
14434
14435 #[inline(always)]
14436 fn inline_align(_context: fidl::encoding::Context) -> usize {
14437 8
14438 }
14439
14440 #[inline(always)]
14441 fn inline_size(_context: fidl::encoding::Context) -> usize {
14442 24
14443 }
14444 #[inline(always)]
14445 fn encode_is_copy() -> bool {
14446 true
14447 }
14448
14449 #[inline(always)]
14450 fn decode_is_copy() -> bool {
14451 true
14452 }
14453 }
14454
14455 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<TimelineFunction, D>
14456 for &TimelineFunction
14457 {
14458 #[inline]
14459 unsafe fn encode(
14460 self,
14461 encoder: &mut fidl::encoding::Encoder<'_, D>,
14462 offset: usize,
14463 _depth: fidl::encoding::Depth,
14464 ) -> fidl::Result<()> {
14465 encoder.debug_check_bounds::<TimelineFunction>(offset);
14466 unsafe {
14467 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
14469 (buf_ptr as *mut TimelineFunction)
14470 .write_unaligned((self as *const TimelineFunction).read());
14471 }
14474 Ok(())
14475 }
14476 }
14477 unsafe impl<
14478 D: fidl::encoding::ResourceDialect,
14479 T0: fidl::encoding::Encode<i64, D>,
14480 T1: fidl::encoding::Encode<i64, D>,
14481 T2: fidl::encoding::Encode<u32, D>,
14482 T3: fidl::encoding::Encode<u32, D>,
14483 > fidl::encoding::Encode<TimelineFunction, D> for (T0, T1, T2, T3)
14484 {
14485 #[inline]
14486 unsafe fn encode(
14487 self,
14488 encoder: &mut fidl::encoding::Encoder<'_, D>,
14489 offset: usize,
14490 depth: fidl::encoding::Depth,
14491 ) -> fidl::Result<()> {
14492 encoder.debug_check_bounds::<TimelineFunction>(offset);
14493 self.0.encode(encoder, offset + 0, depth)?;
14497 self.1.encode(encoder, offset + 8, depth)?;
14498 self.2.encode(encoder, offset + 16, depth)?;
14499 self.3.encode(encoder, offset + 20, depth)?;
14500 Ok(())
14501 }
14502 }
14503
14504 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for TimelineFunction {
14505 #[inline(always)]
14506 fn new_empty() -> Self {
14507 Self {
14508 subject_time: fidl::new_empty!(i64, D),
14509 reference_time: fidl::new_empty!(i64, D),
14510 subject_delta: fidl::new_empty!(u32, D),
14511 reference_delta: fidl::new_empty!(u32, D),
14512 }
14513 }
14514
14515 #[inline]
14516 unsafe fn decode(
14517 &mut self,
14518 decoder: &mut fidl::encoding::Decoder<'_, D>,
14519 offset: usize,
14520 _depth: fidl::encoding::Depth,
14521 ) -> fidl::Result<()> {
14522 decoder.debug_check_bounds::<Self>(offset);
14523 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
14524 unsafe {
14527 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 24);
14528 }
14529 Ok(())
14530 }
14531 }
14532
14533 impl fidl::encoding::ValueTypeMarker for UsageGainListenerOnGainMuteChangedRequest {
14534 type Borrowed<'a> = &'a Self;
14535 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
14536 value
14537 }
14538 }
14539
14540 unsafe impl fidl::encoding::TypeMarker for UsageGainListenerOnGainMuteChangedRequest {
14541 type Owned = Self;
14542
14543 #[inline(always)]
14544 fn inline_align(_context: fidl::encoding::Context) -> usize {
14545 4
14546 }
14547
14548 #[inline(always)]
14549 fn inline_size(_context: fidl::encoding::Context) -> usize {
14550 8
14551 }
14552 }
14553
14554 unsafe impl<D: fidl::encoding::ResourceDialect>
14555 fidl::encoding::Encode<UsageGainListenerOnGainMuteChangedRequest, D>
14556 for &UsageGainListenerOnGainMuteChangedRequest
14557 {
14558 #[inline]
14559 unsafe fn encode(
14560 self,
14561 encoder: &mut fidl::encoding::Encoder<'_, D>,
14562 offset: usize,
14563 _depth: fidl::encoding::Depth,
14564 ) -> fidl::Result<()> {
14565 encoder.debug_check_bounds::<UsageGainListenerOnGainMuteChangedRequest>(offset);
14566 fidl::encoding::Encode::<UsageGainListenerOnGainMuteChangedRequest, D>::encode(
14568 (
14569 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.muted),
14570 <f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.gain_dbfs),
14571 ),
14572 encoder,
14573 offset,
14574 _depth,
14575 )
14576 }
14577 }
14578 unsafe impl<
14579 D: fidl::encoding::ResourceDialect,
14580 T0: fidl::encoding::Encode<bool, D>,
14581 T1: fidl::encoding::Encode<f32, D>,
14582 > fidl::encoding::Encode<UsageGainListenerOnGainMuteChangedRequest, D> for (T0, T1)
14583 {
14584 #[inline]
14585 unsafe fn encode(
14586 self,
14587 encoder: &mut fidl::encoding::Encoder<'_, D>,
14588 offset: usize,
14589 depth: fidl::encoding::Depth,
14590 ) -> fidl::Result<()> {
14591 encoder.debug_check_bounds::<UsageGainListenerOnGainMuteChangedRequest>(offset);
14592 unsafe {
14595 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
14596 (ptr as *mut u32).write_unaligned(0);
14597 }
14598 self.0.encode(encoder, offset + 0, depth)?;
14600 self.1.encode(encoder, offset + 4, depth)?;
14601 Ok(())
14602 }
14603 }
14604
14605 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
14606 for UsageGainListenerOnGainMuteChangedRequest
14607 {
14608 #[inline(always)]
14609 fn new_empty() -> Self {
14610 Self { muted: fidl::new_empty!(bool, D), gain_dbfs: fidl::new_empty!(f32, D) }
14611 }
14612
14613 #[inline]
14614 unsafe fn decode(
14615 &mut self,
14616 decoder: &mut fidl::encoding::Decoder<'_, D>,
14617 offset: usize,
14618 _depth: fidl::encoding::Depth,
14619 ) -> fidl::Result<()> {
14620 decoder.debug_check_bounds::<Self>(offset);
14621 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
14623 let padval = unsafe { (ptr as *const u32).read_unaligned() };
14624 let mask = 0xffffff00u32;
14625 let maskedval = padval & mask;
14626 if maskedval != 0 {
14627 return Err(fidl::Error::NonZeroPadding {
14628 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
14629 });
14630 }
14631 fidl::decode!(bool, D, &mut self.muted, decoder, offset + 0, _depth)?;
14632 fidl::decode!(f32, D, &mut self.gain_dbfs, decoder, offset + 4, _depth)?;
14633 Ok(())
14634 }
14635 }
14636
14637 impl fidl::encoding::ValueTypeMarker for UsageWatcher2OnStateChangedRequest {
14638 type Borrowed<'a> = &'a Self;
14639 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
14640 value
14641 }
14642 }
14643
14644 unsafe impl fidl::encoding::TypeMarker for UsageWatcher2OnStateChangedRequest {
14645 type Owned = Self;
14646
14647 #[inline(always)]
14648 fn inline_align(_context: fidl::encoding::Context) -> usize {
14649 8
14650 }
14651
14652 #[inline(always)]
14653 fn inline_size(_context: fidl::encoding::Context) -> usize {
14654 32
14655 }
14656 }
14657
14658 unsafe impl<D: fidl::encoding::ResourceDialect>
14659 fidl::encoding::Encode<UsageWatcher2OnStateChangedRequest, D>
14660 for &UsageWatcher2OnStateChangedRequest
14661 {
14662 #[inline]
14663 unsafe fn encode(
14664 self,
14665 encoder: &mut fidl::encoding::Encoder<'_, D>,
14666 offset: usize,
14667 _depth: fidl::encoding::Depth,
14668 ) -> fidl::Result<()> {
14669 encoder.debug_check_bounds::<UsageWatcher2OnStateChangedRequest>(offset);
14670 fidl::encoding::Encode::<UsageWatcher2OnStateChangedRequest, D>::encode(
14672 (
14673 <Usage2 as fidl::encoding::ValueTypeMarker>::borrow(&self.usage),
14674 <UsageState as fidl::encoding::ValueTypeMarker>::borrow(&self.state),
14675 ),
14676 encoder,
14677 offset,
14678 _depth,
14679 )
14680 }
14681 }
14682 unsafe impl<
14683 D: fidl::encoding::ResourceDialect,
14684 T0: fidl::encoding::Encode<Usage2, D>,
14685 T1: fidl::encoding::Encode<UsageState, D>,
14686 > fidl::encoding::Encode<UsageWatcher2OnStateChangedRequest, D> for (T0, T1)
14687 {
14688 #[inline]
14689 unsafe fn encode(
14690 self,
14691 encoder: &mut fidl::encoding::Encoder<'_, D>,
14692 offset: usize,
14693 depth: fidl::encoding::Depth,
14694 ) -> fidl::Result<()> {
14695 encoder.debug_check_bounds::<UsageWatcher2OnStateChangedRequest>(offset);
14696 self.0.encode(encoder, offset + 0, depth)?;
14700 self.1.encode(encoder, offset + 16, depth)?;
14701 Ok(())
14702 }
14703 }
14704
14705 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
14706 for UsageWatcher2OnStateChangedRequest
14707 {
14708 #[inline(always)]
14709 fn new_empty() -> Self {
14710 Self { usage: fidl::new_empty!(Usage2, D), state: fidl::new_empty!(UsageState, D) }
14711 }
14712
14713 #[inline]
14714 unsafe fn decode(
14715 &mut self,
14716 decoder: &mut fidl::encoding::Decoder<'_, D>,
14717 offset: usize,
14718 _depth: fidl::encoding::Depth,
14719 ) -> fidl::Result<()> {
14720 decoder.debug_check_bounds::<Self>(offset);
14721 fidl::decode!(Usage2, D, &mut self.usage, decoder, offset + 0, _depth)?;
14723 fidl::decode!(UsageState, D, &mut self.state, decoder, offset + 16, _depth)?;
14724 Ok(())
14725 }
14726 }
14727
14728 impl fidl::encoding::ValueTypeMarker for UsageWatcherOnStateChangedRequest {
14729 type Borrowed<'a> = &'a Self;
14730 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
14731 value
14732 }
14733 }
14734
14735 unsafe impl fidl::encoding::TypeMarker for UsageWatcherOnStateChangedRequest {
14736 type Owned = Self;
14737
14738 #[inline(always)]
14739 fn inline_align(_context: fidl::encoding::Context) -> usize {
14740 8
14741 }
14742
14743 #[inline(always)]
14744 fn inline_size(_context: fidl::encoding::Context) -> usize {
14745 32
14746 }
14747 }
14748
14749 unsafe impl<D: fidl::encoding::ResourceDialect>
14750 fidl::encoding::Encode<UsageWatcherOnStateChangedRequest, D>
14751 for &UsageWatcherOnStateChangedRequest
14752 {
14753 #[inline]
14754 unsafe fn encode(
14755 self,
14756 encoder: &mut fidl::encoding::Encoder<'_, D>,
14757 offset: usize,
14758 _depth: fidl::encoding::Depth,
14759 ) -> fidl::Result<()> {
14760 encoder.debug_check_bounds::<UsageWatcherOnStateChangedRequest>(offset);
14761 fidl::encoding::Encode::<UsageWatcherOnStateChangedRequest, D>::encode(
14763 (
14764 <Usage as fidl::encoding::ValueTypeMarker>::borrow(&self.usage),
14765 <UsageState as fidl::encoding::ValueTypeMarker>::borrow(&self.state),
14766 ),
14767 encoder,
14768 offset,
14769 _depth,
14770 )
14771 }
14772 }
14773 unsafe impl<
14774 D: fidl::encoding::ResourceDialect,
14775 T0: fidl::encoding::Encode<Usage, D>,
14776 T1: fidl::encoding::Encode<UsageState, D>,
14777 > fidl::encoding::Encode<UsageWatcherOnStateChangedRequest, D> for (T0, T1)
14778 {
14779 #[inline]
14780 unsafe fn encode(
14781 self,
14782 encoder: &mut fidl::encoding::Encoder<'_, D>,
14783 offset: usize,
14784 depth: fidl::encoding::Depth,
14785 ) -> fidl::Result<()> {
14786 encoder.debug_check_bounds::<UsageWatcherOnStateChangedRequest>(offset);
14787 self.0.encode(encoder, offset + 0, depth)?;
14791 self.1.encode(encoder, offset + 16, depth)?;
14792 Ok(())
14793 }
14794 }
14795
14796 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
14797 for UsageWatcherOnStateChangedRequest
14798 {
14799 #[inline(always)]
14800 fn new_empty() -> Self {
14801 Self { usage: fidl::new_empty!(Usage, D), state: fidl::new_empty!(UsageState, D) }
14802 }
14803
14804 #[inline]
14805 unsafe fn decode(
14806 &mut self,
14807 decoder: &mut fidl::encoding::Decoder<'_, D>,
14808 offset: usize,
14809 _depth: fidl::encoding::Depth,
14810 ) -> fidl::Result<()> {
14811 decoder.debug_check_bounds::<Self>(offset);
14812 fidl::decode!(Usage, D, &mut self.usage, decoder, offset + 0, _depth)?;
14814 fidl::decode!(UsageState, D, &mut self.state, decoder, offset + 16, _depth)?;
14815 Ok(())
14816 }
14817 }
14818
14819 impl fidl::encoding::ValueTypeMarker for VideoStreamType {
14820 type Borrowed<'a> = &'a Self;
14821 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
14822 value
14823 }
14824 }
14825
14826 unsafe impl fidl::encoding::TypeMarker for VideoStreamType {
14827 type Owned = Self;
14828
14829 #[inline(always)]
14830 fn inline_align(_context: fidl::encoding::Context) -> usize {
14831 4
14832 }
14833
14834 #[inline(always)]
14835 fn inline_size(_context: fidl::encoding::Context) -> usize {
14836 36
14837 }
14838 }
14839
14840 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<VideoStreamType, D>
14841 for &VideoStreamType
14842 {
14843 #[inline]
14844 unsafe fn encode(
14845 self,
14846 encoder: &mut fidl::encoding::Encoder<'_, D>,
14847 offset: usize,
14848 _depth: fidl::encoding::Depth,
14849 ) -> fidl::Result<()> {
14850 encoder.debug_check_bounds::<VideoStreamType>(offset);
14851 fidl::encoding::Encode::<VideoStreamType, D>::encode(
14853 (
14854 <fidl_fuchsia_images_common::PixelFormat as fidl::encoding::ValueTypeMarker>::borrow(&self.pixel_format),
14855 <ColorSpace as fidl::encoding::ValueTypeMarker>::borrow(&self.color_space),
14856 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.width),
14857 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.height),
14858 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.coded_width),
14859 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.coded_height),
14860 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.pixel_aspect_ratio_width),
14861 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.pixel_aspect_ratio_height),
14862 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.stride),
14863 ),
14864 encoder, offset, _depth
14865 )
14866 }
14867 }
14868 unsafe impl<
14869 D: fidl::encoding::ResourceDialect,
14870 T0: fidl::encoding::Encode<fidl_fuchsia_images_common::PixelFormat, D>,
14871 T1: fidl::encoding::Encode<ColorSpace, D>,
14872 T2: fidl::encoding::Encode<u32, D>,
14873 T3: fidl::encoding::Encode<u32, D>,
14874 T4: fidl::encoding::Encode<u32, D>,
14875 T5: fidl::encoding::Encode<u32, D>,
14876 T6: fidl::encoding::Encode<u32, D>,
14877 T7: fidl::encoding::Encode<u32, D>,
14878 T8: fidl::encoding::Encode<u32, D>,
14879 > fidl::encoding::Encode<VideoStreamType, D> for (T0, T1, T2, T3, T4, T5, T6, T7, T8)
14880 {
14881 #[inline]
14882 unsafe fn encode(
14883 self,
14884 encoder: &mut fidl::encoding::Encoder<'_, D>,
14885 offset: usize,
14886 depth: fidl::encoding::Depth,
14887 ) -> fidl::Result<()> {
14888 encoder.debug_check_bounds::<VideoStreamType>(offset);
14889 self.0.encode(encoder, offset + 0, depth)?;
14893 self.1.encode(encoder, offset + 4, depth)?;
14894 self.2.encode(encoder, offset + 8, depth)?;
14895 self.3.encode(encoder, offset + 12, depth)?;
14896 self.4.encode(encoder, offset + 16, depth)?;
14897 self.5.encode(encoder, offset + 20, depth)?;
14898 self.6.encode(encoder, offset + 24, depth)?;
14899 self.7.encode(encoder, offset + 28, depth)?;
14900 self.8.encode(encoder, offset + 32, depth)?;
14901 Ok(())
14902 }
14903 }
14904
14905 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for VideoStreamType {
14906 #[inline(always)]
14907 fn new_empty() -> Self {
14908 Self {
14909 pixel_format: fidl::new_empty!(fidl_fuchsia_images_common::PixelFormat, D),
14910 color_space: fidl::new_empty!(ColorSpace, D),
14911 width: fidl::new_empty!(u32, D),
14912 height: fidl::new_empty!(u32, D),
14913 coded_width: fidl::new_empty!(u32, D),
14914 coded_height: fidl::new_empty!(u32, D),
14915 pixel_aspect_ratio_width: fidl::new_empty!(u32, D),
14916 pixel_aspect_ratio_height: fidl::new_empty!(u32, D),
14917 stride: fidl::new_empty!(u32, D),
14918 }
14919 }
14920
14921 #[inline]
14922 unsafe fn decode(
14923 &mut self,
14924 decoder: &mut fidl::encoding::Decoder<'_, D>,
14925 offset: usize,
14926 _depth: fidl::encoding::Depth,
14927 ) -> fidl::Result<()> {
14928 decoder.debug_check_bounds::<Self>(offset);
14929 fidl::decode!(
14931 fidl_fuchsia_images_common::PixelFormat,
14932 D,
14933 &mut self.pixel_format,
14934 decoder,
14935 offset + 0,
14936 _depth
14937 )?;
14938 fidl::decode!(ColorSpace, D, &mut self.color_space, decoder, offset + 4, _depth)?;
14939 fidl::decode!(u32, D, &mut self.width, decoder, offset + 8, _depth)?;
14940 fidl::decode!(u32, D, &mut self.height, decoder, offset + 12, _depth)?;
14941 fidl::decode!(u32, D, &mut self.coded_width, decoder, offset + 16, _depth)?;
14942 fidl::decode!(u32, D, &mut self.coded_height, decoder, offset + 20, _depth)?;
14943 fidl::decode!(
14944 u32,
14945 D,
14946 &mut self.pixel_aspect_ratio_width,
14947 decoder,
14948 offset + 24,
14949 _depth
14950 )?;
14951 fidl::decode!(
14952 u32,
14953 D,
14954 &mut self.pixel_aspect_ratio_height,
14955 decoder,
14956 offset + 28,
14957 _depth
14958 )?;
14959 fidl::decode!(u32, D, &mut self.stride, decoder, offset + 32, _depth)?;
14960 Ok(())
14961 }
14962 }
14963
14964 impl fidl::encoding::ValueTypeMarker for VideoUncompressedFormat {
14965 type Borrowed<'a> = &'a Self;
14966 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
14967 value
14968 }
14969 }
14970
14971 unsafe impl fidl::encoding::TypeMarker for VideoUncompressedFormat {
14972 type Owned = Self;
14973
14974 #[inline(always)]
14975 fn inline_align(_context: fidl::encoding::Context) -> usize {
14976 8
14977 }
14978
14979 #[inline(always)]
14980 fn inline_size(_context: fidl::encoding::Context) -> usize {
14981 128
14982 }
14983 }
14984
14985 unsafe impl<D: fidl::encoding::ResourceDialect>
14986 fidl::encoding::Encode<VideoUncompressedFormat, D> for &VideoUncompressedFormat
14987 {
14988 #[inline]
14989 unsafe fn encode(
14990 self,
14991 encoder: &mut fidl::encoding::Encoder<'_, D>,
14992 offset: usize,
14993 _depth: fidl::encoding::Depth,
14994 ) -> fidl::Result<()> {
14995 encoder.debug_check_bounds::<VideoUncompressedFormat>(offset);
14996 fidl::encoding::Encode::<VideoUncompressedFormat, D>::encode(
14998 (
14999 <fidl_fuchsia_sysmem_common::ImageFormat2 as fidl::encoding::ValueTypeMarker>::borrow(&self.image_format),
15000 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.fourcc),
15001 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.primary_width_pixels),
15002 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.primary_height_pixels),
15003 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.secondary_width_pixels),
15004 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.secondary_height_pixels),
15005 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.planar),
15006 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.swizzled),
15007 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.primary_line_stride_bytes),
15008 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.secondary_line_stride_bytes),
15009 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.primary_start_offset),
15010 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.secondary_start_offset),
15011 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.tertiary_start_offset),
15012 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.primary_pixel_stride),
15013 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.secondary_pixel_stride),
15014 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.primary_display_width_pixels),
15015 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.primary_display_height_pixels),
15016 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.has_pixel_aspect_ratio),
15017 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.pixel_aspect_ratio_width),
15018 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.pixel_aspect_ratio_height),
15019 ),
15020 encoder, offset, _depth
15021 )
15022 }
15023 }
15024 unsafe impl<
15025 D: fidl::encoding::ResourceDialect,
15026 T0: fidl::encoding::Encode<fidl_fuchsia_sysmem_common::ImageFormat2, D>,
15027 T1: fidl::encoding::Encode<u32, D>,
15028 T2: fidl::encoding::Encode<u32, D>,
15029 T3: fidl::encoding::Encode<u32, D>,
15030 T4: fidl::encoding::Encode<u32, D>,
15031 T5: fidl::encoding::Encode<u32, D>,
15032 T6: fidl::encoding::Encode<bool, D>,
15033 T7: fidl::encoding::Encode<bool, D>,
15034 T8: fidl::encoding::Encode<u32, D>,
15035 T9: fidl::encoding::Encode<u32, D>,
15036 T10: fidl::encoding::Encode<u32, D>,
15037 T11: fidl::encoding::Encode<u32, D>,
15038 T12: fidl::encoding::Encode<u32, D>,
15039 T13: fidl::encoding::Encode<u32, D>,
15040 T14: fidl::encoding::Encode<u32, D>,
15041 T15: fidl::encoding::Encode<u32, D>,
15042 T16: fidl::encoding::Encode<u32, D>,
15043 T17: fidl::encoding::Encode<bool, D>,
15044 T18: fidl::encoding::Encode<u32, D>,
15045 T19: fidl::encoding::Encode<u32, D>,
15046 > fidl::encoding::Encode<VideoUncompressedFormat, D>
15047 for (
15048 T0,
15049 T1,
15050 T2,
15051 T3,
15052 T4,
15053 T5,
15054 T6,
15055 T7,
15056 T8,
15057 T9,
15058 T10,
15059 T11,
15060 T12,
15061 T13,
15062 T14,
15063 T15,
15064 T16,
15065 T17,
15066 T18,
15067 T19,
15068 )
15069 {
15070 #[inline]
15071 unsafe fn encode(
15072 self,
15073 encoder: &mut fidl::encoding::Encoder<'_, D>,
15074 offset: usize,
15075 depth: fidl::encoding::Depth,
15076 ) -> fidl::Result<()> {
15077 encoder.debug_check_bounds::<VideoUncompressedFormat>(offset);
15078 unsafe {
15081 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(72);
15082 (ptr as *mut u64).write_unaligned(0);
15083 }
15084 unsafe {
15085 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(112);
15086 (ptr as *mut u64).write_unaligned(0);
15087 }
15088 self.0.encode(encoder, offset + 0, depth)?;
15090 self.1.encode(encoder, offset + 56, depth)?;
15091 self.2.encode(encoder, offset + 60, depth)?;
15092 self.3.encode(encoder, offset + 64, depth)?;
15093 self.4.encode(encoder, offset + 68, depth)?;
15094 self.5.encode(encoder, offset + 72, depth)?;
15095 self.6.encode(encoder, offset + 76, depth)?;
15096 self.7.encode(encoder, offset + 77, depth)?;
15097 self.8.encode(encoder, offset + 80, depth)?;
15098 self.9.encode(encoder, offset + 84, depth)?;
15099 self.10.encode(encoder, offset + 88, depth)?;
15100 self.11.encode(encoder, offset + 92, depth)?;
15101 self.12.encode(encoder, offset + 96, depth)?;
15102 self.13.encode(encoder, offset + 100, depth)?;
15103 self.14.encode(encoder, offset + 104, depth)?;
15104 self.15.encode(encoder, offset + 108, depth)?;
15105 self.16.encode(encoder, offset + 112, depth)?;
15106 self.17.encode(encoder, offset + 116, depth)?;
15107 self.18.encode(encoder, offset + 120, depth)?;
15108 self.19.encode(encoder, offset + 124, depth)?;
15109 Ok(())
15110 }
15111 }
15112
15113 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
15114 for VideoUncompressedFormat
15115 {
15116 #[inline(always)]
15117 fn new_empty() -> Self {
15118 Self {
15119 image_format: fidl::new_empty!(fidl_fuchsia_sysmem_common::ImageFormat2, D),
15120 fourcc: fidl::new_empty!(u32, D),
15121 primary_width_pixels: fidl::new_empty!(u32, D),
15122 primary_height_pixels: fidl::new_empty!(u32, D),
15123 secondary_width_pixels: fidl::new_empty!(u32, D),
15124 secondary_height_pixels: fidl::new_empty!(u32, D),
15125 planar: fidl::new_empty!(bool, D),
15126 swizzled: fidl::new_empty!(bool, D),
15127 primary_line_stride_bytes: fidl::new_empty!(u32, D),
15128 secondary_line_stride_bytes: fidl::new_empty!(u32, D),
15129 primary_start_offset: fidl::new_empty!(u32, D),
15130 secondary_start_offset: fidl::new_empty!(u32, D),
15131 tertiary_start_offset: fidl::new_empty!(u32, D),
15132 primary_pixel_stride: fidl::new_empty!(u32, D),
15133 secondary_pixel_stride: fidl::new_empty!(u32, D),
15134 primary_display_width_pixels: fidl::new_empty!(u32, D),
15135 primary_display_height_pixels: fidl::new_empty!(u32, D),
15136 has_pixel_aspect_ratio: fidl::new_empty!(bool, D),
15137 pixel_aspect_ratio_width: fidl::new_empty!(u32, D),
15138 pixel_aspect_ratio_height: fidl::new_empty!(u32, D),
15139 }
15140 }
15141
15142 #[inline]
15143 unsafe fn decode(
15144 &mut self,
15145 decoder: &mut fidl::encoding::Decoder<'_, D>,
15146 offset: usize,
15147 _depth: fidl::encoding::Depth,
15148 ) -> fidl::Result<()> {
15149 decoder.debug_check_bounds::<Self>(offset);
15150 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(72) };
15152 let padval = unsafe { (ptr as *const u64).read_unaligned() };
15153 let mask = 0xffff000000000000u64;
15154 let maskedval = padval & mask;
15155 if maskedval != 0 {
15156 return Err(fidl::Error::NonZeroPadding {
15157 padding_start: offset + 72 + ((mask as u64).trailing_zeros() / 8) as usize,
15158 });
15159 }
15160 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(112) };
15161 let padval = unsafe { (ptr as *const u64).read_unaligned() };
15162 let mask = 0xffffff0000000000u64;
15163 let maskedval = padval & mask;
15164 if maskedval != 0 {
15165 return Err(fidl::Error::NonZeroPadding {
15166 padding_start: offset + 112 + ((mask as u64).trailing_zeros() / 8) as usize,
15167 });
15168 }
15169 fidl::decode!(
15170 fidl_fuchsia_sysmem_common::ImageFormat2,
15171 D,
15172 &mut self.image_format,
15173 decoder,
15174 offset + 0,
15175 _depth
15176 )?;
15177 fidl::decode!(u32, D, &mut self.fourcc, decoder, offset + 56, _depth)?;
15178 fidl::decode!(u32, D, &mut self.primary_width_pixels, decoder, offset + 60, _depth)?;
15179 fidl::decode!(u32, D, &mut self.primary_height_pixels, decoder, offset + 64, _depth)?;
15180 fidl::decode!(u32, D, &mut self.secondary_width_pixels, decoder, offset + 68, _depth)?;
15181 fidl::decode!(u32, D, &mut self.secondary_height_pixels, decoder, offset + 72, _depth)?;
15182 fidl::decode!(bool, D, &mut self.planar, decoder, offset + 76, _depth)?;
15183 fidl::decode!(bool, D, &mut self.swizzled, decoder, offset + 77, _depth)?;
15184 fidl::decode!(
15185 u32,
15186 D,
15187 &mut self.primary_line_stride_bytes,
15188 decoder,
15189 offset + 80,
15190 _depth
15191 )?;
15192 fidl::decode!(
15193 u32,
15194 D,
15195 &mut self.secondary_line_stride_bytes,
15196 decoder,
15197 offset + 84,
15198 _depth
15199 )?;
15200 fidl::decode!(u32, D, &mut self.primary_start_offset, decoder, offset + 88, _depth)?;
15201 fidl::decode!(u32, D, &mut self.secondary_start_offset, decoder, offset + 92, _depth)?;
15202 fidl::decode!(u32, D, &mut self.tertiary_start_offset, decoder, offset + 96, _depth)?;
15203 fidl::decode!(u32, D, &mut self.primary_pixel_stride, decoder, offset + 100, _depth)?;
15204 fidl::decode!(u32, D, &mut self.secondary_pixel_stride, decoder, offset + 104, _depth)?;
15205 fidl::decode!(
15206 u32,
15207 D,
15208 &mut self.primary_display_width_pixels,
15209 decoder,
15210 offset + 108,
15211 _depth
15212 )?;
15213 fidl::decode!(
15214 u32,
15215 D,
15216 &mut self.primary_display_height_pixels,
15217 decoder,
15218 offset + 112,
15219 _depth
15220 )?;
15221 fidl::decode!(
15222 bool,
15223 D,
15224 &mut self.has_pixel_aspect_ratio,
15225 decoder,
15226 offset + 116,
15227 _depth
15228 )?;
15229 fidl::decode!(
15230 u32,
15231 D,
15232 &mut self.pixel_aspect_ratio_width,
15233 decoder,
15234 offset + 120,
15235 _depth
15236 )?;
15237 fidl::decode!(
15238 u32,
15239 D,
15240 &mut self.pixel_aspect_ratio_height,
15241 decoder,
15242 offset + 124,
15243 _depth
15244 )?;
15245 Ok(())
15246 }
15247 }
15248
15249 impl fidl::encoding::ValueTypeMarker for Void {
15250 type Borrowed<'a> = &'a Self;
15251 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
15252 value
15253 }
15254 }
15255
15256 unsafe impl fidl::encoding::TypeMarker for Void {
15257 type Owned = Self;
15258
15259 #[inline(always)]
15260 fn inline_align(_context: fidl::encoding::Context) -> usize {
15261 1
15262 }
15263
15264 #[inline(always)]
15265 fn inline_size(_context: fidl::encoding::Context) -> usize {
15266 1
15267 }
15268 }
15269
15270 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Void, D> for &Void {
15271 #[inline]
15272 unsafe fn encode(
15273 self,
15274 encoder: &mut fidl::encoding::Encoder<'_, D>,
15275 offset: usize,
15276 _depth: fidl::encoding::Depth,
15277 ) -> fidl::Result<()> {
15278 encoder.debug_check_bounds::<Void>(offset);
15279 encoder.write_num(0u8, offset);
15280 Ok(())
15281 }
15282 }
15283
15284 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Void {
15285 #[inline(always)]
15286 fn new_empty() -> Self {
15287 Self
15288 }
15289
15290 #[inline]
15291 unsafe fn decode(
15292 &mut self,
15293 decoder: &mut fidl::encoding::Decoder<'_, D>,
15294 offset: usize,
15295 _depth: fidl::encoding::Depth,
15296 ) -> fidl::Result<()> {
15297 decoder.debug_check_bounds::<Self>(offset);
15298 match decoder.read_num::<u8>(offset) {
15299 0 => Ok(()),
15300 _ => Err(fidl::Error::Invalid),
15301 }
15302 }
15303 }
15304
15305 impl AudioCompressedFormatCvsd {
15306 #[inline(always)]
15307 fn max_ordinal_present(&self) -> u64 {
15308 0
15309 }
15310 }
15311
15312 impl fidl::encoding::ValueTypeMarker for AudioCompressedFormatCvsd {
15313 type Borrowed<'a> = &'a Self;
15314 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
15315 value
15316 }
15317 }
15318
15319 unsafe impl fidl::encoding::TypeMarker for AudioCompressedFormatCvsd {
15320 type Owned = Self;
15321
15322 #[inline(always)]
15323 fn inline_align(_context: fidl::encoding::Context) -> usize {
15324 8
15325 }
15326
15327 #[inline(always)]
15328 fn inline_size(_context: fidl::encoding::Context) -> usize {
15329 16
15330 }
15331 }
15332
15333 unsafe impl<D: fidl::encoding::ResourceDialect>
15334 fidl::encoding::Encode<AudioCompressedFormatCvsd, D> for &AudioCompressedFormatCvsd
15335 {
15336 unsafe fn encode(
15337 self,
15338 encoder: &mut fidl::encoding::Encoder<'_, D>,
15339 offset: usize,
15340 mut depth: fidl::encoding::Depth,
15341 ) -> fidl::Result<()> {
15342 encoder.debug_check_bounds::<AudioCompressedFormatCvsd>(offset);
15343 let max_ordinal: u64 = self.max_ordinal_present();
15345 encoder.write_num(max_ordinal, offset);
15346 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
15347 if max_ordinal == 0 {
15349 return Ok(());
15350 }
15351 depth.increment()?;
15352 let envelope_size = 8;
15353 let bytes_len = max_ordinal as usize * envelope_size;
15354 #[allow(unused_variables)]
15355 let offset = encoder.out_of_line_offset(bytes_len);
15356 let mut _prev_end_offset: usize = 0;
15357
15358 Ok(())
15359 }
15360 }
15361
15362 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
15363 for AudioCompressedFormatCvsd
15364 {
15365 #[inline(always)]
15366 fn new_empty() -> Self {
15367 Self::default()
15368 }
15369
15370 unsafe fn decode(
15371 &mut self,
15372 decoder: &mut fidl::encoding::Decoder<'_, D>,
15373 offset: usize,
15374 mut depth: fidl::encoding::Depth,
15375 ) -> fidl::Result<()> {
15376 decoder.debug_check_bounds::<Self>(offset);
15377 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
15378 None => return Err(fidl::Error::NotNullable),
15379 Some(len) => len,
15380 };
15381 if len == 0 {
15383 return Ok(());
15384 };
15385 depth.increment()?;
15386 let envelope_size = 8;
15387 let bytes_len = len * envelope_size;
15388 let offset = decoder.out_of_line_offset(bytes_len)?;
15389 let mut _next_ordinal_to_read = 0;
15391 let mut next_offset = offset;
15392 let end_offset = offset + bytes_len;
15393
15394 while next_offset < end_offset {
15396 _next_ordinal_to_read += 1;
15397 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15398 next_offset += envelope_size;
15399 }
15400
15401 Ok(())
15402 }
15403 }
15404
15405 impl AudioCompressedFormatLc3 {
15406 #[inline(always)]
15407 fn max_ordinal_present(&self) -> u64 {
15408 0
15409 }
15410 }
15411
15412 impl fidl::encoding::ValueTypeMarker for AudioCompressedFormatLc3 {
15413 type Borrowed<'a> = &'a Self;
15414 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
15415 value
15416 }
15417 }
15418
15419 unsafe impl fidl::encoding::TypeMarker for AudioCompressedFormatLc3 {
15420 type Owned = Self;
15421
15422 #[inline(always)]
15423 fn inline_align(_context: fidl::encoding::Context) -> usize {
15424 8
15425 }
15426
15427 #[inline(always)]
15428 fn inline_size(_context: fidl::encoding::Context) -> usize {
15429 16
15430 }
15431 }
15432
15433 unsafe impl<D: fidl::encoding::ResourceDialect>
15434 fidl::encoding::Encode<AudioCompressedFormatLc3, D> for &AudioCompressedFormatLc3
15435 {
15436 unsafe fn encode(
15437 self,
15438 encoder: &mut fidl::encoding::Encoder<'_, D>,
15439 offset: usize,
15440 mut depth: fidl::encoding::Depth,
15441 ) -> fidl::Result<()> {
15442 encoder.debug_check_bounds::<AudioCompressedFormatLc3>(offset);
15443 let max_ordinal: u64 = self.max_ordinal_present();
15445 encoder.write_num(max_ordinal, offset);
15446 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
15447 if max_ordinal == 0 {
15449 return Ok(());
15450 }
15451 depth.increment()?;
15452 let envelope_size = 8;
15453 let bytes_len = max_ordinal as usize * envelope_size;
15454 #[allow(unused_variables)]
15455 let offset = encoder.out_of_line_offset(bytes_len);
15456 let mut _prev_end_offset: usize = 0;
15457
15458 Ok(())
15459 }
15460 }
15461
15462 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
15463 for AudioCompressedFormatLc3
15464 {
15465 #[inline(always)]
15466 fn new_empty() -> Self {
15467 Self::default()
15468 }
15469
15470 unsafe fn decode(
15471 &mut self,
15472 decoder: &mut fidl::encoding::Decoder<'_, D>,
15473 offset: usize,
15474 mut depth: fidl::encoding::Depth,
15475 ) -> fidl::Result<()> {
15476 decoder.debug_check_bounds::<Self>(offset);
15477 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
15478 None => return Err(fidl::Error::NotNullable),
15479 Some(len) => len,
15480 };
15481 if len == 0 {
15483 return Ok(());
15484 };
15485 depth.increment()?;
15486 let envelope_size = 8;
15487 let bytes_len = len * envelope_size;
15488 let offset = decoder.out_of_line_offset(bytes_len)?;
15489 let mut _next_ordinal_to_read = 0;
15491 let mut next_offset = offset;
15492 let end_offset = offset + bytes_len;
15493
15494 while next_offset < end_offset {
15496 _next_ordinal_to_read += 1;
15497 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15498 next_offset += envelope_size;
15499 }
15500
15501 Ok(())
15502 }
15503 }
15504
15505 impl AudioConsumerStatus {
15506 #[inline(always)]
15507 fn max_ordinal_present(&self) -> u64 {
15508 if let Some(_) = self.max_lead_time {
15509 return 4;
15510 }
15511 if let Some(_) = self.min_lead_time {
15512 return 3;
15513 }
15514 if let Some(_) = self.presentation_timeline {
15515 return 2;
15516 }
15517 if let Some(_) = self.error {
15518 return 1;
15519 }
15520 0
15521 }
15522 }
15523
15524 impl fidl::encoding::ValueTypeMarker for AudioConsumerStatus {
15525 type Borrowed<'a> = &'a Self;
15526 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
15527 value
15528 }
15529 }
15530
15531 unsafe impl fidl::encoding::TypeMarker for AudioConsumerStatus {
15532 type Owned = Self;
15533
15534 #[inline(always)]
15535 fn inline_align(_context: fidl::encoding::Context) -> usize {
15536 8
15537 }
15538
15539 #[inline(always)]
15540 fn inline_size(_context: fidl::encoding::Context) -> usize {
15541 16
15542 }
15543 }
15544
15545 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AudioConsumerStatus, D>
15546 for &AudioConsumerStatus
15547 {
15548 unsafe fn encode(
15549 self,
15550 encoder: &mut fidl::encoding::Encoder<'_, D>,
15551 offset: usize,
15552 mut depth: fidl::encoding::Depth,
15553 ) -> fidl::Result<()> {
15554 encoder.debug_check_bounds::<AudioConsumerStatus>(offset);
15555 let max_ordinal: u64 = self.max_ordinal_present();
15557 encoder.write_num(max_ordinal, offset);
15558 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
15559 if max_ordinal == 0 {
15561 return Ok(());
15562 }
15563 depth.increment()?;
15564 let envelope_size = 8;
15565 let bytes_len = max_ordinal as usize * envelope_size;
15566 #[allow(unused_variables)]
15567 let offset = encoder.out_of_line_offset(bytes_len);
15568 let mut _prev_end_offset: usize = 0;
15569 if 1 > max_ordinal {
15570 return Ok(());
15571 }
15572
15573 let cur_offset: usize = (1 - 1) * envelope_size;
15576
15577 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15579
15580 fidl::encoding::encode_in_envelope_optional::<AudioConsumerError, D>(
15585 self.error
15586 .as_ref()
15587 .map(<AudioConsumerError as fidl::encoding::ValueTypeMarker>::borrow),
15588 encoder,
15589 offset + cur_offset,
15590 depth,
15591 )?;
15592
15593 _prev_end_offset = cur_offset + envelope_size;
15594 if 2 > max_ordinal {
15595 return Ok(());
15596 }
15597
15598 let cur_offset: usize = (2 - 1) * envelope_size;
15601
15602 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15604
15605 fidl::encoding::encode_in_envelope_optional::<TimelineFunction, D>(
15610 self.presentation_timeline
15611 .as_ref()
15612 .map(<TimelineFunction as fidl::encoding::ValueTypeMarker>::borrow),
15613 encoder,
15614 offset + cur_offset,
15615 depth,
15616 )?;
15617
15618 _prev_end_offset = cur_offset + envelope_size;
15619 if 3 > max_ordinal {
15620 return Ok(());
15621 }
15622
15623 let cur_offset: usize = (3 - 1) * envelope_size;
15626
15627 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15629
15630 fidl::encoding::encode_in_envelope_optional::<u64, D>(
15635 self.min_lead_time.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
15636 encoder,
15637 offset + cur_offset,
15638 depth,
15639 )?;
15640
15641 _prev_end_offset = cur_offset + envelope_size;
15642 if 4 > max_ordinal {
15643 return Ok(());
15644 }
15645
15646 let cur_offset: usize = (4 - 1) * envelope_size;
15649
15650 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15652
15653 fidl::encoding::encode_in_envelope_optional::<u64, D>(
15658 self.max_lead_time.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
15659 encoder,
15660 offset + cur_offset,
15661 depth,
15662 )?;
15663
15664 _prev_end_offset = cur_offset + envelope_size;
15665
15666 Ok(())
15667 }
15668 }
15669
15670 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AudioConsumerStatus {
15671 #[inline(always)]
15672 fn new_empty() -> Self {
15673 Self::default()
15674 }
15675
15676 unsafe fn decode(
15677 &mut self,
15678 decoder: &mut fidl::encoding::Decoder<'_, D>,
15679 offset: usize,
15680 mut depth: fidl::encoding::Depth,
15681 ) -> fidl::Result<()> {
15682 decoder.debug_check_bounds::<Self>(offset);
15683 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
15684 None => return Err(fidl::Error::NotNullable),
15685 Some(len) => len,
15686 };
15687 if len == 0 {
15689 return Ok(());
15690 };
15691 depth.increment()?;
15692 let envelope_size = 8;
15693 let bytes_len = len * envelope_size;
15694 let offset = decoder.out_of_line_offset(bytes_len)?;
15695 let mut _next_ordinal_to_read = 0;
15697 let mut next_offset = offset;
15698 let end_offset = offset + bytes_len;
15699 _next_ordinal_to_read += 1;
15700 if next_offset >= end_offset {
15701 return Ok(());
15702 }
15703
15704 while _next_ordinal_to_read < 1 {
15706 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15707 _next_ordinal_to_read += 1;
15708 next_offset += envelope_size;
15709 }
15710
15711 let next_out_of_line = decoder.next_out_of_line();
15712 let handles_before = decoder.remaining_handles();
15713 if let Some((inlined, num_bytes, num_handles)) =
15714 fidl::encoding::decode_envelope_header(decoder, next_offset)?
15715 {
15716 let member_inline_size =
15717 <AudioConsumerError as fidl::encoding::TypeMarker>::inline_size(
15718 decoder.context,
15719 );
15720 if inlined != (member_inline_size <= 4) {
15721 return Err(fidl::Error::InvalidInlineBitInEnvelope);
15722 }
15723 let inner_offset;
15724 let mut inner_depth = depth.clone();
15725 if inlined {
15726 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15727 inner_offset = next_offset;
15728 } else {
15729 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15730 inner_depth.increment()?;
15731 }
15732 let val_ref =
15733 self.error.get_or_insert_with(|| fidl::new_empty!(AudioConsumerError, D));
15734 fidl::decode!(AudioConsumerError, D, val_ref, decoder, inner_offset, inner_depth)?;
15735 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15736 {
15737 return Err(fidl::Error::InvalidNumBytesInEnvelope);
15738 }
15739 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15740 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15741 }
15742 }
15743
15744 next_offset += envelope_size;
15745 _next_ordinal_to_read += 1;
15746 if next_offset >= end_offset {
15747 return Ok(());
15748 }
15749
15750 while _next_ordinal_to_read < 2 {
15752 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15753 _next_ordinal_to_read += 1;
15754 next_offset += envelope_size;
15755 }
15756
15757 let next_out_of_line = decoder.next_out_of_line();
15758 let handles_before = decoder.remaining_handles();
15759 if let Some((inlined, num_bytes, num_handles)) =
15760 fidl::encoding::decode_envelope_header(decoder, next_offset)?
15761 {
15762 let member_inline_size =
15763 <TimelineFunction as fidl::encoding::TypeMarker>::inline_size(decoder.context);
15764 if inlined != (member_inline_size <= 4) {
15765 return Err(fidl::Error::InvalidInlineBitInEnvelope);
15766 }
15767 let inner_offset;
15768 let mut inner_depth = depth.clone();
15769 if inlined {
15770 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15771 inner_offset = next_offset;
15772 } else {
15773 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15774 inner_depth.increment()?;
15775 }
15776 let val_ref = self
15777 .presentation_timeline
15778 .get_or_insert_with(|| fidl::new_empty!(TimelineFunction, D));
15779 fidl::decode!(TimelineFunction, D, val_ref, decoder, inner_offset, inner_depth)?;
15780 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15781 {
15782 return Err(fidl::Error::InvalidNumBytesInEnvelope);
15783 }
15784 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15785 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15786 }
15787 }
15788
15789 next_offset += envelope_size;
15790 _next_ordinal_to_read += 1;
15791 if next_offset >= end_offset {
15792 return Ok(());
15793 }
15794
15795 while _next_ordinal_to_read < 3 {
15797 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15798 _next_ordinal_to_read += 1;
15799 next_offset += envelope_size;
15800 }
15801
15802 let next_out_of_line = decoder.next_out_of_line();
15803 let handles_before = decoder.remaining_handles();
15804 if let Some((inlined, num_bytes, num_handles)) =
15805 fidl::encoding::decode_envelope_header(decoder, next_offset)?
15806 {
15807 let member_inline_size =
15808 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
15809 if inlined != (member_inline_size <= 4) {
15810 return Err(fidl::Error::InvalidInlineBitInEnvelope);
15811 }
15812 let inner_offset;
15813 let mut inner_depth = depth.clone();
15814 if inlined {
15815 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15816 inner_offset = next_offset;
15817 } else {
15818 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15819 inner_depth.increment()?;
15820 }
15821 let val_ref = self.min_lead_time.get_or_insert_with(|| fidl::new_empty!(u64, D));
15822 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
15823 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15824 {
15825 return Err(fidl::Error::InvalidNumBytesInEnvelope);
15826 }
15827 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15828 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15829 }
15830 }
15831
15832 next_offset += envelope_size;
15833 _next_ordinal_to_read += 1;
15834 if next_offset >= end_offset {
15835 return Ok(());
15836 }
15837
15838 while _next_ordinal_to_read < 4 {
15840 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15841 _next_ordinal_to_read += 1;
15842 next_offset += envelope_size;
15843 }
15844
15845 let next_out_of_line = decoder.next_out_of_line();
15846 let handles_before = decoder.remaining_handles();
15847 if let Some((inlined, num_bytes, num_handles)) =
15848 fidl::encoding::decode_envelope_header(decoder, next_offset)?
15849 {
15850 let member_inline_size =
15851 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
15852 if inlined != (member_inline_size <= 4) {
15853 return Err(fidl::Error::InvalidInlineBitInEnvelope);
15854 }
15855 let inner_offset;
15856 let mut inner_depth = depth.clone();
15857 if inlined {
15858 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15859 inner_offset = next_offset;
15860 } else {
15861 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15862 inner_depth.increment()?;
15863 }
15864 let val_ref = self.max_lead_time.get_or_insert_with(|| fidl::new_empty!(u64, D));
15865 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
15866 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15867 {
15868 return Err(fidl::Error::InvalidNumBytesInEnvelope);
15869 }
15870 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15871 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15872 }
15873 }
15874
15875 next_offset += envelope_size;
15876
15877 while next_offset < end_offset {
15879 _next_ordinal_to_read += 1;
15880 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15881 next_offset += envelope_size;
15882 }
15883
15884 Ok(())
15885 }
15886 }
15887
15888 impl CvsdEncoderSettings {
15889 #[inline(always)]
15890 fn max_ordinal_present(&self) -> u64 {
15891 0
15892 }
15893 }
15894
15895 impl fidl::encoding::ValueTypeMarker for CvsdEncoderSettings {
15896 type Borrowed<'a> = &'a Self;
15897 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
15898 value
15899 }
15900 }
15901
15902 unsafe impl fidl::encoding::TypeMarker for CvsdEncoderSettings {
15903 type Owned = Self;
15904
15905 #[inline(always)]
15906 fn inline_align(_context: fidl::encoding::Context) -> usize {
15907 8
15908 }
15909
15910 #[inline(always)]
15911 fn inline_size(_context: fidl::encoding::Context) -> usize {
15912 16
15913 }
15914 }
15915
15916 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<CvsdEncoderSettings, D>
15917 for &CvsdEncoderSettings
15918 {
15919 unsafe fn encode(
15920 self,
15921 encoder: &mut fidl::encoding::Encoder<'_, D>,
15922 offset: usize,
15923 mut depth: fidl::encoding::Depth,
15924 ) -> fidl::Result<()> {
15925 encoder.debug_check_bounds::<CvsdEncoderSettings>(offset);
15926 let max_ordinal: u64 = self.max_ordinal_present();
15928 encoder.write_num(max_ordinal, offset);
15929 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
15930 if max_ordinal == 0 {
15932 return Ok(());
15933 }
15934 depth.increment()?;
15935 let envelope_size = 8;
15936 let bytes_len = max_ordinal as usize * envelope_size;
15937 #[allow(unused_variables)]
15938 let offset = encoder.out_of_line_offset(bytes_len);
15939 let mut _prev_end_offset: usize = 0;
15940
15941 Ok(())
15942 }
15943 }
15944
15945 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CvsdEncoderSettings {
15946 #[inline(always)]
15947 fn new_empty() -> Self {
15948 Self::default()
15949 }
15950
15951 unsafe fn decode(
15952 &mut self,
15953 decoder: &mut fidl::encoding::Decoder<'_, D>,
15954 offset: usize,
15955 mut depth: fidl::encoding::Depth,
15956 ) -> fidl::Result<()> {
15957 decoder.debug_check_bounds::<Self>(offset);
15958 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
15959 None => return Err(fidl::Error::NotNullable),
15960 Some(len) => len,
15961 };
15962 if len == 0 {
15964 return Ok(());
15965 };
15966 depth.increment()?;
15967 let envelope_size = 8;
15968 let bytes_len = len * envelope_size;
15969 let offset = decoder.out_of_line_offset(bytes_len)?;
15970 let mut _next_ordinal_to_read = 0;
15972 let mut next_offset = offset;
15973 let end_offset = offset + bytes_len;
15974
15975 while next_offset < end_offset {
15977 _next_ordinal_to_read += 1;
15978 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15979 next_offset += envelope_size;
15980 }
15981
15982 Ok(())
15983 }
15984 }
15985
15986 impl DecryptedFormat {
15987 #[inline(always)]
15988 fn max_ordinal_present(&self) -> u64 {
15989 if let Some(_) = self.ignore_this_field {
15990 return 1;
15991 }
15992 0
15993 }
15994 }
15995
15996 impl fidl::encoding::ValueTypeMarker for DecryptedFormat {
15997 type Borrowed<'a> = &'a Self;
15998 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
15999 value
16000 }
16001 }
16002
16003 unsafe impl fidl::encoding::TypeMarker for DecryptedFormat {
16004 type Owned = Self;
16005
16006 #[inline(always)]
16007 fn inline_align(_context: fidl::encoding::Context) -> usize {
16008 8
16009 }
16010
16011 #[inline(always)]
16012 fn inline_size(_context: fidl::encoding::Context) -> usize {
16013 16
16014 }
16015 }
16016
16017 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DecryptedFormat, D>
16018 for &DecryptedFormat
16019 {
16020 unsafe fn encode(
16021 self,
16022 encoder: &mut fidl::encoding::Encoder<'_, D>,
16023 offset: usize,
16024 mut depth: fidl::encoding::Depth,
16025 ) -> fidl::Result<()> {
16026 encoder.debug_check_bounds::<DecryptedFormat>(offset);
16027 let max_ordinal: u64 = self.max_ordinal_present();
16029 encoder.write_num(max_ordinal, offset);
16030 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
16031 if max_ordinal == 0 {
16033 return Ok(());
16034 }
16035 depth.increment()?;
16036 let envelope_size = 8;
16037 let bytes_len = max_ordinal as usize * envelope_size;
16038 #[allow(unused_variables)]
16039 let offset = encoder.out_of_line_offset(bytes_len);
16040 let mut _prev_end_offset: usize = 0;
16041 if 1 > max_ordinal {
16042 return Ok(());
16043 }
16044
16045 let cur_offset: usize = (1 - 1) * envelope_size;
16048
16049 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16051
16052 fidl::encoding::encode_in_envelope_optional::<bool, D>(
16057 self.ignore_this_field
16058 .as_ref()
16059 .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
16060 encoder,
16061 offset + cur_offset,
16062 depth,
16063 )?;
16064
16065 _prev_end_offset = cur_offset + envelope_size;
16066
16067 Ok(())
16068 }
16069 }
16070
16071 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DecryptedFormat {
16072 #[inline(always)]
16073 fn new_empty() -> Self {
16074 Self::default()
16075 }
16076
16077 unsafe fn decode(
16078 &mut self,
16079 decoder: &mut fidl::encoding::Decoder<'_, D>,
16080 offset: usize,
16081 mut depth: fidl::encoding::Depth,
16082 ) -> fidl::Result<()> {
16083 decoder.debug_check_bounds::<Self>(offset);
16084 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
16085 None => return Err(fidl::Error::NotNullable),
16086 Some(len) => len,
16087 };
16088 if len == 0 {
16090 return Ok(());
16091 };
16092 depth.increment()?;
16093 let envelope_size = 8;
16094 let bytes_len = len * envelope_size;
16095 let offset = decoder.out_of_line_offset(bytes_len)?;
16096 let mut _next_ordinal_to_read = 0;
16098 let mut next_offset = offset;
16099 let end_offset = offset + bytes_len;
16100 _next_ordinal_to_read += 1;
16101 if next_offset >= end_offset {
16102 return Ok(());
16103 }
16104
16105 while _next_ordinal_to_read < 1 {
16107 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16108 _next_ordinal_to_read += 1;
16109 next_offset += envelope_size;
16110 }
16111
16112 let next_out_of_line = decoder.next_out_of_line();
16113 let handles_before = decoder.remaining_handles();
16114 if let Some((inlined, num_bytes, num_handles)) =
16115 fidl::encoding::decode_envelope_header(decoder, next_offset)?
16116 {
16117 let member_inline_size =
16118 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
16119 if inlined != (member_inline_size <= 4) {
16120 return Err(fidl::Error::InvalidInlineBitInEnvelope);
16121 }
16122 let inner_offset;
16123 let mut inner_depth = depth.clone();
16124 if inlined {
16125 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16126 inner_offset = next_offset;
16127 } else {
16128 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16129 inner_depth.increment()?;
16130 }
16131 let val_ref =
16132 self.ignore_this_field.get_or_insert_with(|| fidl::new_empty!(bool, D));
16133 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
16134 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16135 {
16136 return Err(fidl::Error::InvalidNumBytesInEnvelope);
16137 }
16138 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16139 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16140 }
16141 }
16142
16143 next_offset += envelope_size;
16144
16145 while next_offset < end_offset {
16147 _next_ordinal_to_read += 1;
16148 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16149 next_offset += envelope_size;
16150 }
16151
16152 Ok(())
16153 }
16154 }
16155
16156 impl EncryptedFormat {
16157 #[inline(always)]
16158 fn max_ordinal_present(&self) -> u64 {
16159 if let Some(_) = self.key_id {
16160 return 8;
16161 }
16162 if let Some(_) = self.scheme {
16163 return 6;
16164 }
16165 if let Some(_) = self.pattern {
16166 return 5;
16167 }
16168 if let Some(_) = self.subsamples {
16169 return 4;
16170 }
16171 if let Some(_) = self.init_vector {
16172 return 3;
16173 }
16174 0
16175 }
16176 }
16177
16178 impl fidl::encoding::ValueTypeMarker for EncryptedFormat {
16179 type Borrowed<'a> = &'a Self;
16180 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
16181 value
16182 }
16183 }
16184
16185 unsafe impl fidl::encoding::TypeMarker for EncryptedFormat {
16186 type Owned = Self;
16187
16188 #[inline(always)]
16189 fn inline_align(_context: fidl::encoding::Context) -> usize {
16190 8
16191 }
16192
16193 #[inline(always)]
16194 fn inline_size(_context: fidl::encoding::Context) -> usize {
16195 16
16196 }
16197 }
16198
16199 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<EncryptedFormat, D>
16200 for &EncryptedFormat
16201 {
16202 unsafe fn encode(
16203 self,
16204 encoder: &mut fidl::encoding::Encoder<'_, D>,
16205 offset: usize,
16206 mut depth: fidl::encoding::Depth,
16207 ) -> fidl::Result<()> {
16208 encoder.debug_check_bounds::<EncryptedFormat>(offset);
16209 let max_ordinal: u64 = self.max_ordinal_present();
16211 encoder.write_num(max_ordinal, offset);
16212 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
16213 if max_ordinal == 0 {
16215 return Ok(());
16216 }
16217 depth.increment()?;
16218 let envelope_size = 8;
16219 let bytes_len = max_ordinal as usize * envelope_size;
16220 #[allow(unused_variables)]
16221 let offset = encoder.out_of_line_offset(bytes_len);
16222 let mut _prev_end_offset: usize = 0;
16223 if 3 > max_ordinal {
16224 return Ok(());
16225 }
16226
16227 let cur_offset: usize = (3 - 1) * envelope_size;
16230
16231 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16233
16234 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u8, 16>, D>(
16239 self.init_vector.as_ref().map(
16240 <fidl::encoding::Vector<u8, 16> as fidl::encoding::ValueTypeMarker>::borrow,
16241 ),
16242 encoder,
16243 offset + cur_offset,
16244 depth,
16245 )?;
16246
16247 _prev_end_offset = cur_offset + envelope_size;
16248 if 4 > max_ordinal {
16249 return Ok(());
16250 }
16251
16252 let cur_offset: usize = (4 - 1) * envelope_size;
16255
16256 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16258
16259 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<SubsampleEntry>, D>(
16264 self.subsamples.as_ref().map(<fidl::encoding::UnboundedVector<SubsampleEntry> as fidl::encoding::ValueTypeMarker>::borrow),
16265 encoder, offset + cur_offset, depth
16266 )?;
16267
16268 _prev_end_offset = cur_offset + envelope_size;
16269 if 5 > max_ordinal {
16270 return Ok(());
16271 }
16272
16273 let cur_offset: usize = (5 - 1) * envelope_size;
16276
16277 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16279
16280 fidl::encoding::encode_in_envelope_optional::<EncryptionPattern, D>(
16285 self.pattern
16286 .as_ref()
16287 .map(<EncryptionPattern as fidl::encoding::ValueTypeMarker>::borrow),
16288 encoder,
16289 offset + cur_offset,
16290 depth,
16291 )?;
16292
16293 _prev_end_offset = cur_offset + envelope_size;
16294 if 6 > max_ordinal {
16295 return Ok(());
16296 }
16297
16298 let cur_offset: usize = (6 - 1) * envelope_size;
16301
16302 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16304
16305 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedString, D>(
16310 self.scheme.as_ref().map(
16311 <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow,
16312 ),
16313 encoder,
16314 offset + cur_offset,
16315 depth,
16316 )?;
16317
16318 _prev_end_offset = cur_offset + envelope_size;
16319 if 8 > max_ordinal {
16320 return Ok(());
16321 }
16322
16323 let cur_offset: usize = (8 - 1) * envelope_size;
16326
16327 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16329
16330 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u8, 16>, D>(
16335 self.key_id.as_ref().map(
16336 <fidl::encoding::Vector<u8, 16> as fidl::encoding::ValueTypeMarker>::borrow,
16337 ),
16338 encoder,
16339 offset + cur_offset,
16340 depth,
16341 )?;
16342
16343 _prev_end_offset = cur_offset + envelope_size;
16344
16345 Ok(())
16346 }
16347 }
16348
16349 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for EncryptedFormat {
16350 #[inline(always)]
16351 fn new_empty() -> Self {
16352 Self::default()
16353 }
16354
16355 unsafe fn decode(
16356 &mut self,
16357 decoder: &mut fidl::encoding::Decoder<'_, D>,
16358 offset: usize,
16359 mut depth: fidl::encoding::Depth,
16360 ) -> fidl::Result<()> {
16361 decoder.debug_check_bounds::<Self>(offset);
16362 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
16363 None => return Err(fidl::Error::NotNullable),
16364 Some(len) => len,
16365 };
16366 if len == 0 {
16368 return Ok(());
16369 };
16370 depth.increment()?;
16371 let envelope_size = 8;
16372 let bytes_len = len * envelope_size;
16373 let offset = decoder.out_of_line_offset(bytes_len)?;
16374 let mut _next_ordinal_to_read = 0;
16376 let mut next_offset = offset;
16377 let end_offset = offset + bytes_len;
16378 _next_ordinal_to_read += 1;
16379 if next_offset >= end_offset {
16380 return Ok(());
16381 }
16382
16383 while _next_ordinal_to_read < 3 {
16385 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16386 _next_ordinal_to_read += 1;
16387 next_offset += envelope_size;
16388 }
16389
16390 let next_out_of_line = decoder.next_out_of_line();
16391 let handles_before = decoder.remaining_handles();
16392 if let Some((inlined, num_bytes, num_handles)) =
16393 fidl::encoding::decode_envelope_header(decoder, next_offset)?
16394 {
16395 let member_inline_size =
16396 <fidl::encoding::Vector<u8, 16> as fidl::encoding::TypeMarker>::inline_size(
16397 decoder.context,
16398 );
16399 if inlined != (member_inline_size <= 4) {
16400 return Err(fidl::Error::InvalidInlineBitInEnvelope);
16401 }
16402 let inner_offset;
16403 let mut inner_depth = depth.clone();
16404 if inlined {
16405 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16406 inner_offset = next_offset;
16407 } else {
16408 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16409 inner_depth.increment()?;
16410 }
16411 let val_ref = self
16412 .init_vector
16413 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 16>, D));
16414 fidl::decode!(fidl::encoding::Vector<u8, 16>, D, val_ref, decoder, inner_offset, inner_depth)?;
16415 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16416 {
16417 return Err(fidl::Error::InvalidNumBytesInEnvelope);
16418 }
16419 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16420 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16421 }
16422 }
16423
16424 next_offset += envelope_size;
16425 _next_ordinal_to_read += 1;
16426 if next_offset >= end_offset {
16427 return Ok(());
16428 }
16429
16430 while _next_ordinal_to_read < 4 {
16432 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16433 _next_ordinal_to_read += 1;
16434 next_offset += envelope_size;
16435 }
16436
16437 let next_out_of_line = decoder.next_out_of_line();
16438 let handles_before = decoder.remaining_handles();
16439 if let Some((inlined, num_bytes, num_handles)) =
16440 fidl::encoding::decode_envelope_header(decoder, next_offset)?
16441 {
16442 let member_inline_size = <fidl::encoding::UnboundedVector<SubsampleEntry> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
16443 if inlined != (member_inline_size <= 4) {
16444 return Err(fidl::Error::InvalidInlineBitInEnvelope);
16445 }
16446 let inner_offset;
16447 let mut inner_depth = depth.clone();
16448 if inlined {
16449 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16450 inner_offset = next_offset;
16451 } else {
16452 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16453 inner_depth.increment()?;
16454 }
16455 let val_ref = self.subsamples.get_or_insert_with(|| {
16456 fidl::new_empty!(fidl::encoding::UnboundedVector<SubsampleEntry>, D)
16457 });
16458 fidl::decode!(
16459 fidl::encoding::UnboundedVector<SubsampleEntry>,
16460 D,
16461 val_ref,
16462 decoder,
16463 inner_offset,
16464 inner_depth
16465 )?;
16466 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16467 {
16468 return Err(fidl::Error::InvalidNumBytesInEnvelope);
16469 }
16470 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16471 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16472 }
16473 }
16474
16475 next_offset += envelope_size;
16476 _next_ordinal_to_read += 1;
16477 if next_offset >= end_offset {
16478 return Ok(());
16479 }
16480
16481 while _next_ordinal_to_read < 5 {
16483 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16484 _next_ordinal_to_read += 1;
16485 next_offset += envelope_size;
16486 }
16487
16488 let next_out_of_line = decoder.next_out_of_line();
16489 let handles_before = decoder.remaining_handles();
16490 if let Some((inlined, num_bytes, num_handles)) =
16491 fidl::encoding::decode_envelope_header(decoder, next_offset)?
16492 {
16493 let member_inline_size =
16494 <EncryptionPattern as fidl::encoding::TypeMarker>::inline_size(decoder.context);
16495 if inlined != (member_inline_size <= 4) {
16496 return Err(fidl::Error::InvalidInlineBitInEnvelope);
16497 }
16498 let inner_offset;
16499 let mut inner_depth = depth.clone();
16500 if inlined {
16501 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16502 inner_offset = next_offset;
16503 } else {
16504 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16505 inner_depth.increment()?;
16506 }
16507 let val_ref =
16508 self.pattern.get_or_insert_with(|| fidl::new_empty!(EncryptionPattern, D));
16509 fidl::decode!(EncryptionPattern, D, val_ref, decoder, inner_offset, inner_depth)?;
16510 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16511 {
16512 return Err(fidl::Error::InvalidNumBytesInEnvelope);
16513 }
16514 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16515 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16516 }
16517 }
16518
16519 next_offset += envelope_size;
16520 _next_ordinal_to_read += 1;
16521 if next_offset >= end_offset {
16522 return Ok(());
16523 }
16524
16525 while _next_ordinal_to_read < 6 {
16527 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16528 _next_ordinal_to_read += 1;
16529 next_offset += envelope_size;
16530 }
16531
16532 let next_out_of_line = decoder.next_out_of_line();
16533 let handles_before = decoder.remaining_handles();
16534 if let Some((inlined, num_bytes, num_handles)) =
16535 fidl::encoding::decode_envelope_header(decoder, next_offset)?
16536 {
16537 let member_inline_size =
16538 <fidl::encoding::UnboundedString as fidl::encoding::TypeMarker>::inline_size(
16539 decoder.context,
16540 );
16541 if inlined != (member_inline_size <= 4) {
16542 return Err(fidl::Error::InvalidInlineBitInEnvelope);
16543 }
16544 let inner_offset;
16545 let mut inner_depth = depth.clone();
16546 if inlined {
16547 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16548 inner_offset = next_offset;
16549 } else {
16550 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16551 inner_depth.increment()?;
16552 }
16553 let val_ref = self
16554 .scheme
16555 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::UnboundedString, D));
16556 fidl::decode!(
16557 fidl::encoding::UnboundedString,
16558 D,
16559 val_ref,
16560 decoder,
16561 inner_offset,
16562 inner_depth
16563 )?;
16564 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16565 {
16566 return Err(fidl::Error::InvalidNumBytesInEnvelope);
16567 }
16568 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16569 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16570 }
16571 }
16572
16573 next_offset += envelope_size;
16574 _next_ordinal_to_read += 1;
16575 if next_offset >= end_offset {
16576 return Ok(());
16577 }
16578
16579 while _next_ordinal_to_read < 8 {
16581 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16582 _next_ordinal_to_read += 1;
16583 next_offset += envelope_size;
16584 }
16585
16586 let next_out_of_line = decoder.next_out_of_line();
16587 let handles_before = decoder.remaining_handles();
16588 if let Some((inlined, num_bytes, num_handles)) =
16589 fidl::encoding::decode_envelope_header(decoder, next_offset)?
16590 {
16591 let member_inline_size =
16592 <fidl::encoding::Vector<u8, 16> as fidl::encoding::TypeMarker>::inline_size(
16593 decoder.context,
16594 );
16595 if inlined != (member_inline_size <= 4) {
16596 return Err(fidl::Error::InvalidInlineBitInEnvelope);
16597 }
16598 let inner_offset;
16599 let mut inner_depth = depth.clone();
16600 if inlined {
16601 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16602 inner_offset = next_offset;
16603 } else {
16604 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16605 inner_depth.increment()?;
16606 }
16607 let val_ref = self
16608 .key_id
16609 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 16>, D));
16610 fidl::decode!(fidl::encoding::Vector<u8, 16>, D, val_ref, decoder, inner_offset, inner_depth)?;
16611 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16612 {
16613 return Err(fidl::Error::InvalidNumBytesInEnvelope);
16614 }
16615 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16616 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16617 }
16618 }
16619
16620 next_offset += envelope_size;
16621
16622 while next_offset < end_offset {
16624 _next_ordinal_to_read += 1;
16625 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16626 next_offset += envelope_size;
16627 }
16628
16629 Ok(())
16630 }
16631 }
16632
16633 impl FormatDetails {
16634 #[inline(always)]
16635 fn max_ordinal_present(&self) -> u64 {
16636 if let Some(_) = self.profile {
16637 return 8;
16638 }
16639 if let Some(_) = self.timebase {
16640 return 7;
16641 }
16642 if let Some(_) = self.encoder_settings {
16643 return 6;
16644 }
16645 if let Some(_) = self.pass_through_parameters {
16646 return 5;
16647 }
16648 if let Some(_) = self.domain {
16649 return 4;
16650 }
16651 if let Some(_) = self.oob_bytes {
16652 return 3;
16653 }
16654 if let Some(_) = self.mime_type {
16655 return 2;
16656 }
16657 if let Some(_) = self.format_details_version_ordinal {
16658 return 1;
16659 }
16660 0
16661 }
16662 }
16663
16664 impl fidl::encoding::ValueTypeMarker for FormatDetails {
16665 type Borrowed<'a> = &'a Self;
16666 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
16667 value
16668 }
16669 }
16670
16671 unsafe impl fidl::encoding::TypeMarker for FormatDetails {
16672 type Owned = Self;
16673
16674 #[inline(always)]
16675 fn inline_align(_context: fidl::encoding::Context) -> usize {
16676 8
16677 }
16678
16679 #[inline(always)]
16680 fn inline_size(_context: fidl::encoding::Context) -> usize {
16681 16
16682 }
16683 }
16684
16685 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<FormatDetails, D>
16686 for &FormatDetails
16687 {
16688 unsafe fn encode(
16689 self,
16690 encoder: &mut fidl::encoding::Encoder<'_, D>,
16691 offset: usize,
16692 mut depth: fidl::encoding::Depth,
16693 ) -> fidl::Result<()> {
16694 encoder.debug_check_bounds::<FormatDetails>(offset);
16695 let max_ordinal: u64 = self.max_ordinal_present();
16697 encoder.write_num(max_ordinal, offset);
16698 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
16699 if max_ordinal == 0 {
16701 return Ok(());
16702 }
16703 depth.increment()?;
16704 let envelope_size = 8;
16705 let bytes_len = max_ordinal as usize * envelope_size;
16706 #[allow(unused_variables)]
16707 let offset = encoder.out_of_line_offset(bytes_len);
16708 let mut _prev_end_offset: usize = 0;
16709 if 1 > max_ordinal {
16710 return Ok(());
16711 }
16712
16713 let cur_offset: usize = (1 - 1) * envelope_size;
16716
16717 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16719
16720 fidl::encoding::encode_in_envelope_optional::<u64, D>(
16725 self.format_details_version_ordinal
16726 .as_ref()
16727 .map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
16728 encoder,
16729 offset + cur_offset,
16730 depth,
16731 )?;
16732
16733 _prev_end_offset = cur_offset + envelope_size;
16734 if 2 > max_ordinal {
16735 return Ok(());
16736 }
16737
16738 let cur_offset: usize = (2 - 1) * envelope_size;
16741
16742 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16744
16745 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedString, D>(
16750 self.mime_type.as_ref().map(
16751 <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow,
16752 ),
16753 encoder,
16754 offset + cur_offset,
16755 depth,
16756 )?;
16757
16758 _prev_end_offset = cur_offset + envelope_size;
16759 if 3 > max_ordinal {
16760 return Ok(());
16761 }
16762
16763 let cur_offset: usize = (3 - 1) * envelope_size;
16766
16767 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16769
16770 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<u8>, D>(
16775 self.oob_bytes.as_ref().map(<fidl::encoding::UnboundedVector<u8> as fidl::encoding::ValueTypeMarker>::borrow),
16776 encoder, offset + cur_offset, depth
16777 )?;
16778
16779 _prev_end_offset = cur_offset + envelope_size;
16780 if 4 > max_ordinal {
16781 return Ok(());
16782 }
16783
16784 let cur_offset: usize = (4 - 1) * envelope_size;
16787
16788 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16790
16791 fidl::encoding::encode_in_envelope_optional::<DomainFormat, D>(
16796 self.domain.as_ref().map(<DomainFormat as fidl::encoding::ValueTypeMarker>::borrow),
16797 encoder,
16798 offset + cur_offset,
16799 depth,
16800 )?;
16801
16802 _prev_end_offset = cur_offset + envelope_size;
16803 if 5 > max_ordinal {
16804 return Ok(());
16805 }
16806
16807 let cur_offset: usize = (5 - 1) * envelope_size;
16810
16811 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16813
16814 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::UnboundedVector<Parameter>, D>(
16819 self.pass_through_parameters.as_ref().map(<fidl::encoding::UnboundedVector<Parameter> as fidl::encoding::ValueTypeMarker>::borrow),
16820 encoder, offset + cur_offset, depth
16821 )?;
16822
16823 _prev_end_offset = cur_offset + envelope_size;
16824 if 6 > max_ordinal {
16825 return Ok(());
16826 }
16827
16828 let cur_offset: usize = (6 - 1) * envelope_size;
16831
16832 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16834
16835 fidl::encoding::encode_in_envelope_optional::<EncoderSettings, D>(
16840 self.encoder_settings
16841 .as_ref()
16842 .map(<EncoderSettings as fidl::encoding::ValueTypeMarker>::borrow),
16843 encoder,
16844 offset + cur_offset,
16845 depth,
16846 )?;
16847
16848 _prev_end_offset = cur_offset + envelope_size;
16849 if 7 > max_ordinal {
16850 return Ok(());
16851 }
16852
16853 let cur_offset: usize = (7 - 1) * envelope_size;
16856
16857 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16859
16860 fidl::encoding::encode_in_envelope_optional::<u64, D>(
16865 self.timebase.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
16866 encoder,
16867 offset + cur_offset,
16868 depth,
16869 )?;
16870
16871 _prev_end_offset = cur_offset + envelope_size;
16872 if 8 > max_ordinal {
16873 return Ok(());
16874 }
16875
16876 let cur_offset: usize = (8 - 1) * envelope_size;
16879
16880 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16882
16883 fidl::encoding::encode_in_envelope_optional::<CodecProfile, D>(
16888 self.profile
16889 .as_ref()
16890 .map(<CodecProfile as fidl::encoding::ValueTypeMarker>::borrow),
16891 encoder,
16892 offset + cur_offset,
16893 depth,
16894 )?;
16895
16896 _prev_end_offset = cur_offset + envelope_size;
16897
16898 Ok(())
16899 }
16900 }
16901
16902 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FormatDetails {
16903 #[inline(always)]
16904 fn new_empty() -> Self {
16905 Self::default()
16906 }
16907
16908 unsafe fn decode(
16909 &mut self,
16910 decoder: &mut fidl::encoding::Decoder<'_, D>,
16911 offset: usize,
16912 mut depth: fidl::encoding::Depth,
16913 ) -> fidl::Result<()> {
16914 decoder.debug_check_bounds::<Self>(offset);
16915 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
16916 None => return Err(fidl::Error::NotNullable),
16917 Some(len) => len,
16918 };
16919 if len == 0 {
16921 return Ok(());
16922 };
16923 depth.increment()?;
16924 let envelope_size = 8;
16925 let bytes_len = len * envelope_size;
16926 let offset = decoder.out_of_line_offset(bytes_len)?;
16927 let mut _next_ordinal_to_read = 0;
16929 let mut next_offset = offset;
16930 let end_offset = offset + bytes_len;
16931 _next_ordinal_to_read += 1;
16932 if next_offset >= end_offset {
16933 return Ok(());
16934 }
16935
16936 while _next_ordinal_to_read < 1 {
16938 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16939 _next_ordinal_to_read += 1;
16940 next_offset += envelope_size;
16941 }
16942
16943 let next_out_of_line = decoder.next_out_of_line();
16944 let handles_before = decoder.remaining_handles();
16945 if let Some((inlined, num_bytes, num_handles)) =
16946 fidl::encoding::decode_envelope_header(decoder, next_offset)?
16947 {
16948 let member_inline_size =
16949 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
16950 if inlined != (member_inline_size <= 4) {
16951 return Err(fidl::Error::InvalidInlineBitInEnvelope);
16952 }
16953 let inner_offset;
16954 let mut inner_depth = depth.clone();
16955 if inlined {
16956 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16957 inner_offset = next_offset;
16958 } else {
16959 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16960 inner_depth.increment()?;
16961 }
16962 let val_ref = self
16963 .format_details_version_ordinal
16964 .get_or_insert_with(|| fidl::new_empty!(u64, D));
16965 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
16966 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16967 {
16968 return Err(fidl::Error::InvalidNumBytesInEnvelope);
16969 }
16970 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16971 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16972 }
16973 }
16974
16975 next_offset += envelope_size;
16976 _next_ordinal_to_read += 1;
16977 if next_offset >= end_offset {
16978 return Ok(());
16979 }
16980
16981 while _next_ordinal_to_read < 2 {
16983 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16984 _next_ordinal_to_read += 1;
16985 next_offset += envelope_size;
16986 }
16987
16988 let next_out_of_line = decoder.next_out_of_line();
16989 let handles_before = decoder.remaining_handles();
16990 if let Some((inlined, num_bytes, num_handles)) =
16991 fidl::encoding::decode_envelope_header(decoder, next_offset)?
16992 {
16993 let member_inline_size =
16994 <fidl::encoding::UnboundedString as fidl::encoding::TypeMarker>::inline_size(
16995 decoder.context,
16996 );
16997 if inlined != (member_inline_size <= 4) {
16998 return Err(fidl::Error::InvalidInlineBitInEnvelope);
16999 }
17000 let inner_offset;
17001 let mut inner_depth = depth.clone();
17002 if inlined {
17003 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17004 inner_offset = next_offset;
17005 } else {
17006 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17007 inner_depth.increment()?;
17008 }
17009 let val_ref = self
17010 .mime_type
17011 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::UnboundedString, D));
17012 fidl::decode!(
17013 fidl::encoding::UnboundedString,
17014 D,
17015 val_ref,
17016 decoder,
17017 inner_offset,
17018 inner_depth
17019 )?;
17020 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17021 {
17022 return Err(fidl::Error::InvalidNumBytesInEnvelope);
17023 }
17024 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17025 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17026 }
17027 }
17028
17029 next_offset += envelope_size;
17030 _next_ordinal_to_read += 1;
17031 if next_offset >= end_offset {
17032 return Ok(());
17033 }
17034
17035 while _next_ordinal_to_read < 3 {
17037 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17038 _next_ordinal_to_read += 1;
17039 next_offset += envelope_size;
17040 }
17041
17042 let next_out_of_line = decoder.next_out_of_line();
17043 let handles_before = decoder.remaining_handles();
17044 if let Some((inlined, num_bytes, num_handles)) =
17045 fidl::encoding::decode_envelope_header(decoder, next_offset)?
17046 {
17047 let member_inline_size = <fidl::encoding::UnboundedVector<u8> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
17048 if inlined != (member_inline_size <= 4) {
17049 return Err(fidl::Error::InvalidInlineBitInEnvelope);
17050 }
17051 let inner_offset;
17052 let mut inner_depth = depth.clone();
17053 if inlined {
17054 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17055 inner_offset = next_offset;
17056 } else {
17057 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17058 inner_depth.increment()?;
17059 }
17060 let val_ref = self.oob_bytes.get_or_insert_with(|| {
17061 fidl::new_empty!(fidl::encoding::UnboundedVector<u8>, D)
17062 });
17063 fidl::decode!(
17064 fidl::encoding::UnboundedVector<u8>,
17065 D,
17066 val_ref,
17067 decoder,
17068 inner_offset,
17069 inner_depth
17070 )?;
17071 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17072 {
17073 return Err(fidl::Error::InvalidNumBytesInEnvelope);
17074 }
17075 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17076 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17077 }
17078 }
17079
17080 next_offset += envelope_size;
17081 _next_ordinal_to_read += 1;
17082 if next_offset >= end_offset {
17083 return Ok(());
17084 }
17085
17086 while _next_ordinal_to_read < 4 {
17088 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17089 _next_ordinal_to_read += 1;
17090 next_offset += envelope_size;
17091 }
17092
17093 let next_out_of_line = decoder.next_out_of_line();
17094 let handles_before = decoder.remaining_handles();
17095 if let Some((inlined, num_bytes, num_handles)) =
17096 fidl::encoding::decode_envelope_header(decoder, next_offset)?
17097 {
17098 let member_inline_size =
17099 <DomainFormat as fidl::encoding::TypeMarker>::inline_size(decoder.context);
17100 if inlined != (member_inline_size <= 4) {
17101 return Err(fidl::Error::InvalidInlineBitInEnvelope);
17102 }
17103 let inner_offset;
17104 let mut inner_depth = depth.clone();
17105 if inlined {
17106 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17107 inner_offset = next_offset;
17108 } else {
17109 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17110 inner_depth.increment()?;
17111 }
17112 let val_ref = self.domain.get_or_insert_with(|| fidl::new_empty!(DomainFormat, D));
17113 fidl::decode!(DomainFormat, D, val_ref, decoder, inner_offset, inner_depth)?;
17114 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17115 {
17116 return Err(fidl::Error::InvalidNumBytesInEnvelope);
17117 }
17118 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17119 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17120 }
17121 }
17122
17123 next_offset += envelope_size;
17124 _next_ordinal_to_read += 1;
17125 if next_offset >= end_offset {
17126 return Ok(());
17127 }
17128
17129 while _next_ordinal_to_read < 5 {
17131 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17132 _next_ordinal_to_read += 1;
17133 next_offset += envelope_size;
17134 }
17135
17136 let next_out_of_line = decoder.next_out_of_line();
17137 let handles_before = decoder.remaining_handles();
17138 if let Some((inlined, num_bytes, num_handles)) =
17139 fidl::encoding::decode_envelope_header(decoder, next_offset)?
17140 {
17141 let member_inline_size = <fidl::encoding::UnboundedVector<Parameter> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
17142 if inlined != (member_inline_size <= 4) {
17143 return Err(fidl::Error::InvalidInlineBitInEnvelope);
17144 }
17145 let inner_offset;
17146 let mut inner_depth = depth.clone();
17147 if inlined {
17148 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17149 inner_offset = next_offset;
17150 } else {
17151 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17152 inner_depth.increment()?;
17153 }
17154 let val_ref = self.pass_through_parameters.get_or_insert_with(|| {
17155 fidl::new_empty!(fidl::encoding::UnboundedVector<Parameter>, D)
17156 });
17157 fidl::decode!(
17158 fidl::encoding::UnboundedVector<Parameter>,
17159 D,
17160 val_ref,
17161 decoder,
17162 inner_offset,
17163 inner_depth
17164 )?;
17165 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17166 {
17167 return Err(fidl::Error::InvalidNumBytesInEnvelope);
17168 }
17169 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17170 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17171 }
17172 }
17173
17174 next_offset += envelope_size;
17175 _next_ordinal_to_read += 1;
17176 if next_offset >= end_offset {
17177 return Ok(());
17178 }
17179
17180 while _next_ordinal_to_read < 6 {
17182 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17183 _next_ordinal_to_read += 1;
17184 next_offset += envelope_size;
17185 }
17186
17187 let next_out_of_line = decoder.next_out_of_line();
17188 let handles_before = decoder.remaining_handles();
17189 if let Some((inlined, num_bytes, num_handles)) =
17190 fidl::encoding::decode_envelope_header(decoder, next_offset)?
17191 {
17192 let member_inline_size =
17193 <EncoderSettings as fidl::encoding::TypeMarker>::inline_size(decoder.context);
17194 if inlined != (member_inline_size <= 4) {
17195 return Err(fidl::Error::InvalidInlineBitInEnvelope);
17196 }
17197 let inner_offset;
17198 let mut inner_depth = depth.clone();
17199 if inlined {
17200 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17201 inner_offset = next_offset;
17202 } else {
17203 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17204 inner_depth.increment()?;
17205 }
17206 let val_ref = self
17207 .encoder_settings
17208 .get_or_insert_with(|| fidl::new_empty!(EncoderSettings, D));
17209 fidl::decode!(EncoderSettings, D, val_ref, decoder, inner_offset, inner_depth)?;
17210 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17211 {
17212 return Err(fidl::Error::InvalidNumBytesInEnvelope);
17213 }
17214 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17215 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17216 }
17217 }
17218
17219 next_offset += envelope_size;
17220 _next_ordinal_to_read += 1;
17221 if next_offset >= end_offset {
17222 return Ok(());
17223 }
17224
17225 while _next_ordinal_to_read < 7 {
17227 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17228 _next_ordinal_to_read += 1;
17229 next_offset += envelope_size;
17230 }
17231
17232 let next_out_of_line = decoder.next_out_of_line();
17233 let handles_before = decoder.remaining_handles();
17234 if let Some((inlined, num_bytes, num_handles)) =
17235 fidl::encoding::decode_envelope_header(decoder, next_offset)?
17236 {
17237 let member_inline_size =
17238 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
17239 if inlined != (member_inline_size <= 4) {
17240 return Err(fidl::Error::InvalidInlineBitInEnvelope);
17241 }
17242 let inner_offset;
17243 let mut inner_depth = depth.clone();
17244 if inlined {
17245 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17246 inner_offset = next_offset;
17247 } else {
17248 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17249 inner_depth.increment()?;
17250 }
17251 let val_ref = self.timebase.get_or_insert_with(|| fidl::new_empty!(u64, D));
17252 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
17253 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17254 {
17255 return Err(fidl::Error::InvalidNumBytesInEnvelope);
17256 }
17257 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17258 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17259 }
17260 }
17261
17262 next_offset += envelope_size;
17263 _next_ordinal_to_read += 1;
17264 if next_offset >= end_offset {
17265 return Ok(());
17266 }
17267
17268 while _next_ordinal_to_read < 8 {
17270 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17271 _next_ordinal_to_read += 1;
17272 next_offset += envelope_size;
17273 }
17274
17275 let next_out_of_line = decoder.next_out_of_line();
17276 let handles_before = decoder.remaining_handles();
17277 if let Some((inlined, num_bytes, num_handles)) =
17278 fidl::encoding::decode_envelope_header(decoder, next_offset)?
17279 {
17280 let member_inline_size =
17281 <CodecProfile as fidl::encoding::TypeMarker>::inline_size(decoder.context);
17282 if inlined != (member_inline_size <= 4) {
17283 return Err(fidl::Error::InvalidInlineBitInEnvelope);
17284 }
17285 let inner_offset;
17286 let mut inner_depth = depth.clone();
17287 if inlined {
17288 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17289 inner_offset = next_offset;
17290 } else {
17291 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17292 inner_depth.increment()?;
17293 }
17294 let val_ref = self.profile.get_or_insert_with(|| fidl::new_empty!(CodecProfile, D));
17295 fidl::decode!(CodecProfile, D, val_ref, decoder, inner_offset, inner_depth)?;
17296 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17297 {
17298 return Err(fidl::Error::InvalidNumBytesInEnvelope);
17299 }
17300 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17301 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17302 }
17303 }
17304
17305 next_offset += envelope_size;
17306
17307 while next_offset < end_offset {
17309 _next_ordinal_to_read += 1;
17310 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17311 next_offset += envelope_size;
17312 }
17313
17314 Ok(())
17315 }
17316 }
17317
17318 impl H264EncoderSettings {
17319 #[inline(always)]
17320 fn max_ordinal_present(&self) -> u64 {
17321 if let Some(_) = self.quantization_params {
17322 return 7;
17323 }
17324 if let Some(_) = self.force_key_frame {
17325 return 6;
17326 }
17327 if let Some(_) = self.min_frame_rate {
17328 return 5;
17329 }
17330 if let Some(_) = self.variable_frame_rate {
17331 return 4;
17332 }
17333 if let Some(_) = self.gop_size {
17334 return 3;
17335 }
17336 if let Some(_) = self.frame_rate {
17337 return 2;
17338 }
17339 if let Some(_) = self.bit_rate {
17340 return 1;
17341 }
17342 0
17343 }
17344 }
17345
17346 impl fidl::encoding::ValueTypeMarker for H264EncoderSettings {
17347 type Borrowed<'a> = &'a Self;
17348 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
17349 value
17350 }
17351 }
17352
17353 unsafe impl fidl::encoding::TypeMarker for H264EncoderSettings {
17354 type Owned = Self;
17355
17356 #[inline(always)]
17357 fn inline_align(_context: fidl::encoding::Context) -> usize {
17358 8
17359 }
17360
17361 #[inline(always)]
17362 fn inline_size(_context: fidl::encoding::Context) -> usize {
17363 16
17364 }
17365 }
17366
17367 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<H264EncoderSettings, D>
17368 for &H264EncoderSettings
17369 {
17370 unsafe fn encode(
17371 self,
17372 encoder: &mut fidl::encoding::Encoder<'_, D>,
17373 offset: usize,
17374 mut depth: fidl::encoding::Depth,
17375 ) -> fidl::Result<()> {
17376 encoder.debug_check_bounds::<H264EncoderSettings>(offset);
17377 let max_ordinal: u64 = self.max_ordinal_present();
17379 encoder.write_num(max_ordinal, offset);
17380 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
17381 if max_ordinal == 0 {
17383 return Ok(());
17384 }
17385 depth.increment()?;
17386 let envelope_size = 8;
17387 let bytes_len = max_ordinal as usize * envelope_size;
17388 #[allow(unused_variables)]
17389 let offset = encoder.out_of_line_offset(bytes_len);
17390 let mut _prev_end_offset: usize = 0;
17391 if 1 > max_ordinal {
17392 return Ok(());
17393 }
17394
17395 let cur_offset: usize = (1 - 1) * envelope_size;
17398
17399 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17401
17402 fidl::encoding::encode_in_envelope_optional::<u32, D>(
17407 self.bit_rate.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
17408 encoder,
17409 offset + cur_offset,
17410 depth,
17411 )?;
17412
17413 _prev_end_offset = cur_offset + envelope_size;
17414 if 2 > max_ordinal {
17415 return Ok(());
17416 }
17417
17418 let cur_offset: usize = (2 - 1) * envelope_size;
17421
17422 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17424
17425 fidl::encoding::encode_in_envelope_optional::<u32, D>(
17430 self.frame_rate.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
17431 encoder,
17432 offset + cur_offset,
17433 depth,
17434 )?;
17435
17436 _prev_end_offset = cur_offset + envelope_size;
17437 if 3 > max_ordinal {
17438 return Ok(());
17439 }
17440
17441 let cur_offset: usize = (3 - 1) * envelope_size;
17444
17445 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17447
17448 fidl::encoding::encode_in_envelope_optional::<u32, D>(
17453 self.gop_size.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
17454 encoder,
17455 offset + cur_offset,
17456 depth,
17457 )?;
17458
17459 _prev_end_offset = cur_offset + envelope_size;
17460 if 4 > max_ordinal {
17461 return Ok(());
17462 }
17463
17464 let cur_offset: usize = (4 - 1) * envelope_size;
17467
17468 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17470
17471 fidl::encoding::encode_in_envelope_optional::<bool, D>(
17476 self.variable_frame_rate
17477 .as_ref()
17478 .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
17479 encoder,
17480 offset + cur_offset,
17481 depth,
17482 )?;
17483
17484 _prev_end_offset = cur_offset + envelope_size;
17485 if 5 > max_ordinal {
17486 return Ok(());
17487 }
17488
17489 let cur_offset: usize = (5 - 1) * envelope_size;
17492
17493 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17495
17496 fidl::encoding::encode_in_envelope_optional::<u32, D>(
17501 self.min_frame_rate.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
17502 encoder,
17503 offset + cur_offset,
17504 depth,
17505 )?;
17506
17507 _prev_end_offset = cur_offset + envelope_size;
17508 if 6 > max_ordinal {
17509 return Ok(());
17510 }
17511
17512 let cur_offset: usize = (6 - 1) * envelope_size;
17515
17516 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17518
17519 fidl::encoding::encode_in_envelope_optional::<bool, D>(
17524 self.force_key_frame
17525 .as_ref()
17526 .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
17527 encoder,
17528 offset + cur_offset,
17529 depth,
17530 )?;
17531
17532 _prev_end_offset = cur_offset + envelope_size;
17533 if 7 > max_ordinal {
17534 return Ok(());
17535 }
17536
17537 let cur_offset: usize = (7 - 1) * envelope_size;
17540
17541 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17543
17544 fidl::encoding::encode_in_envelope_optional::<H264QuantizationParameters, D>(
17549 self.quantization_params
17550 .as_ref()
17551 .map(<H264QuantizationParameters as fidl::encoding::ValueTypeMarker>::borrow),
17552 encoder,
17553 offset + cur_offset,
17554 depth,
17555 )?;
17556
17557 _prev_end_offset = cur_offset + envelope_size;
17558
17559 Ok(())
17560 }
17561 }
17562
17563 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for H264EncoderSettings {
17564 #[inline(always)]
17565 fn new_empty() -> Self {
17566 Self::default()
17567 }
17568
17569 unsafe fn decode(
17570 &mut self,
17571 decoder: &mut fidl::encoding::Decoder<'_, D>,
17572 offset: usize,
17573 mut depth: fidl::encoding::Depth,
17574 ) -> fidl::Result<()> {
17575 decoder.debug_check_bounds::<Self>(offset);
17576 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
17577 None => return Err(fidl::Error::NotNullable),
17578 Some(len) => len,
17579 };
17580 if len == 0 {
17582 return Ok(());
17583 };
17584 depth.increment()?;
17585 let envelope_size = 8;
17586 let bytes_len = len * envelope_size;
17587 let offset = decoder.out_of_line_offset(bytes_len)?;
17588 let mut _next_ordinal_to_read = 0;
17590 let mut next_offset = offset;
17591 let end_offset = offset + bytes_len;
17592 _next_ordinal_to_read += 1;
17593 if next_offset >= end_offset {
17594 return Ok(());
17595 }
17596
17597 while _next_ordinal_to_read < 1 {
17599 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17600 _next_ordinal_to_read += 1;
17601 next_offset += envelope_size;
17602 }
17603
17604 let next_out_of_line = decoder.next_out_of_line();
17605 let handles_before = decoder.remaining_handles();
17606 if let Some((inlined, num_bytes, num_handles)) =
17607 fidl::encoding::decode_envelope_header(decoder, next_offset)?
17608 {
17609 let member_inline_size =
17610 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
17611 if inlined != (member_inline_size <= 4) {
17612 return Err(fidl::Error::InvalidInlineBitInEnvelope);
17613 }
17614 let inner_offset;
17615 let mut inner_depth = depth.clone();
17616 if inlined {
17617 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17618 inner_offset = next_offset;
17619 } else {
17620 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17621 inner_depth.increment()?;
17622 }
17623 let val_ref = self.bit_rate.get_or_insert_with(|| fidl::new_empty!(u32, D));
17624 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
17625 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17626 {
17627 return Err(fidl::Error::InvalidNumBytesInEnvelope);
17628 }
17629 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17630 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17631 }
17632 }
17633
17634 next_offset += envelope_size;
17635 _next_ordinal_to_read += 1;
17636 if next_offset >= end_offset {
17637 return Ok(());
17638 }
17639
17640 while _next_ordinal_to_read < 2 {
17642 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17643 _next_ordinal_to_read += 1;
17644 next_offset += envelope_size;
17645 }
17646
17647 let next_out_of_line = decoder.next_out_of_line();
17648 let handles_before = decoder.remaining_handles();
17649 if let Some((inlined, num_bytes, num_handles)) =
17650 fidl::encoding::decode_envelope_header(decoder, next_offset)?
17651 {
17652 let member_inline_size =
17653 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
17654 if inlined != (member_inline_size <= 4) {
17655 return Err(fidl::Error::InvalidInlineBitInEnvelope);
17656 }
17657 let inner_offset;
17658 let mut inner_depth = depth.clone();
17659 if inlined {
17660 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17661 inner_offset = next_offset;
17662 } else {
17663 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17664 inner_depth.increment()?;
17665 }
17666 let val_ref = self.frame_rate.get_or_insert_with(|| fidl::new_empty!(u32, D));
17667 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
17668 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17669 {
17670 return Err(fidl::Error::InvalidNumBytesInEnvelope);
17671 }
17672 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17673 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17674 }
17675 }
17676
17677 next_offset += envelope_size;
17678 _next_ordinal_to_read += 1;
17679 if next_offset >= end_offset {
17680 return Ok(());
17681 }
17682
17683 while _next_ordinal_to_read < 3 {
17685 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17686 _next_ordinal_to_read += 1;
17687 next_offset += envelope_size;
17688 }
17689
17690 let next_out_of_line = decoder.next_out_of_line();
17691 let handles_before = decoder.remaining_handles();
17692 if let Some((inlined, num_bytes, num_handles)) =
17693 fidl::encoding::decode_envelope_header(decoder, next_offset)?
17694 {
17695 let member_inline_size =
17696 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
17697 if inlined != (member_inline_size <= 4) {
17698 return Err(fidl::Error::InvalidInlineBitInEnvelope);
17699 }
17700 let inner_offset;
17701 let mut inner_depth = depth.clone();
17702 if inlined {
17703 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17704 inner_offset = next_offset;
17705 } else {
17706 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17707 inner_depth.increment()?;
17708 }
17709 let val_ref = self.gop_size.get_or_insert_with(|| fidl::new_empty!(u32, D));
17710 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
17711 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17712 {
17713 return Err(fidl::Error::InvalidNumBytesInEnvelope);
17714 }
17715 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17716 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17717 }
17718 }
17719
17720 next_offset += envelope_size;
17721 _next_ordinal_to_read += 1;
17722 if next_offset >= end_offset {
17723 return Ok(());
17724 }
17725
17726 while _next_ordinal_to_read < 4 {
17728 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17729 _next_ordinal_to_read += 1;
17730 next_offset += envelope_size;
17731 }
17732
17733 let next_out_of_line = decoder.next_out_of_line();
17734 let handles_before = decoder.remaining_handles();
17735 if let Some((inlined, num_bytes, num_handles)) =
17736 fidl::encoding::decode_envelope_header(decoder, next_offset)?
17737 {
17738 let member_inline_size =
17739 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
17740 if inlined != (member_inline_size <= 4) {
17741 return Err(fidl::Error::InvalidInlineBitInEnvelope);
17742 }
17743 let inner_offset;
17744 let mut inner_depth = depth.clone();
17745 if inlined {
17746 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17747 inner_offset = next_offset;
17748 } else {
17749 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17750 inner_depth.increment()?;
17751 }
17752 let val_ref =
17753 self.variable_frame_rate.get_or_insert_with(|| fidl::new_empty!(bool, D));
17754 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
17755 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17756 {
17757 return Err(fidl::Error::InvalidNumBytesInEnvelope);
17758 }
17759 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17760 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17761 }
17762 }
17763
17764 next_offset += envelope_size;
17765 _next_ordinal_to_read += 1;
17766 if next_offset >= end_offset {
17767 return Ok(());
17768 }
17769
17770 while _next_ordinal_to_read < 5 {
17772 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17773 _next_ordinal_to_read += 1;
17774 next_offset += envelope_size;
17775 }
17776
17777 let next_out_of_line = decoder.next_out_of_line();
17778 let handles_before = decoder.remaining_handles();
17779 if let Some((inlined, num_bytes, num_handles)) =
17780 fidl::encoding::decode_envelope_header(decoder, next_offset)?
17781 {
17782 let member_inline_size =
17783 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
17784 if inlined != (member_inline_size <= 4) {
17785 return Err(fidl::Error::InvalidInlineBitInEnvelope);
17786 }
17787 let inner_offset;
17788 let mut inner_depth = depth.clone();
17789 if inlined {
17790 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17791 inner_offset = next_offset;
17792 } else {
17793 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17794 inner_depth.increment()?;
17795 }
17796 let val_ref = self.min_frame_rate.get_or_insert_with(|| fidl::new_empty!(u32, D));
17797 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
17798 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17799 {
17800 return Err(fidl::Error::InvalidNumBytesInEnvelope);
17801 }
17802 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17803 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17804 }
17805 }
17806
17807 next_offset += envelope_size;
17808 _next_ordinal_to_read += 1;
17809 if next_offset >= end_offset {
17810 return Ok(());
17811 }
17812
17813 while _next_ordinal_to_read < 6 {
17815 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17816 _next_ordinal_to_read += 1;
17817 next_offset += envelope_size;
17818 }
17819
17820 let next_out_of_line = decoder.next_out_of_line();
17821 let handles_before = decoder.remaining_handles();
17822 if let Some((inlined, num_bytes, num_handles)) =
17823 fidl::encoding::decode_envelope_header(decoder, next_offset)?
17824 {
17825 let member_inline_size =
17826 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
17827 if inlined != (member_inline_size <= 4) {
17828 return Err(fidl::Error::InvalidInlineBitInEnvelope);
17829 }
17830 let inner_offset;
17831 let mut inner_depth = depth.clone();
17832 if inlined {
17833 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17834 inner_offset = next_offset;
17835 } else {
17836 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17837 inner_depth.increment()?;
17838 }
17839 let val_ref = self.force_key_frame.get_or_insert_with(|| fidl::new_empty!(bool, D));
17840 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
17841 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17842 {
17843 return Err(fidl::Error::InvalidNumBytesInEnvelope);
17844 }
17845 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17846 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17847 }
17848 }
17849
17850 next_offset += envelope_size;
17851 _next_ordinal_to_read += 1;
17852 if next_offset >= end_offset {
17853 return Ok(());
17854 }
17855
17856 while _next_ordinal_to_read < 7 {
17858 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17859 _next_ordinal_to_read += 1;
17860 next_offset += envelope_size;
17861 }
17862
17863 let next_out_of_line = decoder.next_out_of_line();
17864 let handles_before = decoder.remaining_handles();
17865 if let Some((inlined, num_bytes, num_handles)) =
17866 fidl::encoding::decode_envelope_header(decoder, next_offset)?
17867 {
17868 let member_inline_size =
17869 <H264QuantizationParameters as fidl::encoding::TypeMarker>::inline_size(
17870 decoder.context,
17871 );
17872 if inlined != (member_inline_size <= 4) {
17873 return Err(fidl::Error::InvalidInlineBitInEnvelope);
17874 }
17875 let inner_offset;
17876 let mut inner_depth = depth.clone();
17877 if inlined {
17878 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17879 inner_offset = next_offset;
17880 } else {
17881 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17882 inner_depth.increment()?;
17883 }
17884 let val_ref = self
17885 .quantization_params
17886 .get_or_insert_with(|| fidl::new_empty!(H264QuantizationParameters, D));
17887 fidl::decode!(
17888 H264QuantizationParameters,
17889 D,
17890 val_ref,
17891 decoder,
17892 inner_offset,
17893 inner_depth
17894 )?;
17895 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17896 {
17897 return Err(fidl::Error::InvalidNumBytesInEnvelope);
17898 }
17899 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17900 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17901 }
17902 }
17903
17904 next_offset += envelope_size;
17905
17906 while next_offset < end_offset {
17908 _next_ordinal_to_read += 1;
17909 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17910 next_offset += envelope_size;
17911 }
17912
17913 Ok(())
17914 }
17915 }
17916
17917 impl H264QuantizationParameters {
17918 #[inline(always)]
17919 fn max_ordinal_present(&self) -> u64 {
17920 if let Some(_) = self.p_max {
17921 return 6;
17922 }
17923 if let Some(_) = self.p_min {
17924 return 5;
17925 }
17926 if let Some(_) = self.p_base {
17927 return 4;
17928 }
17929 if let Some(_) = self.i_max {
17930 return 3;
17931 }
17932 if let Some(_) = self.i_min {
17933 return 2;
17934 }
17935 if let Some(_) = self.i_base {
17936 return 1;
17937 }
17938 0
17939 }
17940 }
17941
17942 impl fidl::encoding::ValueTypeMarker for H264QuantizationParameters {
17943 type Borrowed<'a> = &'a Self;
17944 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
17945 value
17946 }
17947 }
17948
17949 unsafe impl fidl::encoding::TypeMarker for H264QuantizationParameters {
17950 type Owned = Self;
17951
17952 #[inline(always)]
17953 fn inline_align(_context: fidl::encoding::Context) -> usize {
17954 8
17955 }
17956
17957 #[inline(always)]
17958 fn inline_size(_context: fidl::encoding::Context) -> usize {
17959 16
17960 }
17961 }
17962
17963 unsafe impl<D: fidl::encoding::ResourceDialect>
17964 fidl::encoding::Encode<H264QuantizationParameters, D> for &H264QuantizationParameters
17965 {
17966 unsafe fn encode(
17967 self,
17968 encoder: &mut fidl::encoding::Encoder<'_, D>,
17969 offset: usize,
17970 mut depth: fidl::encoding::Depth,
17971 ) -> fidl::Result<()> {
17972 encoder.debug_check_bounds::<H264QuantizationParameters>(offset);
17973 let max_ordinal: u64 = self.max_ordinal_present();
17975 encoder.write_num(max_ordinal, offset);
17976 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
17977 if max_ordinal == 0 {
17979 return Ok(());
17980 }
17981 depth.increment()?;
17982 let envelope_size = 8;
17983 let bytes_len = max_ordinal as usize * envelope_size;
17984 #[allow(unused_variables)]
17985 let offset = encoder.out_of_line_offset(bytes_len);
17986 let mut _prev_end_offset: usize = 0;
17987 if 1 > max_ordinal {
17988 return Ok(());
17989 }
17990
17991 let cur_offset: usize = (1 - 1) * envelope_size;
17994
17995 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17997
17998 fidl::encoding::encode_in_envelope_optional::<u32, D>(
18003 self.i_base.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
18004 encoder,
18005 offset + cur_offset,
18006 depth,
18007 )?;
18008
18009 _prev_end_offset = cur_offset + envelope_size;
18010 if 2 > max_ordinal {
18011 return Ok(());
18012 }
18013
18014 let cur_offset: usize = (2 - 1) * envelope_size;
18017
18018 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18020
18021 fidl::encoding::encode_in_envelope_optional::<u32, D>(
18026 self.i_min.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
18027 encoder,
18028 offset + cur_offset,
18029 depth,
18030 )?;
18031
18032 _prev_end_offset = cur_offset + envelope_size;
18033 if 3 > max_ordinal {
18034 return Ok(());
18035 }
18036
18037 let cur_offset: usize = (3 - 1) * envelope_size;
18040
18041 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18043
18044 fidl::encoding::encode_in_envelope_optional::<u32, D>(
18049 self.i_max.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
18050 encoder,
18051 offset + cur_offset,
18052 depth,
18053 )?;
18054
18055 _prev_end_offset = cur_offset + envelope_size;
18056 if 4 > max_ordinal {
18057 return Ok(());
18058 }
18059
18060 let cur_offset: usize = (4 - 1) * envelope_size;
18063
18064 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18066
18067 fidl::encoding::encode_in_envelope_optional::<u32, D>(
18072 self.p_base.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
18073 encoder,
18074 offset + cur_offset,
18075 depth,
18076 )?;
18077
18078 _prev_end_offset = cur_offset + envelope_size;
18079 if 5 > max_ordinal {
18080 return Ok(());
18081 }
18082
18083 let cur_offset: usize = (5 - 1) * envelope_size;
18086
18087 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18089
18090 fidl::encoding::encode_in_envelope_optional::<u32, D>(
18095 self.p_min.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
18096 encoder,
18097 offset + cur_offset,
18098 depth,
18099 )?;
18100
18101 _prev_end_offset = cur_offset + envelope_size;
18102 if 6 > max_ordinal {
18103 return Ok(());
18104 }
18105
18106 let cur_offset: usize = (6 - 1) * envelope_size;
18109
18110 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18112
18113 fidl::encoding::encode_in_envelope_optional::<u32, D>(
18118 self.p_max.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
18119 encoder,
18120 offset + cur_offset,
18121 depth,
18122 )?;
18123
18124 _prev_end_offset = cur_offset + envelope_size;
18125
18126 Ok(())
18127 }
18128 }
18129
18130 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
18131 for H264QuantizationParameters
18132 {
18133 #[inline(always)]
18134 fn new_empty() -> Self {
18135 Self::default()
18136 }
18137
18138 unsafe fn decode(
18139 &mut self,
18140 decoder: &mut fidl::encoding::Decoder<'_, D>,
18141 offset: usize,
18142 mut depth: fidl::encoding::Depth,
18143 ) -> fidl::Result<()> {
18144 decoder.debug_check_bounds::<Self>(offset);
18145 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
18146 None => return Err(fidl::Error::NotNullable),
18147 Some(len) => len,
18148 };
18149 if len == 0 {
18151 return Ok(());
18152 };
18153 depth.increment()?;
18154 let envelope_size = 8;
18155 let bytes_len = len * envelope_size;
18156 let offset = decoder.out_of_line_offset(bytes_len)?;
18157 let mut _next_ordinal_to_read = 0;
18159 let mut next_offset = offset;
18160 let end_offset = offset + bytes_len;
18161 _next_ordinal_to_read += 1;
18162 if next_offset >= end_offset {
18163 return Ok(());
18164 }
18165
18166 while _next_ordinal_to_read < 1 {
18168 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18169 _next_ordinal_to_read += 1;
18170 next_offset += envelope_size;
18171 }
18172
18173 let next_out_of_line = decoder.next_out_of_line();
18174 let handles_before = decoder.remaining_handles();
18175 if let Some((inlined, num_bytes, num_handles)) =
18176 fidl::encoding::decode_envelope_header(decoder, next_offset)?
18177 {
18178 let member_inline_size =
18179 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
18180 if inlined != (member_inline_size <= 4) {
18181 return Err(fidl::Error::InvalidInlineBitInEnvelope);
18182 }
18183 let inner_offset;
18184 let mut inner_depth = depth.clone();
18185 if inlined {
18186 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18187 inner_offset = next_offset;
18188 } else {
18189 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18190 inner_depth.increment()?;
18191 }
18192 let val_ref = self.i_base.get_or_insert_with(|| fidl::new_empty!(u32, D));
18193 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
18194 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18195 {
18196 return Err(fidl::Error::InvalidNumBytesInEnvelope);
18197 }
18198 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18199 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18200 }
18201 }
18202
18203 next_offset += envelope_size;
18204 _next_ordinal_to_read += 1;
18205 if next_offset >= end_offset {
18206 return Ok(());
18207 }
18208
18209 while _next_ordinal_to_read < 2 {
18211 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18212 _next_ordinal_to_read += 1;
18213 next_offset += envelope_size;
18214 }
18215
18216 let next_out_of_line = decoder.next_out_of_line();
18217 let handles_before = decoder.remaining_handles();
18218 if let Some((inlined, num_bytes, num_handles)) =
18219 fidl::encoding::decode_envelope_header(decoder, next_offset)?
18220 {
18221 let member_inline_size =
18222 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
18223 if inlined != (member_inline_size <= 4) {
18224 return Err(fidl::Error::InvalidInlineBitInEnvelope);
18225 }
18226 let inner_offset;
18227 let mut inner_depth = depth.clone();
18228 if inlined {
18229 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18230 inner_offset = next_offset;
18231 } else {
18232 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18233 inner_depth.increment()?;
18234 }
18235 let val_ref = self.i_min.get_or_insert_with(|| fidl::new_empty!(u32, D));
18236 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
18237 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18238 {
18239 return Err(fidl::Error::InvalidNumBytesInEnvelope);
18240 }
18241 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18242 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18243 }
18244 }
18245
18246 next_offset += envelope_size;
18247 _next_ordinal_to_read += 1;
18248 if next_offset >= end_offset {
18249 return Ok(());
18250 }
18251
18252 while _next_ordinal_to_read < 3 {
18254 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18255 _next_ordinal_to_read += 1;
18256 next_offset += envelope_size;
18257 }
18258
18259 let next_out_of_line = decoder.next_out_of_line();
18260 let handles_before = decoder.remaining_handles();
18261 if let Some((inlined, num_bytes, num_handles)) =
18262 fidl::encoding::decode_envelope_header(decoder, next_offset)?
18263 {
18264 let member_inline_size =
18265 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
18266 if inlined != (member_inline_size <= 4) {
18267 return Err(fidl::Error::InvalidInlineBitInEnvelope);
18268 }
18269 let inner_offset;
18270 let mut inner_depth = depth.clone();
18271 if inlined {
18272 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18273 inner_offset = next_offset;
18274 } else {
18275 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18276 inner_depth.increment()?;
18277 }
18278 let val_ref = self.i_max.get_or_insert_with(|| fidl::new_empty!(u32, D));
18279 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
18280 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18281 {
18282 return Err(fidl::Error::InvalidNumBytesInEnvelope);
18283 }
18284 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18285 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18286 }
18287 }
18288
18289 next_offset += envelope_size;
18290 _next_ordinal_to_read += 1;
18291 if next_offset >= end_offset {
18292 return Ok(());
18293 }
18294
18295 while _next_ordinal_to_read < 4 {
18297 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18298 _next_ordinal_to_read += 1;
18299 next_offset += envelope_size;
18300 }
18301
18302 let next_out_of_line = decoder.next_out_of_line();
18303 let handles_before = decoder.remaining_handles();
18304 if let Some((inlined, num_bytes, num_handles)) =
18305 fidl::encoding::decode_envelope_header(decoder, next_offset)?
18306 {
18307 let member_inline_size =
18308 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
18309 if inlined != (member_inline_size <= 4) {
18310 return Err(fidl::Error::InvalidInlineBitInEnvelope);
18311 }
18312 let inner_offset;
18313 let mut inner_depth = depth.clone();
18314 if inlined {
18315 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18316 inner_offset = next_offset;
18317 } else {
18318 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18319 inner_depth.increment()?;
18320 }
18321 let val_ref = self.p_base.get_or_insert_with(|| fidl::new_empty!(u32, D));
18322 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
18323 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18324 {
18325 return Err(fidl::Error::InvalidNumBytesInEnvelope);
18326 }
18327 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18328 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18329 }
18330 }
18331
18332 next_offset += envelope_size;
18333 _next_ordinal_to_read += 1;
18334 if next_offset >= end_offset {
18335 return Ok(());
18336 }
18337
18338 while _next_ordinal_to_read < 5 {
18340 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18341 _next_ordinal_to_read += 1;
18342 next_offset += envelope_size;
18343 }
18344
18345 let next_out_of_line = decoder.next_out_of_line();
18346 let handles_before = decoder.remaining_handles();
18347 if let Some((inlined, num_bytes, num_handles)) =
18348 fidl::encoding::decode_envelope_header(decoder, next_offset)?
18349 {
18350 let member_inline_size =
18351 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
18352 if inlined != (member_inline_size <= 4) {
18353 return Err(fidl::Error::InvalidInlineBitInEnvelope);
18354 }
18355 let inner_offset;
18356 let mut inner_depth = depth.clone();
18357 if inlined {
18358 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18359 inner_offset = next_offset;
18360 } else {
18361 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18362 inner_depth.increment()?;
18363 }
18364 let val_ref = self.p_min.get_or_insert_with(|| fidl::new_empty!(u32, D));
18365 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
18366 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18367 {
18368 return Err(fidl::Error::InvalidNumBytesInEnvelope);
18369 }
18370 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18371 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18372 }
18373 }
18374
18375 next_offset += envelope_size;
18376 _next_ordinal_to_read += 1;
18377 if next_offset >= end_offset {
18378 return Ok(());
18379 }
18380
18381 while _next_ordinal_to_read < 6 {
18383 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18384 _next_ordinal_to_read += 1;
18385 next_offset += envelope_size;
18386 }
18387
18388 let next_out_of_line = decoder.next_out_of_line();
18389 let handles_before = decoder.remaining_handles();
18390 if let Some((inlined, num_bytes, num_handles)) =
18391 fidl::encoding::decode_envelope_header(decoder, next_offset)?
18392 {
18393 let member_inline_size =
18394 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
18395 if inlined != (member_inline_size <= 4) {
18396 return Err(fidl::Error::InvalidInlineBitInEnvelope);
18397 }
18398 let inner_offset;
18399 let mut inner_depth = depth.clone();
18400 if inlined {
18401 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18402 inner_offset = next_offset;
18403 } else {
18404 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18405 inner_depth.increment()?;
18406 }
18407 let val_ref = self.p_max.get_or_insert_with(|| fidl::new_empty!(u32, D));
18408 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
18409 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18410 {
18411 return Err(fidl::Error::InvalidNumBytesInEnvelope);
18412 }
18413 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18414 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18415 }
18416 }
18417
18418 next_offset += envelope_size;
18419
18420 while next_offset < end_offset {
18422 _next_ordinal_to_read += 1;
18423 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18424 next_offset += envelope_size;
18425 }
18426
18427 Ok(())
18428 }
18429 }
18430
18431 impl HevcEncoderSettings {
18432 #[inline(always)]
18433 fn max_ordinal_present(&self) -> u64 {
18434 if let Some(_) = self.gop_size {
18435 return 3;
18436 }
18437 if let Some(_) = self.frame_rate {
18438 return 2;
18439 }
18440 if let Some(_) = self.bit_rate {
18441 return 1;
18442 }
18443 0
18444 }
18445 }
18446
18447 impl fidl::encoding::ValueTypeMarker for HevcEncoderSettings {
18448 type Borrowed<'a> = &'a Self;
18449 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
18450 value
18451 }
18452 }
18453
18454 unsafe impl fidl::encoding::TypeMarker for HevcEncoderSettings {
18455 type Owned = Self;
18456
18457 #[inline(always)]
18458 fn inline_align(_context: fidl::encoding::Context) -> usize {
18459 8
18460 }
18461
18462 #[inline(always)]
18463 fn inline_size(_context: fidl::encoding::Context) -> usize {
18464 16
18465 }
18466 }
18467
18468 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<HevcEncoderSettings, D>
18469 for &HevcEncoderSettings
18470 {
18471 unsafe fn encode(
18472 self,
18473 encoder: &mut fidl::encoding::Encoder<'_, D>,
18474 offset: usize,
18475 mut depth: fidl::encoding::Depth,
18476 ) -> fidl::Result<()> {
18477 encoder.debug_check_bounds::<HevcEncoderSettings>(offset);
18478 let max_ordinal: u64 = self.max_ordinal_present();
18480 encoder.write_num(max_ordinal, offset);
18481 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
18482 if max_ordinal == 0 {
18484 return Ok(());
18485 }
18486 depth.increment()?;
18487 let envelope_size = 8;
18488 let bytes_len = max_ordinal as usize * envelope_size;
18489 #[allow(unused_variables)]
18490 let offset = encoder.out_of_line_offset(bytes_len);
18491 let mut _prev_end_offset: usize = 0;
18492 if 1 > max_ordinal {
18493 return Ok(());
18494 }
18495
18496 let cur_offset: usize = (1 - 1) * envelope_size;
18499
18500 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18502
18503 fidl::encoding::encode_in_envelope_optional::<u32, D>(
18508 self.bit_rate.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
18509 encoder,
18510 offset + cur_offset,
18511 depth,
18512 )?;
18513
18514 _prev_end_offset = cur_offset + envelope_size;
18515 if 2 > max_ordinal {
18516 return Ok(());
18517 }
18518
18519 let cur_offset: usize = (2 - 1) * envelope_size;
18522
18523 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18525
18526 fidl::encoding::encode_in_envelope_optional::<u32, D>(
18531 self.frame_rate.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
18532 encoder,
18533 offset + cur_offset,
18534 depth,
18535 )?;
18536
18537 _prev_end_offset = cur_offset + envelope_size;
18538 if 3 > max_ordinal {
18539 return Ok(());
18540 }
18541
18542 let cur_offset: usize = (3 - 1) * envelope_size;
18545
18546 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18548
18549 fidl::encoding::encode_in_envelope_optional::<u32, D>(
18554 self.gop_size.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
18555 encoder,
18556 offset + cur_offset,
18557 depth,
18558 )?;
18559
18560 _prev_end_offset = cur_offset + envelope_size;
18561
18562 Ok(())
18563 }
18564 }
18565
18566 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for HevcEncoderSettings {
18567 #[inline(always)]
18568 fn new_empty() -> Self {
18569 Self::default()
18570 }
18571
18572 unsafe fn decode(
18573 &mut self,
18574 decoder: &mut fidl::encoding::Decoder<'_, D>,
18575 offset: usize,
18576 mut depth: fidl::encoding::Depth,
18577 ) -> fidl::Result<()> {
18578 decoder.debug_check_bounds::<Self>(offset);
18579 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
18580 None => return Err(fidl::Error::NotNullable),
18581 Some(len) => len,
18582 };
18583 if len == 0 {
18585 return Ok(());
18586 };
18587 depth.increment()?;
18588 let envelope_size = 8;
18589 let bytes_len = len * envelope_size;
18590 let offset = decoder.out_of_line_offset(bytes_len)?;
18591 let mut _next_ordinal_to_read = 0;
18593 let mut next_offset = offset;
18594 let end_offset = offset + bytes_len;
18595 _next_ordinal_to_read += 1;
18596 if next_offset >= end_offset {
18597 return Ok(());
18598 }
18599
18600 while _next_ordinal_to_read < 1 {
18602 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18603 _next_ordinal_to_read += 1;
18604 next_offset += envelope_size;
18605 }
18606
18607 let next_out_of_line = decoder.next_out_of_line();
18608 let handles_before = decoder.remaining_handles();
18609 if let Some((inlined, num_bytes, num_handles)) =
18610 fidl::encoding::decode_envelope_header(decoder, next_offset)?
18611 {
18612 let member_inline_size =
18613 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
18614 if inlined != (member_inline_size <= 4) {
18615 return Err(fidl::Error::InvalidInlineBitInEnvelope);
18616 }
18617 let inner_offset;
18618 let mut inner_depth = depth.clone();
18619 if inlined {
18620 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18621 inner_offset = next_offset;
18622 } else {
18623 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18624 inner_depth.increment()?;
18625 }
18626 let val_ref = self.bit_rate.get_or_insert_with(|| fidl::new_empty!(u32, D));
18627 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
18628 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18629 {
18630 return Err(fidl::Error::InvalidNumBytesInEnvelope);
18631 }
18632 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18633 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18634 }
18635 }
18636
18637 next_offset += envelope_size;
18638 _next_ordinal_to_read += 1;
18639 if next_offset >= end_offset {
18640 return Ok(());
18641 }
18642
18643 while _next_ordinal_to_read < 2 {
18645 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18646 _next_ordinal_to_read += 1;
18647 next_offset += envelope_size;
18648 }
18649
18650 let next_out_of_line = decoder.next_out_of_line();
18651 let handles_before = decoder.remaining_handles();
18652 if let Some((inlined, num_bytes, num_handles)) =
18653 fidl::encoding::decode_envelope_header(decoder, next_offset)?
18654 {
18655 let member_inline_size =
18656 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
18657 if inlined != (member_inline_size <= 4) {
18658 return Err(fidl::Error::InvalidInlineBitInEnvelope);
18659 }
18660 let inner_offset;
18661 let mut inner_depth = depth.clone();
18662 if inlined {
18663 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18664 inner_offset = next_offset;
18665 } else {
18666 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18667 inner_depth.increment()?;
18668 }
18669 let val_ref = self.frame_rate.get_or_insert_with(|| fidl::new_empty!(u32, D));
18670 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
18671 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18672 {
18673 return Err(fidl::Error::InvalidNumBytesInEnvelope);
18674 }
18675 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18676 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18677 }
18678 }
18679
18680 next_offset += envelope_size;
18681 _next_ordinal_to_read += 1;
18682 if next_offset >= end_offset {
18683 return Ok(());
18684 }
18685
18686 while _next_ordinal_to_read < 3 {
18688 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18689 _next_ordinal_to_read += 1;
18690 next_offset += envelope_size;
18691 }
18692
18693 let next_out_of_line = decoder.next_out_of_line();
18694 let handles_before = decoder.remaining_handles();
18695 if let Some((inlined, num_bytes, num_handles)) =
18696 fidl::encoding::decode_envelope_header(decoder, next_offset)?
18697 {
18698 let member_inline_size =
18699 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
18700 if inlined != (member_inline_size <= 4) {
18701 return Err(fidl::Error::InvalidInlineBitInEnvelope);
18702 }
18703 let inner_offset;
18704 let mut inner_depth = depth.clone();
18705 if inlined {
18706 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18707 inner_offset = next_offset;
18708 } else {
18709 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18710 inner_depth.increment()?;
18711 }
18712 let val_ref = self.gop_size.get_or_insert_with(|| fidl::new_empty!(u32, D));
18713 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
18714 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18715 {
18716 return Err(fidl::Error::InvalidNumBytesInEnvelope);
18717 }
18718 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18719 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18720 }
18721 }
18722
18723 next_offset += envelope_size;
18724
18725 while next_offset < end_offset {
18727 _next_ordinal_to_read += 1;
18728 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18729 next_offset += envelope_size;
18730 }
18731
18732 Ok(())
18733 }
18734 }
18735
18736 impl InputAudioCapturerConfiguration {
18737 #[inline(always)]
18738 fn max_ordinal_present(&self) -> u64 {
18739 if let Some(_) = self.usage2 {
18740 return 2;
18741 }
18742 if let Some(_) = self.usage {
18743 return 1;
18744 }
18745 0
18746 }
18747 }
18748
18749 impl fidl::encoding::ValueTypeMarker for InputAudioCapturerConfiguration {
18750 type Borrowed<'a> = &'a Self;
18751 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
18752 value
18753 }
18754 }
18755
18756 unsafe impl fidl::encoding::TypeMarker for InputAudioCapturerConfiguration {
18757 type Owned = Self;
18758
18759 #[inline(always)]
18760 fn inline_align(_context: fidl::encoding::Context) -> usize {
18761 8
18762 }
18763
18764 #[inline(always)]
18765 fn inline_size(_context: fidl::encoding::Context) -> usize {
18766 16
18767 }
18768 }
18769
18770 unsafe impl<D: fidl::encoding::ResourceDialect>
18771 fidl::encoding::Encode<InputAudioCapturerConfiguration, D>
18772 for &InputAudioCapturerConfiguration
18773 {
18774 unsafe fn encode(
18775 self,
18776 encoder: &mut fidl::encoding::Encoder<'_, D>,
18777 offset: usize,
18778 mut depth: fidl::encoding::Depth,
18779 ) -> fidl::Result<()> {
18780 encoder.debug_check_bounds::<InputAudioCapturerConfiguration>(offset);
18781 let max_ordinal: u64 = self.max_ordinal_present();
18783 encoder.write_num(max_ordinal, offset);
18784 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
18785 if max_ordinal == 0 {
18787 return Ok(());
18788 }
18789 depth.increment()?;
18790 let envelope_size = 8;
18791 let bytes_len = max_ordinal as usize * envelope_size;
18792 #[allow(unused_variables)]
18793 let offset = encoder.out_of_line_offset(bytes_len);
18794 let mut _prev_end_offset: usize = 0;
18795 if 1 > max_ordinal {
18796 return Ok(());
18797 }
18798
18799 let cur_offset: usize = (1 - 1) * envelope_size;
18802
18803 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18805
18806 fidl::encoding::encode_in_envelope_optional::<AudioCaptureUsage, D>(
18811 self.usage
18812 .as_ref()
18813 .map(<AudioCaptureUsage as fidl::encoding::ValueTypeMarker>::borrow),
18814 encoder,
18815 offset + cur_offset,
18816 depth,
18817 )?;
18818
18819 _prev_end_offset = cur_offset + envelope_size;
18820 if 2 > max_ordinal {
18821 return Ok(());
18822 }
18823
18824 let cur_offset: usize = (2 - 1) * envelope_size;
18827
18828 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18830
18831 fidl::encoding::encode_in_envelope_optional::<AudioCaptureUsage2, D>(
18836 self.usage2
18837 .as_ref()
18838 .map(<AudioCaptureUsage2 as fidl::encoding::ValueTypeMarker>::borrow),
18839 encoder,
18840 offset + cur_offset,
18841 depth,
18842 )?;
18843
18844 _prev_end_offset = cur_offset + envelope_size;
18845
18846 Ok(())
18847 }
18848 }
18849
18850 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
18851 for InputAudioCapturerConfiguration
18852 {
18853 #[inline(always)]
18854 fn new_empty() -> Self {
18855 Self::default()
18856 }
18857
18858 unsafe fn decode(
18859 &mut self,
18860 decoder: &mut fidl::encoding::Decoder<'_, D>,
18861 offset: usize,
18862 mut depth: fidl::encoding::Depth,
18863 ) -> fidl::Result<()> {
18864 decoder.debug_check_bounds::<Self>(offset);
18865 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
18866 None => return Err(fidl::Error::NotNullable),
18867 Some(len) => len,
18868 };
18869 if len == 0 {
18871 return Ok(());
18872 };
18873 depth.increment()?;
18874 let envelope_size = 8;
18875 let bytes_len = len * envelope_size;
18876 let offset = decoder.out_of_line_offset(bytes_len)?;
18877 let mut _next_ordinal_to_read = 0;
18879 let mut next_offset = offset;
18880 let end_offset = offset + bytes_len;
18881 _next_ordinal_to_read += 1;
18882 if next_offset >= end_offset {
18883 return Ok(());
18884 }
18885
18886 while _next_ordinal_to_read < 1 {
18888 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18889 _next_ordinal_to_read += 1;
18890 next_offset += envelope_size;
18891 }
18892
18893 let next_out_of_line = decoder.next_out_of_line();
18894 let handles_before = decoder.remaining_handles();
18895 if let Some((inlined, num_bytes, num_handles)) =
18896 fidl::encoding::decode_envelope_header(decoder, next_offset)?
18897 {
18898 let member_inline_size =
18899 <AudioCaptureUsage as fidl::encoding::TypeMarker>::inline_size(decoder.context);
18900 if inlined != (member_inline_size <= 4) {
18901 return Err(fidl::Error::InvalidInlineBitInEnvelope);
18902 }
18903 let inner_offset;
18904 let mut inner_depth = depth.clone();
18905 if inlined {
18906 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18907 inner_offset = next_offset;
18908 } else {
18909 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18910 inner_depth.increment()?;
18911 }
18912 let val_ref =
18913 self.usage.get_or_insert_with(|| fidl::new_empty!(AudioCaptureUsage, D));
18914 fidl::decode!(AudioCaptureUsage, D, val_ref, decoder, inner_offset, inner_depth)?;
18915 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18916 {
18917 return Err(fidl::Error::InvalidNumBytesInEnvelope);
18918 }
18919 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18920 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18921 }
18922 }
18923
18924 next_offset += envelope_size;
18925 _next_ordinal_to_read += 1;
18926 if next_offset >= end_offset {
18927 return Ok(());
18928 }
18929
18930 while _next_ordinal_to_read < 2 {
18932 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18933 _next_ordinal_to_read += 1;
18934 next_offset += envelope_size;
18935 }
18936
18937 let next_out_of_line = decoder.next_out_of_line();
18938 let handles_before = decoder.remaining_handles();
18939 if let Some((inlined, num_bytes, num_handles)) =
18940 fidl::encoding::decode_envelope_header(decoder, next_offset)?
18941 {
18942 let member_inline_size =
18943 <AudioCaptureUsage2 as fidl::encoding::TypeMarker>::inline_size(
18944 decoder.context,
18945 );
18946 if inlined != (member_inline_size <= 4) {
18947 return Err(fidl::Error::InvalidInlineBitInEnvelope);
18948 }
18949 let inner_offset;
18950 let mut inner_depth = depth.clone();
18951 if inlined {
18952 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18953 inner_offset = next_offset;
18954 } else {
18955 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18956 inner_depth.increment()?;
18957 }
18958 let val_ref =
18959 self.usage2.get_or_insert_with(|| fidl::new_empty!(AudioCaptureUsage2, D));
18960 fidl::decode!(AudioCaptureUsage2, D, val_ref, decoder, inner_offset, inner_depth)?;
18961 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18962 {
18963 return Err(fidl::Error::InvalidNumBytesInEnvelope);
18964 }
18965 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18966 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18967 }
18968 }
18969
18970 next_offset += envelope_size;
18971
18972 while next_offset < end_offset {
18974 _next_ordinal_to_read += 1;
18975 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18976 next_offset += envelope_size;
18977 }
18978
18979 Ok(())
18980 }
18981 }
18982
18983 impl Lc3EncoderSettings {
18984 #[inline(always)]
18985 fn max_ordinal_present(&self) -> u64 {
18986 if let Some(_) = self.frame_duration {
18987 return 2;
18988 }
18989 if let Some(_) = self.nbytes {
18990 return 1;
18991 }
18992 0
18993 }
18994 }
18995
18996 impl fidl::encoding::ValueTypeMarker for Lc3EncoderSettings {
18997 type Borrowed<'a> = &'a Self;
18998 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
18999 value
19000 }
19001 }
19002
19003 unsafe impl fidl::encoding::TypeMarker for Lc3EncoderSettings {
19004 type Owned = Self;
19005
19006 #[inline(always)]
19007 fn inline_align(_context: fidl::encoding::Context) -> usize {
19008 8
19009 }
19010
19011 #[inline(always)]
19012 fn inline_size(_context: fidl::encoding::Context) -> usize {
19013 16
19014 }
19015 }
19016
19017 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Lc3EncoderSettings, D>
19018 for &Lc3EncoderSettings
19019 {
19020 unsafe fn encode(
19021 self,
19022 encoder: &mut fidl::encoding::Encoder<'_, D>,
19023 offset: usize,
19024 mut depth: fidl::encoding::Depth,
19025 ) -> fidl::Result<()> {
19026 encoder.debug_check_bounds::<Lc3EncoderSettings>(offset);
19027 let max_ordinal: u64 = self.max_ordinal_present();
19029 encoder.write_num(max_ordinal, offset);
19030 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
19031 if max_ordinal == 0 {
19033 return Ok(());
19034 }
19035 depth.increment()?;
19036 let envelope_size = 8;
19037 let bytes_len = max_ordinal as usize * envelope_size;
19038 #[allow(unused_variables)]
19039 let offset = encoder.out_of_line_offset(bytes_len);
19040 let mut _prev_end_offset: usize = 0;
19041 if 1 > max_ordinal {
19042 return Ok(());
19043 }
19044
19045 let cur_offset: usize = (1 - 1) * envelope_size;
19048
19049 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
19051
19052 fidl::encoding::encode_in_envelope_optional::<u16, D>(
19057 self.nbytes.as_ref().map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
19058 encoder,
19059 offset + cur_offset,
19060 depth,
19061 )?;
19062
19063 _prev_end_offset = cur_offset + envelope_size;
19064 if 2 > max_ordinal {
19065 return Ok(());
19066 }
19067
19068 let cur_offset: usize = (2 - 1) * envelope_size;
19071
19072 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
19074
19075 fidl::encoding::encode_in_envelope_optional::<Lc3FrameDuration, D>(
19080 self.frame_duration
19081 .as_ref()
19082 .map(<Lc3FrameDuration as fidl::encoding::ValueTypeMarker>::borrow),
19083 encoder,
19084 offset + cur_offset,
19085 depth,
19086 )?;
19087
19088 _prev_end_offset = cur_offset + envelope_size;
19089
19090 Ok(())
19091 }
19092 }
19093
19094 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Lc3EncoderSettings {
19095 #[inline(always)]
19096 fn new_empty() -> Self {
19097 Self::default()
19098 }
19099
19100 unsafe fn decode(
19101 &mut self,
19102 decoder: &mut fidl::encoding::Decoder<'_, D>,
19103 offset: usize,
19104 mut depth: fidl::encoding::Depth,
19105 ) -> fidl::Result<()> {
19106 decoder.debug_check_bounds::<Self>(offset);
19107 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
19108 None => return Err(fidl::Error::NotNullable),
19109 Some(len) => len,
19110 };
19111 if len == 0 {
19113 return Ok(());
19114 };
19115 depth.increment()?;
19116 let envelope_size = 8;
19117 let bytes_len = len * envelope_size;
19118 let offset = decoder.out_of_line_offset(bytes_len)?;
19119 let mut _next_ordinal_to_read = 0;
19121 let mut next_offset = offset;
19122 let end_offset = offset + bytes_len;
19123 _next_ordinal_to_read += 1;
19124 if next_offset >= end_offset {
19125 return Ok(());
19126 }
19127
19128 while _next_ordinal_to_read < 1 {
19130 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
19131 _next_ordinal_to_read += 1;
19132 next_offset += envelope_size;
19133 }
19134
19135 let next_out_of_line = decoder.next_out_of_line();
19136 let handles_before = decoder.remaining_handles();
19137 if let Some((inlined, num_bytes, num_handles)) =
19138 fidl::encoding::decode_envelope_header(decoder, next_offset)?
19139 {
19140 let member_inline_size =
19141 <u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
19142 if inlined != (member_inline_size <= 4) {
19143 return Err(fidl::Error::InvalidInlineBitInEnvelope);
19144 }
19145 let inner_offset;
19146 let mut inner_depth = depth.clone();
19147 if inlined {
19148 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
19149 inner_offset = next_offset;
19150 } else {
19151 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
19152 inner_depth.increment()?;
19153 }
19154 let val_ref = self.nbytes.get_or_insert_with(|| fidl::new_empty!(u16, D));
19155 fidl::decode!(u16, D, val_ref, decoder, inner_offset, inner_depth)?;
19156 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
19157 {
19158 return Err(fidl::Error::InvalidNumBytesInEnvelope);
19159 }
19160 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
19161 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
19162 }
19163 }
19164
19165 next_offset += envelope_size;
19166 _next_ordinal_to_read += 1;
19167 if next_offset >= end_offset {
19168 return Ok(());
19169 }
19170
19171 while _next_ordinal_to_read < 2 {
19173 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
19174 _next_ordinal_to_read += 1;
19175 next_offset += envelope_size;
19176 }
19177
19178 let next_out_of_line = decoder.next_out_of_line();
19179 let handles_before = decoder.remaining_handles();
19180 if let Some((inlined, num_bytes, num_handles)) =
19181 fidl::encoding::decode_envelope_header(decoder, next_offset)?
19182 {
19183 let member_inline_size =
19184 <Lc3FrameDuration as fidl::encoding::TypeMarker>::inline_size(decoder.context);
19185 if inlined != (member_inline_size <= 4) {
19186 return Err(fidl::Error::InvalidInlineBitInEnvelope);
19187 }
19188 let inner_offset;
19189 let mut inner_depth = depth.clone();
19190 if inlined {
19191 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
19192 inner_offset = next_offset;
19193 } else {
19194 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
19195 inner_depth.increment()?;
19196 }
19197 let val_ref = self
19198 .frame_duration
19199 .get_or_insert_with(|| fidl::new_empty!(Lc3FrameDuration, D));
19200 fidl::decode!(Lc3FrameDuration, D, val_ref, decoder, inner_offset, inner_depth)?;
19201 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
19202 {
19203 return Err(fidl::Error::InvalidNumBytesInEnvelope);
19204 }
19205 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
19206 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
19207 }
19208 }
19209
19210 next_offset += envelope_size;
19211
19212 while next_offset < end_offset {
19214 _next_ordinal_to_read += 1;
19215 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
19216 next_offset += envelope_size;
19217 }
19218
19219 Ok(())
19220 }
19221 }
19222
19223 impl LoopbackAudioCapturerConfiguration {
19224 #[inline(always)]
19225 fn max_ordinal_present(&self) -> u64 {
19226 0
19227 }
19228 }
19229
19230 impl fidl::encoding::ValueTypeMarker for LoopbackAudioCapturerConfiguration {
19231 type Borrowed<'a> = &'a Self;
19232 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
19233 value
19234 }
19235 }
19236
19237 unsafe impl fidl::encoding::TypeMarker for LoopbackAudioCapturerConfiguration {
19238 type Owned = Self;
19239
19240 #[inline(always)]
19241 fn inline_align(_context: fidl::encoding::Context) -> usize {
19242 8
19243 }
19244
19245 #[inline(always)]
19246 fn inline_size(_context: fidl::encoding::Context) -> usize {
19247 16
19248 }
19249 }
19250
19251 unsafe impl<D: fidl::encoding::ResourceDialect>
19252 fidl::encoding::Encode<LoopbackAudioCapturerConfiguration, D>
19253 for &LoopbackAudioCapturerConfiguration
19254 {
19255 unsafe fn encode(
19256 self,
19257 encoder: &mut fidl::encoding::Encoder<'_, D>,
19258 offset: usize,
19259 mut depth: fidl::encoding::Depth,
19260 ) -> fidl::Result<()> {
19261 encoder.debug_check_bounds::<LoopbackAudioCapturerConfiguration>(offset);
19262 let max_ordinal: u64 = self.max_ordinal_present();
19264 encoder.write_num(max_ordinal, offset);
19265 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
19266 if max_ordinal == 0 {
19268 return Ok(());
19269 }
19270 depth.increment()?;
19271 let envelope_size = 8;
19272 let bytes_len = max_ordinal as usize * envelope_size;
19273 #[allow(unused_variables)]
19274 let offset = encoder.out_of_line_offset(bytes_len);
19275 let mut _prev_end_offset: usize = 0;
19276
19277 Ok(())
19278 }
19279 }
19280
19281 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
19282 for LoopbackAudioCapturerConfiguration
19283 {
19284 #[inline(always)]
19285 fn new_empty() -> Self {
19286 Self::default()
19287 }
19288
19289 unsafe fn decode(
19290 &mut self,
19291 decoder: &mut fidl::encoding::Decoder<'_, D>,
19292 offset: usize,
19293 mut depth: fidl::encoding::Depth,
19294 ) -> fidl::Result<()> {
19295 decoder.debug_check_bounds::<Self>(offset);
19296 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
19297 None => return Err(fidl::Error::NotNullable),
19298 Some(len) => len,
19299 };
19300 if len == 0 {
19302 return Ok(());
19303 };
19304 depth.increment()?;
19305 let envelope_size = 8;
19306 let bytes_len = len * envelope_size;
19307 let offset = decoder.out_of_line_offset(bytes_len)?;
19308 let mut _next_ordinal_to_read = 0;
19310 let mut next_offset = offset;
19311 let end_offset = offset + bytes_len;
19312
19313 while next_offset < end_offset {
19315 _next_ordinal_to_read += 1;
19316 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
19317 next_offset += envelope_size;
19318 }
19319
19320 Ok(())
19321 }
19322 }
19323
19324 impl MSbcEncoderSettings {
19325 #[inline(always)]
19326 fn max_ordinal_present(&self) -> u64 {
19327 0
19328 }
19329 }
19330
19331 impl fidl::encoding::ValueTypeMarker for MSbcEncoderSettings {
19332 type Borrowed<'a> = &'a Self;
19333 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
19334 value
19335 }
19336 }
19337
19338 unsafe impl fidl::encoding::TypeMarker for MSbcEncoderSettings {
19339 type Owned = Self;
19340
19341 #[inline(always)]
19342 fn inline_align(_context: fidl::encoding::Context) -> usize {
19343 8
19344 }
19345
19346 #[inline(always)]
19347 fn inline_size(_context: fidl::encoding::Context) -> usize {
19348 16
19349 }
19350 }
19351
19352 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<MSbcEncoderSettings, D>
19353 for &MSbcEncoderSettings
19354 {
19355 unsafe fn encode(
19356 self,
19357 encoder: &mut fidl::encoding::Encoder<'_, D>,
19358 offset: usize,
19359 mut depth: fidl::encoding::Depth,
19360 ) -> fidl::Result<()> {
19361 encoder.debug_check_bounds::<MSbcEncoderSettings>(offset);
19362 let max_ordinal: u64 = self.max_ordinal_present();
19364 encoder.write_num(max_ordinal, offset);
19365 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
19366 if max_ordinal == 0 {
19368 return Ok(());
19369 }
19370 depth.increment()?;
19371 let envelope_size = 8;
19372 let bytes_len = max_ordinal as usize * envelope_size;
19373 #[allow(unused_variables)]
19374 let offset = encoder.out_of_line_offset(bytes_len);
19375 let mut _prev_end_offset: usize = 0;
19376
19377 Ok(())
19378 }
19379 }
19380
19381 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for MSbcEncoderSettings {
19382 #[inline(always)]
19383 fn new_empty() -> Self {
19384 Self::default()
19385 }
19386
19387 unsafe fn decode(
19388 &mut self,
19389 decoder: &mut fidl::encoding::Decoder<'_, D>,
19390 offset: usize,
19391 mut depth: fidl::encoding::Depth,
19392 ) -> fidl::Result<()> {
19393 decoder.debug_check_bounds::<Self>(offset);
19394 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
19395 None => return Err(fidl::Error::NotNullable),
19396 Some(len) => len,
19397 };
19398 if len == 0 {
19400 return Ok(());
19401 };
19402 depth.increment()?;
19403 let envelope_size = 8;
19404 let bytes_len = len * envelope_size;
19405 let offset = decoder.out_of_line_offset(bytes_len)?;
19406 let mut _next_ordinal_to_read = 0;
19408 let mut next_offset = offset;
19409 let end_offset = offset + bytes_len;
19410
19411 while next_offset < end_offset {
19413 _next_ordinal_to_read += 1;
19414 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
19415 next_offset += envelope_size;
19416 }
19417
19418 Ok(())
19419 }
19420 }
19421
19422 impl Packet {
19423 #[inline(always)]
19424 fn max_ordinal_present(&self) -> u64 {
19425 if let Some(_) = self.key_frame {
19426 return 9;
19427 }
19428 if let Some(_) = self.known_end_access_unit {
19429 return 8;
19430 }
19431 if let Some(_) = self.start_access_unit {
19432 return 7;
19433 }
19434 if let Some(_) = self.timestamp_ish {
19435 return 6;
19436 }
19437 if let Some(_) = self.valid_length_bytes {
19438 return 5;
19439 }
19440 if let Some(_) = self.start_offset {
19441 return 4;
19442 }
19443 if let Some(_) = self.stream_lifetime_ordinal {
19444 return 3;
19445 }
19446 if let Some(_) = self.buffer_index {
19447 return 2;
19448 }
19449 if let Some(_) = self.header {
19450 return 1;
19451 }
19452 0
19453 }
19454 }
19455
19456 impl fidl::encoding::ValueTypeMarker for Packet {
19457 type Borrowed<'a> = &'a Self;
19458 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
19459 value
19460 }
19461 }
19462
19463 unsafe impl fidl::encoding::TypeMarker for Packet {
19464 type Owned = Self;
19465
19466 #[inline(always)]
19467 fn inline_align(_context: fidl::encoding::Context) -> usize {
19468 8
19469 }
19470
19471 #[inline(always)]
19472 fn inline_size(_context: fidl::encoding::Context) -> usize {
19473 16
19474 }
19475 }
19476
19477 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Packet, D> for &Packet {
19478 unsafe fn encode(
19479 self,
19480 encoder: &mut fidl::encoding::Encoder<'_, D>,
19481 offset: usize,
19482 mut depth: fidl::encoding::Depth,
19483 ) -> fidl::Result<()> {
19484 encoder.debug_check_bounds::<Packet>(offset);
19485 let max_ordinal: u64 = self.max_ordinal_present();
19487 encoder.write_num(max_ordinal, offset);
19488 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
19489 if max_ordinal == 0 {
19491 return Ok(());
19492 }
19493 depth.increment()?;
19494 let envelope_size = 8;
19495 let bytes_len = max_ordinal as usize * envelope_size;
19496 #[allow(unused_variables)]
19497 let offset = encoder.out_of_line_offset(bytes_len);
19498 let mut _prev_end_offset: usize = 0;
19499 if 1 > max_ordinal {
19500 return Ok(());
19501 }
19502
19503 let cur_offset: usize = (1 - 1) * envelope_size;
19506
19507 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
19509
19510 fidl::encoding::encode_in_envelope_optional::<PacketHeader, D>(
19515 self.header.as_ref().map(<PacketHeader as fidl::encoding::ValueTypeMarker>::borrow),
19516 encoder,
19517 offset + cur_offset,
19518 depth,
19519 )?;
19520
19521 _prev_end_offset = cur_offset + envelope_size;
19522 if 2 > max_ordinal {
19523 return Ok(());
19524 }
19525
19526 let cur_offset: usize = (2 - 1) * envelope_size;
19529
19530 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
19532
19533 fidl::encoding::encode_in_envelope_optional::<u32, D>(
19538 self.buffer_index.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
19539 encoder,
19540 offset + cur_offset,
19541 depth,
19542 )?;
19543
19544 _prev_end_offset = cur_offset + envelope_size;
19545 if 3 > max_ordinal {
19546 return Ok(());
19547 }
19548
19549 let cur_offset: usize = (3 - 1) * envelope_size;
19552
19553 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
19555
19556 fidl::encoding::encode_in_envelope_optional::<u64, D>(
19561 self.stream_lifetime_ordinal
19562 .as_ref()
19563 .map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
19564 encoder,
19565 offset + cur_offset,
19566 depth,
19567 )?;
19568
19569 _prev_end_offset = cur_offset + envelope_size;
19570 if 4 > max_ordinal {
19571 return Ok(());
19572 }
19573
19574 let cur_offset: usize = (4 - 1) * envelope_size;
19577
19578 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
19580
19581 fidl::encoding::encode_in_envelope_optional::<u32, D>(
19586 self.start_offset.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
19587 encoder,
19588 offset + cur_offset,
19589 depth,
19590 )?;
19591
19592 _prev_end_offset = cur_offset + envelope_size;
19593 if 5 > max_ordinal {
19594 return Ok(());
19595 }
19596
19597 let cur_offset: usize = (5 - 1) * envelope_size;
19600
19601 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
19603
19604 fidl::encoding::encode_in_envelope_optional::<u32, D>(
19609 self.valid_length_bytes
19610 .as_ref()
19611 .map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
19612 encoder,
19613 offset + cur_offset,
19614 depth,
19615 )?;
19616
19617 _prev_end_offset = cur_offset + envelope_size;
19618 if 6 > max_ordinal {
19619 return Ok(());
19620 }
19621
19622 let cur_offset: usize = (6 - 1) * envelope_size;
19625
19626 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
19628
19629 fidl::encoding::encode_in_envelope_optional::<u64, D>(
19634 self.timestamp_ish.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
19635 encoder,
19636 offset + cur_offset,
19637 depth,
19638 )?;
19639
19640 _prev_end_offset = cur_offset + envelope_size;
19641 if 7 > max_ordinal {
19642 return Ok(());
19643 }
19644
19645 let cur_offset: usize = (7 - 1) * envelope_size;
19648
19649 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
19651
19652 fidl::encoding::encode_in_envelope_optional::<bool, D>(
19657 self.start_access_unit
19658 .as_ref()
19659 .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
19660 encoder,
19661 offset + cur_offset,
19662 depth,
19663 )?;
19664
19665 _prev_end_offset = cur_offset + envelope_size;
19666 if 8 > max_ordinal {
19667 return Ok(());
19668 }
19669
19670 let cur_offset: usize = (8 - 1) * envelope_size;
19673
19674 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
19676
19677 fidl::encoding::encode_in_envelope_optional::<bool, D>(
19682 self.known_end_access_unit
19683 .as_ref()
19684 .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
19685 encoder,
19686 offset + cur_offset,
19687 depth,
19688 )?;
19689
19690 _prev_end_offset = cur_offset + envelope_size;
19691 if 9 > max_ordinal {
19692 return Ok(());
19693 }
19694
19695 let cur_offset: usize = (9 - 1) * envelope_size;
19698
19699 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
19701
19702 fidl::encoding::encode_in_envelope_optional::<bool, D>(
19707 self.key_frame.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
19708 encoder,
19709 offset + cur_offset,
19710 depth,
19711 )?;
19712
19713 _prev_end_offset = cur_offset + envelope_size;
19714
19715 Ok(())
19716 }
19717 }
19718
19719 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Packet {
19720 #[inline(always)]
19721 fn new_empty() -> Self {
19722 Self::default()
19723 }
19724
19725 unsafe fn decode(
19726 &mut self,
19727 decoder: &mut fidl::encoding::Decoder<'_, D>,
19728 offset: usize,
19729 mut depth: fidl::encoding::Depth,
19730 ) -> fidl::Result<()> {
19731 decoder.debug_check_bounds::<Self>(offset);
19732 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
19733 None => return Err(fidl::Error::NotNullable),
19734 Some(len) => len,
19735 };
19736 if len == 0 {
19738 return Ok(());
19739 };
19740 depth.increment()?;
19741 let envelope_size = 8;
19742 let bytes_len = len * envelope_size;
19743 let offset = decoder.out_of_line_offset(bytes_len)?;
19744 let mut _next_ordinal_to_read = 0;
19746 let mut next_offset = offset;
19747 let end_offset = offset + bytes_len;
19748 _next_ordinal_to_read += 1;
19749 if next_offset >= end_offset {
19750 return Ok(());
19751 }
19752
19753 while _next_ordinal_to_read < 1 {
19755 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
19756 _next_ordinal_to_read += 1;
19757 next_offset += envelope_size;
19758 }
19759
19760 let next_out_of_line = decoder.next_out_of_line();
19761 let handles_before = decoder.remaining_handles();
19762 if let Some((inlined, num_bytes, num_handles)) =
19763 fidl::encoding::decode_envelope_header(decoder, next_offset)?
19764 {
19765 let member_inline_size =
19766 <PacketHeader as fidl::encoding::TypeMarker>::inline_size(decoder.context);
19767 if inlined != (member_inline_size <= 4) {
19768 return Err(fidl::Error::InvalidInlineBitInEnvelope);
19769 }
19770 let inner_offset;
19771 let mut inner_depth = depth.clone();
19772 if inlined {
19773 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
19774 inner_offset = next_offset;
19775 } else {
19776 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
19777 inner_depth.increment()?;
19778 }
19779 let val_ref = self.header.get_or_insert_with(|| fidl::new_empty!(PacketHeader, D));
19780 fidl::decode!(PacketHeader, D, val_ref, decoder, inner_offset, inner_depth)?;
19781 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
19782 {
19783 return Err(fidl::Error::InvalidNumBytesInEnvelope);
19784 }
19785 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
19786 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
19787 }
19788 }
19789
19790 next_offset += envelope_size;
19791 _next_ordinal_to_read += 1;
19792 if next_offset >= end_offset {
19793 return Ok(());
19794 }
19795
19796 while _next_ordinal_to_read < 2 {
19798 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
19799 _next_ordinal_to_read += 1;
19800 next_offset += envelope_size;
19801 }
19802
19803 let next_out_of_line = decoder.next_out_of_line();
19804 let handles_before = decoder.remaining_handles();
19805 if let Some((inlined, num_bytes, num_handles)) =
19806 fidl::encoding::decode_envelope_header(decoder, next_offset)?
19807 {
19808 let member_inline_size =
19809 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
19810 if inlined != (member_inline_size <= 4) {
19811 return Err(fidl::Error::InvalidInlineBitInEnvelope);
19812 }
19813 let inner_offset;
19814 let mut inner_depth = depth.clone();
19815 if inlined {
19816 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
19817 inner_offset = next_offset;
19818 } else {
19819 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
19820 inner_depth.increment()?;
19821 }
19822 let val_ref = self.buffer_index.get_or_insert_with(|| fidl::new_empty!(u32, D));
19823 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
19824 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
19825 {
19826 return Err(fidl::Error::InvalidNumBytesInEnvelope);
19827 }
19828 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
19829 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
19830 }
19831 }
19832
19833 next_offset += envelope_size;
19834 _next_ordinal_to_read += 1;
19835 if next_offset >= end_offset {
19836 return Ok(());
19837 }
19838
19839 while _next_ordinal_to_read < 3 {
19841 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
19842 _next_ordinal_to_read += 1;
19843 next_offset += envelope_size;
19844 }
19845
19846 let next_out_of_line = decoder.next_out_of_line();
19847 let handles_before = decoder.remaining_handles();
19848 if let Some((inlined, num_bytes, num_handles)) =
19849 fidl::encoding::decode_envelope_header(decoder, next_offset)?
19850 {
19851 let member_inline_size =
19852 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
19853 if inlined != (member_inline_size <= 4) {
19854 return Err(fidl::Error::InvalidInlineBitInEnvelope);
19855 }
19856 let inner_offset;
19857 let mut inner_depth = depth.clone();
19858 if inlined {
19859 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
19860 inner_offset = next_offset;
19861 } else {
19862 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
19863 inner_depth.increment()?;
19864 }
19865 let val_ref =
19866 self.stream_lifetime_ordinal.get_or_insert_with(|| fidl::new_empty!(u64, D));
19867 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
19868 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
19869 {
19870 return Err(fidl::Error::InvalidNumBytesInEnvelope);
19871 }
19872 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
19873 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
19874 }
19875 }
19876
19877 next_offset += envelope_size;
19878 _next_ordinal_to_read += 1;
19879 if next_offset >= end_offset {
19880 return Ok(());
19881 }
19882
19883 while _next_ordinal_to_read < 4 {
19885 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
19886 _next_ordinal_to_read += 1;
19887 next_offset += envelope_size;
19888 }
19889
19890 let next_out_of_line = decoder.next_out_of_line();
19891 let handles_before = decoder.remaining_handles();
19892 if let Some((inlined, num_bytes, num_handles)) =
19893 fidl::encoding::decode_envelope_header(decoder, next_offset)?
19894 {
19895 let member_inline_size =
19896 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
19897 if inlined != (member_inline_size <= 4) {
19898 return Err(fidl::Error::InvalidInlineBitInEnvelope);
19899 }
19900 let inner_offset;
19901 let mut inner_depth = depth.clone();
19902 if inlined {
19903 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
19904 inner_offset = next_offset;
19905 } else {
19906 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
19907 inner_depth.increment()?;
19908 }
19909 let val_ref = self.start_offset.get_or_insert_with(|| fidl::new_empty!(u32, D));
19910 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
19911 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
19912 {
19913 return Err(fidl::Error::InvalidNumBytesInEnvelope);
19914 }
19915 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
19916 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
19917 }
19918 }
19919
19920 next_offset += envelope_size;
19921 _next_ordinal_to_read += 1;
19922 if next_offset >= end_offset {
19923 return Ok(());
19924 }
19925
19926 while _next_ordinal_to_read < 5 {
19928 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
19929 _next_ordinal_to_read += 1;
19930 next_offset += envelope_size;
19931 }
19932
19933 let next_out_of_line = decoder.next_out_of_line();
19934 let handles_before = decoder.remaining_handles();
19935 if let Some((inlined, num_bytes, num_handles)) =
19936 fidl::encoding::decode_envelope_header(decoder, next_offset)?
19937 {
19938 let member_inline_size =
19939 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
19940 if inlined != (member_inline_size <= 4) {
19941 return Err(fidl::Error::InvalidInlineBitInEnvelope);
19942 }
19943 let inner_offset;
19944 let mut inner_depth = depth.clone();
19945 if inlined {
19946 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
19947 inner_offset = next_offset;
19948 } else {
19949 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
19950 inner_depth.increment()?;
19951 }
19952 let val_ref =
19953 self.valid_length_bytes.get_or_insert_with(|| fidl::new_empty!(u32, D));
19954 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
19955 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
19956 {
19957 return Err(fidl::Error::InvalidNumBytesInEnvelope);
19958 }
19959 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
19960 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
19961 }
19962 }
19963
19964 next_offset += envelope_size;
19965 _next_ordinal_to_read += 1;
19966 if next_offset >= end_offset {
19967 return Ok(());
19968 }
19969
19970 while _next_ordinal_to_read < 6 {
19972 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
19973 _next_ordinal_to_read += 1;
19974 next_offset += envelope_size;
19975 }
19976
19977 let next_out_of_line = decoder.next_out_of_line();
19978 let handles_before = decoder.remaining_handles();
19979 if let Some((inlined, num_bytes, num_handles)) =
19980 fidl::encoding::decode_envelope_header(decoder, next_offset)?
19981 {
19982 let member_inline_size =
19983 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
19984 if inlined != (member_inline_size <= 4) {
19985 return Err(fidl::Error::InvalidInlineBitInEnvelope);
19986 }
19987 let inner_offset;
19988 let mut inner_depth = depth.clone();
19989 if inlined {
19990 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
19991 inner_offset = next_offset;
19992 } else {
19993 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
19994 inner_depth.increment()?;
19995 }
19996 let val_ref = self.timestamp_ish.get_or_insert_with(|| fidl::new_empty!(u64, D));
19997 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
19998 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
19999 {
20000 return Err(fidl::Error::InvalidNumBytesInEnvelope);
20001 }
20002 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
20003 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
20004 }
20005 }
20006
20007 next_offset += envelope_size;
20008 _next_ordinal_to_read += 1;
20009 if next_offset >= end_offset {
20010 return Ok(());
20011 }
20012
20013 while _next_ordinal_to_read < 7 {
20015 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
20016 _next_ordinal_to_read += 1;
20017 next_offset += envelope_size;
20018 }
20019
20020 let next_out_of_line = decoder.next_out_of_line();
20021 let handles_before = decoder.remaining_handles();
20022 if let Some((inlined, num_bytes, num_handles)) =
20023 fidl::encoding::decode_envelope_header(decoder, next_offset)?
20024 {
20025 let member_inline_size =
20026 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
20027 if inlined != (member_inline_size <= 4) {
20028 return Err(fidl::Error::InvalidInlineBitInEnvelope);
20029 }
20030 let inner_offset;
20031 let mut inner_depth = depth.clone();
20032 if inlined {
20033 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
20034 inner_offset = next_offset;
20035 } else {
20036 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
20037 inner_depth.increment()?;
20038 }
20039 let val_ref =
20040 self.start_access_unit.get_or_insert_with(|| fidl::new_empty!(bool, D));
20041 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
20042 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
20043 {
20044 return Err(fidl::Error::InvalidNumBytesInEnvelope);
20045 }
20046 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
20047 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
20048 }
20049 }
20050
20051 next_offset += envelope_size;
20052 _next_ordinal_to_read += 1;
20053 if next_offset >= end_offset {
20054 return Ok(());
20055 }
20056
20057 while _next_ordinal_to_read < 8 {
20059 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
20060 _next_ordinal_to_read += 1;
20061 next_offset += envelope_size;
20062 }
20063
20064 let next_out_of_line = decoder.next_out_of_line();
20065 let handles_before = decoder.remaining_handles();
20066 if let Some((inlined, num_bytes, num_handles)) =
20067 fidl::encoding::decode_envelope_header(decoder, next_offset)?
20068 {
20069 let member_inline_size =
20070 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
20071 if inlined != (member_inline_size <= 4) {
20072 return Err(fidl::Error::InvalidInlineBitInEnvelope);
20073 }
20074 let inner_offset;
20075 let mut inner_depth = depth.clone();
20076 if inlined {
20077 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
20078 inner_offset = next_offset;
20079 } else {
20080 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
20081 inner_depth.increment()?;
20082 }
20083 let val_ref =
20084 self.known_end_access_unit.get_or_insert_with(|| fidl::new_empty!(bool, D));
20085 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
20086 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
20087 {
20088 return Err(fidl::Error::InvalidNumBytesInEnvelope);
20089 }
20090 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
20091 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
20092 }
20093 }
20094
20095 next_offset += envelope_size;
20096 _next_ordinal_to_read += 1;
20097 if next_offset >= end_offset {
20098 return Ok(());
20099 }
20100
20101 while _next_ordinal_to_read < 9 {
20103 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
20104 _next_ordinal_to_read += 1;
20105 next_offset += envelope_size;
20106 }
20107
20108 let next_out_of_line = decoder.next_out_of_line();
20109 let handles_before = decoder.remaining_handles();
20110 if let Some((inlined, num_bytes, num_handles)) =
20111 fidl::encoding::decode_envelope_header(decoder, next_offset)?
20112 {
20113 let member_inline_size =
20114 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
20115 if inlined != (member_inline_size <= 4) {
20116 return Err(fidl::Error::InvalidInlineBitInEnvelope);
20117 }
20118 let inner_offset;
20119 let mut inner_depth = depth.clone();
20120 if inlined {
20121 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
20122 inner_offset = next_offset;
20123 } else {
20124 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
20125 inner_depth.increment()?;
20126 }
20127 let val_ref = self.key_frame.get_or_insert_with(|| fidl::new_empty!(bool, D));
20128 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
20129 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
20130 {
20131 return Err(fidl::Error::InvalidNumBytesInEnvelope);
20132 }
20133 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
20134 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
20135 }
20136 }
20137
20138 next_offset += envelope_size;
20139
20140 while next_offset < end_offset {
20142 _next_ordinal_to_read += 1;
20143 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
20144 next_offset += envelope_size;
20145 }
20146
20147 Ok(())
20148 }
20149 }
20150
20151 impl PacketHeader {
20152 #[inline(always)]
20153 fn max_ordinal_present(&self) -> u64 {
20154 if let Some(_) = self.packet_index {
20155 return 2;
20156 }
20157 if let Some(_) = self.buffer_lifetime_ordinal {
20158 return 1;
20159 }
20160 0
20161 }
20162 }
20163
20164 impl fidl::encoding::ValueTypeMarker for PacketHeader {
20165 type Borrowed<'a> = &'a Self;
20166 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
20167 value
20168 }
20169 }
20170
20171 unsafe impl fidl::encoding::TypeMarker for PacketHeader {
20172 type Owned = Self;
20173
20174 #[inline(always)]
20175 fn inline_align(_context: fidl::encoding::Context) -> usize {
20176 8
20177 }
20178
20179 #[inline(always)]
20180 fn inline_size(_context: fidl::encoding::Context) -> usize {
20181 16
20182 }
20183 }
20184
20185 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<PacketHeader, D>
20186 for &PacketHeader
20187 {
20188 unsafe fn encode(
20189 self,
20190 encoder: &mut fidl::encoding::Encoder<'_, D>,
20191 offset: usize,
20192 mut depth: fidl::encoding::Depth,
20193 ) -> fidl::Result<()> {
20194 encoder.debug_check_bounds::<PacketHeader>(offset);
20195 let max_ordinal: u64 = self.max_ordinal_present();
20197 encoder.write_num(max_ordinal, offset);
20198 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
20199 if max_ordinal == 0 {
20201 return Ok(());
20202 }
20203 depth.increment()?;
20204 let envelope_size = 8;
20205 let bytes_len = max_ordinal as usize * envelope_size;
20206 #[allow(unused_variables)]
20207 let offset = encoder.out_of_line_offset(bytes_len);
20208 let mut _prev_end_offset: usize = 0;
20209 if 1 > max_ordinal {
20210 return Ok(());
20211 }
20212
20213 let cur_offset: usize = (1 - 1) * envelope_size;
20216
20217 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
20219
20220 fidl::encoding::encode_in_envelope_optional::<u64, D>(
20225 self.buffer_lifetime_ordinal
20226 .as_ref()
20227 .map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
20228 encoder,
20229 offset + cur_offset,
20230 depth,
20231 )?;
20232
20233 _prev_end_offset = cur_offset + envelope_size;
20234 if 2 > max_ordinal {
20235 return Ok(());
20236 }
20237
20238 let cur_offset: usize = (2 - 1) * envelope_size;
20241
20242 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
20244
20245 fidl::encoding::encode_in_envelope_optional::<u32, D>(
20250 self.packet_index.as_ref().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
20258 Ok(())
20259 }
20260 }
20261
20262 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for PacketHeader {
20263 #[inline(always)]
20264 fn new_empty() -> Self {
20265 Self::default()
20266 }
20267
20268 unsafe fn decode(
20269 &mut self,
20270 decoder: &mut fidl::encoding::Decoder<'_, D>,
20271 offset: usize,
20272 mut depth: fidl::encoding::Depth,
20273 ) -> fidl::Result<()> {
20274 decoder.debug_check_bounds::<Self>(offset);
20275 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
20276 None => return Err(fidl::Error::NotNullable),
20277 Some(len) => len,
20278 };
20279 if len == 0 {
20281 return Ok(());
20282 };
20283 depth.increment()?;
20284 let envelope_size = 8;
20285 let bytes_len = len * envelope_size;
20286 let offset = decoder.out_of_line_offset(bytes_len)?;
20287 let mut _next_ordinal_to_read = 0;
20289 let mut next_offset = offset;
20290 let end_offset = offset + bytes_len;
20291 _next_ordinal_to_read += 1;
20292 if next_offset >= end_offset {
20293 return Ok(());
20294 }
20295
20296 while _next_ordinal_to_read < 1 {
20298 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
20299 _next_ordinal_to_read += 1;
20300 next_offset += envelope_size;
20301 }
20302
20303 let next_out_of_line = decoder.next_out_of_line();
20304 let handles_before = decoder.remaining_handles();
20305 if let Some((inlined, num_bytes, num_handles)) =
20306 fidl::encoding::decode_envelope_header(decoder, next_offset)?
20307 {
20308 let member_inline_size =
20309 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
20310 if inlined != (member_inline_size <= 4) {
20311 return Err(fidl::Error::InvalidInlineBitInEnvelope);
20312 }
20313 let inner_offset;
20314 let mut inner_depth = depth.clone();
20315 if inlined {
20316 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
20317 inner_offset = next_offset;
20318 } else {
20319 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
20320 inner_depth.increment()?;
20321 }
20322 let val_ref =
20323 self.buffer_lifetime_ordinal.get_or_insert_with(|| fidl::new_empty!(u64, D));
20324 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
20325 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
20326 {
20327 return Err(fidl::Error::InvalidNumBytesInEnvelope);
20328 }
20329 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
20330 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
20331 }
20332 }
20333
20334 next_offset += envelope_size;
20335 _next_ordinal_to_read += 1;
20336 if next_offset >= end_offset {
20337 return Ok(());
20338 }
20339
20340 while _next_ordinal_to_read < 2 {
20342 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
20343 _next_ordinal_to_read += 1;
20344 next_offset += envelope_size;
20345 }
20346
20347 let next_out_of_line = decoder.next_out_of_line();
20348 let handles_before = decoder.remaining_handles();
20349 if let Some((inlined, num_bytes, num_handles)) =
20350 fidl::encoding::decode_envelope_header(decoder, next_offset)?
20351 {
20352 let member_inline_size =
20353 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
20354 if inlined != (member_inline_size <= 4) {
20355 return Err(fidl::Error::InvalidInlineBitInEnvelope);
20356 }
20357 let inner_offset;
20358 let mut inner_depth = depth.clone();
20359 if inlined {
20360 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
20361 inner_offset = next_offset;
20362 } else {
20363 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
20364 inner_depth.increment()?;
20365 }
20366 let val_ref = self.packet_index.get_or_insert_with(|| fidl::new_empty!(u32, D));
20367 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
20368 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
20369 {
20370 return Err(fidl::Error::InvalidNumBytesInEnvelope);
20371 }
20372 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
20373 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
20374 }
20375 }
20376
20377 next_offset += envelope_size;
20378
20379 while next_offset < end_offset {
20381 _next_ordinal_to_read += 1;
20382 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
20383 next_offset += envelope_size;
20384 }
20385
20386 Ok(())
20387 }
20388 }
20389
20390 impl StreamBufferConstraints {
20391 #[inline(always)]
20392 fn max_ordinal_present(&self) -> u64 {
20393 if let Some(_) = self.pixel_format {
20394 return 16;
20395 }
20396 if let Some(_) = self.size {
20397 return 15;
20398 }
20399 if let Some(_) = self.buffer_count_for_server_current {
20400 return 14;
20401 }
20402 if let Some(_) = self.is_physically_contiguous_required {
20403 return 13;
20404 }
20405 if let Some(_) = self.single_buffer_mode_allowed {
20406 return 12;
20407 }
20408 if let Some(_) = self.packet_count_for_client_max {
20409 return 11;
20410 }
20411 if let Some(_) = self.packet_count_for_client_min {
20412 return 10;
20413 }
20414 if let Some(_) = self.packet_count_for_server_max {
20415 return 9;
20416 }
20417 if let Some(_) = self.packet_count_for_server_recommended_max {
20418 return 8;
20419 }
20420 if let Some(_) = self.packet_count_for_server_recommended {
20421 return 7;
20422 }
20423 if let Some(_) = self.packet_count_for_server_min {
20424 return 6;
20425 }
20426 if let Some(_) = self.per_packet_buffer_bytes_max {
20427 return 5;
20428 }
20429 if let Some(_) = self.per_packet_buffer_bytes_recommended {
20430 return 4;
20431 }
20432 if let Some(_) = self.per_packet_buffer_bytes_min {
20433 return 3;
20434 }
20435 if let Some(_) = self.default_settings {
20436 return 2;
20437 }
20438 if let Some(_) = self.buffer_constraints_version_ordinal {
20439 return 1;
20440 }
20441 0
20442 }
20443 }
20444
20445 impl fidl::encoding::ValueTypeMarker for StreamBufferConstraints {
20446 type Borrowed<'a> = &'a Self;
20447 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
20448 value
20449 }
20450 }
20451
20452 unsafe impl fidl::encoding::TypeMarker for StreamBufferConstraints {
20453 type Owned = Self;
20454
20455 #[inline(always)]
20456 fn inline_align(_context: fidl::encoding::Context) -> usize {
20457 8
20458 }
20459
20460 #[inline(always)]
20461 fn inline_size(_context: fidl::encoding::Context) -> usize {
20462 16
20463 }
20464 }
20465
20466 unsafe impl<D: fidl::encoding::ResourceDialect>
20467 fidl::encoding::Encode<StreamBufferConstraints, D> for &StreamBufferConstraints
20468 {
20469 unsafe fn encode(
20470 self,
20471 encoder: &mut fidl::encoding::Encoder<'_, D>,
20472 offset: usize,
20473 mut depth: fidl::encoding::Depth,
20474 ) -> fidl::Result<()> {
20475 encoder.debug_check_bounds::<StreamBufferConstraints>(offset);
20476 let max_ordinal: u64 = self.max_ordinal_present();
20478 encoder.write_num(max_ordinal, offset);
20479 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
20480 if max_ordinal == 0 {
20482 return Ok(());
20483 }
20484 depth.increment()?;
20485 let envelope_size = 8;
20486 let bytes_len = max_ordinal as usize * envelope_size;
20487 #[allow(unused_variables)]
20488 let offset = encoder.out_of_line_offset(bytes_len);
20489 let mut _prev_end_offset: usize = 0;
20490 if 1 > max_ordinal {
20491 return Ok(());
20492 }
20493
20494 let cur_offset: usize = (1 - 1) * envelope_size;
20497
20498 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
20500
20501 fidl::encoding::encode_in_envelope_optional::<u64, D>(
20506 self.buffer_constraints_version_ordinal
20507 .as_ref()
20508 .map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
20509 encoder,
20510 offset + cur_offset,
20511 depth,
20512 )?;
20513
20514 _prev_end_offset = cur_offset + envelope_size;
20515 if 2 > max_ordinal {
20516 return Ok(());
20517 }
20518
20519 let cur_offset: usize = (2 - 1) * envelope_size;
20522
20523 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
20525
20526 fidl::encoding::encode_in_envelope_optional::<StreamBufferSettings, D>(
20531 self.default_settings
20532 .as_ref()
20533 .map(<StreamBufferSettings as fidl::encoding::ValueTypeMarker>::borrow),
20534 encoder,
20535 offset + cur_offset,
20536 depth,
20537 )?;
20538
20539 _prev_end_offset = cur_offset + envelope_size;
20540 if 3 > max_ordinal {
20541 return Ok(());
20542 }
20543
20544 let cur_offset: usize = (3 - 1) * envelope_size;
20547
20548 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
20550
20551 fidl::encoding::encode_in_envelope_optional::<u32, D>(
20556 self.per_packet_buffer_bytes_min
20557 .as_ref()
20558 .map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
20559 encoder,
20560 offset + cur_offset,
20561 depth,
20562 )?;
20563
20564 _prev_end_offset = cur_offset + envelope_size;
20565 if 4 > max_ordinal {
20566 return Ok(());
20567 }
20568
20569 let cur_offset: usize = (4 - 1) * envelope_size;
20572
20573 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
20575
20576 fidl::encoding::encode_in_envelope_optional::<u32, D>(
20581 self.per_packet_buffer_bytes_recommended
20582 .as_ref()
20583 .map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
20584 encoder,
20585 offset + cur_offset,
20586 depth,
20587 )?;
20588
20589 _prev_end_offset = cur_offset + envelope_size;
20590 if 5 > max_ordinal {
20591 return Ok(());
20592 }
20593
20594 let cur_offset: usize = (5 - 1) * envelope_size;
20597
20598 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
20600
20601 fidl::encoding::encode_in_envelope_optional::<u32, D>(
20606 self.per_packet_buffer_bytes_max
20607 .as_ref()
20608 .map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
20609 encoder,
20610 offset + cur_offset,
20611 depth,
20612 )?;
20613
20614 _prev_end_offset = cur_offset + envelope_size;
20615 if 6 > max_ordinal {
20616 return Ok(());
20617 }
20618
20619 let cur_offset: usize = (6 - 1) * envelope_size;
20622
20623 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
20625
20626 fidl::encoding::encode_in_envelope_optional::<u32, D>(
20631 self.packet_count_for_server_min
20632 .as_ref()
20633 .map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
20634 encoder,
20635 offset + cur_offset,
20636 depth,
20637 )?;
20638
20639 _prev_end_offset = cur_offset + envelope_size;
20640 if 7 > max_ordinal {
20641 return Ok(());
20642 }
20643
20644 let cur_offset: usize = (7 - 1) * envelope_size;
20647
20648 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
20650
20651 fidl::encoding::encode_in_envelope_optional::<u32, D>(
20656 self.packet_count_for_server_recommended
20657 .as_ref()
20658 .map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
20659 encoder,
20660 offset + cur_offset,
20661 depth,
20662 )?;
20663
20664 _prev_end_offset = cur_offset + envelope_size;
20665 if 8 > max_ordinal {
20666 return Ok(());
20667 }
20668
20669 let cur_offset: usize = (8 - 1) * envelope_size;
20672
20673 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
20675
20676 fidl::encoding::encode_in_envelope_optional::<u32, D>(
20681 self.packet_count_for_server_recommended_max
20682 .as_ref()
20683 .map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
20684 encoder,
20685 offset + cur_offset,
20686 depth,
20687 )?;
20688
20689 _prev_end_offset = cur_offset + envelope_size;
20690 if 9 > max_ordinal {
20691 return Ok(());
20692 }
20693
20694 let cur_offset: usize = (9 - 1) * envelope_size;
20697
20698 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
20700
20701 fidl::encoding::encode_in_envelope_optional::<u32, D>(
20706 self.packet_count_for_server_max
20707 .as_ref()
20708 .map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
20709 encoder,
20710 offset + cur_offset,
20711 depth,
20712 )?;
20713
20714 _prev_end_offset = cur_offset + envelope_size;
20715 if 10 > max_ordinal {
20716 return Ok(());
20717 }
20718
20719 let cur_offset: usize = (10 - 1) * envelope_size;
20722
20723 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
20725
20726 fidl::encoding::encode_in_envelope_optional::<u32, D>(
20731 self.packet_count_for_client_min
20732 .as_ref()
20733 .map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
20734 encoder,
20735 offset + cur_offset,
20736 depth,
20737 )?;
20738
20739 _prev_end_offset = cur_offset + envelope_size;
20740 if 11 > max_ordinal {
20741 return Ok(());
20742 }
20743
20744 let cur_offset: usize = (11 - 1) * envelope_size;
20747
20748 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
20750
20751 fidl::encoding::encode_in_envelope_optional::<u32, D>(
20756 self.packet_count_for_client_max
20757 .as_ref()
20758 .map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
20759 encoder,
20760 offset + cur_offset,
20761 depth,
20762 )?;
20763
20764 _prev_end_offset = cur_offset + envelope_size;
20765 if 12 > max_ordinal {
20766 return Ok(());
20767 }
20768
20769 let cur_offset: usize = (12 - 1) * envelope_size;
20772
20773 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
20775
20776 fidl::encoding::encode_in_envelope_optional::<bool, D>(
20781 self.single_buffer_mode_allowed
20782 .as_ref()
20783 .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
20784 encoder,
20785 offset + cur_offset,
20786 depth,
20787 )?;
20788
20789 _prev_end_offset = cur_offset + envelope_size;
20790 if 13 > max_ordinal {
20791 return Ok(());
20792 }
20793
20794 let cur_offset: usize = (13 - 1) * envelope_size;
20797
20798 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
20800
20801 fidl::encoding::encode_in_envelope_optional::<bool, D>(
20806 self.is_physically_contiguous_required
20807 .as_ref()
20808 .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
20809 encoder,
20810 offset + cur_offset,
20811 depth,
20812 )?;
20813
20814 _prev_end_offset = cur_offset + envelope_size;
20815 if 14 > max_ordinal {
20816 return Ok(());
20817 }
20818
20819 let cur_offset: usize = (14 - 1) * envelope_size;
20822
20823 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
20825
20826 fidl::encoding::encode_in_envelope_optional::<u32, D>(
20831 self.buffer_count_for_server_current
20832 .as_ref()
20833 .map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
20834 encoder,
20835 offset + cur_offset,
20836 depth,
20837 )?;
20838
20839 _prev_end_offset = cur_offset + envelope_size;
20840 if 15 > max_ordinal {
20841 return Ok(());
20842 }
20843
20844 let cur_offset: usize = (15 - 1) * envelope_size;
20847
20848 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
20850
20851 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_math_common::SizeU, D>(
20856 self.size.as_ref().map(
20857 <fidl_fuchsia_math_common::SizeU as fidl::encoding::ValueTypeMarker>::borrow,
20858 ),
20859 encoder,
20860 offset + cur_offset,
20861 depth,
20862 )?;
20863
20864 _prev_end_offset = cur_offset + envelope_size;
20865 if 16 > max_ordinal {
20866 return Ok(());
20867 }
20868
20869 let cur_offset: usize = (16 - 1) * envelope_size;
20872
20873 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
20875
20876 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_images2_common::PixelFormat, D>(
20881 self.pixel_format.as_ref().map(<fidl_fuchsia_images2_common::PixelFormat as fidl::encoding::ValueTypeMarker>::borrow),
20882 encoder, offset + cur_offset, depth
20883 )?;
20884
20885 _prev_end_offset = cur_offset + envelope_size;
20886
20887 Ok(())
20888 }
20889 }
20890
20891 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
20892 for StreamBufferConstraints
20893 {
20894 #[inline(always)]
20895 fn new_empty() -> Self {
20896 Self::default()
20897 }
20898
20899 unsafe fn decode(
20900 &mut self,
20901 decoder: &mut fidl::encoding::Decoder<'_, D>,
20902 offset: usize,
20903 mut depth: fidl::encoding::Depth,
20904 ) -> fidl::Result<()> {
20905 decoder.debug_check_bounds::<Self>(offset);
20906 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
20907 None => return Err(fidl::Error::NotNullable),
20908 Some(len) => len,
20909 };
20910 if len == 0 {
20912 return Ok(());
20913 };
20914 depth.increment()?;
20915 let envelope_size = 8;
20916 let bytes_len = len * envelope_size;
20917 let offset = decoder.out_of_line_offset(bytes_len)?;
20918 let mut _next_ordinal_to_read = 0;
20920 let mut next_offset = offset;
20921 let end_offset = offset + bytes_len;
20922 _next_ordinal_to_read += 1;
20923 if next_offset >= end_offset {
20924 return Ok(());
20925 }
20926
20927 while _next_ordinal_to_read < 1 {
20929 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
20930 _next_ordinal_to_read += 1;
20931 next_offset += envelope_size;
20932 }
20933
20934 let next_out_of_line = decoder.next_out_of_line();
20935 let handles_before = decoder.remaining_handles();
20936 if let Some((inlined, num_bytes, num_handles)) =
20937 fidl::encoding::decode_envelope_header(decoder, next_offset)?
20938 {
20939 let member_inline_size =
20940 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
20941 if inlined != (member_inline_size <= 4) {
20942 return Err(fidl::Error::InvalidInlineBitInEnvelope);
20943 }
20944 let inner_offset;
20945 let mut inner_depth = depth.clone();
20946 if inlined {
20947 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
20948 inner_offset = next_offset;
20949 } else {
20950 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
20951 inner_depth.increment()?;
20952 }
20953 let val_ref = self
20954 .buffer_constraints_version_ordinal
20955 .get_or_insert_with(|| fidl::new_empty!(u64, D));
20956 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
20957 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
20958 {
20959 return Err(fidl::Error::InvalidNumBytesInEnvelope);
20960 }
20961 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
20962 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
20963 }
20964 }
20965
20966 next_offset += envelope_size;
20967 _next_ordinal_to_read += 1;
20968 if next_offset >= end_offset {
20969 return Ok(());
20970 }
20971
20972 while _next_ordinal_to_read < 2 {
20974 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
20975 _next_ordinal_to_read += 1;
20976 next_offset += envelope_size;
20977 }
20978
20979 let next_out_of_line = decoder.next_out_of_line();
20980 let handles_before = decoder.remaining_handles();
20981 if let Some((inlined, num_bytes, num_handles)) =
20982 fidl::encoding::decode_envelope_header(decoder, next_offset)?
20983 {
20984 let member_inline_size =
20985 <StreamBufferSettings as fidl::encoding::TypeMarker>::inline_size(
20986 decoder.context,
20987 );
20988 if inlined != (member_inline_size <= 4) {
20989 return Err(fidl::Error::InvalidInlineBitInEnvelope);
20990 }
20991 let inner_offset;
20992 let mut inner_depth = depth.clone();
20993 if inlined {
20994 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
20995 inner_offset = next_offset;
20996 } else {
20997 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
20998 inner_depth.increment()?;
20999 }
21000 let val_ref = self
21001 .default_settings
21002 .get_or_insert_with(|| fidl::new_empty!(StreamBufferSettings, D));
21003 fidl::decode!(
21004 StreamBufferSettings,
21005 D,
21006 val_ref,
21007 decoder,
21008 inner_offset,
21009 inner_depth
21010 )?;
21011 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
21012 {
21013 return Err(fidl::Error::InvalidNumBytesInEnvelope);
21014 }
21015 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
21016 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
21017 }
21018 }
21019
21020 next_offset += envelope_size;
21021 _next_ordinal_to_read += 1;
21022 if next_offset >= end_offset {
21023 return Ok(());
21024 }
21025
21026 while _next_ordinal_to_read < 3 {
21028 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
21029 _next_ordinal_to_read += 1;
21030 next_offset += envelope_size;
21031 }
21032
21033 let next_out_of_line = decoder.next_out_of_line();
21034 let handles_before = decoder.remaining_handles();
21035 if let Some((inlined, num_bytes, num_handles)) =
21036 fidl::encoding::decode_envelope_header(decoder, next_offset)?
21037 {
21038 let member_inline_size =
21039 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
21040 if inlined != (member_inline_size <= 4) {
21041 return Err(fidl::Error::InvalidInlineBitInEnvelope);
21042 }
21043 let inner_offset;
21044 let mut inner_depth = depth.clone();
21045 if inlined {
21046 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
21047 inner_offset = next_offset;
21048 } else {
21049 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
21050 inner_depth.increment()?;
21051 }
21052 let val_ref = self
21053 .per_packet_buffer_bytes_min
21054 .get_or_insert_with(|| fidl::new_empty!(u32, D));
21055 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
21056 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
21057 {
21058 return Err(fidl::Error::InvalidNumBytesInEnvelope);
21059 }
21060 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
21061 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
21062 }
21063 }
21064
21065 next_offset += envelope_size;
21066 _next_ordinal_to_read += 1;
21067 if next_offset >= end_offset {
21068 return Ok(());
21069 }
21070
21071 while _next_ordinal_to_read < 4 {
21073 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
21074 _next_ordinal_to_read += 1;
21075 next_offset += envelope_size;
21076 }
21077
21078 let next_out_of_line = decoder.next_out_of_line();
21079 let handles_before = decoder.remaining_handles();
21080 if let Some((inlined, num_bytes, num_handles)) =
21081 fidl::encoding::decode_envelope_header(decoder, next_offset)?
21082 {
21083 let member_inline_size =
21084 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
21085 if inlined != (member_inline_size <= 4) {
21086 return Err(fidl::Error::InvalidInlineBitInEnvelope);
21087 }
21088 let inner_offset;
21089 let mut inner_depth = depth.clone();
21090 if inlined {
21091 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
21092 inner_offset = next_offset;
21093 } else {
21094 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
21095 inner_depth.increment()?;
21096 }
21097 let val_ref = self
21098 .per_packet_buffer_bytes_recommended
21099 .get_or_insert_with(|| fidl::new_empty!(u32, D));
21100 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
21101 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
21102 {
21103 return Err(fidl::Error::InvalidNumBytesInEnvelope);
21104 }
21105 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
21106 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
21107 }
21108 }
21109
21110 next_offset += envelope_size;
21111 _next_ordinal_to_read += 1;
21112 if next_offset >= end_offset {
21113 return Ok(());
21114 }
21115
21116 while _next_ordinal_to_read < 5 {
21118 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
21119 _next_ordinal_to_read += 1;
21120 next_offset += envelope_size;
21121 }
21122
21123 let next_out_of_line = decoder.next_out_of_line();
21124 let handles_before = decoder.remaining_handles();
21125 if let Some((inlined, num_bytes, num_handles)) =
21126 fidl::encoding::decode_envelope_header(decoder, next_offset)?
21127 {
21128 let member_inline_size =
21129 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
21130 if inlined != (member_inline_size <= 4) {
21131 return Err(fidl::Error::InvalidInlineBitInEnvelope);
21132 }
21133 let inner_offset;
21134 let mut inner_depth = depth.clone();
21135 if inlined {
21136 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
21137 inner_offset = next_offset;
21138 } else {
21139 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
21140 inner_depth.increment()?;
21141 }
21142 let val_ref = self
21143 .per_packet_buffer_bytes_max
21144 .get_or_insert_with(|| fidl::new_empty!(u32, D));
21145 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
21146 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
21147 {
21148 return Err(fidl::Error::InvalidNumBytesInEnvelope);
21149 }
21150 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
21151 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
21152 }
21153 }
21154
21155 next_offset += envelope_size;
21156 _next_ordinal_to_read += 1;
21157 if next_offset >= end_offset {
21158 return Ok(());
21159 }
21160
21161 while _next_ordinal_to_read < 6 {
21163 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
21164 _next_ordinal_to_read += 1;
21165 next_offset += envelope_size;
21166 }
21167
21168 let next_out_of_line = decoder.next_out_of_line();
21169 let handles_before = decoder.remaining_handles();
21170 if let Some((inlined, num_bytes, num_handles)) =
21171 fidl::encoding::decode_envelope_header(decoder, next_offset)?
21172 {
21173 let member_inline_size =
21174 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
21175 if inlined != (member_inline_size <= 4) {
21176 return Err(fidl::Error::InvalidInlineBitInEnvelope);
21177 }
21178 let inner_offset;
21179 let mut inner_depth = depth.clone();
21180 if inlined {
21181 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
21182 inner_offset = next_offset;
21183 } else {
21184 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
21185 inner_depth.increment()?;
21186 }
21187 let val_ref = self
21188 .packet_count_for_server_min
21189 .get_or_insert_with(|| fidl::new_empty!(u32, D));
21190 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
21191 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
21192 {
21193 return Err(fidl::Error::InvalidNumBytesInEnvelope);
21194 }
21195 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
21196 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
21197 }
21198 }
21199
21200 next_offset += envelope_size;
21201 _next_ordinal_to_read += 1;
21202 if next_offset >= end_offset {
21203 return Ok(());
21204 }
21205
21206 while _next_ordinal_to_read < 7 {
21208 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
21209 _next_ordinal_to_read += 1;
21210 next_offset += envelope_size;
21211 }
21212
21213 let next_out_of_line = decoder.next_out_of_line();
21214 let handles_before = decoder.remaining_handles();
21215 if let Some((inlined, num_bytes, num_handles)) =
21216 fidl::encoding::decode_envelope_header(decoder, next_offset)?
21217 {
21218 let member_inline_size =
21219 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
21220 if inlined != (member_inline_size <= 4) {
21221 return Err(fidl::Error::InvalidInlineBitInEnvelope);
21222 }
21223 let inner_offset;
21224 let mut inner_depth = depth.clone();
21225 if inlined {
21226 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
21227 inner_offset = next_offset;
21228 } else {
21229 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
21230 inner_depth.increment()?;
21231 }
21232 let val_ref = self
21233 .packet_count_for_server_recommended
21234 .get_or_insert_with(|| fidl::new_empty!(u32, D));
21235 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
21236 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
21237 {
21238 return Err(fidl::Error::InvalidNumBytesInEnvelope);
21239 }
21240 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
21241 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
21242 }
21243 }
21244
21245 next_offset += envelope_size;
21246 _next_ordinal_to_read += 1;
21247 if next_offset >= end_offset {
21248 return Ok(());
21249 }
21250
21251 while _next_ordinal_to_read < 8 {
21253 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
21254 _next_ordinal_to_read += 1;
21255 next_offset += envelope_size;
21256 }
21257
21258 let next_out_of_line = decoder.next_out_of_line();
21259 let handles_before = decoder.remaining_handles();
21260 if let Some((inlined, num_bytes, num_handles)) =
21261 fidl::encoding::decode_envelope_header(decoder, next_offset)?
21262 {
21263 let member_inline_size =
21264 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
21265 if inlined != (member_inline_size <= 4) {
21266 return Err(fidl::Error::InvalidInlineBitInEnvelope);
21267 }
21268 let inner_offset;
21269 let mut inner_depth = depth.clone();
21270 if inlined {
21271 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
21272 inner_offset = next_offset;
21273 } else {
21274 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
21275 inner_depth.increment()?;
21276 }
21277 let val_ref = self
21278 .packet_count_for_server_recommended_max
21279 .get_or_insert_with(|| fidl::new_empty!(u32, D));
21280 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
21281 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
21282 {
21283 return Err(fidl::Error::InvalidNumBytesInEnvelope);
21284 }
21285 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
21286 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
21287 }
21288 }
21289
21290 next_offset += envelope_size;
21291 _next_ordinal_to_read += 1;
21292 if next_offset >= end_offset {
21293 return Ok(());
21294 }
21295
21296 while _next_ordinal_to_read < 9 {
21298 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
21299 _next_ordinal_to_read += 1;
21300 next_offset += envelope_size;
21301 }
21302
21303 let next_out_of_line = decoder.next_out_of_line();
21304 let handles_before = decoder.remaining_handles();
21305 if let Some((inlined, num_bytes, num_handles)) =
21306 fidl::encoding::decode_envelope_header(decoder, next_offset)?
21307 {
21308 let member_inline_size =
21309 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
21310 if inlined != (member_inline_size <= 4) {
21311 return Err(fidl::Error::InvalidInlineBitInEnvelope);
21312 }
21313 let inner_offset;
21314 let mut inner_depth = depth.clone();
21315 if inlined {
21316 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
21317 inner_offset = next_offset;
21318 } else {
21319 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
21320 inner_depth.increment()?;
21321 }
21322 let val_ref = self
21323 .packet_count_for_server_max
21324 .get_or_insert_with(|| fidl::new_empty!(u32, D));
21325 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
21326 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
21327 {
21328 return Err(fidl::Error::InvalidNumBytesInEnvelope);
21329 }
21330 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
21331 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
21332 }
21333 }
21334
21335 next_offset += envelope_size;
21336 _next_ordinal_to_read += 1;
21337 if next_offset >= end_offset {
21338 return Ok(());
21339 }
21340
21341 while _next_ordinal_to_read < 10 {
21343 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
21344 _next_ordinal_to_read += 1;
21345 next_offset += envelope_size;
21346 }
21347
21348 let next_out_of_line = decoder.next_out_of_line();
21349 let handles_before = decoder.remaining_handles();
21350 if let Some((inlined, num_bytes, num_handles)) =
21351 fidl::encoding::decode_envelope_header(decoder, next_offset)?
21352 {
21353 let member_inline_size =
21354 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
21355 if inlined != (member_inline_size <= 4) {
21356 return Err(fidl::Error::InvalidInlineBitInEnvelope);
21357 }
21358 let inner_offset;
21359 let mut inner_depth = depth.clone();
21360 if inlined {
21361 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
21362 inner_offset = next_offset;
21363 } else {
21364 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
21365 inner_depth.increment()?;
21366 }
21367 let val_ref = self
21368 .packet_count_for_client_min
21369 .get_or_insert_with(|| fidl::new_empty!(u32, D));
21370 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
21371 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
21372 {
21373 return Err(fidl::Error::InvalidNumBytesInEnvelope);
21374 }
21375 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
21376 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
21377 }
21378 }
21379
21380 next_offset += envelope_size;
21381 _next_ordinal_to_read += 1;
21382 if next_offset >= end_offset {
21383 return Ok(());
21384 }
21385
21386 while _next_ordinal_to_read < 11 {
21388 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
21389 _next_ordinal_to_read += 1;
21390 next_offset += envelope_size;
21391 }
21392
21393 let next_out_of_line = decoder.next_out_of_line();
21394 let handles_before = decoder.remaining_handles();
21395 if let Some((inlined, num_bytes, num_handles)) =
21396 fidl::encoding::decode_envelope_header(decoder, next_offset)?
21397 {
21398 let member_inline_size =
21399 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
21400 if inlined != (member_inline_size <= 4) {
21401 return Err(fidl::Error::InvalidInlineBitInEnvelope);
21402 }
21403 let inner_offset;
21404 let mut inner_depth = depth.clone();
21405 if inlined {
21406 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
21407 inner_offset = next_offset;
21408 } else {
21409 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
21410 inner_depth.increment()?;
21411 }
21412 let val_ref = self
21413 .packet_count_for_client_max
21414 .get_or_insert_with(|| fidl::new_empty!(u32, D));
21415 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
21416 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
21417 {
21418 return Err(fidl::Error::InvalidNumBytesInEnvelope);
21419 }
21420 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
21421 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
21422 }
21423 }
21424
21425 next_offset += envelope_size;
21426 _next_ordinal_to_read += 1;
21427 if next_offset >= end_offset {
21428 return Ok(());
21429 }
21430
21431 while _next_ordinal_to_read < 12 {
21433 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
21434 _next_ordinal_to_read += 1;
21435 next_offset += envelope_size;
21436 }
21437
21438 let next_out_of_line = decoder.next_out_of_line();
21439 let handles_before = decoder.remaining_handles();
21440 if let Some((inlined, num_bytes, num_handles)) =
21441 fidl::encoding::decode_envelope_header(decoder, next_offset)?
21442 {
21443 let member_inline_size =
21444 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
21445 if inlined != (member_inline_size <= 4) {
21446 return Err(fidl::Error::InvalidInlineBitInEnvelope);
21447 }
21448 let inner_offset;
21449 let mut inner_depth = depth.clone();
21450 if inlined {
21451 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
21452 inner_offset = next_offset;
21453 } else {
21454 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
21455 inner_depth.increment()?;
21456 }
21457 let val_ref = self
21458 .single_buffer_mode_allowed
21459 .get_or_insert_with(|| fidl::new_empty!(bool, D));
21460 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
21461 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
21462 {
21463 return Err(fidl::Error::InvalidNumBytesInEnvelope);
21464 }
21465 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
21466 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
21467 }
21468 }
21469
21470 next_offset += envelope_size;
21471 _next_ordinal_to_read += 1;
21472 if next_offset >= end_offset {
21473 return Ok(());
21474 }
21475
21476 while _next_ordinal_to_read < 13 {
21478 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
21479 _next_ordinal_to_read += 1;
21480 next_offset += envelope_size;
21481 }
21482
21483 let next_out_of_line = decoder.next_out_of_line();
21484 let handles_before = decoder.remaining_handles();
21485 if let Some((inlined, num_bytes, num_handles)) =
21486 fidl::encoding::decode_envelope_header(decoder, next_offset)?
21487 {
21488 let member_inline_size =
21489 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
21490 if inlined != (member_inline_size <= 4) {
21491 return Err(fidl::Error::InvalidInlineBitInEnvelope);
21492 }
21493 let inner_offset;
21494 let mut inner_depth = depth.clone();
21495 if inlined {
21496 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
21497 inner_offset = next_offset;
21498 } else {
21499 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
21500 inner_depth.increment()?;
21501 }
21502 let val_ref = self
21503 .is_physically_contiguous_required
21504 .get_or_insert_with(|| fidl::new_empty!(bool, D));
21505 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
21506 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
21507 {
21508 return Err(fidl::Error::InvalidNumBytesInEnvelope);
21509 }
21510 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
21511 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
21512 }
21513 }
21514
21515 next_offset += envelope_size;
21516 _next_ordinal_to_read += 1;
21517 if next_offset >= end_offset {
21518 return Ok(());
21519 }
21520
21521 while _next_ordinal_to_read < 14 {
21523 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
21524 _next_ordinal_to_read += 1;
21525 next_offset += envelope_size;
21526 }
21527
21528 let next_out_of_line = decoder.next_out_of_line();
21529 let handles_before = decoder.remaining_handles();
21530 if let Some((inlined, num_bytes, num_handles)) =
21531 fidl::encoding::decode_envelope_header(decoder, next_offset)?
21532 {
21533 let member_inline_size =
21534 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
21535 if inlined != (member_inline_size <= 4) {
21536 return Err(fidl::Error::InvalidInlineBitInEnvelope);
21537 }
21538 let inner_offset;
21539 let mut inner_depth = depth.clone();
21540 if inlined {
21541 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
21542 inner_offset = next_offset;
21543 } else {
21544 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
21545 inner_depth.increment()?;
21546 }
21547 let val_ref = self
21548 .buffer_count_for_server_current
21549 .get_or_insert_with(|| fidl::new_empty!(u32, D));
21550 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
21551 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
21552 {
21553 return Err(fidl::Error::InvalidNumBytesInEnvelope);
21554 }
21555 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
21556 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
21557 }
21558 }
21559
21560 next_offset += envelope_size;
21561 _next_ordinal_to_read += 1;
21562 if next_offset >= end_offset {
21563 return Ok(());
21564 }
21565
21566 while _next_ordinal_to_read < 15 {
21568 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
21569 _next_ordinal_to_read += 1;
21570 next_offset += envelope_size;
21571 }
21572
21573 let next_out_of_line = decoder.next_out_of_line();
21574 let handles_before = decoder.remaining_handles();
21575 if let Some((inlined, num_bytes, num_handles)) =
21576 fidl::encoding::decode_envelope_header(decoder, next_offset)?
21577 {
21578 let member_inline_size =
21579 <fidl_fuchsia_math_common::SizeU as fidl::encoding::TypeMarker>::inline_size(
21580 decoder.context,
21581 );
21582 if inlined != (member_inline_size <= 4) {
21583 return Err(fidl::Error::InvalidInlineBitInEnvelope);
21584 }
21585 let inner_offset;
21586 let mut inner_depth = depth.clone();
21587 if inlined {
21588 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
21589 inner_offset = next_offset;
21590 } else {
21591 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
21592 inner_depth.increment()?;
21593 }
21594 let val_ref = self
21595 .size
21596 .get_or_insert_with(|| fidl::new_empty!(fidl_fuchsia_math_common::SizeU, D));
21597 fidl::decode!(
21598 fidl_fuchsia_math_common::SizeU,
21599 D,
21600 val_ref,
21601 decoder,
21602 inner_offset,
21603 inner_depth
21604 )?;
21605 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
21606 {
21607 return Err(fidl::Error::InvalidNumBytesInEnvelope);
21608 }
21609 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
21610 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
21611 }
21612 }
21613
21614 next_offset += envelope_size;
21615 _next_ordinal_to_read += 1;
21616 if next_offset >= end_offset {
21617 return Ok(());
21618 }
21619
21620 while _next_ordinal_to_read < 16 {
21622 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
21623 _next_ordinal_to_read += 1;
21624 next_offset += envelope_size;
21625 }
21626
21627 let next_out_of_line = decoder.next_out_of_line();
21628 let handles_before = decoder.remaining_handles();
21629 if let Some((inlined, num_bytes, num_handles)) =
21630 fidl::encoding::decode_envelope_header(decoder, next_offset)?
21631 {
21632 let member_inline_size = <fidl_fuchsia_images2_common::PixelFormat as fidl::encoding::TypeMarker>::inline_size(decoder.context);
21633 if inlined != (member_inline_size <= 4) {
21634 return Err(fidl::Error::InvalidInlineBitInEnvelope);
21635 }
21636 let inner_offset;
21637 let mut inner_depth = depth.clone();
21638 if inlined {
21639 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
21640 inner_offset = next_offset;
21641 } else {
21642 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
21643 inner_depth.increment()?;
21644 }
21645 let val_ref = self.pixel_format.get_or_insert_with(|| {
21646 fidl::new_empty!(fidl_fuchsia_images2_common::PixelFormat, D)
21647 });
21648 fidl::decode!(
21649 fidl_fuchsia_images2_common::PixelFormat,
21650 D,
21651 val_ref,
21652 decoder,
21653 inner_offset,
21654 inner_depth
21655 )?;
21656 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
21657 {
21658 return Err(fidl::Error::InvalidNumBytesInEnvelope);
21659 }
21660 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
21661 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
21662 }
21663 }
21664
21665 next_offset += envelope_size;
21666
21667 while next_offset < end_offset {
21669 _next_ordinal_to_read += 1;
21670 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
21671 next_offset += envelope_size;
21672 }
21673
21674 Ok(())
21675 }
21676 }
21677
21678 impl StreamBufferSettings {
21679 #[inline(always)]
21680 fn max_ordinal_present(&self) -> u64 {
21681 if let Some(_) = self.single_buffer_mode {
21682 return 6;
21683 }
21684 if let Some(_) = self.per_packet_buffer_bytes {
21685 return 5;
21686 }
21687 if let Some(_) = self.packet_count_for_client {
21688 return 4;
21689 }
21690 if let Some(_) = self.packet_count_for_server {
21691 return 3;
21692 }
21693 if let Some(_) = self.buffer_constraints_version_ordinal {
21694 return 2;
21695 }
21696 if let Some(_) = self.buffer_lifetime_ordinal {
21697 return 1;
21698 }
21699 0
21700 }
21701 }
21702
21703 impl fidl::encoding::ValueTypeMarker for StreamBufferSettings {
21704 type Borrowed<'a> = &'a Self;
21705 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
21706 value
21707 }
21708 }
21709
21710 unsafe impl fidl::encoding::TypeMarker for StreamBufferSettings {
21711 type Owned = Self;
21712
21713 #[inline(always)]
21714 fn inline_align(_context: fidl::encoding::Context) -> usize {
21715 8
21716 }
21717
21718 #[inline(always)]
21719 fn inline_size(_context: fidl::encoding::Context) -> usize {
21720 16
21721 }
21722 }
21723
21724 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<StreamBufferSettings, D>
21725 for &StreamBufferSettings
21726 {
21727 unsafe fn encode(
21728 self,
21729 encoder: &mut fidl::encoding::Encoder<'_, D>,
21730 offset: usize,
21731 mut depth: fidl::encoding::Depth,
21732 ) -> fidl::Result<()> {
21733 encoder.debug_check_bounds::<StreamBufferSettings>(offset);
21734 let max_ordinal: u64 = self.max_ordinal_present();
21736 encoder.write_num(max_ordinal, offset);
21737 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
21738 if max_ordinal == 0 {
21740 return Ok(());
21741 }
21742 depth.increment()?;
21743 let envelope_size = 8;
21744 let bytes_len = max_ordinal as usize * envelope_size;
21745 #[allow(unused_variables)]
21746 let offset = encoder.out_of_line_offset(bytes_len);
21747 let mut _prev_end_offset: usize = 0;
21748 if 1 > max_ordinal {
21749 return Ok(());
21750 }
21751
21752 let cur_offset: usize = (1 - 1) * envelope_size;
21755
21756 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
21758
21759 fidl::encoding::encode_in_envelope_optional::<u64, D>(
21764 self.buffer_lifetime_ordinal
21765 .as_ref()
21766 .map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
21767 encoder,
21768 offset + cur_offset,
21769 depth,
21770 )?;
21771
21772 _prev_end_offset = cur_offset + envelope_size;
21773 if 2 > max_ordinal {
21774 return Ok(());
21775 }
21776
21777 let cur_offset: usize = (2 - 1) * envelope_size;
21780
21781 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
21783
21784 fidl::encoding::encode_in_envelope_optional::<u64, D>(
21789 self.buffer_constraints_version_ordinal
21790 .as_ref()
21791 .map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
21792 encoder,
21793 offset + cur_offset,
21794 depth,
21795 )?;
21796
21797 _prev_end_offset = cur_offset + envelope_size;
21798 if 3 > max_ordinal {
21799 return Ok(());
21800 }
21801
21802 let cur_offset: usize = (3 - 1) * envelope_size;
21805
21806 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
21808
21809 fidl::encoding::encode_in_envelope_optional::<u32, D>(
21814 self.packet_count_for_server
21815 .as_ref()
21816 .map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
21817 encoder,
21818 offset + cur_offset,
21819 depth,
21820 )?;
21821
21822 _prev_end_offset = cur_offset + envelope_size;
21823 if 4 > max_ordinal {
21824 return Ok(());
21825 }
21826
21827 let cur_offset: usize = (4 - 1) * envelope_size;
21830
21831 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
21833
21834 fidl::encoding::encode_in_envelope_optional::<u32, D>(
21839 self.packet_count_for_client
21840 .as_ref()
21841 .map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
21842 encoder,
21843 offset + cur_offset,
21844 depth,
21845 )?;
21846
21847 _prev_end_offset = cur_offset + envelope_size;
21848 if 5 > max_ordinal {
21849 return Ok(());
21850 }
21851
21852 let cur_offset: usize = (5 - 1) * envelope_size;
21855
21856 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
21858
21859 fidl::encoding::encode_in_envelope_optional::<u32, D>(
21864 self.per_packet_buffer_bytes
21865 .as_ref()
21866 .map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
21867 encoder,
21868 offset + cur_offset,
21869 depth,
21870 )?;
21871
21872 _prev_end_offset = cur_offset + envelope_size;
21873 if 6 > max_ordinal {
21874 return Ok(());
21875 }
21876
21877 let cur_offset: usize = (6 - 1) * envelope_size;
21880
21881 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
21883
21884 fidl::encoding::encode_in_envelope_optional::<bool, D>(
21889 self.single_buffer_mode
21890 .as_ref()
21891 .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
21892 encoder,
21893 offset + cur_offset,
21894 depth,
21895 )?;
21896
21897 _prev_end_offset = cur_offset + envelope_size;
21898
21899 Ok(())
21900 }
21901 }
21902
21903 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for StreamBufferSettings {
21904 #[inline(always)]
21905 fn new_empty() -> Self {
21906 Self::default()
21907 }
21908
21909 unsafe fn decode(
21910 &mut self,
21911 decoder: &mut fidl::encoding::Decoder<'_, D>,
21912 offset: usize,
21913 mut depth: fidl::encoding::Depth,
21914 ) -> fidl::Result<()> {
21915 decoder.debug_check_bounds::<Self>(offset);
21916 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
21917 None => return Err(fidl::Error::NotNullable),
21918 Some(len) => len,
21919 };
21920 if len == 0 {
21922 return Ok(());
21923 };
21924 depth.increment()?;
21925 let envelope_size = 8;
21926 let bytes_len = len * envelope_size;
21927 let offset = decoder.out_of_line_offset(bytes_len)?;
21928 let mut _next_ordinal_to_read = 0;
21930 let mut next_offset = offset;
21931 let end_offset = offset + bytes_len;
21932 _next_ordinal_to_read += 1;
21933 if next_offset >= end_offset {
21934 return Ok(());
21935 }
21936
21937 while _next_ordinal_to_read < 1 {
21939 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
21940 _next_ordinal_to_read += 1;
21941 next_offset += envelope_size;
21942 }
21943
21944 let next_out_of_line = decoder.next_out_of_line();
21945 let handles_before = decoder.remaining_handles();
21946 if let Some((inlined, num_bytes, num_handles)) =
21947 fidl::encoding::decode_envelope_header(decoder, next_offset)?
21948 {
21949 let member_inline_size =
21950 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
21951 if inlined != (member_inline_size <= 4) {
21952 return Err(fidl::Error::InvalidInlineBitInEnvelope);
21953 }
21954 let inner_offset;
21955 let mut inner_depth = depth.clone();
21956 if inlined {
21957 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
21958 inner_offset = next_offset;
21959 } else {
21960 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
21961 inner_depth.increment()?;
21962 }
21963 let val_ref =
21964 self.buffer_lifetime_ordinal.get_or_insert_with(|| fidl::new_empty!(u64, D));
21965 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
21966 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
21967 {
21968 return Err(fidl::Error::InvalidNumBytesInEnvelope);
21969 }
21970 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
21971 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
21972 }
21973 }
21974
21975 next_offset += envelope_size;
21976 _next_ordinal_to_read += 1;
21977 if next_offset >= end_offset {
21978 return Ok(());
21979 }
21980
21981 while _next_ordinal_to_read < 2 {
21983 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
21984 _next_ordinal_to_read += 1;
21985 next_offset += envelope_size;
21986 }
21987
21988 let next_out_of_line = decoder.next_out_of_line();
21989 let handles_before = decoder.remaining_handles();
21990 if let Some((inlined, num_bytes, num_handles)) =
21991 fidl::encoding::decode_envelope_header(decoder, next_offset)?
21992 {
21993 let member_inline_size =
21994 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
21995 if inlined != (member_inline_size <= 4) {
21996 return Err(fidl::Error::InvalidInlineBitInEnvelope);
21997 }
21998 let inner_offset;
21999 let mut inner_depth = depth.clone();
22000 if inlined {
22001 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
22002 inner_offset = next_offset;
22003 } else {
22004 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
22005 inner_depth.increment()?;
22006 }
22007 let val_ref = self
22008 .buffer_constraints_version_ordinal
22009 .get_or_insert_with(|| fidl::new_empty!(u64, D));
22010 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
22011 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
22012 {
22013 return Err(fidl::Error::InvalidNumBytesInEnvelope);
22014 }
22015 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
22016 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
22017 }
22018 }
22019
22020 next_offset += envelope_size;
22021 _next_ordinal_to_read += 1;
22022 if next_offset >= end_offset {
22023 return Ok(());
22024 }
22025
22026 while _next_ordinal_to_read < 3 {
22028 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
22029 _next_ordinal_to_read += 1;
22030 next_offset += envelope_size;
22031 }
22032
22033 let next_out_of_line = decoder.next_out_of_line();
22034 let handles_before = decoder.remaining_handles();
22035 if let Some((inlined, num_bytes, num_handles)) =
22036 fidl::encoding::decode_envelope_header(decoder, next_offset)?
22037 {
22038 let member_inline_size =
22039 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
22040 if inlined != (member_inline_size <= 4) {
22041 return Err(fidl::Error::InvalidInlineBitInEnvelope);
22042 }
22043 let inner_offset;
22044 let mut inner_depth = depth.clone();
22045 if inlined {
22046 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
22047 inner_offset = next_offset;
22048 } else {
22049 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
22050 inner_depth.increment()?;
22051 }
22052 let val_ref =
22053 self.packet_count_for_server.get_or_insert_with(|| fidl::new_empty!(u32, D));
22054 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
22055 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
22056 {
22057 return Err(fidl::Error::InvalidNumBytesInEnvelope);
22058 }
22059 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
22060 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
22061 }
22062 }
22063
22064 next_offset += envelope_size;
22065 _next_ordinal_to_read += 1;
22066 if next_offset >= end_offset {
22067 return Ok(());
22068 }
22069
22070 while _next_ordinal_to_read < 4 {
22072 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
22073 _next_ordinal_to_read += 1;
22074 next_offset += envelope_size;
22075 }
22076
22077 let next_out_of_line = decoder.next_out_of_line();
22078 let handles_before = decoder.remaining_handles();
22079 if let Some((inlined, num_bytes, num_handles)) =
22080 fidl::encoding::decode_envelope_header(decoder, next_offset)?
22081 {
22082 let member_inline_size =
22083 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
22084 if inlined != (member_inline_size <= 4) {
22085 return Err(fidl::Error::InvalidInlineBitInEnvelope);
22086 }
22087 let inner_offset;
22088 let mut inner_depth = depth.clone();
22089 if inlined {
22090 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
22091 inner_offset = next_offset;
22092 } else {
22093 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
22094 inner_depth.increment()?;
22095 }
22096 let val_ref =
22097 self.packet_count_for_client.get_or_insert_with(|| fidl::new_empty!(u32, D));
22098 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
22099 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
22100 {
22101 return Err(fidl::Error::InvalidNumBytesInEnvelope);
22102 }
22103 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
22104 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
22105 }
22106 }
22107
22108 next_offset += envelope_size;
22109 _next_ordinal_to_read += 1;
22110 if next_offset >= end_offset {
22111 return Ok(());
22112 }
22113
22114 while _next_ordinal_to_read < 5 {
22116 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
22117 _next_ordinal_to_read += 1;
22118 next_offset += envelope_size;
22119 }
22120
22121 let next_out_of_line = decoder.next_out_of_line();
22122 let handles_before = decoder.remaining_handles();
22123 if let Some((inlined, num_bytes, num_handles)) =
22124 fidl::encoding::decode_envelope_header(decoder, next_offset)?
22125 {
22126 let member_inline_size =
22127 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
22128 if inlined != (member_inline_size <= 4) {
22129 return Err(fidl::Error::InvalidInlineBitInEnvelope);
22130 }
22131 let inner_offset;
22132 let mut inner_depth = depth.clone();
22133 if inlined {
22134 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
22135 inner_offset = next_offset;
22136 } else {
22137 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
22138 inner_depth.increment()?;
22139 }
22140 let val_ref =
22141 self.per_packet_buffer_bytes.get_or_insert_with(|| fidl::new_empty!(u32, D));
22142 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
22143 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
22144 {
22145 return Err(fidl::Error::InvalidNumBytesInEnvelope);
22146 }
22147 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
22148 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
22149 }
22150 }
22151
22152 next_offset += envelope_size;
22153 _next_ordinal_to_read += 1;
22154 if next_offset >= end_offset {
22155 return Ok(());
22156 }
22157
22158 while _next_ordinal_to_read < 6 {
22160 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
22161 _next_ordinal_to_read += 1;
22162 next_offset += envelope_size;
22163 }
22164
22165 let next_out_of_line = decoder.next_out_of_line();
22166 let handles_before = decoder.remaining_handles();
22167 if let Some((inlined, num_bytes, num_handles)) =
22168 fidl::encoding::decode_envelope_header(decoder, next_offset)?
22169 {
22170 let member_inline_size =
22171 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
22172 if inlined != (member_inline_size <= 4) {
22173 return Err(fidl::Error::InvalidInlineBitInEnvelope);
22174 }
22175 let inner_offset;
22176 let mut inner_depth = depth.clone();
22177 if inlined {
22178 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
22179 inner_offset = next_offset;
22180 } else {
22181 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
22182 inner_depth.increment()?;
22183 }
22184 let val_ref =
22185 self.single_buffer_mode.get_or_insert_with(|| fidl::new_empty!(bool, D));
22186 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
22187 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
22188 {
22189 return Err(fidl::Error::InvalidNumBytesInEnvelope);
22190 }
22191 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
22192 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
22193 }
22194 }
22195
22196 next_offset += envelope_size;
22197
22198 while next_offset < end_offset {
22200 _next_ordinal_to_read += 1;
22201 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
22202 next_offset += envelope_size;
22203 }
22204
22205 Ok(())
22206 }
22207 }
22208
22209 impl StreamOutputConstraints {
22210 #[inline(always)]
22211 fn max_ordinal_present(&self) -> u64 {
22212 if let Some(_) = self.buffer_constraints {
22213 return 3;
22214 }
22215 if let Some(_) = self.buffer_constraints_action_required {
22216 return 2;
22217 }
22218 if let Some(_) = self.stream_lifetime_ordinal {
22219 return 1;
22220 }
22221 0
22222 }
22223 }
22224
22225 impl fidl::encoding::ValueTypeMarker for StreamOutputConstraints {
22226 type Borrowed<'a> = &'a Self;
22227 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
22228 value
22229 }
22230 }
22231
22232 unsafe impl fidl::encoding::TypeMarker for StreamOutputConstraints {
22233 type Owned = Self;
22234
22235 #[inline(always)]
22236 fn inline_align(_context: fidl::encoding::Context) -> usize {
22237 8
22238 }
22239
22240 #[inline(always)]
22241 fn inline_size(_context: fidl::encoding::Context) -> usize {
22242 16
22243 }
22244 }
22245
22246 unsafe impl<D: fidl::encoding::ResourceDialect>
22247 fidl::encoding::Encode<StreamOutputConstraints, D> for &StreamOutputConstraints
22248 {
22249 unsafe fn encode(
22250 self,
22251 encoder: &mut fidl::encoding::Encoder<'_, D>,
22252 offset: usize,
22253 mut depth: fidl::encoding::Depth,
22254 ) -> fidl::Result<()> {
22255 encoder.debug_check_bounds::<StreamOutputConstraints>(offset);
22256 let max_ordinal: u64 = self.max_ordinal_present();
22258 encoder.write_num(max_ordinal, offset);
22259 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
22260 if max_ordinal == 0 {
22262 return Ok(());
22263 }
22264 depth.increment()?;
22265 let envelope_size = 8;
22266 let bytes_len = max_ordinal as usize * envelope_size;
22267 #[allow(unused_variables)]
22268 let offset = encoder.out_of_line_offset(bytes_len);
22269 let mut _prev_end_offset: usize = 0;
22270 if 1 > max_ordinal {
22271 return Ok(());
22272 }
22273
22274 let cur_offset: usize = (1 - 1) * envelope_size;
22277
22278 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
22280
22281 fidl::encoding::encode_in_envelope_optional::<u64, D>(
22286 self.stream_lifetime_ordinal
22287 .as_ref()
22288 .map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
22289 encoder,
22290 offset + cur_offset,
22291 depth,
22292 )?;
22293
22294 _prev_end_offset = cur_offset + envelope_size;
22295 if 2 > max_ordinal {
22296 return Ok(());
22297 }
22298
22299 let cur_offset: usize = (2 - 1) * envelope_size;
22302
22303 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
22305
22306 fidl::encoding::encode_in_envelope_optional::<bool, D>(
22311 self.buffer_constraints_action_required
22312 .as_ref()
22313 .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
22314 encoder,
22315 offset + cur_offset,
22316 depth,
22317 )?;
22318
22319 _prev_end_offset = cur_offset + envelope_size;
22320 if 3 > max_ordinal {
22321 return Ok(());
22322 }
22323
22324 let cur_offset: usize = (3 - 1) * envelope_size;
22327
22328 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
22330
22331 fidl::encoding::encode_in_envelope_optional::<StreamBufferConstraints, D>(
22336 self.buffer_constraints
22337 .as_ref()
22338 .map(<StreamBufferConstraints as fidl::encoding::ValueTypeMarker>::borrow),
22339 encoder,
22340 offset + cur_offset,
22341 depth,
22342 )?;
22343
22344 _prev_end_offset = cur_offset + envelope_size;
22345
22346 Ok(())
22347 }
22348 }
22349
22350 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
22351 for StreamOutputConstraints
22352 {
22353 #[inline(always)]
22354 fn new_empty() -> Self {
22355 Self::default()
22356 }
22357
22358 unsafe fn decode(
22359 &mut self,
22360 decoder: &mut fidl::encoding::Decoder<'_, D>,
22361 offset: usize,
22362 mut depth: fidl::encoding::Depth,
22363 ) -> fidl::Result<()> {
22364 decoder.debug_check_bounds::<Self>(offset);
22365 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
22366 None => return Err(fidl::Error::NotNullable),
22367 Some(len) => len,
22368 };
22369 if len == 0 {
22371 return Ok(());
22372 };
22373 depth.increment()?;
22374 let envelope_size = 8;
22375 let bytes_len = len * envelope_size;
22376 let offset = decoder.out_of_line_offset(bytes_len)?;
22377 let mut _next_ordinal_to_read = 0;
22379 let mut next_offset = offset;
22380 let end_offset = offset + bytes_len;
22381 _next_ordinal_to_read += 1;
22382 if next_offset >= end_offset {
22383 return Ok(());
22384 }
22385
22386 while _next_ordinal_to_read < 1 {
22388 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
22389 _next_ordinal_to_read += 1;
22390 next_offset += envelope_size;
22391 }
22392
22393 let next_out_of_line = decoder.next_out_of_line();
22394 let handles_before = decoder.remaining_handles();
22395 if let Some((inlined, num_bytes, num_handles)) =
22396 fidl::encoding::decode_envelope_header(decoder, next_offset)?
22397 {
22398 let member_inline_size =
22399 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
22400 if inlined != (member_inline_size <= 4) {
22401 return Err(fidl::Error::InvalidInlineBitInEnvelope);
22402 }
22403 let inner_offset;
22404 let mut inner_depth = depth.clone();
22405 if inlined {
22406 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
22407 inner_offset = next_offset;
22408 } else {
22409 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
22410 inner_depth.increment()?;
22411 }
22412 let val_ref =
22413 self.stream_lifetime_ordinal.get_or_insert_with(|| fidl::new_empty!(u64, D));
22414 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
22415 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
22416 {
22417 return Err(fidl::Error::InvalidNumBytesInEnvelope);
22418 }
22419 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
22420 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
22421 }
22422 }
22423
22424 next_offset += envelope_size;
22425 _next_ordinal_to_read += 1;
22426 if next_offset >= end_offset {
22427 return Ok(());
22428 }
22429
22430 while _next_ordinal_to_read < 2 {
22432 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
22433 _next_ordinal_to_read += 1;
22434 next_offset += envelope_size;
22435 }
22436
22437 let next_out_of_line = decoder.next_out_of_line();
22438 let handles_before = decoder.remaining_handles();
22439 if let Some((inlined, num_bytes, num_handles)) =
22440 fidl::encoding::decode_envelope_header(decoder, next_offset)?
22441 {
22442 let member_inline_size =
22443 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
22444 if inlined != (member_inline_size <= 4) {
22445 return Err(fidl::Error::InvalidInlineBitInEnvelope);
22446 }
22447 let inner_offset;
22448 let mut inner_depth = depth.clone();
22449 if inlined {
22450 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
22451 inner_offset = next_offset;
22452 } else {
22453 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
22454 inner_depth.increment()?;
22455 }
22456 let val_ref = self
22457 .buffer_constraints_action_required
22458 .get_or_insert_with(|| fidl::new_empty!(bool, D));
22459 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
22460 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
22461 {
22462 return Err(fidl::Error::InvalidNumBytesInEnvelope);
22463 }
22464 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
22465 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
22466 }
22467 }
22468
22469 next_offset += envelope_size;
22470 _next_ordinal_to_read += 1;
22471 if next_offset >= end_offset {
22472 return Ok(());
22473 }
22474
22475 while _next_ordinal_to_read < 3 {
22477 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
22478 _next_ordinal_to_read += 1;
22479 next_offset += envelope_size;
22480 }
22481
22482 let next_out_of_line = decoder.next_out_of_line();
22483 let handles_before = decoder.remaining_handles();
22484 if let Some((inlined, num_bytes, num_handles)) =
22485 fidl::encoding::decode_envelope_header(decoder, next_offset)?
22486 {
22487 let member_inline_size =
22488 <StreamBufferConstraints as fidl::encoding::TypeMarker>::inline_size(
22489 decoder.context,
22490 );
22491 if inlined != (member_inline_size <= 4) {
22492 return Err(fidl::Error::InvalidInlineBitInEnvelope);
22493 }
22494 let inner_offset;
22495 let mut inner_depth = depth.clone();
22496 if inlined {
22497 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
22498 inner_offset = next_offset;
22499 } else {
22500 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
22501 inner_depth.increment()?;
22502 }
22503 let val_ref = self
22504 .buffer_constraints
22505 .get_or_insert_with(|| fidl::new_empty!(StreamBufferConstraints, D));
22506 fidl::decode!(
22507 StreamBufferConstraints,
22508 D,
22509 val_ref,
22510 decoder,
22511 inner_offset,
22512 inner_depth
22513 )?;
22514 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
22515 {
22516 return Err(fidl::Error::InvalidNumBytesInEnvelope);
22517 }
22518 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
22519 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
22520 }
22521 }
22522
22523 next_offset += envelope_size;
22524
22525 while next_offset < end_offset {
22527 _next_ordinal_to_read += 1;
22528 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
22529 next_offset += envelope_size;
22530 }
22531
22532 Ok(())
22533 }
22534 }
22535
22536 impl StreamOutputFormat {
22537 #[inline(always)]
22538 fn max_ordinal_present(&self) -> u64 {
22539 if let Some(_) = self.format_details {
22540 return 2;
22541 }
22542 if let Some(_) = self.stream_lifetime_ordinal {
22543 return 1;
22544 }
22545 0
22546 }
22547 }
22548
22549 impl fidl::encoding::ValueTypeMarker for StreamOutputFormat {
22550 type Borrowed<'a> = &'a Self;
22551 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
22552 value
22553 }
22554 }
22555
22556 unsafe impl fidl::encoding::TypeMarker for StreamOutputFormat {
22557 type Owned = Self;
22558
22559 #[inline(always)]
22560 fn inline_align(_context: fidl::encoding::Context) -> usize {
22561 8
22562 }
22563
22564 #[inline(always)]
22565 fn inline_size(_context: fidl::encoding::Context) -> usize {
22566 16
22567 }
22568 }
22569
22570 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<StreamOutputFormat, D>
22571 for &StreamOutputFormat
22572 {
22573 unsafe fn encode(
22574 self,
22575 encoder: &mut fidl::encoding::Encoder<'_, D>,
22576 offset: usize,
22577 mut depth: fidl::encoding::Depth,
22578 ) -> fidl::Result<()> {
22579 encoder.debug_check_bounds::<StreamOutputFormat>(offset);
22580 let max_ordinal: u64 = self.max_ordinal_present();
22582 encoder.write_num(max_ordinal, offset);
22583 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
22584 if max_ordinal == 0 {
22586 return Ok(());
22587 }
22588 depth.increment()?;
22589 let envelope_size = 8;
22590 let bytes_len = max_ordinal as usize * envelope_size;
22591 #[allow(unused_variables)]
22592 let offset = encoder.out_of_line_offset(bytes_len);
22593 let mut _prev_end_offset: usize = 0;
22594 if 1 > max_ordinal {
22595 return Ok(());
22596 }
22597
22598 let cur_offset: usize = (1 - 1) * envelope_size;
22601
22602 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
22604
22605 fidl::encoding::encode_in_envelope_optional::<u64, D>(
22610 self.stream_lifetime_ordinal
22611 .as_ref()
22612 .map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
22613 encoder,
22614 offset + cur_offset,
22615 depth,
22616 )?;
22617
22618 _prev_end_offset = cur_offset + envelope_size;
22619 if 2 > max_ordinal {
22620 return Ok(());
22621 }
22622
22623 let cur_offset: usize = (2 - 1) * envelope_size;
22626
22627 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
22629
22630 fidl::encoding::encode_in_envelope_optional::<FormatDetails, D>(
22635 self.format_details
22636 .as_ref()
22637 .map(<FormatDetails as fidl::encoding::ValueTypeMarker>::borrow),
22638 encoder,
22639 offset + cur_offset,
22640 depth,
22641 )?;
22642
22643 _prev_end_offset = cur_offset + envelope_size;
22644
22645 Ok(())
22646 }
22647 }
22648
22649 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for StreamOutputFormat {
22650 #[inline(always)]
22651 fn new_empty() -> Self {
22652 Self::default()
22653 }
22654
22655 unsafe fn decode(
22656 &mut self,
22657 decoder: &mut fidl::encoding::Decoder<'_, D>,
22658 offset: usize,
22659 mut depth: fidl::encoding::Depth,
22660 ) -> fidl::Result<()> {
22661 decoder.debug_check_bounds::<Self>(offset);
22662 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
22663 None => return Err(fidl::Error::NotNullable),
22664 Some(len) => len,
22665 };
22666 if len == 0 {
22668 return Ok(());
22669 };
22670 depth.increment()?;
22671 let envelope_size = 8;
22672 let bytes_len = len * envelope_size;
22673 let offset = decoder.out_of_line_offset(bytes_len)?;
22674 let mut _next_ordinal_to_read = 0;
22676 let mut next_offset = offset;
22677 let end_offset = offset + bytes_len;
22678 _next_ordinal_to_read += 1;
22679 if next_offset >= end_offset {
22680 return Ok(());
22681 }
22682
22683 while _next_ordinal_to_read < 1 {
22685 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
22686 _next_ordinal_to_read += 1;
22687 next_offset += envelope_size;
22688 }
22689
22690 let next_out_of_line = decoder.next_out_of_line();
22691 let handles_before = decoder.remaining_handles();
22692 if let Some((inlined, num_bytes, num_handles)) =
22693 fidl::encoding::decode_envelope_header(decoder, next_offset)?
22694 {
22695 let member_inline_size =
22696 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
22697 if inlined != (member_inline_size <= 4) {
22698 return Err(fidl::Error::InvalidInlineBitInEnvelope);
22699 }
22700 let inner_offset;
22701 let mut inner_depth = depth.clone();
22702 if inlined {
22703 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
22704 inner_offset = next_offset;
22705 } else {
22706 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
22707 inner_depth.increment()?;
22708 }
22709 let val_ref =
22710 self.stream_lifetime_ordinal.get_or_insert_with(|| fidl::new_empty!(u64, D));
22711 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
22712 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
22713 {
22714 return Err(fidl::Error::InvalidNumBytesInEnvelope);
22715 }
22716 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
22717 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
22718 }
22719 }
22720
22721 next_offset += envelope_size;
22722 _next_ordinal_to_read += 1;
22723 if next_offset >= end_offset {
22724 return Ok(());
22725 }
22726
22727 while _next_ordinal_to_read < 2 {
22729 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
22730 _next_ordinal_to_read += 1;
22731 next_offset += envelope_size;
22732 }
22733
22734 let next_out_of_line = decoder.next_out_of_line();
22735 let handles_before = decoder.remaining_handles();
22736 if let Some((inlined, num_bytes, num_handles)) =
22737 fidl::encoding::decode_envelope_header(decoder, next_offset)?
22738 {
22739 let member_inline_size =
22740 <FormatDetails as fidl::encoding::TypeMarker>::inline_size(decoder.context);
22741 if inlined != (member_inline_size <= 4) {
22742 return Err(fidl::Error::InvalidInlineBitInEnvelope);
22743 }
22744 let inner_offset;
22745 let mut inner_depth = depth.clone();
22746 if inlined {
22747 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
22748 inner_offset = next_offset;
22749 } else {
22750 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
22751 inner_depth.increment()?;
22752 }
22753 let val_ref =
22754 self.format_details.get_or_insert_with(|| fidl::new_empty!(FormatDetails, D));
22755 fidl::decode!(FormatDetails, D, val_ref, decoder, inner_offset, inner_depth)?;
22756 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
22757 {
22758 return Err(fidl::Error::InvalidNumBytesInEnvelope);
22759 }
22760 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
22761 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
22762 }
22763 }
22764
22765 next_offset += envelope_size;
22766
22767 while next_offset < end_offset {
22769 _next_ordinal_to_read += 1;
22770 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
22771 next_offset += envelope_size;
22772 }
22773
22774 Ok(())
22775 }
22776 }
22777
22778 impl StreamProcessorOnOutputTimestampHasNoOutputRequest {
22779 #[inline(always)]
22780 fn max_ordinal_present(&self) -> u64 {
22781 if let Some(_) = self.timestamp_ish {
22782 return 2;
22783 }
22784 if let Some(_) = self.stream_lifetime_ordinal {
22785 return 1;
22786 }
22787 0
22788 }
22789 }
22790
22791 impl fidl::encoding::ValueTypeMarker for StreamProcessorOnOutputTimestampHasNoOutputRequest {
22792 type Borrowed<'a> = &'a Self;
22793 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
22794 value
22795 }
22796 }
22797
22798 unsafe impl fidl::encoding::TypeMarker for StreamProcessorOnOutputTimestampHasNoOutputRequest {
22799 type Owned = Self;
22800
22801 #[inline(always)]
22802 fn inline_align(_context: fidl::encoding::Context) -> usize {
22803 8
22804 }
22805
22806 #[inline(always)]
22807 fn inline_size(_context: fidl::encoding::Context) -> usize {
22808 16
22809 }
22810 }
22811
22812 unsafe impl<D: fidl::encoding::ResourceDialect>
22813 fidl::encoding::Encode<StreamProcessorOnOutputTimestampHasNoOutputRequest, D>
22814 for &StreamProcessorOnOutputTimestampHasNoOutputRequest
22815 {
22816 unsafe fn encode(
22817 self,
22818 encoder: &mut fidl::encoding::Encoder<'_, D>,
22819 offset: usize,
22820 mut depth: fidl::encoding::Depth,
22821 ) -> fidl::Result<()> {
22822 encoder
22823 .debug_check_bounds::<StreamProcessorOnOutputTimestampHasNoOutputRequest>(offset);
22824 let max_ordinal: u64 = self.max_ordinal_present();
22826 encoder.write_num(max_ordinal, offset);
22827 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
22828 if max_ordinal == 0 {
22830 return Ok(());
22831 }
22832 depth.increment()?;
22833 let envelope_size = 8;
22834 let bytes_len = max_ordinal as usize * envelope_size;
22835 #[allow(unused_variables)]
22836 let offset = encoder.out_of_line_offset(bytes_len);
22837 let mut _prev_end_offset: usize = 0;
22838 if 1 > max_ordinal {
22839 return Ok(());
22840 }
22841
22842 let cur_offset: usize = (1 - 1) * envelope_size;
22845
22846 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
22848
22849 fidl::encoding::encode_in_envelope_optional::<u64, D>(
22854 self.stream_lifetime_ordinal
22855 .as_ref()
22856 .map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
22857 encoder,
22858 offset + cur_offset,
22859 depth,
22860 )?;
22861
22862 _prev_end_offset = cur_offset + envelope_size;
22863 if 2 > max_ordinal {
22864 return Ok(());
22865 }
22866
22867 let cur_offset: usize = (2 - 1) * envelope_size;
22870
22871 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
22873
22874 fidl::encoding::encode_in_envelope_optional::<u64, D>(
22879 self.timestamp_ish.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
22880 encoder,
22881 offset + cur_offset,
22882 depth,
22883 )?;
22884
22885 _prev_end_offset = cur_offset + envelope_size;
22886
22887 Ok(())
22888 }
22889 }
22890
22891 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
22892 for StreamProcessorOnOutputTimestampHasNoOutputRequest
22893 {
22894 #[inline(always)]
22895 fn new_empty() -> Self {
22896 Self::default()
22897 }
22898
22899 unsafe fn decode(
22900 &mut self,
22901 decoder: &mut fidl::encoding::Decoder<'_, D>,
22902 offset: usize,
22903 mut depth: fidl::encoding::Depth,
22904 ) -> fidl::Result<()> {
22905 decoder.debug_check_bounds::<Self>(offset);
22906 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
22907 None => return Err(fidl::Error::NotNullable),
22908 Some(len) => len,
22909 };
22910 if len == 0 {
22912 return Ok(());
22913 };
22914 depth.increment()?;
22915 let envelope_size = 8;
22916 let bytes_len = len * envelope_size;
22917 let offset = decoder.out_of_line_offset(bytes_len)?;
22918 let mut _next_ordinal_to_read = 0;
22920 let mut next_offset = offset;
22921 let end_offset = offset + bytes_len;
22922 _next_ordinal_to_read += 1;
22923 if next_offset >= end_offset {
22924 return Ok(());
22925 }
22926
22927 while _next_ordinal_to_read < 1 {
22929 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
22930 _next_ordinal_to_read += 1;
22931 next_offset += envelope_size;
22932 }
22933
22934 let next_out_of_line = decoder.next_out_of_line();
22935 let handles_before = decoder.remaining_handles();
22936 if let Some((inlined, num_bytes, num_handles)) =
22937 fidl::encoding::decode_envelope_header(decoder, next_offset)?
22938 {
22939 let member_inline_size =
22940 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
22941 if inlined != (member_inline_size <= 4) {
22942 return Err(fidl::Error::InvalidInlineBitInEnvelope);
22943 }
22944 let inner_offset;
22945 let mut inner_depth = depth.clone();
22946 if inlined {
22947 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
22948 inner_offset = next_offset;
22949 } else {
22950 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
22951 inner_depth.increment()?;
22952 }
22953 let val_ref =
22954 self.stream_lifetime_ordinal.get_or_insert_with(|| fidl::new_empty!(u64, D));
22955 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
22956 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
22957 {
22958 return Err(fidl::Error::InvalidNumBytesInEnvelope);
22959 }
22960 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
22961 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
22962 }
22963 }
22964
22965 next_offset += envelope_size;
22966 _next_ordinal_to_read += 1;
22967 if next_offset >= end_offset {
22968 return Ok(());
22969 }
22970
22971 while _next_ordinal_to_read < 2 {
22973 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
22974 _next_ordinal_to_read += 1;
22975 next_offset += envelope_size;
22976 }
22977
22978 let next_out_of_line = decoder.next_out_of_line();
22979 let handles_before = decoder.remaining_handles();
22980 if let Some((inlined, num_bytes, num_handles)) =
22981 fidl::encoding::decode_envelope_header(decoder, next_offset)?
22982 {
22983 let member_inline_size =
22984 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
22985 if inlined != (member_inline_size <= 4) {
22986 return Err(fidl::Error::InvalidInlineBitInEnvelope);
22987 }
22988 let inner_offset;
22989 let mut inner_depth = depth.clone();
22990 if inlined {
22991 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
22992 inner_offset = next_offset;
22993 } else {
22994 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
22995 inner_depth.increment()?;
22996 }
22997 let val_ref = self.timestamp_ish.get_or_insert_with(|| fidl::new_empty!(u64, D));
22998 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
22999 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
23000 {
23001 return Err(fidl::Error::InvalidNumBytesInEnvelope);
23002 }
23003 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
23004 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
23005 }
23006 }
23007
23008 next_offset += envelope_size;
23009
23010 while next_offset < end_offset {
23012 _next_ordinal_to_read += 1;
23013 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
23014 next_offset += envelope_size;
23015 }
23016
23017 Ok(())
23018 }
23019 }
23020
23021 impl UsageStateDucked {
23022 #[inline(always)]
23023 fn max_ordinal_present(&self) -> u64 {
23024 0
23025 }
23026 }
23027
23028 impl fidl::encoding::ValueTypeMarker for UsageStateDucked {
23029 type Borrowed<'a> = &'a Self;
23030 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
23031 value
23032 }
23033 }
23034
23035 unsafe impl fidl::encoding::TypeMarker for UsageStateDucked {
23036 type Owned = Self;
23037
23038 #[inline(always)]
23039 fn inline_align(_context: fidl::encoding::Context) -> usize {
23040 8
23041 }
23042
23043 #[inline(always)]
23044 fn inline_size(_context: fidl::encoding::Context) -> usize {
23045 16
23046 }
23047 }
23048
23049 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<UsageStateDucked, D>
23050 for &UsageStateDucked
23051 {
23052 unsafe fn encode(
23053 self,
23054 encoder: &mut fidl::encoding::Encoder<'_, D>,
23055 offset: usize,
23056 mut depth: fidl::encoding::Depth,
23057 ) -> fidl::Result<()> {
23058 encoder.debug_check_bounds::<UsageStateDucked>(offset);
23059 let max_ordinal: u64 = self.max_ordinal_present();
23061 encoder.write_num(max_ordinal, offset);
23062 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
23063 if max_ordinal == 0 {
23065 return Ok(());
23066 }
23067 depth.increment()?;
23068 let envelope_size = 8;
23069 let bytes_len = max_ordinal as usize * envelope_size;
23070 #[allow(unused_variables)]
23071 let offset = encoder.out_of_line_offset(bytes_len);
23072 let mut _prev_end_offset: usize = 0;
23073
23074 Ok(())
23075 }
23076 }
23077
23078 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for UsageStateDucked {
23079 #[inline(always)]
23080 fn new_empty() -> Self {
23081 Self::default()
23082 }
23083
23084 unsafe fn decode(
23085 &mut self,
23086 decoder: &mut fidl::encoding::Decoder<'_, D>,
23087 offset: usize,
23088 mut depth: fidl::encoding::Depth,
23089 ) -> fidl::Result<()> {
23090 decoder.debug_check_bounds::<Self>(offset);
23091 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
23092 None => return Err(fidl::Error::NotNullable),
23093 Some(len) => len,
23094 };
23095 if len == 0 {
23097 return Ok(());
23098 };
23099 depth.increment()?;
23100 let envelope_size = 8;
23101 let bytes_len = len * envelope_size;
23102 let offset = decoder.out_of_line_offset(bytes_len)?;
23103 let mut _next_ordinal_to_read = 0;
23105 let mut next_offset = offset;
23106 let end_offset = offset + bytes_len;
23107
23108 while next_offset < end_offset {
23110 _next_ordinal_to_read += 1;
23111 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
23112 next_offset += envelope_size;
23113 }
23114
23115 Ok(())
23116 }
23117 }
23118
23119 impl UsageStateMuted {
23120 #[inline(always)]
23121 fn max_ordinal_present(&self) -> u64 {
23122 0
23123 }
23124 }
23125
23126 impl fidl::encoding::ValueTypeMarker for UsageStateMuted {
23127 type Borrowed<'a> = &'a Self;
23128 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
23129 value
23130 }
23131 }
23132
23133 unsafe impl fidl::encoding::TypeMarker for UsageStateMuted {
23134 type Owned = Self;
23135
23136 #[inline(always)]
23137 fn inline_align(_context: fidl::encoding::Context) -> usize {
23138 8
23139 }
23140
23141 #[inline(always)]
23142 fn inline_size(_context: fidl::encoding::Context) -> usize {
23143 16
23144 }
23145 }
23146
23147 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<UsageStateMuted, D>
23148 for &UsageStateMuted
23149 {
23150 unsafe fn encode(
23151 self,
23152 encoder: &mut fidl::encoding::Encoder<'_, D>,
23153 offset: usize,
23154 mut depth: fidl::encoding::Depth,
23155 ) -> fidl::Result<()> {
23156 encoder.debug_check_bounds::<UsageStateMuted>(offset);
23157 let max_ordinal: u64 = self.max_ordinal_present();
23159 encoder.write_num(max_ordinal, offset);
23160 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
23161 if max_ordinal == 0 {
23163 return Ok(());
23164 }
23165 depth.increment()?;
23166 let envelope_size = 8;
23167 let bytes_len = max_ordinal as usize * envelope_size;
23168 #[allow(unused_variables)]
23169 let offset = encoder.out_of_line_offset(bytes_len);
23170 let mut _prev_end_offset: usize = 0;
23171
23172 Ok(())
23173 }
23174 }
23175
23176 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for UsageStateMuted {
23177 #[inline(always)]
23178 fn new_empty() -> Self {
23179 Self::default()
23180 }
23181
23182 unsafe fn decode(
23183 &mut self,
23184 decoder: &mut fidl::encoding::Decoder<'_, D>,
23185 offset: usize,
23186 mut depth: fidl::encoding::Depth,
23187 ) -> fidl::Result<()> {
23188 decoder.debug_check_bounds::<Self>(offset);
23189 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
23190 None => return Err(fidl::Error::NotNullable),
23191 Some(len) => len,
23192 };
23193 if len == 0 {
23195 return Ok(());
23196 };
23197 depth.increment()?;
23198 let envelope_size = 8;
23199 let bytes_len = len * envelope_size;
23200 let offset = decoder.out_of_line_offset(bytes_len)?;
23201 let mut _next_ordinal_to_read = 0;
23203 let mut next_offset = offset;
23204 let end_offset = offset + bytes_len;
23205
23206 while next_offset < end_offset {
23208 _next_ordinal_to_read += 1;
23209 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
23210 next_offset += envelope_size;
23211 }
23212
23213 Ok(())
23214 }
23215 }
23216
23217 impl UsageStateUnadjusted {
23218 #[inline(always)]
23219 fn max_ordinal_present(&self) -> u64 {
23220 0
23221 }
23222 }
23223
23224 impl fidl::encoding::ValueTypeMarker for UsageStateUnadjusted {
23225 type Borrowed<'a> = &'a Self;
23226 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
23227 value
23228 }
23229 }
23230
23231 unsafe impl fidl::encoding::TypeMarker for UsageStateUnadjusted {
23232 type Owned = Self;
23233
23234 #[inline(always)]
23235 fn inline_align(_context: fidl::encoding::Context) -> usize {
23236 8
23237 }
23238
23239 #[inline(always)]
23240 fn inline_size(_context: fidl::encoding::Context) -> usize {
23241 16
23242 }
23243 }
23244
23245 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<UsageStateUnadjusted, D>
23246 for &UsageStateUnadjusted
23247 {
23248 unsafe fn encode(
23249 self,
23250 encoder: &mut fidl::encoding::Encoder<'_, D>,
23251 offset: usize,
23252 mut depth: fidl::encoding::Depth,
23253 ) -> fidl::Result<()> {
23254 encoder.debug_check_bounds::<UsageStateUnadjusted>(offset);
23255 let max_ordinal: u64 = self.max_ordinal_present();
23257 encoder.write_num(max_ordinal, offset);
23258 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
23259 if max_ordinal == 0 {
23261 return Ok(());
23262 }
23263 depth.increment()?;
23264 let envelope_size = 8;
23265 let bytes_len = max_ordinal as usize * envelope_size;
23266 #[allow(unused_variables)]
23267 let offset = encoder.out_of_line_offset(bytes_len);
23268 let mut _prev_end_offset: usize = 0;
23269
23270 Ok(())
23271 }
23272 }
23273
23274 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for UsageStateUnadjusted {
23275 #[inline(always)]
23276 fn new_empty() -> Self {
23277 Self::default()
23278 }
23279
23280 unsafe fn decode(
23281 &mut self,
23282 decoder: &mut fidl::encoding::Decoder<'_, D>,
23283 offset: usize,
23284 mut depth: fidl::encoding::Depth,
23285 ) -> fidl::Result<()> {
23286 decoder.debug_check_bounds::<Self>(offset);
23287 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
23288 None => return Err(fidl::Error::NotNullable),
23289 Some(len) => len,
23290 };
23291 if len == 0 {
23293 return Ok(());
23294 };
23295 depth.increment()?;
23296 let envelope_size = 8;
23297 let bytes_len = len * envelope_size;
23298 let offset = decoder.out_of_line_offset(bytes_len)?;
23299 let mut _next_ordinal_to_read = 0;
23301 let mut next_offset = offset;
23302 let end_offset = offset + bytes_len;
23303
23304 while next_offset < end_offset {
23306 _next_ordinal_to_read += 1;
23307 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
23308 next_offset += envelope_size;
23309 }
23310
23311 Ok(())
23312 }
23313 }
23314
23315 impl fidl::encoding::ValueTypeMarker for AacBitRate {
23316 type Borrowed<'a> = &'a Self;
23317 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
23318 value
23319 }
23320 }
23321
23322 unsafe impl fidl::encoding::TypeMarker for AacBitRate {
23323 type Owned = Self;
23324
23325 #[inline(always)]
23326 fn inline_align(_context: fidl::encoding::Context) -> usize {
23327 8
23328 }
23329
23330 #[inline(always)]
23331 fn inline_size(_context: fidl::encoding::Context) -> usize {
23332 16
23333 }
23334 }
23335
23336 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AacBitRate, D>
23337 for &AacBitRate
23338 {
23339 #[inline]
23340 unsafe fn encode(
23341 self,
23342 encoder: &mut fidl::encoding::Encoder<'_, D>,
23343 offset: usize,
23344 _depth: fidl::encoding::Depth,
23345 ) -> fidl::Result<()> {
23346 encoder.debug_check_bounds::<AacBitRate>(offset);
23347 encoder.write_num::<u64>(self.ordinal(), offset);
23348 match self {
23349 AacBitRate::Constant(ref val) => {
23350 fidl::encoding::encode_in_envelope::<AacConstantBitRate, D>(
23351 <AacConstantBitRate as fidl::encoding::ValueTypeMarker>::borrow(val),
23352 encoder,
23353 offset + 8,
23354 _depth,
23355 )
23356 }
23357 AacBitRate::Variable(ref val) => {
23358 fidl::encoding::encode_in_envelope::<AacVariableBitRate, D>(
23359 <AacVariableBitRate as fidl::encoding::ValueTypeMarker>::borrow(val),
23360 encoder,
23361 offset + 8,
23362 _depth,
23363 )
23364 }
23365 }
23366 }
23367 }
23368
23369 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AacBitRate {
23370 #[inline(always)]
23371 fn new_empty() -> Self {
23372 Self::Constant(fidl::new_empty!(AacConstantBitRate, D))
23373 }
23374
23375 #[inline]
23376 unsafe fn decode(
23377 &mut self,
23378 decoder: &mut fidl::encoding::Decoder<'_, D>,
23379 offset: usize,
23380 mut depth: fidl::encoding::Depth,
23381 ) -> fidl::Result<()> {
23382 decoder.debug_check_bounds::<Self>(offset);
23383 #[allow(unused_variables)]
23384 let next_out_of_line = decoder.next_out_of_line();
23385 let handles_before = decoder.remaining_handles();
23386 let (ordinal, inlined, num_bytes, num_handles) =
23387 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
23388
23389 let member_inline_size = match ordinal {
23390 1 => {
23391 <AacConstantBitRate as fidl::encoding::TypeMarker>::inline_size(decoder.context)
23392 }
23393 2 => {
23394 <AacVariableBitRate as fidl::encoding::TypeMarker>::inline_size(decoder.context)
23395 }
23396 _ => return Err(fidl::Error::UnknownUnionTag),
23397 };
23398
23399 if inlined != (member_inline_size <= 4) {
23400 return Err(fidl::Error::InvalidInlineBitInEnvelope);
23401 }
23402 let _inner_offset;
23403 if inlined {
23404 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
23405 _inner_offset = offset + 8;
23406 } else {
23407 depth.increment()?;
23408 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
23409 }
23410 match ordinal {
23411 1 => {
23412 #[allow(irrefutable_let_patterns)]
23413 if let AacBitRate::Constant(_) = self {
23414 } else {
23416 *self = AacBitRate::Constant(fidl::new_empty!(AacConstantBitRate, D));
23418 }
23419 #[allow(irrefutable_let_patterns)]
23420 if let AacBitRate::Constant(ref mut val) = self {
23421 fidl::decode!(AacConstantBitRate, D, val, decoder, _inner_offset, depth)?;
23422 } else {
23423 unreachable!()
23424 }
23425 }
23426 2 => {
23427 #[allow(irrefutable_let_patterns)]
23428 if let AacBitRate::Variable(_) = self {
23429 } else {
23431 *self = AacBitRate::Variable(fidl::new_empty!(AacVariableBitRate, D));
23433 }
23434 #[allow(irrefutable_let_patterns)]
23435 if let AacBitRate::Variable(ref mut val) = self {
23436 fidl::decode!(AacVariableBitRate, D, val, decoder, _inner_offset, depth)?;
23437 } else {
23438 unreachable!()
23439 }
23440 }
23441 ordinal => panic!("unexpected ordinal {:?}", ordinal),
23442 }
23443 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
23444 return Err(fidl::Error::InvalidNumBytesInEnvelope);
23445 }
23446 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
23447 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
23448 }
23449 Ok(())
23450 }
23451 }
23452
23453 impl fidl::encoding::ValueTypeMarker for AacTransport {
23454 type Borrowed<'a> = &'a Self;
23455 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
23456 value
23457 }
23458 }
23459
23460 unsafe impl fidl::encoding::TypeMarker for AacTransport {
23461 type Owned = Self;
23462
23463 #[inline(always)]
23464 fn inline_align(_context: fidl::encoding::Context) -> usize {
23465 8
23466 }
23467
23468 #[inline(always)]
23469 fn inline_size(_context: fidl::encoding::Context) -> usize {
23470 16
23471 }
23472 }
23473
23474 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AacTransport, D>
23475 for &AacTransport
23476 {
23477 #[inline]
23478 unsafe fn encode(
23479 self,
23480 encoder: &mut fidl::encoding::Encoder<'_, D>,
23481 offset: usize,
23482 _depth: fidl::encoding::Depth,
23483 ) -> fidl::Result<()> {
23484 encoder.debug_check_bounds::<AacTransport>(offset);
23485 encoder.write_num::<u64>(self.ordinal(), offset);
23486 match self {
23487 AacTransport::Raw(ref val) => {
23488 fidl::encoding::encode_in_envelope::<AacTransportRaw, D>(
23489 <AacTransportRaw as fidl::encoding::ValueTypeMarker>::borrow(val),
23490 encoder,
23491 offset + 8,
23492 _depth,
23493 )
23494 }
23495 AacTransport::Latm(ref val) => {
23496 fidl::encoding::encode_in_envelope::<AacTransportLatm, D>(
23497 <AacTransportLatm as fidl::encoding::ValueTypeMarker>::borrow(val),
23498 encoder,
23499 offset + 8,
23500 _depth,
23501 )
23502 }
23503 AacTransport::Adts(ref val) => {
23504 fidl::encoding::encode_in_envelope::<AacTransportAdts, D>(
23505 <AacTransportAdts as fidl::encoding::ValueTypeMarker>::borrow(val),
23506 encoder,
23507 offset + 8,
23508 _depth,
23509 )
23510 }
23511 AacTransport::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
23512 }
23513 }
23514 }
23515
23516 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AacTransport {
23517 #[inline(always)]
23518 fn new_empty() -> Self {
23519 Self::__SourceBreaking { unknown_ordinal: 0 }
23520 }
23521
23522 #[inline]
23523 unsafe fn decode(
23524 &mut self,
23525 decoder: &mut fidl::encoding::Decoder<'_, D>,
23526 offset: usize,
23527 mut depth: fidl::encoding::Depth,
23528 ) -> fidl::Result<()> {
23529 decoder.debug_check_bounds::<Self>(offset);
23530 #[allow(unused_variables)]
23531 let next_out_of_line = decoder.next_out_of_line();
23532 let handles_before = decoder.remaining_handles();
23533 let (ordinal, inlined, num_bytes, num_handles) =
23534 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
23535
23536 let member_inline_size = match ordinal {
23537 1 => <AacTransportRaw as fidl::encoding::TypeMarker>::inline_size(decoder.context),
23538 2 => <AacTransportLatm as fidl::encoding::TypeMarker>::inline_size(decoder.context),
23539 3 => <AacTransportAdts as fidl::encoding::TypeMarker>::inline_size(decoder.context),
23540 0 => return Err(fidl::Error::UnknownUnionTag),
23541 _ => num_bytes as usize,
23542 };
23543
23544 if inlined != (member_inline_size <= 4) {
23545 return Err(fidl::Error::InvalidInlineBitInEnvelope);
23546 }
23547 let _inner_offset;
23548 if inlined {
23549 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
23550 _inner_offset = offset + 8;
23551 } else {
23552 depth.increment()?;
23553 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
23554 }
23555 match ordinal {
23556 1 => {
23557 #[allow(irrefutable_let_patterns)]
23558 if let AacTransport::Raw(_) = self {
23559 } else {
23561 *self = AacTransport::Raw(fidl::new_empty!(AacTransportRaw, D));
23563 }
23564 #[allow(irrefutable_let_patterns)]
23565 if let AacTransport::Raw(ref mut val) = self {
23566 fidl::decode!(AacTransportRaw, D, val, decoder, _inner_offset, depth)?;
23567 } else {
23568 unreachable!()
23569 }
23570 }
23571 2 => {
23572 #[allow(irrefutable_let_patterns)]
23573 if let AacTransport::Latm(_) = self {
23574 } else {
23576 *self = AacTransport::Latm(fidl::new_empty!(AacTransportLatm, D));
23578 }
23579 #[allow(irrefutable_let_patterns)]
23580 if let AacTransport::Latm(ref mut val) = self {
23581 fidl::decode!(AacTransportLatm, D, val, decoder, _inner_offset, depth)?;
23582 } else {
23583 unreachable!()
23584 }
23585 }
23586 3 => {
23587 #[allow(irrefutable_let_patterns)]
23588 if let AacTransport::Adts(_) = self {
23589 } else {
23591 *self = AacTransport::Adts(fidl::new_empty!(AacTransportAdts, D));
23593 }
23594 #[allow(irrefutable_let_patterns)]
23595 if let AacTransport::Adts(ref mut val) = self {
23596 fidl::decode!(AacTransportAdts, D, val, decoder, _inner_offset, depth)?;
23597 } else {
23598 unreachable!()
23599 }
23600 }
23601 #[allow(deprecated)]
23602 ordinal => {
23603 for _ in 0..num_handles {
23604 decoder.drop_next_handle()?;
23605 }
23606 *self = AacTransport::__SourceBreaking { unknown_ordinal: ordinal };
23607 }
23608 }
23609 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
23610 return Err(fidl::Error::InvalidNumBytesInEnvelope);
23611 }
23612 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
23613 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
23614 }
23615 Ok(())
23616 }
23617 }
23618
23619 impl fidl::encoding::ValueTypeMarker for AudioCapturerConfiguration {
23620 type Borrowed<'a> = &'a Self;
23621 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
23622 value
23623 }
23624 }
23625
23626 unsafe impl fidl::encoding::TypeMarker for AudioCapturerConfiguration {
23627 type Owned = Self;
23628
23629 #[inline(always)]
23630 fn inline_align(_context: fidl::encoding::Context) -> usize {
23631 8
23632 }
23633
23634 #[inline(always)]
23635 fn inline_size(_context: fidl::encoding::Context) -> usize {
23636 16
23637 }
23638 }
23639
23640 unsafe impl<D: fidl::encoding::ResourceDialect>
23641 fidl::encoding::Encode<AudioCapturerConfiguration, D> for &AudioCapturerConfiguration
23642 {
23643 #[inline]
23644 unsafe fn encode(
23645 self,
23646 encoder: &mut fidl::encoding::Encoder<'_, D>,
23647 offset: usize,
23648 _depth: fidl::encoding::Depth,
23649 ) -> fidl::Result<()> {
23650 encoder.debug_check_bounds::<AudioCapturerConfiguration>(offset);
23651 encoder.write_num::<u64>(self.ordinal(), offset);
23652 match self {
23653 AudioCapturerConfiguration::Loopback(ref val) => fidl::encoding::encode_in_envelope::<
23654 LoopbackAudioCapturerConfiguration,
23655 D,
23656 >(
23657 <LoopbackAudioCapturerConfiguration as fidl::encoding::ValueTypeMarker>::borrow(
23658 val,
23659 ),
23660 encoder,
23661 offset + 8,
23662 _depth,
23663 ),
23664 AudioCapturerConfiguration::Input(ref val) => fidl::encoding::encode_in_envelope::<
23665 InputAudioCapturerConfiguration,
23666 D,
23667 >(
23668 <InputAudioCapturerConfiguration as fidl::encoding::ValueTypeMarker>::borrow(
23669 val,
23670 ),
23671 encoder,
23672 offset + 8,
23673 _depth,
23674 ),
23675 }
23676 }
23677 }
23678
23679 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
23680 for AudioCapturerConfiguration
23681 {
23682 #[inline(always)]
23683 fn new_empty() -> Self {
23684 Self::Loopback(fidl::new_empty!(LoopbackAudioCapturerConfiguration, D))
23685 }
23686
23687 #[inline]
23688 unsafe fn decode(
23689 &mut self,
23690 decoder: &mut fidl::encoding::Decoder<'_, D>,
23691 offset: usize,
23692 mut depth: fidl::encoding::Depth,
23693 ) -> fidl::Result<()> {
23694 decoder.debug_check_bounds::<Self>(offset);
23695 #[allow(unused_variables)]
23696 let next_out_of_line = decoder.next_out_of_line();
23697 let handles_before = decoder.remaining_handles();
23698 let (ordinal, inlined, num_bytes, num_handles) =
23699 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
23700
23701 let member_inline_size = match ordinal {
23702 1 => {
23703 <LoopbackAudioCapturerConfiguration as fidl::encoding::TypeMarker>::inline_size(
23704 decoder.context,
23705 )
23706 }
23707 2 => <InputAudioCapturerConfiguration as fidl::encoding::TypeMarker>::inline_size(
23708 decoder.context,
23709 ),
23710 _ => return Err(fidl::Error::UnknownUnionTag),
23711 };
23712
23713 if inlined != (member_inline_size <= 4) {
23714 return Err(fidl::Error::InvalidInlineBitInEnvelope);
23715 }
23716 let _inner_offset;
23717 if inlined {
23718 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
23719 _inner_offset = offset + 8;
23720 } else {
23721 depth.increment()?;
23722 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
23723 }
23724 match ordinal {
23725 1 => {
23726 #[allow(irrefutable_let_patterns)]
23727 if let AudioCapturerConfiguration::Loopback(_) = self {
23728 } else {
23730 *self = AudioCapturerConfiguration::Loopback(fidl::new_empty!(
23732 LoopbackAudioCapturerConfiguration,
23733 D
23734 ));
23735 }
23736 #[allow(irrefutable_let_patterns)]
23737 if let AudioCapturerConfiguration::Loopback(ref mut val) = self {
23738 fidl::decode!(
23739 LoopbackAudioCapturerConfiguration,
23740 D,
23741 val,
23742 decoder,
23743 _inner_offset,
23744 depth
23745 )?;
23746 } else {
23747 unreachable!()
23748 }
23749 }
23750 2 => {
23751 #[allow(irrefutable_let_patterns)]
23752 if let AudioCapturerConfiguration::Input(_) = self {
23753 } else {
23755 *self = AudioCapturerConfiguration::Input(fidl::new_empty!(
23757 InputAudioCapturerConfiguration,
23758 D
23759 ));
23760 }
23761 #[allow(irrefutable_let_patterns)]
23762 if let AudioCapturerConfiguration::Input(ref mut val) = self {
23763 fidl::decode!(
23764 InputAudioCapturerConfiguration,
23765 D,
23766 val,
23767 decoder,
23768 _inner_offset,
23769 depth
23770 )?;
23771 } else {
23772 unreachable!()
23773 }
23774 }
23775 ordinal => panic!("unexpected ordinal {:?}", ordinal),
23776 }
23777 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
23778 return Err(fidl::Error::InvalidNumBytesInEnvelope);
23779 }
23780 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
23781 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
23782 }
23783 Ok(())
23784 }
23785 }
23786
23787 impl fidl::encoding::ValueTypeMarker for AudioCompressedFormat {
23788 type Borrowed<'a> = &'a Self;
23789 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
23790 value
23791 }
23792 }
23793
23794 unsafe impl fidl::encoding::TypeMarker for AudioCompressedFormat {
23795 type Owned = Self;
23796
23797 #[inline(always)]
23798 fn inline_align(_context: fidl::encoding::Context) -> usize {
23799 8
23800 }
23801
23802 #[inline(always)]
23803 fn inline_size(_context: fidl::encoding::Context) -> usize {
23804 16
23805 }
23806 }
23807
23808 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AudioCompressedFormat, D>
23809 for &AudioCompressedFormat
23810 {
23811 #[inline]
23812 unsafe fn encode(
23813 self,
23814 encoder: &mut fidl::encoding::Encoder<'_, D>,
23815 offset: usize,
23816 _depth: fidl::encoding::Depth,
23817 ) -> fidl::Result<()> {
23818 encoder.debug_check_bounds::<AudioCompressedFormat>(offset);
23819 encoder.write_num::<u64>(self.ordinal(), offset);
23820 match self {
23821 AudioCompressedFormat::Aac(ref val) => {
23822 fidl::encoding::encode_in_envelope::<AudioCompressedFormatAac, D>(
23823 <AudioCompressedFormatAac as fidl::encoding::ValueTypeMarker>::borrow(val),
23824 encoder,
23825 offset + 8,
23826 _depth,
23827 )
23828 }
23829 AudioCompressedFormat::Sbc(ref val) => {
23830 fidl::encoding::encode_in_envelope::<AudioCompressedFormatSbc, D>(
23831 <AudioCompressedFormatSbc as fidl::encoding::ValueTypeMarker>::borrow(val),
23832 encoder,
23833 offset + 8,
23834 _depth,
23835 )
23836 }
23837 AudioCompressedFormat::Cvsd(ref val) => {
23838 fidl::encoding::encode_in_envelope::<AudioCompressedFormatCvsd, D>(
23839 <AudioCompressedFormatCvsd as fidl::encoding::ValueTypeMarker>::borrow(val),
23840 encoder,
23841 offset + 8,
23842 _depth,
23843 )
23844 }
23845 AudioCompressedFormat::Lc3(ref val) => {
23846 fidl::encoding::encode_in_envelope::<AudioCompressedFormatLc3, D>(
23847 <AudioCompressedFormatLc3 as fidl::encoding::ValueTypeMarker>::borrow(val),
23848 encoder,
23849 offset + 8,
23850 _depth,
23851 )
23852 }
23853 AudioCompressedFormat::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
23854 }
23855 }
23856 }
23857
23858 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AudioCompressedFormat {
23859 #[inline(always)]
23860 fn new_empty() -> Self {
23861 Self::__SourceBreaking { unknown_ordinal: 0 }
23862 }
23863
23864 #[inline]
23865 unsafe fn decode(
23866 &mut self,
23867 decoder: &mut fidl::encoding::Decoder<'_, D>,
23868 offset: usize,
23869 mut depth: fidl::encoding::Depth,
23870 ) -> fidl::Result<()> {
23871 decoder.debug_check_bounds::<Self>(offset);
23872 #[allow(unused_variables)]
23873 let next_out_of_line = decoder.next_out_of_line();
23874 let handles_before = decoder.remaining_handles();
23875 let (ordinal, inlined, num_bytes, num_handles) =
23876 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
23877
23878 let member_inline_size = match ordinal {
23879 1 => <AudioCompressedFormatAac as fidl::encoding::TypeMarker>::inline_size(
23880 decoder.context,
23881 ),
23882 2 => <AudioCompressedFormatSbc as fidl::encoding::TypeMarker>::inline_size(
23883 decoder.context,
23884 ),
23885 3 => <AudioCompressedFormatCvsd as fidl::encoding::TypeMarker>::inline_size(
23886 decoder.context,
23887 ),
23888 4 => <AudioCompressedFormatLc3 as fidl::encoding::TypeMarker>::inline_size(
23889 decoder.context,
23890 ),
23891 0 => return Err(fidl::Error::UnknownUnionTag),
23892 _ => num_bytes as usize,
23893 };
23894
23895 if inlined != (member_inline_size <= 4) {
23896 return Err(fidl::Error::InvalidInlineBitInEnvelope);
23897 }
23898 let _inner_offset;
23899 if inlined {
23900 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
23901 _inner_offset = offset + 8;
23902 } else {
23903 depth.increment()?;
23904 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
23905 }
23906 match ordinal {
23907 1 => {
23908 #[allow(irrefutable_let_patterns)]
23909 if let AudioCompressedFormat::Aac(_) = self {
23910 } else {
23912 *self = AudioCompressedFormat::Aac(fidl::new_empty!(
23914 AudioCompressedFormatAac,
23915 D
23916 ));
23917 }
23918 #[allow(irrefutable_let_patterns)]
23919 if let AudioCompressedFormat::Aac(ref mut val) = self {
23920 fidl::decode!(
23921 AudioCompressedFormatAac,
23922 D,
23923 val,
23924 decoder,
23925 _inner_offset,
23926 depth
23927 )?;
23928 } else {
23929 unreachable!()
23930 }
23931 }
23932 2 => {
23933 #[allow(irrefutable_let_patterns)]
23934 if let AudioCompressedFormat::Sbc(_) = self {
23935 } else {
23937 *self = AudioCompressedFormat::Sbc(fidl::new_empty!(
23939 AudioCompressedFormatSbc,
23940 D
23941 ));
23942 }
23943 #[allow(irrefutable_let_patterns)]
23944 if let AudioCompressedFormat::Sbc(ref mut val) = self {
23945 fidl::decode!(
23946 AudioCompressedFormatSbc,
23947 D,
23948 val,
23949 decoder,
23950 _inner_offset,
23951 depth
23952 )?;
23953 } else {
23954 unreachable!()
23955 }
23956 }
23957 3 => {
23958 #[allow(irrefutable_let_patterns)]
23959 if let AudioCompressedFormat::Cvsd(_) = self {
23960 } else {
23962 *self = AudioCompressedFormat::Cvsd(fidl::new_empty!(
23964 AudioCompressedFormatCvsd,
23965 D
23966 ));
23967 }
23968 #[allow(irrefutable_let_patterns)]
23969 if let AudioCompressedFormat::Cvsd(ref mut val) = self {
23970 fidl::decode!(
23971 AudioCompressedFormatCvsd,
23972 D,
23973 val,
23974 decoder,
23975 _inner_offset,
23976 depth
23977 )?;
23978 } else {
23979 unreachable!()
23980 }
23981 }
23982 4 => {
23983 #[allow(irrefutable_let_patterns)]
23984 if let AudioCompressedFormat::Lc3(_) = self {
23985 } else {
23987 *self = AudioCompressedFormat::Lc3(fidl::new_empty!(
23989 AudioCompressedFormatLc3,
23990 D
23991 ));
23992 }
23993 #[allow(irrefutable_let_patterns)]
23994 if let AudioCompressedFormat::Lc3(ref mut val) = self {
23995 fidl::decode!(
23996 AudioCompressedFormatLc3,
23997 D,
23998 val,
23999 decoder,
24000 _inner_offset,
24001 depth
24002 )?;
24003 } else {
24004 unreachable!()
24005 }
24006 }
24007 #[allow(deprecated)]
24008 ordinal => {
24009 for _ in 0..num_handles {
24010 decoder.drop_next_handle()?;
24011 }
24012 *self = AudioCompressedFormat::__SourceBreaking { unknown_ordinal: ordinal };
24013 }
24014 }
24015 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
24016 return Err(fidl::Error::InvalidNumBytesInEnvelope);
24017 }
24018 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
24019 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
24020 }
24021 Ok(())
24022 }
24023 }
24024
24025 impl fidl::encoding::ValueTypeMarker for AudioConsumerError {
24026 type Borrowed<'a> = &'a Self;
24027 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
24028 value
24029 }
24030 }
24031
24032 unsafe impl fidl::encoding::TypeMarker for AudioConsumerError {
24033 type Owned = Self;
24034
24035 #[inline(always)]
24036 fn inline_align(_context: fidl::encoding::Context) -> usize {
24037 8
24038 }
24039
24040 #[inline(always)]
24041 fn inline_size(_context: fidl::encoding::Context) -> usize {
24042 16
24043 }
24044 }
24045
24046 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AudioConsumerError, D>
24047 for &AudioConsumerError
24048 {
24049 #[inline]
24050 unsafe fn encode(
24051 self,
24052 encoder: &mut fidl::encoding::Encoder<'_, D>,
24053 offset: usize,
24054 _depth: fidl::encoding::Depth,
24055 ) -> fidl::Result<()> {
24056 encoder.debug_check_bounds::<AudioConsumerError>(offset);
24057 encoder.write_num::<u64>(self.ordinal(), offset);
24058 match self {
24059 AudioConsumerError::PlaceHolder(ref val) => {
24060 fidl::encoding::encode_in_envelope::<Void, D>(
24061 <Void as fidl::encoding::ValueTypeMarker>::borrow(val),
24062 encoder,
24063 offset + 8,
24064 _depth,
24065 )
24066 }
24067 }
24068 }
24069 }
24070
24071 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AudioConsumerError {
24072 #[inline(always)]
24073 fn new_empty() -> Self {
24074 Self::PlaceHolder(fidl::new_empty!(Void, D))
24075 }
24076
24077 #[inline]
24078 unsafe fn decode(
24079 &mut self,
24080 decoder: &mut fidl::encoding::Decoder<'_, D>,
24081 offset: usize,
24082 mut depth: fidl::encoding::Depth,
24083 ) -> fidl::Result<()> {
24084 decoder.debug_check_bounds::<Self>(offset);
24085 #[allow(unused_variables)]
24086 let next_out_of_line = decoder.next_out_of_line();
24087 let handles_before = decoder.remaining_handles();
24088 let (ordinal, inlined, num_bytes, num_handles) =
24089 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
24090
24091 let member_inline_size = match ordinal {
24092 1 => <Void as fidl::encoding::TypeMarker>::inline_size(decoder.context),
24093 _ => return Err(fidl::Error::UnknownUnionTag),
24094 };
24095
24096 if inlined != (member_inline_size <= 4) {
24097 return Err(fidl::Error::InvalidInlineBitInEnvelope);
24098 }
24099 let _inner_offset;
24100 if inlined {
24101 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
24102 _inner_offset = offset + 8;
24103 } else {
24104 depth.increment()?;
24105 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
24106 }
24107 match ordinal {
24108 1 => {
24109 #[allow(irrefutable_let_patterns)]
24110 if let AudioConsumerError::PlaceHolder(_) = self {
24111 } else {
24113 *self = AudioConsumerError::PlaceHolder(fidl::new_empty!(Void, D));
24115 }
24116 #[allow(irrefutable_let_patterns)]
24117 if let AudioConsumerError::PlaceHolder(ref mut val) = self {
24118 fidl::decode!(Void, D, val, decoder, _inner_offset, depth)?;
24119 } else {
24120 unreachable!()
24121 }
24122 }
24123 ordinal => panic!("unexpected ordinal {:?}", ordinal),
24124 }
24125 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
24126 return Err(fidl::Error::InvalidNumBytesInEnvelope);
24127 }
24128 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
24129 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
24130 }
24131 Ok(())
24132 }
24133 }
24134
24135 impl fidl::encoding::ValueTypeMarker for AudioFormat {
24136 type Borrowed<'a> = &'a Self;
24137 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
24138 value
24139 }
24140 }
24141
24142 unsafe impl fidl::encoding::TypeMarker for AudioFormat {
24143 type Owned = Self;
24144
24145 #[inline(always)]
24146 fn inline_align(_context: fidl::encoding::Context) -> usize {
24147 8
24148 }
24149
24150 #[inline(always)]
24151 fn inline_size(_context: fidl::encoding::Context) -> usize {
24152 16
24153 }
24154 }
24155
24156 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AudioFormat, D>
24157 for &AudioFormat
24158 {
24159 #[inline]
24160 unsafe fn encode(
24161 self,
24162 encoder: &mut fidl::encoding::Encoder<'_, D>,
24163 offset: usize,
24164 _depth: fidl::encoding::Depth,
24165 ) -> fidl::Result<()> {
24166 encoder.debug_check_bounds::<AudioFormat>(offset);
24167 encoder.write_num::<u64>(self.ordinal(), offset);
24168 match self {
24169 AudioFormat::Compressed(ref val) => {
24170 fidl::encoding::encode_in_envelope::<AudioCompressedFormat, D>(
24171 <AudioCompressedFormat as fidl::encoding::ValueTypeMarker>::borrow(val),
24172 encoder,
24173 offset + 8,
24174 _depth,
24175 )
24176 }
24177 AudioFormat::Uncompressed(ref val) => {
24178 fidl::encoding::encode_in_envelope::<AudioUncompressedFormat, D>(
24179 <AudioUncompressedFormat as fidl::encoding::ValueTypeMarker>::borrow(val),
24180 encoder,
24181 offset + 8,
24182 _depth,
24183 )
24184 }
24185 }
24186 }
24187 }
24188
24189 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AudioFormat {
24190 #[inline(always)]
24191 fn new_empty() -> Self {
24192 Self::Compressed(fidl::new_empty!(AudioCompressedFormat, D))
24193 }
24194
24195 #[inline]
24196 unsafe fn decode(
24197 &mut self,
24198 decoder: &mut fidl::encoding::Decoder<'_, D>,
24199 offset: usize,
24200 mut depth: fidl::encoding::Depth,
24201 ) -> fidl::Result<()> {
24202 decoder.debug_check_bounds::<Self>(offset);
24203 #[allow(unused_variables)]
24204 let next_out_of_line = decoder.next_out_of_line();
24205 let handles_before = decoder.remaining_handles();
24206 let (ordinal, inlined, num_bytes, num_handles) =
24207 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
24208
24209 let member_inline_size = match ordinal {
24210 1 => <AudioCompressedFormat as fidl::encoding::TypeMarker>::inline_size(
24211 decoder.context,
24212 ),
24213 2 => <AudioUncompressedFormat as fidl::encoding::TypeMarker>::inline_size(
24214 decoder.context,
24215 ),
24216 _ => return Err(fidl::Error::UnknownUnionTag),
24217 };
24218
24219 if inlined != (member_inline_size <= 4) {
24220 return Err(fidl::Error::InvalidInlineBitInEnvelope);
24221 }
24222 let _inner_offset;
24223 if inlined {
24224 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
24225 _inner_offset = offset + 8;
24226 } else {
24227 depth.increment()?;
24228 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
24229 }
24230 match ordinal {
24231 1 => {
24232 #[allow(irrefutable_let_patterns)]
24233 if let AudioFormat::Compressed(_) = self {
24234 } else {
24236 *self = AudioFormat::Compressed(fidl::new_empty!(AudioCompressedFormat, D));
24238 }
24239 #[allow(irrefutable_let_patterns)]
24240 if let AudioFormat::Compressed(ref mut val) = self {
24241 fidl::decode!(
24242 AudioCompressedFormat,
24243 D,
24244 val,
24245 decoder,
24246 _inner_offset,
24247 depth
24248 )?;
24249 } else {
24250 unreachable!()
24251 }
24252 }
24253 2 => {
24254 #[allow(irrefutable_let_patterns)]
24255 if let AudioFormat::Uncompressed(_) = self {
24256 } else {
24258 *self =
24260 AudioFormat::Uncompressed(fidl::new_empty!(AudioUncompressedFormat, D));
24261 }
24262 #[allow(irrefutable_let_patterns)]
24263 if let AudioFormat::Uncompressed(ref mut val) = self {
24264 fidl::decode!(
24265 AudioUncompressedFormat,
24266 D,
24267 val,
24268 decoder,
24269 _inner_offset,
24270 depth
24271 )?;
24272 } else {
24273 unreachable!()
24274 }
24275 }
24276 ordinal => panic!("unexpected ordinal {:?}", ordinal),
24277 }
24278 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
24279 return Err(fidl::Error::InvalidNumBytesInEnvelope);
24280 }
24281 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
24282 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
24283 }
24284 Ok(())
24285 }
24286 }
24287
24288 impl fidl::encoding::ValueTypeMarker for AudioUncompressedFormat {
24289 type Borrowed<'a> = &'a Self;
24290 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
24291 value
24292 }
24293 }
24294
24295 unsafe impl fidl::encoding::TypeMarker for AudioUncompressedFormat {
24296 type Owned = Self;
24297
24298 #[inline(always)]
24299 fn inline_align(_context: fidl::encoding::Context) -> usize {
24300 8
24301 }
24302
24303 #[inline(always)]
24304 fn inline_size(_context: fidl::encoding::Context) -> usize {
24305 16
24306 }
24307 }
24308
24309 unsafe impl<D: fidl::encoding::ResourceDialect>
24310 fidl::encoding::Encode<AudioUncompressedFormat, D> for &AudioUncompressedFormat
24311 {
24312 #[inline]
24313 unsafe fn encode(
24314 self,
24315 encoder: &mut fidl::encoding::Encoder<'_, D>,
24316 offset: usize,
24317 _depth: fidl::encoding::Depth,
24318 ) -> fidl::Result<()> {
24319 encoder.debug_check_bounds::<AudioUncompressedFormat>(offset);
24320 encoder.write_num::<u64>(self.ordinal(), offset);
24321 match self {
24322 AudioUncompressedFormat::Pcm(ref val) => {
24323 fidl::encoding::encode_in_envelope::<PcmFormat, D>(
24324 <PcmFormat as fidl::encoding::ValueTypeMarker>::borrow(val),
24325 encoder,
24326 offset + 8,
24327 _depth,
24328 )
24329 }
24330 }
24331 }
24332 }
24333
24334 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
24335 for AudioUncompressedFormat
24336 {
24337 #[inline(always)]
24338 fn new_empty() -> Self {
24339 Self::Pcm(fidl::new_empty!(PcmFormat, D))
24340 }
24341
24342 #[inline]
24343 unsafe fn decode(
24344 &mut self,
24345 decoder: &mut fidl::encoding::Decoder<'_, D>,
24346 offset: usize,
24347 mut depth: fidl::encoding::Depth,
24348 ) -> fidl::Result<()> {
24349 decoder.debug_check_bounds::<Self>(offset);
24350 #[allow(unused_variables)]
24351 let next_out_of_line = decoder.next_out_of_line();
24352 let handles_before = decoder.remaining_handles();
24353 let (ordinal, inlined, num_bytes, num_handles) =
24354 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
24355
24356 let member_inline_size = match ordinal {
24357 1 => <PcmFormat as fidl::encoding::TypeMarker>::inline_size(decoder.context),
24358 _ => return Err(fidl::Error::UnknownUnionTag),
24359 };
24360
24361 if inlined != (member_inline_size <= 4) {
24362 return Err(fidl::Error::InvalidInlineBitInEnvelope);
24363 }
24364 let _inner_offset;
24365 if inlined {
24366 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
24367 _inner_offset = offset + 8;
24368 } else {
24369 depth.increment()?;
24370 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
24371 }
24372 match ordinal {
24373 1 => {
24374 #[allow(irrefutable_let_patterns)]
24375 if let AudioUncompressedFormat::Pcm(_) = self {
24376 } else {
24378 *self = AudioUncompressedFormat::Pcm(fidl::new_empty!(PcmFormat, D));
24380 }
24381 #[allow(irrefutable_let_patterns)]
24382 if let AudioUncompressedFormat::Pcm(ref mut val) = self {
24383 fidl::decode!(PcmFormat, D, val, decoder, _inner_offset, depth)?;
24384 } else {
24385 unreachable!()
24386 }
24387 }
24388 ordinal => panic!("unexpected ordinal {:?}", ordinal),
24389 }
24390 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
24391 return Err(fidl::Error::InvalidNumBytesInEnvelope);
24392 }
24393 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
24394 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
24395 }
24396 Ok(())
24397 }
24398 }
24399
24400 impl fidl::encoding::ValueTypeMarker for CryptoFormat {
24401 type Borrowed<'a> = &'a Self;
24402 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
24403 value
24404 }
24405 }
24406
24407 unsafe impl fidl::encoding::TypeMarker for CryptoFormat {
24408 type Owned = Self;
24409
24410 #[inline(always)]
24411 fn inline_align(_context: fidl::encoding::Context) -> usize {
24412 8
24413 }
24414
24415 #[inline(always)]
24416 fn inline_size(_context: fidl::encoding::Context) -> usize {
24417 16
24418 }
24419 }
24420
24421 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<CryptoFormat, D>
24422 for &CryptoFormat
24423 {
24424 #[inline]
24425 unsafe fn encode(
24426 self,
24427 encoder: &mut fidl::encoding::Encoder<'_, D>,
24428 offset: usize,
24429 _depth: fidl::encoding::Depth,
24430 ) -> fidl::Result<()> {
24431 encoder.debug_check_bounds::<CryptoFormat>(offset);
24432 encoder.write_num::<u64>(self.ordinal(), offset);
24433 match self {
24434 CryptoFormat::Encrypted(ref val) => {
24435 fidl::encoding::encode_in_envelope::<EncryptedFormat, D>(
24436 <EncryptedFormat as fidl::encoding::ValueTypeMarker>::borrow(val),
24437 encoder,
24438 offset + 8,
24439 _depth,
24440 )
24441 }
24442 CryptoFormat::Decrypted(ref val) => {
24443 fidl::encoding::encode_in_envelope::<DecryptedFormat, D>(
24444 <DecryptedFormat as fidl::encoding::ValueTypeMarker>::borrow(val),
24445 encoder,
24446 offset + 8,
24447 _depth,
24448 )
24449 }
24450 CryptoFormat::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
24451 }
24452 }
24453 }
24454
24455 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CryptoFormat {
24456 #[inline(always)]
24457 fn new_empty() -> Self {
24458 Self::__SourceBreaking { unknown_ordinal: 0 }
24459 }
24460
24461 #[inline]
24462 unsafe fn decode(
24463 &mut self,
24464 decoder: &mut fidl::encoding::Decoder<'_, D>,
24465 offset: usize,
24466 mut depth: fidl::encoding::Depth,
24467 ) -> fidl::Result<()> {
24468 decoder.debug_check_bounds::<Self>(offset);
24469 #[allow(unused_variables)]
24470 let next_out_of_line = decoder.next_out_of_line();
24471 let handles_before = decoder.remaining_handles();
24472 let (ordinal, inlined, num_bytes, num_handles) =
24473 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
24474
24475 let member_inline_size = match ordinal {
24476 1 => <EncryptedFormat as fidl::encoding::TypeMarker>::inline_size(decoder.context),
24477 2 => <DecryptedFormat as fidl::encoding::TypeMarker>::inline_size(decoder.context),
24478 0 => return Err(fidl::Error::UnknownUnionTag),
24479 _ => num_bytes as usize,
24480 };
24481
24482 if inlined != (member_inline_size <= 4) {
24483 return Err(fidl::Error::InvalidInlineBitInEnvelope);
24484 }
24485 let _inner_offset;
24486 if inlined {
24487 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
24488 _inner_offset = offset + 8;
24489 } else {
24490 depth.increment()?;
24491 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
24492 }
24493 match ordinal {
24494 1 => {
24495 #[allow(irrefutable_let_patterns)]
24496 if let CryptoFormat::Encrypted(_) = self {
24497 } else {
24499 *self = CryptoFormat::Encrypted(fidl::new_empty!(EncryptedFormat, D));
24501 }
24502 #[allow(irrefutable_let_patterns)]
24503 if let CryptoFormat::Encrypted(ref mut val) = self {
24504 fidl::decode!(EncryptedFormat, D, val, decoder, _inner_offset, depth)?;
24505 } else {
24506 unreachable!()
24507 }
24508 }
24509 2 => {
24510 #[allow(irrefutable_let_patterns)]
24511 if let CryptoFormat::Decrypted(_) = self {
24512 } else {
24514 *self = CryptoFormat::Decrypted(fidl::new_empty!(DecryptedFormat, D));
24516 }
24517 #[allow(irrefutable_let_patterns)]
24518 if let CryptoFormat::Decrypted(ref mut val) = self {
24519 fidl::decode!(DecryptedFormat, D, val, decoder, _inner_offset, depth)?;
24520 } else {
24521 unreachable!()
24522 }
24523 }
24524 #[allow(deprecated)]
24525 ordinal => {
24526 for _ in 0..num_handles {
24527 decoder.drop_next_handle()?;
24528 }
24529 *self = CryptoFormat::__SourceBreaking { unknown_ordinal: ordinal };
24530 }
24531 }
24532 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
24533 return Err(fidl::Error::InvalidNumBytesInEnvelope);
24534 }
24535 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
24536 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
24537 }
24538 Ok(())
24539 }
24540 }
24541
24542 impl fidl::encoding::ValueTypeMarker for DomainFormat {
24543 type Borrowed<'a> = &'a Self;
24544 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
24545 value
24546 }
24547 }
24548
24549 unsafe impl fidl::encoding::TypeMarker for DomainFormat {
24550 type Owned = Self;
24551
24552 #[inline(always)]
24553 fn inline_align(_context: fidl::encoding::Context) -> usize {
24554 8
24555 }
24556
24557 #[inline(always)]
24558 fn inline_size(_context: fidl::encoding::Context) -> usize {
24559 16
24560 }
24561 }
24562
24563 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DomainFormat, D>
24564 for &DomainFormat
24565 {
24566 #[inline]
24567 unsafe fn encode(
24568 self,
24569 encoder: &mut fidl::encoding::Encoder<'_, D>,
24570 offset: usize,
24571 _depth: fidl::encoding::Depth,
24572 ) -> fidl::Result<()> {
24573 encoder.debug_check_bounds::<DomainFormat>(offset);
24574 encoder.write_num::<u64>(self.ordinal(), offset);
24575 match self {
24576 DomainFormat::Audio(ref val) => {
24577 fidl::encoding::encode_in_envelope::<AudioFormat, D>(
24578 <AudioFormat as fidl::encoding::ValueTypeMarker>::borrow(val),
24579 encoder,
24580 offset + 8,
24581 _depth,
24582 )
24583 }
24584 DomainFormat::Video(ref val) => {
24585 fidl::encoding::encode_in_envelope::<VideoFormat, D>(
24586 <VideoFormat as fidl::encoding::ValueTypeMarker>::borrow(val),
24587 encoder,
24588 offset + 8,
24589 _depth,
24590 )
24591 }
24592 DomainFormat::Crypto(ref val) => {
24593 fidl::encoding::encode_in_envelope::<CryptoFormat, D>(
24594 <CryptoFormat as fidl::encoding::ValueTypeMarker>::borrow(val),
24595 encoder,
24596 offset + 8,
24597 _depth,
24598 )
24599 }
24600 }
24601 }
24602 }
24603
24604 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DomainFormat {
24605 #[inline(always)]
24606 fn new_empty() -> Self {
24607 Self::Audio(fidl::new_empty!(AudioFormat, D))
24608 }
24609
24610 #[inline]
24611 unsafe fn decode(
24612 &mut self,
24613 decoder: &mut fidl::encoding::Decoder<'_, D>,
24614 offset: usize,
24615 mut depth: fidl::encoding::Depth,
24616 ) -> fidl::Result<()> {
24617 decoder.debug_check_bounds::<Self>(offset);
24618 #[allow(unused_variables)]
24619 let next_out_of_line = decoder.next_out_of_line();
24620 let handles_before = decoder.remaining_handles();
24621 let (ordinal, inlined, num_bytes, num_handles) =
24622 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
24623
24624 let member_inline_size = match ordinal {
24625 1 => <AudioFormat as fidl::encoding::TypeMarker>::inline_size(decoder.context),
24626 2 => <VideoFormat as fidl::encoding::TypeMarker>::inline_size(decoder.context),
24627 3 => <CryptoFormat as fidl::encoding::TypeMarker>::inline_size(decoder.context),
24628 _ => return Err(fidl::Error::UnknownUnionTag),
24629 };
24630
24631 if inlined != (member_inline_size <= 4) {
24632 return Err(fidl::Error::InvalidInlineBitInEnvelope);
24633 }
24634 let _inner_offset;
24635 if inlined {
24636 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
24637 _inner_offset = offset + 8;
24638 } else {
24639 depth.increment()?;
24640 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
24641 }
24642 match ordinal {
24643 1 => {
24644 #[allow(irrefutable_let_patterns)]
24645 if let DomainFormat::Audio(_) = self {
24646 } else {
24648 *self = DomainFormat::Audio(fidl::new_empty!(AudioFormat, D));
24650 }
24651 #[allow(irrefutable_let_patterns)]
24652 if let DomainFormat::Audio(ref mut val) = self {
24653 fidl::decode!(AudioFormat, D, val, decoder, _inner_offset, depth)?;
24654 } else {
24655 unreachable!()
24656 }
24657 }
24658 2 => {
24659 #[allow(irrefutable_let_patterns)]
24660 if let DomainFormat::Video(_) = self {
24661 } else {
24663 *self = DomainFormat::Video(fidl::new_empty!(VideoFormat, D));
24665 }
24666 #[allow(irrefutable_let_patterns)]
24667 if let DomainFormat::Video(ref mut val) = self {
24668 fidl::decode!(VideoFormat, D, val, decoder, _inner_offset, depth)?;
24669 } else {
24670 unreachable!()
24671 }
24672 }
24673 3 => {
24674 #[allow(irrefutable_let_patterns)]
24675 if let DomainFormat::Crypto(_) = self {
24676 } else {
24678 *self = DomainFormat::Crypto(fidl::new_empty!(CryptoFormat, D));
24680 }
24681 #[allow(irrefutable_let_patterns)]
24682 if let DomainFormat::Crypto(ref mut val) = self {
24683 fidl::decode!(CryptoFormat, D, val, decoder, _inner_offset, depth)?;
24684 } else {
24685 unreachable!()
24686 }
24687 }
24688 ordinal => panic!("unexpected ordinal {:?}", ordinal),
24689 }
24690 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
24691 return Err(fidl::Error::InvalidNumBytesInEnvelope);
24692 }
24693 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
24694 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
24695 }
24696 Ok(())
24697 }
24698 }
24699
24700 impl fidl::encoding::ValueTypeMarker for EncoderSettings {
24701 type Borrowed<'a> = &'a Self;
24702 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
24703 value
24704 }
24705 }
24706
24707 unsafe impl fidl::encoding::TypeMarker for EncoderSettings {
24708 type Owned = Self;
24709
24710 #[inline(always)]
24711 fn inline_align(_context: fidl::encoding::Context) -> usize {
24712 8
24713 }
24714
24715 #[inline(always)]
24716 fn inline_size(_context: fidl::encoding::Context) -> usize {
24717 16
24718 }
24719 }
24720
24721 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<EncoderSettings, D>
24722 for &EncoderSettings
24723 {
24724 #[inline]
24725 unsafe fn encode(
24726 self,
24727 encoder: &mut fidl::encoding::Encoder<'_, D>,
24728 offset: usize,
24729 _depth: fidl::encoding::Depth,
24730 ) -> fidl::Result<()> {
24731 encoder.debug_check_bounds::<EncoderSettings>(offset);
24732 encoder.write_num::<u64>(self.ordinal(), offset);
24733 match self {
24734 EncoderSettings::Sbc(ref val) => {
24735 fidl::encoding::encode_in_envelope::<SbcEncoderSettings, D>(
24736 <SbcEncoderSettings as fidl::encoding::ValueTypeMarker>::borrow(val),
24737 encoder,
24738 offset + 8,
24739 _depth,
24740 )
24741 }
24742 EncoderSettings::Aac(ref val) => {
24743 fidl::encoding::encode_in_envelope::<AacEncoderSettings, D>(
24744 <AacEncoderSettings as fidl::encoding::ValueTypeMarker>::borrow(val),
24745 encoder,
24746 offset + 8,
24747 _depth,
24748 )
24749 }
24750 EncoderSettings::H264(ref val) => {
24751 fidl::encoding::encode_in_envelope::<H264EncoderSettings, D>(
24752 <H264EncoderSettings as fidl::encoding::ValueTypeMarker>::borrow(val),
24753 encoder,
24754 offset + 8,
24755 _depth,
24756 )
24757 }
24758 EncoderSettings::Hevc(ref val) => {
24759 fidl::encoding::encode_in_envelope::<HevcEncoderSettings, D>(
24760 <HevcEncoderSettings as fidl::encoding::ValueTypeMarker>::borrow(val),
24761 encoder,
24762 offset + 8,
24763 _depth,
24764 )
24765 }
24766 EncoderSettings::Cvsd(ref val) => {
24767 fidl::encoding::encode_in_envelope::<CvsdEncoderSettings, D>(
24768 <CvsdEncoderSettings as fidl::encoding::ValueTypeMarker>::borrow(val),
24769 encoder,
24770 offset + 8,
24771 _depth,
24772 )
24773 }
24774 EncoderSettings::Lc3(ref val) => {
24775 fidl::encoding::encode_in_envelope::<Lc3EncoderSettings, D>(
24776 <Lc3EncoderSettings as fidl::encoding::ValueTypeMarker>::borrow(val),
24777 encoder,
24778 offset + 8,
24779 _depth,
24780 )
24781 }
24782 EncoderSettings::Msbc(ref val) => {
24783 fidl::encoding::encode_in_envelope::<MSbcEncoderSettings, D>(
24784 <MSbcEncoderSettings as fidl::encoding::ValueTypeMarker>::borrow(val),
24785 encoder,
24786 offset + 8,
24787 _depth,
24788 )
24789 }
24790 EncoderSettings::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
24791 }
24792 }
24793 }
24794
24795 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for EncoderSettings {
24796 #[inline(always)]
24797 fn new_empty() -> Self {
24798 Self::__SourceBreaking { unknown_ordinal: 0 }
24799 }
24800
24801 #[inline]
24802 unsafe fn decode(
24803 &mut self,
24804 decoder: &mut fidl::encoding::Decoder<'_, D>,
24805 offset: usize,
24806 mut depth: fidl::encoding::Depth,
24807 ) -> fidl::Result<()> {
24808 decoder.debug_check_bounds::<Self>(offset);
24809 #[allow(unused_variables)]
24810 let next_out_of_line = decoder.next_out_of_line();
24811 let handles_before = decoder.remaining_handles();
24812 let (ordinal, inlined, num_bytes, num_handles) =
24813 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
24814
24815 let member_inline_size = match ordinal {
24816 1 => {
24817 <SbcEncoderSettings as fidl::encoding::TypeMarker>::inline_size(decoder.context)
24818 }
24819 2 => {
24820 <AacEncoderSettings as fidl::encoding::TypeMarker>::inline_size(decoder.context)
24821 }
24822 3 => <H264EncoderSettings as fidl::encoding::TypeMarker>::inline_size(
24823 decoder.context,
24824 ),
24825 4 => <HevcEncoderSettings as fidl::encoding::TypeMarker>::inline_size(
24826 decoder.context,
24827 ),
24828 5 => <CvsdEncoderSettings as fidl::encoding::TypeMarker>::inline_size(
24829 decoder.context,
24830 ),
24831 6 => {
24832 <Lc3EncoderSettings as fidl::encoding::TypeMarker>::inline_size(decoder.context)
24833 }
24834 7 => <MSbcEncoderSettings as fidl::encoding::TypeMarker>::inline_size(
24835 decoder.context,
24836 ),
24837 0 => return Err(fidl::Error::UnknownUnionTag),
24838 _ => num_bytes as usize,
24839 };
24840
24841 if inlined != (member_inline_size <= 4) {
24842 return Err(fidl::Error::InvalidInlineBitInEnvelope);
24843 }
24844 let _inner_offset;
24845 if inlined {
24846 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
24847 _inner_offset = offset + 8;
24848 } else {
24849 depth.increment()?;
24850 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
24851 }
24852 match ordinal {
24853 1 => {
24854 #[allow(irrefutable_let_patterns)]
24855 if let EncoderSettings::Sbc(_) = self {
24856 } else {
24858 *self = EncoderSettings::Sbc(fidl::new_empty!(SbcEncoderSettings, D));
24860 }
24861 #[allow(irrefutable_let_patterns)]
24862 if let EncoderSettings::Sbc(ref mut val) = self {
24863 fidl::decode!(SbcEncoderSettings, D, val, decoder, _inner_offset, depth)?;
24864 } else {
24865 unreachable!()
24866 }
24867 }
24868 2 => {
24869 #[allow(irrefutable_let_patterns)]
24870 if let EncoderSettings::Aac(_) = self {
24871 } else {
24873 *self = EncoderSettings::Aac(fidl::new_empty!(AacEncoderSettings, D));
24875 }
24876 #[allow(irrefutable_let_patterns)]
24877 if let EncoderSettings::Aac(ref mut val) = self {
24878 fidl::decode!(AacEncoderSettings, D, val, decoder, _inner_offset, depth)?;
24879 } else {
24880 unreachable!()
24881 }
24882 }
24883 3 => {
24884 #[allow(irrefutable_let_patterns)]
24885 if let EncoderSettings::H264(_) = self {
24886 } else {
24888 *self = EncoderSettings::H264(fidl::new_empty!(H264EncoderSettings, D));
24890 }
24891 #[allow(irrefutable_let_patterns)]
24892 if let EncoderSettings::H264(ref mut val) = self {
24893 fidl::decode!(H264EncoderSettings, D, val, decoder, _inner_offset, depth)?;
24894 } else {
24895 unreachable!()
24896 }
24897 }
24898 4 => {
24899 #[allow(irrefutable_let_patterns)]
24900 if let EncoderSettings::Hevc(_) = self {
24901 } else {
24903 *self = EncoderSettings::Hevc(fidl::new_empty!(HevcEncoderSettings, D));
24905 }
24906 #[allow(irrefutable_let_patterns)]
24907 if let EncoderSettings::Hevc(ref mut val) = self {
24908 fidl::decode!(HevcEncoderSettings, D, val, decoder, _inner_offset, depth)?;
24909 } else {
24910 unreachable!()
24911 }
24912 }
24913 5 => {
24914 #[allow(irrefutable_let_patterns)]
24915 if let EncoderSettings::Cvsd(_) = self {
24916 } else {
24918 *self = EncoderSettings::Cvsd(fidl::new_empty!(CvsdEncoderSettings, D));
24920 }
24921 #[allow(irrefutable_let_patterns)]
24922 if let EncoderSettings::Cvsd(ref mut val) = self {
24923 fidl::decode!(CvsdEncoderSettings, D, val, decoder, _inner_offset, depth)?;
24924 } else {
24925 unreachable!()
24926 }
24927 }
24928 6 => {
24929 #[allow(irrefutable_let_patterns)]
24930 if let EncoderSettings::Lc3(_) = self {
24931 } else {
24933 *self = EncoderSettings::Lc3(fidl::new_empty!(Lc3EncoderSettings, D));
24935 }
24936 #[allow(irrefutable_let_patterns)]
24937 if let EncoderSettings::Lc3(ref mut val) = self {
24938 fidl::decode!(Lc3EncoderSettings, D, val, decoder, _inner_offset, depth)?;
24939 } else {
24940 unreachable!()
24941 }
24942 }
24943 7 => {
24944 #[allow(irrefutable_let_patterns)]
24945 if let EncoderSettings::Msbc(_) = self {
24946 } else {
24948 *self = EncoderSettings::Msbc(fidl::new_empty!(MSbcEncoderSettings, D));
24950 }
24951 #[allow(irrefutable_let_patterns)]
24952 if let EncoderSettings::Msbc(ref mut val) = self {
24953 fidl::decode!(MSbcEncoderSettings, D, val, decoder, _inner_offset, depth)?;
24954 } else {
24955 unreachable!()
24956 }
24957 }
24958 #[allow(deprecated)]
24959 ordinal => {
24960 for _ in 0..num_handles {
24961 decoder.drop_next_handle()?;
24962 }
24963 *self = EncoderSettings::__SourceBreaking { unknown_ordinal: ordinal };
24964 }
24965 }
24966 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
24967 return Err(fidl::Error::InvalidNumBytesInEnvelope);
24968 }
24969 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
24970 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
24971 }
24972 Ok(())
24973 }
24974 }
24975
24976 impl fidl::encoding::ValueTypeMarker for MediumSpecificStreamType {
24977 type Borrowed<'a> = &'a Self;
24978 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
24979 value
24980 }
24981 }
24982
24983 unsafe impl fidl::encoding::TypeMarker for MediumSpecificStreamType {
24984 type Owned = Self;
24985
24986 #[inline(always)]
24987 fn inline_align(_context: fidl::encoding::Context) -> usize {
24988 8
24989 }
24990
24991 #[inline(always)]
24992 fn inline_size(_context: fidl::encoding::Context) -> usize {
24993 16
24994 }
24995 }
24996
24997 unsafe impl<D: fidl::encoding::ResourceDialect>
24998 fidl::encoding::Encode<MediumSpecificStreamType, D> for &MediumSpecificStreamType
24999 {
25000 #[inline]
25001 unsafe fn encode(
25002 self,
25003 encoder: &mut fidl::encoding::Encoder<'_, D>,
25004 offset: usize,
25005 _depth: fidl::encoding::Depth,
25006 ) -> fidl::Result<()> {
25007 encoder.debug_check_bounds::<MediumSpecificStreamType>(offset);
25008 encoder.write_num::<u64>(self.ordinal(), offset);
25009 match self {
25010 MediumSpecificStreamType::Audio(ref val) => {
25011 fidl::encoding::encode_in_envelope::<AudioStreamType, D>(
25012 <AudioStreamType as fidl::encoding::ValueTypeMarker>::borrow(val),
25013 encoder,
25014 offset + 8,
25015 _depth,
25016 )
25017 }
25018 MediumSpecificStreamType::Video(ref val) => {
25019 fidl::encoding::encode_in_envelope::<VideoStreamType, D>(
25020 <VideoStreamType as fidl::encoding::ValueTypeMarker>::borrow(val),
25021 encoder,
25022 offset + 8,
25023 _depth,
25024 )
25025 }
25026 MediumSpecificStreamType::Text(ref val) => {
25027 fidl::encoding::encode_in_envelope::<TextStreamType, D>(
25028 <TextStreamType as fidl::encoding::ValueTypeMarker>::borrow(val),
25029 encoder,
25030 offset + 8,
25031 _depth,
25032 )
25033 }
25034 MediumSpecificStreamType::Subpicture(ref val) => {
25035 fidl::encoding::encode_in_envelope::<SubpictureStreamType, D>(
25036 <SubpictureStreamType as fidl::encoding::ValueTypeMarker>::borrow(val),
25037 encoder,
25038 offset + 8,
25039 _depth,
25040 )
25041 }
25042 }
25043 }
25044 }
25045
25046 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
25047 for MediumSpecificStreamType
25048 {
25049 #[inline(always)]
25050 fn new_empty() -> Self {
25051 Self::Audio(fidl::new_empty!(AudioStreamType, D))
25052 }
25053
25054 #[inline]
25055 unsafe fn decode(
25056 &mut self,
25057 decoder: &mut fidl::encoding::Decoder<'_, D>,
25058 offset: usize,
25059 mut depth: fidl::encoding::Depth,
25060 ) -> fidl::Result<()> {
25061 decoder.debug_check_bounds::<Self>(offset);
25062 #[allow(unused_variables)]
25063 let next_out_of_line = decoder.next_out_of_line();
25064 let handles_before = decoder.remaining_handles();
25065 let (ordinal, inlined, num_bytes, num_handles) =
25066 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
25067
25068 let member_inline_size = match ordinal {
25069 1 => <AudioStreamType as fidl::encoding::TypeMarker>::inline_size(decoder.context),
25070 2 => <VideoStreamType as fidl::encoding::TypeMarker>::inline_size(decoder.context),
25071 3 => <TextStreamType as fidl::encoding::TypeMarker>::inline_size(decoder.context),
25072 4 => <SubpictureStreamType as fidl::encoding::TypeMarker>::inline_size(
25073 decoder.context,
25074 ),
25075 _ => return Err(fidl::Error::UnknownUnionTag),
25076 };
25077
25078 if inlined != (member_inline_size <= 4) {
25079 return Err(fidl::Error::InvalidInlineBitInEnvelope);
25080 }
25081 let _inner_offset;
25082 if inlined {
25083 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
25084 _inner_offset = offset + 8;
25085 } else {
25086 depth.increment()?;
25087 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
25088 }
25089 match ordinal {
25090 1 => {
25091 #[allow(irrefutable_let_patterns)]
25092 if let MediumSpecificStreamType::Audio(_) = self {
25093 } else {
25095 *self =
25097 MediumSpecificStreamType::Audio(fidl::new_empty!(AudioStreamType, D));
25098 }
25099 #[allow(irrefutable_let_patterns)]
25100 if let MediumSpecificStreamType::Audio(ref mut val) = self {
25101 fidl::decode!(AudioStreamType, D, val, decoder, _inner_offset, depth)?;
25102 } else {
25103 unreachable!()
25104 }
25105 }
25106 2 => {
25107 #[allow(irrefutable_let_patterns)]
25108 if let MediumSpecificStreamType::Video(_) = self {
25109 } else {
25111 *self =
25113 MediumSpecificStreamType::Video(fidl::new_empty!(VideoStreamType, D));
25114 }
25115 #[allow(irrefutable_let_patterns)]
25116 if let MediumSpecificStreamType::Video(ref mut val) = self {
25117 fidl::decode!(VideoStreamType, D, val, decoder, _inner_offset, depth)?;
25118 } else {
25119 unreachable!()
25120 }
25121 }
25122 3 => {
25123 #[allow(irrefutable_let_patterns)]
25124 if let MediumSpecificStreamType::Text(_) = self {
25125 } else {
25127 *self = MediumSpecificStreamType::Text(fidl::new_empty!(TextStreamType, D));
25129 }
25130 #[allow(irrefutable_let_patterns)]
25131 if let MediumSpecificStreamType::Text(ref mut val) = self {
25132 fidl::decode!(TextStreamType, D, val, decoder, _inner_offset, depth)?;
25133 } else {
25134 unreachable!()
25135 }
25136 }
25137 4 => {
25138 #[allow(irrefutable_let_patterns)]
25139 if let MediumSpecificStreamType::Subpicture(_) = self {
25140 } else {
25142 *self = MediumSpecificStreamType::Subpicture(fidl::new_empty!(
25144 SubpictureStreamType,
25145 D
25146 ));
25147 }
25148 #[allow(irrefutable_let_patterns)]
25149 if let MediumSpecificStreamType::Subpicture(ref mut val) = self {
25150 fidl::decode!(SubpictureStreamType, D, val, decoder, _inner_offset, depth)?;
25151 } else {
25152 unreachable!()
25153 }
25154 }
25155 ordinal => panic!("unexpected ordinal {:?}", ordinal),
25156 }
25157 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
25158 return Err(fidl::Error::InvalidNumBytesInEnvelope);
25159 }
25160 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
25161 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
25162 }
25163 Ok(())
25164 }
25165 }
25166
25167 impl fidl::encoding::ValueTypeMarker for Usage {
25168 type Borrowed<'a> = &'a Self;
25169 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
25170 value
25171 }
25172 }
25173
25174 unsafe impl fidl::encoding::TypeMarker for Usage {
25175 type Owned = Self;
25176
25177 #[inline(always)]
25178 fn inline_align(_context: fidl::encoding::Context) -> usize {
25179 8
25180 }
25181
25182 #[inline(always)]
25183 fn inline_size(_context: fidl::encoding::Context) -> usize {
25184 16
25185 }
25186 }
25187
25188 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Usage, D> for &Usage {
25189 #[inline]
25190 unsafe fn encode(
25191 self,
25192 encoder: &mut fidl::encoding::Encoder<'_, D>,
25193 offset: usize,
25194 _depth: fidl::encoding::Depth,
25195 ) -> fidl::Result<()> {
25196 encoder.debug_check_bounds::<Usage>(offset);
25197 encoder.write_num::<u64>(self.ordinal(), offset);
25198 match self {
25199 Usage::RenderUsage(ref val) => {
25200 fidl::encoding::encode_in_envelope::<AudioRenderUsage, D>(
25201 <AudioRenderUsage as fidl::encoding::ValueTypeMarker>::borrow(val),
25202 encoder,
25203 offset + 8,
25204 _depth,
25205 )
25206 }
25207 Usage::CaptureUsage(ref val) => {
25208 fidl::encoding::encode_in_envelope::<AudioCaptureUsage, D>(
25209 <AudioCaptureUsage as fidl::encoding::ValueTypeMarker>::borrow(val),
25210 encoder,
25211 offset + 8,
25212 _depth,
25213 )
25214 }
25215 }
25216 }
25217 }
25218
25219 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Usage {
25220 #[inline(always)]
25221 fn new_empty() -> Self {
25222 Self::RenderUsage(fidl::new_empty!(AudioRenderUsage, D))
25223 }
25224
25225 #[inline]
25226 unsafe fn decode(
25227 &mut self,
25228 decoder: &mut fidl::encoding::Decoder<'_, D>,
25229 offset: usize,
25230 mut depth: fidl::encoding::Depth,
25231 ) -> fidl::Result<()> {
25232 decoder.debug_check_bounds::<Self>(offset);
25233 #[allow(unused_variables)]
25234 let next_out_of_line = decoder.next_out_of_line();
25235 let handles_before = decoder.remaining_handles();
25236 let (ordinal, inlined, num_bytes, num_handles) =
25237 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
25238
25239 let member_inline_size = match ordinal {
25240 1 => <AudioRenderUsage as fidl::encoding::TypeMarker>::inline_size(decoder.context),
25241 2 => {
25242 <AudioCaptureUsage as fidl::encoding::TypeMarker>::inline_size(decoder.context)
25243 }
25244 _ => return Err(fidl::Error::UnknownUnionTag),
25245 };
25246
25247 if inlined != (member_inline_size <= 4) {
25248 return Err(fidl::Error::InvalidInlineBitInEnvelope);
25249 }
25250 let _inner_offset;
25251 if inlined {
25252 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
25253 _inner_offset = offset + 8;
25254 } else {
25255 depth.increment()?;
25256 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
25257 }
25258 match ordinal {
25259 1 => {
25260 #[allow(irrefutable_let_patterns)]
25261 if let Usage::RenderUsage(_) = self {
25262 } else {
25264 *self = Usage::RenderUsage(fidl::new_empty!(AudioRenderUsage, D));
25266 }
25267 #[allow(irrefutable_let_patterns)]
25268 if let Usage::RenderUsage(ref mut val) = self {
25269 fidl::decode!(AudioRenderUsage, D, val, decoder, _inner_offset, depth)?;
25270 } else {
25271 unreachable!()
25272 }
25273 }
25274 2 => {
25275 #[allow(irrefutable_let_patterns)]
25276 if let Usage::CaptureUsage(_) = self {
25277 } else {
25279 *self = Usage::CaptureUsage(fidl::new_empty!(AudioCaptureUsage, D));
25281 }
25282 #[allow(irrefutable_let_patterns)]
25283 if let Usage::CaptureUsage(ref mut val) = self {
25284 fidl::decode!(AudioCaptureUsage, D, val, decoder, _inner_offset, depth)?;
25285 } else {
25286 unreachable!()
25287 }
25288 }
25289 ordinal => panic!("unexpected ordinal {:?}", ordinal),
25290 }
25291 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
25292 return Err(fidl::Error::InvalidNumBytesInEnvelope);
25293 }
25294 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
25295 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
25296 }
25297 Ok(())
25298 }
25299 }
25300
25301 impl fidl::encoding::ValueTypeMarker for Usage2 {
25302 type Borrowed<'a> = &'a Self;
25303 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
25304 value
25305 }
25306 }
25307
25308 unsafe impl fidl::encoding::TypeMarker for Usage2 {
25309 type Owned = Self;
25310
25311 #[inline(always)]
25312 fn inline_align(_context: fidl::encoding::Context) -> usize {
25313 8
25314 }
25315
25316 #[inline(always)]
25317 fn inline_size(_context: fidl::encoding::Context) -> usize {
25318 16
25319 }
25320 }
25321
25322 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Usage2, D> for &Usage2 {
25323 #[inline]
25324 unsafe fn encode(
25325 self,
25326 encoder: &mut fidl::encoding::Encoder<'_, D>,
25327 offset: usize,
25328 _depth: fidl::encoding::Depth,
25329 ) -> fidl::Result<()> {
25330 encoder.debug_check_bounds::<Usage2>(offset);
25331 encoder.write_num::<u64>(self.ordinal(), offset);
25332 match self {
25333 Usage2::RenderUsage(ref val) => {
25334 fidl::encoding::encode_in_envelope::<AudioRenderUsage2, D>(
25335 <AudioRenderUsage2 as fidl::encoding::ValueTypeMarker>::borrow(val),
25336 encoder,
25337 offset + 8,
25338 _depth,
25339 )
25340 }
25341 Usage2::CaptureUsage(ref val) => {
25342 fidl::encoding::encode_in_envelope::<AudioCaptureUsage2, D>(
25343 <AudioCaptureUsage2 as fidl::encoding::ValueTypeMarker>::borrow(val),
25344 encoder,
25345 offset + 8,
25346 _depth,
25347 )
25348 }
25349 Usage2::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
25350 }
25351 }
25352 }
25353
25354 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Usage2 {
25355 #[inline(always)]
25356 fn new_empty() -> Self {
25357 Self::__SourceBreaking { unknown_ordinal: 0 }
25358 }
25359
25360 #[inline]
25361 unsafe fn decode(
25362 &mut self,
25363 decoder: &mut fidl::encoding::Decoder<'_, D>,
25364 offset: usize,
25365 mut depth: fidl::encoding::Depth,
25366 ) -> fidl::Result<()> {
25367 decoder.debug_check_bounds::<Self>(offset);
25368 #[allow(unused_variables)]
25369 let next_out_of_line = decoder.next_out_of_line();
25370 let handles_before = decoder.remaining_handles();
25371 let (ordinal, inlined, num_bytes, num_handles) =
25372 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
25373
25374 let member_inline_size = match ordinal {
25375 1 => {
25376 <AudioRenderUsage2 as fidl::encoding::TypeMarker>::inline_size(decoder.context)
25377 }
25378 2 => {
25379 <AudioCaptureUsage2 as fidl::encoding::TypeMarker>::inline_size(decoder.context)
25380 }
25381 0 => return Err(fidl::Error::UnknownUnionTag),
25382 _ => num_bytes as usize,
25383 };
25384
25385 if inlined != (member_inline_size <= 4) {
25386 return Err(fidl::Error::InvalidInlineBitInEnvelope);
25387 }
25388 let _inner_offset;
25389 if inlined {
25390 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
25391 _inner_offset = offset + 8;
25392 } else {
25393 depth.increment()?;
25394 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
25395 }
25396 match ordinal {
25397 1 => {
25398 #[allow(irrefutable_let_patterns)]
25399 if let Usage2::RenderUsage(_) = self {
25400 } else {
25402 *self = Usage2::RenderUsage(fidl::new_empty!(AudioRenderUsage2, D));
25404 }
25405 #[allow(irrefutable_let_patterns)]
25406 if let Usage2::RenderUsage(ref mut val) = self {
25407 fidl::decode!(AudioRenderUsage2, D, val, decoder, _inner_offset, depth)?;
25408 } else {
25409 unreachable!()
25410 }
25411 }
25412 2 => {
25413 #[allow(irrefutable_let_patterns)]
25414 if let Usage2::CaptureUsage(_) = self {
25415 } else {
25417 *self = Usage2::CaptureUsage(fidl::new_empty!(AudioCaptureUsage2, D));
25419 }
25420 #[allow(irrefutable_let_patterns)]
25421 if let Usage2::CaptureUsage(ref mut val) = self {
25422 fidl::decode!(AudioCaptureUsage2, D, val, decoder, _inner_offset, depth)?;
25423 } else {
25424 unreachable!()
25425 }
25426 }
25427 #[allow(deprecated)]
25428 ordinal => {
25429 for _ in 0..num_handles {
25430 decoder.drop_next_handle()?;
25431 }
25432 *self = Usage2::__SourceBreaking { unknown_ordinal: ordinal };
25433 }
25434 }
25435 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
25436 return Err(fidl::Error::InvalidNumBytesInEnvelope);
25437 }
25438 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
25439 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
25440 }
25441 Ok(())
25442 }
25443 }
25444
25445 impl fidl::encoding::ValueTypeMarker for UsageState {
25446 type Borrowed<'a> = &'a Self;
25447 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
25448 value
25449 }
25450 }
25451
25452 unsafe impl fidl::encoding::TypeMarker for UsageState {
25453 type Owned = Self;
25454
25455 #[inline(always)]
25456 fn inline_align(_context: fidl::encoding::Context) -> usize {
25457 8
25458 }
25459
25460 #[inline(always)]
25461 fn inline_size(_context: fidl::encoding::Context) -> usize {
25462 16
25463 }
25464 }
25465
25466 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<UsageState, D>
25467 for &UsageState
25468 {
25469 #[inline]
25470 unsafe fn encode(
25471 self,
25472 encoder: &mut fidl::encoding::Encoder<'_, D>,
25473 offset: usize,
25474 _depth: fidl::encoding::Depth,
25475 ) -> fidl::Result<()> {
25476 encoder.debug_check_bounds::<UsageState>(offset);
25477 encoder.write_num::<u64>(self.ordinal(), offset);
25478 match self {
25479 UsageState::Unadjusted(ref val) => {
25480 fidl::encoding::encode_in_envelope::<UsageStateUnadjusted, D>(
25481 <UsageStateUnadjusted as fidl::encoding::ValueTypeMarker>::borrow(val),
25482 encoder,
25483 offset + 8,
25484 _depth,
25485 )
25486 }
25487 UsageState::Ducked(ref val) => {
25488 fidl::encoding::encode_in_envelope::<UsageStateDucked, D>(
25489 <UsageStateDucked as fidl::encoding::ValueTypeMarker>::borrow(val),
25490 encoder,
25491 offset + 8,
25492 _depth,
25493 )
25494 }
25495 UsageState::Muted(ref val) => {
25496 fidl::encoding::encode_in_envelope::<UsageStateMuted, D>(
25497 <UsageStateMuted as fidl::encoding::ValueTypeMarker>::borrow(val),
25498 encoder,
25499 offset + 8,
25500 _depth,
25501 )
25502 }
25503 UsageState::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
25504 }
25505 }
25506 }
25507
25508 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for UsageState {
25509 #[inline(always)]
25510 fn new_empty() -> Self {
25511 Self::__SourceBreaking { unknown_ordinal: 0 }
25512 }
25513
25514 #[inline]
25515 unsafe fn decode(
25516 &mut self,
25517 decoder: &mut fidl::encoding::Decoder<'_, D>,
25518 offset: usize,
25519 mut depth: fidl::encoding::Depth,
25520 ) -> fidl::Result<()> {
25521 decoder.debug_check_bounds::<Self>(offset);
25522 #[allow(unused_variables)]
25523 let next_out_of_line = decoder.next_out_of_line();
25524 let handles_before = decoder.remaining_handles();
25525 let (ordinal, inlined, num_bytes, num_handles) =
25526 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
25527
25528 let member_inline_size = match ordinal {
25529 1 => <UsageStateUnadjusted as fidl::encoding::TypeMarker>::inline_size(
25530 decoder.context,
25531 ),
25532 2 => <UsageStateDucked as fidl::encoding::TypeMarker>::inline_size(decoder.context),
25533 3 => <UsageStateMuted as fidl::encoding::TypeMarker>::inline_size(decoder.context),
25534 0 => return Err(fidl::Error::UnknownUnionTag),
25535 _ => num_bytes as usize,
25536 };
25537
25538 if inlined != (member_inline_size <= 4) {
25539 return Err(fidl::Error::InvalidInlineBitInEnvelope);
25540 }
25541 let _inner_offset;
25542 if inlined {
25543 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
25544 _inner_offset = offset + 8;
25545 } else {
25546 depth.increment()?;
25547 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
25548 }
25549 match ordinal {
25550 1 => {
25551 #[allow(irrefutable_let_patterns)]
25552 if let UsageState::Unadjusted(_) = self {
25553 } else {
25555 *self = UsageState::Unadjusted(fidl::new_empty!(UsageStateUnadjusted, D));
25557 }
25558 #[allow(irrefutable_let_patterns)]
25559 if let UsageState::Unadjusted(ref mut val) = self {
25560 fidl::decode!(UsageStateUnadjusted, D, val, decoder, _inner_offset, depth)?;
25561 } else {
25562 unreachable!()
25563 }
25564 }
25565 2 => {
25566 #[allow(irrefutable_let_patterns)]
25567 if let UsageState::Ducked(_) = self {
25568 } else {
25570 *self = UsageState::Ducked(fidl::new_empty!(UsageStateDucked, D));
25572 }
25573 #[allow(irrefutable_let_patterns)]
25574 if let UsageState::Ducked(ref mut val) = self {
25575 fidl::decode!(UsageStateDucked, D, val, decoder, _inner_offset, depth)?;
25576 } else {
25577 unreachable!()
25578 }
25579 }
25580 3 => {
25581 #[allow(irrefutable_let_patterns)]
25582 if let UsageState::Muted(_) = self {
25583 } else {
25585 *self = UsageState::Muted(fidl::new_empty!(UsageStateMuted, D));
25587 }
25588 #[allow(irrefutable_let_patterns)]
25589 if let UsageState::Muted(ref mut val) = self {
25590 fidl::decode!(UsageStateMuted, D, val, decoder, _inner_offset, depth)?;
25591 } else {
25592 unreachable!()
25593 }
25594 }
25595 #[allow(deprecated)]
25596 ordinal => {
25597 for _ in 0..num_handles {
25598 decoder.drop_next_handle()?;
25599 }
25600 *self = UsageState::__SourceBreaking { unknown_ordinal: ordinal };
25601 }
25602 }
25603 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
25604 return Err(fidl::Error::InvalidNumBytesInEnvelope);
25605 }
25606 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
25607 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
25608 }
25609 Ok(())
25610 }
25611 }
25612
25613 impl fidl::encoding::ValueTypeMarker for Value {
25614 type Borrowed<'a> = &'a Self;
25615 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
25616 value
25617 }
25618 }
25619
25620 unsafe impl fidl::encoding::TypeMarker for Value {
25621 type Owned = Self;
25622
25623 #[inline(always)]
25624 fn inline_align(_context: fidl::encoding::Context) -> usize {
25625 8
25626 }
25627
25628 #[inline(always)]
25629 fn inline_size(_context: fidl::encoding::Context) -> usize {
25630 16
25631 }
25632 }
25633
25634 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Value, D> for &Value {
25635 #[inline]
25636 unsafe fn encode(
25637 self,
25638 encoder: &mut fidl::encoding::Encoder<'_, D>,
25639 offset: usize,
25640 _depth: fidl::encoding::Depth,
25641 ) -> fidl::Result<()> {
25642 encoder.debug_check_bounds::<Value>(offset);
25643 encoder.write_num::<u64>(self.ordinal(), offset);
25644 match self {
25645 Value::BoolValue(ref val) => {
25646 fidl::encoding::encode_in_envelope::<bool, D>(
25647 <bool as fidl::encoding::ValueTypeMarker>::borrow(val),
25648 encoder, offset + 8, _depth
25649 )
25650 }
25651 Value::Uint64Value(ref val) => {
25652 fidl::encoding::encode_in_envelope::<u64, D>(
25653 <u64 as fidl::encoding::ValueTypeMarker>::borrow(val),
25654 encoder, offset + 8, _depth
25655 )
25656 }
25657 Value::Int64Value(ref val) => {
25658 fidl::encoding::encode_in_envelope::<i64, D>(
25659 <i64 as fidl::encoding::ValueTypeMarker>::borrow(val),
25660 encoder, offset + 8, _depth
25661 )
25662 }
25663 Value::StringValue(ref val) => {
25664 fidl::encoding::encode_in_envelope::<fidl::encoding::UnboundedString, D>(
25665 <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(val),
25666 encoder, offset + 8, _depth
25667 )
25668 }
25669 Value::BytesValue(ref val) => {
25670 fidl::encoding::encode_in_envelope::<fidl::encoding::UnboundedVector<u8>, D>(
25671 <fidl::encoding::UnboundedVector<u8> as fidl::encoding::ValueTypeMarker>::borrow(val),
25672 encoder, offset + 8, _depth
25673 )
25674 }
25675 }
25676 }
25677 }
25678
25679 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Value {
25680 #[inline(always)]
25681 fn new_empty() -> Self {
25682 Self::BoolValue(fidl::new_empty!(bool, D))
25683 }
25684
25685 #[inline]
25686 unsafe fn decode(
25687 &mut self,
25688 decoder: &mut fidl::encoding::Decoder<'_, D>,
25689 offset: usize,
25690 mut depth: fidl::encoding::Depth,
25691 ) -> fidl::Result<()> {
25692 decoder.debug_check_bounds::<Self>(offset);
25693 #[allow(unused_variables)]
25694 let next_out_of_line = decoder.next_out_of_line();
25695 let handles_before = decoder.remaining_handles();
25696 let (ordinal, inlined, num_bytes, num_handles) =
25697 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
25698
25699 let member_inline_size = match ordinal {
25700 1 => <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context),
25701 2 => <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
25702 3 => <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
25703 4 => <fidl::encoding::UnboundedString as fidl::encoding::TypeMarker>::inline_size(
25704 decoder.context,
25705 ),
25706 5 => {
25707 <fidl::encoding::UnboundedVector<u8> as fidl::encoding::TypeMarker>::inline_size(
25708 decoder.context,
25709 )
25710 }
25711 _ => return Err(fidl::Error::UnknownUnionTag),
25712 };
25713
25714 if inlined != (member_inline_size <= 4) {
25715 return Err(fidl::Error::InvalidInlineBitInEnvelope);
25716 }
25717 let _inner_offset;
25718 if inlined {
25719 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
25720 _inner_offset = offset + 8;
25721 } else {
25722 depth.increment()?;
25723 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
25724 }
25725 match ordinal {
25726 1 => {
25727 #[allow(irrefutable_let_patterns)]
25728 if let Value::BoolValue(_) = self {
25729 } else {
25731 *self = Value::BoolValue(fidl::new_empty!(bool, D));
25733 }
25734 #[allow(irrefutable_let_patterns)]
25735 if let Value::BoolValue(ref mut val) = self {
25736 fidl::decode!(bool, D, val, decoder, _inner_offset, depth)?;
25737 } else {
25738 unreachable!()
25739 }
25740 }
25741 2 => {
25742 #[allow(irrefutable_let_patterns)]
25743 if let Value::Uint64Value(_) = self {
25744 } else {
25746 *self = Value::Uint64Value(fidl::new_empty!(u64, D));
25748 }
25749 #[allow(irrefutable_let_patterns)]
25750 if let Value::Uint64Value(ref mut val) = self {
25751 fidl::decode!(u64, D, val, decoder, _inner_offset, depth)?;
25752 } else {
25753 unreachable!()
25754 }
25755 }
25756 3 => {
25757 #[allow(irrefutable_let_patterns)]
25758 if let Value::Int64Value(_) = self {
25759 } else {
25761 *self = Value::Int64Value(fidl::new_empty!(i64, D));
25763 }
25764 #[allow(irrefutable_let_patterns)]
25765 if let Value::Int64Value(ref mut val) = self {
25766 fidl::decode!(i64, D, val, decoder, _inner_offset, depth)?;
25767 } else {
25768 unreachable!()
25769 }
25770 }
25771 4 => {
25772 #[allow(irrefutable_let_patterns)]
25773 if let Value::StringValue(_) = self {
25774 } else {
25776 *self = Value::StringValue(fidl::new_empty!(
25778 fidl::encoding::UnboundedString,
25779 D
25780 ));
25781 }
25782 #[allow(irrefutable_let_patterns)]
25783 if let Value::StringValue(ref mut val) = self {
25784 fidl::decode!(
25785 fidl::encoding::UnboundedString,
25786 D,
25787 val,
25788 decoder,
25789 _inner_offset,
25790 depth
25791 )?;
25792 } else {
25793 unreachable!()
25794 }
25795 }
25796 5 => {
25797 #[allow(irrefutable_let_patterns)]
25798 if let Value::BytesValue(_) = self {
25799 } else {
25801 *self = Value::BytesValue(fidl::new_empty!(
25803 fidl::encoding::UnboundedVector<u8>,
25804 D
25805 ));
25806 }
25807 #[allow(irrefutable_let_patterns)]
25808 if let Value::BytesValue(ref mut val) = self {
25809 fidl::decode!(
25810 fidl::encoding::UnboundedVector<u8>,
25811 D,
25812 val,
25813 decoder,
25814 _inner_offset,
25815 depth
25816 )?;
25817 } else {
25818 unreachable!()
25819 }
25820 }
25821 ordinal => panic!("unexpected ordinal {:?}", ordinal),
25822 }
25823 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
25824 return Err(fidl::Error::InvalidNumBytesInEnvelope);
25825 }
25826 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
25827 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
25828 }
25829 Ok(())
25830 }
25831 }
25832
25833 impl fidl::encoding::ValueTypeMarker for VideoCompressedFormat {
25834 type Borrowed<'a> = &'a Self;
25835 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
25836 value
25837 }
25838 }
25839
25840 unsafe impl fidl::encoding::TypeMarker for VideoCompressedFormat {
25841 type Owned = Self;
25842
25843 #[inline(always)]
25844 fn inline_align(_context: fidl::encoding::Context) -> usize {
25845 8
25846 }
25847
25848 #[inline(always)]
25849 fn inline_size(_context: fidl::encoding::Context) -> usize {
25850 16
25851 }
25852 }
25853
25854 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<VideoCompressedFormat, D>
25855 for &VideoCompressedFormat
25856 {
25857 #[inline]
25858 unsafe fn encode(
25859 self,
25860 encoder: &mut fidl::encoding::Encoder<'_, D>,
25861 offset: usize,
25862 _depth: fidl::encoding::Depth,
25863 ) -> fidl::Result<()> {
25864 encoder.debug_check_bounds::<VideoCompressedFormat>(offset);
25865 encoder.write_num::<u64>(self.ordinal(), offset);
25866 match self {
25867 VideoCompressedFormat::TempFieldTodoRemove(ref val) => {
25868 fidl::encoding::encode_in_envelope::<u32, D>(
25869 <u32 as fidl::encoding::ValueTypeMarker>::borrow(val),
25870 encoder,
25871 offset + 8,
25872 _depth,
25873 )
25874 }
25875 }
25876 }
25877 }
25878
25879 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for VideoCompressedFormat {
25880 #[inline(always)]
25881 fn new_empty() -> Self {
25882 Self::TempFieldTodoRemove(fidl::new_empty!(u32, D))
25883 }
25884
25885 #[inline]
25886 unsafe fn decode(
25887 &mut self,
25888 decoder: &mut fidl::encoding::Decoder<'_, D>,
25889 offset: usize,
25890 mut depth: fidl::encoding::Depth,
25891 ) -> fidl::Result<()> {
25892 decoder.debug_check_bounds::<Self>(offset);
25893 #[allow(unused_variables)]
25894 let next_out_of_line = decoder.next_out_of_line();
25895 let handles_before = decoder.remaining_handles();
25896 let (ordinal, inlined, num_bytes, num_handles) =
25897 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
25898
25899 let member_inline_size = match ordinal {
25900 1 => <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
25901 _ => return Err(fidl::Error::UnknownUnionTag),
25902 };
25903
25904 if inlined != (member_inline_size <= 4) {
25905 return Err(fidl::Error::InvalidInlineBitInEnvelope);
25906 }
25907 let _inner_offset;
25908 if inlined {
25909 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
25910 _inner_offset = offset + 8;
25911 } else {
25912 depth.increment()?;
25913 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
25914 }
25915 match ordinal {
25916 1 => {
25917 #[allow(irrefutable_let_patterns)]
25918 if let VideoCompressedFormat::TempFieldTodoRemove(_) = self {
25919 } else {
25921 *self =
25923 VideoCompressedFormat::TempFieldTodoRemove(fidl::new_empty!(u32, D));
25924 }
25925 #[allow(irrefutable_let_patterns)]
25926 if let VideoCompressedFormat::TempFieldTodoRemove(ref mut val) = self {
25927 fidl::decode!(u32, D, val, decoder, _inner_offset, depth)?;
25928 } else {
25929 unreachable!()
25930 }
25931 }
25932 ordinal => panic!("unexpected ordinal {:?}", ordinal),
25933 }
25934 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
25935 return Err(fidl::Error::InvalidNumBytesInEnvelope);
25936 }
25937 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
25938 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
25939 }
25940 Ok(())
25941 }
25942 }
25943
25944 impl fidl::encoding::ValueTypeMarker for VideoFormat {
25945 type Borrowed<'a> = &'a Self;
25946 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
25947 value
25948 }
25949 }
25950
25951 unsafe impl fidl::encoding::TypeMarker for VideoFormat {
25952 type Owned = Self;
25953
25954 #[inline(always)]
25955 fn inline_align(_context: fidl::encoding::Context) -> usize {
25956 8
25957 }
25958
25959 #[inline(always)]
25960 fn inline_size(_context: fidl::encoding::Context) -> usize {
25961 16
25962 }
25963 }
25964
25965 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<VideoFormat, D>
25966 for &VideoFormat
25967 {
25968 #[inline]
25969 unsafe fn encode(
25970 self,
25971 encoder: &mut fidl::encoding::Encoder<'_, D>,
25972 offset: usize,
25973 _depth: fidl::encoding::Depth,
25974 ) -> fidl::Result<()> {
25975 encoder.debug_check_bounds::<VideoFormat>(offset);
25976 encoder.write_num::<u64>(self.ordinal(), offset);
25977 match self {
25978 VideoFormat::Compressed(ref val) => {
25979 fidl::encoding::encode_in_envelope::<VideoCompressedFormat, D>(
25980 <VideoCompressedFormat as fidl::encoding::ValueTypeMarker>::borrow(val),
25981 encoder,
25982 offset + 8,
25983 _depth,
25984 )
25985 }
25986 VideoFormat::Uncompressed(ref val) => {
25987 fidl::encoding::encode_in_envelope::<VideoUncompressedFormat, D>(
25988 <VideoUncompressedFormat as fidl::encoding::ValueTypeMarker>::borrow(val),
25989 encoder,
25990 offset + 8,
25991 _depth,
25992 )
25993 }
25994 }
25995 }
25996 }
25997
25998 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for VideoFormat {
25999 #[inline(always)]
26000 fn new_empty() -> Self {
26001 Self::Compressed(fidl::new_empty!(VideoCompressedFormat, D))
26002 }
26003
26004 #[inline]
26005 unsafe fn decode(
26006 &mut self,
26007 decoder: &mut fidl::encoding::Decoder<'_, D>,
26008 offset: usize,
26009 mut depth: fidl::encoding::Depth,
26010 ) -> fidl::Result<()> {
26011 decoder.debug_check_bounds::<Self>(offset);
26012 #[allow(unused_variables)]
26013 let next_out_of_line = decoder.next_out_of_line();
26014 let handles_before = decoder.remaining_handles();
26015 let (ordinal, inlined, num_bytes, num_handles) =
26016 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
26017
26018 let member_inline_size = match ordinal {
26019 1 => <VideoCompressedFormat as fidl::encoding::TypeMarker>::inline_size(
26020 decoder.context,
26021 ),
26022 2 => <VideoUncompressedFormat as fidl::encoding::TypeMarker>::inline_size(
26023 decoder.context,
26024 ),
26025 _ => return Err(fidl::Error::UnknownUnionTag),
26026 };
26027
26028 if inlined != (member_inline_size <= 4) {
26029 return Err(fidl::Error::InvalidInlineBitInEnvelope);
26030 }
26031 let _inner_offset;
26032 if inlined {
26033 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
26034 _inner_offset = offset + 8;
26035 } else {
26036 depth.increment()?;
26037 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
26038 }
26039 match ordinal {
26040 1 => {
26041 #[allow(irrefutable_let_patterns)]
26042 if let VideoFormat::Compressed(_) = self {
26043 } else {
26045 *self = VideoFormat::Compressed(fidl::new_empty!(VideoCompressedFormat, D));
26047 }
26048 #[allow(irrefutable_let_patterns)]
26049 if let VideoFormat::Compressed(ref mut val) = self {
26050 fidl::decode!(
26051 VideoCompressedFormat,
26052 D,
26053 val,
26054 decoder,
26055 _inner_offset,
26056 depth
26057 )?;
26058 } else {
26059 unreachable!()
26060 }
26061 }
26062 2 => {
26063 #[allow(irrefutable_let_patterns)]
26064 if let VideoFormat::Uncompressed(_) = self {
26065 } else {
26067 *self =
26069 VideoFormat::Uncompressed(fidl::new_empty!(VideoUncompressedFormat, D));
26070 }
26071 #[allow(irrefutable_let_patterns)]
26072 if let VideoFormat::Uncompressed(ref mut val) = self {
26073 fidl::decode!(
26074 VideoUncompressedFormat,
26075 D,
26076 val,
26077 decoder,
26078 _inner_offset,
26079 depth
26080 )?;
26081 } else {
26082 unreachable!()
26083 }
26084 }
26085 ordinal => panic!("unexpected ordinal {:?}", ordinal),
26086 }
26087 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
26088 return Err(fidl::Error::InvalidNumBytesInEnvelope);
26089 }
26090 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
26091 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
26092 }
26093 Ok(())
26094 }
26095 }
26096}