Confirmed users
220
edits
| Line 16: | Line 16: | ||
== Proposed API == | == Proposed API == | ||
=== Basic Port Interface === | === Basic Port Interface === | ||
enum InputPortType { | 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 | readonly attribute DOMString id; | ||
readonly attribute InputPortType type; | readonly attribute InputPortType type; | ||
readonly attribute MediaStream stream; | readonly attribute MediaStream stream; | ||
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. | ||
''' | ===== Methods ===== | ||
'''getSupportedVideoFormats'''<br /> | |||
Return the video formats supported by this input port. | |||
=== Specific Port Interfaces === | === Specific Port Interfaces === | ||