niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2011 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_MODULES_VIDEO_RENDER_MAIN_SOURCE_I_VIDEO_RENDER_H_ |
| 12 | #define WEBRTC_MODULES_VIDEO_RENDER_MAIN_SOURCE_I_VIDEO_RENDER_H_ |
| 13 | |
| 14 | #include "video_render.h" |
| 15 | |
| 16 | namespace webrtc { |
| 17 | |
| 18 | // Class definitions |
| 19 | class IVideoRender |
| 20 | { |
| 21 | public: |
| 22 | /* |
| 23 | * Constructor/destructor |
| 24 | */ |
| 25 | |
| 26 | virtual ~IVideoRender() |
| 27 | { |
| 28 | }; |
| 29 | |
pbos@webrtc.org | ddf94e7 | 2013-04-10 08:09:04 +0000 | [diff] [blame^] | 30 | virtual int32_t Init() = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 31 | |
pbos@webrtc.org | ddf94e7 | 2013-04-10 08:09:04 +0000 | [diff] [blame^] | 32 | virtual int32_t ChangeUniqueId(const int32_t id) = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 33 | |
pbos@webrtc.org | ddf94e7 | 2013-04-10 08:09:04 +0000 | [diff] [blame^] | 34 | virtual int32_t ChangeWindow(void* window) = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 35 | |
| 36 | /************************************************************************** |
| 37 | * |
| 38 | * Incoming Streams |
| 39 | * |
| 40 | ***************************************************************************/ |
| 41 | |
| 42 | virtual VideoRenderCallback |
pbos@webrtc.org | ddf94e7 | 2013-04-10 08:09:04 +0000 | [diff] [blame^] | 43 | * AddIncomingRenderStream(const uint32_t streamId, |
| 44 | const uint32_t zOrder, |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 45 | const float left, |
| 46 | const float top, |
| 47 | const float right, |
| 48 | const float bottom) = 0; |
| 49 | |
pbos@webrtc.org | ddf94e7 | 2013-04-10 08:09:04 +0000 | [diff] [blame^] | 50 | virtual int32_t |
| 51 | DeleteIncomingRenderStream(const uint32_t streamId) = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 52 | |
pbos@webrtc.org | ddf94e7 | 2013-04-10 08:09:04 +0000 | [diff] [blame^] | 53 | virtual int32_t |
| 54 | GetIncomingRenderStreamProperties(const uint32_t streamId, |
| 55 | uint32_t& zOrder, |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 56 | float& left, |
| 57 | float& top, |
| 58 | float& right, |
| 59 | float& bottom) const = 0; |
| 60 | // Implemented in common code? |
pbos@webrtc.org | ddf94e7 | 2013-04-10 08:09:04 +0000 | [diff] [blame^] | 61 | //virtual uint32_t GetNumIncomingRenderStreams() const = 0; |
| 62 | //virtual bool HasIncomingRenderStream(const uint16_t stramId) const = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 63 | |
| 64 | |
| 65 | /************************************************************************** |
| 66 | * |
| 67 | * Start/Stop |
| 68 | * |
| 69 | ***************************************************************************/ |
| 70 | |
pbos@webrtc.org | ddf94e7 | 2013-04-10 08:09:04 +0000 | [diff] [blame^] | 71 | virtual int32_t StartRender() = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 72 | |
pbos@webrtc.org | ddf94e7 | 2013-04-10 08:09:04 +0000 | [diff] [blame^] | 73 | virtual int32_t StopRender() = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 74 | |
| 75 | /************************************************************************** |
| 76 | * |
| 77 | * Properties |
| 78 | * |
| 79 | ***************************************************************************/ |
| 80 | virtual VideoRenderType RenderType() = 0; |
| 81 | |
| 82 | virtual RawVideoType PerferedVideoType() = 0; |
| 83 | |
| 84 | virtual bool FullScreen() = 0; |
| 85 | |
| 86 | // TODO: This should be treated in platform specific code only |
pbos@webrtc.org | ddf94e7 | 2013-04-10 08:09:04 +0000 | [diff] [blame^] | 87 | virtual int32_t |
| 88 | GetGraphicsMemory(uint64_t& totalGraphicsMemory, |
| 89 | uint64_t& availableGraphicsMemory) const = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 90 | |
pbos@webrtc.org | ddf94e7 | 2013-04-10 08:09:04 +0000 | [diff] [blame^] | 91 | virtual int32_t |
| 92 | GetScreenResolution(uint32_t& screenWidth, |
| 93 | uint32_t& screenHeight) const = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 94 | |
pbos@webrtc.org | ddf94e7 | 2013-04-10 08:09:04 +0000 | [diff] [blame^] | 95 | virtual uint32_t RenderFrameRate(const uint32_t streamId) = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 96 | |
pbos@webrtc.org | ddf94e7 | 2013-04-10 08:09:04 +0000 | [diff] [blame^] | 97 | virtual int32_t SetStreamCropping(const uint32_t streamId, |
| 98 | const float left, |
| 99 | const float top, |
| 100 | const float right, |
| 101 | const float bottom) = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 102 | |
pbos@webrtc.org | ddf94e7 | 2013-04-10 08:09:04 +0000 | [diff] [blame^] | 103 | virtual int32_t ConfigureRenderer(const uint32_t streamId, |
| 104 | const unsigned int zOrder, |
| 105 | const float left, |
| 106 | const float top, |
| 107 | const float right, |
| 108 | const float bottom) = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 109 | |
pbos@webrtc.org | ddf94e7 | 2013-04-10 08:09:04 +0000 | [diff] [blame^] | 110 | virtual int32_t SetTransparentBackground(const bool enable) = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 111 | |
pbos@webrtc.org | ddf94e7 | 2013-04-10 08:09:04 +0000 | [diff] [blame^] | 112 | virtual int32_t SetText(const uint8_t textId, |
| 113 | const uint8_t* text, |
| 114 | const int32_t textLength, |
| 115 | const uint32_t textColorRef, |
| 116 | const uint32_t backgroundColorRef, |
| 117 | const float left, |
| 118 | const float top, |
| 119 | const float rigth, |
| 120 | const float bottom) = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 121 | |
pbos@webrtc.org | ddf94e7 | 2013-04-10 08:09:04 +0000 | [diff] [blame^] | 122 | virtual int32_t SetBitmap(const void* bitMap, |
| 123 | const uint8_t pictureId, |
| 124 | const void* colorKey, |
| 125 | const float left, |
| 126 | const float top, |
| 127 | const float right, |
| 128 | const float bottom) = 0; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 129 | |
| 130 | }; |
| 131 | } //namespace webrtc |
| 132 | |
| 133 | #endif // WEBRTC_MODULES_VIDEO_RENDER_MAIN_SOURCE_I_VIDEO_RENDER_H_ |