Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(202)

Side by Side Diff: media/formats/mp2t/ts_section_pes.cc

Issue 2158923004: Convert media constants to constexpr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/formats/mp2t/ts_section_pes.h" 5 #include "media/formats/mp2t/ts_section_pes.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 RCHECK(bit_reader.ReadBits(40, &dts_section)); 215 RCHECK(bit_reader.ReadBits(40, &dts_section));
216 RCHECK((((pts_section >> 36) & 0xf) == 0x3) && 216 RCHECK((((pts_section >> 36) & 0xf) == 0x3) &&
217 IsTimestampSectionValid(pts_section)); 217 IsTimestampSectionValid(pts_section));
218 RCHECK((((dts_section >> 36) & 0xf) == 0x1) && 218 RCHECK((((dts_section >> 36) & 0xf) == 0x1) &&
219 IsTimestampSectionValid(dts_section)); 219 IsTimestampSectionValid(dts_section));
220 is_pts_valid = true; 220 is_pts_valid = true;
221 is_dts_valid = true; 221 is_dts_valid = true;
222 } 222 }
223 223
224 // Convert and unroll the timestamps. 224 // Convert and unroll the timestamps.
225 base::TimeDelta media_pts(kNoTimestamp()); 225 base::TimeDelta media_pts(kNoTimestamp);
226 DecodeTimestamp media_dts(kNoDecodeTimestamp()); 226 DecodeTimestamp media_dts(kNoDecodeTimestamp());
227 if (is_pts_valid) { 227 if (is_pts_valid) {
228 int64_t pts = timestamp_unroller_->GetUnrolledTimestamp( 228 int64_t pts = timestamp_unroller_->GetUnrolledTimestamp(
229 ConvertTimestampSectionToTimestamp(pts_section)); 229 ConvertTimestampSectionToTimestamp(pts_section));
230 media_pts = base::TimeDelta::FromMicroseconds((1000 * pts) / 90); 230 media_pts = base::TimeDelta::FromMicroseconds((1000 * pts) / 90);
231 } 231 }
232 if (is_dts_valid) { 232 if (is_dts_valid) {
233 int64_t dts = timestamp_unroller_->GetUnrolledTimestamp( 233 int64_t dts = timestamp_unroller_->GetUnrolledTimestamp(
234 ConvertTimestampSectionToTimestamp(dts_section)); 234 ConvertTimestampSectionToTimestamp(dts_section));
235 media_dts = DecodeTimestamp::FromMicroseconds((1000 * dts) / 90); 235 media_dts = DecodeTimestamp::FromMicroseconds((1000 * dts) / 90);
(...skipping 16 matching lines...) Expand all
252 return es_parser_->Parse(&raw_pes[es_offset], es_size, media_pts, media_dts); 252 return es_parser_->Parse(&raw_pes[es_offset], es_size, media_pts, media_dts);
253 } 253 }
254 254
255 void TsSectionPes::ResetPesState() { 255 void TsSectionPes::ResetPesState() {
256 pes_byte_queue_.Reset(); 256 pes_byte_queue_.Reset();
257 wait_for_pusi_ = true; 257 wait_for_pusi_ = true;
258 } 258 }
259 259
260 } // namespace mp2t 260 } // namespace mp2t
261 } // namespace media 261 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698