X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=app%2Fmain.cpp;h=64a435b319b79b83769986e5e1df6a08d85b55cb;hb=refs%2Fheads%2Fquillback;hp=0247d3e9957b42ce0aea184840d83c652e62638e;hpb=895b7306d837862b7fe1b706bb26307007f69c32;p=apps%2Fcamera-gstreamer.git diff --git a/app/main.cpp b/app/main.cpp index 0247d3e..64a435b 100644 --- a/app/main.cpp +++ b/app/main.cpp @@ -16,6 +16,7 @@ #include "utils.h" #include "xdg-shell-client-protocol.h" +#include "AglShellGrpcClient.h" #include @@ -216,6 +217,7 @@ create_shm_buffer(struct display *display, struct buffer *buffer, buffer->height = height; fprintf(stdout, "Created shm buffer with width %d, height %d\n", width, height); + return 0; } @@ -571,6 +573,8 @@ create_window(struct display *display, int width, int height, const char *app_id window->display = display; window->width = width; window->height = height; + window->init_width = width; + window->init_height = height; window->surface = wl_compositor_create_surface(display->wl_compositor); if (display->wm_base) { @@ -725,13 +729,12 @@ GstElement* create_pipeline(int* argc, char** argv[]) snprintf(pipeline_str, sizeof(pipeline_str), "v4l2src device=%s ! video/x-raw,width=%d,height=%d ! waylandsink", camera_device, width, height); else if (gst_pipeline_failed == TRUE) { - snprintf(pipeline_str, sizeof(pipeline_str), "filesrc location=%s/still-image.jpg ! decodebin ! videoconvert ! imagefreeze ! waylandsink fullscreen=true", - xstr(APP_DATA_PATH), width, height); + snprintf(pipeline_str, sizeof(pipeline_str), "filesrc location=%s/still-image.jpg ! decodebin ! videoconvert ! imagefreeze ! waylandsink", + xstr(APP_DATA_PATH)); fallback_gst_pipeline_tried = TRUE; } else { - snprintf(pipeline_str, sizeof(pipeline_str), "pipewiresrc ! video/x-raw,width=%d,height=%d ! waylandsink", width, - height); + snprintf(pipeline_str, sizeof(pipeline_str), "pipewiresrc ! waylandsink"); } fprintf(stdout, "Using pipeline: %s\n", pipeline_str); @@ -756,6 +759,13 @@ int main(int argc, char* argv[]) struct window* window; const char* app_id = "camera-gstreamer"; + // for starting the application from the beginning, with a diffrent + // role we need to handle that creating the main window + if (argc >= 2 && strcmp(argv[1], "float") == 0) { + GrpcClient *client = new GrpcClient(); + client->SetAppFloat(std::string(app_id), 30, 400); + } + sa.sa_sigaction = signal_int; sigemptyset(&sa.sa_mask); sa.sa_flags = SA_RESETHAND | SA_SIGINFO;