1 module libwasm.bindings.MediaCapabilities; 2 3 import libwasm.types; 4 5 import memutils.ct: tuple; 6 @safe: 7 nothrow: 8 9 struct AudioConfiguration { 10 nothrow: 11 JsHandle handle; 12 alias handle this; 13 this(Handle h) { 14 this.handle = JsHandle(h); 15 } 16 static auto create() { 17 return AudioConfiguration(libwasm_add__object()); 18 } 19 void contentType()(string contentType) { 20 Object_Call_string__void(this.handle, "contentType", contentType); 21 } 22 string contentType()() { 23 return Object_Getter__string(this.handle, "contentType"); 24 } 25 void channels()(string channels) { 26 Object_Call_string__void(this.handle, "channels", channels); 27 } 28 string channels()() { 29 return Object_Getter__string(this.handle, "channels"); 30 } 31 void bitrate()(uint bitrate) { 32 Object_Call_uint__void(this.handle, "bitrate", bitrate); 33 } 34 uint bitrate()() { 35 return Object_Getter__uint(this.handle, "bitrate"); 36 } 37 void samplerate()(uint samplerate) { 38 Object_Call_uint__void(this.handle, "samplerate", samplerate); 39 } 40 uint samplerate()() { 41 return Object_Getter__uint(this.handle, "samplerate"); 42 } 43 } 44 struct MediaCapabilities { 45 nothrow: 46 JsHandle handle; 47 alias handle this; 48 this(Handle h) { 49 this.handle = JsHandle(h); 50 } 51 auto decodingInfo()(scope ref MediaDecodingConfiguration configuration) { 52 return JsPromise!(MediaCapabilitiesInfo)(Object_Call_Handle__Handle(this.handle, "decodingInfo", configuration._parent)); 53 } 54 auto encodingInfo()(scope ref MediaEncodingConfiguration configuration) { 55 return JsPromise!(MediaCapabilitiesInfo)(Object_Call_Handle__Handle(this.handle, "encodingInfo", configuration._parent)); 56 } 57 } 58 struct MediaCapabilitiesInfo { 59 nothrow: 60 JsHandle handle; 61 alias handle this; 62 this(Handle h) { 63 this.handle = JsHandle(h); 64 } 65 bool supported()() { 66 return Object_Getter__bool(this.handle, "supported"); 67 } 68 bool smooth()() { 69 return Object_Getter__bool(this.handle, "smooth"); 70 } 71 bool powerEfficient()() { 72 return Object_Getter__bool(this.handle, "powerEfficient"); 73 } 74 } 75 struct MediaConfiguration { 76 nothrow: 77 JsHandle handle; 78 alias handle this; 79 this(Handle h) { 80 this.handle = JsHandle(h); 81 } 82 static auto create() { 83 return MediaConfiguration(libwasm_add__object()); 84 } 85 void video()(scope ref VideoConfiguration video) { 86 Object_Call_Handle__void(this.handle, "video", video.handle); 87 } 88 auto video()() { 89 return VideoConfiguration(Object_Getter__Handle(this.handle, "video")); 90 } 91 void audio()(scope ref AudioConfiguration audio) { 92 Object_Call_Handle__void(this.handle, "audio", audio.handle); 93 } 94 auto audio()() { 95 return AudioConfiguration(Object_Getter__Handle(this.handle, "audio")); 96 } 97 } 98 struct MediaDecodingConfiguration { 99 nothrow: 100 libwasm.bindings.MediaCapabilities.MediaConfiguration _parent; 101 alias _parent this; 102 this(Handle h) { 103 _parent = .MediaConfiguration(h); 104 } 105 static auto create() { 106 return MediaDecodingConfiguration(libwasm_add__object()); 107 } 108 void type()(MediaDecodingType type) { 109 Object_Call_int__void(this._parent, "type", type); 110 } 111 MediaDecodingType type()() { 112 return Object_Getter__int(this._parent, "type"); 113 } 114 } 115 enum MediaDecodingType { 116 file, 117 media_source 118 } 119 struct MediaEncodingConfiguration { 120 nothrow: 121 libwasm.bindings.MediaCapabilities.MediaConfiguration _parent; 122 alias _parent this; 123 this(Handle h) { 124 _parent = .MediaConfiguration(h); 125 } 126 static auto create() { 127 return MediaEncodingConfiguration(libwasm_add__object()); 128 } 129 void type()(MediaEncodingType type) { 130 Object_Call_int__void(this._parent, "type", type); 131 } 132 MediaEncodingType type()() { 133 return Object_Getter__int(this._parent, "type"); 134 } 135 } 136 enum MediaEncodingType { 137 record, 138 transmission 139 } 140 struct VideoConfiguration { 141 nothrow: 142 JsHandle handle; 143 alias handle this; 144 this(Handle h) { 145 this.handle = JsHandle(h); 146 } 147 static auto create() { 148 return VideoConfiguration(libwasm_add__object()); 149 } 150 void contentType()(string contentType) { 151 Object_Call_string__void(this.handle, "contentType", contentType); 152 } 153 string contentType()() { 154 return Object_Getter__string(this.handle, "contentType"); 155 } 156 void width()(uint width) { 157 Object_Call_uint__void(this.handle, "width", width); 158 } 159 uint width()() { 160 return Object_Getter__uint(this.handle, "width"); 161 } 162 void height()(uint height) { 163 Object_Call_uint__void(this.handle, "height", height); 164 } 165 uint height()() { 166 return Object_Getter__uint(this.handle, "height"); 167 } 168 void bitrate()(uint bitrate) { 169 Object_Call_uint__void(this.handle, "bitrate", bitrate); 170 } 171 uint bitrate()() { 172 return Object_Getter__uint(this.handle, "bitrate"); 173 } 174 void framerate()(string framerate) { 175 Object_Call_string__void(this.handle, "framerate", framerate); 176 } 177 string framerate()() { 178 return Object_Getter__string(this.handle, "framerate"); 179 } 180 } 181 182