Home | History | Annotate | Download | only in api
      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
      3 // found in the LICENSE file.
      4 
      5 // The <code>chrome.cast.streaming.session</code> API creates a Cast
      6 // session using WebMediaStreamTrack as sources. The session is composed
      7 // by RTP streams and a network transport.
      8 //
      9 // Calling this API will generate corresponding resources for use with
     10 // chrome.cast.streaming.rtpStream and chrome.cast.streaming.udpTransport
     11 // APIs.
     12 //
     13 // Valid resource IDs are positive and non-zero.
     14 namespace cast.streaming.session {
     15   // Callback from the <code>create</code> method.
     16   // |audioStreamId| : The audio RTP stream ID.
     17   // |videoStreamId| : The video RTP stream ID.
     18   // |udpTransportId| : The UDP transport ID.
     19   callback CreateCallback = void (long audioStreamId,
     20                                   long videoStreamId,
     21                                   long udpTransportId);
     22 
     23   interface Functions {
     24     // Creates a Cast session using the provided audio and video track as
     25     // source. The tracks must be of type MediaStreamTrack. This will
     26     // create two RTP streams and a UDP transport that builds the session.
     27     // Either |audioTrack| or |videoTrack| can be null but not both. This
     28     // means creating a session with only audio or video. If a given
     29     // track is null then the created stream ID will be null.
     30     //
     31     // |audioTrack| : the source audio track.
     32     // |videoTrack| : the source video track.
     33     // |callback| : Called when the sesion has been created.
     34     [nocompile,allowAmbiguousOptionalArguments] static void create(
     35         [instanceOf=MediaStreamTrack] optional object audioTrack,
     36         [instanceOf=MediaStreamTrack] optional object videoTrack,
     37         CreateCallback callback);
     38   };
     39 };
     40