OLD | NEW |
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2013 Google Inc. | 3 * Copyright 2013 Google Inc. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 public void dispose() { | 141 public void dispose() { |
142 nativeFreeFactory(nativeFactory); | 142 nativeFreeFactory(nativeFactory); |
143 signalingThread = null; | 143 signalingThread = null; |
144 workerThread = null; | 144 workerThread = null; |
145 } | 145 } |
146 | 146 |
147 public void threadsCallbacks() { | 147 public void threadsCallbacks() { |
148 nativeThreadsCallbacks(nativeFactory); | 148 nativeThreadsCallbacks(nativeFactory); |
149 } | 149 } |
150 | 150 |
151 public static void printStackTraces() { | 151 private static void printStackTrace(Thread thread, String threadName) { |
152 if (workerThread != null) { | 152 if (thread != null) { |
153 Logging.d(TAG, "Worker thread stacks trace:"); | 153 StackTraceElement[] stackTraces = thread.getStackTrace(); |
154 for (StackTraceElement stackTrace : workerThread.getStackTrace()) { | 154 if (stackTraces.length > 0) { |
155 Logging.d(TAG, stackTrace.toString()); | 155 Logging.d(TAG, threadName + " stacks trace:"); |
| 156 for (StackTraceElement stackTrace : stackTraces) { |
| 157 Logging.d(TAG, stackTrace.toString()); |
| 158 } |
156 } | 159 } |
157 } | 160 } |
158 if (signalingThread != null) { | 161 } |
159 Logging.d(TAG, "Signaling thread stacks trace:"); | 162 |
160 for (StackTraceElement stackTrace : signalingThread.getStackTrace()) { | 163 public static void printStackTraces() { |
161 Logging.d(TAG, stackTrace.toString()); | 164 printStackTrace(workerThread, "Worker thread"); |
162 } | 165 printStackTrace(signalingThread, "Signaling thread"); |
163 } | |
164 } | 166 } |
165 | 167 |
166 private static void onWorkerThreadReady() { | 168 private static void onWorkerThreadReady() { |
167 workerThread = Thread.currentThread(); | 169 workerThread = Thread.currentThread(); |
168 Logging.d(TAG, "onWorkerThreadReady"); | 170 Logging.d(TAG, "onWorkerThreadReady"); |
169 } | 171 } |
170 | 172 |
171 private static void onSignalingThreadReady() { | 173 private static void onSignalingThreadReady() { |
172 signalingThread = Thread.currentThread(); | 174 signalingThread = Thread.currentThread(); |
173 Logging.d(TAG, "onSignalingThreadReady"); | 175 Logging.d(TAG, "onSignalingThreadReady"); |
(...skipping 26 matching lines...) Expand all Loading... |
200 | 202 |
201 public native void nativeSetOptions(long nativeFactory, Options options); | 203 public native void nativeSetOptions(long nativeFactory, Options options); |
202 | 204 |
203 private static native void nativeSetVideoHwAccelerationOptions( | 205 private static native void nativeSetVideoHwAccelerationOptions( |
204 long nativeFactory, Object renderEGLContext); | 206 long nativeFactory, Object renderEGLContext); |
205 | 207 |
206 private static native void nativeThreadsCallbacks(long nativeFactory); | 208 private static native void nativeThreadsCallbacks(long nativeFactory); |
207 | 209 |
208 private static native void nativeFreeFactory(long nativeFactory); | 210 private static native void nativeFreeFactory(long nativeFactory); |
209 } | 211 } |
OLD | NEW |