Adjust for initial cropping when adapting frame.
When adapting a frame, any initial cropping coordinate was replaced by the coordinate calculated for adapting. Offset initial coordinate instead. BUG=webrtc:7880 Review-Url: https://codereview.webrtc.org/2975613002 Cr-Commit-Position: refs/heads/master@{#19509}
This commit is contained in:
@ -21,11 +21,11 @@
|
|||||||
int _bufferHeight;
|
int _bufferHeight;
|
||||||
int _cropWidth;
|
int _cropWidth;
|
||||||
int _cropHeight;
|
int _cropHeight;
|
||||||
int _cropX;
|
|
||||||
int _cropY;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@synthesize pixelBuffer = _pixelBuffer;
|
@synthesize pixelBuffer = _pixelBuffer;
|
||||||
|
@synthesize cropX = _cropX;
|
||||||
|
@synthesize cropY = _cropY;
|
||||||
|
|
||||||
- (instancetype)initWithPixelBuffer:(CVPixelBufferRef)pixelBuffer {
|
- (instancetype)initWithPixelBuffer:(CVPixelBufferRef)pixelBuffer {
|
||||||
return [self initWithPixelBuffer:pixelBuffer
|
return [self initWithPixelBuffer:pixelBuffer
|
||||||
|
|||||||
@ -54,8 +54,8 @@ void ObjcVideoTrackSource::OnCapturedFrame(RTCVideoFrame* frame) {
|
|||||||
adaptedHeight:adapted_height
|
adaptedHeight:adapted_height
|
||||||
cropWidth:crop_width
|
cropWidth:crop_width
|
||||||
cropHeight:crop_height
|
cropHeight:crop_height
|
||||||
cropX:crop_x
|
cropX:crop_x + rtcPixelBuffer.cropX
|
||||||
cropY:crop_y]);
|
cropY:crop_y + rtcPixelBuffer.cropY]);
|
||||||
} else {
|
} else {
|
||||||
// Adapted I420 frame.
|
// Adapted I420 frame.
|
||||||
// TODO(magjed): Optimize this I420 path.
|
// TODO(magjed): Optimize this I420 path.
|
||||||
|
|||||||
@ -69,6 +69,8 @@ RTC_EXPORT
|
|||||||
@interface RTCCVPixelBuffer : NSObject <RTCVideoFrameBuffer>
|
@interface RTCCVPixelBuffer : NSObject <RTCVideoFrameBuffer>
|
||||||
|
|
||||||
@property(nonatomic, readonly) CVPixelBufferRef pixelBuffer;
|
@property(nonatomic, readonly) CVPixelBufferRef pixelBuffer;
|
||||||
|
@property(nonatomic, readonly) int cropX;
|
||||||
|
@property(nonatomic, readonly) int cropY;
|
||||||
|
|
||||||
- (instancetype)initWithPixelBuffer:(CVPixelBufferRef)pixelBuffer;
|
- (instancetype)initWithPixelBuffer:(CVPixelBufferRef)pixelBuffer;
|
||||||
- (instancetype)initWithPixelBuffer:(CVPixelBufferRef)pixelBuffer
|
- (instancetype)initWithPixelBuffer:(CVPixelBufferRef)pixelBuffer
|
||||||
|
|||||||
Reference in New Issue
Block a user