PVRManager.ipdl (3194B)
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- 2 * vim: sw=2 ts=8 et : 3 */ 4 /* This Source Code Form is subject to the terms of the Mozilla Public 5 * License, v. 2.0. If a copy of the MPL was not distributed with this 6 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 7 8 include LayersSurfaces; 9 include protocol PVRLayer; 10 include LayersMessages; 11 include GamepadEventTypes; 12 13 include "VRMessageUtils.h"; 14 include "VRManagerParent.h"; 15 include "VRManagerChild.h"; 16 17 using struct mozilla::gfx::VRFieldOfView from "gfxVR.h"; 18 using struct mozilla::gfx::VRDisplayInfo from "gfxVR.h"; 19 using struct mozilla::gfx::VRSensorUpdate from "gfxVR.h"; 20 using struct mozilla::gfx::VRHMDSensorState from "gfxVR.h"; 21 using struct mozilla::gfx::VRControllerInfo from "gfxVR.h"; 22 using struct mozilla::gfx::VRSubmitFrameResultInfo from "gfxVR.h"; 23 using mozilla::gfx::VRDisplayCapabilityFlags from "moz_external_vr.h"; 24 using mozilla::layers::LayersBackend from "mozilla/layers/LayersTypes.h"; 25 using mozilla::layers::TextureFlags from "mozilla/layers/CompositorTypes.h"; 26 using mozilla::dom::GamepadHandle from "mozilla/dom/GamepadHandle.h"; 27 28 29 namespace mozilla { 30 namespace gfx { 31 32 /** 33 * The PVRManager protocol is used to enable communication of VR display 34 * enumeration and sensor state between the compositor thread and 35 * content threads/processes. 36 */ 37 [NeedsOtherPid, ChildImpl="VRManagerChild", ParentImpl="VRManagerParent", ParentProc=compositor, ChildProc=anydom] 38 sync protocol PVRManager 39 { 40 manages PVRLayer; 41 42 parent: 43 async PVRLayer(uint32_t aDisplayID, uint32_t aGroup); 44 45 // Detect runtime capabilities. This will return the presense of VR and/or AR 46 // runtime software, without enumerating or activating any hardware devices. 47 async DetectRuntimes(); 48 49 // (Re)Enumerate VR Displays. An updated list of VR displays will be returned 50 // asynchronously to children via UpdateDisplayInfo. 51 async RefreshDisplays(); 52 53 async SetGroupMask(uint32_t aDisplayID, uint32_t aGroupMask); 54 async SetHaveEventListener(bool aHaveEventListener); 55 56 async ControllerListenerAdded(); 57 async ControllerListenerRemoved(); 58 async VibrateHaptic(GamepadHandle aGamepadHandle, uint32_t aHapticIndex, 59 double aIntensity, double aDuration, uint32_t aPromiseID); 60 async StopVibrateHaptic(GamepadHandle aGamepadHandle); 61 async StartVRNavigation(uint32_t aDeviceID); 62 async StopVRNavigation(uint32_t aDeviceID, TimeDuration aDuration); 63 async StartActivity(); 64 async StopActivity(); 65 66 async RunPuppet(uint64_t[] buffer); 67 async ResetPuppet(); 68 69 child: 70 // Notify children of updated VR display enumeration and details. This will 71 // be sent to all children when the parent receives RefreshDisplays, even 72 // if no changes have been detected. This ensures that Promises exposed 73 // through DOM calls are always resolved. 74 async UpdateDisplayInfo(VRDisplayInfo aDisplayInfo); 75 76 async UpdateRuntimeCapabilities(VRDisplayCapabilityFlags aCapabilities); 77 78 async ReplyGamepadVibrateHaptic(uint32_t aPromiseID); 79 async NotifyPuppetCommandBufferCompleted(bool aSuccess); 80 async NotifyPuppetResetComplete(); 81 82 async __delete__(); 83 84 }; 85 86 } // gfx 87 } // mozilla