summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorSeungha Yang <seungha@centricular.com>2021-03-25 03:24:11 +0900
committerSeungha Yang <seungha@centricular.com>2021-03-25 03:27:24 +0900
commitcc7bb86aa661cc8969a5785cea48c8f6c655e799 (patch)
tree4bf904c6b2fc7c23038481bea939e26b658df92b /sys
parent90181642a35f5813bad8db47f29a89a276f9ea08 (diff)
downloadgstreamer-plugins-bad-cc7bb86aa661cc8969a5785cea48c8f6c655e799.tar.gz
mfvideoenc: Don't pass 0/1 framerate to MFT
Some MFT implementations do not accept 0/1 framerate and it will result in encoder open failure. If framerate is unknown, we will use arbitrary 25/1 framerate value. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2106>
Diffstat (limited to 'sys')
-rw-r--r--sys/mediafoundation/gstmfvideoenc.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/mediafoundation/gstmfvideoenc.cpp b/sys/mediafoundation/gstmfvideoenc.cpp
index 8bedc5f60..968a6e41f 100644
--- a/sys/mediafoundation/gstmfvideoenc.cpp
+++ b/sys/mediafoundation/gstmfvideoenc.cpp
@@ -320,8 +320,11 @@ gst_mf_video_enc_set_format (GstVideoEncoder * enc, GstVideoCodecState * state)
fps_n = GST_VIDEO_INFO_FPS_N (info);
fps_d = GST_VIDEO_INFO_FPS_D (info);
- if (fps_n == 0 || fps_d == 0) {
- fps_n = 0;
+ if (fps_n <= 0 || fps_d <= 0) {
+ /* XXX: not sure why. NVIDIA MFT accepts 0/1 framerate, but Intel or
+ * Microsoft's software MFT doesn't accept 0/1 framerate.
+ * Need to set something meaningful value here therefore */
+ fps_n = 25;
fps_d = 1;
}