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 _cropWidth;
|
||||
int _cropHeight;
|
||||
int _cropX;
|
||||
int _cropY;
|
||||
}
|
||||
|
||||
@synthesize pixelBuffer = _pixelBuffer;
|
||||
@synthesize cropX = _cropX;
|
||||
@synthesize cropY = _cropY;
|
||||
|
||||
- (instancetype)initWithPixelBuffer:(CVPixelBufferRef)pixelBuffer {
|
||||
return [self initWithPixelBuffer:pixelBuffer
|
||||
|
||||
@ -54,8 +54,8 @@ void ObjcVideoTrackSource::OnCapturedFrame(RTCVideoFrame* frame) {
|
||||
adaptedHeight:adapted_height
|
||||
cropWidth:crop_width
|
||||
cropHeight:crop_height
|
||||
cropX:crop_x
|
||||
cropY:crop_y]);
|
||||
cropX:crop_x + rtcPixelBuffer.cropX
|
||||
cropY:crop_y + rtcPixelBuffer.cropY]);
|
||||
} else {
|
||||
// Adapted I420 frame.
|
||||
// TODO(magjed): Optimize this I420 path.
|
||||
|
||||
Reference in New Issue
Block a user