blob: 2799a79e378fd056352d73f75f4676926f4d5f37 [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
30 virtual WebRtc_Word32 Init() = 0;
31
32 virtual WebRtc_Word32 ChangeUniqueId(const WebRtc_Word32 id) = 0;
33
34 virtual WebRtc_Word32 ChangeWindow(void* window) = 0;
35
36 /**************************************************************************
37 *
38 * Incoming Streams
39 *
40 ***************************************************************************/
41
42 virtual VideoRenderCallback
43 * AddIncomingRenderStream(const WebRtc_UWord32 streamId,
44 const WebRtc_UWord32 zOrder,
45 const float left,
46 const float top,
47 const float right,
48 const float bottom) = 0;
49
50 virtual WebRtc_Word32
51 DeleteIncomingRenderStream(const WebRtc_UWord32 streamId) = 0;
52
53 virtual WebRtc_Word32
54 GetIncomingRenderStreamProperties(const WebRtc_UWord32 streamId,
55 WebRtc_UWord32& zOrder,
56 float& left,
57 float& top,
58 float& right,
59 float& bottom) const = 0;
60 // Implemented in common code?
61 //virtual WebRtc_UWord32 GetNumIncomingRenderStreams() const = 0;
62 //virtual bool HasIncomingRenderStream(const WebRtc_UWord16 stramId) const = 0;
63
64
65 /**************************************************************************
66 *
67 * Start/Stop
68 *
69 ***************************************************************************/
70
71 virtual WebRtc_Word32 StartRender() = 0;
72
73 virtual WebRtc_Word32 StopRender() = 0;
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
87 virtual WebRtc_Word32
88 GetGraphicsMemory(WebRtc_UWord64& totalGraphicsMemory,
89 WebRtc_UWord64& availableGraphicsMemory) const = 0;
90
91 virtual WebRtc_Word32
92 GetScreenResolution(WebRtc_UWord32& screenWidth,
93 WebRtc_UWord32& screenHeight) const = 0;
94
95 virtual WebRtc_UWord32 RenderFrameRate(const WebRtc_UWord32 streamId) = 0;
96
97 virtual WebRtc_Word32 SetStreamCropping(const WebRtc_UWord32 streamId,
98 const float left,
99 const float top,
100 const float right,
101 const float bottom) = 0;
102
103 virtual WebRtc_Word32 ConfigureRenderer(const WebRtc_UWord32 streamId,
104 const unsigned int zOrder,
105 const float left,
106 const float top,
107 const float right,
108 const float bottom) = 0;
109
110 virtual WebRtc_Word32 SetTransparentBackground(const bool enable) = 0;
111
112 virtual WebRtc_Word32 SetText(const WebRtc_UWord8 textId,
113 const WebRtc_UWord8* text,
114 const WebRtc_Word32 textLength,
115 const WebRtc_UWord32 textColorRef,
116 const WebRtc_UWord32 backgroundColorRef,
117 const float left,
118 const float top,
119 const float rigth,
120 const float bottom) = 0;
121
122 virtual WebRtc_Word32 SetBitmap(const void* bitMap,
123 const WebRtc_UWord8 pictureId,
124 const void* colorKey,
125 const float left,
126 const float top,
127 const float right,
128 const float bottom) = 0;
129
130};
131} //namespace webrtc
132
133#endif // WEBRTC_MODULES_VIDEO_RENDER_MAIN_SOURCE_I_VIDEO_RENDER_H_