making cmake work for target machine to compile'

This commit is contained in:
talksik
2023-07-25 14:49:04 -07:00
parent 567e1a7a9c
commit 9fcee60896
3 changed files with 10 additions and 4 deletions
+3
View File
@@ -7,13 +7,16 @@ set(CMAKE_CXX_STANDARD 17)
find_package(PkgConfig)
pkg_check_modules(GTKMM gtkmm-4.0)
pkg_check_modules(GST gstreamer-1.0)
set (source_dir "${PROJECT_SOURCE_DIR}/src")
file(GLOB source_files "${source_dir}/*.cpp")
link_directories(${GTKMM_LIBRARY_DIRS})
include_directories(${GTKMM_INCLUDE_DIRS})
include_directories(${GST_INCLUDE_DIRS})
add_executable(${PROJECT_NAME} ${source_files})
target_link_libraries(${PROJECT_NAME} ${GTKMM_LIBRARIES})
target_link_libraries(${PROJECT_NAME} ${GST_LIBRARIES})
+5 -3
View File
@@ -68,9 +68,11 @@ int LocalCapture::on_new_sample(GstElement *sink, gpointer data) {
/* Retrieve the buffer */
g_signal_emit_by_name(sink, "pull-sample", &sample);
if (sample) {
/* The only thing we do in this example is print a * to indicate a received
* buffer */
g_print("*");
GstBuffer *buffer = gst_sample_get_buffer(sample);
GstMapInfo map;
gst_buffer_map(buffer, &map, GST_MAP_READ);
std::cout << "received " << map.size << " bytes" << std::endl;
gst_sample_unref(sample);
return GST_FLOW_OK;
}
+1
View File
@@ -13,6 +13,7 @@ MyWindow::MyWindow() {
set_title("flowy");
m_localCapture = new LocalCapture();
Gtk::Picture picture;
// todo: show frames here
// GtkWidget *area;