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 |
11 #include "webrtc/modules/video_render/android/video_render_android_native_opengl
2.h" | 11 #include "webrtc/modules/video_render/android/video_render_android_native_opengl
2.h" |
12 #include "webrtc/system_wrappers/include/critical_section_wrapper.h" | 12 #include "webrtc/system_wrappers/include/critical_section_wrapper.h" |
13 #include "webrtc/system_wrappers/include/tick_util.h" | |
14 | 13 |
15 #ifdef ANDROID_LOG | 14 #ifdef ANDROID_LOG |
16 #include <android/log.h> | 15 #include <android/log.h> |
17 #include <stdio.h> | 16 #include <stdio.h> |
18 | 17 |
19 #undef WEBRTC_TRACE | 18 #undef WEBRTC_TRACE |
20 #define WEBRTC_TRACE(a,b,c,...) __android_log_print(ANDROID_LOG_DEBUG, "*WEBRTC
*", __VA_ARGS__) | 19 #define WEBRTC_TRACE(a,b,c,...) __android_log_print(ANDROID_LOG_DEBUG, "*WEBRTC
*", __VA_ARGS__) |
21 #else | 20 #else |
22 #include "webrtc/system_wrappers/include/trace.h" | 21 #include "webrtc/system_wrappers/include/trace.h" |
23 #endif | 22 #endif |
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 _bufferToRender = videoFrame; | 387 _bufferToRender = videoFrame; |
389 _renderCritSect.Leave(); | 388 _renderCritSect.Leave(); |
390 _renderer.ReDraw(); | 389 _renderer.ReDraw(); |
391 return 0; | 390 return 0; |
392 } | 391 } |
393 | 392 |
394 /*Implements AndroidStream | 393 /*Implements AndroidStream |
395 * Calls the Java object and render the buffer in _bufferToRender | 394 * Calls the Java object and render the buffer in _bufferToRender |
396 */ | 395 */ |
397 void AndroidNativeOpenGl2Channel::DeliverFrame(JNIEnv* jniEnv) { | 396 void AndroidNativeOpenGl2Channel::DeliverFrame(JNIEnv* jniEnv) { |
398 //TickTime timeNow=TickTime::Now(); | |
399 | |
400 //Draw the Surface | 397 //Draw the Surface |
401 jniEnv->CallVoidMethod(_javaRenderObj, _redrawCid); | 398 jniEnv->CallVoidMethod(_javaRenderObj, _redrawCid); |
402 | |
403 // WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer,_id, | |
404 // "%s: time to deliver %lld" ,__FUNCTION__, | |
405 // (TickTime::Now()-timeNow).Milliseconds()); | |
406 } | 399 } |
407 | 400 |
408 /* | 401 /* |
409 * JNI callback from Java class. Called when the render | 402 * JNI callback from Java class. Called when the render |
410 * want to render a frame. Called from the GLRenderThread | 403 * want to render a frame. Called from the GLRenderThread |
411 * Method: DrawNative | 404 * Method: DrawNative |
412 * Signature: (J)V | 405 * Signature: (J)V |
413 */ | 406 */ |
414 void JNICALL AndroidNativeOpenGl2Channel::DrawNativeStatic( | 407 void JNICALL AndroidNativeOpenGl2Channel::DrawNativeStatic( |
415 JNIEnv * env, jobject, jlong context) { | 408 JNIEnv * env, jobject, jlong context) { |
(...skipping 25 matching lines...) Expand all Loading... |
441 WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer, -1, "%s:", __FUNCTION__); | 434 WEBRTC_TRACE(kTraceInfo, kTraceVideoRenderer, -1, "%s:", __FUNCTION__); |
442 return renderChannel->CreateOpenGLNative(width, height); | 435 return renderChannel->CreateOpenGLNative(width, height); |
443 } | 436 } |
444 | 437 |
445 jint AndroidNativeOpenGl2Channel::CreateOpenGLNative( | 438 jint AndroidNativeOpenGl2Channel::CreateOpenGLNative( |
446 int width, int height) { | 439 int width, int height) { |
447 return _openGLRenderer.Setup(width, height); | 440 return _openGLRenderer.Setup(width, height); |
448 } | 441 } |
449 | 442 |
450 } // namespace webrtc | 443 } // namespace webrtc |
OLD | NEW |