/// <summary>
        /// Constructor -- creates a new Recorder that will use the GStreamerMiniBinding to connect itself to the player tee for recording streams
        /// </summary>
        public Recorder()
        {
            try
            {
                if (Marshaller.Initialize())
                {
                    encoders.Add(new Encoder("None (unchanged stream)", "! identity ", null));

                    has_lame = Marshaller.CheckGstPlugin("lamemp3enc") && Marshaller.CheckGstPlugin("id3v2mux");
                    Hyena.Log.Debug("[Streamrecorder] GstPlugin lame" + (has_lame ? "" : " not") + " found");
                    if (has_lame)
                    {
                        encoders.Add(new Encoder(lame_name, lame_pipeline, lame_extension));
                    }

                    has_vorbis = Marshaller.CheckGstPlugin("vorbisenc") && Marshaller.CheckGstPlugin("oggmux") && Marshaller.CheckGstPlugin("oggmux");
                    Hyena.Log.Debug("[Streamrecorder] GstPlugin vorbis" + (has_vorbis ? "" : " not") + " found");
                    if (has_vorbis)
                    {
                        encoders.Add(new Encoder(vorbis_name, vorbis_pipeline, vorbis_extension, true));
                    }

                    has_flac = Marshaller.CheckGstPlugin("flacenc") && Marshaller.CheckGstPlugin("flactag");
                    Hyena.Log.Debug("[Streamrecorder] GstPlugin flac" + (has_flac ? "" : " not") + " found");
                    if (has_flac)
                    {
                        encoders.Add(new Encoder(flac_name, flac_pipeline, flac_extension));
                    }
                }
                else
                {
                    Hyena.Log.Debug("[Streamrecorder] an error occurred during gstreamer initialization, aborting.");
                }
            } catch (Exception e) {
                Hyena.Log.Information("[Streamrecorder] An exception occurred during gstreamer initialization");
                Hyena.Log.Debug(e.StackTrace);
            }

            is_recording = false;
        }
Пример #2
0
        public JsGlobal(JintRuntime runtime, JintEngine engine)
        {
            if (runtime == null)
                throw new ArgumentNullException("runtime");

            _runtime = runtime;

            Id.SeedGlobal(this);

            PrototypeSink = CreatePrototypeSink();
            RootSchema = new JsSchema();
            Engine = engine;

            // The Random instance is used by Math to generate random numbers.
            Random = new Random();

            BuildEnvironment();

            GlobalScope = CreateGlobalScope();

            Marshaller = new Marshaller(runtime, this);
            Marshaller.Initialize();
        }