Exemple #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MediaEngine" /> class.
        /// </summary>
        /// <param name="parent">The associated parent object.</param>
        /// <param name="connector">The parent implementing connector methods.</param>
        /// <exception cref="InvalidOperationException">Thrown when the static Initialize method has not been called.</exception>
        public MediaEngine(object parent, IMediaConnector connector)
        {
            // Associate the parent as the media connector that implements the callbacks
            Parent    = parent;
            Connector = connector;
            Commands  = new CommandManager(this);
            State     = new MediaEngineState(this);
            Timing    = new TimingController(this);

            // Don't start up timers or any other stuff if we are in design-time
            if (Platform.IsInDesignTime)
            {
                return;
            }

            // Check initialization has taken place
            lock (InitLock)
            {
                if (IsInitialized == false)
                {
                    throw new InvalidOperationException(
                              $"{nameof(MediaEngine)} not initialized. Call the static method {nameof(Initialize)}");
                }
            }
        }
Exemple #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RenderingAudioEventArgs" /> class.
 /// </summary>
 /// <param name="buffer">The buffer.</param>
 /// <param name="length">The length.</param>
 /// <param name="engineState">The engine.</param>
 /// <param name="stream">The stream.</param>
 /// <param name="startTime">The start time.</param>
 /// <param name="duration">The duration.</param>
 /// <param name="clock">The clock.</param>
 internal RenderingAudioEventArgs(
     byte[] buffer, int length, MediaEngineState engineState, StreamInfo stream, TimeSpan startTime, TimeSpan duration, TimeSpan clock)
     : base(engineState, stream, startTime, duration, clock)
 {
     Buffer        = buffer;
     BufferLength  = length;
     SampleRate    = Constants.Audio.SampleRate;
     ChannelCount  = Constants.Audio.ChannelCount;
     BitsPerSample = Constants.Audio.BitsPerSample;
 }
Exemple #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RenderingSubtitlesEventArgs" /> class.
 /// </summary>
 /// <param name="text">The text.</param>
 /// <param name="originalText">The original text.</param>
 /// <param name="format">The format.</param>
 /// <param name="engineState">The engine.</param>
 /// <param name="stream">The stream.</param>
 /// <param name="startTime">The start time.</param>
 /// <param name="duration">The duration.</param>
 /// <param name="clock">The clock.</param>
 internal RenderingSubtitlesEventArgs(
     List <string> text,
     List <string> originalText,
     AVSubtitleType format,
     MediaEngineState engineState,
     StreamInfo stream,
     TimeSpan startTime,
     TimeSpan duration,
     TimeSpan clock)
     : base(engineState, stream, startTime, duration, clock)
 {
     Text         = text;
     Format       = format;
     OriginalText = originalText;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="RenderingVideoEventArgs" /> class.
 /// </summary>
 /// <param name="bitmap">The bitmap.</param>
 /// <param name="closedCaptions">The closed captions.</param>
 /// <param name="smtpeTimeCode">The smtpe time code.</param>
 /// <param name="pictureNumber">The picture number.</param>
 /// <param name="engineState">The engine.</param>
 /// <param name="stream">The stream.</param>
 /// <param name="startTime">The start time.</param>
 /// <param name="duration">The duration.</param>
 /// <param name="clock">The clock.</param>
 internal RenderingVideoEventArgs(
     BitmapDataBuffer bitmap,
     ReadOnlyCollection <ClosedCaptionPacket> closedCaptions,
     string smtpeTimeCode,
     long pictureNumber,
     MediaEngineState engineState,
     StreamInfo stream,
     TimeSpan startTime,
     TimeSpan duration,
     TimeSpan clock)
     : base(engineState, stream, startTime, duration, clock)
 {
     PictureNumber  = pictureNumber;
     Bitmap         = bitmap;
     SmtpeTimeCode  = smtpeTimeCode;
     ClosedCaptions = closedCaptions;
 }