summaryrefslogtreecommitdiff
path: root/examples/android/src/org/appspot/apprtc/AppRTCDemoActivity.java
diff options
context:
space:
mode:
authorfischman@webrtc.org <fischman@webrtc.org@4adac7df-926f-26a2-2b94-8c16560cd09d>2014-02-13 03:56:14 +0000
committerfischman@webrtc.org <fischman@webrtc.org@4adac7df-926f-26a2-2b94-8c16560cd09d>2014-02-13 03:56:14 +0000
commitb0ffe7003e63b7283f3897a919aa8d2905d7a313 (patch)
tree9bc403715b80e1b09edaa14c9f1daba438b8e1f8 /examples/android/src/org/appspot/apprtc/AppRTCDemoActivity.java
parentac981114cbd52dcfa16000ca08c0d40c775bc92d (diff)
downloadtalk-b0ffe7003e63b7283f3897a919aa8d2905d7a313.tar.gz
PeerConnection(java): use MediaCodec for HW-accelerated video encode where available.
Still disabled by default until https://code.google.com/p/webrtc/issues/detail?id=2899 is resolved. Also (because I needed them during development): - make AppRTCDemo "debuggable" for extra JNI checks - honor audio constraints served by apprtc.appspot.com - don't "restart" video when it hasn't been stopped (affects running with the screen off) BUG=2575 R=noahric@google.com Review URL: https://webrtc-codereview.appspot.com/8269004 git-svn-id: http://webrtc.googlecode.com/svn/trunk/talk@5539 4adac7df-926f-26a2-2b94-8c16560cd09d
Diffstat (limited to 'examples/android/src/org/appspot/apprtc/AppRTCDemoActivity.java')
-rw-r--r--examples/android/src/org/appspot/apprtc/AppRTCDemoActivity.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/examples/android/src/org/appspot/apprtc/AppRTCDemoActivity.java b/examples/android/src/org/appspot/apprtc/AppRTCDemoActivity.java
index e872355..1754994 100644
--- a/examples/android/src/org/appspot/apprtc/AppRTCDemoActivity.java
+++ b/examples/android/src/org/appspot/apprtc/AppRTCDemoActivity.java
@@ -75,6 +75,7 @@ public class AppRTCDemoActivity extends Activity
private static final String TAG = "AppRTCDemoActivity";
private PeerConnectionFactory factory;
private VideoSource videoSource;
+ private boolean videoSourceStopped;
private PeerConnection pc;
private final PCObserver pcObserver = new PCObserver();
private final SDPObserver sdpObserver = new SDPObserver();
@@ -159,6 +160,7 @@ public class AppRTCDemoActivity extends Activity
vsv.onPause();
if (videoSource != null) {
videoSource.stop();
+ videoSourceStopped = true;
}
}
@@ -166,7 +168,7 @@ public class AppRTCDemoActivity extends Activity
public void onResume() {
super.onResume();
vsv.onResume();
- if (videoSource != null) {
+ if (videoSource != null && videoSourceStopped) {
videoSource.restart();
}
}
@@ -239,7 +241,9 @@ public class AppRTCDemoActivity extends Activity
vsv, VideoStreamsView.Endpoint.LOCAL)));
lMS.addTrack(videoTrack);
}
- lMS.addTrack(factory.createAudioTrack("ARDAMSa0"));
+ if (appRtcClient.audioConstraints() != null) {
+ lMS.addTrack(factory.createAudioTrack("ARDAMSa0"));
+ }
pc.addStream(lMS, new MediaConstraints());
}
logAndToast("Waiting for ICE candidates...");