Chromium Code Reviews| Index: content/renderer/media/video_destination_handler.h |
| =================================================================== |
| --- content/renderer/media/video_destination_handler.h (revision 0) |
| +++ content/renderer/media/video_destination_handler.h (revision 0) |
| @@ -0,0 +1,79 @@ |
| +// Copyright (c) 2013 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. |
| + |
| +#ifndef CONTENT_RENDERER_MEDIA_VIDEO_DESTINATION_HANDLER_H_ |
| +#define CONTENT_RENDERER_MEDIA_VIDEO_DESTINATION_HANDLER_H_ |
| + |
| +#include <string> |
| +#include <vector> |
| + |
| +#include "base/compiler_specific.h" |
| +#include "content/common/content_export.h" |
| +#include "third_party/libjingle/source/talk/media/base/videocapturer.h" |
| +#include "third_party/WebKit/Source/Platform/chromium/public/WebMediaStream.h" |
| + |
| +namespace content { |
| + |
| +class MediaStreamDependencyFactory; |
| +class MediaStreamRegistryInterface; |
| + |
| +// Interface used by the effects pepper plugin to output the processed frame |
| +// to the video track. |
| +class CONTENT_EXPORT FrameWriterInterface { |
| + public: |
| + // The ownership of the |frame| deosn't transfer. So the implementation of |
| + // this interface should make a copy of the |frame| before return. |
| + virtual void PutFrame(cricket::CapturedFrame* frame) = 0; |
| + |
| + protected: |
| + virtual ~FrameWriterInterface() {} |
| +}; |
| + |
| +// PpFrameWriter implements cricket::VideoCapturer so that it can be used in |
| +// the native video track's video source. It also implements |
| +// FrameWriterInterface, which will be used by the effects pepper plugin to |
| +// inject the processed frame. |
| +class CONTENT_EXPORT PpFrameWriter |
| + : public NON_EXPORTED_BASE(cricket::VideoCapturer), |
| + public FrameWriterInterface { |
| + public: |
| + PpFrameWriter(); |
| + virtual ~PpFrameWriter(); |
| + |
| + // cricket::VideoCapturer implementation. |
| + // These methods are accessed from a libJingle worker thread. |
| + virtual cricket::CaptureState Start( |
| + const cricket::VideoFormat& capture_format) OVERRIDE; |
| + virtual void Stop() OVERRIDE; |
| + virtual bool IsRunning() OVERRIDE; |
| + virtual bool GetPreferredFourccs(std::vector<uint32>* fourccs) OVERRIDE; |
| + virtual bool GetBestCaptureFormat(const cricket::VideoFormat& desired, |
| + cricket::VideoFormat* best_format) OVERRIDE; |
| + virtual bool IsScreencast() const OVERRIDE; |
| + |
| + // FrameWriterInterface implementation. |
| + virtual void PutFrame(cricket::CapturedFrame* frame) OVERRIDE; |
| + |
| + private: |
| + bool started_; |
| +}; |
| + |
| +// VideoDestinationHandler is a glue class between the webrtc MediaStream and |
| +// the effects pepper plugin host. |
| +class CONTENT_EXPORT VideoDestinationHandler { |
| + public: |
| + VideoDestinationHandler(MediaStreamDependencyFactory* factory, |
| + MediaStreamRegistryInterface* registry); |
| + bool Open(const std::string& url, FrameWriterInterface** frame_writer); |
|
wjia(left Chromium)
2013/04/30 18:32:11
Please add detailed comments for API functions.
Ronghua Wu (Left Chromium)
2013/04/30 22:42:17
Done.
|
| + virtual ~VideoDestinationHandler(); |
| + |
| + private: |
| + MediaStreamDependencyFactory* factory_; |
| + MediaStreamRegistryInterface* registry_; |
| +}; |
| + |
| +} // namespace content |
| + |
| +#endif // CONTENT_RENDERER_MEDIA_VIDEO_DESTINATION_HANDLER_H_ |
| + |
| Property changes on: content/renderer/media/video_destination_handler.h |
| ___________________________________________________________________ |
| Added: svn:eol-style |
| + LF |