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

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

Issue 10382200: Update WebMClusterParser to compute durations for all StreamParserBuffers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address CR comments Created 8 years, 7 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 | « no previous file | media/filters/chunk_demuxer_unittest.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
11 StreamParserBuffer::StreamParserBuffer(const uint8* data, int data_size, 11 StreamParserBuffer::StreamParserBuffer(const uint8* data, int data_size,
12 bool is_keyframe) 12 bool is_keyframe)
13 : DataBuffer(data, data_size), 13 : DataBuffer(data, data_size),
14 is_keyframe_(is_keyframe) { 14 is_keyframe_(is_keyframe) {
15 SetDuration(kNoTimestamp());
15 } 16 }
16 17
17 scoped_refptr<StreamParserBuffer> StreamParserBuffer::CreateEOSBuffer() { 18 scoped_refptr<StreamParserBuffer> StreamParserBuffer::CreateEOSBuffer() {
18 return make_scoped_refptr(new StreamParserBuffer(NULL, 0, false)); 19 return make_scoped_refptr(new StreamParserBuffer(NULL, 0, false));
19 } 20 }
20 21
21 scoped_refptr<StreamParserBuffer> StreamParserBuffer::CopyFrom( 22 scoped_refptr<StreamParserBuffer> StreamParserBuffer::CopyFrom(
22 const uint8* data, int data_size, bool is_keyframe) { 23 const uint8* data, int data_size, bool is_keyframe) {
23 return make_scoped_refptr( 24 return make_scoped_refptr(
24 new StreamParserBuffer(data, data_size, is_keyframe)); 25 new StreamParserBuffer(data, data_size, is_keyframe));
25 } 26 }
26 27
27 base::TimeDelta StreamParserBuffer::GetEndTimestamp() const { 28 base::TimeDelta StreamParserBuffer::GetEndTimestamp() const {
28 DCHECK(GetTimestamp() != kNoTimestamp()); 29 DCHECK(GetTimestamp() != kNoTimestamp());
29 DCHECK(GetDuration() != kNoTimestamp()); 30 DCHECK(GetDuration() != kNoTimestamp());
30 return GetTimestamp() + GetDuration(); 31 return GetTimestamp() + GetDuration();
31 } 32 }
32 33
33 } // namespace media 34 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | media/filters/chunk_demuxer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698