Support RGB frames in RTCCVPixelBuffer

In addition to NV12 frames, also support cropping/scaling RGB frames and
converting RGB frames to i420.

This CL also removes the hardcoding of pixel format in
RTCCameraVideoCapturer. Instead, use the first available format for the
output device that our pipeline supports.

Bug: webrtc:8351
Change-Id: If479b4934c47cd2994936913f55e60fbbee3893b
Reviewed-on: https://webrtc-review.googlesource.com/8920
Commit-Queue: Anders Carlsson <andersc@webrtc.org>
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Daniela Jovanoska Petrenko <denicija@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20396}
This commit is contained in:
Anders Carlsson
2017-10-23 15:23:00 +02:00
committed by Commit Bot
parent a642efb6ee
commit f3ee3b7478
5 changed files with 231 additions and 93 deletions

View File

@ -72,6 +72,8 @@ RTC_EXPORT
@property(nonatomic, readonly) int cropX;
@property(nonatomic, readonly) int cropY;
+ (NSSet<NSNumber *> *)supportedPixelFormats;
- (instancetype)initWithPixelBuffer:(CVPixelBufferRef)pixelBuffer;
- (instancetype)initWithPixelBuffer:(CVPixelBufferRef)pixelBuffer
adaptedWidth:(int)adaptedWidth