[camera_web] Re: Support for camera stream on web - #7950
Conversation
…d before expecting mock response
…d before expecting mock response
…d before expecting mock response
…d before expecting mock response
…d before expecting mock response
…d before expecting mock response
…m, and used window.animationFrames
…le height and width in takeFrame
…seOffScreenCanvas
|
Thanks for the valuable comments Ditman and the suggestion about MediaStreamTrackProcessor :) |
|
@TecHaxter – we love thoughtful, polite contributors. Thanks for helping out! |
|
is any update on this PR? |
…ollow wasm comp, moved copyVideoFrameToBufferAndGetStride in camera_service with exception handling, cleaned _triggerVideoStreamTrackProcessorLoop in camera
…rAndGetStride camera service tests
|
From triage: @mdebbar it looks from discussion above like this is ready for a hopefully final review round. |
This comment was marked as off-topic.
This comment was marked as off-topic.
| cameraId: cameraId, | ||
| ); | ||
| if (videoFrame.visibleRect == null) { | ||
| throw CameraWebException( |
There was a problem hiding this comment.
Let's call videoFrame.close() before throwing to avoid a memory leak.
| ..objectFit = 'cover'; | ||
| } | ||
|
|
||
| StreamController<CameraImageData>? _cameraFrameStreamController; |
There was a problem hiding this comment.
Should this controller be closed in the dispose() method?
| ..width = width | ||
| ..height = height; | ||
| } | ||
| final web.CanvasRenderingContext2D context = _canvasElement!.context2D; |
There was a problem hiding this comment.
Is there a reason we aren't using 'willReadFrequently': true for this context?
| _isCameraFrameStreamInitialized() && _cameraFrameStreamController!.hasListener; | ||
|
|
||
| /// Used for safely emitting camera frame stream event | ||
| void _safelyEmitCamereFrameStreamEvent(CameraImageData data) { |
There was a problem hiding this comment.
typo:
| void _safelyEmitCamereFrameStreamEvent(CameraImageData data) { | |
| void _safelyEmitCameraFrameStreamEvent(CameraImageData data) { |
| } | ||
|
|
||
| /// Used for safely closing camera frame stream event | ||
| void _safelyCloseCamereFrameStream() { |
There was a problem hiding this comment.
typo:
| void _safelyCloseCamereFrameStream() { | |
| void _safelyCloseCameraFrameStream() { |
| } | ||
|
|
||
| /// Used for safely emitting camera frame stream error | ||
| void _safelyEmitCamereFrameStreamError(Object error) { |
There was a problem hiding this comment.
typo:
| void _safelyEmitCamereFrameStreamError(Object error) { | |
| void _safelyEmitCameraFrameStreamError(Object error) { |
| bool Function(JSAny) checkType, { | ||
| int cameraId = 0, | ||
| }) { | ||
| // Use the callback to perform the compile-time bound check |
There was a problem hiding this comment.
Did you mean runtime instead of "compile-time"?
|
This pull request is not mergeable in its current state, likely because of a merge conflict. Pre-submit CI jobs were not triggered. Pushing a new commit to this branch that resolves the issue will result in pre-submit jobs being scheduled. |
This PR aims to provide support for strartImageStream and stopImageStream on Web.
#92460
Based on #6944 from the archived plugins repository
Pre-launch Checklist
dart format.)[shared_preferences]pubspec.yamlwith an appropriate new version according to the [pub versioning philosophy], or this PR is [exempt from version changes].CHANGELOG.mdto add a description of the change, [following repository CHANGELOG style].///).POV: my first PR on a public repo
Contains required commits from the PR #6443, resolves unnecessary 202 commits