private void copyData(Capturer obj) { _videoDeviceName = obj._videoDeviceName; _audioDeviceName = obj._audioDeviceName; _videoCompressor = obj._videoCompressor; _audioCompressor = obj._audioCompressor; _videoSourceName = obj._videoSourceName; _audioSourceName = obj._audioSourceName; _frameRate = obj._frameRate; _audioChannel = obj._audioChannel; _audioSamplerate = obj._audioSamplerate; _audioSampleSize = obj._audioSampleSize; _tvChannel = obj._tvChannel; _tunerInputType = obj._tunerInputType; _filename = obj._filename; _filters = obj._filters; initCatureObject(); }
/// <summary> /// Frequency Overrides are stored in the registry, in a key labeled /// TS[CountryCode]-[TunerInputType ], so for cable tv in Portugal it /// would be TS351-1 /// </summary> /// <param name="channel"></param> /// <param name="Frequency"></param> /// <param name="TuningSpace"></param> /// <param name="InputType"></param> /// <returns></returns> public bool SetFrequencyOverride(int channel, int Frequency, int TuningSpace, TunerInputType InputType) { try { int IType; if (InputType == TunerInputType.Cable) { IType = 1; } else { IType = 0; } Microsoft.Win32.RegistryKey LocaleOverride; LocaleOverride = Microsoft.Win32.Registry.LocalMachine.OpenSubKey("SOFTWARE\\Microsoft\\TV System Services\\TVAutoTune\\TS" + TuningSpace.ToString() + "-" + IType.ToString(), true); if (LocaleOverride == null) { LocaleOverride = Microsoft.Win32.Registry.LocalMachine.CreateSubKey("SOFTWARE\\Microsoft\\TV System Services\\TVAutoTune\\TS" + TuningSpace.ToString() + "-" + IType.ToString()); } LocaleOverride.SetValue(channel.ToString(), Frequency); return(true); } catch { return(false); } }
/// <summary> /// Frequency Overrides are stored in the registry, in a key labeled /// TS[CountryCode]-[TunerInputType ], so for cable tv in Portugal it /// would be TS351-1 /// </summary> /// <param name="channel"></param> /// <param name="Frequency"></param> /// <param name="TuningSpace"></param> /// <param name="InputType"></param> /// <returns></returns> public bool SetFrequencyOverride(int channel, int Frequency, int TuningSpace, TunerInputType InputType) { try { int IType; if (InputType == TunerInputType.Cable ) { IType=1; } else { IType=0; } Microsoft.Win32.RegistryKey LocaleOverride; LocaleOverride = Microsoft.Win32.Registry.LocalMachine.OpenSubKey("SOFTWARE\\Microsoft\\TV System Services\\TVAutoTune\\TS" + TuningSpace.ToString() + "-" + IType.ToString(), true); if (LocaleOverride == null) { LocaleOverride = Microsoft.Win32.Registry.LocalMachine.CreateSubKey("SOFTWARE\\Microsoft\\TV System Services\\TVAutoTune\\TS" + TuningSpace.ToString() + "-" + IType.ToString()); } LocaleOverride.SetValue(channel.ToString(), Frequency); return true; } catch { return false; } }
public int put_InputType([NativeTypeName("long")] int lIndex, TunerInputType InputType) { return(((delegate * unmanaged <IAMTVTuner *, int, TunerInputType, int>)(lpVtbl[23]))((IAMTVTuner *)Unsafe.AsPointer(ref this), lIndex, InputType)); }
public override void SubmitTuneRequest(Channel channel) { if (channel is ChannelAnalogic) { ChannelAnalogic channelAnalogic = channel as ChannelAnalogic; int hr = 0; //SetCaptureResolution(this.captureFormat); // channelAnalogic.CaptureResolution); if (this.videoCaptureFilter != null) { IAMAnalogVideoDecoder analogVideoDecoder = this.videoCaptureFilter as IAMAnalogVideoDecoder; if (analogVideoDecoder != null) { AnalogVideoStandard videoStandard; hr = analogVideoDecoder.get_TVFormat(out videoStandard); if (videoStandard != channelAnalogic.VideoStandard) { hr = analogVideoDecoder.put_TVFormat(channelAnalogic.VideoStandard); } } } if (this.tuner != null) { int tuningSpace = 0; hr = this.tuner.get_TuningSpace(out tuningSpace); if (hr < 0 || channelAnalogic.TuningSpace != tuningSpace) { this.tuner.put_TuningSpace(channelAnalogic.TuningSpace); } int countryCode = 0; hr = this.tuner.get_CountryCode(out countryCode); if (hr < 0 || channelAnalogic.CountryCode != countryCode) { this.tuner.put_CountryCode(channelAnalogic.CountryCode); } int connectInput = 0; hr = this.tuner.get_ConnectInput(out connectInput); if (hr < 0 || channelAnalogic.ConnectInput != connectInput) { this.tuner.put_ConnectInput(channelAnalogic.ConnectInput); } TunerInputType inputType = TunerInputType.Antenna; hr = this.tuner.get_InputType(channelAnalogic.ConnectInput, out inputType); if (hr < 0 || channelAnalogic.InputType != inputType) { this.tuner.put_InputType(channelAnalogic.ConnectInput, channelAnalogic.InputType); } AMTunerModeType mode = AMTunerModeType.Default; hr = this.tuner.get_Mode(out mode); if (hr < 0 || channelAnalogic.Mode != mode) { this.tuner.put_Mode(channelAnalogic.Mode); } if (channelAnalogic.Channel > 0) { hr = this.tuner.put_Channel(channelAnalogic.Channel, AMTunerSubChannel.Default, AMTunerSubChannel.Default); DsError.ThrowExceptionForHR(hr); } //int plChannel; //AMTunerSubChannel plVideoSubChannel; //AMTunerSubChannel plAudioSubChannel; //hr = this.tuner.get_Channel(out plChannel, out plVideoSubChannel, out plAudioSubChannel); //if (plChannel != channelAnalogic.Channel) //{ // DsError.ThrowExceptionForHR(-2147024809); //} } if (this.amTVAudio != null && channelAnalogic.AudioMode != TVAudioMode.None) { TVAudioMode audioMode = TVAudioMode.Stereo; hr = this.amTVAudio.get_TVAudioMode(out audioMode); if (hr < 0 || channelAnalogic.AudioMode != audioMode) { this.amTVAudio.put_TVAudioMode(channelAnalogic.AudioMode); } } if (WDMCrossbar != null) { try { if (channelAnalogic.AudioSource != WDMCrossbar.GetAudioInput()) { WDMCrossbar.SetAudioInput(channelAnalogic.AudioSource, false); } } catch { } try { if (channelAnalogic.VideoSource != WDMCrossbar.GetVideoInput()) { WDMCrossbar.SetVideoInput(channelAnalogic.VideoSource, false); } } catch { } } RunGraph(); } if (useWPF) { WpfUpdateVideoSize(); } }