User:Shellylin/InputPort: Difference between revisions

Line 16: Line 16:
== Proposed API ==
== Proposed API ==
=== Basic Port Interface ===
=== Basic Port Interface ===
   enum InputPortType { “av”, "hdmi", "displayport" };
   enum InputPortType { "audio", "av", "displayport", "dvi", "hdmi" };
  enum VideoFormat { "480i", "480p", "720p", "1080i", "1080p" };


   interface InputPort {
   interface InputPort {
    sequence<VideoFormat> getSupportedVideoFormats ();
     readonly attribute DOMString name;
     readonly attribute DOMString name;
     readonly attribute DOMString uuid;
     readonly attribute DOMString id;
     readonly attribute InputPortType type;
     readonly attribute InputPortType type;
     readonly attribute MediaStream stream;
     readonly attribute MediaStream stream;
    readonly attribute DOMString resolution;
    readonly attribute DOMString aspect;
             attribute EventHandler onconnect;
             attribute EventHandler onconnect;
             attribute EventHandler ondisconnect;
             attribute EventHandler ondisconnect;
   };
   };


===== Attributes =====
'''name''' of type DOMString, readonly<br />
'''name''' of type DOMString, readonly<br />
The name of this input port, e.g. "HDMI1", "HDMI2".
The name of this input port, e.g. "HDMI1", "HDMI2".
'''id''' of type DOMString, readonly<br />
When an InputPort object is created, the user agent MUST generate an identifier string, and MUST initialize the object's id attribute to that string. A good practice is to use an UUID, which is 36 characters long in its canonical form.
The id attribute MUST return the value to which it was initialized when the object was created.
p.s. The idea behind InputPort's id is identical to the id of MediaStream, we want to differentiate InputPort instances created by different UA, so the above statement is copied from the definition of MediaStream's id.


'''type''' of type InputPortType, readonly<br />
'''type''' of type InputPortType, readonly<br />
Line 38: Line 46:
The stream represents the media content provided by this input port.
The stream represents the media content provided by this input port.


'''resolution''' of type DOMString, readonly<br />
===== Methods =====
The video resolution of this input port, e.g. "480i", "1080p", "VGA".
'''getSupportedVideoFormats'''<br />
 
Return the video formats supported by this input port.
'''aspect''' of type DOMString, readonly<br />
The recommended aspect ratio of this input port, e.g. "16:9", "4:3".


=== Specific Port Interfaces ===
=== Specific Port Interfaces ===
Confirmed users
220

edits