Changeset 68372 in vbox for trunk/src/VBox/Main
- Timestamp:
- Aug 10, 2017 2:00:06 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/EbmlWriter.cpp
r68370 r68372 583 583 584 584 pTrack->Audio.uHz = uHz; 585 pTrack->Audio.csFrame = pTrack->Audio.uHz / (1000 /* s in ms */ / 20 ); /** @todo 20 ms of audio data. Make this configurable? */585 pTrack->Audio.csFrame = pTrack->Audio.uHz / (1000 /* s in ms */ / 20 /* ms */); /** @todo 20 ms of audio data. Make this configurable? */ 586 586 587 587 OpusPrivData opusPrivData(uHz, cChannels); … … 681 681 const void *a_pvData, size_t a_cbData, uint8_t a_fFlags) 682 682 { 683 Log Func(("SimpleBlock @ %RU64 (T%RU8, TS=%RU64, %zu bytes)\n",684 RTFileTell(m_Ebml.getFile()), a_pTrack->uTrack, a_uTimecode, a_cbData));683 Log3Func(("SimpleBlock @ %RU64 (T%RU8, TS=%RU64, %zu bytes)\n", 684 RTFileTell(m_Ebml.getFile()), a_pTrack->uTrack, a_uTimecode, a_cbData)); 685 685 686 686 /** @todo Mask out non-valid timecode bits, e.g. the upper 48 bits for a (default) 16-bit timecode. */ … … 809 809 Cluster.tcStart = tcPTS; 810 810 811 LogFunc(("tcPTSRaw=%RU64, tcPTS=%RU64, cbData=%RU64, uTimeStampMs=%RU64\n",812 tcPTSRaw, tcPTS, Cluster.cbData, uTimeStampMs));813 814 811 Cluster.tcLast = tcPTS; 815 812 … … 844 841 845 842 Cluster.fOpen = true; 843 Cluster.uID = a_pTrack->cTotalClusters; 846 844 Cluster.tcStart = tcPTS; 845 Cluster.tcLast = Cluster.tcStart; 847 846 Cluster.offCluster = RTFileTell(m_Ebml.getFile()); 848 847 Cluster.cBlocks = 0; 849 848 Cluster.cbData = 0; 850 849 851 LogFunc(("[C%RU64] Start @ tc=%RU64 off=%RU64\n", a_pTrack->cTotalClusters, Cluster.tcStart, Cluster.offCluster));850 LogFunc(("[C%RU64] Start @ tc=%RU64 off=%RU64\n", Cluster.uID, Cluster.tcStart, Cluster.offCluster)); 852 851 853 852 m_Ebml.subStart(MkvElem_Cluster) … … 857 856 } 858 857 859 LogFunc(("tcPTS=%RU64, s=%RU64, e=%RU64\n", tcPTS, CurSeg.CurCluster.tcStart, CurSeg.CurCluster.tcLast));860 861 858 Cluster.cBlocks += 1; 862 859 Cluster.cbData += cbData; 860 861 Log2Func(("[C%RU64] tcBlock=%RU64, tcClusterStart=%RU64, tcClusterLast=%RU64, cbData=%zu\n", 862 Cluster.uID, tcBlock, CurSeg.CurCluster.tcStart, CurSeg.CurCluster.tcLast, CurSeg.CurCluster.cbData)); 863 863 864 864 return writeSimpleBlockInternal(a_pTrack, tcBlock, pvData, cbData, VBOX_WEBM_BLOCK_FLAG_KEY_FRAME); … … 943 943 * Write Cues element. 944 944 */ 945 LogFunc(("Cues @ %RU64\n", RTFileTell(m_Ebml.getFile()))); 946 947 CurSeg.offCues = RTFileTell(m_Ebml.getFile()); 948 949 m_Ebml.subStart(MkvElem_Cues); 950 951 std::list<WebMCueEntry>::iterator itCuePoint = CurSeg.lstCues.begin(); 952 while (itCuePoint != CurSeg.lstCues.end()) 953 { 954 m_Ebml.subStart(MkvElem_CuePoint) 955 .serializeUnsignedInteger(MkvElem_CueTime, itCuePoint->time) 956 .subStart(MkvElem_CueTrackPositions) 957 .serializeUnsignedInteger(MkvElem_CueTrack, 1) 958 .serializeUnsignedInteger(MkvElem_CueClusterPosition, itCuePoint->loc - CurSeg.offStart, 8) 959 .subEnd(MkvElem_CueTrackPositions) 960 .subEnd(MkvElem_CuePoint); 961 962 itCuePoint++; 963 } 964 965 m_Ebml.subEnd(MkvElem_Cues) 966 .subEnd(MkvElem_Segment); 945 if (CurSeg.lstCues.size()) 946 { 947 LogFunc(("Cues @ %RU64\n", RTFileTell(m_Ebml.getFile()))); 948 949 CurSeg.offCues = RTFileTell(m_Ebml.getFile()); 950 951 m_Ebml.subStart(MkvElem_Cues); 952 953 std::list<WebMCueEntry>::iterator itCuePoint = CurSeg.lstCues.begin(); 954 while (itCuePoint != CurSeg.lstCues.end()) 955 { 956 LogFunc(("CuePoint @ %RU64\n", RTFileTell(m_Ebml.getFile()))); 957 958 m_Ebml.subStart(MkvElem_CuePoint) 959 .serializeUnsignedInteger(MkvElem_CueTime, itCuePoint->time) 960 .subStart(MkvElem_CueTrackPositions) 961 .serializeUnsignedInteger(MkvElem_CueTrack, 1) 962 .serializeUnsignedInteger(MkvElem_CueClusterPosition, itCuePoint->loc - CurSeg.offStart, 8) 963 .subEnd(MkvElem_CueTrackPositions) 964 .subEnd(MkvElem_CuePoint); 965 966 itCuePoint++; 967 } 968 969 m_Ebml.subEnd(MkvElem_Cues); 970 } 971 972 m_Ebml.subEnd(MkvElem_Segment); 967 973 968 974 /* … … 1010 1016 LogFunc(("SeekHead @ %RU64\n", CurSeg.offSeekInfo)); 1011 1017 1012 m_Ebml.subStart(MkvElem_SeekHead) 1013 1014 1018 m_Ebml.subStart(MkvElem_SeekHead); 1019 1020 m_Ebml.subStart(MkvElem_Seek) 1015 1021 .serializeUnsignedInteger(MkvElem_SeekID, MkvElem_Tracks) 1016 1022 .serializeUnsignedInteger(MkvElem_SeekPosition, CurSeg.offTracks - CurSeg.offStart, 8) 1017 .subEnd(MkvElem_Seek) 1018 1019 .subStart(MkvElem_Seek) 1020 .serializeUnsignedInteger(MkvElem_SeekID, MkvElem_Cues) 1021 .serializeUnsignedInteger(MkvElem_SeekPosition, CurSeg.offCues - CurSeg.offStart, 8) 1022 .subEnd(MkvElem_Seek) 1023 1024 .subStart(MkvElem_Seek) 1023 .subEnd(MkvElem_Seek); 1024 1025 if (CurSeg.lstCues.size()) 1026 { 1027 Assert(CurSeg.offCues - CurSeg.offStart > 0); /* Sanity. */ 1028 1029 m_Ebml.subStart(MkvElem_Seek) 1030 .serializeUnsignedInteger(MkvElem_SeekID, MkvElem_Cues) 1031 .serializeUnsignedInteger(MkvElem_SeekPosition, CurSeg.offCues - CurSeg.offStart, 8) 1032 .subEnd(MkvElem_Seek); 1033 } 1034 1035 m_Ebml.subStart(MkvElem_Seek) 1025 1036 .serializeUnsignedInteger(MkvElem_SeekID, MkvElem_Info) 1026 1037 .serializeUnsignedInteger(MkvElem_SeekPosition, CurSeg.offInfo - CurSeg.offStart, 8) 1027 .subEnd(MkvElem_Seek) 1028 1029 .subEnd(MkvElem_SeekHead);1038 .subEnd(MkvElem_Seek); 1039 1040 m_Ebml.subEnd(MkvElem_SeekHead); 1030 1041 1031 1042 //int64_t iFrameTime = (int64_t)1000 * 1 / 25; //m_Framerate.den / m_Framerate.num; /** @todo Fix this! */
Note:
See TracChangeset
for help on using the changeset viewer.