| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2011 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 25 matching lines...) Expand all Loading... |
| 36 black_frame_ = CheckFrameColorYuv(6, 48, 128, 128, 128, 128, frame); | 36 black_frame_ = CheckFrameColorYuv(6, 48, 128, 128, 128, 128, frame); |
| 37 // Treat unexpected frame size as error. | 37 // Treat unexpected frame size as error. |
| 38 if (!frame) { | 38 if (!frame) { |
| 39 LOG(LS_WARNING) << "RenderFrame expected non-null frame."; | 39 LOG(LS_WARNING) << "RenderFrame expected non-null frame."; |
| 40 ++errors_; | 40 ++errors_; |
| 41 return false; | 41 return false; |
| 42 } | 42 } |
| 43 ++num_rendered_frames_; | 43 ++num_rendered_frames_; |
| 44 width_ = static_cast<int>(frame->GetWidth()); | 44 width_ = static_cast<int>(frame->GetWidth()); |
| 45 height_ = static_cast<int>(frame->GetHeight()); | 45 height_ = static_cast<int>(frame->GetHeight()); |
| 46 rotation_ = frame->GetVideoRotation(); |
| 46 SignalRenderFrame(frame); | 47 SignalRenderFrame(frame); |
| 47 return true; | 48 return true; |
| 48 } | 49 } |
| 49 | 50 |
| 50 int errors() const { return errors_; } | 51 int errors() const { return errors_; } |
| 51 int width() const { | 52 int width() const { |
| 52 rtc::CritScope cs(&crit_); | 53 rtc::CritScope cs(&crit_); |
| 53 return width_; | 54 return width_; |
| 54 } | 55 } |
| 55 int height() const { | 56 int height() const { |
| 56 rtc::CritScope cs(&crit_); | 57 rtc::CritScope cs(&crit_); |
| 57 return height_; | 58 return height_; |
| 58 } | 59 } |
| 60 int rotation() const { |
| 61 rtc::CritScope cs(&crit_); |
| 62 return rotation_; |
| 63 } |
| 59 int num_rendered_frames() const { | 64 int num_rendered_frames() const { |
| 60 rtc::CritScope cs(&crit_); | 65 rtc::CritScope cs(&crit_); |
| 61 return num_rendered_frames_; | 66 return num_rendered_frames_; |
| 62 } | 67 } |
| 63 bool black_frame() const { | 68 bool black_frame() const { |
| 64 rtc::CritScope cs(&crit_); | 69 rtc::CritScope cs(&crit_); |
| 65 return black_frame_; | 70 return black_frame_; |
| 66 } | 71 } |
| 67 | 72 |
| 68 sigslot::signal3<int, int, int> SignalSetSize; | 73 sigslot::signal3<int, int, int> SignalSetSize; |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 } | 121 } |
| 117 u_pos += u_pitch; | 122 u_pos += u_pitch; |
| 118 v_pos += v_pitch; | 123 v_pos += v_pitch; |
| 119 } | 124 } |
| 120 return true; | 125 return true; |
| 121 } | 126 } |
| 122 | 127 |
| 123 int errors_; | 128 int errors_; |
| 124 int width_; | 129 int width_; |
| 125 int height_; | 130 int height_; |
| 131 webrtc::VideoRotation rotation_; |
| 126 int num_rendered_frames_; | 132 int num_rendered_frames_; |
| 127 bool black_frame_; | 133 bool black_frame_; |
| 128 rtc::CriticalSection crit_; | 134 rtc::CriticalSection crit_; |
| 129 }; | 135 }; |
| 130 | 136 |
| 131 } // namespace cricket | 137 } // namespace cricket |
| 132 | 138 |
| 133 #endif // WEBRTC_MEDIA_BASE_FAKEVIDEORENDERER_H_ | 139 #endif // WEBRTC_MEDIA_BASE_FAKEVIDEORENDERER_H_ |
| OLD | NEW |