| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2015 The WebRTC project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 } | 24 } |
| 25 | 25 |
| 26 - (int)height { | 26 - (int)height { |
| 27 return _buffer.height; | 27 return _buffer.height; |
| 28 } | 28 } |
| 29 | 29 |
| 30 - (RTCVideoRotation)rotation { | 30 - (RTCVideoRotation)rotation { |
| 31 return _rotation; | 31 return _rotation; |
| 32 } | 32 } |
| 33 | 33 |
| 34 - (const uint8_t *)dataY { | |
| 35 if ([_buffer conformsToProtocol:@protocol(RTCI420Buffer)]) { | |
| 36 return ((id<RTCI420Buffer>)_buffer).dataY; | |
| 37 } else { | |
| 38 return nullptr; | |
| 39 } | |
| 40 } | |
| 41 | |
| 42 - (const uint8_t *)dataU { | |
| 43 if ([_buffer conformsToProtocol:@protocol(RTCI420Buffer)]) { | |
| 44 return ((id<RTCI420Buffer>)_buffer).dataU; | |
| 45 } else { | |
| 46 return nullptr; | |
| 47 } | |
| 48 } | |
| 49 | |
| 50 - (const uint8_t *)dataV { | |
| 51 if ([_buffer conformsToProtocol:@protocol(RTCI420Buffer)]) { | |
| 52 return ((id<RTCI420Buffer>)_buffer).dataV; | |
| 53 } else { | |
| 54 return nullptr; | |
| 55 } | |
| 56 } | |
| 57 | |
| 58 - (int)strideY { | |
| 59 if ([_buffer conformsToProtocol:@protocol(RTCI420Buffer)]) { | |
| 60 return ((id<RTCI420Buffer>)_buffer).strideY; | |
| 61 } else { | |
| 62 return 0; | |
| 63 } | |
| 64 } | |
| 65 | |
| 66 - (int)strideU { | |
| 67 if ([_buffer conformsToProtocol:@protocol(RTCI420Buffer)]) { | |
| 68 return ((id<RTCI420Buffer>)_buffer).strideU; | |
| 69 } else { | |
| 70 return 0; | |
| 71 } | |
| 72 } | |
| 73 | |
| 74 - (int)strideV { | |
| 75 if ([_buffer conformsToProtocol:@protocol(RTCI420Buffer)]) { | |
| 76 return ((id<RTCI420Buffer>)_buffer).strideV; | |
| 77 } else { | |
| 78 return 0; | |
| 79 } | |
| 80 } | |
| 81 | |
| 82 - (int64_t)timeStampNs { | 34 - (int64_t)timeStampNs { |
| 83 return _timeStampNs; | 35 return _timeStampNs; |
| 84 } | 36 } |
| 85 | 37 |
| 86 - (CVPixelBufferRef)nativeHandle { | 38 - (CVPixelBufferRef)nativeHandle { |
| 87 if ([_buffer isKindOfClass:[RTCCVPixelBuffer class]]) { | 39 if ([_buffer isKindOfClass:[RTCCVPixelBuffer class]]) { |
| 88 return ((RTCCVPixelBuffer *)_buffer).pixelBuffer; | 40 return ((RTCCVPixelBuffer *)_buffer).pixelBuffer; |
| 89 } else { | 41 } else { |
| 90 return nullptr; | 42 return nullptr; |
| 91 } | 43 } |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 if (self = [super init]) { | 82 if (self = [super init]) { |
| 131 _buffer = buffer; | 83 _buffer = buffer; |
| 132 _rotation = rotation; | 84 _rotation = rotation; |
| 133 _timeStampNs = timeStampNs; | 85 _timeStampNs = timeStampNs; |
| 134 } | 86 } |
| 135 | 87 |
| 136 return self; | 88 return self; |
| 137 } | 89 } |
| 138 | 90 |
| 139 @end | 91 @end |
| OLD | NEW |