diff options
author | Scott Murray <scott.murray@konsulko.com> | 2019-03-26 16:12:36 -0400 |
---|---|---|
committer | Scott Murray <scott.murray@konsulko.com> | 2019-03-26 20:15:03 +0000 |
commit | 420515fb36adbf9b8d49df79efc24c3d662d7a7a (patch) | |
tree | 1c196c31e41f7f89a99a8bd7a515be49bb020835 /app | |
parent | ace90ff9f2fd72847a88ee0a9f043ed2132c80d4 (diff) |
Add waylandsink fallbackguppy_7.0.4guppy_7.0.3guppy_7.0.2guppy_7.0.1guppy/7.0.4guppy/7.0.3guppy/7.0.2guppy/7.0.17.0.47.0.37.0.27.0.1guppy
Add a check for vaapisink availability, and fall back to using
waylandsink if it is unavailable. This should allow using a non-Intel
board for the cluster demo, though there are potentially issues around
having a H.264 decoder plugin available that may need to be addressed
in the target platform BSP (e.g. Raspberry Pi).
Change-Id: Ie351fe0cd6e36e3db6707b9202b3b1fd7c66d3ce
Signed-off-by: Scott Murray <scott.murray@konsulko.com>
Diffstat (limited to 'app')
-rw-r--r-- | app/main.cpp | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/app/main.cpp b/app/main.cpp index 400a066..967f5e4 100644 --- a/app/main.cpp +++ b/app/main.cpp @@ -20,6 +20,8 @@ #include <gst/gst.h> #include "surface.hpp" +#undef DEBUG + int main(int argc, char *argv[]) { int port = 0; @@ -49,11 +51,30 @@ int main(int argc, char *argv[]) // // videotestsrc pattern=smpte ! video/x-raw,format=BGRx,width=384,height=368 ! waylandsink // + std::string pipeline_str = \ - "udpsrc port=5005 ! application/x-rtp,media=video,encoding-name=H264 ! queue ! rtph264depay ! h264parse config-interval=1 disable-passthrough=true ! decodebin ! vaapisink"; + "udpsrc port=5005 ! application/x-rtp,media=video,encoding-name=H264 ! queue ! rtph264depay ! h264parse config-interval=1 disable-passthrough=true ! decodebin ! "; + GstPlugin *plugin = gst_registry_find_plugin(gst_registry_get (), "vaapisink"); + if(plugin) { + pipeline_str += "vaapisink"; + gst_object_unref(plugin); + } else { + pipeline_str += "videoconvert ! video/x-raw,format=BGRx,width=384,height=368 ! waylandsink"; + } +#ifdef DEBUG + std::cout << "Using pipeline: " << pipeline_str << std::endl; +#endif // Initialize GStreamer +#ifdef DEBUG + int gargc = 2; + char **gargv = (char**) malloc(2 * sizeof(char*)); + gargv[0] = strdup(argv[0]); + gargv[1] = strdup("--gst-debug-level=2"); + gst_init(&gargc, &gargv); +#else gst_init(NULL, NULL); +#endif // Create our IVI surface handler SurfaceHandler handler(port, token, role); |