private static Stream CreateStream(InputStream inputStream, CodecConfig codecConfig, StreamMode streamMode)
 {
     return(new Stream
     {
         InputStreams = new List <InputStream> {
             inputStream
         },
         CodecConfigId = codecConfig.Id,
         Mode = streamMode
     });
 }
Example #2
0
        private static Stream CreateStream(AzureInput input, string inputPath, int?position,
                                           CodecConfig codecConfig, SelectionMode selectionMode)
        {
            var inputStream = new InputStream
            {
                InputId       = input.Id,
                InputPath     = inputPath,
                Position      = position,
                SelectionMode = selectionMode
            };

            var stream = new Stream
            {
                InputStreams = new List <InputStream> {
                    inputStream
                },
                CodecConfigId = codecConfig.Id
            };

            return(stream);
        }
        public Tracer.Builder GetTracerBuilder()
        {
            if (ReporterConfig == null)
            {
                ReporterConfig = new ReporterConfiguration(_loggerFactory);
            }
            if (SamplerConfig == null)
            {
                SamplerConfig = new SamplerConfiguration(_loggerFactory);
            }
            if (CodecConfig == null)
            {
                CodecConfig = new CodecConfiguration(_loggerFactory);
            }
            if (_metricsFactory == null)
            {
                _metricsFactory = NoopMetricsFactory.Instance;
            }
            IMetrics  metrics  = new MetricsImpl(_metricsFactory);
            IReporter reporter = ReporterConfig.GetReporter(metrics);
            ISampler  sampler  = SamplerConfig.GetSampler(ServiceName, metrics);

            Tracer.Builder builder = new Tracer.Builder(ServiceName)
                                     .WithLoggerFactory(_loggerFactory)
                                     .WithSampler(sampler)
                                     .WithReporter(reporter)
                                     .WithMetrics(metrics)
                                     .WithTags(_tracerTags);

            if (UseTraceId128Bit)
            {
                builder = builder.WithTraceId128Bit();
            }

            CodecConfig.Apply(builder);

            return(builder);
        }