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

Side by Side Diff: remoting/client/software_video_renderer.h

Issue 910343002: Decompose VideoRenderer from VideoStub. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix perf test Created 5 years, 10 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #ifndef REMOTING_CLIENT_SOFTWARE_VIDEO_RENDERER_H_ 5 #ifndef REMOTING_CLIENT_SOFTWARE_VIDEO_RENDERER_H_
6 #define REMOTING_CLIENT_SOFTWARE_VIDEO_RENDERER_H_ 6 #define REMOTING_CLIENT_SOFTWARE_VIDEO_RENDERER_H_
7 7
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "remoting/client/chromoting_stats.h" 10 #include "remoting/client/chromoting_stats.h"
11 #include "remoting/client/frame_consumer_proxy.h" 11 #include "remoting/client/frame_consumer_proxy.h"
12 #include "remoting/client/frame_producer.h" 12 #include "remoting/client/frame_producer.h"
13 #include "remoting/client/video_renderer.h" 13 #include "remoting/client/video_renderer.h"
14 #include "remoting/protocol/video_stub.h"
14 #include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h" 15 #include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h"
15 16
16 namespace base { 17 namespace base {
17 class SingleThreadTaskRunner; 18 class SingleThreadTaskRunner;
18 } // namespace base 19 } // namespace base
19 20
20 namespace remoting { 21 namespace remoting {
21 22
22 class ChromotingStats; 23 class ChromotingStats;
23 24
24 // Implementation of VideoRenderer interface that decodes frame on CPU (on a 25 // Implementation of VideoRenderer interface that decodes frame on CPU (on a
25 // decode thread) and then passes decoded frames to a FrameConsumer. 26 // decode thread) and then passes decoded frames to a FrameConsumer.
26 // FrameProducer methods can be called on any thread. All other methods must be 27 // FrameProducer methods can be called on any thread. All other methods must be
27 // called on the main thread. Owned must ensure that this class outlives 28 // called on the main thread. Owned must ensure that this class outlives
28 // FrameConsumer (which calls FrameProducer interface). 29 // FrameConsumer (which calls FrameProducer interface).
29 class SoftwareVideoRenderer : public VideoRenderer, 30 class SoftwareVideoRenderer : public VideoRenderer,
31 public protocol::VideoStub,
30 public FrameProducer, 32 public FrameProducer,
31 public base::NonThreadSafe { 33 public base::NonThreadSafe {
32 public: 34 public:
33 // Creates an update decoder on |main_task_runner_| and |decode_task_runner_|, 35 // Creates an update decoder on |main_task_runner_| and |decode_task_runner_|,
34 // outputting to |consumer|. The |main_task_runner_| is responsible for 36 // outputting to |consumer|. The |main_task_runner_| is responsible for
35 // receiving and queueing packets. The |decode_task_runner_| is responsible 37 // receiving and queueing packets. The |decode_task_runner_| is responsible
36 // for decoding the video packets. 38 // for decoding the video packets.
37 // TODO(wez): Replace the ref-counted proxy with an owned FrameConsumer. 39 // TODO(wez): Replace the ref-counted proxy with an owned FrameConsumer.
38 SoftwareVideoRenderer( 40 SoftwareVideoRenderer(
39 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, 41 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner,
40 scoped_refptr<base::SingleThreadTaskRunner> decode_task_runner, 42 scoped_refptr<base::SingleThreadTaskRunner> decode_task_runner,
41 scoped_refptr<FrameConsumerProxy> consumer); 43 scoped_refptr<FrameConsumerProxy> consumer);
42 ~SoftwareVideoRenderer() override; 44 ~SoftwareVideoRenderer() override;
43 45
44 // VideoRenderer implementation. 46 // VideoRenderer interface.
45 void OnSessionConfig(const protocol::SessionConfig& config) override; 47 void OnSessionConfig(const protocol::SessionConfig& config) override;
46 ChromotingStats* GetStats() override; 48 ChromotingStats* GetStats() override;
49 protocol::VideoStub* GetVideoStub() override;
50
51 // protocol::VideoStub interface.
47 void ProcessVideoPacket(scoped_ptr<VideoPacket> packet, 52 void ProcessVideoPacket(scoped_ptr<VideoPacket> packet,
48 const base::Closure& done) override; 53 const base::Closure& done) override;
49 54
50 // FrameProducer implementation. These methods may be called before we are 55 // FrameProducer implementation. These methods may be called before we are
51 // Initialize()d, or we know the source screen size. These methods may be 56 // Initialize()d, or we know the source screen size. These methods may be
52 // called on any thread. 57 // called on any thread.
53 // 58 //
54 // TODO(sergeyu): On Android a separate display thread is used for drawing. 59 // TODO(sergeyu): On Android a separate display thread is used for drawing.
55 // FrameConsumer calls FrameProducer on that thread. Can we avoid having a 60 // FrameConsumer calls FrameProducer on that thread. Can we avoid having a
56 // separate display thread? E.g. can we do everything on the decode thread? 61 // separate display thread? E.g. can we do everything on the decode thread?
(...skipping 19 matching lines...) Expand all
76 int64 latest_event_timestamp_; 81 int64 latest_event_timestamp_;
77 82
78 base::WeakPtrFactory<SoftwareVideoRenderer> weak_factory_; 83 base::WeakPtrFactory<SoftwareVideoRenderer> weak_factory_;
79 84
80 DISALLOW_COPY_AND_ASSIGN(SoftwareVideoRenderer); 85 DISALLOW_COPY_AND_ASSIGN(SoftwareVideoRenderer);
81 }; 86 };
82 87
83 } // namespace remoting 88 } // namespace remoting
84 89
85 #endif // REMOTING_CLIENT_SOFTWARE_VIDEO_RENDERER_H_ 90 #endif // REMOTING_CLIENT_SOFTWARE_VIDEO_RENDERER_H_
OLDNEW
« no previous file with comments | « remoting/client/plugin/pepper_video_renderer_3d.cc ('k') | remoting/client/software_video_renderer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698