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

Unified Diff: webrtc/examples/androidapp/src/org/appspot/apprtc/CallActivity.java

Issue 3016443002: Android AppRTCMobile: Transition local render to new VideoSink interface (Closed)
Patch Set: Update tests Created 3 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | webrtc/examples/androidapp/src/org/appspot/apprtc/PeerConnectionClient.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/examples/androidapp/src/org/appspot/apprtc/CallActivity.java
diff --git a/webrtc/examples/androidapp/src/org/appspot/apprtc/CallActivity.java b/webrtc/examples/androidapp/src/org/appspot/apprtc/CallActivity.java
index 9c3347bbcf1c5850675041debd9a02c6da0d21da..45bc26b64d8679ae21708cf42738a412ee045e3f 100644
--- a/webrtc/examples/androidapp/src/org/appspot/apprtc/CallActivity.java
+++ b/webrtc/examples/androidapp/src/org/appspot/apprtc/CallActivity.java
@@ -56,7 +56,9 @@ import org.webrtc.StatsReport;
import org.webrtc.SurfaceViewRenderer;
import org.webrtc.VideoCapturer;
import org.webrtc.VideoFileRenderer;
+import org.webrtc.VideoFrame;
import org.webrtc.VideoRenderer;
+import org.webrtc.VideoSink;
/**
* Activity for peer connection call setup, call waiting
@@ -137,9 +139,11 @@ public class CallActivity extends Activity implements AppRTCClient.SignalingEven
// Peer connection statistics callback period in ms.
private static final int STAT_CALLBACK_PERIOD = 1000;
- private class ProxyRenderer implements VideoRenderer.Callbacks {
- private VideoRenderer.Callbacks target;
+ private class ProxyRenderer<T extends VideoRenderer.Callbacks & VideoSink>
+ implements VideoRenderer.Callbacks, VideoSink {
+ private T target;
+ @Override
synchronized public void renderFrame(VideoRenderer.I420Frame frame) {
if (target == null) {
Logging.d(TAG, "Dropping frame in proxy because target is null.");
@@ -150,7 +154,17 @@ public class CallActivity extends Activity implements AppRTCClient.SignalingEven
target.renderFrame(frame);
}
- synchronized public void setTarget(VideoRenderer.Callbacks target) {
+ @Override
+ synchronized public void onFrame(VideoFrame frame) {
+ if (target == null) {
+ Logging.d(TAG, "Dropping frame in proxy because target is null.");
+ return;
+ }
+
+ target.onFrame(frame);
+ }
+
+ synchronized public void setTarget(T target) {
this.target = target;
}
}
« no previous file with comments | « no previous file | webrtc/examples/androidapp/src/org/appspot/apprtc/PeerConnectionClient.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698