-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow device capabilities to be discoverable via enumerateDevices #211
Conversation
… the unfiltered scenario of device enumeration.
<code>getCapabilities()</code> on the first <code><a>MediaStreamTrack</a></code> of this type in a | ||
<code><a>MediaStream</a></code> returned by <code>getUserMedia({deviceId: <i>id</i>})</code> | ||
where <i>id</i> is the value of the <code>deviceId</code> attribute of this <code>MediaDeviceInfo</code>. | ||
For output devices, the capabilities describe a hypothetical MediaStreamTrack whose characteristics |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am a bit unsure about the applicability to output devices. Did we ever discuss that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we missed this in our earlier discussion. However, there is presently no output analogue to getUserMedia() that would hypothetically supply the capabilities of an output device. Without some kind of definition similar in spirit to the above, we seem to have no way to determine the capabilities of output devices until the Audio Output API is fleshed out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like we should delete the sentence about output devices, and declare that we'll figure that one out later.
I don't think we should add ways to determine capabilities of output devices to this spec. Let's focus on the input devices, at least for now. |
@stefhak Output devices are more central to the Web Audio API than input devices -- one can't make any sound in Web Audio without an output device. I have a few questions: Why do you feel it's best to put this off? And when/where do you think we should address them, if not now? Would we change |
After re-reading http://w3c.github.io/mediacapture-main/ I think I was wrong in my initial reaction regarding output devices. enumerateDevices does indeed enumerate output audio devices, and adding capabilities to them does not seem like that big a deal in that perspective. I'm not sure about the language ("hypothetical MediaStreamTrack") in some parts. Additionally, there is text now about only devices that the user has approved use of will described. Are all output devices automatically in this category? At the editor's meeting tomorrow I will ask one of the editors to review this PR. |
Thanks. A couple of quick responses: The language of "hypothetical MediaStreamTrack matching the output device characteristics" was included because my understanding is that MediaStreamTracks are not creatable for output devices: they are defined in terms of a source only. Perhaps there is a better way to phrase this. The device approval policy was intended to track the same permission policy for the rest of enumerateDevices() filterable information, which currently states that once the user has granted access to any device, this filterable information is obtainable for all devices. I continue to think that some way of requesting permission from the user to obtain info on available devices would clarify this area, and someone proposed that on the list not long ago. |
To me, this begs a lot of questions:
We're surely stretching definitions here. |
I looked at this from an editorial/spec consistency standpoint and agree with Jan-Ivar that this crosses the line into more output info (and ultimately control) than the rest of the specification supports. Because output issues can be complex and are definitely different in some cases from input issues, all output work (with the notable exception I'll get to below) is being done in the separate Audio Output specification. I think going beyond this is too far and that it would be better for the Audio Output spec to add any additional info for output devices. Then again, I personally think capabilities info in enumerateDevices is too far, but that's just my personal opinion (not as an editor). |
@burnburn thanks for explaining the reason for the exception. Having an Audio Output spec add this makes sense to me FWIW. It might be worth pondering whether such a spec would be likely to extend (with the *) Because |
The logic of how we got here is kind of a step by step process.
Each step seems logical. But if we're unhappy with the state at the end, we should think about which step is the one that doesn't hang together. |
It seems to me we've forgotten to define output devices. Relying on their similarity to input devices, is the weak link in this reasoning imho. |
I would agree with @jan-ivar that there is a substantial gap in the media capture world right now regarding output devices, and that "piggybacking" a definition of output capabilities on top of input is a shaky approach. I wouldn't have chosen this except that my understanding from the chairs has been that they want to defer discussions of how to fill this gap, until future consideration of the Audio Output API (which spec is really a kind of prototype that needs considerable revision to serve the most important use cases). I suppose one question for the group here is whether deferral is desirable, if it leads to a device enumeration API that cannot expose a unified view of input and output devices. |
If it's "cannot expose now", it seems like an acceptable thing to me. |
I think that my current approach is to redo this change and rename the new attribute If no one objects I'll close this PR and create a new one along these lines. |
@joeberkovitz to me that sounds like a sensible next step. |
Defining capabilities for output devices seems like a different question to be addressed, but the idea of exposing capabiilities in the device list seems good. If everyone agrees, we should merge this and add a new issue on output device caps. |
To @joeberkovitz ' comment: I think changing to "inputcapabilities" would be a mistake. |
@alvestrand I'm fine with that approach, I suppose it has to be either input or output. As per our earlier discussion I believe an attempt to define output capabilities would be post-1.0 unless you want to resolve the other, larger API issues pertaining to output. |
@alvestrand Extending So that would almost certainly leave us with |
@jan-ivar I think that would be fine. |
…from capabilities attribute as type may be different in fuure for output devices
@stefhak @jan-ivar I've changed this to remove support for output device capabilities, and also removed strong typing from the If this is a problem, we could leave the strong typing in. |
With the exception of the part "Future changes to this API will address the acquisition of output device capabilities." this LGTM. I don't think that kind of forward looking predictions belong in a spec for implementers, that fits more into a group planning doc or similar. |
I've removed the statement about future spec intentions, and also changed the phrase "...will always have the value |
…n specialized InputDeviceInfo subtype.
@jan-ivar I think we should be good now |
Travis thinks there's a reference error in it, however.... and it's not the same one as the one on the main branch. |
The Travis issues actually look like the same as on master, so I don't think they are blocking (I'll take a stab at fixing the issues separately) |
It looks like gh-pages might have been reset on the repo to an earlier commit by someone. After fetching, my local gh-pages was suddenly ahead of the origin. I left this situation alone. |
The Travis CI warnings seem to be unrelated. You could do a rebase if you want to get rid of them. |
@@ -2329,7 +2333,8 @@ | |||
a copy of <var>resultList</var>, and all its elements, where | |||
the <code><a href= | |||
"#widl-MediaDeviceInfo-label">label</a></code> member is the | |||
empty string.</p> | |||
empty string and the <code><a href= | |||
"#widl-MediaDeviceInfo-capabilities">capabilities</a></code> member is <code>null</code>.</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't have the capabilities member (attribute) anymore. I think you can simply remove this since the wanted behaviour is already documented in the description of getCapabilites().
…ice conditionality in MediaDeviceInfo.
Thanks @adam-be, I should have caught those references. Should be good now. |
@@ -2248,6 +2248,10 @@ | |||
User Agent's available media input and output devices if enumeration | |||
is successful.</p> | |||
|
|||
<p>Elements of this sequence which represent input devices will be of type |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use "that" with restrictive clause.
lgtm on substance. some language nits. |
Thanks -- appreciate the pointers. Changes applied. |
OK, please let me know if there's a further next step I can take -- I don't have write access and can't merge this request. |
@joeberkovitz this is now in the hands of the editors (and @adam-be is assigned). Hopefully it can be merged shortly. I'm removing the "submitter action needed" label. |
This looks quite ready to me. |
With all the positive words, I'm hitting the merge button. |
Allow device capabilities to be discoverable via enumerateDevices
LC proposal documented in https://lists.w3.org/Archives/Public/public-media-capture/2015Jun/0034.html to allow applications to discover device capabilities.