• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 "webrtc/modules/video_render/include/video_render.h"
15 
16 namespace webrtc {
17 
18 // Class definitions
19 class IVideoRender
20 {
21 public:
22     /*
23      *   Constructor/destructor
24      */
25 
~IVideoRender()26     virtual ~IVideoRender()
27     {
28     };
29 
30     virtual int32_t Init() = 0;
31 
32     virtual int32_t ChangeUniqueId(const int32_t id) = 0;
33 
34     virtual int32_t ChangeWindow(void* window) = 0;
35 
36     /**************************************************************************
37      *
38      *   Incoming Streams
39      *
40      ***************************************************************************/
41 
42     virtual VideoRenderCallback
43             * AddIncomingRenderStream(const uint32_t streamId,
44                                       const uint32_t zOrder,
45                                       const float left,
46                                       const float top,
47                                       const float right,
48                                       const float bottom) = 0;
49 
50     virtual int32_t
51             DeleteIncomingRenderStream(const uint32_t streamId) = 0;
52 
53     virtual int32_t
54             GetIncomingRenderStreamProperties(const uint32_t streamId,
55                                               uint32_t& zOrder,
56                                               float& left,
57                                               float& top,
58                                               float& right,
59                                               float& bottom) const = 0;
60     // Implemented in common code?
61     //virtual uint32_t GetNumIncomingRenderStreams() const = 0;
62     //virtual bool HasIncomingRenderStream(const uint16_t stramId) const = 0;
63 
64 
65     /**************************************************************************
66      *
67      *   Start/Stop
68      *
69      ***************************************************************************/
70 
71     virtual int32_t StartRender() = 0;
72 
73     virtual int32_t 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 int32_t
88             GetGraphicsMemory(uint64_t& totalGraphicsMemory,
89                               uint64_t& availableGraphicsMemory) const = 0;
90 
91     virtual int32_t
92             GetScreenResolution(uint32_t& screenWidth,
93                                 uint32_t& screenHeight) const = 0;
94 
95     virtual uint32_t RenderFrameRate(const uint32_t streamId) = 0;
96 
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;
102 
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;
109 
110     virtual int32_t SetTransparentBackground(const bool enable) = 0;
111 
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;
121 
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;
129 
130 };
131 }  // namespace webrtc
132 
133 #endif  // WEBRTC_MODULES_VIDEO_RENDER_MAIN_SOURCE_I_VIDEO_RENDER_H_
134