Exemplo n.º 1
0
        protected static Channel GetChannel(IPlayerStream stream)
        {
            var temp = stream as InternalPlayerStream;
            if (temp == null) throw new InvalidOperationException("The Type must be InternalPlayerStream.");

            return temp.Channel;
        }
Exemplo n.º 2
0
        public IEncoder CreateEncoder(CommonProfile profile, IPlayerStream channel)
        {
            if (profile == null) return CreateDefault(channel);

            IEncoderFactory fac = _encoderFactories.FirstOrDefault(f => f.Id == profile.Id);
            if (fac == null) return CreateDefault(channel);

            var rec = fac.Create(profile, channel) ?? CreateDefault(channel);

            return rec;
        }
 public IEncoder Create(CommonProfile profile, IPlayerStream channel)
 {
     if(profile == null) return null;
     return InternalCreate(profile, channel);
 }
 protected override IEncoder InternalCreate(CommonProfile profile, IPlayerStream channel)
 {
     return new LameEncoderProfile(profile).CreateEncoder(channel);
 }
Exemplo n.º 5
0
 protected AudioEncoderBase([NotNull] Func<Channel, BaseEncoder> encoder, [NotNull] IPlayerStream stream)
     : base(encoder, GetChannel(stream))
 {
     _playerStream = stream;
 }