Exemplo n.º 1
0
        /// <summary>
        /// Adds preferred audio/video codecs.
        /// </summary>
        protected override void AddPreferredCodecs()
        {
            base.AddPreferredCodecs();

            BluRayPlayerSettings settings = ServiceRegistration.Get <ISettingsManager>().Load <BluRayPlayerSettings>();

            if (settings == null)
            {
                return;
            }

            //IAMPluginControl is supported in Win7 and later only.
            try
            {
                IAMPluginControl pc = new DirectShowPluginControl() as IAMPluginControl;
                if (pc != null)
                {
                    if (settings.VC1Codec != null)
                    {
                        BluRayPlayerBuilder.LogDebug("Setting preferred VC-1 codec {0}", settings.VC1Codec);
                        pc.SetPreferredClsid(CodecHandler.MEDIASUBTYPE_VC1, settings.VC1Codec.GetCLSID());
                    }
                }
            }
            catch
            {
            }
        }
Exemplo n.º 2
0
        public override void Save()
        {
            // Load settings
            BluRayPlayerSettings settings = SettingsManager.Load <BluRayPlayerSettings>();

            settings.VC1Codec = _codecList[Selected];
            SettingsManager.Save(settings);
        }
Exemplo n.º 3
0
        public override void Load()
        {
            // Load settings
            BluRayPlayerSettings settings = SettingsManager.Load <BluRayPlayerSettings>();

            if (settings != null && settings.VC1Codec != null)
            {
                _currentSelection = settings.VC1Codec.GetCLSID();
            }
            base.Load();
        }
Exemplo n.º 4
0
        private void SetVideoDecoder()
        {
            VideoSettings        settings   = ServiceRegistration.Get <ISettingsManager>().Load <VideoSettings>();
            BluRayPlayerSettings bdSettings = ServiceRegistration.Get <ISettingsManager>().Load <BluRayPlayerSettings>();
            Dictionary <BluRayAPI.BluRayStreamFormats, CodecInfo> codecMapping = new Dictionary <BluRayAPI.BluRayStreamFormats, CodecInfo>
            {
                { BluRayAPI.BluRayStreamFormats.VideoH264, settings.H264Codec },
                { BluRayAPI.BluRayStreamFormats.VideoMPEG2, settings.Mpeg2Codec },
                { BluRayAPI.BluRayStreamFormats.VideoVc1, bdSettings.VC1Codec },
            };

            foreach (var codecInfo in codecMapping)
            {
                if (codecInfo.Value == null)
                {
                    continue;
                }
                var dsGuid = new Guid(codecInfo.Value.CLSID);
                _bdReader.SetVideoDecoder(codecInfo.Key, ref dsGuid);
            }
        }