making cmake work for target machine to compile'
This commit is contained in:
@@ -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})
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
+2
-1
@@ -13,9 +13,10 @@ MyWindow::MyWindow() {
|
||||
set_title("flowy");
|
||||
|
||||
m_localCapture = new LocalCapture();
|
||||
Gtk::Picture picture;
|
||||
|
||||
// todo: show frames here
|
||||
//GtkWidget *area;
|
||||
// GtkWidget *area;
|
||||
// g_object_get(m_localCapture->gtksink, "widget", &area, NULL);
|
||||
// Gtk::Widget *widget = Glib::wrap(area);
|
||||
// set_child(*widget);
|
||||
|
||||
Reference in New Issue
Block a user