OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 CHROME_RENDERER_EXTENSIONS_CAST_STREAMING_NATIVE_HANDLER_H_ | 5 #ifndef CHROME_RENDERER_EXTENSIONS_CAST_STREAMING_NATIVE_HANDLER_H_ |
6 #define CHROME_RENDERER_EXTENSIONS_CAST_STREAMING_NATIVE_HANDLER_H_ | 6 #define CHROME_RENDERER_EXTENSIONS_CAST_STREAMING_NATIVE_HANDLER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <memory> | 9 #include <memory> |
10 | 10 |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
13 #include "extensions/renderer/object_backed_native_handler.h" | 13 #include "extensions/renderer/object_backed_native_handler.h" |
14 #include "v8/include/v8.h" | 14 #include "v8/include/v8.h" |
15 | 15 |
16 class CastRtpStream; | 16 class CastRtpStream; |
17 class CastUdpTransport; | 17 class CastUdpTransport; |
18 | 18 |
19 namespace base { | 19 namespace base { |
20 class DictionaryValue; | 20 class DictionaryValue; |
21 class Value; | 21 class Value; |
22 using BinaryValue = Value; | |
23 } | 22 } |
24 | 23 |
25 namespace net { | 24 namespace net { |
26 class IPEndPoint; | 25 class IPEndPoint; |
27 } | 26 } |
28 | 27 |
29 namespace media { | 28 namespace media { |
30 class AudioCapturerSource; | 29 class AudioCapturerSource; |
31 class AudioParameters; | 30 class AudioParameters; |
32 class VideoCapturerSource; | 31 class VideoCapturerSource; |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 scoped_refptr<media::AudioCapturerSource> audio, | 98 scoped_refptr<media::AudioCapturerSource> audio, |
100 std::unique_ptr<media::VideoCapturerSource> video); | 99 std::unique_ptr<media::VideoCapturerSource> video); |
101 | 100 |
102 // |function| is a javascript function that will take |error_message| as | 101 // |function| is a javascript function that will take |error_message| as |
103 // an argument. Called when something goes wrong in a cast receiver. | 102 // an argument. Called when something goes wrong in a cast receiver. |
104 void CallReceiverErrorCallback( | 103 void CallReceiverErrorCallback( |
105 v8::CopyablePersistentTraits<v8::Function>::CopyablePersistent function, | 104 v8::CopyablePersistentTraits<v8::Function>::CopyablePersistent function, |
106 const std::string& error_message); | 105 const std::string& error_message); |
107 | 106 |
108 void CallGetRawEventsCallback(int transport_id, | 107 void CallGetRawEventsCallback(int transport_id, |
109 std::unique_ptr<base::BinaryValue> raw_events); | 108 std::unique_ptr<base::Value> raw_events); |
110 void CallGetStatsCallback(int transport_id, | 109 void CallGetStatsCallback(int transport_id, |
111 std::unique_ptr<base::DictionaryValue> stats); | 110 std::unique_ptr<base::DictionaryValue> stats); |
112 | 111 |
113 // Gets the RTP stream or UDP transport indexed by an ID. | 112 // Gets the RTP stream or UDP transport indexed by an ID. |
114 // If not found, returns NULL and throws a V8 exception. | 113 // If not found, returns NULL and throws a V8 exception. |
115 CastRtpStream* GetRtpStreamOrThrow(int stream_id) const; | 114 CastRtpStream* GetRtpStreamOrThrow(int stream_id) const; |
116 CastUdpTransport* GetUdpTransportOrThrow(int transport_id) const; | 115 CastUdpTransport* GetUdpTransportOrThrow(int transport_id) const; |
117 | 116 |
118 // Fills out a media::cast::FrameReceiverConfig from the v8 | 117 // Fills out a media::cast::FrameReceiverConfig from the v8 |
119 // equivialent. (cast.streaming.receiverSession.RtpReceiverParams) | 118 // equivialent. (cast.streaming.receiverSession.RtpReceiverParams) |
(...skipping 25 matching lines...) Expand all Loading... |
145 ExtensionBindingsSystem* bindings_system_; | 144 ExtensionBindingsSystem* bindings_system_; |
146 | 145 |
147 base::WeakPtrFactory<CastStreamingNativeHandler> weak_factory_; | 146 base::WeakPtrFactory<CastStreamingNativeHandler> weak_factory_; |
148 | 147 |
149 DISALLOW_COPY_AND_ASSIGN(CastStreamingNativeHandler); | 148 DISALLOW_COPY_AND_ASSIGN(CastStreamingNativeHandler); |
150 }; | 149 }; |
151 | 150 |
152 } // namespace extensions | 151 } // namespace extensions |
153 | 152 |
154 #endif // CHROME_RENDERER_EXTENSIONS_CAST_STREAMING_NATIVE_HANDLER_H_ | 153 #endif // CHROME_RENDERER_EXTENSIONS_CAST_STREAMING_NATIVE_HANDLER_H_ |
OLD | NEW |