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

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

Issue 11929015: Tighten up media::DecoderBuffer API contract for end of stream buffers (round 2). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixes Created 7 years, 10 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/decoder_buffer_unittest.cc ('k') | media/filters/decrypting_audio_decoder.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 #include "media/base/buffers.h" 8 #include "media/base/buffers.h"
9 9
10 namespace media { 10 namespace media {
(...skipping 17 matching lines...) Expand all
28 void StreamParserBuffer::SetDecodeTimestamp(const base::TimeDelta& timestamp) { 28 void StreamParserBuffer::SetDecodeTimestamp(const base::TimeDelta& timestamp) {
29 decode_timestamp_ = timestamp; 29 decode_timestamp_ = timestamp;
30 } 30 }
31 31
32 StreamParserBuffer::StreamParserBuffer(const uint8* data, int data_size, 32 StreamParserBuffer::StreamParserBuffer(const uint8* data, int data_size,
33 bool is_keyframe) 33 bool is_keyframe)
34 : DecoderBuffer(data, data_size), 34 : DecoderBuffer(data, data_size),
35 is_keyframe_(is_keyframe), 35 is_keyframe_(is_keyframe),
36 decode_timestamp_(kNoTimestamp()), 36 decode_timestamp_(kNoTimestamp()),
37 config_id_(kInvalidConfigId) { 37 config_id_(kInvalidConfigId) {
38 SetDuration(kNoTimestamp()); 38 // TODO(scherkus): Should DataBuffer constructor accept a timestamp and
39 // duration to force clients to set them? Today they end up being zero which
40 // is both a common and valid value and could lead to bugs.
41 if (data) {
42 SetDuration(kNoTimestamp());
43 }
39 } 44 }
40 45
41 StreamParserBuffer::~StreamParserBuffer() { 46 StreamParserBuffer::~StreamParserBuffer() {
42 } 47 }
43 48
44 int StreamParserBuffer::GetConfigId() const { 49 int StreamParserBuffer::GetConfigId() const {
45 return config_id_; 50 return config_id_;
46 } 51 }
47 52
48 void StreamParserBuffer::SetConfigId(int config_id) { 53 void StreamParserBuffer::SetConfigId(int config_id) {
49 config_id_ = config_id; 54 config_id_ = config_id;
50 } 55 }
51 56
52 } // namespace media 57 } // namespace media
OLDNEW
« no previous file with comments | « media/base/decoder_buffer_unittest.cc ('k') | media/filters/decrypting_audio_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698