Esempio n. 1
0
        public void SetVideoFormat(String chroma, uint width, uint height, uint pitch)
        {
            var handle = InteropHelper.StringToPtr(chroma);

            _setVideoFormatFunction.Delegate(InstancePointer, handle.AddrOfPinnedObject(), width, height, pitch);
            handle.Free();
        }
Esempio n. 2
0
        /// <summary>
        ///     Selects an audio output module.
        ///     Any change will take be effect only after playback is stopped and restarted. Audio output cannot be changed while
        ///     playing.
        /// </summary>
        /// <param name="audioOutput"></param>
        /// <returns></returns>
        public bool SetAudioOutput(AudioOutput audioOutput)
        {
            var handle = InteropHelper.StringToPtr(audioOutput.Name);
            var result = _setAudioOutputFunction.Delegate(InstancePointer, handle.AddrOfPinnedObject());

            handle.Free();
            return(result == 0);
        }
Esempio n. 3
0
        public int VlmGetRate(String name, int id)
        {
            var nameHandle = InteropHelper.StringToPtr(name);

            var result = _getMediaBackRateFunction.Delegate(InstancePointer, nameHandle.AddrOfPinnedObject(), id);

            nameHandle.Free();

            return(result);
        }
Esempio n. 4
0
        public String VlmGetInfomation(String name)
        {
            var nameHandle = InteropHelper.StringToPtr(name);

            var result = _returnJsonMessageFunction.Delegate(InstancePointer, nameHandle.AddrOfPinnedObject());

            nameHandle.Free();

            return(InteropHelper.PtrToString(result));
        }
Esempio n. 5
0
        public bool VlmPause(String name)
        {
            var nameHandle = InteropHelper.StringToPtr(name);

            var result = _pauseNamedBroadcastFunction.Delegate(InstancePointer, nameHandle.AddrOfPinnedObject()) == 0;

            nameHandle.Free();

            return(result);
        }
Esempio n. 6
0
        public bool VlmSetLoop(String name, int loop)
        {
            var nameHandle = InteropHelper.StringToPtr(name);

            var result = _setMediaLoopFunction.Delegate(InstancePointer, nameHandle.AddrOfPinnedObject(), loop) == 0;

            nameHandle.Free();

            return(result);
        }
Esempio n. 7
0
        public bool VlmSetEnable(String name, int enable)
        {
            var nameHandle = InteropHelper.StringToPtr(name);

            var result = _mediaSwitchFunction.Delegate(InstancePointer, nameHandle.AddrOfPinnedObject(), enable) == 0;

            nameHandle.Free();

            return(result);
        }
Esempio n. 8
0
        public bool VlmDeleteMedia(String name)
        {
            var nameHandle = InteropHelper.StringToPtr(name);

            var result = _delBoroadcastOrOvdFunction.Delegate(InstancePointer, nameHandle.AddrOfPinnedObject()) == 0;

            nameHandle.Free();

            return(result);
        }
Esempio n. 9
0
        /// <summary>
        ///     Gets a list of audio output devices for a given audio output module.
        /// </summary>
        /// <param name="audioOutput"></param>
        /// <returns></returns>
        public AudioDeviceList GetAudioDeviceList(AudioOutput audioOutput)
        {
            var handle = InteropHelper.StringToPtr(audioOutput.Name);
            var result =
                new AudioDeviceList(_getAudioDeviceListFunction.Delegate(VlcInstance.InstancePointer,
                                                                         handle.AddrOfPinnedObject()));

            handle.Free();
            return(result);
        }
Esempio n. 10
0
        public bool VlmSeek(String name, float percentage)
        {
            var nameHandle = InteropHelper.StringToPtr(name);

            var result =
                _seekInNamedBroadcastFunction.Delegate(InstancePointer, nameHandle.AddrOfPinnedObject(), percentage) ==
                0;

            nameHandle.Free();

            return(result);
        }
Esempio n. 11
0
        public bool VlmSetMuxer(String name, String muxer)
        {
            var nameHandle  = InteropHelper.StringToPtr(name);
            var muxerHandle = InteropHelper.StringToPtr(muxer);

            var result =
                _setVodMuxerFunction.Delegate(InstancePointer, nameHandle.AddrOfPinnedObject(),
                                              muxerHandle.AddrOfPinnedObject()) == 0;

            nameHandle.Free();
            muxerHandle.Free();

            return(result);
        }
