CAP_MFX: surface pool with timeout, more parameters#17228
Merged
opencv-pushbot merged 1 commit intoopencv:3.4from May 12, 2020
Merged
CAP_MFX: surface pool with timeout, more parameters#17228opencv-pushbot merged 1 commit intoopencv:3.4from
opencv-pushbot merged 1 commit intoopencv:3.4from
Conversation
6 tasks
55172a8 to
dd9cedf
Compare
alalek
reviewed
May 8, 2020
| using namespace std; | ||
| using namespace cv; | ||
|
|
||
| static size_t IMPL = utils::getConfigurationParameterSizeT("OPENCV_VIDEOIO_MFX_IMPL", MFX_IMPL_AUTO_ANY); |
Member
There was a problem hiding this comment.
Lets avoid exploding of global static initialization tables.
Use lazy on-demand initialization instead. See static const String getBuildExtraOptions() from ocl.cpp
Contributor
Author
There was a problem hiding this comment.
Should I repeat scheme with initialized flag or use simple static initialization like shown below?
size_t getValue()
{
static const size_t value = initValue();
return value;
}
Member
There was a problem hiding this comment.
Something like this is enough (sample code prints "overloaded" message):
size_t getValue()
{
static const size_t value = utils::getConfigurationParameterSizeT("OPENCV_VIDEOIO_MFX_IMPL", MFX_IMPL_AUTO_ANY);
return value;
}
dd9cedf to
f309318
Compare
Merged
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Added environment variables to control MFX videoio backend:
OPENCV_VIDEOIO_MFX_IMPL- preferred implementation, number, see mfxIMPL documentationOPENCV_VIDEOIO_MFX_POOL_TIMEOUT- surface pool wait timeout, seconds, default value is 1OPENCV_VIDEOIO_MFX_EXTRA_SURFACE_NUM- extra surfaces in surface pool, number, default value is 0OPENCV_VIDEOIO_MFX_BITRATE_DIVISOR- bitrate calculation divisor, number, default value is 500,bitrate = pixel_num * fps/ divisorOPENCV_VIDEOIO_MFX_WRITER_TIMEOUT- encoder timeout, seconds, default value is 1Pull Request Readiness Checklist
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
Patch to opencv_extra has the same branch name.