A GLSurfaceView{,.Renderer} that efficiently renders YUV frames from local & remote VideoTracks using the GPU for CSC. Clients will want to call the constructor, setSize() and updateFrame() as appropriate, but none of the other public methods of this class are of interest to clients (only to system classes).
상속: Android.Opengl.GLSurfaceView, GLSurfaceView.IRenderer
예제 #1
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            Java.Lang.Thread.DefaultUncaughtExceptionHandler = new UnhandledExceptionHandler(this);

            Window.AddFlags(WindowManagerFlags.Fullscreen);
            Window.AddFlags(WindowManagerFlags.KeepScreenOn);

            Point displaySize = new Point();

            WindowManager.DefaultDisplay.GetSize(displaySize);
            vsv = new VideoStreamsView(this, displaySize);
            SetContentView(vsv);

            abortUnless(PeerConnectionFactory.InitializeAndroidGlobals(this), "Failed to initializeAndroidGlobals");

            AudioManager audioManager = ((AudioManager)GetSystemService(AudioService));
            // TODO(fischman): figure out how to do this Right(tm) and remove the
            // suppression.
            bool isWiredHeadsetOn = audioManager.WiredHeadsetOn;

            audioManager.Mode           = isWiredHeadsetOn ? Mode.InCall : Mode.InCommunication;
            audioManager.SpeakerphoneOn = !isWiredHeadsetOn;

            sdpMediaConstraints = new MediaConstraints();
            sdpMediaConstraints.Mandatory.Add(new MediaConstraints.KeyValuePair("OfferToReceiveAudio", "true"));
            sdpMediaConstraints.Mandatory.Add(new MediaConstraints.KeyValuePair("OfferToReceiveVideo", "true"));

            Intent intent = Intent;

            if ("Android.intent.action.VIEW".Equals(intent.Action))
            {
                connectToRoom(intent.Data.ToString());
                return;
            }
            showGetRoomUI();
        }
 public VideoCallbacks(AppRTCDemoActivity outerInstance, VideoStreamsView view, VideoStreamsView.Endpoint stream)
 {
     this.outerInstance = outerInstance;
     this.view = view;
     this.stream = stream;
 }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            Java.Lang.Thread.DefaultUncaughtExceptionHandler = new UnhandledExceptionHandler(this);

            Window.AddFlags(WindowManagerFlags.Fullscreen);
            Window.AddFlags(WindowManagerFlags.KeepScreenOn);

            Point displaySize = new Point();
            WindowManager.DefaultDisplay.GetSize(displaySize);
            vsv = new VideoStreamsView(this, displaySize);
            SetContentView(vsv);

            abortUnless(PeerConnectionFactory.InitializeAndroidGlobals(this), "Failed to initializeAndroidGlobals");

            AudioManager audioManager = ((AudioManager)GetSystemService(AudioService));
            // TODO(fischman): figure out how to do this Right(tm) and remove the
            // suppression.
            bool isWiredHeadsetOn = audioManager.WiredHeadsetOn;
            audioManager.Mode = isWiredHeadsetOn ? Mode.InCall : Mode.InCommunication;
            audioManager.SpeakerphoneOn = !isWiredHeadsetOn;

            sdpMediaConstraints = new MediaConstraints();
            sdpMediaConstraints.Mandatory.Add(new MediaConstraints.KeyValuePair("OfferToReceiveAudio", "true"));
            sdpMediaConstraints.Mandatory.Add(new MediaConstraints.KeyValuePair("OfferToReceiveVideo", "true"));

            Intent intent = Intent;
            if ("Android.intent.action.VIEW".Equals(intent.Action))
            {
                connectToRoom(intent.Data.ToString());
                return;
            }
            showGetRoomUI();
        }
예제 #4
0
 public VideoCallbacks(AppRTCDemoActivity outerInstance, VideoStreamsView view, VideoStreamsView.Endpoint stream)
 {
     this.outerInstance = outerInstance;
     this.view          = view;
     this.stream        = stream;
 }