Esempio n. 1
0
 /// <summary>
 /// Opens the streams in the file using the specified <see cref="MediaOptions"/>.
 /// </summary>
 /// <param name="options">The <see cref="MediaOptions"/> object.</param>
 private void OpenStreams(MediaOptions options)
 {
     if (options.StreamsToLoad != MediaMode.Audio)
     {
         var index = FindBestStream(Pointer, AVMediaType.AVMEDIA_TYPE_VIDEO);
         if (index != null)
         {
             Video = InputStreamFactory.OpenVideo(this, index.Value, options);
             Video.PacketsNeeded += () => AddPacket(MediaType.Video); // Adds the event handler.
             AddPacket(MediaType.Video);                              // Requests for the first packet.
         }
     }
 }
 private void OpenStreams(MediaOptions options)
 {
     if (options.StreamsToLoad != MediaMode.Audio)
     {
         var index = FindBestStream(Pointer, AVMediaType.AVMEDIA_TYPE_VIDEO);
         if (index != null)
         {
             Video = InputStreamFactory.OpenVideo(this, index.Value, options);
             Video.PacketQueue.Dequeued += OnPacketDequeued;
             AddPacket(MediaType.Video);
         }
     }
 }