static void draw_cb (gpointer data) { GstGLWindowWaylandEGL *window_egl = data; GstGLWindow *window = GST_GL_WINDOW (window_egl); GstGLContext *context = gst_gl_window_get_context (window); GstGLContextClass *context_class = GST_GL_CONTEXT_GET_CLASS (context); create_surfaces (window_egl); if (window_egl->window.subsurface) wl_subsurface_set_desync (window_egl->window.subsurface); if (window->queue_resize) { guint width, height; gst_gl_window_get_surface_dimensions (window, &width, &height); gst_gl_window_resize (window, width, height); } if (window->draw) window->draw (window->draw_data); context_class->swap_buffers (context); if (window_egl->window.subsurface) wl_subsurface_set_desync (window_egl->window.subsurface); gst_object_unref (context); }
static void gst_gl_window_wayland_egl_show (GstGLWindow * window) { GstGLDisplayWayland *display_wayland = GST_GL_DISPLAY_WAYLAND (window->display); GstGLWindowWaylandEGL *window_egl = GST_GL_WINDOW_WAYLAND_EGL (window); create_surfaces (window_egl); if (gst_gl_wl_display_roundtrip_queue (display_wayland->display, window_egl->window.queue) < 0) GST_WARNING_OBJECT (window, "failed a roundtrip"); }
static void gst_gl_window_wayland_egl_set_window_handle (GstGLWindow * window, guintptr handle) { GstGLWindowWaylandEGL *window_egl = GST_GL_WINDOW_WAYLAND_EGL (window); struct wl_surface *surface = (struct wl_surface *) handle; /* already set the NULL handle */ if (surface == NULL && window_egl->window.foreign_surface == NULL) return; /* unparent */ destroy_surfaces (window_egl); window_egl->window.foreign_surface = surface; create_surfaces (window_egl); }
/* * Class: my_streamplayer_Rtsplayer * Method: CreateRec * Signature: (Ljava/lang/String;Ljava/lang/String;IIII)V */ void Java_my_streamplayer_Rtsplayer_CreateRec (JNIEnv *env, jobject obj, jstring URL, jstring recfile, jint ID, jint x, jint y, jint frame_rate) { jboolean isCopy; char* rtspURL = (char*) env->GetStringUTFChars(URL, &isCopy); char* RecFile = (char*) env->GetStringUTFChars(recfile, &isCopy); LOGD("CAM ID %d \tURL: %s \t FILE: %s\n ", ID, rtspURL, RecFile); create_surfaces(ID, x, y); switch(ID) { case 1: MyIPCAM1 = new ipcam_camera(rtspURL, ID, frame_rate); MyIPCAM1->init(); // initialize ring buffers MyIPCAM1->set_recFile(RecFile); errorCam1 = MyIPCAM1->play_connect(); MyIPCAM1->rec_connect(); //create FFMPEG Decoder videoDecode1 = new ipcam_vdec(1, VIDEO_WIDTH, VIDEO_HEIGHT); MyIPCAM1->pVDec = videoDecode1; usleep (1000); videoDecode1->InitMPEG4Dec(); LOGD("IPCAM %d errorCam1 %d\n", ID, errorCam1); break; default: LOGE("INVALID CAM-ID %d", ID); break; } }
void gst_gl_window_wayland_egl_create_window (GstGLWindowWaylandEGL * window_egl) { create_surfaces (window_egl); }
static RobWidget * toplevel(SFSUI* ui, void * const top) { /* main widget: layout */ ui->rw = rob_vbox_new(FALSE, 0); robwidget_make_toplevel(ui->rw, top); ui->hbox1 = rob_hbox_new(FALSE, 0); ui->hbox2 = rob_hbox_new(FALSE, 0); ui->sep2 = robtk_sep_new(true); rob_vbox_child_pack(ui->rw, ui->hbox1, FALSE, FALSE); rob_vbox_child_pack(ui->rw, robtk_sep_widget(ui->sep2), FALSE, FALSE); rob_vbox_child_pack(ui->rw, ui->hbox2, FALSE, FALSE); ui->font[0] = pango_font_description_from_string("Mono 7"); ui->font[1] = pango_font_description_from_string("Mono 8"); get_color_from_theme(0, ui->c_fg); get_color_from_theme(1, ui->c_bg); create_surfaces(ui); /* main drawing area */ ui->m0 = robwidget_new(ui); ROBWIDGET_SETNAME(ui->m0, "stsco (m0)"); robwidget_set_expose_event(ui->m0, expose_event); robwidget_set_size_request(ui->m0, size_request); rob_hbox_child_pack(ui->hbox1, ui->m0, FALSE, FALSE); /* screen persistence dial */ ui->lbl_screen = robtk_lbl_new("Persistence:"); ui->screen = robtk_dial_new_with_size(0.0, 100.0, 1, 22, 22, 10.5, 10.5, 10); robtk_dial_set_alignment(ui->screen, 1.0, 0.5); robtk_dial_set_value(ui->screen, 50); robtk_dial_set_default(ui->screen, 50.0); robtk_dial_set_callback(ui->screen, cb_set_persistence, ui); /* fft bins */ ui->lbl_fft = robtk_lbl_new("FFT Samples:"); ui->sel_fft = robtk_select_new(); robtk_select_add_item(ui->sel_fft, 128, "256"); robtk_select_add_item(ui->sel_fft, 256, "512"); robtk_select_add_item(ui->sel_fft, 512, "1024"); robtk_select_add_item(ui->sel_fft, 1024, "2048"); robtk_select_add_item(ui->sel_fft, 2048, "4096"); robtk_select_add_item(ui->sel_fft, 4096, "8192"); robtk_select_add_item(ui->sel_fft, 6144, "12288"); robtk_select_add_item(ui->sel_fft, 8192, "16384"); robtk_select_set_default_item(ui->sel_fft, 3); robtk_select_set_value(ui->sel_fft, 512); robtk_select_set_callback(ui->sel_fft, cb_set_fft, ui); /* N/octave */ ui->btn_oct = robtk_cbtn_new("N/Octave Bands", GBT_LED_LEFT, false); robtk_cbtn_set_active(ui->btn_oct, false); robtk_cbtn_set_callback(ui->btn_oct, cb_set_oct, ui); robtk_cbtn_set_color_on(ui->btn_oct, .2, .8, .1); robtk_cbtn_set_color_off(ui->btn_oct, .1, .3, .1); /* explicit alignment */ ui->sep0 = robtk_sep_new(true); robtk_sep_set_linewidth(ui->sep0, 0); rob_hbox_child_pack(ui->hbox2, robtk_lbl_widget(ui->lbl_screen), FALSE, FALSE); rob_hbox_child_pack(ui->hbox2, robtk_dial_widget(ui->screen), FALSE, FALSE); rob_hbox_child_pack(ui->hbox2, robtk_lbl_widget(ui->lbl_fft), FALSE, FALSE); rob_hbox_child_pack(ui->hbox2, robtk_select_widget(ui->sel_fft), FALSE, FALSE); rob_hbox_child_pack(ui->hbox2, robtk_sep_widget(ui->sep0), TRUE, FALSE); rob_hbox_child_pack(ui->hbox2, robtk_cbtn_widget(ui->btn_oct), FALSE, FALSE); return ui->rw; }
int tool_main(int argc, char** argv) { SetupCrashHandler(); SkAutoGraphics ag; SkCommandLineFlags::Parse(argc, argv); const double overhead = estimate_timer_overhead(); if (FLAGS_verbose) { // No header. } else if (FLAGS_quiet) { SkDebugf("min\tbench\tconfig\n"); } else { SkDebugf("loops\tmin\tmean\tmax\tstddev\tbench\tconfig\n"); } for (const BenchRegistry* r = BenchRegistry::Head(); r != NULL; r = r->next()) { SkAutoTDelete<Benchmark> bench(r->factory()(NULL)); if (SkCommandLineFlags::ShouldSkip(FLAGS_match, bench->getName())) { continue; } SkTDArray<SkSurface*> surfaces; SkTDArray<const char*> configs; create_surfaces(bench.get(), &surfaces, &configs); bench->preDraw(); for (int j = 0; j < surfaces.count(); j++) { SkCanvas* canvas = surfaces[j] ? surfaces[j]->getCanvas() : NULL; const char* config = configs[j]; bench->draw(1, canvas); // Just paranoid warmup. safe_flush(canvas); const int loops = guess_loops(overhead, bench.get(), canvas); SkAutoTMalloc<double> samples(FLAGS_samples); WallTimer timer; for (int i = 0; i < FLAGS_samples; i++) { timer.start(); bench->draw(loops, canvas); safe_flush(canvas); timer.end(); samples[i] = timer.fWall / loops; } Stats stats(samples.get(), FLAGS_samples); if (FLAGS_verbose) { for (int i = 0; i < FLAGS_samples; i++) { SkDebugf("%s ", humanize(samples[i]).c_str()); } SkDebugf("%s\n", bench->getName()); } else if (FLAGS_quiet) { if (configs.count() == 1) { config = ""; // Only print the config if we run the same bench on more than one. } SkDebugf("%s\t%s\t%s\n", humanize(stats.min).c_str(), bench->getName(), config); } else { const double stddev_percent = 100 * sqrt(stats.var) / stats.mean; SkDebugf("%d\t%s\t%s\t%s\t%.0f%%\t%s\t%s\n" , loops , humanize(stats.min).c_str() , humanize(stats.mean).c_str() , humanize(stats.max).c_str() , stddev_percent , bench->getName() , config ); } } surfaces.deleteAll(); } return 0; }