Esempio n. 1
0
 /// <summary>
 /// Releases the resources used by the <see cref="MediaVisionSource"/> object.
 /// </summary>
 /// <param name="disposing">
 /// true to release both managed and unmanaged resources; otherwise false to release only unmanaged resources.
 /// </param>
 /// <since_tizen> 4 </since_tizen>
 protected virtual void Dispose(bool disposing)
 {
     if (_disposed)
     {
         return;
     }
     InteropSource.Destroy(_handle);
     _disposed = true;
 }
Esempio n. 2
0
        private static void FillMediaPacket(IntPtr handle, MediaPacket mediaPacket)
        {
            Debug.Assert(handle != IntPtr.Zero);

            if (mediaPacket == null)
            {
                throw new ArgumentNullException(nameof(mediaPacket));
            }

            InteropSource.FillMediaPacket(handle, mediaPacket.GetHandle()).
            Validate("Failed to fill media packet");
        }
Esempio n. 3
0
 private MediaVisionSource(Action <IntPtr> fillAction)
     : this()
 {
     try
     {
         fillAction(_handle);
     }
     catch (Exception)
     {
         InteropSource.Destroy(_handle);
         _disposed = true;
         throw;
     }
 }
Esempio n. 4
0
        private static void FillBuffer(IntPtr handle, byte[] buffer, uint width, uint height, ColorSpace colorSpace)
        {
            Debug.Assert(handle != IntPtr.Zero);

            if (buffer == null)
            {
                throw new ArgumentNullException(nameof(buffer));
            }

            if (buffer.Length == 0)
            {
                throw new ArgumentException("Buffer.Length is zero.", nameof(buffer));
            }

            ValidationUtil.ValidateEnum(typeof(ColorSpace), colorSpace, nameof(colorSpace));

            InteropSource.FillBuffer(handle, buffer, buffer.Length, width, height, colorSpace.ToVisionColorSpace()).
            Validate("Failed to fill buffer");
        }
Esempio n. 5
0
 internal MediaVisionSource()
 {
     InteropSource.Create(out _handle).Validate("Failed to create media vision source");
 }