locked
TopoEdit: Save Topology with Custom Media Sink RRS feed

  • Question

  • hey there

    I'm using a custom media sink for writing ASF files in my topology with TopoEdit (adding with Add Custom Sink..)

    Unfortunately it seems like I can't successfully save this topology to an XML file. As soon as I attempt to reopen the saved file, TopoEdit gives the following message:

    "Error Loading XML file. Invalid Input. This may be due to a corrupt file."

    Is this a common problem or is something wrong with my topology?

    cheers

    Tuesday, June 1, 2010 10:39 AM

Answers

  • This is due to a bug in TopoEdit -- the glue code to load custom sinks from the XML file is not there.  The SDK ships with the TopoEdit sources under samples\multimedia\mediafoundation\topoedit, so you can fix this bug if you so desire.  The problem is in tedutil\tededit.cpp, in the function CTedTopologyEditor::LoadTopologyObject.  A new condition needs to be added:

    else if(strObjName == L"CTedCustomOutputMemo")
    {
      CAutoPtr<CTedCustomOutputMemo> memo(new CTedCustomOutputMemo());
      CHECK_ALLOC( memo.m_p );
      IFC( memo->Deserialize(pLoader) );
    
      CTedCustomOutputNode* node = new CTedCustomOutputNode;
      CHECK_ALLOC( node );
      IFC( node->Init(memo) );
    
      IFC( AddComponent(node, memo->GetNodeX(), memo->GetNodeY()) );
    }
    That should fix the problem for you.
    Wednesday, June 2, 2010 12:55 AM

All replies

  • This is due to a bug in TopoEdit -- the glue code to load custom sinks from the XML file is not there.  The SDK ships with the TopoEdit sources under samples\multimedia\mediafoundation\topoedit, so you can fix this bug if you so desire.  The problem is in tedutil\tededit.cpp, in the function CTedTopologyEditor::LoadTopologyObject.  A new condition needs to be added:

    else if(strObjName == L"CTedCustomOutputMemo")
    {
      CAutoPtr<CTedCustomOutputMemo> memo(new CTedCustomOutputMemo());
      CHECK_ALLOC( memo.m_p );
      IFC( memo->Deserialize(pLoader) );
    
      CTedCustomOutputNode* node = new CTedCustomOutputNode;
      CHECK_ALLOC( node );
      IFC( node->Init(memo) );
    
      IFC( AddComponent(node, memo->GetNodeX(), memo->GetNodeY()) );
    }
    That should fix the problem for you.
    Wednesday, June 2, 2010 12:55 AM
  • Thanks for your answer, Matt.

    Unfortunately, there are no GetNodeX() / GetNodeY() methods defined in CTedCustomOutputMemo. If I leave those 2 parameters in AddComponent, the Topology can still not be opened successfully.

    Regards,
    Stefan

    Wednesday, June 2, 2010 9:36 AM