Exemple #1
0
        protected override void OnCreate(Bundle bundle)
        {
            /*base.OnCreate (bundle);
             * SetContentView(Resource.Layout.CameraView);
             * camera = (SurfaceView)FindViewById(Resource.Id.smallcameraview);
             * camera.Holder.SetType(SurfaceType.PushBuffers);
             * holder = camera.Holder;
             * Session.setSurfaceHolder(holder);*/

            base.OnCreate(bundle);
            base.RequestedOrientation = Android.Content.PM.ScreenOrientation.Portrait;
            SetContentView(Resource.Layout.Main);
            startButton    = FindViewById <ImageButton> (Resource.Id.startButton);
            connectButton  = FindViewById <ImageButton> (Resource.Id.connectToClientButton);
            settingsButton = FindViewById <ImageButton> (Resource.Id.settingsButton);

            connectLight   = FindViewById <ImageView> (Resource.Id.connectLight);
            streamingLight = FindViewById <ImageView> (Resource.Id.streamingLight);

            connectText = FindViewById <TextView> (Resource.Id.connectStatus);
            streamText  = FindViewById <TextView> (Resource.Id.streamingStatus);

            logView    = FindViewById <TextView> (Resource.Id.log);
            scrollView = FindViewById <ScrollView> (Resource.Id.logScrollView);
            scrollView.FullScroll(FocusSearchDirection.Down);
            logView.SetText(savedText, TextView.BufferType.Editable);
            scrollView.ScrollTo(0, logView.Height);
            scrollView.FullScroll(FocusSearchDirection.Down);

            camera = (SurfaceView)FindViewById(Resource.Id.smallcameraview);
            camera.Holder.SetType(SurfaceType.PushBuffers);
            //holder = camera.Holder;
            Session.SetSurfaceHolder(camera.Holder);


            startButton.Click    += OnStartClicked;
            connectButton.Click  += OnConnectToClientClicked;
            settingsButton.Click += OnStettingsClicked;

            //this should be set based on something
            DisableButton(connectButton);
            EnableButton(settingsButton);
            SetStartICon();

            SetDisableLight(connectLight);
            SetDisableLight(streamingLight);

            connectText.Text = "Client is not connected";
            streamText.Text  = "Not streaming";

            PreferenceManager.SetDefaultValues(this, Resource.Layout.Settings, false);
        }
		//private VideoQuality defaultVideoQuality = new VideoQuality();


		protected override void OnCreate (Bundle bundle)
		{
			base.OnCreate (bundle);
			SetContentView(Resource.Layout.CameraView);
			camera = (SurfaceView)FindViewById(Resource.Id.smallcameraview);
			camera.Holder.SetType(SurfaceType.PushBuffers);
			holder = camera.Holder;
			Session.SetSurfaceHolder(holder);

			/*defaultVideoQuality.resX = 200;
			defaultVideoQuality.resY = 200;
			defaultVideoQuality.frameRate = 15;
			defaultVideoQuality.bitRate = 500*1000; // 500 kb/s

			Session.setDefaultVideoQuality(defaultVideoQuality);*/


		}