Adds print out of incoming resolution.

BUG=N/A
R=mflodman@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/1532004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@4091 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
henrike@webrtc.org 2013-05-23 11:57:25 +00:00
parent a7dc37d568
commit 191c596912
3 changed files with 29 additions and 0 deletions

View File

@ -192,6 +192,19 @@ class VideoCallbackAndroid: public ViEDecoderObserver,
virtual void IncomingCodecChanged(const int videoChannel,
const webrtc::VideoCodec& videoCodec)
{
JNIEnv* threadEnv = NULL;
int ret = webrtcGlobalVM->AttachCurrentThread(&threadEnv, NULL);
// Get the JNI env for this thread
if ((ret < 0) || !threadEnv)
{
__android_log_print(ANDROID_LOG_DEBUG, WEBRTC_LOG_TAG,
"Could not attach thread to JVM (%d, %p)", ret,
threadEnv);
return;
}
threadEnv->CallIntMethod(_callbackObj, _incomingResolutionId,
videoCodec.width, videoCodec.height);
webrtcGlobalVM->DetachCurrentThread();
}
;
@ -217,6 +230,7 @@ public:
jobject _callbackObj;
jclass _callbackCls;
jmethodID _callbackId;
jmethodID _incomingResolutionId;
int _frameRateO, _bitRateO;
VideoCallbackAndroid(VideoEngineData& vieData, JNIEnv * env,
jobject callback) :
@ -225,6 +239,8 @@ public:
_callbackCls = _env->GetObjectClass(_callbackObj);
_callbackId
= _env->GetMethodID(_callbackCls, "updateStats", "(IIIII)I");
_incomingResolutionId
= _env->GetMethodID(_callbackCls, "newIncomingResolution", "(II)I");
if (_callbackId == NULL) {
__android_log_print(ANDROID_LOG_ERROR, WEBRTC_LOG_TAG,
"Failed to get jid");

View File

@ -14,4 +14,6 @@ public interface IViEAndroidCallback {
public int updateStats(int frameRateI, int bitRateI,
int packetLoss, int frameRateO,
int bitRateO);
public int newIncomingResolution(int width, int height);
}

View File

@ -178,6 +178,9 @@ public class WebRTCDemo extends TabActivity implements IViEAndroidCallback,
private int bitRateO;
private int numCalls = 0;
private int widthI;
private int heightI;
// Variable for storing variables
private String webrtcName = "/webrtc";
private String webrtcDebugDir = null;
@ -352,6 +355,8 @@ public class WebRTCDemo extends TabActivity implements IViEAndroidCallback,
loadText = "< " + frameRateO + " fps/ " +
bitRateO/1024 + " kbps";
canvas.drawText(loadText, 4, 262, loadPaint);
loadText = "Incoming resolution " + widthI + "x" + heightI;
canvas.drawText(loadText, 4, 282, loadPaint);
}
updateDisplay();
}
@ -1023,6 +1028,12 @@ public class WebRTCDemo extends TabActivity implements IViEAndroidCallback,
return 0;
}
public int newIncomingResolution(int width, int height) {
widthI = width;
heightI = height;
return 0;
}
private void addStatusView() {
if (statsView != null) {
return;