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@5539 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
fischman@webrtc.org
2014-02-13 03:56:14 +00:00
parent 17342e5092
commit 540acde5b3
6 changed files with 1000 additions and 41 deletions

View File

@@ -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...");