| 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 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 402 } | 402 } |
| 403 | 403 |
| 404 WEBRTC_TRACE(kTraceDebug, | 404 WEBRTC_TRACE(kTraceDebug, |
| 405 kTraceVideoRenderer, | 405 kTraceVideoRenderer, |
| 406 _id, | 406 _id, |
| 407 "%s: AndroidSurfaceViewChannel done", | 407 "%s: AndroidSurfaceViewChannel done", |
| 408 __FUNCTION__); | 408 __FUNCTION__); |
| 409 return 0; | 409 return 0; |
| 410 } | 410 } |
| 411 | 411 |
| 412 int32_t AndroidSurfaceViewChannel::RenderFrame(const uint32_t /*streamId*/, | 412 void AndroidSurfaceViewChannel::OnFrame(const VideoFrame& videoFrame) { |
| 413 const VideoFrame& videoFrame) { | |
| 414 // WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer,_id, "%s:" ,__FUNCTION__); | 413 // WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer,_id, "%s:" ,__FUNCTION__); |
| 415 _renderCritSect.Enter(); | 414 _renderCritSect.Enter(); |
| 416 _bufferToRender = videoFrame; | 415 _bufferToRender = videoFrame; |
| 417 _renderCritSect.Leave(); | 416 _renderCritSect.Leave(); |
| 418 _renderer.ReDraw(); | 417 _renderer.ReDraw(); |
| 419 return 0; | |
| 420 } | 418 } |
| 421 | 419 |
| 422 | 420 |
| 423 /*Implements AndroidStream | 421 /*Implements AndroidStream |
| 424 * Calls the Java object and render the buffer in _bufferToRender | 422 * Calls the Java object and render the buffer in _bufferToRender |
| 425 */ | 423 */ |
| 426 void AndroidSurfaceViewChannel::DeliverFrame(JNIEnv* jniEnv) { | 424 void AndroidSurfaceViewChannel::DeliverFrame(JNIEnv* jniEnv) { |
| 427 _renderCritSect.Enter(); | 425 _renderCritSect.Enter(); |
| 428 | 426 |
| 429 if (_bitmapWidth != _bufferToRender.width() || | 427 if (_bitmapWidth != _bufferToRender.width() || |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 465 _renderCritSect.Leave(); | 463 _renderCritSect.Leave(); |
| 466 return; | 464 return; |
| 467 } | 465 } |
| 468 } | 466 } |
| 469 _renderCritSect.Leave(); | 467 _renderCritSect.Leave(); |
| 470 // Draw the Surface | 468 // Draw the Surface |
| 471 jniEnv->CallVoidMethod(_javaRenderObj, _drawByteBufferCid); | 469 jniEnv->CallVoidMethod(_javaRenderObj, _drawByteBufferCid); |
| 472 } | 470 } |
| 473 | 471 |
| 474 } // namespace webrtc | 472 } // namespace webrtc |
| OLD | NEW |