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

Side by Side Diff: chromecast/media/cma/pipeline/av_pipeline_impl.cc

Issue 1875623002: Convert //chromecast from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "chromecast/media/cma/pipeline/av_pipeline_impl.h" 5 #include "chromecast/media/cma/pipeline/av_pipeline_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback_helpers.h" 10 #include "base/callback_helpers.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 } 57 }
58 58
59 AvPipelineImpl::~AvPipelineImpl() { 59 AvPipelineImpl::~AvPipelineImpl() {
60 DCHECK(thread_checker_.CalledOnValidThread()); 60 DCHECK(thread_checker_.CalledOnValidThread());
61 61
62 if (media_keys_ && media_keys_callback_id_ != kNoCallbackId) 62 if (media_keys_ && media_keys_callback_id_ != kNoCallbackId)
63 media_keys_->UnregisterPlayer(media_keys_callback_id_); 63 media_keys_->UnregisterPlayer(media_keys_callback_id_);
64 } 64 }
65 65
66 void AvPipelineImpl::SetCodedFrameProvider( 66 void AvPipelineImpl::SetCodedFrameProvider(
67 scoped_ptr<CodedFrameProvider> frame_provider, 67 std::unique_ptr<CodedFrameProvider> frame_provider,
68 size_t max_buffer_size, 68 size_t max_buffer_size,
69 size_t max_frame_size) { 69 size_t max_frame_size) {
70 DCHECK_EQ(state_, kUninitialized); 70 DCHECK_EQ(state_, kUninitialized);
71 DCHECK(frame_provider); 71 DCHECK(frame_provider);
72 72
73 // Wrap the incoming frame provider to add some buffering capabilities. 73 // Wrap the incoming frame provider to add some buffering capabilities.
74 frame_provider_.reset(new BufferingFrameProvider( 74 frame_provider_.reset(new BufferingFrameProvider(
75 std::move(frame_provider), max_buffer_size, max_frame_size, 75 std::move(frame_provider), max_buffer_size, max_frame_size,
76 base::Bind(&AvPipelineImpl::OnDataBuffered, weak_this_))); 76 base::Bind(&AvPipelineImpl::OnDataBuffered, weak_this_)));
77 } 77 }
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 return; 199 return;
200 200
201 DCHECK(!pushed_buffer_); 201 DCHECK(!pushed_buffer_);
202 202
203 // Break the feeding loop when the end of stream is reached. 203 // Break the feeding loop when the end of stream is reached.
204 if (pending_buffer_->end_of_stream()) { 204 if (pending_buffer_->end_of_stream()) {
205 CMALOG(kLogControl) << __FUNCTION__ << ": EOS reached, stopped feeding"; 205 CMALOG(kLogControl) << __FUNCTION__ << ": EOS reached, stopped feeding";
206 enable_feeding_ = false; 206 enable_feeding_ = false;
207 } 207 }
208 208
209 scoped_ptr<DecryptContextImpl> decrypt_context; 209 std::unique_ptr<DecryptContextImpl> decrypt_context;
210 if (!pending_buffer_->end_of_stream() && 210 if (!pending_buffer_->end_of_stream() &&
211 pending_buffer_->decrypt_config()) { 211 pending_buffer_->decrypt_config()) {
212 // Verify that CDM has the key ID. 212 // Verify that CDM has the key ID.
213 // Should not send the frame if the key ID is not available yet. 213 // Should not send the frame if the key ID is not available yet.
214 std::string key_id(pending_buffer_->decrypt_config()->key_id()); 214 std::string key_id(pending_buffer_->decrypt_config()->key_id());
215 if (!media_keys_) { 215 if (!media_keys_) {
216 CMALOG(kLogControl) << "No CDM for frame: pts=" 216 CMALOG(kLogControl) << "No CDM for frame: pts="
217 << pending_buffer_->timestamp(); 217 << pending_buffer_->timestamp();
218 return; 218 return;
219 } 219 }
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 } 366 }
367 } 367 }
368 368
369 // The frame is playable: remove it from the list of non playable frames. 369 // The frame is playable: remove it from the list of non playable frames.
370 non_playable_frames_.pop_front(); 370 non_playable_frames_.pop_front();
371 } 371 }
372 } 372 }
373 373
374 } // namespace media 374 } // namespace media
375 } // namespace chromecast 375 } // namespace chromecast
OLDNEW
« no previous file with comments | « chromecast/media/cma/pipeline/av_pipeline_impl.h ('k') | chromecast/media/cma/pipeline/media_pipeline_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698