/// <summary> /// Load an attribute store from a COM stream. /// </summary> /// <param name="attributes">A valid IMFAttributes instance.</param> /// <param name="stream">A COM stream where the attributes are read from.</param> /// <param name="options">On or more values of the MFAttributeSerializeOptions enumaration.</param> /// <returns>If this function succeeds, it returns the S_OK member. Otherwise, it returns another HResult's member that describe the error.</returns> public static HResult DeserializeAttributesFromStream(this IMFAttributes attributes, IStream stream, MFAttributeSerializeOptions options = MFAttributeSerializeOptions.None) { if (attributes == null) { throw new ArgumentNullException("attributes"); } if (stream == null) { throw new ArgumentNullException("stream"); } return(MFExtern.MFDeserializeAttributesFromStream(attributes, options, stream)); }
/// <summary> /// Load an attribute store from a managed stream. /// </summary> /// <param name="attributes">A valid IMFAttributes instance.</param> /// <param name="stream">A managed stream where the attributes are read from.</param> /// <param name="options">On or more values of the MFAttributeSerializeOptions enumaration.</param> /// <returns>If this function succeeds, it returns the S_OK member. Otherwise, it returns another HResult's member that describe the error.</returns> public static HResult DeserializeAttributesFromStream(this IMFAttributes attributes, Stream stream, MFAttributeSerializeOptions options = MFAttributeSerializeOptions.None) { if (attributes == null) { throw new ArgumentNullException("attributes"); } if (stream == null) { throw new ArgumentNullException("stream"); } if (!stream.CanRead) { throw new ArgumentException("stream must be readable.", "stream"); } using (ComCallableStream comStream = new ComCallableStream(stream, false)) { return(MFExtern.MFDeserializeAttributesFromStream(attributes, options, comStream)); } }
public static extern void MFDeserializeAttributesFromStream( IMFAttributes pAttr, MFAttributeSerializeOptions dwOptions, IStream pStm);