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

Side by Side Diff: media/cast/sender/video_encoder_impl.cc

Issue 1905763002: Convert //media/cast 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
« no previous file with comments | « media/cast/sender/video_encoder_impl.h ('k') | media/cast/sender/video_encoder_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 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 "media/cast/sender/video_encoder_impl.h" 5 #include "media/cast/sender/video_encoder_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 22 matching lines...) Expand all
33 const scoped_refptr<media::VideoFrame>& video_frame, 33 const scoped_refptr<media::VideoFrame>& video_frame,
34 const base::TimeTicks& reference_time, 34 const base::TimeTicks& reference_time,
35 const VideoEncoderImpl::CodecDynamicConfig& dynamic_config, 35 const VideoEncoderImpl::CodecDynamicConfig& dynamic_config,
36 const VideoEncoderImpl::FrameEncodedCallback& frame_encoded_callback) { 36 const VideoEncoderImpl::FrameEncodedCallback& frame_encoded_callback) {
37 DCHECK(environment->CurrentlyOn(CastEnvironment::VIDEO)); 37 DCHECK(environment->CurrentlyOn(CastEnvironment::VIDEO));
38 if (dynamic_config.key_frame_requested) { 38 if (dynamic_config.key_frame_requested) {
39 encoder->GenerateKeyFrame(); 39 encoder->GenerateKeyFrame();
40 } 40 }
41 encoder->UpdateRates(dynamic_config.bit_rate); 41 encoder->UpdateRates(dynamic_config.bit_rate);
42 42
43 scoped_ptr<SenderEncodedFrame> encoded_frame(new SenderEncodedFrame()); 43 std::unique_ptr<SenderEncodedFrame> encoded_frame(new SenderEncodedFrame());
44 encoder->Encode(video_frame, reference_time, encoded_frame.get()); 44 encoder->Encode(video_frame, reference_time, encoded_frame.get());
45 encoded_frame->encode_completion_time = environment->Clock()->NowTicks(); 45 encoded_frame->encode_completion_time = environment->Clock()->NowTicks();
46 environment->PostTask( 46 environment->PostTask(
47 CastEnvironment::MAIN, 47 CastEnvironment::MAIN,
48 FROM_HERE, 48 FROM_HERE,
49 base::Bind(frame_encoded_callback, base::Passed(&encoded_frame))); 49 base::Bind(frame_encoded_callback, base::Passed(&encoded_frame)));
50 } 50 }
51 } // namespace 51 } // namespace
52 52
53 // static 53 // static
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 dynamic_config_.bit_rate = new_bit_rate; 131 dynamic_config_.bit_rate = new_bit_rate;
132 } 132 }
133 133
134 // Inform the encoder to encode the next frame as a key frame. 134 // Inform the encoder to encode the next frame as a key frame.
135 void VideoEncoderImpl::GenerateKeyFrame() { 135 void VideoEncoderImpl::GenerateKeyFrame() {
136 dynamic_config_.key_frame_requested = true; 136 dynamic_config_.key_frame_requested = true;
137 } 137 }
138 138
139 } // namespace cast 139 } // namespace cast
140 } // namespace media 140 } // namespace media
OLDNEW
« no previous file with comments | « media/cast/sender/video_encoder_impl.h ('k') | media/cast/sender/video_encoder_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698