Esempio n. 1
0
        public static ProcessSample MediaTypeChange(SinkStream sinkStream, ProcessSample next)
        {
            return sample =>
                {
                    if (sample.Flags.CurrentMediaTypeChanged)
                        sinkStream.InputMediaType = sample.Stream.CurrentMediaType;

                    return next(sample);
                };
        }
Esempio n. 2
0
        public static ProcessSample SaveTo(SinkStream sinkStream)
        {
            return sample =>
            {
                if (sample.Flags.StreamTick)
                    throw new NotImplementedException();

                if (sample.Sample == null)
                    return true;

                if (sample.Count == 0)
                    sample.Sample.Discontinuity = true;

                sinkStream.WriteSample(sample.Sample);

                return true;
            };
        }