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

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

Issue 629493004: [Cast] Clean-up: Move max_unacked_frames into CongestionControl. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 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
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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 VideoEncoderImpl::VideoEncoderImpl( 55 VideoEncoderImpl::VideoEncoderImpl(
56 scoped_refptr<CastEnvironment> cast_environment, 56 scoped_refptr<CastEnvironment> cast_environment,
57 const VideoSenderConfig& video_config, 57 const VideoSenderConfig& video_config)
58 int max_unacked_frames)
59 : cast_environment_(cast_environment) { 58 : cast_environment_(cast_environment) {
60 if (video_config.codec == CODEC_VIDEO_VP8) { 59 if (video_config.codec == CODEC_VIDEO_VP8) {
61 encoder_.reset(new Vp8Encoder(video_config, max_unacked_frames)); 60 encoder_.reset(new Vp8Encoder(video_config));
62 cast_environment_->PostTask(CastEnvironment::VIDEO, 61 cast_environment_->PostTask(CastEnvironment::VIDEO,
63 FROM_HERE, 62 FROM_HERE,
64 base::Bind(&InitializeEncoderOnEncoderThread, 63 base::Bind(&InitializeEncoderOnEncoderThread,
65 cast_environment, 64 cast_environment,
66 encoder_.get())); 65 encoder_.get()));
67 #ifndef OFFICIAL_BUILD 66 #ifndef OFFICIAL_BUILD
68 } else if (video_config.codec == CODEC_VIDEO_FAKE) { 67 } else if (video_config.codec == CODEC_VIDEO_FAKE) {
69 encoder_.reset(new FakeSoftwareVideoEncoder(video_config)); 68 encoder_.reset(new FakeSoftwareVideoEncoder(video_config));
70 #endif 69 #endif
71 } else { 70 } else {
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 dynamic_config_.key_frame_requested = true; 116 dynamic_config_.key_frame_requested = true;
118 } 117 }
119 118
120 // Inform the encoder to only reference frames older or equal to frame_id; 119 // Inform the encoder to only reference frames older or equal to frame_id;
121 void VideoEncoderImpl::LatestFrameIdToReference(uint32 frame_id) { 120 void VideoEncoderImpl::LatestFrameIdToReference(uint32 frame_id) {
122 dynamic_config_.latest_frame_id_to_reference = frame_id; 121 dynamic_config_.latest_frame_id_to_reference = frame_id;
123 } 122 }
124 123
125 } // namespace cast 124 } // namespace cast
126 } // namespace media 125 } // namespace media
OLDNEW
« no previous file with comments | « media/cast/sender/video_encoder_impl.h ('k') | media/cast/sender/video_encoder_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698