VirtualBox

source: vbox/trunk/include/VBox/vmm/pdmwebcaminfs.h@ 104429

Last change on this file since 104429 was 98103, checked in by vboxsync, 22 months ago

Copyright year updates by scm.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 6.0 KB
Line 
1/* $Id: pdmwebcaminfs.h 98103 2023-01-17 14:15:46Z vboxsync $ */
2/** @file
3 * webcaminfs - interfaces between dev and driver.
4 */
5
6/*
7 * Copyright (C) 2011-2023 Oracle and/or its affiliates.
8 *
9 * This file is part of VirtualBox base platform packages, as
10 * available from https://www.virtualbox.org.
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation, in version 3 of the
15 * License.
16 *
17 * This program is distributed in the hope that it will be useful, but
18 * WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, see <https://www.gnu.org/licenses>.
24 *
25 * The contents of this file may alternatively be used under the terms
26 * of the Common Development and Distribution License Version 1.0
27 * (CDDL), a copy of it is provided in the "COPYING.CDDL" file included
28 * in the VirtualBox distribution, in which case the provisions of the
29 * CDDL are applicable instead of those of the GPL.
30 *
31 * You may elect to license modified versions of this file under the
32 * terms and conditions of either the GPL or the CDDL or both.
33 *
34 * SPDX-License-Identifier: GPL-3.0-only OR CDDL-1.0
35 */
36
37#ifndef VBOX_INCLUDED_vmm_pdmwebcaminfs_h
38#define VBOX_INCLUDED_vmm_pdmwebcaminfs_h
39#ifndef RT_WITHOUT_PRAGMA_ONCE
40# pragma once
41#endif
42
43#include <VBox/types.h>
44
45struct VRDEVIDEOINDEVICEDESC;
46struct VRDEVIDEOINPAYLOADHDR;
47struct VRDEVIDEOINCTRLHDR;
48
49
50/** @defgroup grp_pdm_ifs_webcam PDM Web Camera Interfaces
51 * @ingroup grp_pdm_interfaces
52 * @{
53 */
54
55/** Pointer to the web camera driver (up) interface. */
56typedef struct PDMIWEBCAMDRV *PPDMIWEBCAMDRV;
57/**
58 * Web camera interface driver provided by the driver to the device,
59 * i.e. facing upwards.
60 */
61typedef struct PDMIWEBCAMDRV
62{
63 /**
64 * The PDM device is ready to get webcam notifications.
65 *
66 * @param pInterface Pointer to the interface.
67 * @param fReady Whether the device is ready.
68 */
69 DECLR3CALLBACKMEMBER(void, pfnReady,(PPDMIWEBCAMDRV pInterface, bool fReady));
70
71 /**
72 * Send a control request to the webcam.
73 *
74 * Async response will be returned by pfnWebcamUpControl callback.
75 *
76 * @returns VBox status code.
77 * @param pInterface Pointer to the interface.
78 * @param pvUser The callers context.
79 * @param idDevice Unique id for the reported webcam assigned by the driver.
80 * @param pCtrl The control data.
81 * @param cbCtrl The size of the control data.
82 */
83 DECLR3CALLBACKMEMBER(int, pfnControl,(PPDMIWEBCAMDRV pInterface, void *pvUser, uint64_t idDevice,
84 struct VRDEVIDEOINCTRLHDR const *pCtrl, uint32_t cbCtrl));
85} PDMIWEBCAMDRV;
86/** Interface ID for PDMIWEBCAMDRV. */
87#define PDMIWEBCAMDRV_IID "0d29b9a1-f4cd-4719-a564-38d5634ba9f8"
88
89
90/** Pointer to the web camera driver/device (down) interface. */
91typedef struct PDMIWEBCAMDEV *PPDMIWEBCAMDEV;
92/**
93 * Web camera interface provided by the device(/driver) interface,
94 * i.e. facing downwards.
95 */
96typedef struct PDMIWEBCAMDEV
97{
98 /**
99 * A webcam is available.
100 *
101 * @returns VBox status code.
102 * @param pInterface Pointer to the interface.
103 * @param idDevice Unique id for the reported webcam assigned by the driver.
104 * @param pDeviceDesc The device description.
105 * @param cbDeviceDesc The size of the device description.
106 * @param uVersion The remote video input protocol version.
107 * @param fCapabilities The remote video input protocol capabilities.
108 */
109 DECLR3CALLBACKMEMBER(int, pfnAttached,(PPDMIWEBCAMDEV pInterface, uint64_t idDevice,
110 struct VRDEVIDEOINDEVICEDESC const *pDeviceDesc, uint32_t cbDeviceDesc,
111 uint32_t uVersion, uint32_t fCapabilities));
112
113 /**
114 * The webcam is not available anymore.
115 *
116 * @param pInterface Pointer to the interface.
117 * @param idDevice Unique id for the reported webcam assigned by the
118 * driver.
119 */
120 DECLR3CALLBACKMEMBER(void, pfnDetached,(PPDMIWEBCAMDEV pInterface, uint64_t idDevice));
121
122 /**
123 * There is a control response or a control change for the webcam.
124 *
125 * @param pInterface Pointer to the interface.
126 * @param fResponse True if this is a response for a previous pfnWebcamDownControl call.
127 * @param pvUser The pvUser parameter of the pfnWebcamDownControl call. Undefined if fResponse == false.
128 * @param idDevice Unique id for the reported webcam assigned by the
129 * driver.
130 * @param pCtrl The control data (defined in VRDE).
131 * @param cbCtrl The size of the control data.
132 */
133 DECLR3CALLBACKMEMBER(void, pfnControl,(PPDMIWEBCAMDEV pInterface, bool fResponse, void *pvUser,
134 uint64_t idDevice, struct VRDEVIDEOINCTRLHDR const *pCtrl, uint32_t cbCtrl));
135
136 /**
137 * A new frame.
138 *
139 * @param pInterface Pointer to the interface.
140 * @param idDevice Unique id for the reported webcam assigned by the driver.
141 * @param pHeader Payload header (defined in VRDE).
142 * @param cbHeader Size of the payload header.
143 * @param pvFrame Frame (image) data.
144 * @param cbFrame Size of the image data.
145 */
146 DECLR3CALLBACKMEMBER(void, pfnFrame,(PPDMIWEBCAMDEV pInterface, uint64_t idDevice,
147 struct VRDEVIDEOINPAYLOADHDR const *pHeader, uint32_t cbHeader,
148 const void *pvFrame, uint32_t cbFrame));
149} PDMIWEBCAMDEV;
150/** Interface ID for PDMIWEBCAMDEV. */
151#define PDMIWEBCAMDEV_IID "6ac03e3c-f56c-4a35-80af-c13ce47a9dd7"
152
153/** @} */
154
155#endif /* !VBOX_INCLUDED_vmm_pdmwebcaminfs_h */
156
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette