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,95 @@ |
| +// 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> |
|
wjia(left Chromium)
2013/05/03 02:00:38
not needed since vector is used as part of API in
Ronghua Wu (Left Chromium)
2013/05/03 05:37:28
True. But somehow lint is not happy if I don't inc
|
| + |
| +#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" |
|
wjia(left Chromium)
2013/05/03 02:00:38
not used?
Ronghua Wu (Left Chromium)
2013/05/03 05:37:28
Done.
|
| + |
| +namespace webkit { |
| +namespace ppapi { |
| +class PPB_ImageData_Impl; |
| +} |
| +} |
| + |
| +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 |image_data| deosn't transfer. So the implementation |
| + // of this interface should make a copy of the |image_data| before return. |
| + virtual void PutFrame(webkit::ppapi::PPB_ImageData_Impl* image_data, |
| + int64 time_stamp_ns) = 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 |
|
wjia(left Chromium)
2013/05/03 02:00:38
How is lifetime of PpFrameWriter managed? It will
Ronghua Wu (Left Chromium)
2013/05/03 05:37:28
Good question. The PpFrameWriter is owned by the m
|
| + : 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(webkit::ppapi::PPB_ImageData_Impl* image_data, |
| + int64 time_stamp_ns) OVERRIDE; |
| + |
| + private: |
| + bool started_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(PpFrameWriter); |
| +}; |
| + |
| +// VideoDestinationHandler is a glue class between the webrtc MediaStream and |
| +// the effects pepper plugin host. |
| +class CONTENT_EXPORT VideoDestinationHandler { |
|
wjia(left Chromium)
2013/05/03 02:00:38
Will this class be expanded in the future? If not,
Ronghua Wu (Left Chromium)
2013/05/03 05:37:28
Didn't seem will be expanded from what I can tell.
|
| + public: |
| + VideoDestinationHandler(MediaStreamDependencyFactory* factory, |
| + MediaStreamRegistryInterface* registry); |
| + // Instantiates and adds a new video track to the MediaStream specified by |
| + // |url|. Returns a handler for delivering frames to the new video track as |
| + // |frame_writer|. |
| + // Returns true on success and false on failure. |
| + bool Open(const std::string& url, FrameWriterInterface** frame_writer); |
| + virtual ~VideoDestinationHandler(); |
| + |
| + private: |
| + MediaStreamDependencyFactory* factory_; |
| + MediaStreamRegistryInterface* registry_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(VideoDestinationHandler); |
| +}; |
| + |
| +} // 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 |