androidwebrtc-android

How to track the resolution/aspect ratio of a WebRTC remote VideoStream?


I have develop an android application which implement native WebRTC for video chat and i would like to present the remote video resolution and other video information but i was not able to find an WebRTC API for android that is providing this information.

I know that in javascript, there is the MediaStreamTrack.getSettings() API. the question is, how can i get the same information as MediaStreamTrack.getSettings() in Android, JAVA?


Solution

  • After 2 years I have back to my old question and now I was able to get the actual remote video resolution.

    Here are the details for other people may need it:

    private EglBase rootEglBase = EglBase.create();
    private EglBase.Context eglBaseContext = rootEglBase.getEglBaseContext();
    private SurfaceViewRenderer fullScreenView = findViewById(R.id.mainView);
    
            fullScreenView.init(eglBaseContext, new RendererCommon.RendererEvents() {
            @Override
            public void onFirstFrameRendered() {
            }
    
            @Override
            public void onFrameResolutionChanged(int videoWidth, int videoHeight, int rotation) {
                Log.i("ZCF", "onFrameResolutionChanged: W=" + videoWidth + "H=" + videoHeight + " rotation:" + rotation);
            }
        });
    

    ;