Lines Matching full:app
51 struct _app *app = data; in context_handler() local
76 g_mutex_lock (&app->mutex); in context_handler()
77 gst_object_replace (&app->display, display); in context_handler()
79 g_mutex_unlock (&app->mutex); in context_handler()
98 g_mutex_lock (&app->mutex); in context_handler()
99 if (!app->display) { in context_handler()
100 g_mutex_unlock (&app->mutex); in context_handler()
109 gst_structure_set (s, "gst-display", GST_TYPE_OBJECT, app->display, in context_handler()
111 gst_printerrln ("%s", GST_OBJECT_NAME (app->display)); in context_handler()
114 g_mutex_unlock (&app->mutex); in context_handler()
132 struct _app *app = data; in message_handler() local
136 g_main_loop_quit (app->loop); in message_handler()
153 g_main_loop_quit (app->loop); in message_handler()
164 config_simple (struct _app *app) in config_simple() argument
167 GObjectClass *g_class = G_OBJECT_GET_CLASS (app->vpp); in config_simple()
176 g_object_set (app->vpp, "skin-tone", TRUE, NULL); in config_simple()
179 g_object_set (app->vpp, "skin-tone", max, NULL); in config_simple()
191 g_object_set (app->vpp, props[i], max, NULL); in config_simple()
196 build_pipeline (struct _app *app) in build_pipeline() argument
209 app->pipeline = gst_parse_launch (cmd->str, &err); in build_pipeline()
218 src = gst_bin_get_by_name (GST_BIN (app->pipeline), "src"); in build_pipeline()
223 app->vpp = gst_bin_get_by_name (GST_BIN (app->pipeline), "vpp"); in build_pipeline()
225 config_simple (app); in build_pipeline()
227 app->crop = gst_bin_get_by_name (GST_BIN (app->pipeline), "crop"); in build_pipeline()
229 bus = gst_pipeline_get_bus (GST_PIPELINE (app->pipeline)); in build_pipeline()
230 gst_bus_set_sync_handler (bus, context_handler, app, NULL); in build_pipeline()
231 gst_bus_add_watch (bus, message_handler, app); in build_pipeline()
240 struct _app *app = data; in change_cb_randomly() local
244 if (!GST_COLOR_BALANCE_GET_INTERFACE (app->vpp)) in change_cb_randomly()
247 cb = GST_COLOR_BALANCE (app->vpp); in change_cb_randomly()
263 struct _app *app = data; in change_dir_randomly() local
264 GObjectClass *g_class = G_OBJECT_GET_CLASS (app->vpp); in change_dir_randomly()
281 g_object_set (app->vpp, "video-direction", value, NULL); in change_dir_randomly()
297 gst_element_send_event (app->pipeline, event); in change_dir_randomly()
314 struct _app *app = data; in change_sharpen_randomly() local
318 pspec = vpp_has_sharpen (app->vpp); in change_sharpen_randomly()
325 (app->sharpen), GST_SECOND, value); in change_sharpen_randomly()
333 struct _app *app = data; in change_crop_randomly() local
335 g_object_set (app->crop, "bottom", app->bottom, "top", app->top, "left", in change_crop_randomly()
336 app->left, "right", app->right, NULL); in change_crop_randomly()
338 app->top += app->tdir; in change_crop_randomly()
339 if (app->top >= 80) in change_crop_randomly()
340 app->tdir = -10; in change_crop_randomly()
341 else if (app->top < 10) in change_crop_randomly()
342 app->tdir = 10; in change_crop_randomly()
344 app->bottom += app->bdir; in change_crop_randomly()
345 if (app->bottom >= 60) in change_crop_randomly()
346 app->bdir = -10; in change_crop_randomly()
347 else if (app->bottom < 10) in change_crop_randomly()
348 app->bdir = 10; in change_crop_randomly()
350 app->left += app->ldir; in change_crop_randomly()
351 if (app->left >= 100) in change_crop_randomly()
352 app->ldir = -10; in change_crop_randomly()
353 else if (app->left < 10) in change_crop_randomly()
354 app->ldir = 10; in change_crop_randomly()
356 app->right += app->rdir; in change_crop_randomly()
357 if (app->right >= 80) in change_crop_randomly()
358 app->rdir = -10; in change_crop_randomly()
359 else if (app->right < 10) in change_crop_randomly()
360 app->rdir = 10; in change_crop_randomly()
389 struct _app app = { NULL, }; in main() local
395 g_mutex_init (&app.mutex); in main()
397 app.loop = g_main_loop_new (NULL, TRUE); in main()
399 if (!build_pipeline (&app)) in main()
403 g_timeout_add_seconds (1, change_cb_randomly, &app); in main()
407 gst_util_set_object_arg (G_OBJECT (app.vpp), "video-direction", "auto"); in main()
409 g_timeout_add_seconds (1, change_dir_randomly, &app); in main()
412 if (randomsharpen && vpp_has_sharpen (app.vpp)) { in main()
415 app.sharpen = gst_interpolation_control_source_new (); in main()
416 bind = gst_direct_control_binding_new_absolute (GST_OBJECT (app.vpp), in main()
417 "sharpen", app.sharpen); in main()
418 gst_object_add_control_binding (GST_OBJECT (app.vpp), bind); in main()
419 g_object_set (app.sharpen, "mode", GST_INTERPOLATION_MODE_LINEAR, NULL); in main()
421 change_sharpen_randomly (&app); in main()
422 g_timeout_add_seconds (1, change_sharpen_randomly, &app); in main()
426 app.bdir = app.ldir = app.rdir = app.tdir = 10; in main()
427 g_timeout_add (150, change_crop_randomly, &app); in main()
430 gst_element_set_state (app.pipeline, GST_STATE_PLAYING); in main()
432 g_main_loop_run (app.loop); in main()
434 gst_element_set_state (app.pipeline, GST_STATE_NULL); in main()
436 bus = gst_pipeline_get_bus (GST_PIPELINE (app.pipeline)); in main()
440 gst_clear_object (&app.display); in main()
444 gst_clear_object (&app.vpp); in main()
445 gst_clear_object (&app.pipeline); in main()
446 gst_clear_object (&app.sharpen); in main()
447 gst_clear_object (&app.crop); in main()
450 g_mutex_clear (&app.mutex); in main()
451 g_main_loop_unref (app.loop); in main()