下列程式碼可使用自己要的 sink
pipeline =
gst_parse_launch(
"playbin uri=file:///opt/nvidia/deepstream/deepstream-5.0/samples/streams/sample_720p.mp4",
NULL);
GstElement *sink = gst_element_factory_make ("nveglglessink", "sink");
g_object_set(G_OBJECT(pipeline), "video-sink", sink, NULL);
或者調整 registry rank
GstRegistry *plugins_register = gst_registry_get();
GstPluginFeature *nveglglessink = gst_registry_lookup_feature(plugins_register, "nveglglessink");
if (nveglglessink == NULL) {
g_printerr("gst_registry_lookup_feature return NULL \n");
return 0;
}
guint nveglglessink_rank = gst_plugin_feature_get_rank(nveglglessink);
g_print("nveglglessink rank=%u\n", nveglglessink_rank);
gst_plugin_feature_set_rank(nveglglessink, GST_RANK_PRIMARY + 11);
gst_object_unref(nveglglessink);
使用 gst-launch-1.0
$ gst-launch-1.0 playbin uri=https://www.freedesktop.org/software/gstreamer-sdk/data/media/sintel_trailer-480p.webm video-sink=nveglglessink
沒有留言:
張貼留言