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_VIDEO_SOURCE_HANDLER_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_VIDEO_SOURCE_HANDLER_H_ |
6 #define CONTENT_RENDERER_MEDIA_VIDEO_SOURCE_HANDLER_H_ | 6 #define CONTENT_RENDERER_MEDIA_VIDEO_SOURCE_HANDLER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 22 matching lines...) Expand all Loading... |
33 | 33 |
34 protected: | 34 protected: |
35 virtual ~FrameReaderInterface() {} | 35 virtual ~FrameReaderInterface() {} |
36 }; | 36 }; |
37 | 37 |
38 // VideoSourceHandler is a glue class between the webrtc MediaStream and | 38 // VideoSourceHandler is a glue class between the webrtc MediaStream and |
39 // the effects pepper plugin host. | 39 // the effects pepper plugin host. |
40 class CONTENT_EXPORT VideoSourceHandler { | 40 class CONTENT_EXPORT VideoSourceHandler { |
41 public: | 41 public: |
42 // |registry| is used to look up the media stream by url. If a NULL |registry| | 42 // |registry| is used to look up the media stream by url. If a NULL |registry| |
43 // is given, the global WebKit::WebMediaStreamRegistry will be used. | 43 // is given, the global blink::WebMediaStreamRegistry will be used. |
44 explicit VideoSourceHandler(MediaStreamRegistryInterface* registry); | 44 explicit VideoSourceHandler(MediaStreamRegistryInterface* registry); |
45 virtual ~VideoSourceHandler(); | 45 virtual ~VideoSourceHandler(); |
46 // Connects to the first video track in the MediaStream specified by |url| and | 46 // Connects to the first video track in the MediaStream specified by |url| and |
47 // the received frames will be delivered via |reader|. | 47 // the received frames will be delivered via |reader|. |
48 // Returns true on success and false on failure. | 48 // Returns true on success and false on failure. |
49 bool Open(const std::string& url, FrameReaderInterface* reader); | 49 bool Open(const std::string& url, FrameReaderInterface* reader); |
50 // Closes |reader|'s connection with the first video track in | 50 // Closes |reader|'s connection with the first video track in |
51 // the MediaStream specified by |url|, i.e. stops receiving frames from the | 51 // the MediaStream specified by |url|, i.e. stops receiving frames from the |
52 // video track. | 52 // video track. |
53 // Returns true on success and false on failure. | 53 // Returns true on success and false on failure. |
(...skipping 10 matching lines...) Expand all Loading... |
64 MediaStreamRegistryInterface* registry_; | 64 MediaStreamRegistryInterface* registry_; |
65 std::map<FrameReaderInterface*, cricket::VideoRenderer*> reader_to_receiver_; | 65 std::map<FrameReaderInterface*, cricket::VideoRenderer*> reader_to_receiver_; |
66 | 66 |
67 DISALLOW_COPY_AND_ASSIGN(VideoSourceHandler); | 67 DISALLOW_COPY_AND_ASSIGN(VideoSourceHandler); |
68 }; | 68 }; |
69 | 69 |
70 } // namespace content | 70 } // namespace content |
71 | 71 |
72 #endif // CONTENT_RENDERER_MEDIA_VIDEO_SOURCE_HANDLER_H_ | 72 #endif // CONTENT_RENDERER_MEDIA_VIDEO_SOURCE_HANDLER_H_ |
73 | 73 |
OLD | NEW |