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

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

Issue 1538673002: Adding a MediaStream parameter to createSender. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Just take a string as a parameter, for simplicity. Created 5 years 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/PeerConnection.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 1769 matching lines...) Expand 10 before | Expand all | Expand 10 after
1780 reinterpret_cast<MediaStreamInterface*>(native_stream)); 1780 reinterpret_cast<MediaStreamInterface*>(native_stream));
1781 } 1781 }
1782 1782
1783 JOW(void, PeerConnection_nativeRemoveLocalStream)( 1783 JOW(void, PeerConnection_nativeRemoveLocalStream)(
1784 JNIEnv* jni, jobject j_pc, jlong native_stream) { 1784 JNIEnv* jni, jobject j_pc, jlong native_stream) {
1785 ExtractNativePC(jni, j_pc)->RemoveStream( 1785 ExtractNativePC(jni, j_pc)->RemoveStream(
1786 reinterpret_cast<MediaStreamInterface*>(native_stream)); 1786 reinterpret_cast<MediaStreamInterface*>(native_stream));
1787 } 1787 }
1788 1788
1789 JOW(jobject, PeerConnection_nativeCreateSender)( 1789 JOW(jobject, PeerConnection_nativeCreateSender)(
1790 JNIEnv* jni, jobject j_pc, jstring j_kind) { 1790 JNIEnv* jni, jobject j_pc, jstring j_kind, jstring j_stream_id) {
1791 jclass j_rtp_sender_class = FindClass(jni, "org/webrtc/RtpSender"); 1791 jclass j_rtp_sender_class = FindClass(jni, "org/webrtc/RtpSender");
1792 jmethodID j_rtp_sender_ctor = 1792 jmethodID j_rtp_sender_ctor =
1793 GetMethodID(jni, j_rtp_sender_class, "<init>", "(J)V"); 1793 GetMethodID(jni, j_rtp_sender_class, "<init>", "(J)V");
1794 1794
1795 std::string kind = JavaToStdString(jni, j_kind); 1795 std::string kind = JavaToStdString(jni, j_kind);
1796 std::string stream_id = JavaToStdString(jni, j_stream_id);
1796 rtc::scoped_refptr<RtpSenderInterface> sender = 1797 rtc::scoped_refptr<RtpSenderInterface> sender =
1797 ExtractNativePC(jni, j_pc)->CreateSender(kind); 1798 ExtractNativePC(jni, j_pc)->CreateSender(kind, stream_id);
1798 if (!sender.get()) { 1799 if (!sender.get()) {
1799 return nullptr; 1800 return nullptr;
1800 } 1801 }
1801 jlong nativeSenderPtr = jlongFromPointer(sender.get()); 1802 jlong nativeSenderPtr = jlongFromPointer(sender.get());
1802 jobject j_sender = 1803 jobject j_sender =
1803 jni->NewObject(j_rtp_sender_class, j_rtp_sender_ctor, nativeSenderPtr); 1804 jni->NewObject(j_rtp_sender_class, j_rtp_sender_ctor, nativeSenderPtr);
1804 CHECK_EXCEPTION(jni) << "error during NewObject"; 1805 CHECK_EXCEPTION(jni) << "error during NewObject";
1805 // Sender is now owned by the Java object, and will be freed from 1806 // Sender is now owned by the Java object, and will be freed from
1806 // RtpSender.dispose(), called by PeerConnection.dispose() or getSenders(). 1807 // RtpSender.dispose(), called by PeerConnection.dispose() or getSenders().
1807 sender->AddRef(); 1808 sender->AddRef();
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after
2157 return JavaStringFromStdString( 2158 return JavaStringFromStdString(
2158 jni, 2159 jni,
2159 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->id()); 2160 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->id());
2160 } 2161 }
2161 2162
2162 JOW(void, RtpReceiver_free)(JNIEnv* jni, jclass, jlong j_rtp_receiver_pointer) { 2163 JOW(void, RtpReceiver_free)(JNIEnv* jni, jclass, jlong j_rtp_receiver_pointer) {
2163 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->Release(); 2164 reinterpret_cast<RtpReceiverInterface*>(j_rtp_receiver_pointer)->Release();
2164 } 2165 }
2165 2166
2166 } // namespace webrtc_jni 2167 } // namespace webrtc_jni
OLDNEW
« no previous file with comments | « no previous file | talk/app/webrtc/java/src/org/webrtc/PeerConnection.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698