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 1084 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1095 encoder_factory = new MediaCodecVideoEncoderFactory(); | 1095 encoder_factory = new MediaCodecVideoEncoderFactory(); |
1096 decoder_factory = new MediaCodecVideoDecoderFactory(); | 1096 decoder_factory = new MediaCodecVideoDecoderFactory(); |
1097 } | 1097 } |
1098 #endif | 1098 #endif |
1099 rtc::scoped_refptr<PeerConnectionFactoryInterface> factory( | 1099 rtc::scoped_refptr<PeerConnectionFactoryInterface> factory( |
1100 webrtc::CreatePeerConnectionFactory(worker_thread, | 1100 webrtc::CreatePeerConnectionFactory(worker_thread, |
1101 signaling_thread, | 1101 signaling_thread, |
1102 NULL, | 1102 NULL, |
1103 encoder_factory, | 1103 encoder_factory, |
1104 decoder_factory)); | 1104 decoder_factory)); |
1105 CHECK(factory) << "Failed to create the peer connection factory; " | |
1106 << "WebRTC/libjingle init likely failed on this device"; | |
1107 OwnedFactoryAndThreads* owned_factory = new OwnedFactoryAndThreads( | 1105 OwnedFactoryAndThreads* owned_factory = new OwnedFactoryAndThreads( |
1108 worker_thread, signaling_thread, | 1106 worker_thread, signaling_thread, |
1109 encoder_factory, decoder_factory, | 1107 encoder_factory, decoder_factory, |
1110 factory.release()); | 1108 factory.release()); |
1111 return jlongFromPointer(owned_factory); | 1109 return jlongFromPointer(owned_factory); |
1112 } | 1110 } |
1113 | 1111 |
1114 JOW(void, PeerConnectionFactory_freeFactory)(JNIEnv*, jclass, jlong j_p) { | 1112 JOW(void, PeerConnectionFactory_freeFactory)(JNIEnv*, jclass, jlong j_p) { |
1115 delete reinterpret_cast<OwnedFactoryAndThreads*>(j_p); | 1113 delete reinterpret_cast<OwnedFactoryAndThreads*>(j_p); |
1116 if (field_trials_init_string) { | 1114 if (field_trials_init_string) { |
(...skipping 704 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1821 rtc::scoped_ptr<jbyte> buffer(static_cast<jbyte*>(malloc(log_size))); | 1819 rtc::scoped_ptr<jbyte> buffer(static_cast<jbyte*>(malloc(log_size))); |
1822 stream->ReadAll(buffer.get(), log_size, &read, nullptr); | 1820 stream->ReadAll(buffer.get(), log_size, &read, nullptr); |
1823 | 1821 |
1824 jbyteArray result = jni->NewByteArray(read); | 1822 jbyteArray result = jni->NewByteArray(read); |
1825 jni->SetByteArrayRegion(result, 0, read, buffer.get()); | 1823 jni->SetByteArrayRegion(result, 0, read, buffer.get()); |
1826 | 1824 |
1827 return result; | 1825 return result; |
1828 } | 1826 } |
1829 | 1827 |
1830 } // namespace webrtc_jni | 1828 } // namespace webrtc_jni |
OLD | NEW |