locked
IMFPresentationDescriptor::Clone RRS feed

Answers

  • Say you're implementing IMFMediaSource::CreatePresentationDescriptor.  You may not want to give the application a pointer to the same instance of the Presentation Descriptor that you are using internally, since you likely don't want to be randomly affected e.g. by whatever calls to SelectStream/DeselectStream or changing around attributes that they're making in their code.  Cloning the Presentation Descriptor gives them their own copy of the Presentation Descriptor that they can use as they please.

    We have a known issue that this is a shallow copy; when you call IMFPresentationDescriptor::Clone, the IMFStreamDescriptors (and their media types) do not get cloned; you simply get references to the same Stream Descriptor objects.

    Wednesday, December 13, 2006 5:49 PM

All replies

  • Say you're implementing IMFMediaSource::CreatePresentationDescriptor.  You may not want to give the application a pointer to the same instance of the Presentation Descriptor that you are using internally, since you likely don't want to be randomly affected e.g. by whatever calls to SelectStream/DeselectStream or changing around attributes that they're making in their code.  Cloning the Presentation Descriptor gives them their own copy of the Presentation Descriptor that they can use as they please.

    We have a known issue that this is a shallow copy; when you call IMFPresentationDescriptor::Clone, the IMFStreamDescriptors (and their media types) do not get cloned; you simply get references to the same Stream Descriptor objects.

    Wednesday, December 13, 2006 5:49 PM
  • Do you mean that the IMFStreamDescriptors might still get affected randomly? Could this issue be solved if you add Clone() function to IMFStreamDescriptor interface?
    Thursday, December 14, 2006 4:47 AM
  • Yes and yes.
    Thursday, December 14, 2006 4:25 PM