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

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

Issue 868803007: [Cast] Refactor ExternalVideoEncoder for cleaner/simpler encapsulation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add clarification comments and TODOs. Created 5 years, 10 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/fake_video_encode_accelerator_factory.cc ('k') | no next file » | 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_sender.h" 5 #include "media/cast/sender/video_sender.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cstring> 8 #include <cstring>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 cast_environment, video_config, 83 cast_environment, video_config,
84 base::Bind(&VideoSender::OnEncoderInitialized, 84 base::Bind(&VideoSender::OnEncoderInitialized,
85 weak_factory_.GetWeakPtr(), initialization_cb))); 85 weak_factory_.GetWeakPtr(), initialization_cb)));
86 } 86 }
87 #endif // defined(OS_MACOSX) 87 #endif // defined(OS_MACOSX)
88 #if !defined(OS_IOS) 88 #if !defined(OS_IOS)
89 if (video_config.use_external_encoder) { 89 if (video_config.use_external_encoder) {
90 video_encoder_.reset(new ExternalVideoEncoder( 90 video_encoder_.reset(new ExternalVideoEncoder(
91 cast_environment, 91 cast_environment,
92 video_config, 92 video_config,
93 gfx::Size(video_config.width, video_config.height),
93 base::Bind(&VideoSender::OnEncoderInitialized, 94 base::Bind(&VideoSender::OnEncoderInitialized,
94 weak_factory_.GetWeakPtr(), initialization_cb), 95 weak_factory_.GetWeakPtr(), initialization_cb),
95 create_vea_cb, 96 create_vea_cb,
96 create_video_encode_mem_cb)); 97 create_video_encode_mem_cb));
97 } else if (!video_encoder_) { 98 } else if (!video_encoder_) {
98 // Software encoder is initialized immediately. 99 // Software encoder is initialized immediately.
99 video_encoder_.reset(new VideoEncoderImpl(cast_environment, video_config)); 100 video_encoder_.reset(new VideoEncoderImpl(cast_environment, video_config));
100 cast_initialization_status_ = STATUS_VIDEO_INITIALIZED; 101 cast_initialization_status_ = STATUS_VIDEO_INITIALIZED;
101 } 102 }
102 #endif // !defined(OS_IOS) 103 #endif // !defined(OS_IOS)
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 DCHECK_GE(frames_in_encoder_, 0); 252 DCHECK_GE(frames_in_encoder_, 0);
252 253
253 duration_in_encoder_ = 254 duration_in_encoder_ =
254 last_enqueued_frame_reference_time_ - encoded_frame->reference_time; 255 last_enqueued_frame_reference_time_ - encoded_frame->reference_time;
255 256
256 SendEncodedFrame(encoder_bitrate, encoded_frame.Pass()); 257 SendEncodedFrame(encoder_bitrate, encoded_frame.Pass());
257 } 258 }
258 259
259 } // namespace cast 260 } // namespace cast
260 } // namespace media 261 } // namespace media
OLDNEW
« no previous file with comments | « media/cast/sender/fake_video_encode_accelerator_factory.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698