Revert "Revert "Revert "Support more formats in RTCVideoFrame"""
This reverts commit 7583390d1a3a7c4e9a77da0d77250abac0c34d1d. Reason for revert: Breaks unit tests Original change's description: > Revert "Revert "Support more formats in RTCVideoFrame"" > > This reverts commit 0789dab2cbd1617e94d7300e375163d42345f3d4. > > Reason for revert: Include obc_corevideoframebuffer target > > Original change's description: > > Revert "Support more formats in RTCVideoFrame" > > > > This reverts commit bd2220a9c496ef2e8567b68d4be9435a110bdc34. > > > > Reason for revert: Broke external clients > > > > Original change's description: > > > Support more formats in RTCVideoFrame > > > > > > Implement Obj-C version of webrtc::VideoFrameBuffer and use that in > > > RTCVideoFrame. > > > > > > Bug: webrtc:7785 > > > Change-Id: I49f42bcf451dd6769b3a79a65fe7b400dce22677 > > > Reviewed-on: https://chromium-review.googlesource.com/536773 > > > Commit-Queue: Anders Carlsson <andersc@webrtc.org> > > > Reviewed-by: Magnus Jedvert <magjed@webrtc.org> > > > Cr-Commit-Position: refs/heads/master@{#18691} > > > > TBR=magjed@webrtc.org,andersc@webrtc.org > > > > Change-Id: Id765dd9543ed0613a6b2de108b268c3501025fcd > > No-Presubmit: true > > No-Tree-Checks: true > > No-Try: true > > Bug: webrtc:7785 > > Reviewed-on: https://chromium-review.googlesource.com/542837 > > Reviewed-by: Anders Carlsson <andersc@webrtc.org> > > Commit-Queue: Anders Carlsson <andersc@webrtc.org> > > Cr-Commit-Position: refs/heads/master@{#18697} > > TBR=magjed@webrtc.org,andersc@webrtc.org > > Change-Id: I1ef5313b4a6c56eb8c7fd02d95db62c4e3c00255 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: webrtc:7785 > Reviewed-on: https://chromium-review.googlesource.com/542838 > Commit-Queue: Anders Carlsson <andersc@webrtc.org> > Reviewed-by: Anders Carlsson <andersc@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#18716} TBR=magjed@webrtc.org,andersc@webrtc.org Change-Id: Id12f33698eb02041607cb9a5c54f37f01bfac5b1 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:7785 Reviewed-on: https://chromium-review.googlesource.com/544840 Reviewed-by: Anders Carlsson <andersc@webrtc.org> Commit-Queue: Anders Carlsson <andersc@webrtc.org> Cr-Commit-Position: refs/heads/master@{#18718}
This commit is contained in:
committed by
Commit Bot
parent
d0fc37a884
commit
1cfeb43542
@ -9,7 +9,6 @@
|
||||
*/
|
||||
|
||||
#import "RTCI420TextureCache.h"
|
||||
#import "WebRTC/RTCVideoFrameBuffer.h"
|
||||
|
||||
#if TARGET_OS_IPHONE
|
||||
#import <OpenGLES/ES3/gl.h>
|
||||
@ -124,32 +123,31 @@ static const GLsizei kNumTextures = kNumTexturesPerSet * kNumTextureSets;
|
||||
- (void)uploadFrameToTextures:(RTCVideoFrame *)frame {
|
||||
_currentTextureSet = (_currentTextureSet + 1) % kNumTextureSets;
|
||||
|
||||
id<RTCI420Buffer> buffer = [frame.buffer toI420];
|
||||
|
||||
const int chromaWidth = buffer.chromaWidth;
|
||||
const int chromaHeight = buffer.chromaHeight;
|
||||
if (buffer.strideY != frame.width || buffer.strideU != chromaWidth ||
|
||||
buffer.strideV != chromaWidth) {
|
||||
_planeBuffer.resize(buffer.width * buffer.height);
|
||||
const int chromaWidth = (frame.width + 1) / 2;
|
||||
const int chromaHeight = (frame.height + 1) / 2;
|
||||
if (frame.strideY != frame.width ||
|
||||
frame.strideU != chromaWidth ||
|
||||
frame.strideV != chromaWidth) {
|
||||
_planeBuffer.resize(frame.width * frame.height);
|
||||
}
|
||||
|
||||
[self uploadPlane:buffer.dataY
|
||||
[self uploadPlane:frame.dataY
|
||||
texture:self.yTexture
|
||||
width:buffer.width
|
||||
height:buffer.height
|
||||
stride:buffer.strideY];
|
||||
width:frame.width
|
||||
height:frame.height
|
||||
stride:frame.strideY];
|
||||
|
||||
[self uploadPlane:buffer.dataU
|
||||
[self uploadPlane:frame.dataU
|
||||
texture:self.uTexture
|
||||
width:chromaWidth
|
||||
height:chromaHeight
|
||||
stride:buffer.strideU];
|
||||
stride:frame.strideU];
|
||||
|
||||
[self uploadPlane:buffer.dataV
|
||||
[self uploadPlane:frame.dataV
|
||||
texture:self.vTexture
|
||||
width:chromaWidth
|
||||
height:chromaHeight
|
||||
stride:buffer.strideV];
|
||||
stride:frame.strideV];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user