blob: da3ade5a154a029b0ed3fbf285ae513dec2e77c4 [file] [log] [blame]
niklase@google.com470e71d2011-07-07 08:21:25 +00001/*
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
16namespace webrtc {
17
18// Class definitions
19class IVideoRender
20{
21public:
22 /*
23 * Constructor/destructor
24 */
25
26 virtual ~IVideoRender()
27 {
28 };
29
pbos@webrtc.orgddf94e72013-04-10 08:09:04 +000030 virtual int32_t Init() = 0;
niklase@google.com470e71d2011-07-07 08:21:25 +000031
pbos@webrtc.orgddf94e72013-04-10 08:09:04 +000032 virtual int32_t ChangeUniqueId(const int32_t id) = 0;
niklase@google.com470e71d2011-07-07 08:21:25 +000033
pbos@webrtc.orgddf94e72013-04-10 08:09:04 +000034 virtual int32_t ChangeWindow(void* window) = 0;
niklase@google.com470e71d2011-07-07 08:21:25 +000035
36 /**************************************************************************
37 *
38 * Incoming Streams
39 *
40 ***************************************************************************/
41
42 virtual VideoRenderCallback
pbos@webrtc.orgddf94e72013-04-10 08:09:04 +000043 * AddIncomingRenderStream(const uint32_t streamId,
44 const uint32_t zOrder,
niklase@google.com470e71d2011-07-07 08:21:25 +000045 const float left,
46 const float top,
47 const float right,
48 const float bottom) = 0;
49
pbos@webrtc.orgddf94e72013-04-10 08:09:04 +000050 virtual int32_t
51 DeleteIncomingRenderStream(const uint32_t streamId) = 0;
niklase@google.com470e71d2011-07-07 08:21:25 +000052
pbos@webrtc.orgddf94e72013-04-10 08:09:04 +000053 virtual int32_t
54 GetIncomingRenderStreamProperties(const uint32_t streamId,
55 uint32_t& zOrder,
niklase@google.com470e71d2011-07-07 08:21:25 +000056 float& left,
57 float& top,
58 float& right,
59 float& bottom) const = 0;
60 // Implemented in common code?
pbos@webrtc.orgddf94e72013-04-10 08:09:04 +000061 //virtual uint32_t GetNumIncomingRenderStreams() const = 0;
62 //virtual bool HasIncomingRenderStream(const uint16_t stramId) const = 0;
niklase@google.com470e71d2011-07-07 08:21:25 +000063
64
65 /**************************************************************************
66 *
67 * Start/Stop
68 *
69 ***************************************************************************/
70
pbos@webrtc.orgddf94e72013-04-10 08:09:04 +000071 virtual int32_t StartRender() = 0;
niklase@google.com470e71d2011-07-07 08:21:25 +000072
pbos@webrtc.orgddf94e72013-04-10 08:09:04 +000073 virtual int32_t StopRender() = 0;
niklase@google.com470e71d2011-07-07 08:21:25 +000074
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.orgddf94e72013-04-10 08:09:04 +000087 virtual int32_t
88 GetGraphicsMemory(uint64_t& totalGraphicsMemory,
89 uint64_t& availableGraphicsMemory) const = 0;
niklase@google.com470e71d2011-07-07 08:21:25 +000090
pbos@webrtc.orgddf94e72013-04-10 08:09:04 +000091 virtual int32_t
92 GetScreenResolution(uint32_t& screenWidth,
93 uint32_t& screenHeight) const = 0;
niklase@google.com470e71d2011-07-07 08:21:25 +000094
pbos@webrtc.orgddf94e72013-04-10 08:09:04 +000095 virtual uint32_t RenderFrameRate(const uint32_t streamId) = 0;
niklase@google.com470e71d2011-07-07 08:21:25 +000096
pbos@webrtc.orgddf94e72013-04-10 08:09:04 +000097 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.com470e71d2011-07-07 08:21:25 +0000102
pbos@webrtc.orgddf94e72013-04-10 08:09:04 +0000103 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.com470e71d2011-07-07 08:21:25 +0000109
pbos@webrtc.orgddf94e72013-04-10 08:09:04 +0000110 virtual int32_t SetTransparentBackground(const bool enable) = 0;
niklase@google.com470e71d2011-07-07 08:21:25 +0000111
pbos@webrtc.orgddf94e72013-04-10 08:09:04 +0000112 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.com470e71d2011-07-07 08:21:25 +0000121
pbos@webrtc.orgddf94e72013-04-10 08:09:04 +0000122 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.com470e71d2011-07-07 08:21:25 +0000129
130};
131} //namespace webrtc
132
133#endif // WEBRTC_MODULES_VIDEO_RENDER_MAIN_SOURCE_I_VIDEO_RENDER_H_