pbos@webrtc.org | 1ecee9a | 2013-05-29 11:34:32 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2013 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 | |
Peter Boström | 7623ce4 | 2015-12-09 11:13:30 | [diff] [blame] | 11 | #ifndef WEBRTC_VIDEO_RENDERER_H_ |
| 12 | #define WEBRTC_VIDEO_RENDERER_H_ |
pbos@webrtc.org | 1ecee9a | 2013-05-29 11:34:32 | [diff] [blame] | 13 | |
| 14 | namespace webrtc { |
| 15 | |
Miguel Casas-Sanchez | 4765070 | 2015-05-30 00:21:40 | [diff] [blame] | 16 | class VideoFrame; |
pbos@webrtc.org | 1ecee9a | 2013-05-29 11:34:32 | [diff] [blame] | 17 | |
pbos@webrtc.org | 1ecee9a | 2013-05-29 11:34:32 | [diff] [blame] | 18 | class VideoRenderer { |
| 19 | public: |
| 20 | // This function should return as soon as possible and not block until it's |
| 21 | // time to render the frame. |
Miguel Casas-Sanchez | 4765070 | 2015-05-30 00:21:40 | [diff] [blame] | 22 | // TODO(mflodman) Remove time_to_render_ms when VideoFrame contains NTP. |
| 23 | virtual void RenderFrame(const VideoFrame& video_frame, |
pbos@webrtc.org | 1ecee9a | 2013-05-29 11:34:32 | [diff] [blame] | 24 | int time_to_render_ms) = 0; |
| 25 | |
pbos@webrtc.org | 0d852d5 | 2015-02-09 15:14:36 | [diff] [blame] | 26 | virtual bool IsTextureSupported() const = 0; |
| 27 | |
qiangchen | 444682a | 2015-11-25 02:07:56 | [diff] [blame] | 28 | // This function returns true if WebRTC should not delay frames for |
| 29 | // smoothness. In general, this case means the renderer can schedule frames to |
| 30 | // optimize smoothness. |
| 31 | virtual bool SmoothsRenderedFrames() const { return false; } |
| 32 | |
pbos@webrtc.org | 1ecee9a | 2013-05-29 11:34:32 | [diff] [blame] | 33 | protected: |
| 34 | virtual ~VideoRenderer() {} |
| 35 | }; |
pbos@webrtc.org | 1ecee9a | 2013-05-29 11:34:32 | [diff] [blame] | 36 | } // namespace webrtc |
| 37 | |
Peter Boström | 7623ce4 | 2015-12-09 11:13:30 | [diff] [blame] | 38 | #endif // WEBRTC_VIDEO_RENDERER_H_ |