VirtualBox

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

Last change on this file since 62823 was 62823, checked in by vboxsync, 8 years ago

UsbWebcam cleanups, part 3.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 5.6 KB
Line 
1/* $Id: pdmwebcaminfs.h 62823 2016-08-01 15:11:03Z vboxsync $ */
2/** @file
3 * webcaminfs - interfaces between dev and driver.
4 */
5
6/*
7 * Copyright (C) 2011-2016 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_vmm_pdmwebcaminfs_h
28#define ___VBox_vmm_pdmwebcaminfs_h
29
30#include <VBox/types.h>
31
32struct VRDEVIDEOINDEVICEDESC;
33struct VRDEVIDEOINPAYLOADHDR;
34struct VRDEVIDEOINCTRLHDR;
35
36
37/** @defgroup grp_pdm_ifs_webcam PDM Web Camera Interfaces
38 * @ingroup grp_pdm_interfaces
39 * @{
40 */
41
42/** Pointer to the web camera driver up interface. */
43typedef struct PDMIWEBCAMDOWN *PPDMIWEBCAMDOWN;
44/**
45 * Web camera driver up (facing in the direction of the device) interface.
46 * @todo correct name.
47 */
48typedef struct PDMIWEBCAMDOWN
49{
50 /**
51 * The PDM device is ready to get webcam notifications.
52 *
53 * @param pInterface Pointer to the interface.
54 * @param fReady Whether the device is ready.
55 */
56 DECLR3CALLBACKMEMBER(void, pfnReady,(PPDMIWEBCAMDOWN pInterface, bool fReady));
57
58 /**
59 * Send a control request to the webcam.
60 *
61 * Async response will be returned by pfnWebcamUpControl callback.
62 *
63 * @returns VBox status code.
64 * @param pInterface Pointer to the interface.
65 * @param pvUser The callers context.
66 * @param idDevice Unique id for the reported webcam assigned by the driver.
67 * @param pCtrl The control data.
68 * @param cbCtrl The size of the control data.
69 */
70 DECLR3CALLBACKMEMBER(int, pfnControl,(PPDMIWEBCAMDOWN pInterface, void *pvUser, uint64_t idDevice,
71 struct VRDEVIDEOINCTRLHDR const *pCtrl, uint32_t cbCtrl));
72} PDMIWEBCAMDOWN;
73/** Interface ID for PDMIWEBCAMDOWN. */
74#define PDMIWEBCAMDOWN_IID "0d29b9a1-f4cd-4719-a564-38d5634ba9f8"
75
76
77/** Pointer to the web camera driver/device down interface. */
78typedef struct PDMIWEBCAMDEV *PPDMIWEBCAMDEV;
79/**
80 * Web camera device(/driver) down interface.
81 */
82typedef struct PDMIWEBCAMDEV
83{
84 /**
85 * A webcam is available.
86 *
87 * @returns VBox status code.
88 * @param pInterface Pointer to the interface.
89 * @param idDevice Unique id for the reported webcam assigned by the driver.
90 * @param pDeviceDesc The device description.
91 * @param cbDeviceDesc The size of the device description.
92 * @param uVersion The remote video input protocol version.
93 * @param fCapabilities The remote video input protocol capabilities.
94 */
95 DECLR3CALLBACKMEMBER(int, pfnAttached,(PPDMIWEBCAMDEV pInterface, uint64_t idDevice,
96 struct VRDEVIDEOINDEVICEDESC const *pDeviceDesc, uint32_t cbDeviceDesc,
97 uint32_t uVersion, uint32_t fCapabilities));
98
99 /**
100 * The webcam is not available anymore.
101 *
102 * @param pInterface Pointer to the interface.
103 * @param idDevice Unique id for the reported webcam assigned by the
104 * driver.
105 */
106 DECLR3CALLBACKMEMBER(void, pfnDetached,(PPDMIWEBCAMDEV pInterface, uint64_t idDevice));
107
108 /**
109 * There is a control response or a control change for the webcam.
110 *
111 * @param pInterface Pointer to the interface.
112 * @param fResponse True if this is a response for a previous pfnWebcamDownControl call.
113 * @param pvUser The pvUser parameter of the pfnWebcamDownControl call. Undefined if fResponse == false.
114 * @param idDevice Unique id for the reported webcam assigned by the
115 * driver.
116 * @param pCtrl The control data (defined in VRDE).
117 * @param cbCtrl The size of the control data.
118 */
119 DECLR3CALLBACKMEMBER(void, pfnControl,(PPDMIWEBCAMDEV pInterface, bool fResponse, void *pvUser,
120 uint64_t idDevice, struct VRDEVIDEOINCTRLHDR const *pCtrl, uint32_t cbCtrl));
121
122 /**
123 * A new frame.
124 *
125 * @param pInterface Pointer to the interface.
126 * @param idDevice Unique id for the reported webcam assigned by the driver.
127 * @param pHeader Payload header (defined in VRDE).
128 * @param cbHeader Size of the payload header.
129 * @param pvFrame Frame (image) data.
130 * @param cbFrame Size of the image data.
131 */
132 DECLR3CALLBACKMEMBER(void, pfnFrame,(PPDMIWEBCAMDEV pInterface, uint64_t idDevice,
133 struct VRDEVIDEOINPAYLOADHDR const *pHeader, uint32_t cbHeader,
134 const void *pvFrame, uint32_t cbFrame));
135} PDMIWEBCAMDEV;
136/** Interface ID for PDMIWEBCAMDEV. */
137#define PDMIWEBCAMDEV_IID "6ac03e3c-f56c-4a35-80af-c13ce47a9dd7"
138
139/** @} */
140
141#endif
142
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