OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_RENDERER_MEDIA_WEBRTC_VIDEO_DESTINATION_HANDLER_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_WEBRTC_VIDEO_DESTINATION_HANDLER_H_ |
6 #define CONTENT_RENDERER_MEDIA_WEBRTC_VIDEO_DESTINATION_HANDLER_H_ | 6 #define CONTENT_RENDERER_MEDIA_WEBRTC_VIDEO_DESTINATION_HANDLER_H_ |
7 | 7 |
| 8 #include <stdint.h> |
| 9 |
8 #include <string> | 10 #include <string> |
9 #include <vector> | 11 #include <vector> |
10 | 12 |
11 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
| 14 #include "base/macros.h" |
12 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
13 #include "content/common/content_export.h" | 16 #include "content/common/content_export.h" |
14 | 17 |
15 namespace content { | 18 namespace content { |
16 | 19 |
17 class PeerConnectionDependencyFactory; | 20 class PeerConnectionDependencyFactory; |
18 class MediaStreamRegistryInterface; | 21 class MediaStreamRegistryInterface; |
19 class PPB_ImageData_Impl; | 22 class PPB_ImageData_Impl; |
20 | 23 |
21 // Interface used by a Pepper plugin to output frames to a video track. | 24 // Interface used by a Pepper plugin to output frames to a video track. |
22 class CONTENT_EXPORT FrameWriterInterface { | 25 class CONTENT_EXPORT FrameWriterInterface { |
23 public: | 26 public: |
24 // The ownership of the |image_data| doesn't transfer. So the implementation | 27 // The ownership of the |image_data| doesn't transfer. So the implementation |
25 // of this interface should make a copy of the |image_data| before return. | 28 // of this interface should make a copy of the |image_data| before return. |
26 virtual void PutFrame(PPB_ImageData_Impl* image_data, | 29 virtual void PutFrame(PPB_ImageData_Impl* image_data, |
27 int64 time_stamp_ns) = 0; | 30 int64_t time_stamp_ns) = 0; |
28 virtual ~FrameWriterInterface() {} | 31 virtual ~FrameWriterInterface() {} |
29 }; | 32 }; |
30 | 33 |
31 // PepperToVideoTrackAdapter is a glue class between the content MediaStream and | 34 // PepperToVideoTrackAdapter is a glue class between the content MediaStream and |
32 // the effects pepper plugin host. | 35 // the effects pepper plugin host. |
33 class CONTENT_EXPORT PepperToVideoTrackAdapter { | 36 class CONTENT_EXPORT PepperToVideoTrackAdapter { |
34 public: | 37 public: |
35 // Instantiates and adds a new video track to the MediaStream specified by | 38 // Instantiates and adds a new video track to the MediaStream specified by |
36 // |url|. Returns a handler for delivering frames to the new video track as | 39 // |url|. Returns a handler for delivering frames to the new video track as |
37 // |frame_writer|. | 40 // |frame_writer|. |
38 // If |registry| is NULL the global blink::WebMediaStreamRegistry will be | 41 // If |registry| is NULL the global blink::WebMediaStreamRegistry will be |
39 // used to look up the media stream. | 42 // used to look up the media stream. |
40 // The caller of the function takes the ownership of |frame_writer|. | 43 // The caller of the function takes the ownership of |frame_writer|. |
41 // Returns true on success and false on failure. | 44 // Returns true on success and false on failure. |
42 static bool Open(MediaStreamRegistryInterface* registry, | 45 static bool Open(MediaStreamRegistryInterface* registry, |
43 const std::string& url, | 46 const std::string& url, |
44 FrameWriterInterface** frame_writer); | 47 FrameWriterInterface** frame_writer); |
45 | 48 |
46 private: | 49 private: |
47 DISALLOW_COPY_AND_ASSIGN(PepperToVideoTrackAdapter); | 50 DISALLOW_COPY_AND_ASSIGN(PepperToVideoTrackAdapter); |
48 }; | 51 }; |
49 | 52 |
50 } // namespace content | 53 } // namespace content |
51 | 54 |
52 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_VIDEO_DESTINATION_HANDLER_H_ | 55 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_VIDEO_DESTINATION_HANDLER_H_ |
OLD | NEW |