GraphEdit ファイル フォーマット

GraphEdit ユーティリティで DirectShow フィルタ グラフを保存する場合、.grf という拡張子を持つ保存ファイルが作成される。この保存ファイルは、ActiveMovieGraph という名前の単一のストリームを格納している。このストリームには、すべてのフィルタ、フィルタ名、ファイル名、接続などに関する情報が含まれている。

次に示す文法は、修正された BNF (バッカス ナウア記法) の構文を使って、ストリーム内のグラフの構文を記述したものである。

<graph> ::= 0003\r\n<filters><connections><clock>END | 0002\r\n<filters><connections>END
<filters> ::= FILTERS<b> [<filter list><b>]
<filter list> ::= <filter><b> [<filter list>]
<filter> ::= <filter id><b><name><b><class id><b>[<file>]<length><b1><filter data>
<class id> ::= <guid>
<file> ::= SOURCE <name><b> | SINK <name><b>
<connections> ::= CONNECTIONS<b> {<connection><b>}
<connection> ::= <filter id><b><pin id><b><filter id><b><pin id><b><media type>
<filter id> ::= <id>
<pin id> ::= <name>
<media type> ::= <sample size><major type><b><subtype><b><flags><format>
<major type> ::= <guid>
<subtype> ::= <guid>
<flags> ::= <fixed sample size><b><temporal compression><b>
<fixed sample size> ::= 1 | 0
<temporal compression> ::= 1 | 0
<format> ::= <length><b1><format type><b><length><b1><format data>
<format type> ::= <guid>
<format data> ::= { binary_data }
<clock> ::= CLOCK <b><required><b><clockid>\r\n
<required> ::= 1 | 0
<clockid> ::= <filter id> | <class id>
<name> ::= quote_symbol { any_non_quote_character } quote_symbol
<length> ::= unsigned decimal number (as a string), indicating the number 
             of bytes of data in the following token.
<guid> ::= GUID in string format. for example: {CF49D4E0-1115-11CE-B03A-0020AF0BA770}
<b> ::= { space_character } { \t } { \r } { \n } { <b> }
<b1> ::= space_character
<id> ::= integer (as a string), such as 0001

出力では、フィルタごと、接続ごと、およびキーワード FILTERS と CONNECTIONS ごとに復帰改行 ("\r\n") が挿入される。それ以外の <b> は 1 つの空白である。キーワード FILTERS、CONNECTIONS、および END はローカライズ可能ではない。フィルタ データとフォーマット データはバイナリなので、不適切な改行や NULL 値などを含むことがある。このストリームはワイド文字を使う。

以下に標準的なグラフを示す。接続の行はわかりやすくするために一部のみであり、バイナリ データは省略されている。

003
FILTERS
0001 "C:\SomeFile.avi" {E436EBB5-524F-11CE-9F53-0020AF0BA770} SOURCE "C:\SomeFile.avi" 0000000000 
0002 "AVI Splitter" {1B544C20-FD0B-11CE-8C63-00AA0044B51E} 0000000000 
0003 "AVI Decompressor" {CF49D4E0-1115-11CE-B03A-0020AF0BA770} 0000000000
0004 "Video Renderer" {70E102B0-5556-11CE-97C0-00AA0055595A} 0000000000
CONNECTIONS
0001 "Output" 0002 "input pin" 0000000288 
   {E436EB83-524F-11CE-9F53-0020AF0BA770} 
   {E436EB88-524F-11CE-9F53-0020AF0BA770} 1 0 0000000001 
   {00000000-0000-0000-0000-000000000000} 0000000000  
0002 "Stream 00" 0003 "In" 0000000376 
   {73646976-0000-0010-8000-00AA00389B71} 
   {64697663-0000-0010-8000-00AA00389B71} 0 0 0000000001 
   {05589F80-C356-11CE-BF01-00AA0055595A} 0000000088 <binary data>
0003 "Out" 0004 "In" 0000000376 
    {73646976-0000-0010-8000-00AA00389B71} 
    {E436EB7D-524F-11CE-9F53-0020AF0BA770} 1 0 0000129600 
    {05589F80-C356-11CE-BF01-00AA0055595A} 0000000088 <binary data> 
CLOCK 1 0000
END

参照