Changeset 71164 in vbox for trunk/src/VBox/Main/src-client
- Timestamp:
- Mar 1, 2018 3:35:39 PM (7 years ago)
- svn:sync-xref-src-repo-rev:
- 121065
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/VideoRec.cpp
r71162 r71164 33 33 #include <iprt/time.h> 34 34 35 #include <VBox/err.h> 35 36 #include <VBox/com/VirtualBox.h> 36 37 … … 40 41 #ifdef VBOX_WITH_LIBVPX 41 42 # define VPX_CODEC_DISABLE_COMPAT 1 42 # include <vpx/vp8cx.h> 43 # include <vpx/vpx_image.h> 44 45 /** Default VPX codec to use. */ 46 # define DEFAULTCODEC (vpx_codec_vp8_cx()) 43 # include "vpx/vp8cx.h" 44 # include "vpx/vpx_image.h" 45 # include "vpx/vpx_encoder.h" 47 46 #endif /* VBOX_WITH_LIBVPX */ 48 47 … … 148 147 uint8_t abBuf[_64K]; /** @todo Fix! */ 149 148 size_t cbBuf; 150 /** Time stamp (in ms). */149 /** Absolute time stamp (in ms). */ 151 150 uint64_t uTimeStampMs; 152 151 } VIDEORECAUDIOFRAME, *PVIDEORECAUDIOFRAME; … … 1090 1089 PVIDEORECVIDEOCODEC pVC = &pStream->Video.Codec; 1091 1090 1092 #ifdef VBOX_WITH_LIBVPX1093 vpx_codec_err_t rcv = vpx_codec_enc_config_default(DEFAULTCODEC, &pVC->VPX.Cfg, 0);1094 if (rcv != VPX_CODEC_OK)1095 {1096 LogRel(("VideoRec: Failed to get default configuration for VPX codec: %s\n", vpx_codec_err_to_string(rcv)));1097 return VERR_INVALID_PARAMETER;1098 }1099 #endif1100 1101 1091 pStream->Video.uDelayMs = 1000 / pCfg->Video.uFPS; 1102 1092 … … 1183 1173 1184 1174 #ifdef VBOX_WITH_LIBVPX 1175 # ifdef VBOX_WITH_LIBVPX_VP9 1176 vpx_codec_iface_t *pCodecIface = vpx_codec_vp9_cx(); 1177 # else /* Default is using VP8. */ 1178 vpx_codec_iface_t *pCodecIface = vpx_codec_vp8_cx(); 1179 # endif 1180 1181 vpx_codec_err_t rcv = vpx_codec_enc_config_default(pCodecIface, &pVC->VPX.Cfg, 0 /* Reserved */); 1182 if (rcv != VPX_CODEC_OK) 1183 { 1184 LogRel(("VideoRec: Failed to get default config for VPX encoder: %s\n", vpx_codec_err_to_string(rcv))); 1185 return VERR_AVREC_CODEC_INIT_FAILED; 1186 } 1187 1185 1188 /* Target bitrate in kilobits per second. */ 1186 1189 pVC->VPX.Cfg.rc_target_bitrate = pCfg->Video.uRate; … … 1196 1199 1197 1200 /* Initialize codec. */ 1198 rcv = vpx_codec_enc_init(&pVC->VPX.Ctx, DEFAULTCODEC, &pVC->VPX.Cfg, 0);1201 rcv = vpx_codec_enc_init(&pVC->VPX.Ctx, pCodecIface, &pVC->VPX.Cfg, 0 /* Flags */); 1199 1202 if (rcv != VPX_CODEC_OK) 1200 1203 { 1201 LogRel(("VideoRec: Failed to initialize VP 8encoder: %s\n", vpx_codec_err_to_string(rcv)));1202 return VERR_ INVALID_PARAMETER;1204 LogRel(("VideoRec: Failed to initialize VPX encoder: %s\n", vpx_codec_err_to_string(rcv))); 1205 return VERR_AVREC_CODEC_INIT_FAILED; 1203 1206 } 1204 1207
Note:
See TracChangeset
for help on using the changeset viewer.