コード例 #1
0
        public WebRTCNative(Context context)
        {
            JavaSystem.LoadLibrary("gstreamer_android");
            GStreamer.Init(context);

            JavaSystem.LoadLibrary("gstwebrtc");

            //IntPtr klass = JNIEnv.FindClass(typeof(WebRTC));
            //NativeMethods.NativeClassInit(JNIEnv.Handle, klass);

            NativeMethods.NativeNew(JNIEnv.Handle, this.Handle);
        }
コード例 #2
0
ファイル: Main.cs プロジェクト: youmery/longomatch-1
        public static void Main(string[] args)
        {
            GLib.ExceptionManager.UnhandledException += new GLib.UnhandledExceptionHandler(OnException);

            GStreamer.Init();
            if (!GStreamer.CheckInstallation())
            {
                return;
            }

            //try {
            Core.Init();
            MainWindow win = new MainWindow();

            win.Show();
            Core.Start(win);
            Application.Run();
            //} catch(Exception ex) {
            //	ProcessExecutionError(ex);
            //}
        }
コード例 #3
0
ファイル: Main.cs プロジェクト: youmery/longomatch
        public static void Main(string[] args)
        {
            /* Init Gtk */
            Application.Init();

            Core.Init();

            /* Init GStreamer */
            GStreamer.Init();
            if (!GStreamer.CheckInstallation())
            {
                return;
            }

            GLib.ExceptionManager.UnhandledException += new GLib.UnhandledExceptionHandler(OnException);
            Version version = Assembly.GetExecutingAssembly().GetName().Version;

            try {
                AddinsManager manager = new AddinsManager(Config.PluginsConfigDir, Config.PluginsDir);
                manager.LoadConfigModifierAddins();
                GUIToolkit         guiToolkit        = new GUIToolkit(version);
                IMultimediaToolkit multimediaToolkit = new MultimediaFactory();
                manager.LoadExportProjectAddins(guiToolkit.MainWindow);
                manager.LoadImportProjectAddins(guiToolkit.MainWindow);
                try {
                    Core.Start(guiToolkit, multimediaToolkit);
                } catch (DBLockedException locked) {
                    string msg = Catalog.GetString("The database seems to be locked by another instance and " +
                                                   "the application will closed.");
                    Log.Exception(locked);
                    return;
                }
                Application.Run();
            } catch (Exception ex) {
                ProcessExecutionError(ex);
            }
        }
コード例 #4
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;

            base.OnCreate(savedInstanceState);

            Xamarin.Essentials.Platform.Init(this, savedInstanceState);
            global::Xamarin.Forms.Forms.Init(this, savedInstanceState);

            if (ContextCompat.CheckSelfPermission(this, Manifest.Permission.RecordAudio) != (int)Permission.Granted)
            {
                ActivityCompat.RequestPermissions(this, new string[] { Manifest.Permission.RecordAudio }, 0);
            }

            //Os.Setenv("G_MESSAGES_DEBUG", "all", true);
            //Os.Setenv("G_DEBUG", "fatal-warnings", true);
            //Os.Setenv("GST_DEBUG", "6", true);
            //Os.Setenv("GST_DEBUG_NO_COLOR", "1", true);

            JavaSystem.LoadLibrary("gstreamer_android");
            GStreamer.Init(ApplicationContext);

            JavaSystem.LoadLibrary("gstwebrtc");

            //_webRtc = new WebRTCNative(ApplicationContext);
            _webRtc = new WebRTCJava(ApplicationContext);

            //string content = "";
            //AssetManager assets = this.Assets;
            //using (StreamReader sr = new StreamReader(assets.Open("ssl/certs/ca-certificates.crt")))
            //{
            //    content = sr.ReadToEnd();
            //}

            LoadApplication(new App(_webRtc, ""));
        }
コード例 #5
0
        public static void Main(string[] args)
        {
            CoreServices.Init();

            InitGtk();

            /* Init GStreamer */
            GStreamer.Init();
            //if (!GStreamer.CheckInstallation ())
            //	return;

            GLib.ExceptionManager.UnhandledException += new GLib.UnhandledExceptionHandler(OnException);
            Version version = Assembly.GetExecutingAssembly().GetName().Version;

            try {
                AddinsManager.Initialize(Config.PluginsConfigDir, Config.PluginsDir);
                AddinsManager.LoadConfigModifierAddins();
                Config.DrawingToolkit    = new CairoBackend();
                Config.EventsBroker      = new EventsBroker();
                Config.MultimediaToolkit = new MultimediaToolkit();
                Config.GUIToolkit        = new GUIToolkit(version);
                bool haveCodecs = AddinsManager.RegisterGStreamerPlugins();
                AddinsManager.LoadExportProjectAddins(Config.GUIToolkit.MainController);
                AddinsManager.LoadMultimediaBackendsAddins(Config.MultimediaToolkit);
                AddinsManager.LoadUIBackendsAddins(Config.GUIToolkit);
                AddinsManager.LoadServicesAddins();
                Config.GUIToolkit.Register <IPlayerView, PlayerView> (0);

                if (!haveCodecs)
                {
                    CodecsChoiceDialog ccd = new CodecsChoiceDialog();
                    int response           = ccd.Run();
                    if (response == (int)ResponseType.Accept)
                    {
                        try {
                            System.Diagnostics.Process.Start(Constants.WEBSITE);
                        } catch {
                        }
                    }
                    ccd.Destroy();
                }
                try {
                    CoreServices.Start(Config.GUIToolkit, Config.MultimediaToolkit);
                } catch (DBLockedException locked) {
                    string msg = Catalog.GetString("The database seems to be locked by another instance and " +
                                                   "the application will be closed.");
                    Config.GUIToolkit.ErrorMessage(msg);
                    Log.Exception(locked);
                    return;
                }
                AddinsManager.LoadDashboards(Config.CategoriesTemplatesProvider);
                AddinsManager.LoadImportProjectAddins(CoreServices.ProjectsImporter);

                ConfigureOSXApp();

                Application.Run();
            }  catch (AddinRequestShutdownException arse) {
                // Abort gracefully
            } catch (Exception ex) {
                ProcessExecutionError(ex);
            } finally {
                try {
                    AddinsManager.ShutdownMultimediaBackends();
                } catch {
                }
            }
        }