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: media/cast/sender/video_encoder_impl.cc

Issue 1143363005: Revert of [Cast] Compute utilization metrics and add performance overlay. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 25 matching lines...) Expand all
36 const VideoEncoderImpl::CodecDynamicConfig& dynamic_config, 36 const VideoEncoderImpl::CodecDynamicConfig& dynamic_config,
37 const VideoEncoderImpl::FrameEncodedCallback& frame_encoded_callback) { 37 const VideoEncoderImpl::FrameEncodedCallback& frame_encoded_callback) {
38 DCHECK(environment->CurrentlyOn(CastEnvironment::VIDEO)); 38 DCHECK(environment->CurrentlyOn(CastEnvironment::VIDEO));
39 if (dynamic_config.key_frame_requested) { 39 if (dynamic_config.key_frame_requested) {
40 encoder->GenerateKeyFrame(); 40 encoder->GenerateKeyFrame();
41 } 41 }
42 encoder->LatestFrameIdToReference( 42 encoder->LatestFrameIdToReference(
43 dynamic_config.latest_frame_id_to_reference); 43 dynamic_config.latest_frame_id_to_reference);
44 encoder->UpdateRates(dynamic_config.bit_rate); 44 encoder->UpdateRates(dynamic_config.bit_rate);
45 45
46 scoped_ptr<SenderEncodedFrame> encoded_frame(new SenderEncodedFrame()); 46 scoped_ptr<EncodedFrame> encoded_frame(new EncodedFrame());
47 encoder->Encode(video_frame, reference_time, encoded_frame.get()); 47 encoder->Encode(video_frame, reference_time, encoded_frame.get());
48 environment->PostTask( 48 environment->PostTask(
49 CastEnvironment::MAIN, 49 CastEnvironment::MAIN,
50 FROM_HERE, 50 FROM_HERE,
51 base::Bind(frame_encoded_callback, base::Passed(&encoded_frame))); 51 base::Bind(frame_encoded_callback, base::Passed(&encoded_frame)));
52 } 52 }
53 } // namespace 53 } // namespace
54 54
55 // static 55 // static
56 bool VideoEncoderImpl::IsSupported(const VideoSenderConfig& video_config) { 56 bool VideoEncoderImpl::IsSupported(const VideoSenderConfig& video_config) {
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 dynamic_config_.key_frame_requested = true; 139 dynamic_config_.key_frame_requested = true;
140 } 140 }
141 141
142 // Inform the encoder to only reference frames older or equal to frame_id; 142 // Inform the encoder to only reference frames older or equal to frame_id;
143 void VideoEncoderImpl::LatestFrameIdToReference(uint32 frame_id) { 143 void VideoEncoderImpl::LatestFrameIdToReference(uint32 frame_id) {
144 dynamic_config_.latest_frame_id_to_reference = frame_id; 144 dynamic_config_.latest_frame_id_to_reference = frame_id;
145 } 145 }
146 146
147 } // namespace cast 147 } // namespace cast
148 } // namespace media 148 } // 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