Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(312)

Side by Side Diff: webrtc/modules/video_render/mac/video_render_mac_carbon_impl.cc

Issue 1912143002: Delete video_render module. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Move -framework flags from legacy_objc_api_tests.gyp to legacy_objc_api.gyp. Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
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/engine_configurations.h"
12 #if defined(CARBON_RENDERING)
13
14 #include <AGL/agl.h>
15 #include "webrtc/modules/video_render/mac/video_render_agl.h"
16 #include "webrtc/modules/video_render/mac/video_render_mac_carbon_impl.h"
17 #include "webrtc/system_wrappers/include/critical_section_wrapper.h"
18 #include "webrtc/system_wrappers/include/trace.h"
19
20 namespace webrtc {
21
22 VideoRenderMacCarbonImpl::VideoRenderMacCarbonImpl(const int32_t id,
23 const VideoRenderType videoRenderType,
24 void* window,
25 const bool fullscreen) :
26 _id(id),
27 _renderMacCarbonCritsect(*CriticalSectionWrapper::CreateCriticalSection()),
28 _fullScreen(fullscreen),
29 _ptrWindow(window)
30 {
31
32 WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer, _id, "Constructor %s:%d", __FU NCTION__, __LINE__);
33
34 }
35
36 VideoRenderMacCarbonImpl::~VideoRenderMacCarbonImpl()
37 {
38 WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer, _id, "Destructor %s:%d", __FUN CTION__, __LINE__);
39 delete &_renderMacCarbonCritsect;
40 }
41
42 int32_t
43 VideoRenderMacCarbonImpl::Init()
44 {
45 CriticalSectionScoped cs(&_renderMacCarbonCritsect);
46 WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer, _id, "%s:%d", __FUNCTION__, __ LINE__);
47
48 if (!_ptrWindow)
49 {
50 WEBRTC_TRACE(kTraceWarning, kTraceVideoRenderer, _id, "Constructor %s:%d ", __FUNCTION__, __LINE__);
51 return -1;
52 }
53
54 // We don't know if the user passed us a WindowRef or a HIViewRef, so test.
55 bool referenceIsValid = false;
56
57 // Check if it's a valid WindowRef
58 //WEBRTC_TRACE(kTraceDebug, kTraceVideoRenderer, _id, "%s:%d _ptrWindowRef b efore WindowRef cast: %x", __FUNCTION__, __LINE__, _ptrWindowRef);
59 WindowRef* windowRef = static_cast<WindowRef*>(_ptrWindow);
60 //WEBRTC_TRACE(kTraceDebug, kTraceVideoRenderer, _id, "%s:%d _ptrWindowRef a fter cast: %x", __FUNCTION__, __LINE__, _ptrWindowRef);
61 if (IsValidWindowPtr(*windowRef))
62 {
63 _ptrCarbonRender = new VideoRenderAGL(*windowRef, _fullScreen, _id);
64 referenceIsValid = true;
65 WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer, _id, "%s:%d Successfully i nitialized CarbonRenderer with WindowRef:%x", __FUNCTION__, __LINE__, *windowRef );
66 }
67 else
68 {
69 HIViewRef* hiviewRef = static_cast<HIViewRef*>(_ptrWindow);
70 if (HIViewIsValid(*hiviewRef))
71 {
72 _ptrCarbonRender = new VideoRenderAGL(*hiviewRef, _fullScreen, _id);
73 referenceIsValid = true;
74 WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer, _id, "%s:%d Successful ly initialized CarbonRenderer with HIViewRef:%x", __FUNCTION__, __LINE__, hiview Ref);
75 }
76 }
77
78 if(!referenceIsValid)
79 {
80 WEBRTC_TRACE(kTraceError, kTraceVideoRenderer, _id, "%s:%d Invalid Windo wRef/HIViewRef Returning -1", __FUNCTION__, __LINE__);
81 return -1;
82 }
83
84 if(!_ptrCarbonRender)
85 {
86 WEBRTC_TRACE(kTraceError, kTraceVideoRenderer, _id, "%s:%d Failed to cre ate an instance of VideoRenderAGL. Returning -1", __FUNCTION__, __LINE__);
87 }
88
89 int retVal = _ptrCarbonRender->Init();
90 if (retVal == -1)
91 {
92 WEBRTC_TRACE(kTraceError, kTraceVideoRenderer, _id, "%s:%d Failed to ini t CarbonRenderer", __FUNCTION__, __LINE__);
93 return -1;
94 }
95
96 return 0;
97 }
98
99 int32_t
100 VideoRenderMacCarbonImpl::ChangeWindow(void* window)
101 {
102 return -1;
103 CriticalSectionScoped cs(&_renderMacCarbonCritsect);
104 WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer, _id, "%s changing ID to ", __F UNCTION__, window);
105
106 if (window == NULL)
107 {
108 return -1;
109 }
110 _ptrWindow = window;
111
112
113 _ptrWindow = window;
114
115 return 0;
116 }
117
118 VideoRenderCallback*
119 VideoRenderMacCarbonImpl::AddIncomingRenderStream(const uint32_t streamId,
120 const uint32_t zOrder,
121 const float left,
122 const float top,
123 const float right,
124 const float bottom)
125 {
126
127 CriticalSectionScoped cs(&_renderMacCarbonCritsect);
128 WEBRTC_TRACE(kTraceDebug, kTraceVideoRenderer, _id, "%s", __FUNCTION__);
129 VideoChannelAGL* AGLChannel = NULL;
130
131 if(!_ptrWindow)
132 {
133 }
134
135 if(!AGLChannel)
136 {
137 AGLChannel = _ptrCocoaRender->CreateNSGLChannel(streamId, zOrder, left, top, right, bottom);
138 }
139
140 return AGLChannel;
141
142 }
143
144 int32_t
145 VideoRenderMacCarbonImpl::DeleteIncomingRenderStream(const uint32_t streamId)
146 {
147
148 WEBRTC_TRACE(kTraceDebug, kTraceVideoRenderer, _id, "%s:%d", __FUNCTION__, _ _LINE__);
149 CriticalSectionScoped cs(&_renderMacCarbonCritsect);
150 _ptrCarbonRender->DeleteAGLChannel(streamId);
151
152 return 0;
153 }
154
155 int32_t
156 VideoRenderMacCarbonImpl::GetIncomingRenderStreamProperties(const uint32_t strea mId,
157 uint32_t& zOrder,
158 float& left,
159 float& top,
160 float& right,
161 float& bottom) const
162 {
163 return -1;
164 return _ptrCarbonRender->GetChannelProperties(streamId, zOrder, left, top, r ight, bottom);
165 }
166
167 int32_t
168 VideoRenderMacCarbonImpl::StartRender()
169 {
170 return _ptrCarbonRender->StartRender();
171 }
172
173 int32_t
174 VideoRenderMacCarbonImpl::StopRender()
175 {
176 return _ptrCarbonRender->StopRender();
177 }
178
179 VideoRenderType
180 VideoRenderMacCarbonImpl::RenderType()
181 {
182 return kRenderCarbon;
183 }
184
185 RawVideoType
186 VideoRenderMacCarbonImpl::PerferedVideoType()
187 {
188 return kVideoI420;
189 }
190
191 bool
192 VideoRenderMacCarbonImpl::FullScreen()
193 {
194 return false;
195 }
196
197 int32_t
198 VideoRenderMacCarbonImpl::GetGraphicsMemory(uint64_t& totalGraphicsMemory,
199 uint64_t& availableGraphicsMemory) const
200 {
201 totalGraphicsMemory = 0;
202 availableGraphicsMemory = 0;
203 return 0;
204 }
205
206 int32_t
207 VideoRenderMacCarbonImpl::GetScreenResolution(uint32_t& screenWidth,
208 uint32_t& screenHeight) const
209 {
210 CriticalSectionScoped cs(&_renderMacCarbonCritsect);
211 //NSScreen* mainScreen = [NSScreen mainScreen];
212
213 //NSRect frame = [mainScreen frame];
214
215 //screenWidth = frame.size.width;
216 //screenHeight = frame.size.height;
217 return 0;
218 }
219
220 uint32_t
221 VideoRenderMacCarbonImpl::RenderFrameRate(const uint32_t streamId)
222 {
223 CriticalSectionScoped cs(&_renderMacCarbonCritsect);
224 return 0;
225 }
226
227 int32_t
228 VideoRenderMacCarbonImpl::SetStreamCropping(const uint32_t streamId,
229 const float left,
230 const float top,
231 const float right,
232 const float bottom)
233 {
234 return 0;
235 }
236
237 int32_t VideoRenderMacCarbonImpl::ConfigureRenderer(const uint32_t streamId,
238 const unsigned int zOrder,
239 const float left,
240 const float top,
241 const float right,
242 const float bottom)
243 {
244 return 0;
245 }
246
247 int32_t
248 VideoRenderMacCarbonImpl::SetTransparentBackground(const bool enable)
249 {
250 return 0;
251 }
252
253 int32_t VideoRenderMacCarbonImpl::SetText(const uint8_t textId,
254 const uint8_t* text,
255 const int32_t textLength,
256 const uint32_t textColorRef,
257 const uint32_t backgroundColorRef,
258 const float left,
259 const float top,
260 const float right,
261 const float bottom)
262 {
263 return 0;
264 }
265
266 int32_t VideoRenderMacCarbonImpl::SetBitmap(const void* bitMap,
267 const uint8_t pictureId,
268 const void* colorKey,
269 const float left,
270 const float top,
271 const float right,
272 const float bottom)
273 {
274 return 0;
275 }
276
277
278 } // namespace webrtc
279
280 #endif // CARBON_RENDERING
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698