Skip to content

Commit

Permalink
fix bug remoterender when disconnecting/connecting
Browse files Browse the repository at this point in the history
  • Loading branch information
pchab committed Mar 31, 2015
1 parent 1284af6 commit ee34157
Show file tree
Hide file tree
Showing 8 changed files with 100 additions and 10 deletions.
9 changes: 9 additions & 0 deletions .idea/copyright/Apache2_0.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/copyright/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions app/src/main/java/fr/pchab/androidrtc/RtcActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ public void onLocalStream(MediaStream localStream) {
VideoRendererGui.update(localRender,
LOCAL_X_CONNECTING, LOCAL_Y_CONNECTING,
LOCAL_WIDTH_CONNECTING, LOCAL_HEIGHT_CONNECTING,
VideoRendererGui.ScalingType.SCALE_ASPECT_FIT);
scalingType);
}

@Override
Expand All @@ -185,15 +185,14 @@ public void onAddRemoteStream(MediaStream remoteStream, int endPoint) {
VideoRendererGui.update(localRender,
LOCAL_X_CONNECTED, LOCAL_Y_CONNECTED,
LOCAL_WIDTH_CONNECTED, LOCAL_HEIGHT_CONNECTED,
VideoRendererGui.ScalingType.SCALE_ASPECT_FIT);
scalingType);
}

@Override
public void onRemoveRemoteStream(int endPoint) {
VideoRendererGui.remove(remoteRender);
VideoRendererGui.update(localRender,
LOCAL_X_CONNECTING, LOCAL_Y_CONNECTING,
LOCAL_WIDTH_CONNECTING, LOCAL_HEIGHT_CONNECTING,
VideoRendererGui.ScalingType.SCALE_ASPECT_FIT);
scalingType);
}
}
5 changes: 3 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.1.0'

classpath 'com.android.tools.build:gradle:1.1.2'
classpath 'com.github.dcendents:android-maven-plugin:1.2'
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.1"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
Expand Down
61 changes: 60 additions & 1 deletion webrtc-client/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
apply plugin: 'android-library'
apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'com.jfrog.bintray'

// This is the library version used when deploying the artifact
version = "1.0.0"

android {
compileSdkVersion 22
Expand All @@ -18,8 +23,62 @@ android {
}
}

def siteUrl = 'https://github.com/pchab/AndroidRTC' // Homepage URL of the library
def gitUrl = 'https://github.com/pchab/AndroidRTC.git' // Git repository URL
group = "fr.pchab" // Maven Group ID for the artifact

install {
repositories.mavenInstaller {
// This generates POM.xml with proper parameters
pom {
project {
packaging 'aar'

// Add your description here
name 'webrtc-client'
url siteUrl

// Set your license
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id 'fr.pchab'
name 'Pierre Chabardes'
email '[email protected]'
}
}
}
}
}
}

dependencies {
compile 'com.android.support:appcompat-v7:22.0.0'
compile 'com.github.nkzawa:socket.io-client:0.4.2'
compile 'io.pristine:libjingle:8689@aar'
}

task sourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier = 'sources'
}

task javadoc(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
}

task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}

artifacts {
archives javadocJar
archives sourcesJar
}
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ private Peer addPeer(String id, int endPoint) {
private void removePeer(String id) {
Peer peer = peers.get(id);
mListener.onRemoveRemoteStream(peer.endPoint);
peer.pc.close();
peers.remove(peer.id);
endPoints[peer.endPoint] = false;
}
Expand Down
7 changes: 5 additions & 2 deletions webrtc-client/webrtc-client.iml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" external.system.module.group="AndroidRTC" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
<module external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" external.system.module.group="fr.pchab" external.system.module.version="1.0.0" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="android-gradle" name="Android-Gradle">
<configuration>
Expand All @@ -18,7 +18,7 @@
<option name="ALLOW_USER_CONFIGURATION" value="false" />
<option name="MANIFEST_FILE_RELATIVE_PATH" value="/src/main/AndroidManifest.xml" />
<option name="RES_FOLDER_RELATIVE_PATH" value="/src/main/res" />
<option name="RES_FOLDERS_RELATIVE_PATH" value="file://$MODULE_DIR$/src/main/res" />
<option name="RES_FOLDERS_RELATIVE_PATH" value="" />
<option name="ASSETS_FOLDER_RELATIVE_PATH" value="/src/main/assets" />
<option name="LIBRARY_PROJECT" value="true" />
</configuration>
Expand Down Expand Up @@ -62,6 +62,7 @@
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/build/docs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/bundles" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" />
Expand All @@ -81,7 +82,9 @@
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
<excludeFolder url="file://$MODULE_DIR$/build/libs" />
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
<excludeFolder url="file://$MODULE_DIR$/build/poms" />
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
</content>
<orderEntry type="jdk" jdkName="Android API 22 Platform" jdkType="Android SDK" />
Expand Down

0 comments on commit ee34157

Please sign in to comment.