locked
Dynamic format change about MF_MT_INTERLACE_MODE of media type??

    Question

  • There are some question about this

    1. Does all MFVideoInterlaceMode such as MFVideoInterlace_Progressive can represent by MFVideoInterlace_MixedInterlaceOrProgressive with related interlace flags on sample such as  MFSampleExtension_Interlaced, MFSampleExtension_BottomFieldFirst, etc.

    2. If my original output MF_MT_INTERLACE_MODE = MFVideoInterlace_FieldInterleavedUpperFirst. When I do deinterlacing under my module, should I trigger format change for the MFT to change media type to MFVideoInterlace_Progessive?? Or I can only set MFSampleExtension_Intrlaced to FALSE even though it conflicts with msdn http://msdn.microsoft.com/en-us/library/windows/desktop/aa367729(v=vs.85).aspx#interlace_flags

    3. Is that I can only check MF_MT_INTERLACE_MODE MFVideoInterlace_Progressive , MFVideoInterlace_FieldInterleavedUpperFirst and MFVideoInterlace_FieldInterleavedLowerFirst of media type and ignore the optional interlace flag on samples to verify the stream is interlaced or not. As for the MFVideoInterlace_FieldSingleUpper , MFVideoInterlace_FieldSingleLowe and MFVideoInterlace_MixedInterlaceOrProgressive, I only check the required interlace flag on sample.

    4. From msdn http://msdn.microsoft.com/en-us/library/windows/desktop/aa367729(v=vs.85).aspx#interlace_flags, it says that "each of these attributes can have three values: either TRUE,FALSE, or not set". What's the value of not set??  return error MF_E_ATTRIBUTENOTFOUND??

    Thanks


    • Edited by Kenny Lin Tuesday, April 3, 2012 2:43 PM
    Tuesday, April 3, 2012 9:58 AM

Answers

  • Q. Does all MFVideoInterlaceMode such as MFVideoInterlace_Progressive can represent by MFVideoInterlace_MixedInterlaceOrProgressive with related interlace flags on sample such as  MFSampleExtension_Interlaced, MFSampleExtension_BottomFieldFirst, etc.

    A. This question is not clear to me. "MFVideoInterlace_Progressive" and "MFVideoInterlace_MixedInterlaceOrProgressive" are mutulally exclusive. In other words they cannot be set at the same time. If "MFVideoInterlace_MixedInterlaceOrProgressive" is set all sample extensions must set the expected interlace mode. If "MFVideoInterlace_Progressive" is set all samples are expected to be progressive and the interlace mode of the sample extensions are not checked.

    Q. If my original output MF_MT_INTERLACE_MODE = MFVideoInterlace_FieldInterleavedUpperFirst. When I do deinterlacing under my module, should I trigger format change for the MFT to change media type to MFVideoInterlace_Progessive?

    A. If your MFT changes the media type in any way you must report the new media type downstream. In this example if the input media type is "MFVideoInterlace_FieldInterleavedUpperFirst" and you are doing the deinterlacing in your MFT you should report "MFVideoInterlace_Progessive" as the interlace mode of the output media type.

    Q. Is that I can only check MF_MT_INTERLACE_MODE MFVideoInterlace_Progressive , MFVideoInterlace_FieldInterleavedUpperFirst and MFVideoInterlace_FieldInterleavedLowerFirst of media type and ignore the optional interlace flag on samples to verify the stream is interlaced or not. As for the MFVideoInterlace_FieldSingleUpper , MFVideoInterlace_FieldSingleLowe and MFVideoInterlace_MixedInterlaceOrProgressive, I only check the required interlace flag on sample.

    A. The only time you have to check the sample extension interlaced flag is when the media type is set to "MFVideoInterlace_MixedInterlaceOrProgressive". In any other interlaced media type scenario the sample extensions are optional.

    Q. From msdn http://msdn.microsoft.com/en-us/library/windows/desktop/aa367729(v=vs.85).aspx#interlace_flags, it says that "each of these attributes can have three values: either TRUE,FALSE, or not set". What's the value of not set?

    A. If the attribute has not been initalized via the applicaiton to "true" or "false" the value is considered to be "unset". There is no way to my knowledge to specify a value of "unset". This value simply exists if the property has not be initialized.

    I hope this helps,

    James


    Windows Media SDK Technologies - Microsoft Developer Services - http://blogs.msdn.com/mediasdkstuff/

    Monday, April 9, 2012 11:48 PM
    Moderator

