• Home
  • History
  • Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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     _id(id), _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 
ChangeUniqueId(const int32_t id)35 int32_t VideoRenderExternalImpl::ChangeUniqueId(const int32_t id)
36 {
37     CriticalSectionScoped cs(&_critSect);
38     _id = id;
39     return 0;
40 }
41 
ChangeWindow(void * window)42 int32_t VideoRenderExternalImpl::ChangeWindow(void* window)
43 {
44     CriticalSectionScoped cs(&_critSect);
45     return 0;
46 }
47 
48 VideoRenderCallback*
AddIncomingRenderStream(const uint32_t streamId,const uint32_t zOrder,const float left,const float top,const float right,const float bottom)49 VideoRenderExternalImpl::AddIncomingRenderStream(const uint32_t streamId,
50                                                  const uint32_t zOrder,
51                                                  const float left,
52                                                  const float top,
53                                                  const float right,
54                                                  const float bottom)
55 {
56     CriticalSectionScoped cs(&_critSect);
57     return this;
58 }
59 
DeleteIncomingRenderStream(const uint32_t streamId)60 int32_t VideoRenderExternalImpl::DeleteIncomingRenderStream(
61                                                                   const uint32_t streamId)
62 {
63     CriticalSectionScoped cs(&_critSect);
64     return 0;
65 }
66 
GetIncomingRenderStreamProperties(const uint32_t streamId,uint32_t & zOrder,float & left,float & top,float & right,float & bottom) const67 int32_t VideoRenderExternalImpl::GetIncomingRenderStreamProperties(
68                                                                          const uint32_t streamId,
69                                                                          uint32_t& zOrder,
70                                                                          float& left,
71                                                                          float& top,
72                                                                          float& right,
73                                                                          float& bottom) const
74 {
75     CriticalSectionScoped cs(&_critSect);
76 
77     zOrder = 0;
78     left = 0;
79     top = 0;
80     right = 0;
81     bottom = 0;
82 
83     return 0;
84 }
85 
StartRender()86 int32_t VideoRenderExternalImpl::StartRender()
87 {
88     CriticalSectionScoped cs(&_critSect);
89     return 0;
90 }
91 
StopRender()92 int32_t VideoRenderExternalImpl::StopRender()
93 {
94     CriticalSectionScoped cs(&_critSect);
95     return 0;
96 }
97 
RenderType()98 VideoRenderType VideoRenderExternalImpl::RenderType()
99 {
100     return kRenderExternal;
101 }
102 
PerferedVideoType()103 RawVideoType VideoRenderExternalImpl::PerferedVideoType()
104 {
105     return kVideoI420;
106 }
107 
FullScreen()108 bool VideoRenderExternalImpl::FullScreen()
109 {
110     CriticalSectionScoped cs(&_critSect);
111     return _fullscreen;
112 }
113 
GetGraphicsMemory(uint64_t & totalGraphicsMemory,uint64_t & availableGraphicsMemory) const114 int32_t VideoRenderExternalImpl::GetGraphicsMemory(
115                                                          uint64_t& totalGraphicsMemory,
116                                                          uint64_t& availableGraphicsMemory) const
117 {
118     totalGraphicsMemory = 0;
119     availableGraphicsMemory = 0;
120     return -1;
121 }
122 
GetScreenResolution(uint32_t & screenWidth,uint32_t & screenHeight) const123 int32_t VideoRenderExternalImpl::GetScreenResolution(
124                                                            uint32_t& screenWidth,
125                                                            uint32_t& screenHeight) const
126 {
127     CriticalSectionScoped cs(&_critSect);
128     screenWidth = 0;
129     screenHeight = 0;
130     return 0;
131 }
132 
RenderFrameRate(const uint32_t streamId)133 uint32_t VideoRenderExternalImpl::RenderFrameRate(
134                                                         const uint32_t streamId)
135 {
136     CriticalSectionScoped cs(&_critSect);
137     return 0;
138 }
139 
SetStreamCropping(const uint32_t streamId,const float left,const float top,const float right,const float bottom)140 int32_t VideoRenderExternalImpl::SetStreamCropping(
141                                                          const uint32_t streamId,
142                                                          const float left,
143                                                          const float top,
144                                                          const float right,
145                                                          const float bottom)
146 {
147     CriticalSectionScoped cs(&_critSect);
148     return 0;
149 }
150 
ConfigureRenderer(const uint32_t streamId,const unsigned int zOrder,const float left,const float top,const float right,const float bottom)151 int32_t VideoRenderExternalImpl::ConfigureRenderer(
152                                                          const uint32_t streamId,
153                                                          const unsigned int zOrder,
154                                                          const float left,
155                                                          const float top,
156                                                          const float right,
157                                                          const float bottom)
158 {
159     CriticalSectionScoped cs(&_critSect);
160     return 0;
161 }
162 
SetTransparentBackground(const bool enable)163 int32_t VideoRenderExternalImpl::SetTransparentBackground(
164                                                                 const bool enable)
165 {
166     CriticalSectionScoped cs(&_critSect);
167     return 0;
168 }
169 
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)170 int32_t VideoRenderExternalImpl::SetText(
171                                                const uint8_t textId,
172                                                const uint8_t* text,
173                                                const int32_t textLength,
174                                                const uint32_t textColorRef,
175                                                const uint32_t backgroundColorRef,
176                                                const float left,
177                                                const float top,
178                                                const float right,
179                                                const float bottom)
180 {
181     CriticalSectionScoped cs(&_critSect);
182     return 0;
183 }
184 
SetBitmap(const void * bitMap,const uint8_t pictureId,const void * colorKey,const float left,const float top,const float right,const float bottom)185 int32_t VideoRenderExternalImpl::SetBitmap(const void* bitMap,
186                                            const uint8_t pictureId,
187                                            const void* colorKey,
188                                            const float left,
189                                            const float top,
190                                            const float right,
191                                            const float bottom)
192 {
193     CriticalSectionScoped cs(&_critSect);
194     return 0;
195 }
196 
197 // VideoRenderCallback
RenderFrame(const uint32_t streamId,I420VideoFrame & videoFrame)198 int32_t VideoRenderExternalImpl::RenderFrame(
199                                                    const uint32_t streamId,
200                                                    I420VideoFrame& videoFrame)
201 {
202     return 0;
203 }
204 }  // namespace webrtc
205