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 13namespace webrtc { 14 15VideoRenderExternalImpl::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 25VideoRenderExternalImpl::~VideoRenderExternalImpl() 26{ 27 delete &_critSect; 28} 29 30int32_t VideoRenderExternalImpl::Init() 31{ 32 return 0; 33} 34 35int32_t VideoRenderExternalImpl::ChangeUniqueId(const int32_t id) 36{ 37 CriticalSectionScoped cs(&_critSect); 38 _id = id; 39 return 0; 40} 41 42int32_t VideoRenderExternalImpl::ChangeWindow(void* window) 43{ 44 CriticalSectionScoped cs(&_critSect); 45 return 0; 46} 47 48VideoRenderCallback* 49VideoRenderExternalImpl::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 60int32_t VideoRenderExternalImpl::DeleteIncomingRenderStream( 61 const uint32_t streamId) 62{ 63 CriticalSectionScoped cs(&_critSect); 64 return 0; 65} 66 67int32_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 86int32_t VideoRenderExternalImpl::StartRender() 87{ 88 CriticalSectionScoped cs(&_critSect); 89 return 0; 90} 91 92int32_t VideoRenderExternalImpl::StopRender() 93{ 94 CriticalSectionScoped cs(&_critSect); 95 return 0; 96} 97 98VideoRenderType VideoRenderExternalImpl::RenderType() 99{ 100 return kRenderExternal; 101} 102 103RawVideoType VideoRenderExternalImpl::PerferedVideoType() 104{ 105 return kVideoI420; 106} 107 108bool VideoRenderExternalImpl::FullScreen() 109{ 110 CriticalSectionScoped cs(&_critSect); 111 return _fullscreen; 112} 113 114int32_t VideoRenderExternalImpl::GetGraphicsMemory( 115 uint64_t& totalGraphicsMemory, 116 uint64_t& availableGraphicsMemory) const 117{ 118 totalGraphicsMemory = 0; 119 availableGraphicsMemory = 0; 120 return -1; 121} 122 123int32_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 133uint32_t VideoRenderExternalImpl::RenderFrameRate( 134 const uint32_t streamId) 135{ 136 CriticalSectionScoped cs(&_critSect); 137 return 0; 138} 139 140int32_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 151int32_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 163int32_t VideoRenderExternalImpl::SetTransparentBackground( 164 const bool enable) 165{ 166 CriticalSectionScoped cs(&_critSect); 167 return 0; 168} 169 170int32_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 185int32_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 198int32_t VideoRenderExternalImpl::RenderFrame( 199 const uint32_t streamId, 200 I420VideoFrame& videoFrame) 201{ 202 return 0; 203} 204} // namespace webrtc 205