Esempio n. 1
0
        public override void BuildPipeline(StreamContext context)
        {
            SetupAssemblyLoader();

            // input
            bool doInputReader = context.Source.NeedsInputReaderUnit;
            if (doInputReader)
            {
                context.Pipeline.AddDataUnit(context.Source.GetInputReaderUnit(), 1);
            }

            // get parameters
            VLCParameters vlcparam = GenerateVLCParameters(context);
            int duration = (int)Math.Round((decimal)context.MediaInfo.Duration / 1000);

            // add the unit
            VLCManagedEncoder unit;
            if (doInputReader)
            {
                unit = new VLCManagedEncoder(vlcparam.Sout, vlcparam.Arguments, context, VLCManagedEncoder.InputMethod.NamedPipe);
            }
            else
            {
                unit = new VLCManagedEncoder(vlcparam.Sout, vlcparam.Arguments, context, VLCManagedEncoder.InputMethod.File, context.Source.GetPath());
            }
            context.Pipeline.AddDataUnit(unit, 5);
        }
Esempio n. 2
0
        protected override void AddEncoderToPipeline(bool hasInputReader)
        {
            SetupAssemblyLoader();

            // get parameters
            VLCParameters vlcparam = GenerateVLCParameters();
            int duration = (int)Math.Round((decimal)Context.MediaInfo.Duration / 1000);

            // add the unit
            VLCManagedEncoder unit;
            if (hasInputReader)
            {
                unit = new VLCManagedEncoder(vlcparam.Sout, vlcparam.Arguments, Context, VLCManagedEncoder.InputMethod.NamedPipe);
            }
            else
            {
                unit = new VLCManagedEncoder(vlcparam.Sout, vlcparam.Arguments, Context, VLCManagedEncoder.InputMethod.File, Context.Source.GetPath());
            }
            Context.Pipeline.AddDataUnit(unit, 5);
        }