Changeset 68452 in vbox
- Timestamp:
- Aug 17, 2017 7:57:56 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/DrvAudioVideoRec.cpp
r68338 r68452 149 149 /** Time (in ms) an (encoded) frame takes. 150 150 * 151 * For Opus, valid frame size are:151 * For Opus, valid frame sizes are: 152 152 * ms Frame size 153 153 * 2.5 120 … … 233 233 { 234 234 uint32_t uHz = pCodecParms->uHz; 235 uint8_t cBits = 16; /** @ŧodo Make this configurable? */235 uint8_t cBits = pCodecParms->cBits; 236 236 uint8_t cChannels = pCodecParms->cChannels; 237 237 uint32_t uBitrate = pCodecParms->uBitrate; … … 297 297 { 298 298 /** @todo Add sink name / number to file name. */ 299 300 LogRel2(("VideoRec: Recording audio to file '%s'\n", szFile));301 299 302 300 pSink->Con.WebM.pWebM = new WebMWriter(); … … 534 532 535 533 AVRECCONTAINERPARMS ContainerParms; 536 ContainerParms.enmType = AVRECCONTAINERTYPE_ WEBM; /** @todo Make this configurable. */534 ContainerParms.enmType = AVRECCONTAINERTYPE_MAIN_CONSOLE; /** @todo Make this configurable. */ 537 535 538 536 AVRECCODECPARMS CodecParms; 539 537 CodecParms.uHz = AVREC_OPUS_HZ_MAX; /** @todo Make this configurable. */ 540 538 CodecParms.cChannels = 2; /** @todo Make this configurable. */ 539 CodecParms.cBits = 16; /** @todo Make this configurable. */ 541 540 CodecParms.uBitrate = 196000; /** @todo Make this configurable. */ 542 541 … … 637 636 const uint32_t cbFrame = csFrame * pSink->Codec.Parms.cChannels * (pSink->Codec.Parms.cBits / 8 /* Bytes */); 638 637 638 /* Only encode data if we have data for the given time period (or more). */ 639 639 while (RTCircBufUsed(pCircBuf) >= cbFrame) 640 640 { … … 686 686 # ifdef VBOX_WITH_STATISTICS 687 687 /* Get overall frames encoded. */ 688 uint32_t cEncFrames = opus_packet_get_nb_frames(abDst, cbDst); 689 uint32_t cEncSamplesPerFrame = opus_packet_get_samples_per_frame(abDst, pSink->Codec.Parms.uHz); 690 uint32_t csEnc = cEncFrames * cEncSamplesPerFrame; 688 const uint32_t cEncFrames = opus_packet_get_nb_frames(abDst, cbWritten); 691 689 692 690 pSink->Codec.STAM.cEncFrames += cEncFrames; 693 pSink->Codec.STAM.msEncTotal += 20 /* Default 20 ms */ * cEncFrames; 694 695 LogFunc(("%RU64ms [%RU64 frames]: cbSrc=%zu, cbDst=%zu, cEncFrames=%RU32, cEncSamplesPerFrame=%RU32, csEnc=%RU32\n", 696 pSink->Codec.STAM.msEncTotal, pSink->Codec.STAM.cEncFrames, 697 cbSrc, cbDst, cEncFrames, cEncSamplesPerFrame, csEnc)); 691 pSink->Codec.STAM.msEncTotal += pSink->Codec.Opus.msFrame * cEncFrames; 692 693 LogFunc(("%RU64ms [%RU64 frames]: cbSrc=%zu, cbDst=%zu, cEncFrames=%RU32\n", 694 pSink->Codec.STAM.msEncTotal, pSink->Codec.STAM.cEncFrames, cbSrc, cbDst, cEncFrames)); 698 695 # endif 699 696 Assert((uint32_t)cbWritten <= cbDst);
Note:
See TracChangeset
for help on using the changeset viewer.

