aboutsummaryrefslogtreecommitdiff
path: root/frontend/plugin_lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/plugin_lib.c')
-rw-r--r--frontend/plugin_lib.c54
1 files changed, 54 insertions, 0 deletions
diff --git a/frontend/plugin_lib.c b/frontend/plugin_lib.c
new file mode 100644
index 0000000..5fd80cd
--- /dev/null
+++ b/frontend/plugin_lib.c
@@ -0,0 +1,54 @@
+/*
+ * (C) notaz, 2010
+ *
+ * This work is licensed under the terms of the GNU GPLv2 or later.
+ * See the COPYING file in the top-level directory.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "linux/fbdev.h"
+
+static struct vout_fbdev *fbdev;
+void *pl_fbdev_buf;
+
+int pl_fbdev_init(void)
+{
+ const char *fbdev_name;
+ int w, h;
+
+ fbdev_name = getenv("FBDEV");
+ if (fbdev_name == NULL)
+ fbdev_name = "/dev/fb0";
+
+ w = 640;
+ h = 512; // ??
+ fbdev = vout_fbdev_init(fbdev_name, &w, &h, 0);
+ if (fbdev == NULL)
+ return -1;
+
+ pl_fbdev_buf = vout_fbdev_flip(fbdev);
+
+ return 0;
+}
+
+int pl_fbdev_set_mode(int w, int h, int bpp)
+{
+ printf("set mode %dx%d@%d\n", w, h, bpp);
+ return vout_fbdev_resize(fbdev, w, h, 0, 0, 0, 0, 0);
+}
+
+void *pl_fbdev_flip(void)
+{
+ pl_fbdev_buf = vout_fbdev_flip(fbdev);
+ return pl_fbdev_buf;
+}
+
+void pl_fbdev_finish(void)
+{
+ if (fbdev != NULL)
+ vout_fbdev_finish(fbdev);
+ fbdev = NULL;
+}
+