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

Unified Diff: remoting/client/software_video_renderer.h

Issue 1288063004: Simplify FrameConsumer interface. Remove FrameProducer interface. (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/client/plugin/pepper_video_renderer_2d.cc ('k') | remoting/client/software_video_renderer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/client/software_video_renderer.h
diff --git a/remoting/client/software_video_renderer.h b/remoting/client/software_video_renderer.h
index 4fbf7fdda1f6a24decaf870064243b8010765cac..595d22a1868409941281c0a444bd4fd443c632e1 100644
--- a/remoting/client/software_video_renderer.h
+++ b/remoting/client/software_video_renderer.h
@@ -7,9 +7,9 @@
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
+#include "base/memory/weak_ptr.h"
+#include "base/threading/thread_checker.h"
#include "remoting/client/chromoting_stats.h"
-#include "remoting/client/frame_consumer_proxy.h"
-#include "remoting/client/frame_producer.h"
#include "remoting/client/video_renderer.h"
#include "remoting/protocol/video_stub.h"
#include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h"
@@ -18,28 +18,28 @@ namespace base {
class SingleThreadTaskRunner;
} // namespace base
+namespace webrtc {
+class DesktopFrame;
+} // namespace webrtc;
+
namespace remoting {
class ChromotingStats;
+class FrameConsumer;
+class VideoDecoder;
// Implementation of VideoRenderer interface that decodes frame on CPU (on a
// decode thread) and then passes decoded frames to a FrameConsumer.
-// FrameProducer methods can be called on any thread. All other methods must be
-// called on the main thread. Owned must ensure that this class outlives
-// FrameConsumer (which calls FrameProducer interface).
class SoftwareVideoRenderer : public VideoRenderer,
- public protocol::VideoStub,
- public FrameProducer,
- public base::NonThreadSafe {
+ public protocol::VideoStub {
public:
// Creates an update decoder on |main_task_runner_| and |decode_task_runner_|,
// outputting to |consumer|. The |main_task_runner_| is responsible for
// receiving and queueing packets. The |decode_task_runner_| is responsible
// for decoding the video packets.
SoftwareVideoRenderer(
- scoped_refptr<base::SingleThreadTaskRunner> main_task_runner,
scoped_refptr<base::SingleThreadTaskRunner> decode_task_runner,
- scoped_ptr<FrameConsumerProxy> consumer);
+ FrameConsumer* consumer);
~SoftwareVideoRenderer() override;
// VideoRenderer interface.
@@ -51,31 +51,25 @@ class SoftwareVideoRenderer : public VideoRenderer,
void ProcessVideoPacket(scoped_ptr<VideoPacket> packet,
const base::Closure& done) override;
- // FrameProducer implementation. These methods may be called before we are
- // Initialize()d, or we know the source screen size. These methods may be
- // called on any thread.
- //
- // TODO(sergeyu): On Android a separate display thread is used for drawing.
- // FrameConsumer calls FrameProducer on that thread. Can we avoid having a
- // separate display thread? E.g. can we do everything on the decode thread?
- void DrawBuffer(webrtc::DesktopFrame* buffer) override;
- void InvalidateRegion(const webrtc::DesktopRegion& region) override;
- void RequestReturnBuffers(const base::Closure& done) override;
- void SetOutputSizeAndClip(const webrtc::DesktopSize& view_size,
- const webrtc::DesktopRect& clip_area) override;
-
private:
- class Core;
-
- // Callback method when a VideoPacket is processed. |decode_start| contains
- // the timestamp when the packet will start to be processed.
- void OnPacketDone(base::Time decode_start, const base::Closure& done);
+ void RenderFrame(base::TimeTicks decode_start_time,
+ const base::Closure& done,
+ scoped_ptr<webrtc::DesktopFrame> frame);
+ void OnFrameRendered(base::TimeTicks paint_start_time,
+ const base::Closure& done);
scoped_refptr<base::SingleThreadTaskRunner> decode_task_runner_;
- scoped_ptr<Core> core_;
+ FrameConsumer* consumer_;
+
+ scoped_ptr<VideoDecoder> decoder_;
+
+ webrtc::DesktopSize source_size_;
+ webrtc::DesktopVector source_dpi_;
ChromotingStats stats_;
+ base::ThreadChecker thread_checker_;
+
base::WeakPtrFactory<SoftwareVideoRenderer> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(SoftwareVideoRenderer);
« no previous file with comments | « remoting/client/plugin/pepper_video_renderer_2d.cc ('k') | remoting/client/software_video_renderer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698