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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 return ((id<RTCI420Buffer>)_buffer).strideV; | 76 return ((id<RTCI420Buffer>)_buffer).strideV; |
77 } else { | 77 } else { |
78 return 0; | 78 return 0; |
79 } | 79 } |
80 } | 80 } |
81 | 81 |
82 - (int64_t)timeStampNs { | 82 - (int64_t)timeStampNs { |
83 return _timeStampNs; | 83 return _timeStampNs; |
84 } | 84 } |
85 | 85 |
86 - (CVPixelBufferRef)nativeHandle { | |
87 if ([_buffer isKindOfClass:[RTCCVPixelBuffer class]]) { | |
88 return ((RTCCVPixelBuffer *)_buffer).pixelBuffer; | |
89 } else { | |
90 return nullptr; | |
91 } | |
92 } | |
93 | |
94 - (RTCVideoFrame *)newI420VideoFrame { | 86 - (RTCVideoFrame *)newI420VideoFrame { |
95 return [[RTCVideoFrame alloc] initWithBuffer:[_buffer toI420] | 87 return [[RTCVideoFrame alloc] initWithBuffer:[_buffer toI420] |
96 rotation:_rotation | 88 rotation:_rotation |
97 timeStampNs:_timeStampNs]; | 89 timeStampNs:_timeStampNs]; |
98 } | 90 } |
99 | 91 |
100 - (instancetype)initWithPixelBuffer:(CVPixelBufferRef)pixelBuffer | 92 - (instancetype)initWithPixelBuffer:(CVPixelBufferRef)pixelBuffer |
101 rotation:(RTCVideoRotation)rotation | 93 rotation:(RTCVideoRotation)rotation |
102 timeStampNs:(int64_t)timeStampNs { | 94 timeStampNs:(int64_t)timeStampNs { |
103 return [self initWithBuffer:[[RTCCVPixelBuffer alloc] initWithPixelBuffer:pixe
lBuffer] | 95 return [self initWithBuffer:[[RTCCVPixelBuffer alloc] initWithPixelBuffer:pixe
lBuffer] |
(...skipping 26 matching lines...) Expand all Loading... |
130 if (self = [super init]) { | 122 if (self = [super init]) { |
131 _buffer = buffer; | 123 _buffer = buffer; |
132 _rotation = rotation; | 124 _rotation = rotation; |
133 _timeStampNs = timeStampNs; | 125 _timeStampNs = timeStampNs; |
134 } | 126 } |
135 | 127 |
136 return self; | 128 return self; |
137 } | 129 } |
138 | 130 |
139 @end | 131 @end |
OLD | NEW |