VirtualBox

source: vbox/trunk/src/VBox/Devices/Audio/HDAStreamMap.h@ 88158

Last change on this file since 88158 was 88112, checked in by vboxsync, 4 years ago

Audio,DevHDA: Made PDMAUDIOPCMPROPS_F2B and PDMAUDIOPCMPROPS_B2F work for 5.1 and other frame sizes that aren't a power of two. Rewrote hdaR3StreamDoDmaOutput. Mapping is now done using converter functions rather than the complexity in hdaR3StreamTransfer. Probably fixes some recent goofs in the DMA period heuristics for non-stereo guest streams, I've renamed the members to make it clear what's what. bugref:9890

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.3 KB
Line 
1/* $Id: HDAStreamMap.h 88112 2021-03-12 20:41:05Z vboxsync $ */
2/** @file
3 * HDAStreamMap.h - Stream map functions for HD Audio.
4 */
5
6/*
7 * Copyright (C) 2017-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
18#ifndef VBOX_INCLUDED_SRC_Audio_HDAStreamMap_h
19#define VBOX_INCLUDED_SRC_Audio_HDAStreamMap_h
20#ifndef RT_WITHOUT_PRAGMA_ONCE
21# pragma once
22#endif
23
24/**
25 * Audio stream data mapping.
26 */
27typedef struct HDASTREAMMAP
28{
29 /** The guest stream properties that is being mapped from/to.
30 * The host properties are found in HDASTREAMSTATE::Cfg::Props. */
31 PDMAUDIOPCMPROPS GuestProps;
32 /** The stream's layout. */
33 PDMAUDIOSTREAMLAYOUT enmLayout;
34 /** The guest side frame size in bytes. */
35 uint8_t cbGuestFrame;
36 /** Set if mapping is needed. */
37 bool fMappingNeeded;
38 /** Number of mappings in paMappings. */
39 uint8_t cMappings;
40 uint8_t aPadding[1];
41 /** Array of stream mappings.
42 * Note: The mappings *must* be layed out in an increasing order, e.g.
43 * how the data appears in the given data block. */
44 R3PTRTYPE(PPDMAUDIOSTREAMMAP) paMappings;
45#if HC_ARCH_BITS == 32
46 RTR3PTR Padding1;
47#endif
48#ifdef VBOX_WITH_AUDIO_HDA_51_SURROUND
49 /** Circular buffer holding for holding audio data for this mapping. */
50 R3PTRTYPE(PRTCIRCBUF) pCircBuf;
51#endif
52 /**
53 * Converts guest data to host data.
54 *
55 * @param pvDst The destination (host) buffer.
56 * @param pvSrc The source (guest) data. Does not overlap @a pvDst.
57 * @param cFrames Number of frames to convert.
58 * @param pMapping Pointer to this structure.
59 */
60 DECLCALLBACKMEMBER(void, pfnGuestToHost,(void *pvDst, void const *pvSrc, uint32_t cFrames,
61 struct HDASTREAMMAP const *pMapping));
62 /**
63 * Converts host data to guest data.
64 *
65 * @param pvDst The destination (guest) buffer.
66 * @param pvSrc The source (host) data. Does not overlap @a pvDst.
67 * @param cFrames Number of frames to convert.
68 * @param pMapping Pointer to this structure.
69 */
70 DECLCALLBACKMEMBER(void, pfnHostToGuest,(void *pvDst, void const *pvSrc, uint32_t cFrames,
71 struct HDASTREAMMAP const *pMapping));
72} HDASTREAMMAP;
73AssertCompileSizeAlignment(HDASTREAMMAP, 8);
74/** Pointer to an audio stream data mapping. */
75typedef HDASTREAMMAP *PHDASTREAMMAP;
76
77/** @name Stream mapping functions.
78 * @{
79 */
80#ifdef IN_RING3
81int hdaR3StreamMapInit(PHDASTREAMMAP pMapping, uint8_t cHostChannels, PPDMAUDIOPCMPROPS pProps);
82void hdaR3StreamMapDestroy(PHDASTREAMMAP pMapping);
83void hdaR3StreamMapReset(PHDASTREAMMAP pMapping);
84#endif
85/** @} */
86
87#endif /* !VBOX_INCLUDED_SRC_Audio_HDAStreamMap_h */
88
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