123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- using System;
- namespace Vinno.FIS.TRTCClient.ImageSender
- {
- internal class TRTCVideoFrameData : IDisposable
- {
- private readonly Action<object> _dispose;
- private bool _disposed;
- /// <summary>
- /// Gets the width of image.
- /// </summary>
- public int Width { get; set; }
- /// <summary>
- /// Gets the height of the image.
- /// </summary>
- public int Height { get; set; }
- /// <summary>
- /// Gets the data of the image, which is in Bgr32 format.
- /// </summary>
- public byte[] Data { get; set; }
- /// <summary>
- /// It's a bitmap on android and uiimage on IOS
- /// </summary>
- public object ImageData { get; set; }
- public string Key { get; set; }
- public TRTCVideoFrameData(int width, int height, byte[] data, Action<object> dispose = null)
- {
- Width = width;
- Height = height;
- Data = data;
- _dispose = dispose;
- }
- ~TRTCVideoFrameData()
- {
- Dispose();
- }
- public void Dispose()
- {
- if (!_disposed)
- {
- _dispose?.Invoke(ImageData);
- _disposed = true;
- }
- }
- }
- }
|