mirror of
https://github.com/opencv/opencv.git
synced 2025-06-29 16:11:00 +08:00
Merge pull request #24872 from ingridwang:4.x
Replace deprecated symbols AVVideoCodecH264 and AVVideoCodecJPEG
This commit is contained in:
commit
cc2955f21c
@ -105,7 +105,7 @@
|
|||||||
{
|
{
|
||||||
// setup still image output with jpeg codec
|
// setup still image output with jpeg codec
|
||||||
self.stillImageOutput = [[AVCaptureStillImageOutput alloc] init];
|
self.stillImageOutput = [[AVCaptureStillImageOutput alloc] init];
|
||||||
NSDictionary *outputSettings = [NSDictionary dictionaryWithObjectsAndKeys:AVVideoCodecJPEG, AVVideoCodecKey, nil];
|
NSDictionary *outputSettings = [NSDictionary dictionaryWithObjectsAndKeys:AVVideoCodecTypeJPEG, AVVideoCodecKey, nil];
|
||||||
[self.stillImageOutput setOutputSettings:outputSettings];
|
[self.stillImageOutput setOutputSettings:outputSettings];
|
||||||
[self.captureSession addOutput:self.stillImageOutput];
|
[self.captureSession addOutput:self.stillImageOutput];
|
||||||
|
|
||||||
|
@ -315,7 +315,7 @@ static CGFloat DegreesToRadians(CGFloat degrees) {return degrees * M_PI / 180;}
|
|||||||
NSDictionary *outputSettings
|
NSDictionary *outputSettings
|
||||||
= [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithInt:self.imageWidth], AVVideoWidthKey,
|
= [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithInt:self.imageWidth], AVVideoWidthKey,
|
||||||
[NSNumber numberWithInt:self.imageHeight], AVVideoHeightKey,
|
[NSNumber numberWithInt:self.imageHeight], AVVideoHeightKey,
|
||||||
AVVideoCodecH264, AVVideoCodecKey,
|
AVVideoCodecTypeH264, AVVideoCodecKey,
|
||||||
nil
|
nil
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -1220,13 +1220,13 @@ CvVideoWriter_AVFoundation::CvVideoWriter_AVFoundation(const std::string &filena
|
|||||||
is_good = false;
|
is_good = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Three codec supported AVVideoCodecH264 AVVideoCodecJPEG AVVideoCodecTypeHEVC
|
// Three codec supported AVVideoCodecTypeH264 AVVideoCodecTypeJPEG AVVideoCodecTypeHEVC
|
||||||
// On iPhone 3G H264 is not supported.
|
// On iPhone 3G H264 is not supported.
|
||||||
if (fourcc == CV_FOURCC('J','P','E','G') || fourcc == CV_FOURCC('j','p','e','g') ||
|
if (fourcc == CV_FOURCC('J','P','E','G') || fourcc == CV_FOURCC('j','p','e','g') ||
|
||||||
fourcc == CV_FOURCC('M','J','P','G') || fourcc == CV_FOURCC('m','j','p','g')){
|
fourcc == CV_FOURCC('M','J','P','G') || fourcc == CV_FOURCC('m','j','p','g')){
|
||||||
codec = [AVVideoCodecJPEG copy]; // Use JPEG codec if specified, otherwise H264
|
codec = [AVVideoCodecTypeJPEG copy]; // Use JPEG codec if specified, otherwise H264
|
||||||
}else if(fourcc == CV_FOURCC('H','2','6','4') || fourcc == CV_FOURCC('a','v','c','1')){
|
}else if(fourcc == CV_FOURCC('H','2','6','4') || fourcc == CV_FOURCC('a','v','c','1')){
|
||||||
codec = [AVVideoCodecH264 copy];
|
codec = [AVVideoCodecTypeH264 copy];
|
||||||
// Available since macOS 10.13
|
// Available since macOS 10.13
|
||||||
#if defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300
|
#if defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300
|
||||||
}else if(fourcc == CV_FOURCC('H','2','6','5') || fourcc == CV_FOURCC('h','v','c','1') ||
|
}else if(fourcc == CV_FOURCC('H','2','6','5') || fourcc == CV_FOURCC('h','v','c','1') ||
|
||||||
|
Loading…
Reference in New Issue
Block a user