mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-30 12:10:37 +00:00
6195fcf857
Unlike software MFT (Media Foundation Transform) which is synchronous in terms of processing input and output data, hardware MFT works in asynchronous mode. output data might not be available right after we pushed one input data into MFT. Note that async MFT will fire two events, one is "METransformNeedInput" which happens when MFT can accept more input data, and the other is "METransformHaveOutput", that's for signaling there's pending data which can be outputted immediately. To listen the events, we can wait synchronously via IMFMediaEventGenerator::GetEvent() or make use of IMFAsyncCallback object which is asynchronous way and the event will be notified from Media Foundation's internal worker queue thread. To handle such asynchronous operation, previous working flow was as follows (IMFMediaEventGenerator::GetEvent() was used for now) - Check if there is pending output data and push the data toward downstream. - Pulling events (from streaming thread) until there's at least one pending "METransformNeedInput" event - Then, push one data into MFT from streaming thread - Check if there is pending "METransformHaveOutput" again. If there is, push new output data to downstream (unlikely there is pending output data at this moment) Above flow was processed from upstream streaming thread. That means even if there's available output data, it could be outputted later when the next buffer is pushed from upstream streaming thread. It would introduce at least one frame latency in case of live stream. To reduce such latency, this commit modifies the flow to be fully asynchronous like hardware MFT was designed and to be able to output encoded data whenever it's available. More specifically, IMFAsyncCallback object will be used for handling "METransformNeedInput" and "METransformHaveOutput" events from Media Foundation's internal thread, and new output data will be also outputted from the Media Foundation's thread. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1520> |
||
---|---|---|
.. | ||
AsyncOperations.h | ||
gstmfaacenc.cpp | ||
gstmfaacenc.h | ||
gstmfaudioenc.cpp | ||
gstmfaudioenc.h | ||
gstmfcapturewinrt.cpp | ||
gstmfcapturewinrt.h | ||
gstmfdevice.c | ||
gstmfdevice.h | ||
gstmfh264enc.cpp | ||
gstmfh264enc.h | ||
gstmfh265enc.cpp | ||
gstmfh265enc.h | ||
gstmfmp3enc.cpp | ||
gstmfmp3enc.h | ||
gstmfsourceobject.c | ||
gstmfsourceobject.h | ||
gstmfsourcereader.cpp | ||
gstmfsourcereader.h | ||
gstmftransform.cpp | ||
gstmftransform.h | ||
gstmfutils.cpp | ||
gstmfutils.h | ||
gstmfvideobuffer.cpp | ||
gstmfvideobuffer.h | ||
gstmfvideoenc.cpp | ||
gstmfvideoenc.h | ||
gstmfvideosrc.c | ||
gstmfvideosrc.h | ||
gstmfvp9enc.cpp | ||
gstmfvp9enc.h | ||
gststrmif.h | ||
mediacapturewrapper.cpp | ||
mediacapturewrapper.h | ||
meson.build | ||
plugin.c |