linphone-developers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Linphone-developers] Black screen in Android videocall


From: Isaac Gonzalez
Subject: [Linphone-developers] Black screen in Android videocall
Date: Mon, 1 Jun 2015 18:22:24 +0200

Hi,  I'm trying to develop a very very basic sip phone with videocall, but I'm stcuk in this problem. When I create a new videocall, I assign the preview video to a SurfaceView  I have alredy created and the received video to antoher SurfaceView, but both of the still black. Do you know where is the problem?

Also, is there any documentation about the AndroidVideoWindowImpl class?

I am developing this program following some codes in github, but I haven't found any documentation about AndroidVideoWindowImpl  class.

Thanks,
Isaac González

This is my code in case it could be usefull:

@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
       
        this.callTo = this.getArguments().getString("callTo");
        this.videocall = this.getArguments().getBoolean("videocall");
       
        lc = MyLinphone.getLinphoneCore();
        lcFactory = LinphoneCoreFactory.instance();
       
    }
   
    @SuppressWarnings("deprecation")
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
        Bundle savedInstanceState) {
        // Inflate the layout for this fragment
        View view = inflater.inflate(R.layout.in_videocall_fragment_layout, container, false);
       
        captureView = (SurfaceView)view.findViewById(R.id.capture_view);
        captureView.setEnabled(true);
        videoView = (SurfaceView)view.findViewById(R.id.video_view);
        captureView.setZOrderOnTop(true);
        captureViewHolder = captureView.getHolder();
        captureViewHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);//Para las versiones anteriores a android3.0
       
              
       
        try {
            LinphoneAddress address = lcFactory.createLinphoneAddress(callTo);
            LinphoneCallParams params = lc.createDefaultCallParameters();   

            params.setVideoEnabled(videocall);
            params.setAudioBandwidth(0);

            lc.inviteAddressWithParams(address, params);
            lc.getCurrentCall().enableCamera(videocall);
            write("Videocall: " + videocall);
            if(videocall){
                switchCamera();

                AndroidVideoWindowImpl androidVideoWindowImpl = new AndroidVideoWindowImpl(videoView,captureView);
               
                videoWindowListener = new AndroidVideoWindowImpl.VideoWindowListener() {
                    public void onVideoRenderingSurfaceReady(AndroidVideoWindowImpl vw, SurfaceView surface) {
                        //lc.setVideoWindow(vw);
                        lc.setVideoWindow(videoView);
                        videoView = surface;
                    }

                    public void onVideoRenderingSurfaceDestroyed(AndroidVideoWindowImpl vw) {
                        LinphoneCore lc = MyLinphone.getLinphoneCore();
                        if (lc != null) {
                            lc.setVideoWindow(null);
                        }
                    }

                    public void onVideoPreviewSurfaceReady(AndroidVideoWindowImpl vw, SurfaceView surface) {
                        captureView = surface;
                        lc.setPreviewWindow(captureView);
                       
                    }

                    public void onVideoPreviewSurfaceDestroyed(AndroidVideoWindowImpl vw) {
                        MyLinphone.getLinphoneCore().setPreviewWindow(null);
                    }
                };
               
                androidVideoWindowImpl.setListener(videoWindowListener);;
                androidVideoWindowImpl.init();           
            }

        }catch (LinphoneCoreException e) {
            e.printStackTrace();
        }
           
        return view;
    }

reply via email to

[Prev in Thread] Current Thread [Next in Thread]