diff options
4 files changed, 16 insertions, 3 deletions
diff --git a/app/webrtc/java/jni/peerconnection_jni.cc b/app/webrtc/java/jni/peerconnection_jni.cc index a0aa1d4..6bb8fed 100644 --- a/app/webrtc/java/jni/peerconnection_jni.cc +++ b/app/webrtc/java/jni/peerconnection_jni.cc @@ -1897,7 +1897,7 @@ JOW(jboolean, PeerConnectionFactory_initializeAndroidGlobals)( CHECK(g_jvm, "JNI_OnLoad failed to run?"); bool failure = false; if (initialize_video) - failure |= webrtc::VideoEngine::SetAndroidObjects(g_jvm); + failure |= webrtc::VideoEngine::SetAndroidObjects(g_jvm, context); if (initialize_audio) failure |= webrtc::VoiceEngine::SetAndroidObjects(g_jvm, jni, context); return !failure; diff --git a/examples/android/AndroidManifest.xml b/examples/android/AndroidManifest.xml index 1fb60ad..f898641 100644 --- a/examples/android/AndroidManifest.xml +++ b/examples/android/AndroidManifest.xml @@ -21,7 +21,8 @@ android:allowBackup="false"> <activity android:name="AppRTCDemoActivity" android:label="@string/app_name" - android:screenOrientation="landscape" + android:screenOrientation="fullUser" + android:configChanges="orientation|screenSize" android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen"> <intent-filter> <action android:name="android.intent.action.MAIN" /> diff --git a/examples/android/src/org/appspot/apprtc/AppRTCDemoActivity.java b/examples/android/src/org/appspot/apprtc/AppRTCDemoActivity.java index dea251a..9a3d72e 100644 --- a/examples/android/src/org/appspot/apprtc/AppRTCDemoActivity.java +++ b/examples/android/src/org/appspot/apprtc/AppRTCDemoActivity.java @@ -31,6 +31,7 @@ import android.app.Activity; import android.app.AlertDialog; import android.content.DialogInterface; import android.content.Intent; +import android.content.res.Configuration; import android.graphics.Color; import android.graphics.Point; import android.media.AudioManager; @@ -226,6 +227,13 @@ public class AppRTCDemoActivity extends Activity } } + @Override + public void onConfigurationChanged (Configuration newConfig) { + Point displaySize = new Point(); + getWindowManager().getDefaultDisplay().getSize(displaySize); + vsv.updateDisplaySize(displaySize); + super.onConfigurationChanged(newConfig); + } // Just for fun (and to regression-test bug 2302) make sure that DataChannels // can be created, queried, and disposed. diff --git a/examples/android/src/org/appspot/apprtc/VideoStreamsView.java b/examples/android/src/org/appspot/apprtc/VideoStreamsView.java index ca9cd4e..f069f0a 100644 --- a/examples/android/src/org/appspot/apprtc/VideoStreamsView.java +++ b/examples/android/src/org/appspot/apprtc/VideoStreamsView.java @@ -84,11 +84,15 @@ public class VideoStreamsView setRenderMode(RENDERMODE_WHEN_DIRTY); } + public void updateDisplaySize(Point screenDimensions) { + this.screenDimensions = screenDimensions; + } + /** Queue |frame| to be uploaded. */ public void queueFrame(final Endpoint stream, I420Frame frame) { // Paying for the copy of the YUV data here allows CSC and painting time // to get spent on the render thread instead of the UI thread. - abortUnless(framePool.validateDimensions(frame), "Frame too large!"); + abortUnless(FramePool.validateDimensions(frame), "Frame too large!"); final I420Frame frameCopy = framePool.takeFrame(frame).copyFrom(frame); boolean needToScheduleRender; synchronized (framesToRender) { |