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

Unified Diff: remoting/base/encoder_row_based.cc

Issue 8493020: Move code in src/remoting to the new callbacks. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: - Created 9 years, 1 month 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 | « remoting/base/encoder_row_based.h ('k') | remoting/base/encoder_vp8.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/base/encoder_row_based.cc
diff --git a/remoting/base/encoder_row_based.cc b/remoting/base/encoder_row_based.cc
index c8a801fa0caa186166c17ae9c27a94fad65640bb..332cde377091f513863dfe07f98e39449cabc86e 100644
--- a/remoting/base/encoder_row_based.cc
+++ b/remoting/base/encoder_row_based.cc
@@ -56,14 +56,15 @@ EncoderRowBased::EncoderRowBased(Compressor* compressor,
EncoderRowBased::~EncoderRowBased() {}
-void EncoderRowBased::Encode(scoped_refptr<CaptureData> capture_data,
- bool key_frame,
- DataAvailableCallback* data_available_callback) {
+void EncoderRowBased::Encode(
+ scoped_refptr<CaptureData> capture_data,
+ bool key_frame,
+ const DataAvailableCallback& data_available_callback) {
CHECK(capture_data->pixel_format() == media::VideoFrame::RGB32)
<< "RowBased Encoder only works with RGB32. Got "
<< capture_data->pixel_format();
capture_data_ = capture_data;
- callback_.reset(data_available_callback);
+ callback_ = data_available_callback;
const SkRegion& region = capture_data->dirty_region();
SkRegion::Iterator iter(region);
@@ -74,7 +75,7 @@ void EncoderRowBased::Encode(scoped_refptr<CaptureData> capture_data,
}
capture_data_ = NULL;
- callback_.reset();
+ callback_.Reset();
}
void EncoderRowBased::EncodeRect(const SkIRect& rect, bool last) {
@@ -131,7 +132,7 @@ void EncoderRowBased::EncodeRect(const SkIRect& rect, bool last) {
// If we have filled the message or we have reached the end of stream.
if (filled == packet_size_ || !compress_again) {
packet->mutable_data()->resize(filled);
- callback_->Run(packet);
+ callback_.Run(packet);
packet = NULL;
}
« no previous file with comments | « remoting/base/encoder_row_based.h ('k') | remoting/base/encoder_vp8.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698