| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 | 134 |
| 135 if (FAILED(ret)) | 135 if (FAILED(ret)) |
| 136 { | 136 { |
| 137 _pTexture = NULL; | 137 _pTexture = NULL; |
| 138 return -1; | 138 return -1; |
| 139 } | 139 } |
| 140 | 140 |
| 141 return 0; | 141 return 0; |
| 142 } | 142 } |
| 143 | 143 |
| 144 int32_t D3D9Channel::RenderFrame(const uint32_t streamId, | 144 void D3D9Channel::OnFrame(const VideoFrame& videoFrame) { |
| 145 const VideoFrame& videoFrame) { | |
| 146 CriticalSectionScoped cs(_critSect); | 145 CriticalSectionScoped cs(_critSect); |
| 147 if (_width != videoFrame.width() || _height != videoFrame.height()) | 146 if (_width != videoFrame.width() || _height != videoFrame.height()) |
| 148 { | 147 { |
| 149 if (FrameSizeChange(videoFrame.width(), videoFrame.height(), 1) == -1) | 148 if (FrameSizeChange(videoFrame.width(), videoFrame.height(), 1) == -1) |
| 150 { | 149 { |
| 151 return -1; | 150 return; |
| 152 } | 151 } |
| 153 } | 152 } |
| 154 return DeliverFrame(videoFrame); | 153 DeliverFrame(videoFrame); |
| 155 } | 154 } |
| 156 | 155 |
| 157 // Called from video engine when a new frame should be rendered. | 156 // Called from video engine when a new frame should be rendered. |
| 158 int D3D9Channel::DeliverFrame(const VideoFrame& videoFrame) { | 157 int D3D9Channel::DeliverFrame(const VideoFrame& videoFrame) { |
| 159 WEBRTC_TRACE(kTraceStream, kTraceVideo, -1, | 158 WEBRTC_TRACE(kTraceStream, kTraceVideo, -1, |
| 160 "DeliverFrame to D3D9Channel"); | 159 "DeliverFrame to D3D9Channel"); |
| 161 | 160 |
| 162 CriticalSectionScoped cs(_critSect); | 161 CriticalSectionScoped cs(_critSect); |
| 163 | 162 |
| 164 // FIXME if _bufferIsUpdated is still true (not be renderred), do we want to | 163 // FIXME if _bufferIsUpdated is still true (not be renderred), do we want to |
| (...skipping 661 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 826 ddIt = _d3dChannels.find(streamId & 0x0000ffff); | 825 ddIt = _d3dChannels.find(streamId & 0x0000ffff); |
| 827 if (ddIt != _d3dChannels.end()) | 826 if (ddIt != _d3dChannels.end()) |
| 828 { | 827 { |
| 829 delete ddIt->second; | 828 delete ddIt->second; |
| 830 _d3dChannels.erase(ddIt); | 829 _d3dChannels.erase(ddIt); |
| 831 return 0; | 830 return 0; |
| 832 } | 831 } |
| 833 return -1; | 832 return -1; |
| 834 } | 833 } |
| 835 | 834 |
| 836 VideoRenderCallback* VideoRenderDirect3D9::CreateChannel(const uint32_t channel, | 835 rtc::VideoSinkInterface<VideoFrame>* VideoRenderDirect3D9::CreateChannel(const u
int32_t channel, |
| 837 const uint32_t
zOrder, | 836 const uint32_t
zOrder, |
| 838 const float lef
t, | 837 const float lef
t, |
| 839 const float top
, | 838 const float top
, |
| 840 const float rig
ht, | 839 const float rig
ht, |
| 841 const float bot
tom) | 840 const float bot
tom) |
| 842 { | 841 { |
| 843 CriticalSectionScoped cs(&_refD3DCritsect); | 842 CriticalSectionScoped cs(&_refD3DCritsect); |
| 844 | 843 |
| 845 //FIXME this should be done in VideoAPIWindows? stop the frame deliver first | 844 //FIXME this should be done in VideoAPIWindows? stop the frame deliver first |
| 846 //remove the old channel | 845 //remove the old channel |
| (...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1151 "Direct3D render failed to find channel"); | 1150 "Direct3D render failed to find channel"); |
| 1152 return -1; | 1151 return -1; |
| 1153 } | 1152 } |
| 1154 // Only allow one stream per channel, demuxing is | 1153 // Only allow one stream per channel, demuxing is |
| 1155 ddobj->SetStreamSettings(0, zOrder, left, top, right, bottom); | 1154 ddobj->SetStreamSettings(0, zOrder, left, top, right, bottom); |
| 1156 | 1155 |
| 1157 return 0; | 1156 return 0; |
| 1158 } | 1157 } |
| 1159 | 1158 |
| 1160 } // namespace webrtc | 1159 } // namespace webrtc |
| OLD | NEW |