diff options
-rw-r--r-- | Config.kmk | 12 | ||||
-rw-r--r-- | Makefile.kmk | 2 | ||||
-rw-r--r-- | configure.vbs | 2 | ||||
-rw-r--r-- | doc/manual/en_US/user_ThirdParty.xml | 14 | ||||
-rw-r--r-- | src/VBox/Main/Makefile.kmk | 10 | ||||
-rw-r--r-- | src/VBox/Main/include/RecordingInternals.h | 33 | ||||
-rw-r--r-- | src/VBox/Main/include/WebMWriter.h | 34 | ||||
-rw-r--r-- | src/VBox/Main/src-client/DrvAudioRec.cpp | 50 | ||||
-rw-r--r-- | src/VBox/Main/src-client/RecordingCodec.cpp | 192 | ||||
-rw-r--r-- | src/VBox/Main/src-client/WebMWriter.cpp | 36 | ||||
-rw-r--r-- | src/VBox/Main/src-server/RecordingScreenSettingsImpl.cpp | 3 | ||||
-rw-r--r-- | src/VBox/Main/src-server/SystemPropertiesImpl.cpp | 4 | ||||
-rw-r--r-- | src/VBox/Main/xml/Settings.cpp | 6 | ||||
-rw-r--r-- | src/libs/Makefile.kmk | 6 |
14 files changed, 37 insertions, 367 deletions
diff --git a/Config.kmk b/Config.kmk index e602a3b5b7f..b3502652419 100644 --- a/Config.kmk +++ b/Config.kmk @@ -841,10 +841,6 @@ VBOX_WITH_AUDIO_RECORDING = 1 if defined(VBOX_WITH_AUDIO_RECORDING) && !defined(VBOX_WITH_RECORDING) $(error Audio recording (VBOX_WITH_AUDIO_RECORDING) needs the general recording feature (VBOX_WITH_RECORDING) enabled) endif -# Enables libopus (Opus), required for encoding audio into the recorded data. -VBOX_WITH_LIBOPUS = -# Enable SEE (+ AVX) optimizations for Opus. -VBOX_WITH_OPUS_SSE = # Enables libvorbis (Ogg Vorbis), required for encoding audio into the recorded data. VBOX_WITH_LIBVORBIS = 1 # Enables libogg (Ogg file format). Required for building libvorbis above. @@ -1456,7 +1452,6 @@ ifdef VBOX_OSE if1of ($(KBUILD_TARGET), win) # Undefine codec libraries which are not needed. VBOX_WITH_LIBVPX= - VBOX_WITH_LIBOPUS= VBOX_WITH_LIBVORBIS= VBOX_WITH_LIBOGG= # Disable recording (with audio support). @@ -4838,13 +4833,6 @@ if "$(SDK_VBOX_OPENSSL_INCS)" == "$(SDK_VBOX_OPENSSL_VBOX_DEFAULT_INCS)" SDK_VBOX_OPENSSL2_LIBS = $(NO_SUCH_VARIABLE) endif -ifdef VBOX_WITH_LIBOPUS - SDK_VBOX_OPUS := libopus for dll linking. - SDK_VBOX_OPUS_DEFAULT_INCS := $(PATH_ROOT)/src/libs/libopus-1.3.1/include - SDK_VBOX_OPUS_INCS ?= $(SDK_VBOX_OPUS_DEFAULT_INCS) - SDK_VBOX_OPUS_LIBS ?= $(PATH_STAGE_LIB)/VBox-libopus$(VBOX_SUFF_LIB) -endif - ifdef VBOX_WITH_LIBOGG SDK_VBOX_OGG := libogg for dll linking. SDK_VBOX_OGG_DEFAULT_INCS := $(PATH_ROOT)/src/libs/libogg-1.3.5/include diff --git a/Makefile.kmk b/Makefile.kmk index 227a1cd9d41..04814cedaaa 100644 --- a/Makefile.kmk +++ b/Makefile.kmk @@ -1386,7 +1386,6 @@ additions-build-darwin.amd64.rsync-into-vm: '--exclude=src/libs/curl*/**' \ '--exclude=src/libs/libxml*/**' \ '--exclude=src/libs/libvpx*/**' \ - '--exclude=src/libs/libopus*/**' \ '--exclude=src/VBox/Additions/WINNT/**' \ '--exclude=src/VBox/Additions/x11/**' \ '--exclude=src/VBox/Artwork/x11/**' \ @@ -1425,7 +1424,6 @@ additions-build-darwin.x86.rsync-into-vm: '--exclude=src/libs/curl*/**' \ '--exclude=src/libs/libxml*/**' \ '--exclude=src/libs/libvpx*/**' \ - '--exclude=src/libs/libopus*/**' \ '--exclude=src/VBox/Additions/WINNT/**' \ '--exclude=src/VBox/Additions/x11/**' \ '--exclude=src/VBox/Artwork/x11/**' \ diff --git a/configure.vbs b/configure.vbs index cd58c2a5184..a389e747a08 100644 --- a/configure.vbs +++ b/configure.vbs @@ -2212,7 +2212,6 @@ function Main CheckForQt strOptQt5, strOptQt5Infix
CheckForPython strOptPython
CfgPrintAssign "VBOX_WITH_LIBVPX", "" '' @todo look for libvpx 1.1.0+
- CfgPrintAssign "VBOX_WITH_LIBOPUS", "" '' @todo look for libopus 1.2.1+
CfgPrintAssign "VBOX_WITH_LIBOGG", "" '' @todo look for libogg 1.3.5+
CfgPrintAssign "VBOX_WITH_LIBVORBIS", "" '' @todo look for libvorbis 1.3.7+
@@ -2240,4 +2239,3 @@ end function ' What crt0.o typically does:
'
WScript.Quit(Main())
-
diff --git a/doc/manual/en_US/user_ThirdParty.xml b/doc/manual/en_US/user_ThirdParty.xml index ce3864c74f3..604a5df18fa 100644 --- a/doc/manual/en_US/user_ThirdParty.xml +++ b/doc/manual/en_US/user_ThirdParty.xml @@ -370,20 +370,6 @@ <listitem> <para> - &product-name; may contain code from libopus ("Opus") which is - governed by the license in - <xref linkend="licOpus" xrefstyle="template: %n" /> and - </para> - - <para> - Copyright 2001-2011 Xiph.Org, Skype Limited, Octasic, - Jean-Marc Valin, Timothy B. Terriberry, CSIRO, Gregory - Maxwell, Mark Borgerding, Erik de Castro Lopo - </para> - </listitem> - - <listitem> - <para> &product-name; contains code from cURL which is governed by the license in <xref linkend="licCurl" xrefstyle="template: %n" /> and diff --git a/src/VBox/Main/Makefile.kmk b/src/VBox/Main/Makefile.kmk index c72db48ed5f..91242b72fe9 100644 --- a/src/VBox/Main/Makefile.kmk +++ b/src/VBox/Main/Makefile.kmk @@ -1021,12 +1021,6 @@ ifdef VBOX_WITH_RECORDING VBoxC_DEFS += VBOX_WITH_AUDIO_RECORDING # Needed in VBoxSVC for ISystemProperties. src-server/SystemPropertiesImpl.cpp_DEFS += VBOX_WITH_AUDIO_RECORDING - ifdef VBOX_WITH_LIBOPUS - VBoxC_SDKS += VBOX_OPUS - VBoxC_DEFS += VBOX_WITH_LIBOPUS - # Needed in VBoxSVC for ISystemProperties. - src-server/SystemPropertiesImpl.cpp_DEFS += VBOX_WITH_LIBOPUS - endif ifdef VBOX_WITH_LIBOGG VBOX_MAIN_DEFS += VBOX_WITH_LIBOGG VBoxC_SDKS += VBOX_OGG @@ -1257,10 +1251,10 @@ if defined(VBOX_WITH_PRECOMPILED_HEADERS) && "$(KBUILD_TARGET)" == "win" ## @tod VBoxClient-x86_USES = vccprecomp VBoxClient-x86_PCH_HDR := $(PATH_SUB_CURRENT)/src-client/win/precomp_vcc.h endif - VBoxClient-x86_SDKS = $(filter-out VBOX_OPUS VBOX_VPX,$(VBoxC_SDKS)) + VBoxClient-x86_SDKS = $(filter-out VBOX_VPX,$(VBoxC_SDKS)) VBoxClient-x86_DEFS = VBOX_COM_INPROC_API_CLIENT \ $(filter-out VBOX_WITH_RECORDING VBOX_WITH_AUDIO_RECORDING \ - VBOX_WITH_LIBVPX VBOX_WITH_LIBOPUS,$(VBoxC_DEFS)) + VBOX_WITH_LIBVPX,$(VBoxC_DEFS)) VBoxClient-x86_INCS.win = \ $(VBoxClient-x86_0_OUTDIR) \ $(VBoxCOM-x86_0_OUTDIR) \ diff --git a/src/VBox/Main/include/RecordingInternals.h b/src/VBox/Main/include/RecordingInternals.h index a2eca4b0ce2..013c314e9bf 100644 --- a/src/VBox/Main/include/RecordingInternals.h +++ b/src/VBox/Main/include/RecordingInternals.h @@ -38,10 +38,6 @@ # include "vpx/vpx_encoder.h" #endif /* VBOX_WITH_LIBVPX */ -#ifdef VBOX_WITH_LIBOPUS -# include <opus.h> -#endif - #ifdef VBOX_WITH_LIBVORBIS # include "vorbis/vorbisenc.h" #endif @@ -50,9 +46,6 @@ /********************************************************************************************************************************* * Defines * *********************************************************************************************************************************/ -#define VBOX_RECORDING_OPUS_HZ_MAX 48000 /**< Maximum sample rate (in Hz) Opus can handle. */ -#define VBOX_RECORDING_OPUS_FRAME_MS_DEFAULT 20 /**< Default Opus frame size (in ms). */ - #define VBOX_RECORDING_VORBIS_HZ_MAX 48000 /**< Maximum sample rate (in Hz) Vorbis can handle. */ #define VBOX_RECORDING_VORBIS_FRAME_MS_DEFAULT 20 /**< Default Vorbis frame size (in ms). */ @@ -205,15 +198,6 @@ typedef struct RECORDINGCODECPARMS uint32_t uBitrate; /** Time (in ms) the encoder expects us to send data to encode. * - * For Opus, valid frame sizes are: - * ms Frame size - * 2.5 120 - * 5 240 - * 10 480 - * 20 (Default) 960 - * 40 1920 - * 60 2880 - * * For Vorbis, valid frame sizes are powers of two from 64 to 8192 bytes. */ uint32_t msFrame; @@ -246,19 +230,6 @@ typedef struct RECORDINGCODECVPX typedef RECORDINGCODECVPX *PRECORDINGCODECVPX; #endif /* VBOX_WITH_LIBVPX */ -#ifdef VBOX_WITH_LIBOPUS -/** - * Opus encoder state (needs libvorbis). - */ -typedef struct RECORDINGCODECOPUS -{ - /** Encoder we're going to use. */ - OpusEncoder *pEnc; -} RECORDINGCODECOPUS; -/** Pointer to an Opus encoder state. */ -typedef RECORDINGCODECOPUS *PRECORDINGCODECOPUS; -#endif /* VBOX_WITH_LIBOPUS */ - #ifdef VBOX_WITH_LIBVORBIS /** * Vorbis encoder state (needs libvorbis + libogg). @@ -313,9 +284,6 @@ typedef struct RECORDINGCODEC #ifdef VBOX_WITH_AUDIO_RECORDING union { -# ifdef VBOX_WITH_LIBOPUS - RECORDINGCODECOPUS Opus; -# endif /* VBOX_WITH_LIBOPUS */ # ifdef VBOX_WITH_LIBVORBIS RECORDINGCODECVORBIS Vorbis; # endif /* VBOX_WITH_LIBVORBIS */ @@ -487,4 +455,3 @@ int recordingCodecEncode(PRECORDINGCODEC pCodec, const PRECORDINGFRAME pFrame, s int recordingCodecFinalize(PRECORDINGCODEC pCodec); uint32_t recordingCodecGetWritable(PRECORDINGCODEC pCodec, uint64_t msTimestamp); #endif /* !MAIN_INCLUDED_RecordingInternals_h */ - diff --git a/src/VBox/Main/include/WebMWriter.h b/src/VBox/Main/include/WebMWriter.h index 3abccf249b8..aeddb80d724 100644 --- a/src/VBox/Main/include/WebMWriter.h +++ b/src/VBox/Main/include/WebMWriter.h @@ -65,40 +65,6 @@ * With signed 16-bit timecodes and a default timecode scale of 1ms per unit this makes 65536ms. */ #define VBOX_WEBM_BLOCK_MAX_LEN_MS UINT16_MAX -#ifdef VBOX_WITH_LIBOPUS -# pragma pack(push) -# pragma pack(1) - /** Opus codec private data within the MKV (WEBM) container. - * Taken from: https://wiki.xiph.org/MatroskaOpus */ - typedef struct WEBMOPUSPRIVDATA - { - WEBMOPUSPRIVDATA(uint32_t a_u32SampleRate, uint8_t a_u8Channels) - { - au64Head = RT_MAKE_U64_FROM_U8('O', 'p', 'u', 's', 'H', 'e', 'a', 'd'); - u8Version = 1; - u8Channels = a_u8Channels; - u16PreSkip = 0; - u32SampleRate = a_u32SampleRate; - u16Gain = 0; - u8MappingFamily = 0; - } - - uint64_t au64Head; /**< Defaults to "OpusHead". */ - uint8_t u8Version; /**< Must be set to 1. */ - uint8_t u8Channels; - uint16_t u16PreSkip; - /** Sample rate *before* encoding to Opus. - * Note: This rate has nothing to do with the playback rate later! */ - uint32_t u32SampleRate; - uint16_t u16Gain; - /** Must stay 0 -- otherwise a mapping table must be appended - * right after this header. */ - uint8_t u8MappingFamily; - } WEBMOPUSPRIVDATA, *PWEBMOPUSPRIVDATA; - AssertCompileSize(WEBMOPUSPRIVDATA, 19); -# pragma pack(pop) -#endif /* VBOX_WITH_LIBOPUS */ - #ifdef VBOX_WITH_LIBVORBIS # pragma pack(push) # pragma pack(1) diff --git a/src/VBox/Main/src-client/DrvAudioRec.cpp b/src/VBox/Main/src-client/DrvAudioRec.cpp index a99b3de496c..e7488608042 100644 --- a/src/VBox/Main/src-client/DrvAudioRec.cpp +++ b/src/VBox/Main/src-client/DrvAudioRec.cpp @@ -27,55 +27,6 @@ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. */ -/* This code makes use of the Vorbis (libvorbis) and Opus codec (libopus): - * - * Copyright 2001-2011 Xiph.Org, Skype Limited, Octasic, - * Jean-Marc Valin, Timothy B. Terriberry, - * CSIRO, Gregory Maxwell, Mark Borgerding, - * Erik de Castro Lopo - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * - Neither the name of Internet Society, IETF or IETF Trust, nor the - * names of specific contributors, may be used to endorse or promote - * products derived from this software without specific prior written - * permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER - * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Opus is subject to the royalty-free patent licenses which are - * specified at: - * - * Xiph.Org Foundation: - * https://datatracker.ietf.org/ipr/1524/ - * - * Microsoft Corporation: - * https://datatracker.ietf.org/ipr/1914/ - * - * Broadcom Corporation: - * https://datatracker.ietf.org/ipr/1526/ - * - */ - /********************************************************************************************************************************* * Header Files * @@ -1010,4 +961,3 @@ const PDMDRVREG AudioVideoRec::DrvReg = /* u32EndVersion */ PDM_DRVREG_VERSION }; - diff --git a/src/VBox/Main/src-client/RecordingCodec.cpp b/src/VBox/Main/src-client/RecordingCodec.cpp index e0c21021a1d..38ec892998c 100644 --- a/src/VBox/Main/src-client/RecordingCodec.cpp +++ b/src/VBox/Main/src-client/RecordingCodec.cpp @@ -15,6 +15,38 @@ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. */ +/* This code makes use of the Vorbis (libvorbis): + * + * Copyright (c) 2002-2020 Xiph.org Foundation + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of the Xiph.org Foundation nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + #define LOG_GROUP LOG_GROUP_RECORDING #include "LoggingNew.h" @@ -214,152 +246,6 @@ static DECLCALLBACK(int) recordingCodecVPXEncode(PRECORDINGCODEC pCodec, PRECORD /********************************************************************************************************************************* -* Opus codec * -*********************************************************************************************************************************/ - -#ifdef VBOX_WITH_LIBOPUS -/** @copydoc RECORDINGCODECOPS::pfnInit */ -static DECLCALLBACK(int) recordingCodecOpusInit(PRECORDINGCODEC pCodec) -{ - pCodec->cbScratch = _4K; - pCodec->pvScratch = RTMemAlloc(pCodec->cbScratch); - AssertPtrReturn(pCodec->pvScratch, VERR_NO_MEMORY); - - const PPDMAUDIOPCMPROPS pProps = &pCodec->Parms.Audio.PCMProps; - - uint32_t uHz = PDMAudioPropsHz(pProps); - uint8_t const cChannels = PDMAudioPropsChannels(pProps); - - /* Opus only supports certain input sample rates in an efficient manner. - * So make sure that we use those by resampling the data to the requested rate. */ - if (uHz > 24000) uHz = VBOX_RECORDING_OPUS_HZ_MAX; - else if (uHz > 16000) uHz = 24000; - else if (uHz > 12000) uHz = 16000; - else if (uHz > 8000 ) uHz = 12000; - else uHz = 8000; - - int opus_rc; - OpusEncoder *pEnc = opus_encoder_create(uHz, cChannels, OPUS_APPLICATION_AUDIO, &opus_rc); - if (opus_rc != OPUS_OK) - { - LogRel(("Recording: Audio codec failed to initialize: %s\n", opus_strerror(opus_rc))); - return VERR_RECORDING_CODEC_INIT_FAILED; - } - - AssertPtr(pEnc); - - if (pCodec->Parms.uBitrate) /* Only explicitly set the bitrate management if we specified one. Otherwise let Opus decide. */ - { - opus_encoder_ctl(pEnc, OPUS_SET_BITRATE(pCodec->Parms.uBitrate)); - if (opus_rc != OPUS_OK) - { - opus_encoder_destroy(pEnc); - pEnc = NULL; - - LogRel(("Recording: Audio codec failed to set bitrate (%RU32): %s\n", pCodec->Parms.uBitrate, opus_strerror(opus_rc))); - return VERR_RECORDING_CODEC_INIT_FAILED; - } - } - - opus_rc = opus_encoder_ctl(pEnc, OPUS_SET_VBR(pCodec->Parms.uBitrate == 0 ? 1 : 0)); - if (opus_rc != OPUS_OK) - { - LogRel(("Recording: Audio codec failed to %s VBR mode: %s\n", - pCodec->Parms.uBitrate == 0 ? "disable" : "enable", opus_strerror(opus_rc))); - return VERR_RECORDING_CODEC_INIT_FAILED; - } - - pCodec->Audio.Opus.pEnc = pEnc; - - PDMAudioPropsInit(pProps, - PDMAudioPropsSampleSize(pProps), PDMAudioPropsIsSigned(pProps), PDMAudioPropsChannels(pProps), uHz); - - if (!pCodec->Parms.msFrame) /* No ms per frame defined? Use default. */ - pCodec->Parms.msFrame = VBOX_RECORDING_OPUS_FRAME_MS_DEFAULT; - - return VINF_SUCCESS; -} - -/** @copydoc RECORDINGCODECOPS::pfnDestroy */ -static DECLCALLBACK(int) recordingCodecOpusDestroy(PRECORDINGCODEC pCodec) -{ - PRECORDINGCODECOPUS pOpus = &pCodec->Audio.Opus; - - if (pOpus->pEnc) - { - opus_encoder_destroy(pOpus->pEnc); - pOpus->pEnc = NULL; - } - - return VINF_SUCCESS; -} - -/** @copydoc RECORDINGCODECOPS::pfnEncode */ -static DECLCALLBACK(int) recordingCodecOpusEncode(PRECORDINGCODEC pCodec, - const PRECORDINGFRAME pFrame, size_t *pcEncoded, size_t *pcbEncoded) -{ - const PPDMAUDIOPCMPROPS pPCMProps = &pCodec->Parms.Audio.PCMProps; - - Assert (pCodec->Parms.cbFrame); - AssertReturn (pFrame->Audio.cbBuf % pCodec->Parms.cbFrame == 0, VERR_INVALID_PARAMETER); - Assert (pFrame->Audio.cbBuf); - AssertReturn (pFrame->Audio.cbBuf % pPCMProps->cbFrame == 0, VERR_INVALID_PARAMETER); - AssertReturn(pCodec->cbScratch >= pFrame->Audio.cbBuf, VERR_INVALID_PARAMETER); - AssertPtrReturn(pcEncoded, VERR_INVALID_POINTER); - AssertPtrReturn(pcbEncoded, VERR_INVALID_POINTER); - - int vrc = VINF_SUCCESS; - - size_t cBlocksEncoded = 0; - size_t cBytesEncoded = 0; - - /* - * Opus always encodes PER "OPUS FRAME", that is, exactly 2.5, 5, 10, 20, 40 or 60 ms of audio data. - * - * A packet can have up to 120ms worth of audio data. - * Anything > 120ms of data will result in a "corrupted package" error message by - * by decoding application. - */ - opus_int32 cbWritten = opus_encode(pCodec->Audio.Opus.pEnc, - (opus_int16 *)pFrame->Audio.pvBuf, (int)(pFrame->Audio.cbBuf / pPCMProps->cbFrame /* Number of audio frames */), - (uint8_t *)pCodec->pvScratch, (opus_int32)pCodec->cbScratch); - if (cbWritten < 0) - { - LogRel(("Recording: opus_encode() failed (%s)\n", opus_strerror(cbWritten))); - return VERR_RECORDING_ENCODING_FAILED; - } - - if (cbWritten) - { - vrc = pCodec->Callbacks.pfnWriteData(pCodec, pCodec->pvScratch, (size_t)cbWritten, pCodec->State.tsLastWrittenMs, - RECORDINGCODEC_ENC_F_BLOCK_IS_KEY /* Every Opus frame is a key frame */, - pCodec->Callbacks.pvUser); - } - - if (RT_SUCCESS(vrc)) - { - /* Get overall frames encoded. */ - cBlocksEncoded = opus_packet_get_nb_frames((uint8_t *)pCodec->pvScratch, cbWritten); - cBytesEncoded = cbWritten; - - if (pcEncoded) - *pcEncoded = cBlocksEncoded; - if (pcbEncoded) - *pcbEncoded = cBytesEncoded; - } - - if (RT_FAILURE(vrc)) - LogRel(("Recording: Encoding Opus data failed, rc=%Rrc\n", vrc)); - - Log3Func(("cbSrc=%zu, cbDst=%zu, cEncoded=%zu, cbEncoded=%zu, vrc=%Rrc\n", - pFrame->Audio.cbBuf, pCodec->cbScratch, cBlocksEncoded, cBytesEncoded, vrc)); - - return vrc; -} -#endif /* VBOX_WITH_LIBOPUS */ - - -/********************************************************************************************************************************* * Ogg Vorbis codec * *********************************************************************************************************************************/ @@ -761,19 +647,6 @@ int recordingCodecCreateAudio(PRECORDINGCODEC pCodec, RecordingAudioCodec_T enmA switch (enmAudioCodec) { -# ifdef VBOX_WITH_LIBOPUS - case RecordingAudioCodec_Opus: - { - pCodec->Ops.pfnInit = recordingCodecOpusInit; - pCodec->Ops.pfnDestroy = recordingCodecOpusDestroy; - pCodec->Ops.pfnParseOptions = recordingCodecAudioParseOptions; - pCodec->Ops.pfnEncode = recordingCodecOpusEncode; - - vrc = VINF_SUCCESS; - break; - } -# endif /* VBOX_WITH_LIBOPUS */ - # ifdef VBOX_WITH_LIBVORBIS case RecordingAudioCodec_OggVorbis: { @@ -998,4 +871,3 @@ uint32_t recordingCodecGetWritable(PRECORDINGCODEC pCodec, uint64_t msTimestamp) AssertMsg(pCodec->Parms.cbFrame, ("Codec not initialized yet\n")); return pCodec->Parms.cbFrame; } - diff --git a/src/VBox/Main/src-client/WebMWriter.cpp b/src/VBox/Main/src-client/WebMWriter.cpp index 84d3691d51c..328f010650c 100644 --- a/src/VBox/Main/src-client/WebMWriter.cpp +++ b/src/VBox/Main/src-client/WebMWriter.cpp @@ -161,7 +161,7 @@ int WebMWriter::Close(void) */ int WebMWriter::AddAudioTrack(PRECORDINGCODEC pCodec, uint16_t uHz, uint8_t cChannels, uint8_t cBits, uint8_t *puTrack) { -#if defined(VBOX_WITH_LIBOPUS) || defined(VBOX_WITH_LIBVORBIS) +#if defined(VBOX_WITH_LIBVORBIS) AssertReturn(uHz, VERR_INVALID_PARAMETER); AssertReturn(cBits, VERR_INVALID_PARAMETER); AssertReturn(cChannels, VERR_INVALID_PARAMETER); @@ -195,34 +195,6 @@ int WebMWriter::AddAudioTrack(PRECORDINGCODEC pCodec, uint16_t uHz, uint8_t cCha switch (m_enmAudioCodec) { -# ifdef VBOX_WITH_LIBOPUS - case RecordingAudioCodec_Opus: - { - /* - * Adjust the handed-in Hz rate to values which are supported by the Opus codec. - * - * Only the following values are supported by an Opus standard build - * -- every other rate only is supported by a custom build. - * - * See opus_encoder_create() for more information. - */ - if (uHz > 24000) uHz = VBOX_RECORDING_OPUS_HZ_MAX; - else if (uHz > 16000) uHz = 24000; - else if (uHz > 12000) uHz = 16000; - else if (uHz > 8000 ) uHz = 12000; - else uHz = 8000; - - WEBMOPUSPRIVDATA opusPrivData(uHz, cChannels); - - pTrack->Audio.msPerBlock = 0; /** @todo */ - if (!pTrack->Audio.msPerBlock) /* No ms per frame defined? Use default. */ - pTrack->Audio.msPerBlock = VBOX_RECORDING_OPUS_FRAME_MS_DEFAULT; - - serializeString(MkvElem_CodecID, "A_OPUS"); - serializeData(MkvElem_CodecPrivate, &opusPrivData, sizeof(opusPrivData)); - break; - } -# endif /* VBOX_WITH_LIBOPUS */ # ifdef VBOX_WITH_LIBVORBIS case RecordingAudioCodec_OggVorbis: { @@ -325,7 +297,7 @@ int WebMWriter::AddAudioTrack(PRECORDINGCODEC pCodec, uint16_t uHz, uint8_t cCha if (pTrack) delete pTrack; return vrc; -#else /* defined(VBOX_WITH_LIBOPUS) || defined(VBOX_WITH_LIBVORBIS) */ +#else /* !defined(VBOX_WITH_LIBVORBIS) */ RT_NOREF(pCodec, uHz, cChannels, cBits, puTrack); return VERR_NOT_SUPPORTED; #endif @@ -424,9 +396,6 @@ uint64_t WebMWriter::GetAvailableSpace(void) */ int WebMWriter::init(RecordingAudioCodec_T enmAudioCodec, RecordingVideoCodec_T enmVideoCodec) { -#ifndef VBOX_WITH_LIBOPUS - AssertReturn(enmAudioCodec != RecordingAudioCodec_Opus, VERR_NOT_SUPPORTED); -#endif #ifndef VBOX_WITH_LIBVORBIS AssertReturn(enmAudioCodec != RecordingAudioCodec_OggVorbis, VERR_NOT_SUPPORTED); #endif @@ -933,4 +902,3 @@ void WebMWriter::writeSeekHeader(void) .serializeString(MkvElem_WritingApp, szApp) .subEnd(MkvElem_Info); } - diff --git a/src/VBox/Main/src-server/RecordingScreenSettingsImpl.cpp b/src/VBox/Main/src-server/RecordingScreenSettingsImpl.cpp index 4a8844a05ff..942a8fb9737 100644 --- a/src/VBox/Main/src-server/RecordingScreenSettingsImpl.cpp +++ b/src/VBox/Main/src-server/RecordingScreenSettingsImpl.cpp @@ -582,7 +582,7 @@ HRESULT RecordingScreenSettings::setAudioCodec(RecordingAudioCodec_T aCodec) if (!m->pParent->i_canChangeSettings()) return setError(E_INVALIDARG, tr("Cannot change audio codec while recording is enabled")); - if (aCodec != RecordingAudioCodec_Opus) + if (aCodec != RecordingAudioCodec_OggVorbis) return setError(E_INVALIDARG, tr("Audio codec not supported")); AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); @@ -1231,4 +1231,3 @@ int32_t RecordingScreenSettings::i_getReferences(void) { return ASMAtomicReadS32(&m->cRefs); } - diff --git a/src/VBox/Main/src-server/SystemPropertiesImpl.cpp b/src/VBox/Main/src-server/SystemPropertiesImpl.cpp index c41f1f9f3a1..6ff73c8b86f 100644 --- a/src/VBox/Main/src-server/SystemPropertiesImpl.cpp +++ b/src/VBox/Main/src-server/SystemPropertiesImpl.cpp @@ -1601,9 +1601,6 @@ HRESULT SystemProperties::getSupportedRecordingAudioCodecs(std::vector<Recording #ifdef DEBUG RecordingAudioCodec_WavPCM, #endif -#ifdef VBOX_WITH_LIBOPUS - RecordingAudioCodec_Opus, -#endif #ifdef VBOX_WITH_LIBVORBIS RecordingAudioCodec_OggVorbis, #endif @@ -2397,4 +2394,3 @@ HRESULT SystemProperties::setLanguageId(const com::Utf8Str &aLanguageId) return E_NOTIMPL; #endif } - diff --git a/src/VBox/Main/xml/Settings.cpp b/src/VBox/Main/xml/Settings.cpp index 40dd82ed8b0..8bcd5237c70 100644 --- a/src/VBox/Main/xml/Settings.cpp +++ b/src/VBox/Main/xml/Settings.cpp @@ -3025,11 +3025,8 @@ void RecordingScreenSettings::applyDefaults(void) Video.ulRate = 512; Video.ulFPS = 25; #ifdef VBOX_WITH_AUDIO_RECORDING - /* When both codecs are defined, prefer Ogg Vorbis as a default. */ # if defined(VBOX_WITH_LIBVORBIS) Audio.enmCodec = RecordingAudioCodec_OggVorbis; -# elif defined(VBOX_WITH_LIBOPUS) - Audio.enmCodec = RecordingAudioCodec_Opus; # else Audio.enmCodec = RecordingAudioCodec_None; # endif @@ -3072,11 +3069,8 @@ bool RecordingScreenSettings::areDefaultSettings(void) const && Video.ulRate == 512 && Video.ulFPS == 25 #ifdef VBOX_WITH_AUDIO_RECORDING -/* When both codecs are defined, prefer Ogg Vorbis as a default. */ # if defined(VBOX_WITH_LIBVORBIS) && Audio.enmCodec == RecordingAudioCodec_OggVorbis -# elif defined(VBOX_WITH_LIBOPUS) - && Audio.enmCodec == RecordingAudioCodec_Opus # else && Audio.enmCodec == RecordingAudioCodec_None # endif diff --git a/src/libs/Makefile.kmk b/src/libs/Makefile.kmk index 77d8b697506..77153a4c0a3 100644 --- a/src/libs/Makefile.kmk +++ b/src/libs/Makefile.kmk @@ -122,12 +122,6 @@ if defined(VBOX_WITH_MAIN) \ && !defined(VBOX_ONLY_EXTPACKS) \ && !defined(VBOX_WITH_SDK) - # libopus for supporting audio with the video capture. - if defined(VBOX_WITH_LIBOPUS) \ - && ("$(SDK_VBOX_OPUS_INCS)" == "$(SDK_VBOX_OPUS_DEFAULT_INCS)") - include $(PATH_SUB_CURRENT)/libopus-1.3.1/Makefile.kmk - endif - # libogg, needed for building libvorbis. if defined(VBOX_WITH_LIBOGG) \ && ("$(SDK_VBOX_OGG_INCS)" == "$(SDK_VBOX_OGG_DEFAULT_INCS)") |