儲存庫 vbox 的更動 65281
- 時間撮記:
- 2017-1-13 下午01:21:12 (8 年 以前)
- 位置:
- trunk/src/VBox/Main/src-client
- 檔案:
-
- 修改 4 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/src/VBox/Main/src-client/DrvAudioVideoRec.cpp
r65263 r65281 235 235 WebMWriter::AudioCodec_Opus, WebMWriter::VideoCodec_None); 236 236 if (RT_SUCCESS(rc)) 237 rc = pThis->pEBML->AddAudioTrack(44100 .0, 44100, 2, 16);237 rc = pThis->pEBML->AddAudioTrack(44100, 2, 16); 238 238 break; 239 239 } -
trunk/src/VBox/Main/src-client/EbmlIDs.h
r63160 r65281 134 134 // TrackTranslateCodec = 0x66BF, 135 135 // TrackTranslateTrackID = 0x66A5, 136 CodecDelay = 0x56AA, 137 SeekPreRoll = 0x56BB, 136 138 //video 137 139 Video = 0xE0, -
trunk/src/VBox/Main/src-client/EbmlWriter.cpp
r65263 r65281 1 1 /* $Id$ */ 2 2 /** @file 3 * EbmlWriter.cpp - EBML writer + WebM container 3 * EbmlWriter.cpp - EBML writer + WebM container handling. 4 4 */ 5 5 … … 316 316 struct OpusPrivData 317 317 { 318 OpusPrivData(uint32_t a_u32SampleRate, uint8_t a_u8Channels) 319 : u8Channels(a_u8Channels) 320 , u32SampleRate(a_u32SampleRate) { } 321 322 /** "OpusHead". */ 318 323 uint8_t au8Head[8] = { 0x4f, 0x70, 0x75, 0x73, 0x48, 0x65, 0x61, 0x64 }; 324 /** Must set to 1. */ 319 325 uint8_t u8Version = 1; 320 uint8_t c8Channels = 0;326 uint8_t u8Channels = 0; 321 327 uint16_t u16PreSkip = 0; 328 /** Sample rate *before* encoding to Opus. 329 * Note: This rate has nothing to do with the playback rate later! */ 322 330 uint32_t u32SampleRate = 0; 323 331 uint16_t u16Gain = 0; 332 /** Must stay 0 -- otherwise a mapping table must be appended 333 * right after this header. */ 324 334 uint8_t u8MappingFamily = 0; 325 335 }; … … 385 395 , m_offSegClusterStart(0) {} 386 396 387 int AddAudioTrack( float fSamplingHz, float fOutputHz, uint8_t cChannels, uint8_t cBitDepth)397 int AddAudioTrack(uint16_t uHz, uint8_t cChannels, uint8_t cBits) 388 398 { 389 399 #ifdef VBOX_WITH_LIBOPUS … … 395 405 m_lstTracks.push_back(TrackAudio); 396 406 407 if (uHz >= 44100) 408 uHz = 48000; 409 397 410 /** @todo Resolve codec type. */ 398 OpusPrivData opusPrivData ;411 OpusPrivData opusPrivData(uHz, cChannels); 399 412 400 413 m_Ebml.serializeUnsignedInteger(TrackUID, TrackAudio.uID, 4) … … 402 415 .serializeString(CodecID, "A_OPUS") 403 416 .serializeData(CodecPrivate, &opusPrivData, sizeof(opusPrivData)) 417 .serializeUnsignedInteger(CodecDelay, 0) 418 .serializeUnsignedInteger(SeekPreRoll, 80000000) 404 419 .subStart(Audio) 405 .serializeFloat(SamplingFrequency, fSamplingHz) 406 .serializeFloat(OutputSamplingFrequency, fOutputHz) 407 .serializeUnsignedInteger(Channels, cChannels) 408 .serializeUnsignedInteger(BitDepth, cBitDepth) 420 .serializeFloat(SamplingFrequency, (float)uHz) 421 .serializeUnsignedInteger(Channels, cChannels) 422 .serializeUnsignedInteger(BitDepth, cBits) 409 423 .subEnd(Audio) 410 424 .subEnd(TrackEntry); … … 412 426 return VINF_SUCCESS; 413 427 #else 414 RT_NOREF( fSamplingHz, fOutputHz, cChannels, cBitDepth);428 RT_NOREF(uHz, cChannels, cBits); 415 429 return VERR_NOT_SUPPORTED; 416 430 #endif … … 563 577 static uint16_t s_uTimecode = 0; 564 578 579 if (!m_fClusterOpen) 580 { 581 m_Ebml.subStart(Cluster) 582 .serializeUnsignedInteger(Timecode, 0); 583 m_fClusterOpen = true; 584 } 585 565 586 return writeSimpleBlockInternal(0 /** @todo FIX! */, s_uTimecode++, pvData, cbData, 0 /* Flags */); 566 587 } … … 759 780 } 760 781 761 int WebMWriter::AddAudioTrack( float fSamplingHz, float fOutputHz, uint8_t cChannels, uint8_t cBitDepth)762 { 763 return m_pImpl->AddAudioTrack( fSamplingHz, fOutputHz, cChannels, cBitDepth);782 int WebMWriter::AddAudioTrack(uint16_t uHz, uint8_t cChannels, uint8_t cBitDepth) 783 { 784 return m_pImpl->AddAudioTrack(uHz, cChannels, cBitDepth); 764 785 } 765 786 -
trunk/src/VBox/Main/src-client/EbmlWriter.h
r65256 r65281 110 110 int Close(void); 111 111 112 int AddAudioTrack( float fSamplingHz, float fOutputHz, uint8_t cChannels, uint8_t cBitDepth);112 int AddAudioTrack(uint16_t uHz, uint8_t cChannels, uint8_t cBits); 113 113 114 114 int AddVideoTrack(uint16_t uWidth, uint16_t uHeight, double dbFPS);
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器