首页 > 解决方案 > 如何将 GstVideoOrientationInterface 添加到 Gst 管道?

问题描述

我正在尝试旋转/翻转由 plabin 元素(在 C++ 中)播放的视频。我想要做的类似于问题Rotate a Video in gstreamer中提出的问题,但我不喜欢依赖 videoflip 元素。相反,我想使用 gst 中的 GstVideoOrientation 接口(https://thiblahute.github.io/GStreamer-doc/gst-plugins-base-video-1.0/videoorientation.html?gi-language=c#interfaces)视频库(https://thiblahute.github.io/GStreamer-doc/gst-plugins-base-video-1.0/index.html?gi-language=c)。

接口本身的文档以及如何使用它非常清楚,但我不明白如何将这样的接口添加到 GstElement。

在https://gstreamer.freedesktop.org/documentation/application-development/advanced/interfaces.htmlhttps://gstreamer.freedesktop.org/documentation/plugin-development/advanced/interfaces.html中有一些文档,但我仍然无法弄清楚这是如何工作的。

下面是我正在使用的代码示例:

#include <gst/video/video.h>
#include <gst/gst.h>

gint
main (gint argc, gchar * argv[])
{

    //...

    GstElement *pipeline;
    pipeline = NULL;

    gst_init (NULL,NULL);

    pipeline = gst_element_factory_make("playbin", "playbin");

    g_object_set (pipeline, "uri", "an_uri", NULL);

    gst_element_set_state (pipeline, GST_STATE_PLAYING);

    //...

    return 0;
}

任何帮助都会得到帮助

非常感谢

标签: c++gstreamer

解决方案


推荐阅读