public HRESULT GetBlobSize(Guid guidKey, out uint pcbBlobSize) { var hr = _type.GetBlobSize(guidKey, out pcbBlobSize); Trace("guid: " + guidKey.ToName() + " size: " + pcbBlobSize + " hr: " + hr); return(hr); }
public static byte[] GetBlob(this IMFMediaType input, Guid key) { if (input == null) { throw new ArgumentNullException(nameof(input)); } if (input.GetBlobSize(key, out var size).IsError || size == 0) { return(null); } var bytes = new byte[(int)size]; input.GetBlob(key, bytes, (int)size, IntPtr.Zero).ThrowOnError(); return(bytes); }
public static byte[] GetBlob(this IMFMediaType obj, Guid key) { if (obj == null) { throw new ArgumentNullException(nameof(obj)); } if (obj.GetBlobSize(key, out var size).IsError || size == 0) { return(null); } var bytes = new byte[(int)size]; obj.GetBlob(key, bytes, size, ref size).ThrowOnError(); return(bytes); }