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

Unified Diff: remoting/codec/video_decoder_verbatim.cc

Issue 1298863003: Remove VideoDecoder::Initialize(). (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
« no previous file with comments | « remoting/codec/video_decoder_verbatim.h ('k') | remoting/codec/video_decoder_vpx.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..b35013a750e520b56d91feb70965700c5a6975e7 100644
--- a/remoting/codec/video_decoder_verbatim.cc
+++ b/remoting/codec/video_decoder_verbatim.cc
@@ -13,20 +13,20 @@ 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]);
+ updated_region_.Clear();
+ }
}
-}
-bool VideoDecoderVerbatim::DecodePacket(const VideoPacket& packet) {
webrtc::DesktopRegion region;
const char* in = packet.data().data();
« no previous file with comments | « remoting/codec/video_decoder_verbatim.h ('k') | remoting/codec/video_decoder_vpx.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698