mirror of
https://github.com/opencv/opencv.git
synced 2026-07-31 00:03:03 +04:00
Merge branch 4.x
This commit is contained in:
@@ -1104,9 +1104,19 @@ bool CvCaptureFile::setProperty(int property_id, double value) {
|
||||
t.value = value * t.timescale / 1000;
|
||||
retval = setupReadingAt(t);
|
||||
break;
|
||||
case cv::CAP_PROP_POS_FRAMES:
|
||||
retval = mAssetTrack.nominalFrameRate > 0 ? setupReadingAt(CMTimeMake(value, mAssetTrack.nominalFrameRate)) : false;
|
||||
case cv::CAP_PROP_POS_FRAMES: {
|
||||
// Build the seek CMTime from the track's native rational frame
|
||||
// duration so non-integer rates (e.g. 23.976 = 24000/1001) are exact.
|
||||
CMTime frameDuration = mAssetTrack.minFrameDuration;
|
||||
if (frameDuration.timescale > 0 && frameDuration.value > 0) {
|
||||
retval = setupReadingAt(CMTimeMultiply(frameDuration, (int32_t)value));
|
||||
} else if (mAssetTrack.nominalFrameRate > 0) {
|
||||
retval = setupReadingAt(CMTimeMake(value, mAssetTrack.nominalFrameRate));
|
||||
} else {
|
||||
retval = false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case cv::CAP_PROP_POS_AVI_RATIO:
|
||||
t = mAsset.duration;
|
||||
t.value = round(t.value * value);
|
||||
@@ -1349,4 +1359,4 @@ void CvVideoWriter_AVFoundation::write(cv::InputArray image) {
|
||||
}
|
||||
}
|
||||
|
||||
#pragma clang diagnostic pop
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
@@ -1033,9 +1033,19 @@ bool CvCaptureFile::setProperty_(int property_id, double value) {
|
||||
t.value = value * t.timescale / 1000;
|
||||
retval = setupReadingAt(t);
|
||||
break;
|
||||
case cv::CAP_PROP_POS_FRAMES:
|
||||
retval = mAssetTrack.nominalFrameRate > 0 ? setupReadingAt(CMTimeMake(value, mAssetTrack.nominalFrameRate)) : false;
|
||||
case cv::CAP_PROP_POS_FRAMES: {
|
||||
// Build the seek CMTime from the track's native rational frame
|
||||
// duration so non-integer rates (e.g. 23.976 = 24000/1001) are exact.
|
||||
CMTime frameDuration = mAssetTrack.minFrameDuration;
|
||||
if (frameDuration.timescale > 0 && frameDuration.value > 0) {
|
||||
retval = setupReadingAt(CMTimeMultiply(frameDuration, (int32_t)value));
|
||||
} else if (mAssetTrack.nominalFrameRate > 0) {
|
||||
retval = setupReadingAt(CMTimeMake(value, mAssetTrack.nominalFrameRate));
|
||||
} else {
|
||||
retval = false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case cv::CAP_PROP_POS_AVI_RATIO:
|
||||
t = mAsset.duration;
|
||||
t.value = round(t.value * value);
|
||||
|
||||
@@ -1105,7 +1105,7 @@ bool CvCapture_FFMPEG::open(const char* _filename, int index, const Ptr<IStreamR
|
||||
{
|
||||
enableAlpha = false;
|
||||
}
|
||||
if (value == CV_8UC4)
|
||||
else if (value == CV_8UC4)
|
||||
{
|
||||
enableAlpha = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user