protected override MediaObject CreateMediaObject(WaveFormat inputFormat, WaveFormat outputFormat) { _comObj = new DmoMP3DecoderObject(); var mediaObject = new MediaObject(Marshal.GetComInterfaceForObject(_comObj, typeof(IMediaObject))); return mediaObject; }
public WMResampler() { //create a resampler instance var obj = new WMResamplerObject(); _mediaObject = new MediaObject(Marshal.GetComInterfaceForObject((IMediaObject)obj, typeof(IMediaObject))); _resamplerprops = new WMResamplerProps(Marshal.GetComInterfaceForObject(obj as IWMResamplerProps, typeof(IWMResamplerProps))); _obj = obj; }
private void Dispose(bool disposing) { if (_resamplerprops != null) { _resamplerprops.Dispose(); _resamplerprops = null; } if (_mediaObject != null) { _mediaObject.Dispose(); _mediaObject = null; } if (_obj != null) { Marshal.ReleaseComObject(_obj); _obj = null; } }
internal LockDisposable(MediaObject mediaObject) { _mediaObject = mediaObject; }