Exemple #1
0
static void oglspectrum_playback_stop(void)
{
	if(oglspectrum_cfg.tdfx_mode)
	{
		stop_display();
	}
}
Exemple #2
0
static void oglspectrum_playback_start(void)
{
	if(oglspectrum_cfg.tdfx_mode)
	{
		if(window)
			stop_display();

		start_display();
	}
}
Exemple #3
0
static void
leak_after_error(void)
{
	struct client *c = client_connect();

	/* this should return -1, because we'll send error
	 * from server. */
	assert(stop_display(c, 1) == -1);
	assert(wl_display_dispatch_pending(c->wl_display) == -1);
	assert(wl_display_get_error(c->wl_display) == ENOMEM);

	/* after we got error, we have display_resume event
	 * in the queue. It should be freed in wl_display_disconnect().
	 * Let's see! */

	wl_proxy_destroy((struct wl_proxy *) c->tc);
	wl_display_disconnect(c->wl_display);
	free(c);
}
/******************************************************************************
 * Example to show vid1 in YUV format,OSD0 in RGB565 format
 *  and OSD1 is attribute format.
 ******************************************************************************/
static int vpbe_UE_1(void)
{
	int ret = 0;
	v4l2_std_id cur_std;

	DBGENTER;

	/* Setup Capture */
	if (initialize_capture(&cur_std) < 0) {
		printf("Failed to intialize capture\n");
		return ret;
	}

	/* Setup Display */
	if (cur_std & V4L2_STD_NTSC) {
		if (change_sysfs_attrib(ATTRIB_OUTPUT, DISPLAY_INTERFACE_COMPOSITE))
			return FAILURE;
		if (change_sysfs_attrib(ATTRIB_MODE, DISPLAY_MODE_NTSC))
			return FAILURE;
		file_size = WIDTH_NTSC * HEIGHT_NTSC * 2;
	}
	else if (cur_std & V4L2_STD_PAL) {
		if (change_sysfs_attrib(ATTRIB_OUTPUT, DISPLAY_INTERFACE_COMPOSITE))
			return FAILURE;
		if (change_sysfs_attrib(ATTRIB_MODE, DISPLAY_MODE_PAL))
			return FAILURE;
		file_size = WIDTH_PAL * HEIGHT_PAL * 2;
	}
	else if (cur_std & V4L2_STD_720P_60) {
		if (change_sysfs_attrib(ATTRIB_OUTPUT, DISPLAY_INTERFACE_COMPONENT))
			return FAILURE;
		if (change_sysfs_attrib(ATTRIB_MODE, DISPLAY_MODE_720P))
			return FAILURE;
		file_size = WIDTH_720P * HEIGHT_720P * 2;
	}
	else if (cur_std & V4L2_STD_1080I_60) {
		if (change_sysfs_attrib(ATTRIB_OUTPUT, DISPLAY_INTERFACE_COMPONENT))
			return FAILURE;
		if (change_sysfs_attrib(ATTRIB_MODE, DISPLAY_MODE_1080I))
			return FAILURE;
		file_size = WIDTH_1080I * HEIGHT_1080I * 2;
	} else {
		printf("Cannot display this standard\n");
		return FAILURE;
	}

	/* Setup VID1 output */
	if ((init_vid1_device(cur_std)) < 0) {
		printf("\nFailed to init vid1 window ");
		return FAILURE;
	}
	
	ret = start_loop();
	if (ret)
		printf("\tError: Video loopback had some errors\n");
	printf("Video loopback completed successfully\n");

	/*
	 * Once the streaming is done  stop the display
	 * hardware
	 */
	printf(" Test STREAM_OFF - \n");
	ret = stop_display(fd_vid1);
	if (ret < 0) {
		printf("\tError: Could not stop display\n");
		return ret;
	}

	/* Release display channel */
	printf(" Test buffer unmapping & closing of device - \n");
	release_display(&fd_vid1);

	ret = stop_capture(fdCapture);
	if (ret < 0)
		printf("Error in VIDIOC_STREAMOFF:capture\n");

	release_capture(&fdCapture);
	close(fd_osd0);
	printf("DONE ALL\n\n\n");

	DBGEXIT;
	return ret;
}
Exemple #5
0
static void oglspectrum_cleanup(void)
{
	stop_display();
}
static void oglspectrum_stop(void)
{
	stop_display(1);
}
static void *
draw_thread_func(void * UNUSED (arg))
{
	Bool configured = FALSE;

	window_w = prefs_get_int(ap_prefs, "opengl_spectrum", "width", DEFAULT_W);
	window_h = prefs_get_int(ap_prefs, "opengl_spectrum", "height", DEFAULT_H);

	if ((window = create_window(window_w, window_h)) == 0)
	{
		alsaplayer_error("unable to create window");
		pthread_exit(NULL);
	}

	XMapWindow(dpy, window);

	glMatrixMode(GL_PROJECTION);
	glLoadIdentity();
	glFrustum(-1, 1, -1, 1, 1.5, 10);
	glMatrixMode(GL_MODELVIEW);
	glLoadIdentity();
	glEnable(GL_DEPTH_TEST);
	glDepthFunc(GL_LESS);

	while(going)
	{
		while(XPending(dpy))
		{
			XEvent event;
			KeySym keysym;
			char buf[16];

			XNextEvent(dpy, &event);
			switch(event.type)
			{
			case ConfigureNotify:
				glViewport(0,0,event.xconfigure.width, event.xconfigure.height);
				window_w = event.xconfigure.width;
				window_h = event.xconfigure.height;
				prefs_set_int(ap_prefs, "opengl_spectrum", "width", window_w);
				prefs_set_int(ap_prefs, "opengl_spectrum", "height", window_h);
				configured = TRUE;
				break;
			case KeyPress:


				XLookupString (&event.xkey, buf, 16, &keysym, NULL);
				switch(keysym)
				{
				case XK_Escape:

					going = FALSE;
					break;
				case XK_z:
					/*xmms_remote_playlist_prev(oglspectrum_vp.xmms_session); */
					break;
				case XK_x:
					/*xmms_remote_play(oglspectrum_vp.xmms_session); */
					break;
				case XK_c:
					/*xmms_remote_pause(oglspectrum_vp.xmms_session); */
					break;
				case XK_v:
					/*xmms_remote_stop(oglspectrum_vp.xmms_session); */
					break;
				case XK_b:
					/* xmms_remote_playlist_next(oglspectrum_vp.xmms_session); */
					break;
				case XK_Up:
					x_speed -= 0.1;
					if(x_speed < -3.0)
						x_speed = -3.0;
					break;
				case XK_Down:
					x_speed += 0.1;
					if(x_speed > 3.0)
						x_speed = 3.0;
					break;
				case XK_Left:
					y_speed -= 0.1;
					if(y_speed < -3.0)
						y_speed = -3.0;

					break;
				case XK_Right:
					y_speed += 0.1;
					if(y_speed > 3.0)
						y_speed = 3.0;
					break;
				case XK_w:
					z_speed -= 0.1;
					if(z_speed < -3.0)
						z_speed = -3.0;
					break;
				case XK_q:
					z_speed += 0.1;
					if(z_speed > 3.0)
						z_speed = 3.0;
					break;
				case XK_Return:
					x_speed = 0.0;
					y_speed = 0.5;
					z_speed = 0.0;
					x_angle = 20.0;
					y_angle = 45.0;
					z_angle = 0.0;
					break;
				}

				break;
			case ClientMessage:
				if ((Atom)event.xclient.data.l[0] == wm_delete_window_atom)
				{
					going = FALSE;
				}
				break;
			}
		}
		if(configured)
		{
			x_angle += x_speed;
			if(x_angle >= 360.0)
				x_angle -= 360.0;

			y_angle += y_speed;
			if(y_angle >= 360.0)
				y_angle -= 360.0;

			z_angle += z_speed;
			if(z_angle >= 360.0)
				z_angle -= 360.0;

			draw_bars();
		}
	}

	if (glxcontext)
	{
		glXMakeCurrent(dpy, 0, NULL);
		glXDestroyContext(dpy, glxcontext);
		glxcontext = NULL;
	}
	if (window)
	{
		if (grabbed_pointer)
		{
			XUngrabPointer(dpy, CurrentTime);
			grabbed_pointer = FALSE;
		}

		XDestroyWindow(dpy, window);
		window = 0;
	}
	pthread_mutex_unlock(&scope_mutex);
	stop_display(0); /* Close down display */
	pthread_exit(NULL);
}