• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  *  Copyright 2017 The WebRTC project authors. All Rights Reserved.
3  *
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
6  *  tree. An additional intellectual property rights grant can be found
7  *  in the file PATENTS.  All contributing project authors may
8  *  be found in the AUTHORS file in the root of the source tree.
9  */
10 
11 #ifndef SDK_OBJC_NATIVE_SRC_OBJC_FRAME_BUFFER_H_
12 #define SDK_OBJC_NATIVE_SRC_OBJC_FRAME_BUFFER_H_
13 
14 #import <CoreVideo/CoreVideo.h>
15 
16 #import "base/RTCMacros.h"
17 
18 #include "common_video/include/video_frame_buffer.h"
19 
20 @protocol RTC_OBJC_TYPE
21 (RTCVideoFrameBuffer);
22 
23 namespace webrtc {
24 
25 class ObjCFrameBuffer : public VideoFrameBuffer {
26  public:
27   explicit ObjCFrameBuffer(id<RTC_OBJC_TYPE(RTCVideoFrameBuffer)>);
28   ~ObjCFrameBuffer() override;
29 
30   Type type() const override;
31 
32   int width() const override;
33   int height() const override;
34 
35   rtc::scoped_refptr<I420BufferInterface> ToI420() override;
36 
37   id<RTC_OBJC_TYPE(RTCVideoFrameBuffer)> wrapped_frame_buffer() const;
38 
39  private:
40   id<RTC_OBJC_TYPE(RTCVideoFrameBuffer)> frame_buffer_;
41   int width_;
42   int height_;
43 };
44 
45 id<RTC_OBJC_TYPE(RTCVideoFrameBuffer)> ToObjCVideoFrameBuffer(
46     const rtc::scoped_refptr<VideoFrameBuffer>& buffer);
47 
48 }  // namespace webrtc
49 
50 #endif  // SDK_OBJC_NATIVE_SRC_OBJC_FRAME_BUFFER_H_
51