| 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 // The <code>chrome.webrtc.castUdpTransport</code> API creates a UDP | 5 // The <code>chrome.webrtc.castUdpTransport</code> API represents a UDP |
| 6 // transport for outer transport to send and receive data. This API is not | 6 // transport for Cast RTP streams. This API is not useful when standalone |
| 7 // useful when standalone since it does not have send and receive methods. | 7 // since it does not have send and receive methods. |
| 8 // It should be used as an inner transport for other transports such as | 8 // It is used to configure the UDP transport used in Cast session. |
| 9 // castSendTransport. | |
| 10 namespace webrtc.castUdpTransport { | 9 namespace webrtc.castUdpTransport { |
| 11 // The UDP socket address and port. | 10 // The UDP socket address and port. |
| 12 dictionary UdpParams { | 11 dictionary UdpParams { |
| 13 DOMString address; | 12 DOMString address; |
| 14 long port; | 13 long port; |
| 15 }; | 14 }; |
| 16 | 15 |
| 17 // Callback from the <code>create</code> method. | |
| 18 // |transportId| : The transport ID. | |
| 19 // A null value indicates an error. | |
| 20 callback CreateCallback = void (long transportId); | |
| 21 | |
| 22 interface Functions { | 16 interface Functions { |
| 23 // Creates a UDP transport. | |
| 24 // |callback| : Called when the transport has been created. | |
| 25 [nocompile] static void create(CreateCallback callback); | |
| 26 | |
| 27 // Destroys a UDP transport. | 17 // Destroys a UDP transport. |
| 28 // |transportId| : The transport ID. | 18 // |transportId| : The transport ID. |
| 29 [nocompile] static void destroy(long transportId); | 19 [nocompile] static void destroy(long transportId); |
| 30 | 20 |
| 31 // Starts to use the transport by providing remote UDP info. | 21 // Starts to use the transport by providing remote UDP info. |
| 32 // |transportId| : The transport ID. | 22 // |transportId| : The transport ID. |
| 33 // |remoteParams| : The address and port to send packets to. | 23 // |remoteParams| : The address and port to send packets to. |
| 34 [nocompile] static void start(long transportId, UdpParams remoteParams); | 24 [nocompile] static void start(long transportId, UdpParams remoteParams); |
| 35 }; | 25 }; |
| 36 }; | 26 }; |
| OLD | NEW |