1 /*
2  *  Copyright (c) 2012 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 #include "webrtc/modules/video_render/external/video_render_external_impl.h"
12 
13 namespace webrtc {
14 
VideoRenderExternalImpl(const int32_t id,const VideoRenderType videoRenderType,void * window,const bool fullscreen)15 VideoRenderExternalImpl::VideoRenderExternalImpl(
16                                                  const int32_t id,
17                                                  const VideoRenderType videoRenderType,
18                                                  void* window,
19                                                  const bool fullscreen) :
20     _critSect(*CriticalSectionWrapper::CreateCriticalSection()),
21     _fullscreen(fullscreen)
22 {
23 }
24 
~VideoRenderExternalImpl()25 VideoRenderExternalImpl::~VideoRenderExternalImpl()
26 {
27     delete &_critSect;
28 }
29 
Init()30 int32_t VideoRenderExternalImpl::Init()
31 {
32     return 0;
33 }
34 
ChangeWindow(void * window)35 int32_t VideoRenderExternalImpl::ChangeWindow(void* window)
36 {
37     CriticalSectionScoped cs(&_critSect);
38     return 0;
39 }
40 
41 VideoRenderCallback*
AddIncomingRenderStream(const uint32_t streamId,const uint32_t zOrder,const float left,const float top,const float right,const float bottom)42 VideoRenderExternalImpl::AddIncomingRenderStream(const uint32_t streamId,
43                                                  const uint32_t zOrder,
44                                                  const float left,
45                                                  const float top,
46                                                  const float right,
47                                                  const float bottom)
48 {
49     CriticalSectionScoped cs(&_critSect);
50     return this;
51 }
52 
DeleteIncomingRenderStream(const uint32_t streamId)53 int32_t VideoRenderExternalImpl::DeleteIncomingRenderStream(
54                                                                   const uint32_t streamId)
55 {
56     CriticalSectionScoped cs(&_critSect);
57     return 0;
58 }
59 
GetIncomingRenderStreamProperties(const uint32_t streamId,uint32_t & zOrder,float & left,float & top,float & right,float & bottom) const60 int32_t VideoRenderExternalImpl::GetIncomingRenderStreamProperties(
61                                                                          const uint32_t streamId,
62                                                                          uint32_t& zOrder,
63                                                                          float& left,
64                                                                          float& top,
65                                                                          float& right,
66                                                                          float& bottom) const
67 {
68     CriticalSectionScoped cs(&_critSect);
69 
70     zOrder = 0;
71     left = 0;
72     top = 0;
73     right = 0;
74     bottom = 0;
75 
76     return 0;
77 }
78 
StartRender()79 int32_t VideoRenderExternalImpl::StartRender()
80 {
81     CriticalSectionScoped cs(&_critSect);
82     return 0;
83 }
84 
StopRender()85 int32_t VideoRenderExternalImpl::StopRender()
86 {
87     CriticalSectionScoped cs(&_critSect);
88     return 0;
89 }
90 
RenderType()91 VideoRenderType VideoRenderExternalImpl::RenderType()
92 {
93     return kRenderExternal;
94 }
95 
PerferedVideoType()96 RawVideoType VideoRenderExternalImpl::PerferedVideoType()
97 {
98     return kVideoI420;
99 }
100 
FullScreen()101 bool VideoRenderExternalImpl::FullScreen()
102 {
103     CriticalSectionScoped cs(&_critSect);
104     return _fullscreen;
105 }
106 
GetGraphicsMemory(uint64_t & totalGraphicsMemory,uint64_t & availableGraphicsMemory) const107 int32_t VideoRenderExternalImpl::GetGraphicsMemory(
108                                                          uint64_t& totalGraphicsMemory,
109                                                          uint64_t& availableGraphicsMemory) const
110 {
111     totalGraphicsMemory = 0;
112     availableGraphicsMemory = 0;
113     return -1;
114 }
115 
GetScreenResolution(uint32_t & screenWidth,uint32_t & screenHeight) const116 int32_t VideoRenderExternalImpl::GetScreenResolution(
117                                                            uint32_t& screenWidth,
118                                                            uint32_t& screenHeight) const
119 {
120     CriticalSectionScoped cs(&_critSect);
121     screenWidth = 0;
122     screenHeight = 0;
123     return 0;
124 }
125 
RenderFrameRate(const uint32_t streamId)126 uint32_t VideoRenderExternalImpl::RenderFrameRate(
127                                                         const uint32_t streamId)
128 {
129     CriticalSectionScoped cs(&_critSect);
130     return 0;
131 }
132 
SetStreamCropping(const uint32_t streamId,const float left,const float top,const float right,const float bottom)133 int32_t VideoRenderExternalImpl::SetStreamCropping(
134                                                          const uint32_t streamId,
135                                                          const float left,
136                                                          const float top,
137                                                          const float right,
138                                                          const float bottom)
139 {
140     CriticalSectionScoped cs(&_critSect);
141     return 0;
142 }
143 
ConfigureRenderer(const uint32_t streamId,const unsigned int zOrder,const float left,const float top,const float right,const float bottom)144 int32_t VideoRenderExternalImpl::ConfigureRenderer(
145                                                          const uint32_t streamId,
146                                                          const unsigned int zOrder,
147                                                          const float left,
148                                                          const float top,
149                                                          const float right,
150                                                          const float bottom)
151 {
152     CriticalSectionScoped cs(&_critSect);
153     return 0;
154 }
155 
SetTransparentBackground(const bool enable)156 int32_t VideoRenderExternalImpl::SetTransparentBackground(
157                                                                 const bool enable)
158 {
159     CriticalSectionScoped cs(&_critSect);
160     return 0;
161 }
162 
SetText(const uint8_t textId,const uint8_t * text,const int32_t textLength,const uint32_t textColorRef,const uint32_t backgroundColorRef,const float left,const float top,const float right,const float bottom)163 int32_t VideoRenderExternalImpl::SetText(
164                                                const uint8_t textId,
165                                                const uint8_t* text,
166                                                const int32_t textLength,
167                                                const uint32_t textColorRef,
168                                                const uint32_t backgroundColorRef,
169                                                const float left,
170                                                const float top,
171                                                const float right,
172                                                const float bottom)
173 {
174     CriticalSectionScoped cs(&_critSect);
175     return 0;
176 }
177 
SetBitmap(const void * bitMap,const uint8_t pictureId,const void * colorKey,const float left,const float top,const float right,const float bottom)178 int32_t VideoRenderExternalImpl::SetBitmap(const void* bitMap,
179                                            const uint8_t pictureId,
180                                            const void* colorKey,
181                                            const float left,
182                                            const float top,
183                                            const float right,
184                                            const float bottom)
185 {
186     CriticalSectionScoped cs(&_critSect);
187     return 0;
188 }
189 
190 // VideoRenderCallback
RenderFrame(const uint32_t streamId,const VideoFrame & videoFrame)191 int32_t VideoRenderExternalImpl::RenderFrame(const uint32_t streamId,
192                                              const VideoFrame& videoFrame) {
193     return 0;
194 }
195 }  // namespace webrtc
196