From 912b2d7af9a7fb5458001ad8809ad0ac4d1692e4 Mon Sep 17 00:00:00 2001 From: Seungha Yang Date: Tue, 21 Apr 2020 20:49:38 +0900 Subject: [PATCH] mediafoundation: Disable querying supprted maximum resolution Initializing MFT for checking supported maximum resolution is too slow. Part-of: --- sys/mediafoundation/gstmfh264enc.cpp | 8 ++++++++ sys/mediafoundation/gstmfh265enc.cpp | 7 +++++++ 2 files changed, 15 insertions(+) diff --git a/sys/mediafoundation/gstmfh264enc.cpp b/sys/mediafoundation/gstmfh264enc.cpp index 0eb3586622..da5d4f58d0 100644 --- a/sys/mediafoundation/gstmfh264enc.cpp +++ b/sys/mediafoundation/gstmfh264enc.cpp @@ -1232,6 +1232,10 @@ gst_mf_h264_enc_plugin_init_internal (GstPlugin * plugin, guint rank, GST_DEBUG_OBJECT (transform, "Check supported resolutions of %s", device_name); + + /* FIXME: This would take so long time. + * Need to find smart way to find supported resolution*/ +#if 0 for (i = 0; i < G_N_ELEMENTS (resolutions_to_check); i++) { guint width, height; @@ -1259,6 +1263,10 @@ gst_mf_h264_enc_plugin_init_internal (GstPlugin * plugin, guint rank, GST_WARNING_OBJECT (transform, "Couldn't query supported resolution"); goto done; } +#else + /* FIXME: don't hardcode supported resolution */ + max_width = max_height = 8192; +#endif /* high profile supported since windows8 */ src_caps = gst_caps_from_string ("video/x-h264, " diff --git a/sys/mediafoundation/gstmfh265enc.cpp b/sys/mediafoundation/gstmfh265enc.cpp index a0d0d4aba8..ed11eda1eb 100644 --- a/sys/mediafoundation/gstmfh265enc.cpp +++ b/sys/mediafoundation/gstmfh265enc.cpp @@ -1003,6 +1003,9 @@ gst_mf_h265_enc_plugin_init_internal (GstPlugin * plugin, guint rank, if (!gst_mf_result (hr)) goto done; + /* FIXME: This would take so long time. + * Need to find smart way to find supported resolution*/ +#if 0 for (i = 0; i < G_N_ELEMENTS (resolutions_to_check); i++) { guint width, height; @@ -1030,6 +1033,10 @@ gst_mf_h265_enc_plugin_init_internal (GstPlugin * plugin, guint rank, GST_WARNING_OBJECT (transform, "Couldn't query supported resolution"); goto done; } +#else + /* FIXME: don't hardcode supported resolution */ + max_width = max_height = 8192; +#endif src_caps = gst_caps_from_string ("video/x-h265, " "stream-format=(string) byte-stream, "