OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 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 |
11 #ifndef WEBRTC_COMMON_VIDEO_INCLUDE_VIDEO_FRAME_BUFFER_H_ | 11 #ifndef WEBRTC_COMMON_VIDEO_INCLUDE_VIDEO_FRAME_BUFFER_H_ |
12 #define WEBRTC_COMMON_VIDEO_INCLUDE_VIDEO_FRAME_BUFFER_H_ | 12 #define WEBRTC_COMMON_VIDEO_INCLUDE_VIDEO_FRAME_BUFFER_H_ |
13 | 13 |
14 #include <stdint.h> | 14 #include <stdint.h> |
15 | 15 |
16 #if defined(WEBRTC_MAC) || defined(WEBRTC_IOS) | |
17 #include <CoreVideo/CoreVideo.h> | |
18 #endif | |
16 #include <memory> | 19 #include <memory> |
17 | 20 |
18 #include "webrtc/base/callback.h" | 21 #include "webrtc/base/callback.h" |
19 #include "webrtc/base/refcount.h" | 22 #include "webrtc/base/refcount.h" |
20 #include "webrtc/base/scoped_ref_ptr.h" | 23 #include "webrtc/base/scoped_ref_ptr.h" |
21 #include "webrtc/system_wrappers/include/aligned_malloc.h" | 24 #include "webrtc/system_wrappers/include/aligned_malloc.h" |
22 | 25 |
23 namespace webrtc { | 26 namespace webrtc { |
24 | 27 |
25 enum PlaneType { | 28 enum PlaneType { |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
153 rtc::Callback0<void> no_longer_used_cb_; | 156 rtc::Callback0<void> no_longer_used_cb_; |
154 }; | 157 }; |
155 | 158 |
156 // Helper function to crop |buffer| without making a deep copy. May only be used | 159 // Helper function to crop |buffer| without making a deep copy. May only be used |
157 // for non-native frames. | 160 // for non-native frames. |
158 rtc::scoped_refptr<VideoFrameBuffer> ShallowCenterCrop( | 161 rtc::scoped_refptr<VideoFrameBuffer> ShallowCenterCrop( |
159 const rtc::scoped_refptr<VideoFrameBuffer>& buffer, | 162 const rtc::scoped_refptr<VideoFrameBuffer>& buffer, |
160 int cropped_width, | 163 int cropped_width, |
161 int cropped_height); | 164 int cropped_height); |
162 | 165 |
166 #if defined(WEBRTC_MAC) || defined(WEBRTC_IOS) | |
pbos-webrtc
2016/04/01 11:56:10
This class should go into a separate header I thin
tkchin_webrtc
2016/04/01 16:09:29
Done.
| |
167 | |
168 class CoreVideoFrameBuffer : public NativeHandleBuffer { | |
169 public: | |
170 explicit CoreVideoFrameBuffer(CVPixelBufferRef pixel_buffer); | |
171 virtual ~CoreVideoFrameBuffer(); | |
172 | |
173 rtc::scoped_refptr<VideoFrameBuffer> NativeToI420Buffer() override; | |
174 | |
175 private: | |
176 CVPixelBufferRef pixel_buffer_; | |
177 }; | |
178 | |
179 #endif // defined(WEBRTC_MAC) || defined(WEBRTC_IOS) | |
180 | |
163 } // namespace webrtc | 181 } // namespace webrtc |
164 | 182 |
165 #endif // WEBRTC_COMMON_VIDEO_INCLUDE_VIDEO_FRAME_BUFFER_H_ | 183 #endif // WEBRTC_COMMON_VIDEO_INCLUDE_VIDEO_FRAME_BUFFER_H_ |
OLD | NEW |