Changeset 65263 in vbox
- Timestamp:
- Jan 12, 2017 3:25:30 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Config.kmk
r65229 r65263 651 651 # Enable this to build vbox-img even if VBOX_WITH_TESTCASES is disabled 652 652 VBOX_WITH_VBOX_IMG = 653 # Enables the VPX module for VM video capturing654 653 if1of ($(KBUILD_TARGET).$(KBUILD_TARGET_ARCH), darwin.x86 darwin.amd64 linux.x86 linux.amd64 solaris.amd64 win.x86 win.amd64) 655 VBOX_WITH_VPX = 1 654 # Enables the video capturing support. 655 VBOX_WITH_VIDEOREC = 1 656 656 # Enables audio support for VM video capturing. Not enabled by default yet. 657 657 VBOX_WITH_AUDIO_VIDEOREC = … … 679 679 # Enable cURL (required for the network part of the GUI) 680 680 VBOX_WITH_LIBCURL = 1 681 # Enable VPX (VP8 / VP9 codec), used for video capturing. 682 VBOX_WITH_LIBVPX = 1 681 683 # Enable Host=>Guest Drag'n'Drop 682 684 if1of ($(KBUILD_TARGET), darwin linux solaris win) … … 1148 1150 endif 1149 1151 if1of ($(KBUILD_TARGET), win) 1150 VBOX_WITH_ VPX=1152 VBOX_WITH_LIBVPX= 1151 1153 endif 1152 1154 VBOX_GUI_WITH_HIDPI= … … 3707 3709 endif 3708 3710 3709 SDK_VBOX_VPX = . 3710 SDK_VBOX_VPX_DEFAULT_INCS := $(PATH_ROOT)/src/libs/libvpx 3711 SDK_VBOX_VPX_INCS ?= $(SDK_VBOX_VPX_DEFAULT_INCS) 3712 SDK_VBOX_VPX_LIBS ?= $(PATH_STAGE_LIB)/VBox-libvpx$(VBOX_SUFF_LIB) 3711 ifdef VBOX_WITH_LIBVPX 3712 SDK_VBOX_VPX = . 3713 SDK_VBOX_VPX_DEFAULT_INCS := $(PATH_ROOT)/src/libs/libvpx 3714 SDK_VBOX_VPX_INCS ?= $(SDK_VBOX_VPX_DEFAULT_INCS) 3715 SDK_VBOX_VPX_LIBS ?= $(PATH_STAGE_LIB)/VBox-libvpx$(VBOX_SUFF_LIB) 3716 endif 3713 3717 3714 3718 ifdef VBOX_WITH_LIBOPUS 3715 SDK_VBOX_OPUS = .3716 SDK_VBOX_OPUS_INCS ?= $(PATH_ROOT)/src/libs/libopus-1.1.3/include3717 SDK_VBOX_OPUS_LIBS ?= $(PATH_STAGE_LIB)/VBox-libopus$(VBOX_SUFF_LIB)3719 SDK_VBOX_OPUS = . 3720 SDK_VBOX_OPUS_INCS ?= $(PATH_ROOT)/src/libs/libopus-1.1.3/include 3721 SDK_VBOX_OPUS_LIBS ?= $(PATH_STAGE_LIB)/VBox-libopus$(VBOX_SUFF_LIB) 3718 3722 endif 3719 3723 -
trunk/src/VBox/Frontends/VBoxHeadless/Makefile.kmk
r62493 r65263 5 5 6 6 # 7 # Copyright (C) 2006-201 6Oracle Corporation7 # Copyright (C) 2006-2017 Oracle Corporation 8 8 # 9 9 # This file is part of VirtualBox Open Source Edition (OSE), as … … 45 45 # 46 46 VBoxHeadless_TEMPLATE := $(if $(VBOX_WITH_HARDENING),VBOXMAINCLIENTDLL,VBOXMAINCLIENTEXE) 47 VBoxHeadless_DEFS += $(if $(VBOX_WITH_V PX),VBOX_WITH_VPX,)47 VBoxHeadless_DEFS += $(if $(VBOX_WITH_VIDEOREC),VBOX_WITH_VIDEOREC,) 48 48 VBoxHeadless_SOURCES = VBoxHeadless.cpp 49 49 ifdef VBOX_WITH_GUEST_PROPS -
trunk/src/VBox/Frontends/VBoxHeadless/VBoxHeadless.cpp
r64184 r65263 5 5 6 6 /* 7 * Copyright (C) 2006-201 6Oracle Corporation7 * Copyright (C) 2006-2017 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 44 44 #include <VBox/VBoxVideo.h> 45 45 46 #ifdef VBOX_WITH_V PX46 #ifdef VBOX_WITH_VIDEOREC 47 47 # include <cstdlib> 48 48 # include <cerrno> … … 464 464 " settings password\n" 465 465 " -start-paused, --start-paused Start the VM in paused state\n" 466 #ifdef VBOX_WITH_V PX466 #ifdef VBOX_WITH_VIDEOREC 467 467 " -c, -capture, --capture Record the VM screen output to a file\n" 468 468 " -w, --width Frame width when recording\n" … … 475 475 } 476 476 477 #ifdef VBOX_WITH_V PX477 #ifdef VBOX_WITH_VIDEOREC 478 478 /** 479 479 * Parse the environment for variables which can influence the VIDEOREC settings. … … 524 524 *ppszFileName = pszEnvTemp; 525 525 } 526 #endif /* VBOX_WITH_V PXdefined */526 #endif /* VBOX_WITH_VIDEOREC defined */ 527 527 528 528 static RTEXITCODE readPasswordFile(const char *pszFilename, com::Utf8Str *pPasswd) … … 626 626 unsigned fCSAM = ~0U; 627 627 unsigned fPaused = 0; 628 #ifdef VBOX_WITH_V PX628 #ifdef VBOX_WITH_VIDEOREC 629 629 bool fVideoRec = 0; 630 630 unsigned long ulFrameWidth = 800; … … 633 633 char szMpegFile[RTPATH_MAX]; 634 634 const char *pszFileNameParam = "VBox-%d.vob"; 635 #endif /* VBOX_WITH_V PX*/635 #endif /* VBOX_WITH_VIDEOREC */ 636 636 #ifdef RT_OS_WINDOWS 637 637 ATL::CComModule _Module; /* Required internally by ATL (constructor records instance in global variable). */ … … 643 643 "All rights reserved.\n\n"); 644 644 645 #ifdef VBOX_WITH_V PX645 #ifdef VBOX_WITH_VIDEOREC 646 646 /* Parse the environment */ 647 647 parse_environ(&ulFrameWidth, &ulFrameHeight, &ulBitRate, &pszFileNameParam); … … 696 696 { "--settingspw", OPT_SETTINGSPW, RTGETOPT_REQ_STRING }, 697 697 { "--settingspwfile", OPT_SETTINGSPW_FILE, RTGETOPT_REQ_STRING }, 698 #ifdef VBOX_WITH_V PX698 #ifdef VBOX_WITH_VIDEOREC 699 699 { "-capture", 'c', 0 }, 700 700 { "--capture", 'c', 0 }, … … 703 703 { "--bitrate", 'r', RTGETOPT_REQ_UINT32 }, 704 704 { "--filename", 'f', RTGETOPT_REQ_STRING }, 705 #endif /* VBOX_WITH_V PXdefined */705 #endif /* VBOX_WITH_VIDEOREC defined */ 706 706 { "-comment", OPT_COMMENT, RTGETOPT_REQ_STRING }, 707 707 { "--comment", OPT_COMMENT, RTGETOPT_REQ_STRING }, … … 780 780 fPaused = true; 781 781 break; 782 #ifdef VBOX_WITH_V PX782 #ifdef VBOX_WITH_VIDEOREC 783 783 case 'c': 784 784 fVideoRec = true; … … 793 793 pszFileNameParam = ValueUnion.psz; 794 794 break; 795 #endif /* VBOX_WITH_V PXdefined */795 #endif /* VBOX_WITH_VIDEOREC defined */ 796 796 case 'h': 797 #ifdef VBOX_WITH_V PX797 #ifdef VBOX_WITH_VIDEOREC 798 798 if ((GetState.pDef->fFlags & RTGETOPT_REQ_MASK) != RTGETOPT_REQ_NOTHING) 799 799 { … … 817 817 } 818 818 819 #ifdef VBOX_WITH_V PX819 #ifdef VBOX_WITH_VIDEOREC 820 820 if (ulFrameWidth < 512 || ulFrameWidth > 2048 || ulFrameWidth % 2) 821 821 { … … 847 847 } 848 848 RTStrPrintf(&szMpegFile[0], RTPATH_MAX, pszFileNameParam, RTProcSelf()); 849 #endif /* defined VBOX_WITH_V PX*/849 #endif /* defined VBOX_WITH_VIDEOREC */ 850 850 851 851 if (!pcszNameOrUUID) … … 958 958 CHECK_ERROR_BREAK(console, COMGETTER(Display)(display.asOutParam())); 959 959 960 #ifdef VBOX_WITH_V PX960 #ifdef VBOX_WITH_VIDEOREC 961 961 if (fVideoRec) 962 962 { … … 967 967 CHECK_ERROR_BREAK(machine, COMSETTER(VideoCaptureEnabled)(TRUE)); 968 968 } 969 #endif /* defined(VBOX_WITH_V PX) */969 #endif /* defined(VBOX_WITH_VIDEOREC) */ 970 970 971 971 /* get the machine debugger (isn't necessarily available) */ … … 1216 1216 Log(("VBoxHeadless: event loop has terminated...\n")); 1217 1217 1218 #ifdef VBOX_WITH_V PX1218 #ifdef VBOX_WITH_VIDEOREC 1219 1219 if (fVideoRec) 1220 1220 { … … 1222 1222 machine->COMSETTER(VideoCaptureEnabled)(FALSE); 1223 1223 } 1224 #endif /* defined(VBOX_WITH_V PX) */1224 #endif /* defined(VBOX_WITH_VIDEOREC) */ 1225 1225 1226 1226 /* we don't have to disable VRDE here because we don't save the settings of the VM */ -
trunk/src/VBox/Frontends/VBoxManage/Makefile.kmk
r62585 r65263 5 5 6 6 # 7 # Copyright (C) 2006-201 6Oracle Corporation7 # Copyright (C) 2006-2017 Oracle Corporation 8 8 # 9 9 # This file is part of VirtualBox Open Source Edition (OSE), as … … 38 38 $(if $(VBOX_WITH_USB_CARDREADER),VBOX_WITH_USB_CARDREADER) \ 39 39 $(if $(VBOX_WITH_PCI_PASSTHROUGH),VBOX_WITH_PCI_PASSTHROUGH) \ 40 $(if $(VBOX_WITH_V PX),VBOX_WITH_VPX) \40 $(if $(VBOX_WITH_VIDEOREC),VBOX_WITH_VIDEOREC) \ 41 41 $(if $(VBOX_WITH_NAT_SERVICE),VBOX_WITH_NAT_SERVICE) \ 42 42 $(if $(VBOX_WITH_VMSVGA),VBOX_WITH_VMSVGA) -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageControlVM.cpp
r64907 r65263 5 5 6 6 /* 7 * Copyright (C) 2006-201 6Oracle Corporation7 * Copyright (C) 2006-2017 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 1706 1706 RTFileClose(pngFile); 1707 1707 } 1708 #ifdef VBOX_WITH_V PX1708 #ifdef VBOX_WITH_VIDEOREC 1709 1709 /* 1710 1710 * Note: Commands starting with "vcp" are the deprecated versions and are … … 1940 1940 CHECK_ERROR_BREAK(sessionMachine, COMSETTER(VideoCaptureOptions)(Bstr(a->argv[3]).raw())); 1941 1941 } 1942 #endif /* VBOX_WITH_V PX*/1942 #endif /* VBOX_WITH_VIDEOREC */ 1943 1943 else if (!strcmp(a->argv[1], "webcam")) 1944 1944 { -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp
r64997 r65263 5 5 6 6 /* 7 * Copyright (C) 2006-201 6Oracle Corporation7 * Copyright (C) 2006-2017 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 885 885 " acpishutdown]\n" 886 886 #endif 887 #ifdef VBOX_WITH_V PX887 #ifdef VBOX_WITH_VIDEOREC 888 888 " [--videocap on|off]\n" 889 889 " [--videocapscreens all|<screen ID> [<screen ID> ...]]\n" -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp
r65181 r65263 203 203 MODIFYVM_USBCARDREADER, 204 204 #endif 205 #ifdef VBOX_WITH_V PX205 #ifdef VBOX_WITH_VIDEOREC 206 206 MODIFYVM_VIDEOCAP, 207 207 MODIFYVM_VIDEOCAP_SCREENS, … … 372 372 { "--faulttolerancesyncinterval", MODIFYVM_FAULT_TOLERANCE_SYNC_INTERVAL, RTGETOPT_REQ_UINT32 }, 373 373 { "--chipset", MODIFYVM_CHIPSET, RTGETOPT_REQ_STRING }, 374 #ifdef VBOX_WITH_V PX374 #ifdef VBOX_WITH_VIDEOREC 375 375 { "--videocap", MODIFYVM_VIDEOCAP, RTGETOPT_REQ_BOOL_ONOFF }, 376 376 { "--vcpenabled", MODIFYVM_VIDEOCAP, RTGETOPT_REQ_BOOL_ONOFF }, /* deprecated */ … … 451 451 } 452 452 453 #ifdef VBOX_WITH_VIDEOREC 453 454 static int parseScreens(const char *pcszScreens, com::SafeArray<BOOL> *pScreens) 454 455 { … … 474 475 return 0; 475 476 } 477 #endif 476 478 477 479 static int parseNum(uint32_t uIndex, unsigned cMaxIndex, const char *pszName) … … 2849 2851 break; 2850 2852 } 2851 #ifdef VBOX_WITH_V PX2853 #ifdef VBOX_WITH_VIDEOREC 2852 2854 case MODIFYVM_VIDEOCAP: 2853 2855 { -
trunk/src/VBox/Main/Makefile.kmk
r65184 r65263 289 289 $(if $(VBOX_WITH_AUDIO_VALIDATIONKIT),VBOX_WITH_AUDIO_VALIDATIONKIT,) \ 290 290 $(if $(VBOX_WITH_AUDIO_VIDEOREC),VBOX_WITH_AUDIO_VIDEOREC,) \ 291 $(if $(VBOX_WITH_VRDE_AUDIO),VBOX_WITH_VRDE_AUDIO,) \ 291 $(if $(VBOX_WITH_VIDEOREC),VBOX_WITH_VIDEOREC,) \ 292 $(if $(VBOX_WITH_VRDE_AUDIO),VBOX_WITH_VRDE_AUDIO,) \ 292 293 $(if $(VBOX_WITH_E1000),VBOX_WITH_E1000,) \ 293 294 $(if $(VBOX_WITH_VIRTIO),VBOX_WITH_VIRTIO,) \ … … 671 672 $(if $(VBOX_WITH_AUDIO_VALIDATIONKIT),VBOX_WITH_AUDIO_VALIDATIONKIT,) \ 672 673 $(if $(VBOX_WITH_AUDIO_VIDEOREC),VBOX_WITH_AUDIO_VIDEOREC,) \ 674 $(if $(VBOX_WITH_VIDEOREC),VBOX_WITH_VIDEOREC,) \ 673 675 $(if $(VBOX_WITH_VRDE_AUDIO),VBOX_WITH_VRDE_AUDIO,) \ 674 676 $(if $(VBOX_WITH_E1000),VBOX_WITH_E1000,) \ … … 686 688 $(if $(VBOX_WITH_EXTPACK),VBOX_WITH_EXTPACK,) \ 687 689 $(if $(VBOX_WITH_PCI_PASSTHROUGH),VBOX_WITH_PCI_PASSTHROUGH,) \ 688 $(if $(VBOX_WITH_VRDEAUTH_IN_VBOXSVC),VBOX_WITH_VRDEAUTH_IN_VBOXSVC,) \ 689 $(if $(VBOX_WITH_VPX),VBOX_WITH_VPX,) 690 $(if $(VBOX_WITH_VRDEAUTH_IN_VBOXSVC),VBOX_WITH_VRDEAUTH_IN_VBOXSVC,) 690 691 ifdef VBOX_WITH_CRHGSMI 691 692 VBoxC_DEFS += VBOX_WITH_CRHGSMI … … 703 704 704 705 VBoxC_SDKS = VBOX_LIBPNG VBOX_ZLIB 705 ifdef VBOX_WITH_VPX 706 VBoxC_SDKS += VBOX_VPX 707 endif 706 707 ifdef VBOX_WITH_VIDEOREC 708 ifdef VBOX_WITH_LIBVPX 709 VBoxC_SDKS += VBOX_VPX 710 VBoxC_DEFS += VBOX_WITH_LIBVPX 711 else 712 $(error "VBox: No alternative for VPX when using video capturing support yet") 713 endif 714 endif 715 708 716 ifdef VBOX_WITH_AUDIO_VIDEOREC 709 717 ifdef VBOX_WITH_LIBOPUS 710 718 VBoxC_SDKS += VBOX_OPUS 719 VBoxC_DEFS += VBOX_WITH_LIBOPUS 711 720 else 712 721 $(error "VBox: No alternative for Opus when using audio support for video capturing yet") 713 722 endif 714 723 endif 724 715 725 ifdef VBOX_WITH_OPENSSL_FIPS 716 726 VBoxC_SDKS += VBOX_OPENSSL2 … … 802 812 src-client/DisplayImplLegacy.cpp \ 803 813 src-client/DisplaySourceBitmapImpl.cpp \ 814 src-client/EbmlWriter.cpp \ 804 815 src-client/EmulatedUSBImpl.cpp \ 805 816 src-client/GuestImpl.cpp \ … … 812 823 src-client/USBDeviceImpl.cpp \ 813 824 src-client/VBoxDriversRegister.cpp \ 825 src-client/VideoRec.cpp \ 814 826 src-client/VirtualBoxClientImpl.cpp \ 815 827 src-client/VMMDevInterface.cpp \ … … 857 869 VBoxC_SOURCES += \ 858 870 src-client/RemoteUSBBackend.cpp 859 endif860 ifdef VBOX_WITH_VPX861 VBoxC_SOURCES += \862 src-client/EbmlWriter.cpp \863 src-client/VideoRec.cpp864 871 endif 865 872 ifndef VBOX_WITH_VRDEAUTH_IN_VBOXSVC -
trunk/src/VBox/Main/include/DisplayImpl.h
r63606 r65263 96 96 #endif /* VBOX_WITH_CROGL */ 97 97 98 #ifdef VBOX_WITH_V PX98 #ifdef VBOX_WITH_VIDEOREC 99 99 struct 100 100 { 101 101 ComPtr<IDisplaySourceBitmap> pSourceBitmap; 102 102 } videoCapture; 103 #endif 103 #endif /* VBOX_WITH_VIDEOREC */ 104 104 } DISPLAYFBINFO; 105 105 … … 205 205 void i_VideoCaptureStop(); 206 206 int i_VideoCaptureEnableScreens(ComSafeArrayIn(BOOL, aScreens)); 207 #ifdef VBOX_WITH_V PX207 #ifdef VBOX_WITH_VIDEOREC 208 208 void videoCaptureScreenChanged(unsigned uScreenId); 209 209 #endif … … 462 462 /* Serializes access to mVideoAccelLegacy and mfVideoAccelVRDP, etc between VRDP and Display. */ 463 463 RTCRITSECT mVideoAccelLock; 464 #ifdef VBOX_WITH_V PX464 #ifdef VBOX_WITH_VIDEOREC 465 465 /* Serializes access to video capture source bitmaps. */ 466 466 RTCRITSECT mVideoCaptureLock; … … 503 503 #endif 504 504 505 #ifdef VBOX_WITH_V PX505 #ifdef VBOX_WITH_VIDEOREC 506 506 VIDEORECCONTEXT *mpVideoRecCtx; 507 507 bool maVideoRecEnabled[SchemaDefs::MaxGuestMonitors]; -
trunk/src/VBox/Main/src-client/DisplayImpl.cpp
r65173 r65263 5 5 6 6 /* 7 * Copyright (C) 2006-201 6Oracle Corporation7 * Copyright (C) 2006-2017 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 51 51 #include <VBox/com/array.h> 52 52 53 #ifdef VBOX_WITH_V PX53 #ifdef VBOX_WITH_VIDEOREC 54 54 # include <iprt/path.h> 55 55 # include "VideoRec.h" … … 131 131 mfHostCursorCapabilities = 0; 132 132 #endif 133 #ifdef VBOX_WITH_V PX133 #ifdef VBOX_WITH_VIDEOREC 134 134 rc = RTCritSectInit(&mVideoCaptureLock); 135 135 AssertRC(rc); … … 163 163 uninit(); 164 164 165 #ifdef VBOX_WITH_V PX165 #ifdef VBOX_WITH_VIDEOREC 166 166 if (RTCritSectIsInitialized(&mVideoCaptureLock)) 167 167 { … … 714 714 maFramebuffers[uScreenId].updateImage.cbLine = 0; 715 715 maFramebuffers[uScreenId].pFramebuffer.setNull(); 716 #ifdef VBOX_WITH_V PX716 #ifdef VBOX_WITH_VIDEOREC 717 717 maFramebuffers[uScreenId].videoCapture.pSourceBitmap.setNull(); 718 718 #endif … … 988 988 i_handleSetVisibleRegion(mcRectVisibleRegion, mpRectVisibleRegion); 989 989 990 #ifdef VBOX_WITH_V PX990 #ifdef VBOX_WITH_VIDEOREC 991 991 videoCaptureScreenChanged(uScreenId); 992 992 #endif … … 2266 2266 int Display::i_VideoCaptureEnableScreens(ComSafeArrayIn(BOOL, aScreens)) 2267 2267 { 2268 #ifdef VBOX_WITH_V PX2268 #ifdef VBOX_WITH_VIDEOREC 2269 2269 com::SafeArray<BOOL> Screens(ComSafeArrayInArg(aScreens)); 2270 2270 for (unsigned i = 0; i < Screens.size(); i++) … … 2280 2280 return VINF_SUCCESS; 2281 2281 #else 2282 return VERR_NOT_IMPLEMENTED; 2282 ComSafeArrayNoRef(aScreens); 2283 return VERR_NOT_SUPPORTED; 2283 2284 #endif 2284 2285 } … … 2289 2290 int Display::i_VideoCaptureStart() 2290 2291 { 2291 #ifdef VBOX_WITH_V PX2292 #ifdef VBOX_WITH_VIDEOREC 2292 2293 if (VideoRecIsEnabled(mpVideoRecCtx)) 2293 2294 return VINF_SUCCESS; … … 2348 2349 if (RT_SUCCESS(rc)) 2349 2350 { 2351 #ifndef DEUBG_andy 2350 2352 if (mcMonitors > 1) 2351 2353 rc = RTStrAPrintf(&pszName, "%s-%u%s", pszAbsPath, uScreen+1, pszSuff); 2352 2354 else 2353 2355 rc = RTStrAPrintf(&pszName, "%s%s", pszAbsPath, pszSuff); 2356 #else 2357 if (mcMonitors > 1) 2358 rc = RTStrAPrintf(&pszName, "/tmp/avcap-%u.webm", uScreen+1); 2359 else 2360 rc = RTStrAPrintf(&pszName, "/tmp/avcap.webm"); 2361 #endif 2354 2362 } 2355 2363 if (RT_SUCCESS(rc)) … … 2396 2404 } 2397 2405 return rc; 2398 #else 2399 return VERR_NOT_ IMPLEMENTED;2406 #else /* VBOX_WITH_VIDEOREC */ 2407 return VERR_NOT_SUPPORTED; 2400 2408 #endif 2401 2409 } … … 2406 2414 void Display::i_VideoCaptureStop() 2407 2415 { 2408 #ifdef VBOX_WITH_V PX2416 #ifdef VBOX_WITH_VIDEOREC 2409 2417 if (VideoRecIsEnabled(mpVideoRecCtx)) 2410 2418 LogRel(("Display::VideoCaptureStop: WebM/VP8 video recording stopped\n")); … … 2418 2426 } 2419 2427 2420 #ifdef VBOX_WITH_V PX2428 #ifdef VBOX_WITH_VIDEOREC 2421 2429 void Display::videoCaptureScreenChanged(unsigned uScreenId) 2422 2430 { … … 2436 2444 } 2437 2445 } 2438 #endif 2446 #endif /* VBOX_WITH_VIDEOREC */ 2439 2447 2440 2448 int Display::i_drawToScreenEMT(Display *pDisplay, ULONG aScreenId, BYTE *address, … … 3133 3141 } 3134 3142 3135 #ifdef VBOX_WITH_V PX3143 #ifdef VBOX_WITH_VIDEOREC 3136 3144 if (VideoRecIsEnabled(pDisplay->mpVideoRecCtx)) 3137 3145 { … … 3229 3237 } while (0); 3230 3238 } 3231 #endif /* VBOX_WITH_V PX*/3239 #endif /* VBOX_WITH_VIDEOREC */ 3232 3240 3233 3241 #ifdef DEBUG_sunlover_2 … … 3578 3586 * However, using one of the prefixes indicating the timestamp unit 3579 3587 * would be very valuable! */ 3580 # if VBOX_WITH_V PX3588 # if VBOX_WITH_VIDEOREC 3581 3589 return VideoRecIsReady(mpVideoRecCtx, uScreen, u64Timestamp); 3582 3590 # else … … 3598 3606 { 3599 3607 Assert(mfCrOglVideoRecState == CRVREC_STATE_SUBMITTED); 3600 # if VBOX_WITH_V PX3608 # if VBOX_WITH_VIDEOREC 3601 3609 int rc = VideoRecCopyToIntBuf(mpVideoRecCtx, uScreen, x, y, 3602 3610 uPixelFormat, … … 3606 3614 NOREF(rc); 3607 3615 Assert(rc == VINF_SUCCESS /* || rc == VERR_TRY_AGAIN || rc == VINF_TRY_AGAIN*/); 3608 # endif 3616 # else 3617 RT_NOREF(uScreen, x, y, uPixelFormat, \ 3618 uBitsPerPixel, uBytesPerLine, uGuestWidth, uGuestHeight, pu8BufferAddress, u64Timestamp); 3619 # endif /* VBOX_WITH_VIDEOREC */ 3609 3620 } 3610 3621 … … 4278 4289 { 4279 4290 AutoWriteLock displayLock(pThis->pDisplay COMMA_LOCKVAL_SRC_POS); 4280 #ifdef VBOX_WITH_V PX4291 #ifdef VBOX_WITH_VIDEOREC 4281 4292 pThis->pDisplay->i_VideoCaptureStop(); 4282 4293 #endif … … 4389 4400 #endif 4390 4401 4391 #ifdef VBOX_WITH_V PX4402 #ifdef VBOX_WITH_VIDEOREC 4392 4403 ComPtr<IMachine> pMachine = pDisplay->mParent->i_machine(); 4393 4404 BOOL fEnabled = false; 4394 4405 HRESULT hrc = pMachine->COMGETTER(VideoCaptureEnabled)(&fEnabled); 4395 4406 AssertComRCReturn(hrc, VERR_COM_UNEXPECTED); 4396 4397 #ifdef DEBUG_andy4398 fEnabled = true;4399 #endif4400 4407 4401 4408 if (fEnabled) -
trunk/src/VBox/Main/src-client/DrvAudioVideoRec.cpp
r65256 r65263 39 39 #include <VBox/err.h> 40 40 41 #include <opus.h> 42 41 #ifdef VBOX_WITH_LIBOPUS 42 # include <opus.h> 43 #endif 43 44 44 45 /********************************************************************************************************************************* … … 70 71 union 71 72 { 73 #ifdef VBOX_WITH_LIBOPUS 72 74 struct 73 75 { … … 75 77 OpusEncoder *pEnc; 76 78 } Opus; 79 #endif /* VBOX_WITH_LIBOPUS */ 77 80 }; 78 81 } AVRECCODEC, *PAVRECCODEC; … … 135 138 PAVRECSTREAMOUT pStreamOut = (PAVRECSTREAMOUT)pStream; 136 139 137 int rc = DrvAudioHlpStreamCfgToProps(pCfgReq, &pStreamOut->Props); 140 int rc; 141 142 #ifdef VBOX_WITH_LIBOPUS 143 rc = DrvAudioHlpStreamCfgToProps(pCfgReq, &pStreamOut->Props); 138 144 if (RT_SUCCESS(rc)) 139 145 { … … 177 183 } 178 184 } 179 180 LogFlowFuncLeaveRC(VINF_SUCCESS); 181 return VINF_SUCCESS; 185 #else 186 rc = VERR_NOT_SUPPORTED; 187 #endif /* VBOX_WITH_LIBOPUS */ 188 189 LogFlowFuncLeaveRC(rc); 190 return rc; 182 191 } 183 192 … … 310 319 pStreamOut->Props.cBits, pStreamOut->Props.fSigned, cSamplesToSend)); 311 320 321 uint32_t csRead = 0; 322 323 int rc; 324 312 325 /* 313 326 * Call the encoder with the data. 314 327 */ 328 #ifdef VBOX_WITH_LIBOPUS 315 329 316 330 /** @todo For now we ASSUME 25 FPS. */ … … 318 332 size_t cbFrameSize = AUDIOMIXBUF_S2B(&pStream->MixBuf, csFrameSize); 319 333 320 uint32_t csRead = 0; 321 int rc = AudioMixBufReadCirc(&pStream->MixBuf, (uint8_t *)&pStreamOut->pvFrameBuf[pStreamOut->offFrameBufWrite], 322 pStreamOut->cbFrameBufSize - pStreamOut->offFrameBufWrite, &csRead); 334 rc = AudioMixBufReadCirc(&pStream->MixBuf, (uint8_t *)&pStreamOut->pvFrameBuf[pStreamOut->offFrameBufWrite], 335 pStreamOut->cbFrameBufSize - pStreamOut->offFrameBufWrite, &csRead); 323 336 if (RT_SUCCESS(rc)) 324 337 { … … 356 369 } 357 370 } 371 #else 372 rc = VERR_NOT_SUPPORTED; 373 #endif /* VBOX_WITH_LIBOPUS */ 358 374 359 375 if (csRead) … … 385 401 } 386 402 403 #ifdef VBOX_WITH_LIBOPUS 387 404 if (pStreamOut->Codec.Opus.pEnc) 388 405 { … … 390 407 pStreamOut->Codec.Opus.pEnc = NULL; 391 408 } 409 #endif 392 410 393 411 return VINF_SUCCESS; -
trunk/src/VBox/Main/src-client/EbmlWriter.cpp
r65261 r65263 309 309 }; 310 310 311 #ifdef VBOX_WITH_ AUDIO_VIDEOREC311 #ifdef VBOX_WITH_LIBOPUS 312 312 # pragma pack(push) 313 313 # pragma pack(1) … … 325 325 }; 326 326 # pragma pack(pop) 327 #endif /* VBOX_WITH_ AUDIO_VIDEOREC*/327 #endif /* VBOX_WITH_LIBOPUS */ 328 328 329 329 /** Audio codec to use. */ … … 387 387 int AddAudioTrack(float fSamplingHz, float fOutputHz, uint8_t cChannels, uint8_t cBitDepth) 388 388 { 389 #ifdef VBOX_WITH_ AUDIO_VIDEOREC389 #ifdef VBOX_WITH_LIBOPUS 390 390 m_Ebml.subStart(TrackEntry); 391 391 m_Ebml.serializeUnsignedInteger(TrackNumber, (uint8_t)m_lstTracks.size()); … … 557 557 } 558 558 559 #ifdef VBOX_WITH_ AUDIO_VIDEOREC559 #ifdef VBOX_WITH_LIBOPUS 560 560 /* Audio blocks that have same absolute timecode as video blocks SHOULD be written before the video blocks. */ 561 561 int writeBlockOpus(const void *pvData, size_t cbData) … … 563 563 static uint16_t s_uTimecode = 0; 564 564 565 return writeSimpleBlockInternal( 1/** @todo FIX! */, s_uTimecode++, pvData, cbData, 0 /* Flags */);565 return writeSimpleBlockInternal(0 /** @todo FIX! */, s_uTimecode++, pvData, cbData, 0 /* Flags */); 566 566 } 567 567 #endif … … 581 581 switch (blockType) 582 582 { 583 #ifdef VBOX_WITH_AUDIO_VIDEOREC 583 584 584 case WebMWriter::BlockType_Audio: 585 585 { 586 #ifdef VBOX_WITH_LIBOPUS 586 587 if (m_enmAudioCodec == WebMWriter::AudioCodec_Opus) 587 588 { … … 591 592 } 592 593 else 594 #endif /* VBOX_WITH_LIBOPUS */ 593 595 rc = VERR_NOT_SUPPORTED; 594 596 break; 595 597 } 596 #endif 598 597 599 case WebMWriter::BlockType_Video: 598 600 { -
trunk/src/VBox/Main/src-client/VideoRec.cpp
r65260 r65263 1 1 /* $Id$ */ 2 2 /** @file 3 * Encodes the screen content in VPX format.3 * Video capturing utility routines. 4 4 */ 5 5 … … 34 34 #include "VideoRec.h" 35 35 36 #define VPX_CODEC_DISABLE_COMPAT 1 37 #include <vpx/vp8cx.h> 38 #include <vpx/vpx_image.h> 36 #ifdef VBOX_WITH_LIBVPX 37 # define VPX_CODEC_DISABLE_COMPAT 1 38 # include <vpx/vp8cx.h> 39 # include <vpx/vpx_image.h> 39 40 40 41 /** Default VPX codec to use. */ 41 #define DEFAULTCODEC (vpx_codec_vp8_cx()) 42 # define DEFAULTCODEC (vpx_codec_vp8_cx()) 43 #endif /* VBOX_WITH_LIBVPX */ 42 44 43 45 static int videoRecEncodeAndWrite(PVIDEORECSTREAM pStrm); … … 49 51 * Enumeration for a video recording state. 50 52 */ 51 enum 53 enum VIDEORECSTS 52 54 { 53 55 /** Not initialized. */ 54 VID REC_UNINITIALIZED = 0,56 VIDEORECSTS_UNINITIALIZED = 0, 55 57 /** Initialized, idle. */ 56 VID REC_IDLE= 1,58 VIDEORECSTS_IDLE = 1, 57 59 /** Currently in VideoRecCopyToIntBuf(), delay termination. */ 58 VID REC_COPYING= 2,60 VIDEORECSTS_COPYING = 2, 59 61 /** Signal that we are terminating. */ 60 VID REC_TERMINATING= 362 VIDEORECSTS_TERMINATING = 3 61 63 }; 62 64 65 /** 66 * Enumeration for supported pixel formats. 67 */ 68 enum VIDEORECPIXELFMT 69 { 70 /** Unknown pixel format. */ 71 VIDEORECPIXELFMT_UNKNOWN = 0, 72 /** RGB 24. */ 73 VIDEORECPIXELFMT_RGB24 = 1, 74 /** RGB 24. */ 75 VIDEORECPIXELFMT_RGB32 = 2, 76 /** RGB 565. */ 77 VIDEORECPIXELFMT_RGB565 = 3 78 }; 79 63 80 /* Must be always accessible and therefore cannot be part of VIDEORECCONTEXT */ 64 static uint32_t g_enmState = VID REC_UNINITIALIZED;81 static uint32_t g_enmState = VIDEORECSTS_UNINITIALIZED; 65 82 66 83 /** … … 71 88 union 72 89 { 90 #ifdef VBOX_WITH_LIBVPX 73 91 struct 74 92 { … … 80 98 vpx_image_t RawImage; 81 99 } VPX; 100 #endif /* VBOX_WITH_LIBVPX */ 82 101 }; 83 102 } VIDEORECCODEC, *PVIDEORECCODEC; … … 424 443 AssertRCBreak(rc); 425 444 426 if (ASMAtomicReadU32(&g_enmState) == VID REC_TERMINATING)445 if (ASMAtomicReadU32(&g_enmState) == VIDEORECSTS_TERMINATING) 427 446 break; 428 447 … … 469 488 AssertPtrReturn(ppCtx, VERR_INVALID_POINTER); 470 489 471 Assert(ASMAtomicReadU32(&g_enmState) == VID REC_UNINITIALIZED);490 Assert(ASMAtomicReadU32(&g_enmState) == VIDEORECSTS_UNINITIALIZED); 472 491 473 492 int rc = VINF_SUCCESS; … … 511 530 AssertRCReturn(rc, rc); 512 531 513 ASMAtomicWriteU32(&g_enmState, VID REC_IDLE);532 ASMAtomicWriteU32(&g_enmState, VIDEORECSTS_IDLE); 514 533 515 534 if (ppCtx) … … 549 568 return; 550 569 551 uint32_t enmState = VID REC_IDLE;570 uint32_t enmState = VIDEORECSTS_IDLE; 552 571 553 572 for (;;) /** @todo r=andy Remove busy waiting! */ 554 573 { 555 if (ASMAtomicCmpXchgExU32(&g_enmState, VID REC_TERMINATING, enmState, &enmState))556 break; 557 if (enmState == VID REC_UNINITIALIZED)574 if (ASMAtomicCmpXchgExU32(&g_enmState, VIDEORECSTS_TERMINATING, enmState, &enmState)) 575 break; 576 if (enmState == VIDEORECSTS_UNINITIALIZED) 558 577 return; 559 578 } 560 579 561 if (enmState == VID REC_COPYING)580 if (enmState == VIDEORECSTS_COPYING) 562 581 { 563 582 int rc = RTSemEventWait(pCtx->TermEvent, RT_INDEFINITE_WAIT); … … 606 625 RTMemFree(pCtx); 607 626 608 ASMAtomicWriteU32(&g_enmState, VID REC_UNINITIALIZED);627 ASMAtomicWriteU32(&g_enmState, VIDEORECSTS_UNINITIALIZED); 609 628 } 610 629 … … 640 659 pStream->pu8RgbBuf = (uint8_t *)RTMemAllocZ(uWidth * uHeight * 4); 641 660 AssertReturn(pStream->pu8RgbBuf, VERR_NO_MEMORY); 642 pStream->uEncoderDeadline = VPX_DL_REALTIME;643 661 644 662 /* Play safe: the file must not exist, overwriting is potentially … … 646 664 * other important file, causing unintentional data loss. */ 647 665 666 #ifdef VBOX_WITH_LIBVPX 667 pStream->uEncoderDeadline = VPX_DL_REALTIME; 668 648 669 vpx_codec_err_t rcv = vpx_codec_enc_config_default(DEFAULTCODEC, &pStream->Codec.VPX.Config, 0); 649 670 if (rcv != VPX_CODEC_OK) … … 652 673 return VERR_INVALID_PARAMETER; 653 674 } 675 #endif 654 676 655 677 com::Utf8Str options(pszOptions); … … 669 691 if (value.compare("realtime", Utf8Str::CaseInsensitive) == 0) 670 692 { 693 #ifdef VBOX_WITH_LIBVPX 671 694 pStream->uEncoderDeadline = VPX_DL_REALTIME; 695 #endif 672 696 } 673 697 else if (value.compare("good", Utf8Str::CaseInsensitive) == 0) … … 677 701 else if (value.compare("best", Utf8Str::CaseInsensitive) == 0) 678 702 { 703 #ifdef VBOX_WITH_LIBVPX 679 704 pStream->uEncoderDeadline = VPX_DL_BEST_QUALITY; 705 #endif 680 706 } 681 707 else … … 724 750 } 725 751 752 pStream->uDelay = 1000 / uFps; 753 754 if (fHasVideoTrack) 755 { 756 rc = pStream->pEBML->AddVideoTrack(uWidth, uHeight, uFps); 757 if (RT_FAILURE(rc)) 758 { 759 LogRel(("VideoRec: Failed to add video track to output file '%s' (%Rrc)\n", pszFile, rc)); 760 return rc; 761 } 762 } 763 764 #ifdef VBOX_WITH_LIBVPX 726 765 /* target bitrate in kilobits per second */ 727 766 pStream->Codec.VPX.Config.rc_target_bitrate = uRate; … … 736 775 pStream->Codec.VPX.Config.g_threads = 0; 737 776 738 pStream->uDelay = 1000 / uFps; 739 740 if (fHasVideoTrack) 741 { 742 rc = pStream->pEBML->AddVideoTrack(pStream->Codec.VPX.Config.g_w, /* Width */ 743 pStream->Codec.VPX.Config.g_h, /* Height */ 744 uFps); 745 if (RT_FAILURE(rc)) 746 { 747 LogRel(("VideoRec: Failed to add video track to output file '%s' (%Rrc)\n", pszFile, rc)); 748 return rc; 749 } 750 } 751 752 /* Initialize codec */ 777 /* Initialize codec. */ 753 778 rcv = vpx_codec_enc_init(&pStream->Codec.VPX.CodecCtx, DEFAULTCODEC, &pStream->Codec.VPX.Config, 0); 754 779 if (rcv != VPX_CODEC_OK) … … 765 790 766 791 pStream->pu8YuvBuf = pStream->Codec.VPX.RawImage.planes[0]; 792 #endif 767 793 768 794 pCtx->fEnabled = true; … … 782 808 RT_NOREF(pCtx); 783 809 uint32_t enmState = ASMAtomicReadU32(&g_enmState); 784 return ( enmState == VID REC_IDLE785 || enmState == VID REC_COPYING);810 return ( enmState == VIDEORECSTS_IDLE 811 || enmState == VIDEORECSTS_COPYING); 786 812 } 787 813 … … 798 824 { 799 825 uint32_t enmState = ASMAtomicReadU32(&g_enmState); 800 if (enmState != VID REC_IDLE)826 if (enmState != VIDEORECSTS_IDLE) 801 827 return false; 802 828 … … 858 884 static int videoRecEncodeAndWrite(PVIDEORECSTREAM pStream) 859 885 { 886 int rc; 887 888 #ifdef VBOX_WITH_LIBVPX 860 889 /* presentation time stamp */ 861 890 vpx_codec_pts_t pts = pStream->u64TimeStamp; … … 873 902 874 903 vpx_codec_iter_t iter = NULL; 875 intrc = VERR_NO_DATA;904 rc = VERR_NO_DATA; 876 905 for (;;) 877 906 { … … 896 925 897 926 pStream->cFrame++; 927 #else 928 RT_NOREF(pStream); 929 rc = VERR_NOT_SUPPORTED; 930 #endif /* VBOX_WITH_LIBVPX */ 898 931 return rc; 899 932 } … … 909 942 switch (pStrm->u32PixelFormat) 910 943 { 911 case V PX_IMG_FMT_RGB32:944 case VIDEORECPIXELFMT_RGB32: 912 945 LogFlow(("32 bit\n")); 913 946 if (!colorConvWriteYUV420p<ColorConvBGRA32Iter>(pStrm->uTargetWidth, … … 915 948 pStrm->pu8YuvBuf, 916 949 pStrm->pu8RgbBuf)) 917 return VERR_ GENERAL_FAILURE;918 break; 919 case V PX_IMG_FMT_RGB24:950 return VERR_INVALID_PARAMETER; 951 break; 952 case VIDEORECPIXELFMT_RGB24: 920 953 LogFlow(("24 bit\n")); 921 954 if (!colorConvWriteYUV420p<ColorConvBGR24Iter>(pStrm->uTargetWidth, … … 923 956 pStrm->pu8YuvBuf, 924 957 pStrm->pu8RgbBuf)) 925 return VERR_ GENERAL_FAILURE;926 break; 927 case V PX_IMG_FMT_RGB565:958 return VERR_INVALID_PARAMETER; 959 break; 960 case VIDEORECPIXELFMT_RGB565: 928 961 LogFlow(("565 bit\n")); 929 962 if (!colorConvWriteYUV420p<ColorConvBGR565Iter>(pStrm->uTargetWidth, … … 931 964 pStrm->pu8YuvBuf, 932 965 pStrm->pu8RgbBuf)) 933 return VERR_ GENERAL_FAILURE;966 return VERR_INVALID_PARAMETER; 934 967 break; 935 968 default: 936 return VERR_ GENERAL_FAILURE;969 return VERR_NOT_SUPPORTED; 937 970 } 938 971 return VINF_SUCCESS; … … 964 997 { 965 998 /* Do not execute during termination and guard against termination */ 966 if (!ASMAtomicCmpXchgU32(&g_enmState, VID REC_COPYING, VIDREC_IDLE))999 if (!ASMAtomicCmpXchgU32(&g_enmState, VIDEORECSTS_COPYING, VIDEORECSTS_IDLE)) 967 1000 return VINF_TRY_AGAIN; 968 1001 … … 1050 1083 { 1051 1084 case 32: 1052 pStream->u32PixelFormat = V PX_IMG_FMT_RGB32;1085 pStream->u32PixelFormat = VIDEORECPIXELFMT_RGB32; 1053 1086 bpp = 4; 1054 1087 break; 1055 1088 case 24: 1056 pStream->u32PixelFormat = V PX_IMG_FMT_RGB24;1089 pStream->u32PixelFormat = VIDEORECPIXELFMT_RGB24; 1057 1090 bpp = 3; 1058 1091 break; 1059 1092 case 16: 1060 pStream->u32PixelFormat = V PX_IMG_FMT_RGB565;1093 pStream->u32PixelFormat = VIDEORECPIXELFMT_RGB565; 1061 1094 bpp = 2; 1062 1095 break; … … 1098 1131 } while (0); 1099 1132 1100 if (!ASMAtomicCmpXchgU32(&g_enmState, VID REC_IDLE, VIDREC_COPYING))1133 if (!ASMAtomicCmpXchgU32(&g_enmState, VIDEORECSTS_IDLE, VIDEORECSTS_COPYING)) 1101 1134 { 1102 1135 rc = RTSemEventSignal(pCtx->TermEvent); -
trunk/src/libs/Makefile.kmk
r65184 r65263 5 5 6 6 # 7 # Copyright (C) 2006-201 6Oracle Corporation7 # Copyright (C) 2006-2017 Oracle Corporation 8 8 # 9 9 # This file is part of VirtualBox Open Source Edition (OSE), as … … 78 78 endif 79 79 80 # VP 8 for video capture81 if defined(VBOX_WITH_ VPX) && !defined(VBOX_ONLY_DOCS) && !defined(VBOX_WITH_SDK) \80 # VPX for video capture. 81 if defined(VBOX_WITH_LIBVPX) && !defined(VBOX_ONLY_DOCS) && !defined(VBOX_WITH_SDK) \ 82 82 && ("$(SDK_VBOX_VPX_INCS)" == "$(SDK_VBOX_VPX_DEFAULT_INCS)") 83 83 if1of ($(KBUILD_TARGET), darwin linux solaris win) … … 86 86 endif 87 87 88 # Opus for audio encoding video capture 88 # Opus for audio encoding video capture. 89 89 if defined(VBOX_WITH_LIBOPUS) && !defined(VBOX_ONLY_DOCS) && !defined(VBOX_WITH_SDK) \ 90 90 && ("$(SDK_VBOX_OPUS_INCS)" == "$(SDK_VBOX_OPUS_DEFAULT_INCS)")
Note:
See TracChangeset
for help on using the changeset viewer.