diff options
author | liaoyuke <liaoyuke@chromium.org> | 2015-06-26 12:47:35 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-06-26 19:48:02 +0000 |
commit | 497e9a05decbcd344d774e52c1b89cdece525d99 (patch) | |
tree | 11bb0dc3617d808ce3e86056dacec87843a8ad73 /remoting/test/test_video_renderer.h | |
parent | 72ffbe61199a03312123efe7e9829251cfe5c407 (diff) | |
download | chromium_src-497e9a05decbcd344d774e52c1b89cdece525d99.zip chromium_src-497e9a05decbcd344d774e52c1b89cdece525d99.tar.gz chromium_src-497e9a05decbcd344d774e52c1b89cdece525d99.tar.bz2 |
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}
Diffstat (limited to 'remoting/test/test_video_renderer.h')
-rw-r--r-- | remoting/test/test_video_renderer.h | 32 |
1 files changed, 28 insertions, 4 deletions
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<VideoPacket> 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<webrtc::DesktopFrame> GetBufferForTest() const; + + private: + // The actual implementation resides in Core class. + class Core; + scoped_ptr<Core> 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<base::Thread> video_decode_thread_; + + // Used to post tasks to video decode thread. + scoped_refptr<base::SingleThreadTaskRunner> video_decode_task_runner_; DISALLOW_COPY_AND_ASSIGN(TestVideoRenderer); }; |