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

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

Issue 10447035: Introducing DecoderBuffer and general Buffer cleanup. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: s/2011/2012/ Created 8 years, 6 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/base/test_data_util.h » ('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 scoped_refptr<StreamParserBuffer> StreamParserBuffer::CreateEOSBuffer() { 11 scoped_refptr<StreamParserBuffer> StreamParserBuffer::CreateEOSBuffer() {
12 return make_scoped_refptr(new StreamParserBuffer(NULL, 0, false)); 12 return make_scoped_refptr(new StreamParserBuffer(NULL, 0, false));
13 } 13 }
14 14
15 scoped_refptr<StreamParserBuffer> StreamParserBuffer::CopyFrom( 15 scoped_refptr<StreamParserBuffer> StreamParserBuffer::CopyFrom(
16 const uint8* data, int data_size, bool is_keyframe) { 16 const uint8* data, int data_size, bool is_keyframe) {
17 return make_scoped_refptr( 17 return make_scoped_refptr(
18 new StreamParserBuffer(data, data_size, is_keyframe)); 18 new StreamParserBuffer(data, data_size, is_keyframe));
19 } 19 }
20 20
21 base::TimeDelta StreamParserBuffer::GetEndTimestamp() const { 21 base::TimeDelta StreamParserBuffer::GetEndTimestamp() const {
22 DCHECK(GetTimestamp() != kNoTimestamp()); 22 DCHECK(GetTimestamp() != kNoTimestamp());
23 DCHECK(GetDuration() != kNoTimestamp()); 23 DCHECK(GetDuration() != kNoTimestamp());
24 return GetTimestamp() + GetDuration(); 24 return GetTimestamp() + GetDuration();
25 } 25 }
26 26
27 StreamParserBuffer::StreamParserBuffer(const uint8* data, int data_size, 27 StreamParserBuffer::StreamParserBuffer(const uint8* data, int data_size,
28 bool is_keyframe) 28 bool is_keyframe)
29 : DataBuffer(data, data_size), 29 : DecoderBuffer(data, data_size),
30 is_keyframe_(is_keyframe) { 30 is_keyframe_(is_keyframe) {
31 SetDuration(kNoTimestamp()); 31 SetDuration(kNoTimestamp());
32 } 32 }
33 33
34 34
35 StreamParserBuffer::~StreamParserBuffer() { 35 StreamParserBuffer::~StreamParserBuffer() {
36 } 36 }
37 37
38 } // namespace media 38 } // namespace media
OLDNEW
« no previous file with comments | « media/base/stream_parser_buffer.h ('k') | media/base/test_data_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698