| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 22 matching lines...) Expand all Loading... |
| 33 | 33 |
| 34 namespace rtc { | 34 namespace rtc { |
| 35 class PlatformThread; | 35 class PlatformThread; |
| 36 } // namespace rtc | 36 } // namespace rtc |
| 37 | 37 |
| 38 namespace webrtc { | 38 namespace webrtc { |
| 39 class EventTimerWrapper; | 39 class EventTimerWrapper; |
| 40 class VideoRenderNSOpenGL; | 40 class VideoRenderNSOpenGL; |
| 41 class CriticalSectionWrapper; | 41 class CriticalSectionWrapper; |
| 42 | 42 |
| 43 class VideoChannelNSOpenGL : public VideoRenderCallback { | 43 class VideoChannelNSOpenGL : public rtc::VideoSinkInterface<VideoFrame> { |
| 44 public: | 44 public: |
| 45 VideoChannelNSOpenGL(NSOpenGLContext *nsglContext, int iId, VideoRenderNSOpe
nGL* owner); | 45 VideoChannelNSOpenGL(NSOpenGLContext *nsglContext, int iId, VideoRenderNSOpe
nGL* owner); |
| 46 virtual ~VideoChannelNSOpenGL(); | 46 virtual ~VideoChannelNSOpenGL(); |
| 47 | 47 |
| 48 // A new frame is delivered | 48 // A new frame is delivered |
| 49 virtual int DeliverFrame(const VideoFrame& videoFrame); | 49 virtual int DeliverFrame(const VideoFrame& videoFrame); |
| 50 | 50 |
| 51 // Called when the incoming frame size and/or number of streams in mix | 51 // Called when the incoming frame size and/or number of streams in mix |
| 52 // changes. | 52 // changes. |
| 53 virtual int FrameSizeChange(int width, int height, int numberOfStreams); | 53 virtual int FrameSizeChange(int width, int height, int numberOfStreams); |
| 54 | 54 |
| 55 virtual int UpdateSize(int width, int height); | 55 virtual int UpdateSize(int width, int height); |
| 56 | 56 |
| 57 // Setup | 57 // Setup |
| 58 int SetStreamSettings(int streamId, float startWidth, float startHeight, flo
at stopWidth, float stopHeight); | 58 int SetStreamSettings(int streamId, float startWidth, float startHeight, flo
at stopWidth, float stopHeight); |
| 59 int SetStreamCropSettings(int streamId, float startWidth, float startHeight,
float stopWidth, float stopHeight); | 59 int SetStreamCropSettings(int streamId, float startWidth, float startHeight,
float stopWidth, float stopHeight); |
| 60 | 60 |
| 61 // Called when it's time to render the last frame for the channel | 61 // Called when it's time to render the last frame for the channel |
| 62 int RenderOffScreenBuffer(); | 62 int RenderOffScreenBuffer(); |
| 63 | 63 |
| 64 // Returns true if a new buffer has been delivered to the texture | 64 // Returns true if a new buffer has been delivered to the texture |
| 65 int IsUpdated(bool& isUpdated); | 65 int IsUpdated(bool& isUpdated); |
| 66 virtual int UpdateStretchSize(int stretchHeight, int stretchWidth); | 66 virtual int UpdateStretchSize(int stretchHeight, int stretchWidth); |
| 67 | 67 |
| 68 // ********** new module functions ************ // | 68 // ********** new module functions ************ // |
| 69 virtual int32_t RenderFrame(const uint32_t streamId, | 69 void OnFrame(const VideoFrame& videoFrame) override; |
| 70 const VideoFrame& videoFrame); | |
| 71 | 70 |
| 72 // ********** new module helper functions ***** // | 71 // ********** new module helper functions ***** // |
| 73 int ChangeContext(NSOpenGLContext *nsglContext); | 72 int ChangeContext(NSOpenGLContext *nsglContext); |
| 74 int32_t GetChannelProperties(float& left, | 73 int32_t GetChannelProperties(float& left, |
| 75 float& top, | 74 float& top, |
| 76 float& right, | 75 float& right, |
| 77 float& bottom); | 76 float& bottom); |
| 78 | 77 |
| 79 private: | 78 private: |
| 80 | 79 |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 std::multimap<int, int> _zOrderToChannel; | 182 std::multimap<int, int> _zOrderToChannel; |
| 184 bool _renderingIsPaused; | 183 bool _renderingIsPaused; |
| 185 NSView* _windowRefSuperView; | 184 NSView* _windowRefSuperView; |
| 186 NSRect _windowRefSuperViewFrame; | 185 NSRect _windowRefSuperViewFrame; |
| 187 }; | 186 }; |
| 188 | 187 |
| 189 } // namespace webrtc | 188 } // namespace webrtc |
| 190 | 189 |
| 191 #endif // WEBRTC_MODULES_VIDEO_RENDER_MAIN_SOURCE_MAC_VIDEO_RENDER_NSOPENGL_H_ | 190 #endif // WEBRTC_MODULES_VIDEO_RENDER_MAIN_SOURCE_MAC_VIDEO_RENDER_NSOPENGL_H_ |
| 192 #endif // COCOA_RENDERING | 191 #endif // COCOA_RENDERING |
| OLD | NEW |