Update webrtc/sdk/objc to new VideoFrameBuffer interface
More thorough refactoring work is planned for RTCVideoFrame (see webrtc:7785), and this CL just unblocks removing the old interface from webrtc::VideoFrameBuffer. Bug: webrtc:7632,webrtc:7785 Change-Id: I351536c5ca454c2acd8944bbc2ebb1d1439dc50c Reviewed-on: https://chromium-review.googlesource.com/530231 Reviewed-by: Anders Carlsson <andersc@webrtc.org> Commit-Queue: Magnus Jedvert <magjed@webrtc.org> Cr-Commit-Position: refs/heads/master@{#18553}
This commit is contained in:
committed by
Commit Bot
parent
687bc3e27b
commit
b008b45f1e
@ -31,27 +31,27 @@
|
||||
}
|
||||
|
||||
- (const uint8_t *)dataY {
|
||||
return _videoBuffer->DataY();
|
||||
return _videoBuffer->GetI420()->DataY();
|
||||
}
|
||||
|
||||
- (const uint8_t *)dataU {
|
||||
return _videoBuffer->DataU();
|
||||
return _videoBuffer->GetI420()->DataU();
|
||||
}
|
||||
|
||||
- (const uint8_t *)dataV {
|
||||
return _videoBuffer->DataV();
|
||||
return _videoBuffer->GetI420()->DataV();
|
||||
}
|
||||
|
||||
- (int)strideY {
|
||||
return _videoBuffer->StrideY();
|
||||
return _videoBuffer->GetI420()->StrideY();
|
||||
}
|
||||
|
||||
- (int)strideU {
|
||||
return _videoBuffer->StrideU();
|
||||
return _videoBuffer->GetI420()->StrideU();
|
||||
}
|
||||
|
||||
- (int)strideV {
|
||||
return _videoBuffer->StrideV();
|
||||
return _videoBuffer->GetI420()->StrideV();
|
||||
}
|
||||
|
||||
- (int64_t)timeStampNs {
|
||||
@ -59,12 +59,14 @@
|
||||
}
|
||||
|
||||
- (CVPixelBufferRef)nativeHandle {
|
||||
return static_cast<CVPixelBufferRef>(_videoBuffer->native_handle());
|
||||
return (_videoBuffer->type() == webrtc::VideoFrameBuffer::Type::kNative) ?
|
||||
static_cast<webrtc::CoreVideoFrameBuffer *>(_videoBuffer.get())->pixel_buffer() :
|
||||
nil;
|
||||
}
|
||||
|
||||
- (RTCVideoFrame *)newI420VideoFrame {
|
||||
return [[RTCVideoFrame alloc]
|
||||
initWithVideoBuffer:_videoBuffer->NativeToI420Buffer()
|
||||
initWithVideoBuffer:_videoBuffer->ToI420()
|
||||
rotation:_rotation
|
||||
timeStampNs:_timeStampNs];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user