1 | /* $Id: DrvAudioVRDE.h 96407 2022-08-22 17:43:14Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VirtualBox driver interface to VRDE backend.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2014-2022 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 | * SPDX-License-Identifier: GPL-3.0-only
|
---|
26 | */
|
---|
27 |
|
---|
28 | #ifndef MAIN_INCLUDED_DrvAudioVRDE_h
|
---|
29 | #define MAIN_INCLUDED_DrvAudioVRDE_h
|
---|
30 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
31 | # pragma once
|
---|
32 | #endif
|
---|
33 |
|
---|
34 | #include <VBox/com/ptr.h>
|
---|
35 | #include <VBox/com/string.h>
|
---|
36 |
|
---|
37 | #include <VBox/RemoteDesktop/VRDE.h>
|
---|
38 |
|
---|
39 | #include <VBox/vmm/pdmdrv.h>
|
---|
40 | #include <VBox/vmm/pdmifs.h>
|
---|
41 |
|
---|
42 | #include "AudioDriver.h"
|
---|
43 |
|
---|
44 | using namespace com;
|
---|
45 |
|
---|
46 | class Console;
|
---|
47 |
|
---|
48 | class AudioVRDE : public AudioDriver
|
---|
49 | {
|
---|
50 |
|
---|
51 | public:
|
---|
52 |
|
---|
53 | AudioVRDE(Console *pConsole);
|
---|
54 | virtual ~AudioVRDE(void);
|
---|
55 |
|
---|
56 | public:
|
---|
57 |
|
---|
58 | static const PDMDRVREG DrvReg;
|
---|
59 |
|
---|
60 | public:
|
---|
61 |
|
---|
62 | void onVRDEClientConnect(uint32_t uClientID);
|
---|
63 | void onVRDEClientDisconnect(uint32_t uClientID);
|
---|
64 | int onVRDEControl(bool fEnable, uint32_t uFlags);
|
---|
65 | int onVRDEInputBegin(void *pvContext, PVRDEAUDIOINBEGIN pVRDEAudioBegin);
|
---|
66 | int onVRDEInputData(void *pvContext, const void *pvData, uint32_t cbData);
|
---|
67 | int onVRDEInputEnd(void *pvContext);
|
---|
68 | int onVRDEInputIntercept(bool fIntercept);
|
---|
69 |
|
---|
70 | public:
|
---|
71 |
|
---|
72 | static DECLCALLBACK(int) drvConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfg, uint32_t fFlags);
|
---|
73 | static DECLCALLBACK(void) drvDestruct(PPDMDRVINS pDrvIns);
|
---|
74 | static DECLCALLBACK(void) drvPowerOff(PPDMDRVINS pDrvIns);
|
---|
75 |
|
---|
76 | private:
|
---|
77 |
|
---|
78 | virtual int configureDriver(PCFGMNODE pLunCfg, PCVMMR3VTABLE pVMM) RT_OVERRIDE;
|
---|
79 |
|
---|
80 | /** Pointer to the associated VRDE audio driver. */
|
---|
81 | struct DRVAUDIOVRDE *mpDrv;
|
---|
82 | /** Protects accesses to mpDrv from racing driver destruction. */
|
---|
83 | RTCRITSECT mCritSect;
|
---|
84 | };
|
---|
85 |
|
---|
86 | #endif /* !MAIN_INCLUDED_DrvAudioVRDE_h */
|
---|
87 |
|
---|