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

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

Issue 2416183002: media: Use native DemuxerStream enum types in media mojo interfaces (Closed)
Patch Set: comments addressed Created 4 years, 2 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
« no previous file with comments | « media/base/ipc/media_param_traits_macros.h ('k') | media/base/stream_parser_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 <algorithm> 7 #include <algorithm>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 const char* StreamParserBuffer::GetTypeName() const { 128 const char* StreamParserBuffer::GetTypeName() const {
129 switch (type()) { 129 switch (type()) {
130 case DemuxerStream::AUDIO: 130 case DemuxerStream::AUDIO:
131 return "audio"; 131 return "audio";
132 case DemuxerStream::VIDEO: 132 case DemuxerStream::VIDEO:
133 return "video"; 133 return "video";
134 case DemuxerStream::TEXT: 134 case DemuxerStream::TEXT:
135 return "text"; 135 return "text";
136 case DemuxerStream::UNKNOWN: 136 case DemuxerStream::UNKNOWN:
137 return "unknown"; 137 return "unknown";
138 case DemuxerStream::NUM_TYPES:
139 // Fall-through to NOTREACHED().
140 break;
141 } 138 }
142 NOTREACHED(); 139 NOTREACHED();
143 return ""; 140 return "";
144 } 141 }
145 142
146 void StreamParserBuffer::ConvertToSpliceBuffer( 143 void StreamParserBuffer::ConvertToSpliceBuffer(
147 const BufferQueue& pre_splice_buffers) { 144 const BufferQueue& pre_splice_buffers) {
148 DCHECK(splice_buffers_.empty()); 145 DCHECK(splice_buffers_.empty());
149 DCHECK(duration() > base::TimeDelta()) 146 DCHECK(duration() > base::TimeDelta())
150 << "Only buffers with a valid duration can convert to a splice buffer." 147 << "Only buffers with a valid duration can convert to a splice buffer."
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 std::make_pair(kInfiniteDuration, base::TimeDelta())); 232 std::make_pair(kInfiniteDuration, base::TimeDelta()));
236 } 233 }
237 234
238 void StreamParserBuffer::set_timestamp(base::TimeDelta timestamp) { 235 void StreamParserBuffer::set_timestamp(base::TimeDelta timestamp) {
239 DecoderBuffer::set_timestamp(timestamp); 236 DecoderBuffer::set_timestamp(timestamp);
240 if (preroll_buffer_.get()) 237 if (preroll_buffer_.get())
241 preroll_buffer_->set_timestamp(timestamp); 238 preroll_buffer_->set_timestamp(timestamp);
242 } 239 }
243 240
244 } // namespace media 241 } // namespace media
OLDNEW
« no previous file with comments | « media/base/ipc/media_param_traits_macros.h ('k') | media/base/stream_parser_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698