OLD | NEW |
(Empty) | |
| 1 /* |
| 2 * Copyright 2004 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 WEBRTC_MEDIA_BASE_VIDEORENDERER_H_ |
| 12 #define WEBRTC_MEDIA_BASE_VIDEORENDERER_H_ |
| 13 |
| 14 #if !defined(NDEBUG) |
| 15 #include <string> |
| 16 #endif |
| 17 |
| 18 #include "webrtc/base/sigslot.h" |
| 19 |
| 20 namespace cricket { |
| 21 |
| 22 class VideoFrame; |
| 23 |
| 24 // Abstract interface for rendering VideoFrames. |
| 25 class VideoRenderer { |
| 26 public: |
| 27 virtual ~VideoRenderer() {} |
| 28 // Called when the video has changed size. |
| 29 // TODO(nisse): This method is not really used, and should be |
| 30 // deleted. Provide a default do-nothing implementation, to easy the |
| 31 // transition as the method is deleted in subclasses, in particular, |
| 32 // chrome's MockVideoRenderer class. |
| 33 virtual bool SetSize(int width, int height, int reserved) { return true; }; |
| 34 // Called when a new frame is available for display. |
| 35 virtual bool RenderFrame(const VideoFrame *frame) = 0; |
| 36 |
| 37 #if !defined(NDEBUG) |
| 38 // Allow renderer dumping out rendered frames. |
| 39 virtual bool SetDumpPath(const std::string &path) { return true; } |
| 40 #endif |
| 41 }; |
| 42 |
| 43 } // namespace cricket |
| 44 |
| 45 #endif // WEBRTC_MEDIA_BASE_VIDEORENDERER_H_ |
OLD | NEW |