diff options
author | fbarchard@chromium.org <fbarchard@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-30 00:30:01 +0000 |
---|---|---|
committer | fbarchard@chromium.org <fbarchard@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-30 00:30:01 +0000 |
commit | 9e91e12a3f7a9629245cc8f37547531d3a98b1f2 (patch) | |
tree | c2c7cf66ea85324e366a61e19c290af5eb54839d /media | |
parent | f5ff98854a36d071860f450a43a269648eceff42 (diff) | |
download | chromium_src-9e91e12a3f7a9629245cc8f37547531d3a98b1f2.zip chromium_src-9e91e12a3f7a9629245cc8f37547531d3a98b1f2.tar.gz chromium_src-9e91e12a3f7a9629245cc8f37547531d3a98b1f2.tar.bz2 |
media player wtl_render - video renderer
Review URL: http://codereview.chromium.org/99117
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14922 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media')
-rw-r--r-- | media/player/wtl_renderer.cc | 24 | ||||
-rw-r--r-- | media/player/wtl_renderer.h | 35 |
2 files changed, 59 insertions, 0 deletions
diff --git a/media/player/wtl_renderer.cc b/media/player/wtl_renderer.cc new file mode 100644 index 0000000..20056d3 --- /dev/null +++ b/media/player/wtl_renderer.cc @@ -0,0 +1,24 @@ +// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "media/player/stdafx.h" +#include "media/player/view.h" + +WtlVideoRenderer::WtlVideoRenderer(WtlVideoWindow* window) + : window_(window) { +} + +bool WtlVideoRenderer::OnInitialize(size_t width, size_t height) { + window_->SetSize(width, height); + return true; +} + +void WtlVideoRenderer::OnPaintNeeded() { + window_->Invalidate(); +} + +void WtlVideoRenderer::GetCurrentFrame( + scoped_refptr<media::VideoFrame>* frame_out) { + return media::VideoRendererBase::GetCurrentFrame(frame_out); +} diff --git a/media/player/wtl_renderer.h b/media/player/wtl_renderer.h new file mode 100644 index 0000000..33724f5 --- /dev/null +++ b/media/player/wtl_renderer.h @@ -0,0 +1,35 @@ +// Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this +// source code is governed by a BSD-style license that can be found in the +// LICENSE file. + +// Video renderer for media player. + +#ifndef MEDIA_PLAYER_WTL_RENDERER_H_ +#define MEDIA_PLAYER_WTL_RENDERER_H_ + +#include "media/filters/video_renderer_base.h" + +class WtlVideoWindow; + +class WtlVideoRenderer : public media::VideoRendererBase { + public: + explicit WtlVideoRenderer(WtlVideoWindow* window); + virtual bool OnInitialize(size_t width, size_t height); + virtual void OnPaintNeeded(); + void GetCurrentFrame(scoped_refptr<media::VideoFrame>* frame_out); + + static bool IsMediaFormatSupported(const media::MediaFormat& format) { + return media::VideoRendererBase::IsMediaFormatSupported(format); + } + + private: + friend class scoped_refptr<WtlVideoRenderer>; + virtual ~WtlVideoRenderer() {} + + WtlVideoWindow* window_; + + DISALLOW_COPY_AND_ASSIGN(WtlVideoRenderer); +}; + +#endif // MEDIA_PLAYER_WTL_RENDERER_H_ + |