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(); |