OLD | NEW |
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2004 Google Inc. | 3 * Copyright 2004 Google Inc. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
(...skipping 15 matching lines...) Expand all Loading... |
26 */ | 26 */ |
27 | 27 |
28 #ifndef TALK_MEDIA_BASE_VIDEORENDERER_H_ | 28 #ifndef TALK_MEDIA_BASE_VIDEORENDERER_H_ |
29 #define TALK_MEDIA_BASE_VIDEORENDERER_H_ | 29 #define TALK_MEDIA_BASE_VIDEORENDERER_H_ |
30 | 30 |
31 #if !defined(NDEBUG) | 31 #if !defined(NDEBUG) |
32 #include <string> | 32 #include <string> |
33 #endif | 33 #endif |
34 | 34 |
35 #include "webrtc/base/sigslot.h" | 35 #include "webrtc/base/sigslot.h" |
| 36 #include "webrtc/media/base/videosinkinterface.h" |
36 | 37 |
37 namespace cricket { | 38 namespace cricket { |
38 | 39 |
39 class VideoFrame; | 40 class VideoFrame; |
40 | 41 |
41 // Abstract interface for rendering VideoFrames. | 42 // Abstract interface for rendering VideoFrames. |
42 class VideoRenderer { | 43 class VideoRenderer : public rtc::VideoSinkInterface<VideoFrame> { |
43 public: | 44 public: |
44 virtual ~VideoRenderer() {} | 45 virtual ~VideoRenderer() {} |
45 // Called when a new frame is available for display. | 46 // Called when a new frame is available for display. |
46 virtual bool RenderFrame(const VideoFrame *frame) = 0; | 47 virtual bool RenderFrame(const VideoFrame *frame) = 0; |
47 | 48 // Intended to replace RenderFrame. |
| 49 void OnFrame(const cricket::VideoFrame& frame) override { |
| 50 // Unused return value |
| 51 RenderFrame(&frame); |
| 52 } |
48 #if !defined(NDEBUG) | 53 #if !defined(NDEBUG) |
49 // Allow renderer dumping out rendered frames. | 54 // Allow renderer dumping out rendered frames. |
50 virtual bool SetDumpPath(const std::string &path) { return true; } | 55 virtual bool SetDumpPath(const std::string &path) { return true; } |
51 #endif | 56 #endif |
52 }; | 57 }; |
53 | 58 |
54 } // namespace cricket | 59 } // namespace cricket |
55 | 60 |
56 #endif // TALK_MEDIA_BASE_VIDEORENDERER_H_ | 61 #endif // TALK_MEDIA_BASE_VIDEORENDERER_H_ |
OLD | NEW |