1 | /* $Id: RecordingInternals.cpp 96407 2022-08-22 17:43:14Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * Recording internals code.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2012-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 | #include "RecordingInternals.h"
|
---|
29 |
|
---|
30 | #include <iprt/assert.h>
|
---|
31 | #include <iprt/mem.h>
|
---|
32 |
|
---|
33 | #ifdef VBOX_WITH_AUDIO_RECORDING
|
---|
34 | /**
|
---|
35 | * Frees a previously allocated recording audio frame.
|
---|
36 | *
|
---|
37 | * @param pFrame Audio frame to free. The pointer will be invalid after return.
|
---|
38 | */
|
---|
39 | void RecordingAudioFrameFree(PRECORDINGAUDIOFRAME pFrame)
|
---|
40 | {
|
---|
41 | if (!pFrame)
|
---|
42 | return;
|
---|
43 |
|
---|
44 | if (pFrame->pvBuf)
|
---|
45 | {
|
---|
46 | Assert(pFrame->cbBuf);
|
---|
47 | RTMemFree(pFrame->pvBuf);
|
---|
48 | }
|
---|
49 | RTMemFree(pFrame);
|
---|
50 | pFrame = NULL;
|
---|
51 | }
|
---|
52 | #endif
|
---|
53 |
|
---|
54 | /**
|
---|
55 | * Frees a recording video frame.
|
---|
56 | *
|
---|
57 | * @returns IPRT status code.
|
---|
58 | * @param pFrame Pointer to video frame to free. The pointer will be invalid after return.
|
---|
59 | */
|
---|
60 | void RecordingVideoFrameFree(PRECORDINGVIDEOFRAME pFrame)
|
---|
61 | {
|
---|
62 | if (!pFrame)
|
---|
63 | return;
|
---|
64 |
|
---|
65 | if (pFrame->pu8RGBBuf)
|
---|
66 | {
|
---|
67 | Assert(pFrame->cbRGBBuf);
|
---|
68 | RTMemFree(pFrame->pu8RGBBuf);
|
---|
69 | }
|
---|
70 | RTMemFree(pFrame);
|
---|
71 | }
|
---|
72 |
|
---|