All replies

  • Hello,

    Is your project based on Windows 8 Metro style app, this forum is talking about metro development.

    If you project is based on Windows 7. I will help you to move
    Media Foundation Development forum.

    In metro style App, not all API in multimedia can be used.  You can use these API in this document
    http://msdn.microsoft.com/en-us/library/windows/desktop/hh452756.aspx

    Best regards,
    Jesse


    Jesse Jiang [MSFT]
    MSDN Community Support | Feedback to us

    Wednesday, April 4, 2012 6:28 AM
  • Q. Does all MFVideoInterlaceMode such as MFVideoInterlace_Progressive can represent by MFVideoInterlace_MixedInterlaceOrProgressive with related interlace flags on sample such as  MFSampleExtension_Interlaced, MFSampleExtension_BottomFieldFirst, etc.

    A. This question is not clear to me. "MFVideoInterlace_Progressive" and "MFVideoInterlace_MixedInterlaceOrProgressive" are mutulally exclusive. In other words they cannot be set at the same time. If "MFVideoInterlace_MixedInterlaceOrProgressive" is set all sample extensions must set the expected interlace mode. If "MFVideoInterlace_Progressive" is set all samples are expected to be progressive and the interlace mode of the sample extensions are not checked.

    Q. If my original output MF_MT_INTERLACE_MODE = MFVideoInterlace_FieldInterleavedUpperFirst. When I do deinterlacing under my module, should I trigger format change for the MFT to change media type to MFVideoInterlace_Progessive?

    A. If your MFT changes the media type in any way you must report the new media type downstream. In this example if the input media type is "MFVideoInterlace_FieldInterleavedUpperFirst" and you are doing the deinterlacing in your MFT you should report "MFVideoInterlace_Progessive" as the interlace mode of the output media type.

    Q. Is that I can only check MF_MT_INTERLACE_MODE MFVideoInterlace_Progressive , MFVideoInterlace_FieldInterleavedUpperFirst and MFVideoInterlace_FieldInterleavedLowerFirst of media type and ignore the optional interlace flag on samples to verify the stream is interlaced or not. As for the MFVideoInterlace_FieldSingleUpper , MFVideoInterlace_FieldSingleLowe and MFVideoInterlace_MixedInterlaceOrProgressive, I only check the required interlace flag on sample.

    A. The only time you have to check the sample extension interlaced flag is when the media type is set to "MFVideoInterlace_MixedInterlaceOrProgressive". In any other interlaced media type scenario the sample extensions are optional.

    Q. From msdn http://msdn.microsoft.com/en-us/library/windows/desktop/aa367729(v=vs.85).aspx#interlace_flags, it says that "each of these attributes can have three values: either TRUE,FALSE, or not set". What's the value of not set?

    A. If the attribute has not been initalized via the applicaiton to "true" or "false" the value is considered to be "unset". There is no way to my knowledge to specify a value of "unset". This value simply exists if the property has not be initialized.

    I hope this helps,

    James


    Windows Media SDK Technologies - Microsoft Developer Services - http://blogs.msdn.com/mediasdkstuff/

    Monday, April 9, 2012 11:48 PM
    Moderator
  • Dear James:

    Lots of thanks for your reply.

    About question 1:

    I mean that if my input media type is MFVideoInterlace_Progressive and output media type is MFVideoInterlace_Progressive, can I change the combination of input and output media type to MFVideoInterlace_Progressive and MFVideoInterlace_MixedInterlace_MixedInterlaceOrProgressive and set MFSampleExtension_Interlaced to true to do the same influence to the pipeline.

    About question 4,:

    So can I get error message MF_E_ATTRIBUTENOTFOUND when the value is unset or I just misunderstanding the meaning of that error message.

    Thanks

    Kenny Lin

    Friday, April 13, 2012 8:09 AM
  • Hello Kenny,

    I'm very sorry but I'm still confused about question 1. If your input media type is "Progressive" and your output media type is "Progressive" why would you want to change your to "Mixed"? If you know your output samples are all "Progressive" then you should not set the media type to "Mixed".

    Concerning question 4. If the attribute has not been added to the collection then you will get MF_E_ATTRIBUTENOTFOUND error returned. If the attribute has been added to the connection then it has a value associated with it.

    Thanks,

    James


    Windows Media SDK Technologies - Microsoft Developer Services - http://blogs.msdn.com/mediasdkstuff/

    Tuesday, April 17, 2012 12:08 AM
    Moderator