adding in gstreamer working although another window created and meson with it
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
[
|
||||
{
|
||||
"directory": "/home/talksik/Code/flowy/client",
|
||||
"command": "/usr/bin/c++ -I/usr/include/sigc++-3.0 -I/usr/lib/x86_64-linux-gnu/sigc++-3.0/include -I/usr/include/gtk-4.0/unix-print -I/usr/include/gtk-4.0 -I/usr/include/gio-unix-2.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/fribidi -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pixman-1 -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/graphene-1.0 -I/usr/lib/x86_64-linux-gnu/graphene-1.0/include -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/gtkmm-4.0 -I/usr/lib/gtkmm-4.0/include -I/usr/include/pangomm-2.48 -I/usr/lib/pangomm-2.48/include -I/usr/include/giomm-2.68 -I/usr/lib/giomm-2.68/include -I/usr/include/glibmm-2.68 -I/usr/lib/glibmm-2.68/include -I/usr/include/cairomm-1.16 -I/usr/lib/cairomm-1.16/include -g -o CMakeFiles/flowy.dir/src/main.cpp.o -c /home/talksik/Code/flowy/client/src/main.cpp",
|
||||
"file": "/home/talksik/Code/flowy/client/src/main.cpp"
|
||||
}
|
||||
{
|
||||
"directory": "/home/talksik/Code/flowy/client/build",
|
||||
"command": "c++ -Iflowy.p -I. -I.. -I/usr/include/sigc++-3.0 -I/usr/lib/x86_64-linux-gnu/sigc++-3.0/include -I/usr/include/gtk-4.0/unix-print -I/usr/include/gtk-4.0 -I/usr/include/gio-unix-2.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/fribidi -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/x86_64-linux-gnu -I/usr/include/pixman-1 -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/graphene-1.0 -I/usr/lib/x86_64-linux-gnu/graphene-1.0/include -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/gtkmm-4.0 -I/usr/lib/gtkmm-4.0/include -I/usr/include/pangomm-2.48 -I/usr/lib/pangomm-2.48/include -I/usr/include/giomm-2.68 -I/usr/lib/giomm-2.68/include -I/usr/include/glibmm-2.68 -I/usr/lib/glibmm-2.68/include -I/usr/include/cairomm-1.16 -I/usr/lib/cairomm-1.16/include -I/usr/include/gstreamer-1.0 -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wnon-virtual-dtor -g -pthread -mfpmath=sse -msse -msse2 -MD -MQ flowy.p/src_main.cpp.o -MF flowy.p/src_main.cpp.o.d -o flowy.p/src_main.cpp.o -c ../src/main.cpp",
|
||||
"file": "../src/main.cpp",
|
||||
"output": "flowy.p/src_main.cpp.o"
|
||||
}
|
||||
]
|
||||
+2
-1
@@ -1,9 +1,10 @@
|
||||
project('flowy', 'cpp')
|
||||
|
||||
gtkmm_dep = dependency('gtkmm-4.0', version: '>= 4.6.0')
|
||||
gstreamer_dep = dependency('gstreamer-1.0')
|
||||
|
||||
exe_file = executable('flowy',
|
||||
'src/main.cpp',
|
||||
dependencies: gtkmm_dep,
|
||||
dependencies: [gtkmm_dep, gstreamer_dep],
|
||||
win_subsystem: 'windows',
|
||||
)
|
||||
|
||||
@@ -7,6 +7,11 @@ echo "Compiling..."
|
||||
cd build
|
||||
meson compile
|
||||
|
||||
|
||||
echo "Placing compile_commands.json in root directory..."
|
||||
rm ../compile_commands.json
|
||||
cp compile_commands.json ../
|
||||
|
||||
echo "Running..."
|
||||
./flowy
|
||||
|
||||
|
||||
@@ -1,10 +1,41 @@
|
||||
#include "gtkmm/button.h"
|
||||
#include <gst/gst.h>
|
||||
#include <gtkmm.h>
|
||||
#include <iostream>
|
||||
|
||||
#include "main.h"
|
||||
|
||||
void test_gstreamer() {
|
||||
GstElement *pipeline = nullptr;
|
||||
GstBus *bus = nullptr;
|
||||
GstMessage *msg = nullptr;
|
||||
|
||||
// building pipeline
|
||||
pipeline =
|
||||
gst_parse_launch("playbin "
|
||||
"uri=https://www.freedesktop.org/software/gstreamer-sdk/"
|
||||
"data/media/sintel_trailer-480p.webm",
|
||||
nullptr);
|
||||
|
||||
// start playing
|
||||
gst_element_set_state(pipeline, GST_STATE_PLAYING);
|
||||
|
||||
// wait until error or EOS ( End Of Stream )
|
||||
bus = gst_element_get_bus(pipeline);
|
||||
msg = gst_bus_timed_pop_filtered(
|
||||
bus, GST_CLOCK_TIME_NONE,
|
||||
static_cast<GstMessageType>(GST_MESSAGE_ERROR | GST_MESSAGE_EOS));
|
||||
|
||||
// free memory
|
||||
if (msg != nullptr)
|
||||
gst_message_unref(msg);
|
||||
gst_object_unref(bus);
|
||||
gst_element_set_state(pipeline, GST_STATE_NULL);
|
||||
gst_object_unref(pipeline);
|
||||
}
|
||||
|
||||
MyWindow::MyWindow() {
|
||||
|
||||
set_title("Basic application");
|
||||
|
||||
Gtk::Button button("start capture");
|
||||
@@ -22,6 +53,9 @@ MyWindow::~MyWindow() {}
|
||||
void MyWindow::startCapture() { std::cout << "start capture" << std::endl; }
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
gst_init(&argc, &argv);
|
||||
test_gstreamer();
|
||||
|
||||
auto app = Gtk::Application::create("org.gtkmm.examples.base");
|
||||
|
||||
return app->make_window_and_run<MyWindow>(argc, argv);
|
||||
|
||||
Reference in New Issue
Block a user