From 497e9a05decbcd344d774e52c1b89cdece525d99 Mon Sep 17 00:00:00 2001 From: liaoyuke Date: Fri, 26 Jun 2015 12:47:35 -0700 Subject: Updated Test Driver with video decoding capabilities so that when a video sample is received from remote host, it can be decoded and rendered to buffer in memory. BUG= Review URL: https://codereview.chromium.org/1190383007 Cr-Commit-Position: refs/heads/master@{#336445} --- remoting/test/test_video_renderer.h | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) (limited to 'remoting/test/test_video_renderer.h') diff --git a/remoting/test/test_video_renderer.h b/remoting/test/test_video_renderer.h index fcf122a..acaa739 100644 --- a/remoting/test/test_video_renderer.h +++ b/remoting/test/test_video_renderer.h @@ -5,11 +5,22 @@ #ifndef REMOTING_TEST_TEST_VIDEO_RENDERER_H_ #define REMOTING_TEST_TEST_VIDEO_RENDERER_H_ -#include "base/callback.h" #include "base/memory/scoped_ptr.h" +#include "base/threading/thread_checker.h" +#include "media/base/video_frame.h" #include "remoting/client/video_renderer.h" +#include "remoting/protocol/session_config.h" #include "remoting/protocol/video_stub.h" +namespace base { +class Thread; +class SingleThreadTaskRunner; +} + +namespace webrtc { +class DesktopFrame; +} + namespace remoting { namespace test { @@ -24,13 +35,26 @@ class TestVideoRenderer : public VideoRenderer, public protocol::VideoStub { ChromotingStats* GetStats() override; protocol::VideoStub* GetVideoStub() override; - private: // protocol::VideoStub interface. void ProcessVideoPacket(scoped_ptr video_packet, const base::Closure& done) override; - // Track the number of populated video frames which have been received. - int video_frames_processed_; + // Returns a copy of the current buffer. + scoped_ptr GetBufferForTest() const; + + private: + // The actual implementation resides in Core class. + class Core; + scoped_ptr core_; + + // Used to ensure TestVideoRenderer methods are called on the same thread. + base::ThreadChecker thread_checker_; + + // Used to decode and process video packets. + scoped_ptr video_decode_thread_; + + // Used to post tasks to video decode thread. + scoped_refptr video_decode_task_runner_; DISALLOW_COPY_AND_ASSIGN(TestVideoRenderer); }; -- cgit v1.1