OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 #if !defined(__has_feature) || !__has_feature(objc_arc) | 11 #if !defined(__has_feature) || !__has_feature(objc_arc) |
12 #error "This file requires ARC support." | 12 #error "This file requires ARC support." |
13 #endif | 13 #endif |
14 | 14 |
15 #include "webrtc/modules/video_render/ios/video_render_ios_channel.h" | 15 #include "webrtc/modules/video_render/ios/video_render_ios_channel.h" |
16 | 16 |
17 using namespace webrtc; | 17 using namespace webrtc; |
18 | 18 |
19 VideoRenderIosChannel::VideoRenderIosChannel(VideoRenderIosView* view) | 19 VideoRenderIosChannel::VideoRenderIosChannel(VideoRenderIosView* view) |
20 : view_(view), current_frame_(new VideoFrame()), buffer_is_updated_(false) { | 20 : view_(view), current_frame_(new VideoFrame()), buffer_is_updated_(false) { |
21 } | 21 } |
22 | 22 |
23 VideoRenderIosChannel::~VideoRenderIosChannel() { delete current_frame_; } | 23 VideoRenderIosChannel::~VideoRenderIosChannel() { delete current_frame_; } |
24 | 24 |
25 int32_t VideoRenderIosChannel::RenderFrame(const uint32_t stream_id, | 25 void VideoRenderIosChannel::OnFrame(const VideoFrame& video_frame) { |
26 const VideoFrame& video_frame) { | |
27 current_frame_->CopyFrame(video_frame); | 26 current_frame_->CopyFrame(video_frame); |
28 current_frame_->set_render_time_ms(0); | 27 current_frame_->set_render_time_ms(0); |
29 buffer_is_updated_ = true; | 28 buffer_is_updated_ = true; |
30 | |
31 return 0; | |
32 } | 29 } |
33 | 30 |
34 bool VideoRenderIosChannel::RenderOffScreenBuffer() { | 31 bool VideoRenderIosChannel::RenderOffScreenBuffer() { |
35 if (![view_ renderFrame:current_frame_]) { | 32 if (![view_ renderFrame:current_frame_]) { |
36 return false; | 33 return false; |
37 } | 34 } |
38 | 35 |
39 buffer_is_updated_ = false; | 36 buffer_is_updated_ = false; |
40 | 37 |
41 return true; | 38 return true; |
(...skipping 10 matching lines...) Expand all Loading... |
52 Left:left | 49 Left:left |
53 Top:bottom | 50 Top:bottom |
54 Right:right | 51 Right:right |
55 Bottom:top]) { | 52 Bottom:top]) { |
56 | 53 |
57 return -1; | 54 return -1; |
58 } | 55 } |
59 | 56 |
60 return 0; | 57 return 0; |
61 } | 58 } |
OLD | NEW |