home *** CD-ROM | disk | FTP | other *** search
- // This is a sample AVI Decoding Media Graph, it builds a decoding graph that looks like this:
- //
- // +-> [Indirectly Connect to the] -> Video Renderer
- // File Source -> AVI Spliter -|
- // +-> [Indirectly Connect to the] -> Audio Renderer
- //
- //
- // The Functions:
- //
- // LoadFilter(FilterID,FilterName)
- // - You can get the FilterID string by loading the filter in graph edit
- // and saving the result to an XML file (File -> Save as XML). Make sure
- // you copy it complete, along with the {} chars.
- // The FilterName is a name you assign to the filter. I recommend using
- // the name as it's listed by GraphEdit.
- //
- //
- // SetFilterFileName(FilterName,FileName)
- // - Use this function to set the file name the graph should load. The FileName
- // should 99% of the time be set to "<FileName>" as this is the file selected by
- // the user (see example below).
- //
- // ConnectPin(SourceFilterName,SourcePinName,DestinationFilterName,DestinationPinName)
- // - The Source and Destination filter names are the names you used with the LoadFilter
- // function. The Pin names can be found by viewing an XML exported filter graph
- // using GraphEdit (note: the pin names as they appear within GraphEdit itself
- // are incorrect!).
- //
- // IndirectConnectPin(SourceFilterName,SourcePinName,DestinationFilterName,DestinationPinName)
- // - This function is similar to the ConnectPin function except that it allows you to
- // connect pins with missing filters in between them. For example, you don't really know
- // which Audio/Video Codec an AVI file uses, so ... By Indirectly connecting the AVI Splitter
- // "Video->Out" pin with the Video Renderer filter "Video->In", the video codec is derived
- // automatically.
- //
- // RenderPin(FilterName,PinName)
- // - Same as right-clicking a pin in GraphEdit and selecting "Render", not recommended
- // for use in Zoom Player.
- //
- // SetFilterSync(FilterName)
- // - Using this function, you can set a specific filter as the filter that control the
- // Audio/Video Synchronization. Not all filters can be set as the Sync filters. Usually
- // the Audio filters are the ones in control of synchronization.
- // Use this function as the last function in the graph.
- //
- // UseSystemClock
- // - When used, a System Clock is created to maintain sync. This may cure some microstutter
- // issues, but may lead to audio desync.
- //
-
- # Filters that are consistantly used in an AVI Media Graph
- LoadFilter({E436EBB5-524F-11CE-9F53-0020AF0BA770},Source File)
- LoadFilter({79376820-07D0-11CF-A24D-0020AFD79767},Default DirectSound Device)
- LoadFilter({70E102B0-5556-11CE-97C0-00AA0055595A},Video Renderer)
- LoadFilter({1B544C20-FD0B-11CE-8C63-00AA0044B51E},AVI Splitter)
-
- # Assign the File Name into the File Source Filter
- SetFilterFileName(Source File,<FileName>)
-
- # Connect the file source filter (automatically loaded) to the AVI splitter
- ConnectPin(Source File,Output,AVI Splitter,input pin)
-
- # Connect the Video Stream Indirectly to the Video Renderer filter, thus automatically
- # adding the Video Decoder codec into the Graph without actually knowing which codec it
- # is (letting DirectShow detect and add the codec automatically).
- IndirectConnectPin(AVI Splitter,Stream 00,Video Renderer,In)
-
- # Connect the Audio Stream Indirectly to the Audio Renderer filter, thus automatically
- # adding the Audio Decoder codec into the Graph without actually knowing which codec it
- # is (letting DirectShow detect and add the codec automatically).
- IndirectConnectPin(AVI Splitter,Stream 01,Default DirectSound Device,Audio Input pin (rendered))
-