2

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?

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
Zion Cohen
  • 182
  • 6
  • 19
  • Are you using a webrtc library or similar? How are you implementing the functionality currently? – JensV Apr 17 '20 at 13:25
  • Are you using Socket.io or WebSockets? Why you don't use them to send and sync those datas between clients before starting call? – feridok Apr 17 '20 at 17:17
  • i am using my Web Socket and i know what data i am sending but this is not my question. my question is how do i know what each side receiving? for that i need to be able to get it from the remote video track but i did not find any way to get such kind of data. – Zion Cohen Apr 18 '20 at 23:31
  • for the first comment, yes, i am using Native Android WEBRTC library with JAVA websocket.as a signaling server and XIRSYS STUN & TURN servers. – Zion Cohen Apr 18 '20 at 23:40

1 Answers1

2

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 way 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);
        }
    });

;

Zion Cohen
  • 182
  • 6
  • 19