home *** CD-ROM | disk | FTP | other *** search
/ Joystick Magazine 2002 October / JOY141_CD2.iso / Data / Sharewares / Graphisme / zplay280.exe / MediaGraph / avi.mediagraph next >
Text File  |  2002-03-02  |  4KB  |  68 lines

  1. // This is a sample AVI Decoding Media Graph, it builds a decoding graph that looks like this:
  2. //
  3. //                             +-> [Indirectly Connect to the] -> Video Renderer
  4. // File Source -> AVI Spliter -|
  5. //                             +-> [Indirectly Connect to the] -> Audio Renderer
  6. //
  7. //
  8. // The Functions:
  9. //
  10. // LoadFilter(FilterID,FilterName)
  11. //   - You can get the FilterID string by loading the filter in graph edit
  12. //     and saving the result to an XML file (File -> Save as XML).  Make sure
  13. //     you copy it complete, along with the {} chars.
  14. //     The FilterName is a name you assign to the filter.  I recommend using
  15. //     the name as it's listed by GraphEdit.
  16. //
  17. //
  18. // SetFilterFileName(FilterName,FileName)
  19. //   - Use this function to set the file name the graph should load.  The FileName
  20. //     should 99% of the time be set to "<FileName>" as this is the file selected by
  21. //     the user (see example below).
  22. //
  23. // ConnectPin(SourceFilterName,SourcePinName,DestinationFilterName,DestinationPinName)
  24. //   - The Source and Destination filter names are the names you used with the LoadFilter
  25. //     function.  The Pin names can be found by viewing an XML exported filter graph
  26. //     using GraphEdit (note: the pin names as they appear within GraphEdit itself
  27. //     are incorrect!).
  28. //
  29. // IndirectConnectPin(SourceFilterName,SourcePinName,DestinationFilterName,DestinationPinName)
  30. //   - This function is similar to the ConnectPin function except that it allows you to
  31. //     connect pins with missing filters in between them.  For example, you don't really know
  32. //     which Audio/Video Codec an AVI file uses, so ... By Indirectly connecting the AVI Splitter
  33. //     "Video->Out" pin with the Video Renderer filter "Video->In", the video codec is derived
  34. //     automatically.
  35. //
  36. // RenderPin(FilterName,PinName)
  37. //  - Same as right-clicking a pin in GraphEdit and selecting "Render", not recommended
  38. //    for use in Zoom Player.
  39. //
  40. // SetFilterSync(FilterName)
  41. //   - Using this function, you can set a specific filter as the filter that control the
  42. //     Audio/Video Synchronization.  Not all filters can be set as the Sync filters.  Usually
  43. //     the Audio filters are the ones in control of synchronization.
  44. //     Use this function as the last function in the graph.
  45. //
  46.  
  47. # Filters that are consistantly used in an AVI Media Graph
  48. LoadFilter({E436EBB5-524F-11CE-9F53-0020AF0BA770},Source File)
  49. LoadFilter({79376820-07D0-11CF-A24D-0020AFD79767},Default DirectSound Device)
  50. LoadFilter({70E102B0-5556-11CE-97C0-00AA0055595A},Video Renderer)
  51. LoadFilter({1B544C20-FD0B-11CE-8C63-00AA0044B51E},AVI Splitter)
  52.  
  53. # Assign the File Name into the File Source Filter
  54. SetFilterFileName(Source File,<FileName>)
  55.  
  56. # Connect the file source filter (automatically loaded) to the AVI splitter
  57. ConnectPin(Source File,Output,AVI Splitter,input pin)
  58.  
  59. # Connect the Video Stream Indirectly to the Video Renderer filter, thus automatically
  60. # adding the Video Decoder codec into the Graph without actually knowing which codec it
  61. # is (letting DirectShow detect and add the codec automatically).
  62. IndirectConnectPin(AVI Splitter,Stream 00,Video Renderer,In)
  63.  
  64. # Connect the Audio Stream Indirectly to the Audio Renderer filter, thus automatically
  65. # adding the Audio Decoder codec into the Graph without actually knowing which codec it
  66. # is (letting DirectShow detect and add the codec automatically).
  67. IndirectConnectPin(AVI Splitter,Stream 01,Default DirectSound Device,Audio Input pin (rendered))
  68.