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 2102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2113 size_t read = 0; | 2113 size_t read = 0; |
2114 rtc::scoped_ptr<jbyte> buffer(static_cast<jbyte*>(malloc(log_size))); | 2114 rtc::scoped_ptr<jbyte> buffer(static_cast<jbyte*>(malloc(log_size))); |
2115 stream->ReadAll(buffer.get(), log_size, &read, nullptr); | 2115 stream->ReadAll(buffer.get(), log_size, &read, nullptr); |
2116 | 2116 |
2117 jbyteArray result = jni->NewByteArray(read); | 2117 jbyteArray result = jni->NewByteArray(read); |
2118 jni->SetByteArrayRegion(result, 0, read, buffer.get()); | 2118 jni->SetByteArrayRegion(result, 0, read, buffer.get()); |
2119 | 2119 |
2120 return result; | 2120 return result; |
2121 } | 2121 } |
2122 | 2122 |
2123 JOW(void, RtpSender_nativeSetTrack)(JNIEnv* jni, | 2123 JOW(jboolean, RtpSender_nativeSetTrack)(JNIEnv* jni, |
2124 jclass, | 2124 jclass, |
2125 jlong j_rtp_sender_pointer, | 2125 jlong j_rtp_sender_pointer, |
2126 jlong j_track_pointer) { | 2126 jlong j_track_pointer) { |
2127 reinterpret_cast<RtpSenderInterface*>(j_rtp_sender_pointer) | 2127 return reinterpret_cast<RtpSenderInterface*>(j_rtp_sender_pointer) |
2128 ->SetTrack(reinterpret_cast<MediaStreamTrackInterface*>(j_track_pointer)); | 2128 ->SetTrack(reinterpret_cast<MediaStreamTrackInterface*>(j_track_pointer)); |
2129 } | 2129 } |
2130 | 2130 |
2131 JOW(jlong, RtpSender_nativeGetTrack)(JNIEnv* jni, | 2131 JOW(jlong, RtpSender_nativeGetTrack)(JNIEnv* jni, |
2132 jclass, | 2132 jclass, |
2133 jlong j_rtp_sender_pointer, | 2133 jlong j_rtp_sender_pointer, |
2134 jlong j_track_pointer) { | 2134 jlong j_track_pointer) { |
2135 return jlongFromPointer( | 2135 return jlongFromPointer( |
2136 reinterpret_cast<RtpSenderInterface*>(j_rtp_sender_pointer) | 2136 reinterpret_cast<RtpSenderInterface*>(j_rtp_sender_pointer) |
2137 ->track() | 2137 ->track() |
(...skipping 25 matching lines...) Expand all Loading... |
2163 return JavaStringFromStdString( | 2163 return JavaStringFromStdString( |
2164 jni, | 2164 jni, |
2165 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->id()); | 2165 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->id()); |
2166 } | 2166 } |
2167 | 2167 |
2168 JOW(void, RtpReceiver_free)(JNIEnv* jni, jclass, jlong j_rtp_receiver_pointer) { | 2168 JOW(void, RtpReceiver_free)(JNIEnv* jni, jclass, jlong j_rtp_receiver_pointer) { |
2169 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->Release(); | 2169 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->Release(); |
2170 } | 2170 } |
2171 | 2171 |
2172 } // namespace webrtc_jni | 2172 } // namespace webrtc_jni |
OLD | NEW |