Skip to content

Commit 7cdc38e

Browse files
committed
LP-109 video : increase osxvideosink rank
so autovideosink selects it
1 parent cfb621f commit 7cdc38e

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

ground/gcs/src/libs/gstreamer/gst_util.cpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ void gst::init(int *argc, char * *argv[])
7777
// qputenv("GST_DEBUG_FILE", "gst.log");
7878
// qputenv("GST_DEBUG_DUMP_DOT_DIR", ".");
7979

80-
8180
#ifdef Q_OS_WIN
8281
qputenv("GST_PLUGIN_PATH_1_0", (Utils::GetLibraryPath() + "gstreamer-1.0").toLatin1());
8382
#endif
@@ -97,6 +96,18 @@ void gst::init(int *argc, char * *argv[])
9796
// GST_PLUGIN_STATIC_REGISTER(librepilot);
9897
gst_plugin_librepilot_register();
9998

99+
#ifdef Q_OS_MAC
100+
GstRegistry *reg = gst_registry_get();
101+
102+
GstPluginFeature *feature = gst_registry_lookup_feature(reg, "osxvideosink");
103+
if (feature) {
104+
// raise rank of osxvideosink so it gets selected by autovideosink
105+
// if not doing that then autovideosink selects the glimagesink which fails in Qt
106+
gst_plugin_feature_set_rank(feature, GST_RANK_PRIMARY);
107+
gst_object_unref(feature);
108+
}
109+
#endif
110+
100111
#ifdef USE_OPENCV
101112
// see http://stackoverflow.com/questions/32477403/how-to-know-if-sse2-is-activated-in-opencv
102113
// see http://answers.opencv.org/question/696/how-to-enable-vectorization-in-opencv/

0 commit comments

Comments
 (0)