Media (Intel® Video Processing Library, Intel Media SDK)
Access community support with transcoding, decoding, and encoding in applications using media tools like Intel® oneAPI Video Processing Library and Intel® Media SDK
Announcements
The Intel Media SDK project is no longer active. For continued support and access to new features, Intel Media SDK users are encouraged to read the transition guide on upgrading from Intel® Media SDK to Intel® Video Processing Library (VPL), and to move to VPL as soon as possible.
For more information, see the VPL website.

How to dynamic update input type by intel H264 MFT

breaker
Beginner
635 Views

 I use Intel Quick Sync Video H.264 Encoder MFT generate H264 frame in async mode.I found MFGetAttributeUINT32 funtion with MFT_SUPPORT_DYNAMIC_FORMAT_CHANGE return true.But i reset input type when screen resolution change using SetInputType function return MF_E_TRANSFORM_CANNOT_CHANGE_MEDIATYPE_WHILE_PROCESSING(0xC00D6D74),

I think this behaviour doesn't apply for the protocol of Microsoft: 


https://docs.microsoft.com/en-us/windows/desktop/medfound/handling-stream-changes

MFT_SUPPORT_DYNAMIC_FORMAT_CHANGE is TRUE
1.The client calls IMFTransform::SetInputType to set the new input type.

2.The MFT validates the input type. If the type is invalid, SetInputType returns MF_E_INVALIDMEDIATYPE or another error code. Otherwise, SetInputType returns S_OK.

3.Assuming the input type is valid, the MFT evaluates whether the output type also changes. If not, streaming continues, and no further action is required.
4.Before the output type changes, the MFT must process any cached input samples, as follows:
a.The MFT does not invalidate its current output type.
b.The MFT produces as much output as it can from the cached input samples.
c.It is optional whether the MFT accepts new input samples while it processes the cached samples. If so, the new input samples will use the new input format, so the MFT must keep track of the point when the format changed.
5.After the MFT processes all of the samples that it received before the input type changed, the IMFTransform::ProcessOutput returns MF_E_TRANSFORM_STREAM_CHANGE.
6.The MFT invalidates its current output type, and updates the list of available output media types.
7.The client negotiates the new output type, as described previously.
 

Although i tried the other way. By sending the MFT_MESSAGE_COMMAND_DRAIN message, reset input type when revice METransformDrainComplete event,and still got a MF_E_TRANSFORM_CANNOT_CHANGE_MEDIATYPE_WHILE_PROCESSING error. In my view, the  component is abnormal.

Development environment:

intel i7 4790 windows7 64bit

mfx_mft_h264ve_w7_32.dll ver 4.13.1.11

Attached file is the log information generated by the MFTrace.exe tool.

0 Kudos
0 Replies
Reply