/// <summary>
 /// Gets the <see cref="MediaBlock" /> at the specified index.
 /// </summary>
 /// <value>
 /// The <see cref="MediaBlock"/>.
 /// </value>
 /// <param name="index">The index.</param>
 /// <returns>The media block</returns>
 public MediaBlock this[int index]
 {
     get
     {
         using (Locker.AcquireReaderLock())
         {
             return(PlaybackBlocks[index]);
         }
     }
 }
Пример #2
0
 /// <summary>
 /// Gets or sets the <see cref="AVPacket"/> at the specified index.
 /// </summary>
 /// <value>
 /// The <see cref="AVPacket"/>.
 /// </value>
 /// <param name="index">The index.</param>
 /// <returns>The packet reference</returns>
 private AVPacket *this[int index]
 {
     get
     {
         using (Locker.AcquireReaderLock())
         {
             return((AVPacket *)PacketPointers[index]);
         }
     }
     set
     {
         using (Locker.AcquireWriterLock())
         {
             PacketPointers[index] = (IntPtr)value;
         }
     }
 }
Пример #3
0
 /// <summary>
 /// Tries the acquire a reader lock on the unmanaged buffer.
 /// Returns false if the buffer has been disposed.
 /// </summary>
 /// <param name="locker">The locker.</param>
 /// <returns>The disposable lock</returns>
 public bool TryAcquireReaderLock(out IDisposable locker)
 {
     locker = null;
     lock (SyncLock)
     {
         if (m_IsDisposed)
         {
             return(false);
         }
         locker = Locker.AcquireReaderLock();
         return(true);
     }
 }