OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "remoting/client/rectangle_update_decoder.h" | 5 #include "remoting/client/rectangle_update_decoder.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 config)); | 95 config)); |
96 return; | 96 return; |
97 } | 97 } |
98 | 98 |
99 // Initialize decoder based on the selected codec. | 99 // Initialize decoder based on the selected codec. |
100 ChannelConfig::Codec codec = config.video_config().codec; | 100 ChannelConfig::Codec codec = config.video_config().codec; |
101 if (codec == ChannelConfig::CODEC_VERBATIM) { | 101 if (codec == ChannelConfig::CODEC_VERBATIM) { |
102 decoder_.reset(new VideoDecoderVerbatim()); | 102 decoder_.reset(new VideoDecoderVerbatim()); |
103 } else if (codec == ChannelConfig::CODEC_VP8) { | 103 } else if (codec == ChannelConfig::CODEC_VP8) { |
104 decoder_ = VideoDecoderVpx::CreateForVP8(); | 104 decoder_ = VideoDecoderVpx::CreateForVP8(); |
| 105 } else if (codec == ChannelConfig::CODEC_VP9) { |
| 106 decoder_ = VideoDecoderVpx::CreateForVP9(); |
105 } else { | 107 } else { |
106 NOTREACHED() << "Invalid Encoding found: " << codec; | 108 NOTREACHED() << "Invalid Encoding found: " << codec; |
107 } | 109 } |
108 | 110 |
109 if (consumer_->GetPixelFormat() == FrameConsumer::FORMAT_RGBA) { | 111 if (consumer_->GetPixelFormat() == FrameConsumer::FORMAT_RGBA) { |
110 scoped_ptr<VideoDecoder> wrapper( | 112 scoped_ptr<VideoDecoder> wrapper( |
111 new RgbToBgrVideoDecoderFilter(decoder_.Pass())); | 113 new RgbToBgrVideoDecoderFilter(decoder_.Pass())); |
112 decoder_ = wrapper.Pass(); | 114 decoder_ = wrapper.Pass(); |
113 } | 115 } |
114 } | 116 } |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
338 | 340 |
339 done.Run(); | 341 done.Run(); |
340 } | 342 } |
341 | 343 |
342 ChromotingStats* RectangleUpdateDecoder::GetStats() { | 344 ChromotingStats* RectangleUpdateDecoder::GetStats() { |
343 DCHECK(main_task_runner_->BelongsToCurrentThread()); | 345 DCHECK(main_task_runner_->BelongsToCurrentThread()); |
344 return &stats_; | 346 return &stats_; |
345 } | 347 } |
346 | 348 |
347 } // namespace remoting | 349 } // namespace remoting |
OLD | NEW |