User:Shellylin/InputPort
Goals
Provide DOM API access to the input ports of devices. With InputPort API, application developers are able to browse available input ports of the current device, retrieve media content provided by a particular port, detect whether an input port has connected to a source provider.
Contributors
Status
Features
- Enumerate available input ports on the current device. Supported types of input ports include A/V, VGA and HDMI.
- Retrieve media content from an input port, provided by its source provider. Presented as a MediaStream object.
- Read and write the attributes of a selected input port.
- Examples of input port attributes: frame rate, color system, aspect ratio...etc.
- Support hotplug detection on each input port.
Proposed API
Basic Port Interface
enum InputPortType { “av”, "hdmi", "displayport" };
interface InputPort { readonly attribute DOMString name; readonly attribute DOMString uuid; readonly attribute InputPortType type; readonly attribute MediaStream stream; readonly attribute DOMString resolution; readonly attribute DOMString aspect; attribute EventHandler onconnect; attribute EventHandler ondisconnect; };
name of type DOMString, readonly
The name of this input port, e.g. "HDMI1", "HDMI2".
type of type InputPortType, readonly
The type of this input port, value must be defined in the enum of InputPortTypeEnum, e.g. "av", "displayport".
stream of type MediaStream, readonly
The stream represents the media content provided by this input port.
resolution of type DOMString, readonly
The video resolution of this input port, e.g. "480i", "1080p", "VGA".
aspect of type DOMString, readonly
The recommended aspect ratio of this input port, e.g. "16:9", "4:3".
Specific Port Interfaces
A/V
enum AVVideoType { "composite", "component", "scart-rgb" };
interface AVInputPort : InputPort { sequence<AVVideoType> getSupportedVideoTypes (); attribute AVVideoTypeEnum currentVideoType; }
HDMI/DisplayPort
enum HDMIPictureQuality { "xvycc", "colorymetory", "photo-graphics" }; enum HDMIConnectedSourceType { "hdmi", "dvi" } enum HDMIAudioType { "digital", "analog" };
interface HDMIInputPort : InputPort { sequence<AVVideoType> getSupportedAudioTypes (); readonly attribute HDMIPictureQuality? pictureQuality; readonly attribute HDMIConnectedSourceType connectedSourceType; attribute HDMIAudioType currentAudioType; }
interface DisplayPortInputPort : HDMIInputPort { }
InputPortManager
This will be an object in window.navigator
named InputPortManager
with the following interface:
partial interface Navigator { readonly attribute InputPortManager inputPortManager; };
interface InputPortManager { sequence<InputPort> getInputPorts(); };