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

Unified Diff: remoting/codec/video_decoder_verbatim.cc

Issue 1288063004: Simplify FrameConsumer interface. Remove FrameProducer interface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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
Index: remoting/codec/video_decoder_verbatim.cc
diff --git a/remoting/codec/video_decoder_verbatim.cc b/remoting/codec/video_decoder_verbatim.cc
index dd8c2f331d8cd84ce515a27136fcec053f9db4a9..1c2fba10dcb35fc44c102ecd6368140458c1d2de 100644
--- a/remoting/codec/video_decoder_verbatim.cc
+++ b/remoting/codec/video_decoder_verbatim.cc
@@ -13,20 +13,16 @@ VideoDecoderVerbatim::VideoDecoderVerbatim() {}
VideoDecoderVerbatim::~VideoDecoderVerbatim() {}
-void VideoDecoderVerbatim::Initialize(const webrtc::DesktopSize& screen_size) {
- updated_region_.Clear();
- screen_buffer_.reset();
-
- screen_size_ = screen_size;
+bool VideoDecoderVerbatim::DecodePacket(const VideoPacket& packet) {
+ webrtc::DesktopSize screen_size(packet.format().screen_width(),
+ packet.format().screen_height());
// Allocate the screen buffer, if necessary.
- if (!screen_size_.is_empty()) {
- screen_buffer_.reset(
- new uint8[screen_size_.width() * screen_size_.height() *
- kBytesPerPixel]);
+ if (!screen_size.equals(screen_size_)) {
+ screen_size_ = screen_size;
+ screen_buffer_.reset(new uint8[screen_size_.width() *
+ screen_size_.height() * kBytesPerPixel]);
}
-}
-bool VideoDecoderVerbatim::DecodePacket(const VideoPacket& packet) {
webrtc::DesktopRegion region;
const char* in = packet.data().data();

Powered by Google App Engine
This is Rietveld 408576698