From b31cd4302d9f751f5613657ba9d6ad26adc5a9d0 Mon Sep 17 00:00:00 2001 From: lxsang Date: Mon, 28 Dec 2020 20:26:53 +0000 Subject: [PATCH] add package archive --- RemoteCamera/build/debug/main.js | 222 +------------------- RemoteCamera/build/release/RemoteCamera.zip | Bin 0 -> 5577 bytes packages.json | 10 + 3 files changed, 11 insertions(+), 221 deletions(-) create mode 100644 RemoteCamera/build/release/RemoteCamera.zip diff --git a/RemoteCamera/build/debug/main.js b/RemoteCamera/build/debug/main.js index a6d2829..636b56a 100644 --- a/RemoteCamera/build/debug/main.js +++ b/RemoteCamera/build/debug/main.js @@ -1,221 +1 @@ -(function() { - var RemoteCamera; - - RemoteCamera = class RemoteCamera extends this.OS.application.BaseApplication { - constructor(args) { - super("RemoteCamera", args); - } - - main() { - var fps, i, j; - this.mute = false; - this.player = this.find("player"); - this.qctl = this.find("qctl"); - this.fpsctl = this.find("fpsctl"); - this.cam_setting = { - w: 640, - h: 480, - fps: 10, - quality: 60 - }; - fps = []; - for (i = j = 5; j <= 30; i = j += 5) { - fps.push({ - text: `${i}`, - value: i - }); - } - this.fpsctl.data = fps; - this.fpsctl.selected = this.cam_setting.fps / 5 - 1; - this.fpsctl.onlistselect = (e) => { - if (this.mute) { - return; - } - this.cam_setting.fps = e.data.item.data.value; - return this.setCameraSetting(); - }; - this.qctl.value = this.cam_setting.quality; - this.resoctl = this.find("resoctl"); - this.resoctl.data = [ - { - text: __("320x240"), - mode: "qvga" - }, - { - text: __("640x480"), - selected: true, - mode: "vga" - }, - { - text: __("800x600"), - mode: "svga" - }, - { - text: __("1024x760"), - mode: "hd" - }, - { - text: __("1920×1080"), - mode: "fhd" - } - ]; - this.resoctl.onlistselect = (e) => { - if (this.mute) { - return; - } - switch (e.data.item.data.mode) { - case "qvga": - this.cam_setting.w = 320; - this.cam_setting.h = 240; - break; - case "vga": - this.cam_setting.w = 640; - this.cam_setting.h = 480; - break; - case "svga": - this.cam_setting.w = 800; - this.cam_setting.h = 600; - break; - case "hd": - this.cam_setting.w = 1024; - this.cam_setting.h = 768; - break; - case "fhd": - this.cam_setting.w = 1920; - this.cam_setting.h = 1080; - } - return this.setCameraSetting(); - }; - this.qctl.onvaluechange = (e) => { - if (this.mute) { - return; - } - this.cam_setting.quality = e.data; - return this.setCameraSetting(); - }; - if (!Antunnel.tunnel) { - return this.notify(__("Antunnel service is not available")); - } - if (!this.setting.channel) { - return this.requestChannel(); - } else { - return this.openSession(); - } - } - - requestChannel() { - return this.openDialog("PromptDialog", { - title: __("Enter camera channel"), - label: __("Please enter camera channel name") - }).then((v) => { - this.setting.channel = v; - return this.openSession(); - }); - } - - menu() { - return { - text: "__(Option)", - nodes: [ - { - text: "__(Camera channel)" - } - ], - onchildselect: (e) => { - return this.requestChannel(); - } - }; - } - - openSession() { - if (!Antunnel) { - return; - } - if (!this.setting.channel) { - return; - } - this.tunnel = Antunnel.tunnel; - this.sub = new Antunnel.Subscriber(this.setting.channel); - this.sub.onopen = () => { - return console.log("Subscribed to camera channel"); - }; - this.sub.onerror = (e) => { - return this.error(__("Error: {0}", new TextDecoder("utf-8").decode(e.data)), e); - }; - //@sub = undefined - this.sub.onctrl = (e) => { - var res; - this.cam_setting.w = Antunnel.Msg.int_from(e.data, 0); - this.cam_setting.h = Antunnel.Msg.int_from(e.data, 2); - this.cam_setting.fps = e.data[4]; - this.cam_setting.quality = e.data[5]; - this.mute = true; - this.qctl.value = this.cam_setting.quality; - res = `${this.cam_setting.w}x${this.cam_setting.h}`; - switch (res) { - case "320x240": - this.resoctl.selected = 0; - break; - case "640x480": - this.resoctl.selected = 1; - break; - case "800x600": - this.resoctl.selected = 2; - break; - case "1024x768": - this.resoctl.selected = 3; - break; - case "1920x1080": - this.resoctl.selected = 4; - } - this.fpsctl.selected = this.cam_setting.fps / 5 - 1; - return this.mute = false; - }; - this.sub.onmessage = (e) => { - var context, imgData, jpeg; - jpeg = new JpegImage(); - jpeg.parse(e.data); - context = this.player.getContext("2d"); - this.player.width = jpeg.width; - this.player.height = jpeg.height; - //jpeg.copyToImageData(d) - imgData = context.getImageData(0, 0, jpeg.width, jpeg.height); - jpeg.copyToImageData(imgData); - return context.putImageData(imgData, 0, 0); - }; - this.sub.onclose = () => { - this.sub = void 0; - this.notify(__("Unsubscribed to the camera service")); - return this.quit(); - }; - return Antunnel.tunnel.subscribe(this.sub); - } - - cleanup() { - if (this.sub) { - return this.sub.close(); - } - } - - setCameraSetting() { - var arr; - if (!this.sub) { - return; - } - arr = new Uint8Array(6); - arr.set(Antunnel.Msg.bytes_of(this.cam_setting.w), 0); - arr.set(Antunnel.Msg.bytes_of(this.cam_setting.h), 2); - arr[4] = this.cam_setting.fps; - arr[5] = this.cam_setting.quality; - return this.sub.send(Antunnel.Msg.CTRL, arr); - } - - }; - - RemoteCamera.singleton = true; - - RemoteCamera.dependencies = ["pkg://libjpeg/jpg.js"]; - - this.OS.register("RemoteCamera", RemoteCamera); - -}).call(this); +(function(){var t;(t=class extends this.OS.application.BaseApplication{constructor(t){super("RemoteCamera",t)}main(){var t,e,s;for(this.mute=!1,this.player=this.find("player"),this.qctl=this.find("qctl"),this.fpsctl=this.find("fpsctl"),this.cam_setting={w:640,h:480,fps:10,quality:60},t=[],e=s=5;s<=30;e=s+=5)t.push({text:""+e,value:e});return this.fpsctl.data=t,this.fpsctl.selected=this.cam_setting.fps/5-1,this.fpsctl.onlistselect=t=>{if(!this.mute)return this.cam_setting.fps=t.data.item.data.value,this.setCameraSetting()},this.qctl.value=this.cam_setting.quality,this.resoctl=this.find("resoctl"),this.resoctl.data=[{text:__("320x240"),mode:"qvga"},{text:__("640x480"),selected:!0,mode:"vga"},{text:__("800x600"),mode:"svga"},{text:__("1024x760"),mode:"hd"},{text:__("1920×1080"),mode:"fhd"}],this.resoctl.onlistselect=t=>{if(!this.mute){switch(t.data.item.data.mode){case"qvga":this.cam_setting.w=320,this.cam_setting.h=240;break;case"vga":this.cam_setting.w=640,this.cam_setting.h=480;break;case"svga":this.cam_setting.w=800,this.cam_setting.h=600;break;case"hd":this.cam_setting.w=1024,this.cam_setting.h=768;break;case"fhd":this.cam_setting.w=1920,this.cam_setting.h=1080}return this.setCameraSetting()}},this.qctl.onvaluechange=t=>{if(!this.mute)return this.cam_setting.quality=t.data,this.setCameraSetting()},Antunnel.tunnel?this.setting.channel?this.openSession():this.requestChannel():this.notify(__("Antunnel service is not available"))}requestChannel(){return this.openDialog("PromptDialog",{title:__("Enter camera channel"),label:__("Please enter camera channel name")}).then(t=>(this.setting.channel=t,this.openSession()))}menu(){return{text:"__(Option)",nodes:[{text:"__(Camera channel)"}],onchildselect:t=>this.requestChannel()}}openSession(){if(Antunnel&&this.setting.channel)return this.tunnel=Antunnel.tunnel,this.sub=new Antunnel.Subscriber(this.setting.channel),this.sub.onopen=()=>console.log("Subscribed to camera channel"),this.sub.onerror=t=>this.error(__("Error: {0}",new TextDecoder("utf-8").decode(t.data)),t),this.sub.onctrl=t=>{switch(this.cam_setting.w=Antunnel.Msg.int_from(t.data,0),this.cam_setting.h=Antunnel.Msg.int_from(t.data,2),this.cam_setting.fps=t.data[4],this.cam_setting.quality=t.data[5],this.mute=!0,this.qctl.value=this.cam_setting.quality,`${this.cam_setting.w}x${this.cam_setting.h}`){case"320x240":this.resoctl.selected=0;break;case"640x480":this.resoctl.selected=1;break;case"800x600":this.resoctl.selected=2;break;case"1024x768":this.resoctl.selected=3;break;case"1920x1080":this.resoctl.selected=4}return this.fpsctl.selected=this.cam_setting.fps/5-1,this.mute=!1},this.sub.onmessage=t=>{var e,s,i;return(i=new JpegImage).parse(t.data),e=this.player.getContext("2d"),this.player.width=i.width,this.player.height=i.height,s=e.getImageData(0,0,i.width,i.height),i.copyToImageData(s),e.putImageData(s,0,0)},this.sub.onclose=()=>(this.sub=void 0,this.notify(__("Unsubscribed to the camera service")),this.quit()),Antunnel.tunnel.subscribe(this.sub)}cleanup(){if(this.sub)return this.sub.close()}setCameraSetting(){var t;if(this.sub)return(t=new Uint8Array(6)).set(Antunnel.Msg.bytes_of(this.cam_setting.w),0),t.set(Antunnel.Msg.bytes_of(this.cam_setting.h),2),t[4]=this.cam_setting.fps,t[5]=this.cam_setting.quality,this.sub.send(Antunnel.Msg.CTRL,t)}}).singleton=!0,t.dependencies=["pkg://libjpeg/jpg.js"],this.OS.register("RemoteCamera",t)}).call(this); \ No newline at end of file diff --git a/RemoteCamera/build/release/RemoteCamera.zip b/RemoteCamera/build/release/RemoteCamera.zip new file mode 100644 index 0000000000000000000000000000000000000000..32aaaffe8ebf3850be3d6a740de4542ca41eb483 GIT binary patch literal 5577 zcmb_gOLN><74{H@NAnmK!-|a}s42;#mSx9wJnG00Vh_b+rsBjIHm;PTmTtFhqL$ja zSKaMudPx;)Hc%8b8&)h>uw>1e;s>x`$AX{0itj$udbl$~2u`Wey61V%J?A^;>g?gI zFZZ^@-^uTP_xQ7ae(yJrzqPd`p08qU64K0l!K_i4MV#iDWiMx8Veo;)gD4FdGsuFI zEM^8zD03g3yWw=2(kK+n?vF!8?$__jD9;!#%82KM#qA|4r=+mVCuEXy@*td$A~YRt zuY}RckV70c7zuu%e^PQ1+}?HM%QOwINfF53BbvpQsa8x|(XS$&HmTyhqK&4kLscsk zJqjn6jBrk~aj=~Ghx?wB`1?nm12%uxbFRuTrTp4I^i~cJE}l6gV8OwF-3#t`1N?qJ zIIy`pEm>kMIYQ){=KI8%g=tBAva$yS;boDjpef649P%*W%5}ZONJ=73VzrBgPc9gC z4*EI}nmf-@%D9pVcyPR=BkT4$YO*)RYzh-6)ROZxR=$v1+FFhIDP_Yo5uBjgl}M zlh>#cozS{clqVZZIrlSOW*JFc_1_O=xWOop#1&RSQ;YeOWaor2iK=SL1-U8-;|~;@ zWvkUJ=X7*!iF&BC8;le)8WDps17stdg)|L^DKTvu(P(Q~Hp3&Vp3pGO$Ci0kgk6{DfpBuwS{Xp%X4Wnu>;En@)xzVZMe46BLC_m6x`t#ypD>n#Kwde0U%ap&ORf zs%2ZCWfk7{-rIC+Ed*7^8&nedxOHBX!yqGb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PX*YqcWEX*I b$$x*Rg-2%(-~NgqzKwt1MR)n^UGerGNZ=VJ literal 0 HcmV?d00001 diff --git a/packages.json b/packages.json index f643d83..fc75e10 100644 --- a/packages.json +++ b/packages.json @@ -189,6 +189,16 @@ "dependencies": [], "download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/Preview/build/release/Preview.zip" }, + { + "pkgname": "RemoteCamera", + "name": "Remote Camera", + "description": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/RemoteCamera/README.md", + "category": "Other", + "author": "", + "version": "0.0.1-a", + "dependencies": ["libjpeg@0.1.1-a","Antunnel@0.1.8-a"], + "download": "https://raw.githubusercontent.com/lxsang/antosdk-apps/master/RemoteCamera/build/release/RemoteCamera.zip" + }, { "pkgname": "RemoteDesktop", "name": "WVNC remote desktop",