public MpqFileSourceFilter(MpqFile file) { CopyMediaTypes(detectedMediaType, defaultMediaType); name = "Stream Source Filter"; filterState = FilterState.Stopped; var extension = Path.GetExtension(file.Name); try { using (var mediaTypeKey = Registry.ClassesRoot.OpenSubKey(@"Media Type")) { if (extension != null && extension.Length > 1) { try { using (var extensionsKey = mediaTypeKey.OpenSubKey(@"Extensions")) using (var extensionKey = extensionsKey.OpenSubKey(extension)) { var mediaType = new Guid(extensionKey.GetValue("Media Type", MediaType.Stream.ToString()) as string); var subType = new Guid(extensionKey.GetValue("SubType", MediaSubType.None.ToString()) as string); if (mediaType == MediaType.Stream && subType != MediaSubType.None && subType != MediaSubType.Null) { detectedMediaType.majorType = mediaType; detectedMediaType.subType = subType; return; } } } catch (Exception) { } } using (var streamMediaKey = mediaTypeKey.OpenSubKey(MediaType.Stream.ToString())) foreach (var subTypeKeyName in streamMediaKey.GetSubKeyNames()) { try { using (var subTypeKey = streamMediaKey.OpenSubKey(subTypeKeyName)) ; } catch (Exception) { } } } } catch (Exception) { } finally { outputPin = new StreamOutputPin(this); } }
public MpqFileSourceFilter(MpqFile file) { CopyMediaTypes(detectedMediaType, defaultMediaType); name = "Stream Source Filter"; filterState = FilterState.Stopped; var extension = Path.GetExtension(file.Name); try { using (var mediaTypeKey = Registry.ClassesRoot.OpenSubKey(@"Media Type")) { if (extension != null && extension.Length > 1) try { using (var extensionsKey = mediaTypeKey.OpenSubKey(@"Extensions")) using (var extensionKey = extensionsKey.OpenSubKey(extension)) { var mediaType = new Guid(extensionKey.GetValue("Media Type", MediaType.Stream.ToString()) as string); var subType = new Guid(extensionKey.GetValue("SubType", MediaSubType.None.ToString()) as string); if (mediaType == MediaType.Stream && subType != MediaSubType.None && subType != MediaSubType.Null) { detectedMediaType.majorType = mediaType; detectedMediaType.subType = subType; return; } } } catch (Exception) { } using (var streamMediaKey = mediaTypeKey.OpenSubKey(MediaType.Stream.ToString())) foreach (var subTypeKeyName in streamMediaKey.GetSubKeyNames()) try { using (var subTypeKey = streamMediaKey.OpenSubKey(subTypeKeyName)) ; } catch (Exception) { } } } catch (Exception) { } finally { outputPin = new StreamOutputPin(this); } }
public MediaTypeEnumerator(StreamOutputPin pin) { this.pin = pin; }
public MediaTypeEnumerator(StreamOutputPin pin) { this.pin = pin; }