Chromium Code Reviews| 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..5abb1187224a75174e9990983c630a0b3f0de176 100644 |
| --- a/remoting/codec/video_decoder_verbatim.cc |
| +++ b/remoting/codec/video_decoder_verbatim.cc |
| @@ -13,20 +13,19 @@ VideoDecoderVerbatim::VideoDecoderVerbatim() {} |
| VideoDecoderVerbatim::~VideoDecoderVerbatim() {} |
| -void VideoDecoderVerbatim::Initialize(const webrtc::DesktopSize& screen_size) { |
| - updated_region_.Clear(); |
| - screen_buffer_.reset(); |
| - |
| - screen_size_ = screen_size; |
| - // Allocate the screen buffer, if necessary. |
| - if (!screen_size_.is_empty()) { |
| - screen_buffer_.reset( |
| - new uint8[screen_size_.width() * screen_size_.height() * |
| - kBytesPerPixel]); |
| +bool VideoDecoderVerbatim::DecodePacket(const VideoPacket& packet) { |
| + if (packet.format().has_screen_width() && |
| + packet.format().has_screen_height()) { |
| + webrtc::DesktopSize screen_size(packet.format().screen_width(), |
| + packet.format().screen_height()); |
| + // Allocate the screen buffer, if necessary. |
| + if (!screen_size.equals(screen_size_)) { |
| + screen_size_ = screen_size; |
| + screen_buffer_.reset(new uint8[screen_size_.width() * |
| + screen_size_.height() * kBytesPerPixel]); |
|
Jamie
2015/08/19 00:16:32
Do you need to call updated_region_.Clear() as wel
Sergey Ulanov
2015/08/19 00:43:53
Done.
|
| + } |
| } |
| -} |
| -bool VideoDecoderVerbatim::DecodePacket(const VideoPacket& packet) { |
| webrtc::DesktopRegion region; |
| const char* in = packet.data().data(); |