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" |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/single_thread_task_runner.h" | 12 #include "base/single_thread_task_runner.h" |
13 #include "remoting/base/util.h" | 13 #include "remoting/base/util.h" |
14 #include "remoting/codec/video_decoder.h" | 14 #include "remoting/codec/video_decoder.h" |
15 #include "remoting/codec/video_decoder_verbatim.h" | |
16 #include "remoting/codec/video_decoder_vp8.h" | 15 #include "remoting/codec/video_decoder_vp8.h" |
17 #include "remoting/client/frame_consumer.h" | 16 #include "remoting/client/frame_consumer.h" |
18 #include "remoting/protocol/session_config.h" | 17 #include "remoting/protocol/session_config.h" |
19 #include "third_party/webrtc/modules/desktop_capture/desktop_frame.h" | 18 #include "third_party/webrtc/modules/desktop_capture/desktop_frame.h" |
20 | 19 |
21 using base::Passed; | 20 using base::Passed; |
22 using remoting::protocol::ChannelConfig; | 21 using remoting::protocol::ChannelConfig; |
23 using remoting::protocol::SessionConfig; | 22 using remoting::protocol::SessionConfig; |
24 | 23 |
25 namespace remoting { | 24 namespace remoting { |
(...skipping 12 matching lines...) Expand all Loading... | |
38 paint_scheduled_(false), | 37 paint_scheduled_(false), |
39 latest_sequence_number_(0) { | 38 latest_sequence_number_(0) { |
40 } | 39 } |
41 | 40 |
42 RectangleUpdateDecoder::~RectangleUpdateDecoder() { | 41 RectangleUpdateDecoder::~RectangleUpdateDecoder() { |
43 } | 42 } |
44 | 43 |
45 void RectangleUpdateDecoder::Initialize(const SessionConfig& config) { | 44 void RectangleUpdateDecoder::Initialize(const SessionConfig& config) { |
46 // Initialize decoder based on the selected codec. | 45 // Initialize decoder based on the selected codec. |
47 ChannelConfig::Codec codec = config.video_config().codec; | 46 ChannelConfig::Codec codec = config.video_config().codec; |
48 if (codec == ChannelConfig::CODEC_VERBATIM) { | 47 if (codec == ChannelConfig::CODEC_VP8) { |
Wez
2013/09/12 14:20:15
Need to restore the CODEC_VERBATIM case here.
Sergey Ulanov
2013/09/12 19:18:45
Done.
| |
49 decoder_.reset(new VideoDecoderVerbatim()); | |
50 } else if (codec == ChannelConfig::CODEC_VP8) { | |
51 decoder_.reset(new VideoDecoderVp8()); | 48 decoder_.reset(new VideoDecoderVp8()); |
52 } else { | 49 } else { |
53 NOTREACHED() << "Invalid Encoding found: " << codec; | 50 NOTREACHED() << "Invalid Encoding found: " << codec; |
54 } | 51 } |
55 } | 52 } |
56 | 53 |
57 void RectangleUpdateDecoder::DecodePacket(scoped_ptr<VideoPacket> packet, | 54 void RectangleUpdateDecoder::DecodePacket(scoped_ptr<VideoPacket> packet, |
58 const base::Closure& done) { | 55 const base::Closure& done) { |
59 DCHECK(decode_task_runner_->BelongsToCurrentThread()); | 56 DCHECK(decode_task_runner_->BelongsToCurrentThread()); |
60 | 57 |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
288 | 285 |
289 done.Run(); | 286 done.Run(); |
290 } | 287 } |
291 | 288 |
292 ChromotingStats* RectangleUpdateDecoder::GetStats() { | 289 ChromotingStats* RectangleUpdateDecoder::GetStats() { |
293 DCHECK(main_task_runner_->BelongsToCurrentThread()); | 290 DCHECK(main_task_runner_->BelongsToCurrentThread()); |
294 return &stats_; | 291 return &stats_; |
295 } | 292 } |
296 | 293 |
297 } // namespace remoting | 294 } // namespace remoting |
OLD | NEW |