VirtualBox

source: vbox/trunk/src/VBox/Main/include/VideoRecInternals.h@ 75005

Last change on this file since 75005 was 75005, checked in by vboxsync, 6 years ago

Main: build fix (stdint.h)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.7 KB
Line 
1/* $Id: VideoRecInternals.h 75005 2018-10-23 15:17:30Z vboxsync $ */
2/** @file
3 * Video recording internals header.
4 */
5
6/*
7 * Copyright (C) 2012-2018 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 ____H_VIDEOREC_INTERNALS
19#define ____H_VIDEOREC_INTERNALS
20
21#include <iprt/types.h> /* drag in stdint.h before vpx does it. */
22#include <list>
23
24#ifdef VBOX_WITH_LIBVPX
25# define VPX_CODEC_DISABLE_COMPAT 1
26# include "vpx/vp8cx.h"
27# include "vpx/vpx_image.h"
28# include "vpx/vpx_encoder.h"
29#endif /* VBOX_WITH_LIBVPX */
30
31/**
32 * Enumeration for video recording destinations.
33 */
34typedef enum VIDEORECDEST
35{
36 /** Invalid destination, do not use. */
37 VIDEORECDEST_INVALID = 0,
38 /** Write to a file. */
39 VIDEORECDEST_FILE = 1
40} VIDEORECDEST;
41
42/**
43 * Enumeration for the video recording video codec type.
44 */
45typedef enum VIDEORECVIDEOCODECTYPE
46{
47 /** Unknown codec type, do not use. */
48 VIDEORECVIDEOCODECTYPE_UNKNOWN,
49 /** Codec is VP8. */
50 VIDEORECVIDEOCODECTYPE_VP8,
51# ifdef VBOX_WITH_LIBVPX_VP9
52 /** Codec is VP9. */
53 VIDEORECVIDEOCODECTYPE_VP9
54#endif
55} VIDEORECVIDEOCODECTYPE;
56
57/**
58 * Structure for keeping specific video recording codec data.
59 */
60typedef struct VIDEORECVIDEOCODEC
61{
62 /** Used codec type. */
63 VIDEORECVIDEOCODECTYPE enmType;
64#ifdef VBOX_WITH_LIBVPX
65 union
66 {
67 struct
68 {
69 /** VPX codec context. */
70 vpx_codec_ctx_t Ctx;
71 /** VPX codec configuration. */
72 vpx_codec_enc_cfg_t Cfg;
73 /** VPX image context. */
74 vpx_image_t RawImage;
75 /** Pointer to the codec's internal YUV buffer. */
76 uint8_t *pu8YuvBuf;
77 } VPX;
78 };
79#endif /* VBOX_WITH_LIBVPX */
80} VIDEORECVIDEOCODEC, *PVIDEORECVIDEOCODEC;
81
82/**
83 * Enumeration for supported pixel formats.
84 */
85enum VIDEORECPIXELFMT
86{
87 /** Unknown pixel format. */
88 VIDEORECPIXELFMT_UNKNOWN = 0,
89 /** RGB 24. */
90 VIDEORECPIXELFMT_RGB24 = 1,
91 /** RGB 24. */
92 VIDEORECPIXELFMT_RGB32 = 2,
93 /** RGB 565. */
94 VIDEORECPIXELFMT_RGB565 = 3,
95 /** The usual 32-bit hack. */
96 VIDEORECPIXELFMT_32BIT_HACK = 0x7fffffff
97};
98
99/**
100 * Structure for keeping a single video recording video frame.
101 */
102typedef struct VIDEORECVIDEOFRAME
103{
104 /** X resolution of this frame. */
105 uint32_t uWidth;
106 /** Y resolution of this frame. */
107 uint32_t uHeight;
108 /** Pixel format of this frame. */
109 uint32_t uPixelFormat;
110 /** RGB buffer containing the unmodified frame buffer data from Main's display. */
111 uint8_t *pu8RGBBuf;
112 /** Size (in bytes) of the RGB buffer. */
113 size_t cbRGBBuf;
114} VIDEORECVIDEOFRAME, *PVIDEORECVIDEOFRAME;
115
116#ifdef VBOX_WITH_AUDIO_VIDEOREC
117/**
118 * Structure for keeping a single video recording audio frame.
119 */
120typedef struct VIDEORECAUDIOFRAME
121{
122 /** Pointer to audio data. */
123 uint8_t *pvBuf;
124 /** Size (in bytes) of audio data. */
125 size_t cbBuf;
126} VIDEORECAUDIOFRAME, *PVIDEORECAUDIOFRAME;
127#endif
128
129/**
130 * Enumeration for specifying a video recording block type.
131 */
132typedef enum VIDEORECBLOCKTYPE
133{
134 /** Uknown block type, do not use. */
135 VIDEORECBLOCKTYPE_UNKNOWN = 0,
136 /** The block is a video frame. */
137 VIDEORECBLOCKTYPE_VIDEO,
138#ifdef VBOX_WITH_AUDIO_VIDEOREC
139 /** The block is an audio frame. */
140 VIDEORECBLOCKTYPE_AUDIO
141#endif
142} VIDEORECBLOCKTYPE;
143
144/**
145 * Generic structure for keeping a single video recording (data) block.
146 */
147typedef struct VIDEORECBLOCK
148{
149 /** The block's type. */
150 VIDEORECBLOCKTYPE enmType;
151 /** Number of references held of this block. */
152 uint16_t cRefs;
153 /** The (absolute) time stamp (in ms, PTS) of this block. */
154 uint64_t uTimeStampMs;
155 /** Opaque data block to the actual block data, depending on the block's type. */
156 void *pvData;
157 /** Size (in bytes) of the (opaque) data block. */
158 size_t cbData;
159} VIDEORECBLOCK, *PVIDEORECBLOCK;
160
161/** List for keeping video recording (data) blocks. */
162typedef std::list<PVIDEORECBLOCK> VideoRecBlockList;
163
164void VideoRecBlockFree(PVIDEORECBLOCK pBlock);
165#ifdef VBOX_WITH_AUDIO_VIDEOREC
166void VideoRecAudioFrameFree(PVIDEORECAUDIOFRAME pFrame);
167#endif
168void VideoRecVideoFrameFree(PVIDEORECVIDEOFRAME pFrame);
169
170#endif /* ____H_VIDEOREC_INTERNALS */
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette