/// <summary> /// Ergänzt die Beschreibung der aktuellen Aufzeichnungen. /// </summary> /// <param name="info">Die Beschreibung der Gesamtaufgabe des aktuellen Aufzeichnungsprozesses.</param> /// <param name="finalCall">Gesetzt, wenn es sich um den abschließenden Aufruf handelt. Dieser /// wird ausschließlich für die Erstellung des Protokolleintrags verwendet.</param> /// <param name="state">Der aktuelle Zustand.</param> protected override void OnFillInformation(FullInfo info, bool finalCall, ServerInformation state) { // Set static data info.IsDynamic = true; info.CanStream = true; // Synchronize access lock (m_recordings) { // Load all files we've seen so far info.Recording.RecordingFiles.Clear(); info.Recording.RecordingFiles.AddRange(m_files); // Create the file mapping var files = m_files .Where(file => !string.IsNullOrEmpty(file.ScheduleIdentifier)) .GroupBy(file => new Guid(file.ScheduleIdentifier), file => file.Path) .ToDictionary(group => group.Key, group => group.ToArray()); // Process all recordings info .Streams .AddRange((finalCall ? m_allRecordings : m_recordings) .Select(recording => { // Collect the data var streamInfo = (state == null) ? null : state.Streams.Find(recording.Match); var target = (streamInfo == null) ? null : streamInfo.StreamTarget; // Create record return(StreamInfo.Create(recording, target, files)); })); } }
/// <summary> /// Initializes a new instance of the <see cref="Decoder"/> class. /// </summary> /// <param name="codec">The underlying codec.</param> /// <param name="stream">The multimedia stream.</param> /// <param name="owner">The container that owns the stream.</param> public Decoder(AVCodecContext *codec, AVStream *stream, InputContainer owner) : base(codec) { OwnerFile = owner; Info = StreamInfo.Create(stream, owner); switch (Info.Type) { case MediaType.Audio: RecentlyDecodedFrame = new AudioFrame(); break; case MediaType.Video: RecentlyDecodedFrame = new VideoFrame(); break; default: throw new Exception("Tried to create a decoder from an unsupported stream or codec type."); } BufferedPackets = new Queue <MediaPacket>(); }
/// <summary> /// Initializes a new instance of the <see cref="Decoder{TFrame}"/> class. /// </summary> /// <param name="stream">The multimedia stream.</param> /// <param name="owner">The container that owns the stream.</param> public Decoder(AVCodecContext *codec, AVStream *stream, InputContainer owner) : base(codec) { OwnerFile = owner; Info = StreamInfo.Create(stream, owner); }