-
Notifications
You must be signed in to change notification settings - Fork 16
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
Add a section for the background blur field in VideoFrameMetadata #159
base: main
Are you sure you want to change the base?
Conversation
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.
Overall looks good, a couple of feedbacks on the IDL.
index.html
Outdated
@@ -1876,6 +1876,76 @@ <h3>Examples</h3> | |||
</pre> | |||
</section> | |||
</section> | |||
<section> | |||
<h2>Camera Effect Status</h2> | |||
<p>The {{VideoFrameMetadata}} interface exposes the effect state as a property, |
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.
<p>The {{VideoFrameMetadata}} interface exposes the effect state as a property, | |
<p>The {{VideoFrameMetadata}} interface exposes the blur state as a property, |
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.
Done
index.html
Outdated
<dl class="dictionary-members" data-link-for="VideoFrameMetadata" data-dfn-for="VideoFrameMetadata"> | ||
<dt><dfn><code>background_blur</code></dfn> of type <code>{{BackgroundBlur}}</code></dt> | ||
<dd> | ||
<p>The state of the background blur effect for the current frame.</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.
Should explain what it means for the property to be present or missing.
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.
Done
index.html
Outdated
<h3>{{BackgroundBlur}}</h3> | ||
<pre class="idl"> | ||
dictionary BackgroundBlur { | ||
boolean enabled; |
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 this should be a required property. If background_blur
is present, enabled
should have a value.
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.
Done
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.
Other than the MSTG/VTG issue, looks ok.
index.html
Outdated
const videoTrack = stream.getVideoTracks()[0]; | ||
const blurIndicator = document.getElementById("blurIndicator"); | ||
const trackProcessor = new MediaStreamTrackProcessor({ track: videoTrack }); | ||
const trackGenerator = new MediaStreamTrackGenerator({ kind: "video" }); |
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.
You need to use the standardized API (VideoTrackGenerator)
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.
Done
index.html
Outdated
<section class="notoc"> | ||
<h4>Members</h4> | ||
<dl class="dictionary-members" data-link-for="VideoFrameMetadata" data-dfn-for="VideoFrameMetadata"> | ||
<dt><dfn><code>background_blur</code></dfn> of type <code>{{BackgroundBlur}}</code></dt> |
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.
Properties should be camelCase.
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.
Done
index.html
Outdated
<section> | ||
<h3>Example</h3> | ||
<pre class="example"> | ||
// main.js: |
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.
Is this contrasted with code in another .js file or elsewhere?
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.
It's just leftover from a copy/paste. Removed.
* background_blur -> backgroundBlur * MediaStreamTrackGenerator -> VideoTrackGenerator * Removed main.js in code snippet
Ping on this. I think it's ready for merge as I've addressed all of the comments. |
CC: @guidou, @alvestrand, @jan-ivar, @youennf for review in the next editors meeting. |
<dt><dfn><code>backgroundBlur</code></dfn> of type <code>{{BackgroundBlur}}</code></dt> | ||
<dd> | ||
<p>The state of the background blur effect for the current frame. If | ||
the property isn't present, it indicates that the user agent doesn't |
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.
the property isn't present, it indicates that the user agent doesn't | |
the property isn't [=map/exist|present=], it indicates that the user agent doesn't |
...but see overlapping suggestion below before committing.
<p>The state of the background blur effect for the current frame. If | ||
the property isn't present, it indicates that the user agent doesn't | ||
support reporting blur state. |
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.
Is it supposed to be present on VideoFrames from non-camera sources? The text seems to assume every VideoFrame has a background blur effect state, when AFAIK only cameras have this? Are we to intuit {backgroundBlur: false}
in those cases? If so, we might want to clarify that.
What's the precedent here for metadata specific to only certain sources?
I've opened w3c/webcodecs#879, but unless there's a precedent (which I couldn't find), it seems better to me for it to only be present in VideoFrames from cameras. That way false
represents a user setting,.
This way, downstream code can differentiate false
that from absence (unknown) and make a more informed decision about transmission.
This would have the effect of revealing that the VideoFrame came from a camera, but I can't think of a situation where that would be problematic.
How about:
<p>The state of the background blur effect for the current frame. If | |
the property isn't present, it indicates that the user agent doesn't | |
support reporting blur state. | |
<p>The state of the background blur effect for the current frame, if | |
[=map/exist|present=]. Absence might indicate that the frame is not | |
from a camera, or the user agent might not support reporting blur state. |
?
I've softened it a bit with "might" since the VideoFrame has a constructor, which means presence and values might have more to do with what metadata was passed in by JS.
which allows apps to know the state for every frame. This is important for | ||
scenarios where the app must ensure user privacy by never sending an |
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.
Let's avoid normative "must". I also don't think we want to overstate the security properties of camera background blurring. OS implementations might differ significantly, and they don't necessarily pass everyone's definition of a security measure.
which allows apps to know the state for every frame. This is important for | |
scenarios where the app must ensure user privacy by never sending an | |
which allows apps to know the state for every frame. This can be helpful for | |
scenarios where the app wishes to help protect user privacy by never sending an |
<p>The {{VideoFrameMetadata}} interface exposes the blur state as a property, | ||
which allows apps to know the state for every frame. This is important for | ||
scenarios where the app must ensure user privacy by never sending an | ||
un-blurred frame off of the user's device.</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.
Mediacapture uses "device" to mean cameras and mics. Maybe:
un-blurred frame off of the user's device.</p> | |
un-blurred frame off of the user's system.</p> |
See https://github.com/markafoltz/camera-effects for more details.
Preview | Diff