Changeset 75251 in vbox for trunk/src/VBox/Main/include
- Timestamp:
- Nov 5, 2018 5:55:29 PM (6 years ago)
- Location:
- trunk/src/VBox/Main/include
- Files:
-
- 2 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/include/ConsoleImpl.h
r74765 r75251 24 24 #include "SecretKeyStore.h" 25 25 #include "ConsoleWrap.h" 26 #ifdef VBOX_WITH_VIDEOREC 27 # include "VideoRec.h" 28 #endif 26 29 27 30 class Guest; … … 139 142 #endif 140 143 #ifdef VBOX_WITH_AUDIO_VIDEOREC 141 AudioVideoRec *i_getAudioVideoRec() const { return mAudioVideoRec; } 142 HRESULT i_audioVideoRecSendAudio(const void *pvData, size_t cbData, uint64_t uDurationMs); 144 int i_videoRecLoad(settings::CaptureSettings &Settings); 145 int i_videoRecStart(void); 146 int i_videoRecStop(void); 147 AudioVideoRec *i_videoRecGetAudioDrv(void) const { return Capture.mAudioVideoRec; } 148 CaptureContext *i_videoRecGetContext(void) const { return Capture.mpVideoRecCtx; } 149 HRESULT i_videoRecSendAudio(const void *pvData, size_t cbData, uint64_t uDurationMs); 143 150 #endif 144 151 … … 169 176 HRESULT i_onDnDModeChange(DnDMode_T aDnDMode); 170 177 HRESULT i_onVRDEServerChange(BOOL aRestart); 171 HRESULT i_on VideoCaptureChange();178 HRESULT i_onCaptureChange(); 172 179 HRESULT i_onUSBControllerChange(); 173 180 HRESULT i_onSharedFolderChange(BOOL aGlobal); … … 939 946 VMMDev * m_pVMMDev; 940 947 AudioVRDE * const mAudioVRDE; 941 #ifdef VBOX_WITH_AUDIO_VIDEOREC942 /** The video recording audio backend. */943 AudioVideoRec * const mAudioVideoRec;944 #endif945 948 Nvram * const mNvram; 946 949 #ifdef VBOX_WITH_USB_CARDREADER … … 1028 1031 ComPtr<IEventListener> mVmListener; 1029 1032 1033 #ifdef VBOX_WITH_VIDEOREC 1034 struct Capture 1035 { 1036 Capture() 1037 : mpVideoRecCtx(NULL) 1038 , mAudioVideoRec(NULL) { } 1039 1040 /** The capturing context. */ 1041 CaptureContext *mpVideoRecCtx; 1042 # ifdef VBOX_WITH_AUDIO_VIDEOREC 1043 /** Pointer to capturing audio backend. */ 1044 AudioVideoRec * const mAudioVideoRec; 1045 # endif 1046 } Capture; 1047 #endif /* VBOX_WITH_VIDEOREC */ 1048 1030 1049 friend class VMTask; 1031 1050 friend class ConsoleVRDPServer; -
trunk/src/VBox/Main/include/DisplayImpl.h
r75072 r75251 32 32 #endif 33 33 34 #ifdef VBOX_WITH_VIDEOREC35 # include "VideoRec.h"36 struct VIDEORECCONTEXT;37 #endif38 39 34 #include "DisplaySourceBitmapWrap.h" 40 35 #include "GuestScreenInfoWrap.h" … … 184 179 uint32_t x, uint32_t y, uint32_t uPixelFormat, uint32_t uBitsPerPixel, 185 180 uint32_t uBytesPerLine, uint32_t uGuestWidth, uint32_t uGuestHeight, 186 uint8_t *pu8BufferAddress, uint64_t u64TimeStamp); 187 /** @todo r=bird: u64TimeStamp - using the 'u64' prefix add nothing. 188 * However, using one of the prefixes indicating the timestamp unit 189 * would be very valuable! */ 190 bool i_handleCrVRecScreenshotBegin(uint32_t uScreen, uint64_t u64TimeStamp); 191 void i_handleCrVRecScreenshotEnd(uint32_t uScreen, uint64_t u64TimeStamp); 181 uint8_t *pu8BufferAddress, uint64_t uTimestampMs); 182 bool i_handleCrVRecScreenshotBegin(uint32_t uScreen, uint64_t uTimestampMs); 183 void i_handleCrVRecScreenshotEnd(uint32_t uScreen, uint64_t uTimestampMs); 192 184 void i_handleVRecCompletion(); 193 185 #endif … … 209 201 210 202 #ifdef VBOX_WITH_VIDEOREC 211 PVIDEORECCFG i_videoRecGetConfig(void) { return &mVideoRecCfg; } 212 VIDEORECFEATURES i_videoRecGetFeatures(void); 213 bool i_videoRecStarted(void); 214 void i_videoRecInvalidate(); 215 int i_videoRecSendAudio(const void *pvData, size_t cbData, uint64_t uTimestampMs); 216 int i_videoRecStart(void); 217 void i_videoRecStop(void); 218 void i_videoRecScreenChanged(unsigned uScreenId); 203 int i_videoRecInvalidate(void); 204 void i_videoRecScreenChanged(unsigned uScreenId); 219 205 #endif 220 206 … … 486 472 /* Serializes access to video recording source bitmaps. */ 487 473 RTCRITSECT mVideoRecLock; 488 /** The current video recording configuration being used. */ 489 VIDEORECCFG mVideoRecCfg; 490 /** The video recording context. */ 491 VIDEORECCONTEXT *mpVideoRecCtx; 492 /** Array which defines which screens are being enabled for recording. */ 474 /** Array which defines which screens are being enabled for capturing. */ 493 475 bool maVideoRecEnabled[SchemaDefs::MaxGuestMonitors]; 494 476 #endif -
trunk/src/VBox/Main/include/DrvAudioVideoRec.h
r74955 r75251 20 20 21 21 #include <VBox/com/ptr.h> 22 #include <VBox/settings.h> 22 23 #include <VBox/vmm/pdmdrv.h> 23 24 #include <VBox/vmm/pdmifs.h> … … 44 45 public: 45 46 46 int applyConfiguration(const PVIDEORECCFG pVideoRecCfg);47 int applyConfiguration(const settings::CaptureSettings &a_Settings); 47 48 48 49 public: … … 58 59 59 60 /** Pointer to the associated video recording audio driver. */ 60 struct DRVAUDIOVIDEOREC *mpDrv;61 /** Video recording configuration used for configuring the driver. */62 struct VIDEORECCFGmVideoRecCfg;61 struct DRVAUDIOVIDEOREC *mpDrv; 62 /** Capturing configuration used for configuring the driver. */ 63 struct settings::CaptureSettings mVideoRecCfg; 63 64 }; 64 65 -
trunk/src/VBox/Main/include/MachineImpl.h
r72919 r75251 5 5 6 6 /* 7 * Copyright (C) 2006-201 7Oracle Corporation7 * Copyright (C) 2006-2018 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 32 32 #include "ParallelPortImpl.h" 33 33 #include "BIOSSettingsImpl.h" 34 #include "CaptureSettingsImpl.h" 34 35 #include "StorageControllerImpl.h" // required for MachineImpl.h to compile on Windows 35 36 #include "USBControllerImpl.h" // required for MachineImpl.h to compile on Windows … … 265 266 GraphicsControllerType_T mGraphicsControllerType; 266 267 ULONG mVRAMSize; 267 ULONG mVideoCaptureWidth; 268 ULONG mVideoCaptureHeight; 269 ULONG mVideoCaptureRate; 270 ULONG mVideoCaptureFPS; 271 ULONG mVideoCaptureMaxTime; 272 ULONG mVideoCaptureMaxFileSize; 273 Utf8Str mVideoCaptureOptions; 274 Utf8Str mVideoCaptureFile; 275 BOOL mVideoCaptureEnabled; 276 BOOL maVideoCaptureScreens[SchemaDefs::MaxGuestMonitors]; 268 settings::CaptureSettings mCaptureSettings; 277 269 ULONG mMonitorCount; 278 270 BOOL mHWVirtExEnabled; … … 484 476 IsModified_SharedFolders = 0x0400, 485 477 IsModified_Snapshots = 0x0800, 486 IsModified_BandwidthControl = 0x1000 478 IsModified_BandwidthControl = 0x1000, 479 IsModified_Capture = 0x2000 487 480 }; 488 481 … … 528 521 virtual HRESULT i_onStorageDeviceChange(IMediumAttachment * /* mediumAttachment */, BOOL /* remove */, 529 522 BOOL /* silent */) { return S_OK; } 530 virtual HRESULT i_on VideoCaptureChange() { return S_OK; }523 virtual HRESULT i_onCaptureChange() { return S_OK; } 531 524 532 525 HRESULT i_saveRegistryEntry(settings::MachineRegistryEntry &data); … … 540 533 541 534 void i_composeSavedStateFilename(Utf8Str &strStateFilePath); 542 543 void i_getDefaultVideoCaptureFile(Utf8Str &strFile);544 535 545 536 bool i_isUSBControllerPresent(); … … 783 774 const ComObjPtr<USBDeviceFilters> mUSBDeviceFilters; 784 775 const ComObjPtr<BIOSSettings> mBIOSSettings; 776 const ComObjPtr<CaptureSettings> mCaptureSettings; 785 777 const ComObjPtr<BandwidthControl> mBandwidthControl; 786 778 … … 829 821 void i_deleteConfigHandler(DeleteConfigTask &task); 830 822 823 friend class Appliance; 824 friend class CaptureSettings; 825 friend class CaptureScreenSettings; 831 826 friend class SessionMachine; 832 827 friend class SnapshotMachine; 833 friend class Appliance;834 828 friend class VirtualBox; 835 829 … … 882 876 HRESULT getMonitorCount(ULONG *aMonitorCount); 883 877 HRESULT setMonitorCount(ULONG aMonitorCount); 884 HRESULT getVideoCaptureEnabled(BOOL *aVideoCaptureEnabled);885 HRESULT setVideoCaptureEnabled(BOOL aVideoCaptureEnabled);886 HRESULT getVideoCaptureScreens(std::vector<BOOL> &aVideoCaptureScreens);887 HRESULT setVideoCaptureScreens(const std::vector<BOOL> &aVideoCaptureScreens);888 HRESULT getVideoCaptureFile(com::Utf8Str &aVideoCaptureFile);889 HRESULT setVideoCaptureFile(const com::Utf8Str &aVideoCaptureFile);890 HRESULT getVideoCaptureWidth(ULONG *aVideoCaptureWidth);891 HRESULT setVideoCaptureWidth(ULONG aVideoCaptureWidth);892 HRESULT getVideoCaptureHeight(ULONG *aVideoCaptureHeight);893 HRESULT setVideoCaptureHeight(ULONG aVideoCaptureHeight);894 HRESULT getVideoCaptureRate(ULONG *aVideoCaptureRate);895 HRESULT setVideoCaptureRate(ULONG aVideoCaptureRate);896 HRESULT getVideoCaptureFPS(ULONG *aVideoCaptureFPS);897 HRESULT setVideoCaptureFPS(ULONG aVideoCaptureFPS);898 HRESULT getVideoCaptureMaxTime(ULONG *aVideoCaptureMaxTime);899 HRESULT setVideoCaptureMaxTime(ULONG aVideoCaptureMaxTime);900 HRESULT getVideoCaptureMaxFileSize(ULONG *aVideoCaptureMaxFileSize);901 HRESULT setVideoCaptureMaxFileSize(ULONG aVideoCaptureMaxFileSize);902 HRESULT getVideoCaptureOptions(com::Utf8Str &aVideoCaptureOptions);903 HRESULT setVideoCaptureOptions(const com::Utf8Str &aVideoCaptureOptions);904 878 HRESULT getBIOSSettings(ComPtr<IBIOSSettings> &aBIOSSettings); 879 HRESULT getCaptureSettings(ComPtr<ICaptureSettings> &aCaptureSettings); 905 880 HRESULT getFirmwareType(FirmwareType_T *aFirmwareType); 906 881 HRESULT setFirmwareType(FirmwareType_T aFirmwareType); … … 1348 1323 HRESULT i_onCPUChange(ULONG aCPU, BOOL aRemove); 1349 1324 HRESULT i_onVRDEServerChange(BOOL aRestart); 1350 HRESULT i_on VideoCaptureChange();1325 HRESULT i_onCaptureChange(); 1351 1326 HRESULT i_onUSBControllerChange(); 1352 1327 HRESULT i_onUSBDeviceAttach(IUSBDevice *aDevice, -
trunk/src/VBox/Main/include/SessionImpl.h
r68986 r75251 102 102 HRESULT onCPUExecutionCapChange(ULONG aExecutionCap); 103 103 HRESULT onVRDEServerChange(BOOL aRestart); 104 HRESULT on VideoCaptureChange();104 HRESULT onCaptureChange(); 105 105 HRESULT onUSBControllerChange(); 106 106 HRESULT onSharedFolderChange(BOOL aGlobal); -
trunk/src/VBox/Main/include/VideoRec.h
r75067 r75251 23 23 #include <VBox/com/VirtualBox.h> 24 24 #include <VBox/err.h> 25 #include <VBox/settings.h> 25 26 26 27 using namespace com; … … 29 30 #include "VideoRecStream.h" 30 31 32 #if 0 31 33 /** 32 34 * Enumeration for definining a video / audio … … 54 56 55 57 /** 56 * Structure for keeping a videorecording configuration.57 */ 58 typedef struct VIDEOREC CFG58 * Structure for keeping a screen recording configuration. 59 */ 60 typedef struct VIDEORECSCREENCFG 59 61 { 60 VIDEOREC CFG(void)61 : 62 VIDEORECSCREENCFG(void) 63 : enmDst(VIDEORECDEST_INVALID) 62 64 , uMaxTimeS(0) 63 65 { … … 68 70 } 69 71 70 /** Array of all screens containing whether they're enabled 71 * for recording or not. */ 72 com::SafeArray<BOOL> aScreens; 72 VIDEORECSCREENCFG& operator=(const VIDEORECSCREENCFG &that) 73 { 74 enmDst = that.enmDst; 75 76 File.strName = that.File.strName; 77 File.uMaxSizeMB = that.File.uMaxSizeMB; 78 #ifdef VBOX_WITH_AUDIO_VIDEOREC 79 Audio = that.Audio; 80 #endif 81 Video = that.Video; 82 uMaxTimeS = that.uMaxTimeS; 83 return *this; 84 } 85 86 unsigned long uScreenId; 73 87 /** Destination where to write the stream to. */ 74 88 VIDEORECDEST enmDst; … … 135 149 136 150 } Video; 151 137 152 /** Maximum time (in s) to record. 138 153 * Specify 0 to disable this check. */ 139 154 uint32_t uMaxTimeS; 140 141 VIDEORECCFG& operator=(const VIDEORECCFG &that) 142 { 143 aScreens.resize(that.aScreens.size()); 144 for (size_t i = 0; i < that.aScreens.size(); ++i) 145 aScreens[i] = that.aScreens[i]; 146 147 enmDst = that.enmDst; 148 149 File.strName = that.File.strName; 150 File.uMaxSizeMB = that.File.uMaxSizeMB; 151 #ifdef VBOX_WITH_AUDIO_VIDEOREC 152 Audio = that.Audio; 153 #endif 154 Video = that.Video; 155 uMaxTimeS = that.uMaxTimeS; 156 return *this; 157 } 158 159 } VIDEORECCFG, *PVIDEORECCFG; 155 } VIDEORECSCREENCFG, *PVIDEORECSCREENCFG; 156 #endif 157 158 class Console; 160 159 161 160 /** 162 * Structure for keeping a video recording context.163 */ 164 typedef struct VIDEORECCONTEXT 161 * Class for managing a capturing context. 162 */ 163 class CaptureContext 165 164 { 165 public: 166 167 CaptureContext(Console *pConsole); 168 169 CaptureContext(Console *pConsole, const settings::CaptureSettings &a_Settings); 170 171 virtual ~CaptureContext(void); 172 173 public: 174 175 const settings::CaptureSettings &GetConfig(void) const; 176 CaptureStream *GetStream(unsigned uScreen) const; 177 size_t GetStreamCount(void) const; 178 179 int Create(const settings::CaptureSettings &a_Settings); 180 int Destroy(void); 181 182 int SendAudioFrame(const void *pvData, size_t cbData, uint64_t uTimestampMs); 183 int SendVideoFrame(uint32_t uScreen, 184 uint32_t x, uint32_t y, uint32_t uPixelFormat, uint32_t uBPP, 185 uint32_t uBytesPerLine, uint32_t uSrcWidth, uint32_t uSrcHeight, 186 uint8_t *puSrcData, uint64_t uTimeStampMs); 187 public: 188 189 bool IsFeatureEnabled(CaptureFeature_T enmFeature) const; 190 bool IsReady(void) const; 191 bool IsReady(uint32_t uScreen, uint64_t uTimeStampMs) const; 192 bool IsStarted(void) const; 193 bool IsLimitReached(uint32_t uScreen, uint64_t tsNowMs) const; 194 195 protected: 196 197 int createInternal(const settings::CaptureSettings &a_Settings); 198 199 int destroyInternal(void); 200 201 CaptureStream *getStreamInternal(unsigned uScreen) const; 202 203 static DECLCALLBACK(int) threadMain(RTTHREAD hThreadSelf, void *pvUser); 204 205 int threadNotify(void); 206 207 protected: 208 209 /** Pointer to the console object. */ 210 Console *pConsole; 166 211 /** Used recording configuration. */ 167 VIDEORECCFG Cfg;212 settings::CaptureSettings Settings; 168 213 /** The current state. */ 169 uint32_t enmState;214 uint32_t enmState; 170 215 /** Critical section to serialize access. */ 171 RTCRITSECT CritSect;216 RTCRITSECT CritSect; 172 217 /** Semaphore to signal the encoding worker thread. */ 173 RTSEMEVENT WaitEvent;174 /** Whether this con ext is in started state or not. */175 bool fStarted;218 RTSEMEVENT WaitEvent; 219 /** Whether this context is in started state or not. */ 220 bool fStarted; 176 221 /** Shutdown indicator. */ 177 bool fShutdown;222 bool fShutdown; 178 223 /** Worker thread. */ 179 RTTHREAD Thread;224 RTTHREAD Thread; 180 225 /** Vector of current recording streams. 181 226 * Per VM screen (display) one recording stream is being used. */ 182 VideoRecStreams vecStreams;227 VideoRecStreams vecStreams; 183 228 /** Timestamp (in ms) of when recording has been started. */ 184 uint64_t tsStartMs;229 uint64_t tsStartMs; 185 230 /** Block map of common blocks which need to get multiplexed 186 231 * to all recording streams. This common block maps should help … … 190 235 * For now this only affects audio, e.g. all recording streams 191 236 * need to have the same audio data at a specific point in time. */ 192 VideoRecBlockMap mapBlocksCommon; 193 } VIDEORECCONTEXT, *PVIDEORECCONTEXT; 194 195 int VideoRecContextCreate(uint32_t cScreens, PVIDEORECCFG pVideoRecCfg, PVIDEORECCONTEXT *ppCtx); 196 int VideoRecContextDestroy(PVIDEORECCONTEXT pCtx); 197 198 VIDEORECFEATURES VideoRecGetFeatures(PVIDEORECCFG pCfg); 199 PVIDEORECSTREAM VideoRecGetStream(PVIDEORECCONTEXT pCtx, uint32_t uScreen); 200 201 int VideoRecSendAudioFrame(PVIDEORECCONTEXT pCtx, const void *pvData, size_t cbData, uint64_t uTimestampMs); 202 int VideoRecSendVideoFrame(PVIDEORECCONTEXT pCtx, uint32_t uScreen, 203 uint32_t x, uint32_t y, uint32_t uPixelFormat, uint32_t uBPP, 204 uint32_t uBytesPerLine, uint32_t uSrcWidth, uint32_t uSrcHeight, 205 uint8_t *puSrcData, uint64_t uTimeStampMs); 206 bool VideoRecIsReady(PVIDEORECCONTEXT pCtx, uint32_t uScreen, uint64_t uTimeStampMs); 207 bool VideoRecIsStarted(PVIDEORECCONTEXT pCtx); 208 bool VideoRecIsLimitReached(PVIDEORECCONTEXT pCtx, uint32_t uScreen, uint64_t tsNowMs); 209 237 VideoRecBlockMap mapBlocksCommon; 238 }; 210 239 #endif /* !____H_VIDEOREC */ 211 240 -
trunk/src/VBox/Main/include/VideoRecInternals.h
r75005 r75251 30 30 31 31 /** 32 * Enumeration for video recording destinations.33 */34 typedef enum VIDEORECDEST35 {36 /** Invalid destination, do not use. */37 VIDEORECDEST_INVALID = 0,38 /** Write to a file. */39 VIDEORECDEST_FILE = 140 } VIDEORECDEST;41 42 /**43 * Enumeration for the video recording video codec type.44 */45 typedef enum VIDEORECVIDEOCODECTYPE46 {47 /** Unknown codec type, do not use. */48 VIDEORECVIDEOCODECTYPE_UNKNOWN,49 /** Codec is VP8. */50 VIDEORECVIDEOCODECTYPE_VP8,51 # ifdef VBOX_WITH_LIBVPX_VP952 /** Codec is VP9. */53 VIDEORECVIDEOCODECTYPE_VP954 #endif55 } VIDEORECVIDEOCODECTYPE;56 57 /**58 32 * Structure for keeping specific video recording codec data. 59 33 */ 60 34 typedef struct VIDEORECVIDEOCODEC 61 35 { 62 /** Used codec type. */63 VIDEORECVIDEOCODECTYPE enmType;64 36 #ifdef VBOX_WITH_LIBVPX 65 37 union … … 75 47 /** Pointer to the codec's internal YUV buffer. */ 76 48 uint8_t *pu8YuvBuf; 49 unsigned int uEncoderDeadline; 77 50 } VPX; 78 51 }; -
trunk/src/VBox/Main/include/VideoRecStream.h
r75067 r75251 27 27 #include <VBox/com/VirtualBox.h> 28 28 #include <VBox/err.h> 29 #include <VBox/settings.h> 29 30 30 31 #include "VideoRecInternals.h" … … 32 33 class WebMWriter; 33 34 34 struct VIDEORECCFG; 35 typedef struct VIDEORECCFG *PVIDEORECCFG; 36 37 struct VIDEORECCONTEXT; 38 typedef struct VIDEORECCONTEXT *PVIDEORECCONTEXT; 35 struct CaptureContext; 36 typedef struct CaptureContext *PVIDEORECCONTEXT; 39 37 40 38 41 39 /** Structure for queuing all blocks bound to a single timecode. 42 40 * This can happen if multiple tracks are being involved. */ 43 struct VideoRecBlocks41 struct CaptureBlocks 44 42 { 45 virtual ~ VideoRecBlocks()43 virtual ~CaptureBlocks() 46 44 { 47 45 Clear(); … … 71 69 * The key specifies a unique timecode, whereas the value 72 70 * is a list of blocks which all correlate to the same key (timecode). */ 73 typedef std::map<uint64_t, VideoRecBlocks *> VideoRecBlockMap;71 typedef std::map<uint64_t, CaptureBlocks *> VideoRecBlockMap; 74 72 75 73 /** 76 * Structure for holding a set of videorecording (data) blocks.77 */ 78 struct VideoRecBlockSet74 * Structure for holding a set of recording (data) blocks. 75 */ 76 struct CaptureBlockSet 79 77 { 80 virtual ~ VideoRecBlockSet()78 virtual ~CaptureBlockSet() 81 79 { 82 80 Clear(); … … 84 82 85 83 /** 86 * Resets a videorecording block set by removing (destroying)84 * Resets a recording block set by removing (destroying) 87 85 * all current elements. 88 86 */ 89 void Clear( )87 void Clear(void) 90 88 { 91 89 VideoRecBlockMap::iterator it = Map.begin(); … … 108 106 109 107 /** 110 * Structure for maintaining a videorecording stream.111 */ 112 typedef struct VIDEORECSTREAM 108 * Class for managing a recording stream. 109 */ 110 class CaptureStream 113 111 { 114 /** Video recording context this stream is associated to. */ 115 PVIDEORECCONTEXT pCtx; 116 /** Destination where to write the stream to. */ 117 VIDEORECDEST enmDst; 112 public: 113 114 CaptureStream(void); 115 116 CaptureStream(uint32_t a_uScreen, const settings::CaptureScreenSettings &a_Settings); 117 118 virtual ~CaptureStream(void); 119 120 public: 121 122 int Init(uint32_t a_uScreen, const settings::CaptureScreenSettings &a_Settings); 123 int Uninit(void); 124 125 int Process(VideoRecBlockMap &mapBlocksCommon); 126 int SendVideoFrame(uint32_t x, uint32_t y, uint32_t uPixelFormat, uint32_t uBPP, uint32_t uBytesPerLine, 127 uint32_t uSrcWidth, uint32_t uSrcHeight, uint8_t *puSrcData, uint64_t uTimeStampMs); 128 129 const settings::CaptureScreenSettings &GetConfig(void) const; 130 bool IsLimitReached(uint64_t tsNowMs) const; 131 bool IsReady(void) const; 132 133 protected: 134 135 int open(void); 136 int close(void); 137 138 int initInternal(uint32_t a_uScreen, const settings::CaptureScreenSettings &a_Settings); 139 int uninitInternal(void); 140 141 int initVideo(void); 142 int unitVideo(void); 143 144 int initAudio(void); 145 146 #ifdef VBOX_WITH_LIBVPX 147 int initVideoVPX(void); 148 int uninitVideoVPX(void); 149 int writeVideoVPX(uint64_t uTimeStampMs, PVIDEORECVIDEOFRAME pFrame); 150 #endif 151 void lock(void); 152 void unlock(void); 153 154 int parseOptionsString(const com::Utf8Str &strOptions); 155 156 protected: 157 158 /** Recording context this stream is associated to. */ 159 CaptureContext *pCtx; 118 160 union 119 161 { … … 123 165 RTFILE hFile; 124 166 /** File name being used for this stream. */ 125 char *pszFile;167 Utf8Str strName; 126 168 /** Pointer to WebM writer instance being used. */ 127 169 WebMWriter *pWEBM; 128 170 } File; 129 171 }; 172 bool fEnabled; 130 173 #ifdef VBOX_WITH_AUDIO_VIDEOREC 131 174 /** Track number of audio stream. */ … … 136 179 /** Screen ID. */ 137 180 uint16_t uScreenID; 138 /** Whether video recording is enabled or not. */139 bool fEnabled;140 181 /** Critical section to serialize access. */ 141 182 RTCRITSECT CritSect; 183 /** Timestamp (in ms) of when recording has been start. */ 184 uint64_t tsStartMs; 142 185 143 186 struct 144 187 { 145 /** Codec-specific data. */146 VIDEORECVIDEOCODEC Codec;147 188 /** Minimal delay (in ms) between two video frames. 148 189 * This value is based on the configured FPS rate. */ 149 190 uint32_t uDelayMs; 150 /** Target X resolution (in pixels). */151 uint32_t uWidth;152 /** Target Y resolution (in pixels). */153 uint32_t uHeight;154 191 /** Time stamp (in ms) of the last video frame we encoded. */ 155 192 uint64_t uLastTimeStampMs; 156 193 /** Number of failed attempts to encode the current video frame in a row. */ 157 194 uint16_t cFailedEncodingFrames; 195 VIDEORECVIDEOCODEC Codec; 158 196 } Video; 159 197 198 settings::CaptureScreenSettings Settings; 160 199 /** Common set of video recording (data) blocks, needed for 161 200 * multiplexing to all recording streams. */ 162 VideoRecBlockSetBlocks;163 } VIDEORECSTREAM, *PVIDEORECSTREAM;201 CaptureBlockSet Blocks; 202 }; 164 203 165 204 /** Vector of video recording streams. */ 166 typedef std::vector <PVIDEORECSTREAM> VideoRecStreams; 167 168 int VideoRecStreamClose(PVIDEORECSTREAM pStream); 169 int VideoRecStreamOpen(PVIDEORECSTREAM pStream, PVIDEORECCFG pCfg); 170 int VideoRecStreamProcess(PVIDEORECSTREAM pStream); 171 int VideoRecStreamInit(PVIDEORECSTREAM pStream, PVIDEORECCONTEXT pCtx, uint32_t uScreen); 172 int VideoRecStreamUninit(PVIDEORECSTREAM pStream); 173 int VideoRecStreamUnitVideo(PVIDEORECSTREAM pStream); 174 int VideoRecStreamInitVideo(PVIDEORECSTREAM pStream, PVIDEORECCFG pCfg); 175 #ifdef VBOX_WITH_LIBVPX 176 int VideoRecStreamInitVideoVPX(PVIDEORECSTREAM pStream, PVIDEORECCFG pCfg); 177 int VideoRecStreamUninitVideoVPX(PVIDEORECSTREAM pStream); 178 int VideoRecStreamWriteVideoVPX(PVIDEORECSTREAM pStream, uint64_t uTimeStampMs, PVIDEORECVIDEOFRAME pFrame); 179 #endif 180 void VideoRecStreamLock(PVIDEORECSTREAM pStream); 181 void VideoRecStreamUnlock(PVIDEORECSTREAM pStream); 205 typedef std::vector <CaptureStream *> VideoRecStreams; 182 206 183 207 #endif /* ____H_VIDEOREC_STREAM */
Note:
See TracChangeset
for help on using the changeset viewer.