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

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

Issue 2253943004: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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/decoder_buffer_unittest.cc ('k') | media/base/media_tracks.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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/fake_demuxer_stream.h" 5 #include "media/base/fake_demuxer_stream.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <vector> 9 #include <vector>
10 10
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 UpdateVideoDecoderConfig(); 193 UpdateVideoDecoderConfig();
194 base::ResetAndReturn(&read_cb_).Run(kConfigChanged, NULL); 194 base::ResetAndReturn(&read_cb_).Run(kConfigChanged, NULL);
195 return; 195 return;
196 } 196 }
197 197
198 scoped_refptr<DecoderBuffer> buffer = CreateFakeVideoBufferForTest( 198 scoped_refptr<DecoderBuffer> buffer = CreateFakeVideoBufferForTest(
199 video_decoder_config_, current_timestamp_, duration_); 199 video_decoder_config_, current_timestamp_, duration_);
200 200
201 // TODO(xhwang): Output out-of-order buffers if needed. 201 // TODO(xhwang): Output out-of-order buffers if needed.
202 if (is_encrypted_) { 202 if (is_encrypted_) {
203 buffer->set_decrypt_config(base::WrapUnique( 203 buffer->set_decrypt_config(base::MakeUnique<DecryptConfig>(
204 new DecryptConfig(std::string(kKeyId, kKeyId + arraysize(kKeyId)), 204 std::string(kKeyId, kKeyId + arraysize(kKeyId)),
205 std::string(kIv, kIv + arraysize(kIv)), 205 std::string(kIv, kIv + arraysize(kIv)), std::vector<SubsampleEntry>()));
206 std::vector<SubsampleEntry>())));
207 } 206 }
208 buffer->set_timestamp(current_timestamp_); 207 buffer->set_timestamp(current_timestamp_);
209 buffer->set_duration(duration_); 208 buffer->set_duration(duration_);
210 buffer->set_splice_timestamp(splice_timestamp_); 209 buffer->set_splice_timestamp(splice_timestamp_);
211 current_timestamp_ += duration_; 210 current_timestamp_ += duration_;
212 211
213 num_buffers_left_in_current_config_--; 212 num_buffers_left_in_current_config_--;
214 if (num_buffers_left_in_current_config_ == 0) 213 if (num_buffers_left_in_current_config_ == 0)
215 num_configs_left_--; 214 num_configs_left_--;
216 215
(...skipping 13 matching lines...) Expand all
230 FakeDemuxerStreamProvider::~FakeDemuxerStreamProvider() { 229 FakeDemuxerStreamProvider::~FakeDemuxerStreamProvider() {
231 } 230 }
232 231
233 DemuxerStream* FakeDemuxerStreamProvider::GetStream(DemuxerStream::Type type) { 232 DemuxerStream* FakeDemuxerStreamProvider::GetStream(DemuxerStream::Type type) {
234 if (type == DemuxerStream::Type::AUDIO) 233 if (type == DemuxerStream::Type::AUDIO)
235 return nullptr; 234 return nullptr;
236 return &fake_video_stream_; 235 return &fake_video_stream_;
237 }; 236 };
238 237
239 } // namespace media 238 } // namespace media
OLDNEW
« no previous file with comments | « media/base/decoder_buffer_unittest.cc ('k') | media/base/media_tracks.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698