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

Unified Diff: media/cast/video_sender/video_encoder_impl.cc

Issue 116623002: Cast: Adding support for GPU accelerated encode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed dependency on content Created 7 years 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
Index: media/cast/video_sender/video_encoder_impl.cc
diff --git a/media/cast/video_sender/video_encoder.cc b/media/cast/video_sender/video_encoder_impl.cc
similarity index 83%
rename from media/cast/video_sender/video_encoder.cc
rename to media/cast/video_sender/video_encoder_impl.cc
index faa78d3a3e7ece77dbca91836bbdefdc2cceb6e2..6b155c6bee9bacd969dba8c3d2e8e463fe3fc0cc 100644
--- a/media/cast/video_sender/video_encoder.cc
+++ b/media/cast/video_sender/video_encoder_impl.cc
@@ -9,6 +9,7 @@
#include "base/message_loop/message_loop.h"
#include "media/base/video_frame.h"
#include "media/cast/cast_defines.h"
+#include "media/cast/video_sender/video_encoder_impl.h"
namespace media {
namespace cast {
@@ -19,9 +20,10 @@ void LogFrameEncodedEvent(CastEnvironment* const cast_environment,
GetVideoRtpTimestamp(capture_time), kFrameIdUnknown);
}
-VideoEncoder::VideoEncoder(scoped_refptr<CastEnvironment> cast_environment,
- const VideoSenderConfig& video_config,
- uint8 max_unacked_frames)
+VideoEncoderImpl::VideoEncoderImpl(
+ scoped_refptr<CastEnvironment> cast_environment,
+ const VideoSenderConfig& video_config,
+ uint8 max_unacked_frames)
: video_config_(video_config),
cast_environment_(cast_environment),
skip_next_frame_(false),
@@ -37,9 +39,9 @@ VideoEncoder::VideoEncoder(scoped_refptr<CastEnvironment> cast_environment,
dynamic_config_.bit_rate = video_config.start_bitrate;
}
-VideoEncoder::~VideoEncoder() {}
+VideoEncoderImpl::~VideoEncoderImpl() {}
-bool VideoEncoder::EncodeVideoFrame(
+bool VideoEncoderImpl::EncodeVideoFrame(
const scoped_refptr<media::VideoFrame>& video_frame,
const base::TimeTicks& capture_time,
const FrameEncodedCallback& frame_encoded_callback) {
@@ -55,7 +57,7 @@ bool VideoEncoder::EncodeVideoFrame(
cast_environment_->Logging()->InsertFrameEvent(kVideoFrameSentToEncoder,
GetVideoRtpTimestamp(capture_time), kFrameIdUnknown);
cast_environment_->PostTask(CastEnvironment::VIDEO_ENCODER, FROM_HERE,
- base::Bind(&VideoEncoder::EncodeVideoFrameEncoderThread,
+ base::Bind(&VideoEncoderImpl::EncodeVideoFrameEncoderThread,
base::Unretained(this), video_frame, capture_time,
dynamic_config_, frame_encoded_callback));
@@ -63,7 +65,7 @@ bool VideoEncoder::EncodeVideoFrame(
return true;
}
-void VideoEncoder::EncodeVideoFrameEncoderThread(
+void VideoEncoderImpl::EncodeVideoFrameEncoderThread(
const scoped_refptr<media::VideoFrame>& video_frame,
const base::TimeTicks& capture_time,
const CodecDynamicConfig& dynamic_config,
@@ -96,26 +98,26 @@ void VideoEncoder::EncodeVideoFrameEncoderThread(
}
// Inform the encoder about the new target bit rate.
-void VideoEncoder::SetBitRate(int new_bit_rate) {
+void VideoEncoderImpl::SetBitRate(int new_bit_rate) {
dynamic_config_.bit_rate = new_bit_rate;
}
// Inform the encoder to not encode the next frame.
-void VideoEncoder::SkipNextFrame(bool skip_next_frame) {
+void VideoEncoderImpl::SkipNextFrame(bool skip_next_frame) {
skip_next_frame_ = skip_next_frame;
}
// Inform the encoder to encode the next frame as a key frame.
-void VideoEncoder::GenerateKeyFrame() {
+void VideoEncoderImpl::GenerateKeyFrame() {
dynamic_config_.key_frame_requested = true;
}
// Inform the encoder to only reference frames older or equal to frame_id;
-void VideoEncoder::LatestFrameIdToReference(uint32 frame_id) {
+void VideoEncoderImpl::LatestFrameIdToReference(uint32 frame_id) {
dynamic_config_.latest_frame_id_to_reference = frame_id;
}
-int VideoEncoder::NumberOfSkippedFrames() const {
+int VideoEncoderImpl::NumberOfSkippedFrames() const {
return skip_count_;
}

Powered by Google App Engine
This is Rietveld 408576698