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

Unified Diff: media/cast/sender/external_video_encoder.cc

Issue 2113783002: Refactoring: Merge VideoSenderConfig and AudioSenderConfig. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed mek's comment. Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/cast/sender/external_video_encoder.h ('k') | media/cast/sender/fake_software_video_encoder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/cast/sender/external_video_encoder.cc
diff --git a/media/cast/sender/external_video_encoder.cc b/media/cast/sender/external_video_encoder.cc
index bff088cc1e91f4460c63bff985e2dd173ddc968f..1348f7f674d3a954a5987886d3bc1420c38d3742 100644
--- a/media/cast/sender/external_video_encoder.cc
+++ b/media/cast/sender/external_video_encoder.cc
@@ -124,7 +124,7 @@ class ExternalVideoEncoder::VEAClientImpl
const scoped_refptr<CastEnvironment>& cast_environment,
const scoped_refptr<base::SingleThreadTaskRunner>& encoder_task_runner,
std::unique_ptr<media::VideoEncodeAccelerator> vea,
- int max_frame_rate,
+ double max_frame_rate,
const StatusChangeCallback& status_change_cb,
const CreateVideoEncodeMemoryCallback& create_video_encode_memory_cb)
: cast_environment_(cast_environment),
@@ -176,8 +176,8 @@ class ExternalVideoEncoder::VEAClientImpl
DCHECK(task_runner_->RunsTasksOnCurrentThread());
requested_bit_rate_ = bit_rate;
- video_encode_accelerator_->RequestEncodingParametersChange(bit_rate,
- max_frame_rate_);
+ video_encode_accelerator_->RequestEncodingParametersChange(
+ bit_rate, static_cast<uint32_t>(max_frame_rate_ + 0.5));
}
// The destruction call back of the copied video frame to free its use of
@@ -592,7 +592,7 @@ class ExternalVideoEncoder::VEAClientImpl
const scoped_refptr<CastEnvironment> cast_environment_;
const scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
- const int max_frame_rate_;
+ const double max_frame_rate_;
const StatusChangeCallback status_change_cb_; // Must be run on MAIN thread.
const CreateVideoEncodeMemoryCallback create_video_encode_memory_cb_;
std::unique_ptr<media::VideoEncodeAccelerator> video_encode_accelerator_;
@@ -647,7 +647,7 @@ class ExternalVideoEncoder::VEAClientImpl
};
// static
-bool ExternalVideoEncoder::IsSupported(const VideoSenderConfig& video_config) {
+bool ExternalVideoEncoder::IsSupported(const FrameSenderConfig& video_config) {
if (video_config.codec != CODEC_VIDEO_VP8 &&
video_config.codec != CODEC_VIDEO_H264)
return false;
@@ -661,7 +661,7 @@ bool ExternalVideoEncoder::IsSupported(const VideoSenderConfig& video_config) {
ExternalVideoEncoder::ExternalVideoEncoder(
const scoped_refptr<CastEnvironment>& cast_environment,
- const VideoSenderConfig& video_config,
+ const FrameSenderConfig& video_config,
const gfx::Size& frame_size,
FrameId first_frame_id,
const StatusChangeCallback& status_change_cb,
@@ -730,7 +730,7 @@ void ExternalVideoEncoder::GenerateKeyFrame() {
}
void ExternalVideoEncoder::OnCreateVideoEncodeAccelerator(
- const VideoSenderConfig& video_config,
+ const FrameSenderConfig& video_config,
FrameId first_frame_id,
const StatusChangeCallback& status_change_cb,
scoped_refptr<base::SingleThreadTaskRunner> encoder_task_runner,
@@ -782,7 +782,7 @@ void ExternalVideoEncoder::OnCreateVideoEncodeAccelerator(
SizeAdaptableExternalVideoEncoder::SizeAdaptableExternalVideoEncoder(
const scoped_refptr<CastEnvironment>& cast_environment,
- const VideoSenderConfig& video_config,
+ const FrameSenderConfig& video_config,
const StatusChangeCallback& status_change_cb,
const CreateVideoEncodeAcceleratorCallback& create_vea_cb,
const CreateVideoEncodeMemoryCallback& create_video_encode_memory_cb)
« no previous file with comments | « media/cast/sender/external_video_encoder.h ('k') | media/cast/sender/fake_software_video_encoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698