Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: talk/app/webrtc/java/jni/peerconnection_jni.cc

Issue 1566103003: Adding a way for a Java RtpSender to set a track without taking ownership. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | talk/app/webrtc/java/src/org/webrtc/RtpSender.java » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | talk/app/webrtc/java/src/org/webrtc/RtpSender.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698