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

Side by Side Diff: media/base/stream_parser_buffer.cc

Issue 10692053: Remove buffer duration calculation from WebMClusterParser and update SourceBufferStream accordingly (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase ToT + fix clang errors Created 8 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 | Annotate | Revision Log
« no previous file with comments | « media/base/stream_parser_buffer.h ('k') | media/filters/chunk_demuxer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/base/stream_parser_buffer.h" 5 #include "media/base/stream_parser_buffer.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 8
9 namespace media { 9 namespace media {
10 10
(...skipping 10 matching lines...) Expand all
21 base::TimeDelta StreamParserBuffer::GetDecodeTimestamp() const { 21 base::TimeDelta StreamParserBuffer::GetDecodeTimestamp() const {
22 if (decode_timestamp_ == kNoTimestamp()) 22 if (decode_timestamp_ == kNoTimestamp())
23 return GetTimestamp(); 23 return GetTimestamp();
24 return decode_timestamp_; 24 return decode_timestamp_;
25 } 25 }
26 26
27 void StreamParserBuffer::SetDecodeTimestamp(const base::TimeDelta& timestamp) { 27 void StreamParserBuffer::SetDecodeTimestamp(const base::TimeDelta& timestamp) {
28 decode_timestamp_ = timestamp; 28 decode_timestamp_ = timestamp;
29 } 29 }
30 30
31 base::TimeDelta StreamParserBuffer::GetEndTimestamp() const {
32 DCHECK(GetDecodeTimestamp() != kNoTimestamp());
33 DCHECK(GetDuration() != kNoTimestamp());
34 return GetDecodeTimestamp() + GetDuration();
35 }
36
37 StreamParserBuffer::StreamParserBuffer(const uint8* data, int data_size, 31 StreamParserBuffer::StreamParserBuffer(const uint8* data, int data_size,
38 bool is_keyframe) 32 bool is_keyframe)
39 : DecoderBuffer(data, data_size), 33 : DecoderBuffer(data, data_size),
40 is_keyframe_(is_keyframe), 34 is_keyframe_(is_keyframe),
41 decode_timestamp_(kNoTimestamp()) { 35 decode_timestamp_(kNoTimestamp()) {
42 SetDuration(kNoTimestamp()); 36 SetDuration(kNoTimestamp());
43 } 37 }
44 38
45
46 StreamParserBuffer::~StreamParserBuffer() { 39 StreamParserBuffer::~StreamParserBuffer() {
47 } 40 }
48 41
49 } // namespace media 42 } // namespace media
OLDNEW
« no previous file with comments | « media/base/stream_parser_buffer.h ('k') | media/filters/chunk_demuxer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698