-
-
Notifications
You must be signed in to change notification settings - Fork 347
Abstracted some complexity related to WebcamStream. #3004
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
Open
slaff
wants to merge
20
commits into
SmingHub:develop
Choose a base branch
from
slaff:feature/webcam-fps
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 3 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
545186a
Abstracted some complexity related to WebcamStream.
slav-at-attachix 3da840e
Minor fixes.
slav-at-attachix 8e62c54
Implemented review recommendations.
slav-at-attachix 8a9e03a
Fix an issue with Firefox not showing the images.
slav-at-attachix 8c67742
Every consumer gets its own camera stream. We still have timer to tak…
slav-at-attachix cb67514
These changes should make the process less CPU intensive.
slav-at-attachix dbd74ad
Push Tcp content even when the source is not ready yet.
slav-at-attachix b323c42
Configure WiFi
mikee47 5f605d5
Use Periodic timer for frame sync
mikee47 ec64838
Avoid modifying MultiStream?
mikee47 8ae7829
Abstracted some complexity related to WebcamStream.
slav-at-attachix d218844
Minor fixes.
slav-at-attachix 2152dbd
Implemented review recommendations.
slav-at-attachix 5cd49d3
Fix an issue with Firefox not showing the images.
slav-at-attachix b610560
Every consumer gets its own camera stream. We still have timer to tak…
slav-at-attachix 336036a
These changes should make the process less CPU intensive.
slav-at-attachix f3b428b
Push Tcp content even when the source is not ready yet.
slav-at-attachix bd7fc6b
Merge remote-tracking branch 'mikee47/feature/webcam-fps' into featur…
slav-at-attachix 0a1dbd1
Avoid modifying MultiStream?
mikee47 34dd43c
Enable FPS by default.
slav-at-attachix File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| /**** | ||
| * Sming Framework Project - Open Source framework for high efficiency native ESP8266 development. | ||
| * Created 2015 by Skurydin Alexey | ||
| * http://github.com/SmingHub/Sming | ||
| * All files of the Sming Core are provided under the LGPL v3 license. | ||
| * | ||
| * WebcamPictureStream.h | ||
| * | ||
| * @author: 2019 - Slavey Karadzhov <slav@attachix.com> | ||
| * | ||
| ****/ | ||
|
|
||
| #pragma once | ||
|
|
||
| #include <Data/Stream/DataSourceStream.h> | ||
| #include "Camera/CameraInterface.h" | ||
|
|
||
| class WebcamPictureStream : public IDataSourceStream | ||
| { | ||
| public: | ||
| /** | ||
| * @param camera reference to the camera object. | ||
| */ | ||
| WebcamPictureStream(CameraInterface& camera, size_t blockSize = 512) : camera(camera), blockSize(blockSize) | ||
| { | ||
| } | ||
|
|
||
| uint16_t readMemoryBlock(char* data, int bufSize) | ||
| { | ||
| if(camera.getState() == eWCS_HAS_PICTURE) { | ||
| if(!size) { | ||
| size = camera.getSize(); | ||
| offset = 0; | ||
| } | ||
|
|
||
| return camera.read(data, bufSize, offset); | ||
| } | ||
|
|
||
| return 0; | ||
| } | ||
|
|
||
| int available() | ||
| { | ||
| return size; | ||
| } | ||
|
|
||
| bool seek(int len) | ||
| { | ||
| offset += len; // TODO: check for invalid offsets | ||
| return true; | ||
| } | ||
|
|
||
| bool isFinished() | ||
| { | ||
| bool finished = (size && offset >= size); | ||
| if(finished) { | ||
| camera.next(); | ||
| } | ||
| return finished; | ||
| } | ||
|
|
||
| private: | ||
| CameraInterface& camera; | ||
| size_t blockSize; | ||
| size_t size = 0; | ||
| size_t offset = 0; | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.