/// <summary> /// Initializes a new instance of the <see cref="FFmpegMediaFrameCache"/> class. /// </summary> /// <param name="frameRate">The frame rate.</param> /// <param name="type">The type.</param> public FFmpegMediaFrameCache(decimal frameRate, MediaFrameType type) { if (frameRate <= 0) { frameRate = 25; } var capacity = (int)Math.Round(frameRate, 0) * 2; this.Type = type; this.Capacity = capacity; RecomputeProperties(); }
/// <summary> /// Throws the invalid frame type exception. /// </summary> /// <param name="frameType">Type of the frame.</param> /// <exception cref="System.InvalidCastException"></exception> private void ThrowInvalidFrameTypeException(MediaFrameType frameType) { throw new InvalidCastException(string.Format("Provided a frame of type '{0}' but the cache is of type '{1}'", frameType, this.Type)); }
/// <summary> /// Throws the invalid frame type exception. /// </summary> /// <param name="frameType">Type of the frame.</param> /// <exception cref="System.InvalidCastException"></exception> private void ThrowInvalidFrameTypeException(MediaFrameType frameType) { throw new InvalidCastException(string.Format("Provided a frame of type '{0}' but the cache is of type '{1}'", frameType, this.Type)); }
/// <summary> /// Initializes a new instance of the <see cref="FFmpegMediaFrameCache"/> class. /// </summary> /// <param name="frameRate">The frame rate.</param> /// <param name="type">The type.</param> public FFmpegMediaFrameCache(decimal frameRate, MediaFrameType type) { if (frameRate <= 0) frameRate = 25; var capacity = (int)Math.Round(frameRate, 0) * 2; Type = type; Capacity = capacity; RecomputeProperties(); }