Esempio n. 12
0
        public bool VlmAddInput(String name, String input)
        {
            var nameHandle  = InteropHelper.StringToPtr(name);
            var inputHandle = InteropHelper.StringToPtr(input);

            var result =
                _addMediaInputFunction.Delegate(InstancePointer, nameHandle.AddrOfPinnedObject(),
                                                inputHandle.AddrOfPinnedObject()) == 0;

            nameHandle.Free();
            inputHandle.Free();

            return(result);
        }
Esempio n. 13
0
        public bool VlmSetOutput(String name, String output)
        {
            var nameHandle   = InteropHelper.StringToPtr(name);
            var outputHandle = InteropHelper.StringToPtr(output);

            var result =
                _setMediaOutputFunction.Delegate(InstancePointer, nameHandle.AddrOfPinnedObject(),
                                                 outputHandle.AddrOfPinnedObject()) == 0;

            nameHandle.Free();
            outputHandle.Free();

            return(result);
        }
Esempio n. 14
0
        /// <summary>
        ///     Configures an explicit audio output device. If the module paramater is NULL,
        ///     audio output will be moved to the device specified by the device identifier string immediately.
        ///     This is the recommended usage. A list of adequate potential device strings can be obtained with
        ///     <see cref="EnumAudioDeviceList" />.
        ///     However passing NULL is supported in LibVLC version 2.2.0 and later only; in earlier versions, this function would
        ///     have no effects when the module parameter was NULL.
        ///     If the module parameter is not NULL, the device parameter of the corresponding audio output, if it exists, will be
        ///     set to the specified string.
        ///     Note that some audio output modules do not have such a parameter (notably MMDevice and PulseAudio).
        ///     A list of adequate potential device strings can be obtained with <see cref="GetAudioDeviceList" />.
        /// </summary>
        public void SetAudioDevice(AudioOutput audioOutput, AudioDevice audioDevice)
        {
            var outputHandle = audioOutput == null ? null : new GCHandle?(InteropHelper.StringToPtr(audioOutput.Name));
            var deviceHandle = InteropHelper.StringToPtr(audioDevice.Device);

            _setAudioDeviceFunction.Delegate(InstancePointer,
                                             outputHandle == null ? IntPtr.Zero : outputHandle.Value.AddrOfPinnedObject(),
                                             deviceHandle.AddrOfPinnedObject());
            if (outputHandle.HasValue)
            {
                outputHandle.Value.Free();
            }
            deviceHandle.Free();
        }
Esempio n. 15
0
        public bool VlmAddVod(String name, String input, int options, String[] additionalOptions, int enable,
                              String muxer)
        {
            var nameHandle  = InteropHelper.StringToPtr(name);
            var inputHandle = InteropHelper.StringToPtr(input);
            var muxerHandle = InteropHelper.StringToPtr(muxer);

            var result = _newVodInputFunction.Delegate(InstancePointer, nameHandle.AddrOfPinnedObject(),
                                                       inputHandle.AddrOfPinnedObject(), options, InteropHelper.StringArrayToPtr(additionalOptions), enable,
                                                       muxerHandle.AddrOfPinnedObject()) == 0;

            nameHandle.Free();
            inputHandle.Free();
            muxerHandle.Free();

            return(result);
        }
Esempio n. 16
0
        public bool VlmAddBroadcast(String name, String input, String output, int options, String[] additionalOptions,
                                    int enable, int loop)
        {
            var nameHandle   = InteropHelper.StringToPtr(name);
            var inputHandle  = InteropHelper.StringToPtr(input);
            var outputHandle = InteropHelper.StringToPtr(output);

            var result = _newBroadCastInputFunction.Delegate(InstancePointer, nameHandle.AddrOfPinnedObject(),
                                                             inputHandle.AddrOfPinnedObject(), outputHandle.AddrOfPinnedObject(), options,
                                                             InteropHelper.StringArrayToPtr(additionalOptions), enable, loop) == 0;

            nameHandle.Free();
            inputHandle.Free();
            outputHandle.Free();

            return(result);
        }