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

Side by Side Diff: webrtc/api/androidtests/src/org/webrtc/PeerConnectionTest.java

Issue 1819553002: Added the JNI interface to get and set RtpParameters and the maximum bitrate limits. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Addressed some more code review feedback. Created 4 years, 9 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
OLDNEW
1 /* 1 /*
2 * Copyright 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2013 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 676 matching lines...) Expand 10 before | Expand all | Expand 10 after
687 } 687 }
688 688
689 assertTrue(offeringExpectations.waitForAllExpectationsToBeSatisfied(TIMEOUT_ SECONDS)); 689 assertTrue(offeringExpectations.waitForAllExpectationsToBeSatisfied(TIMEOUT_ SECONDS));
690 assertTrue(answeringExpectations.waitForAllExpectationsToBeSatisfied(TIMEOUT _SECONDS)); 690 assertTrue(answeringExpectations.waitForAllExpectationsToBeSatisfied(TIMEOUT _SECONDS));
691 691
692 assertEquals( 692 assertEquals(
693 PeerConnection.SignalingState.STABLE, offeringPC.signalingState()); 693 PeerConnection.SignalingState.STABLE, offeringPC.signalingState());
694 assertEquals( 694 assertEquals(
695 PeerConnection.SignalingState.STABLE, answeringPC.signalingState()); 695 PeerConnection.SignalingState.STABLE, answeringPC.signalingState());
696 696
697 // Set a bitrate limit for the outgoing video stream for the offerer.
698 RtpSender videoSender = null;
699 for (RtpSender sender : offeringPC.getSenders()) {
700 if (sender.track().kind().equals("video")) {
701 videoSender = sender;
702 }
703 }
704 assertNotNull(videoSender);
705 RtpParameters rtpParameters = videoSender.getParameters();
706 assertNotNull(rtpParameters);
707 assertEquals(1, rtpParameters.encodings.size());
708 assertNull(rtpParameters.encodings.get(0).maxBitrateBps);
709
710 rtpParameters.encodings.get(0).maxBitrateBps = 300000;
711 assertTrue(videoSender.setParameters(rtpParameters));
712
713 // Verify that we can read back the updated value.
714 rtpParameters = videoSender.getParameters();
715 assertEquals(300000, (int) rtpParameters.encodings.get(0).maxBitrateBps);
716
697 // Test send & receive UTF-8 text. 717 // Test send & receive UTF-8 text.
698 answeringExpectations.expectMessage( 718 answeringExpectations.expectMessage(
699 ByteBuffer.wrap("hello!".getBytes(Charset.forName("UTF-8"))), false); 719 ByteBuffer.wrap("hello!".getBytes(Charset.forName("UTF-8"))), false);
700 DataChannel.Buffer buffer = new DataChannel.Buffer( 720 DataChannel.Buffer buffer = new DataChannel.Buffer(
701 ByteBuffer.wrap("hello!".getBytes(Charset.forName("UTF-8"))), false); 721 ByteBuffer.wrap("hello!".getBytes(Charset.forName("UTF-8"))), false);
702 assertTrue(offeringExpectations.dataChannel.send(buffer)); 722 assertTrue(offeringExpectations.dataChannel.send(buffer));
703 assertTrue(answeringExpectations.waitForAllExpectationsToBeSatisfied(TIMEOUT _SECONDS)); 723 assertTrue(answeringExpectations.waitForAllExpectationsToBeSatisfied(TIMEOUT _SECONDS));
704 724
705 // Construct this binary message two different ways to ensure no 725 // Construct this binary message two different ways to ensure no
706 // shortcuts are taken. 726 // shortcuts are taken.
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
984 TreeSet<String> threads = new TreeSet<String>(); 1004 TreeSet<String> threads = new TreeSet<String>();
985 // This pokes at /proc instead of using the Java APIs because we're also 1005 // This pokes at /proc instead of using the Java APIs because we're also
986 // looking for libjingle/webrtc native threads, most of which won't have 1006 // looking for libjingle/webrtc native threads, most of which won't have
987 // attached to the JVM. 1007 // attached to the JVM.
988 for (String threadId : (new File("/proc/self/task")).list()) { 1008 for (String threadId : (new File("/proc/self/task")).list()) {
989 threads.add(threadId); 1009 threads.add(threadId);
990 } 1010 }
991 return threads; 1011 return threads;
992 } 1012 }
993 } 1013 }
OLDNEW
« no previous file with comments | « no previous file | webrtc/api/java/jni/classreferenceholder.cc » ('j') | webrtc/api/java/jni/jni_helpers.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698