VirtualBox

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

Last change on this file since 89363 was 82968, checked in by vboxsync, 5 years ago

Copyright year updates by scm.

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