summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorphintuka <phintuka>2008-06-14 07:13:32 +0000
committerphintuka <phintuka>2008-06-14 07:13:32 +0000
commitcba4dfc027619dffbe4e688a7ac30dd90bbf04ab (patch)
tree32cbb643fb4a91299f6299f496eba9d95da46f0b
parent437eaa4a16e85fc527ffc8b6d3c06afffbcbe503 (diff)
downloadxineliboutput-cba4dfc027619dffbe4e688a7ac30dd90bbf04ab.tar.gz
xineliboutput-cba4dfc027619dffbe4e688a7ac30dd90bbf04ab.tar.bz2
Move DFB frame buffer device selection to xine_fbfe_frontend.c
-rw-r--r--xine_fbfe_frontend.c59
-rw-r--r--xine_frontend.c37
2 files changed, 59 insertions, 37 deletions
diff --git a/xine_fbfe_frontend.c b/xine_fbfe_frontend.c
index 698ee7d0..519523d1 100644
--- a/xine_fbfe_frontend.c
+++ b/xine_fbfe_frontend.c
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: xine_fbfe_frontend.c,v 1.20 2008-05-21 20:06:45 phintuka Exp $
+ * $Id: xine_fbfe_frontend.c,v 1.21 2008-06-14 07:13:32 phintuka Exp $
*
*/
@@ -133,6 +133,46 @@ static void fbfe_update_display_size(frontend_t *this_gen)
}
/*
+ * update_DFBARGS
+ *
+ * (optionally) add fbdev option to DFBARGS environment variable
+ */
+static void update_DFBARGS(const char *fb_dev)
+{
+ const char *env_old = getenv("DFBARGS");
+ char *env_new = NULL;
+
+ if (env_old) {
+ char *env_tmp = strdup(env_old);
+ char *head = strstr(env_tmp, "fbdev=");
+
+ if (head) {
+ char *tail = strchr(head, ',');
+ if(head == env_tmp)
+ head = NULL;
+ else
+ *head = 0;
+ asprintf(&env_new, "%sfbdev=%s%s",
+ head ? env_tmp : "", fb_dev, tail ? tail : "");
+ } else {
+ asprintf(&env_new, "fbdev=%s%s%s", fb_dev, env_tmp ? "," : "", env_tmp ?: "");
+ }
+ free(env_tmp);
+
+ LOGMSG("replacing environment variable DFBARGS with %s (original was %s)",
+ env_new, env_old);
+
+ } else {
+ asprintf(&env_new, "fbdev=%s", fb_dev);
+
+ LOGMSG("setting environment variable DFBARGS to %s", env_new);
+ }
+
+ setenv("DFBARGS", env_new, 1);
+ free(env_new);
+}
+
+/*
* fbfe_display_open
*/
static int fbfe_display_open(frontend_t *this_gen, int width, int height, int fullscreen, int hud,
@@ -280,6 +320,21 @@ static void fbfe_display_close(frontend_t *this_gen)
}
}
+static int fbfe_xine_init(frontend_t *this_gen, const char *audio_driver,
+ const char *audio_port,
+ const char *video_driver,
+ int pes_buffers,
+ const char *static_post_plugins)
+{
+ if (video_driver && !strcmp(video_driver, "DirectFB")) {
+ fbfe_t *this = (fbfe_t*)this_gen;
+ update_DFBARGS(this->fb_dev);
+ }
+
+ return fe_xine_init(this_gen, audio_driver, audio_port,
+ video_driver, pes_buffers, static_post_plugins);
+}
+
static frontend_t *fbfe_get_frontend(void)
{
fe_t *this = calloc(1, sizeof(fe_t));
@@ -290,7 +345,7 @@ static frontend_t *fbfe_get_frontend(void)
this->fe.fe_display_config = fbfe_display_config;
this->fe.fe_display_close = fbfe_display_close;
- this->fe.xine_init = fe_xine_init;
+ this->fe.xine_init = fbfe_xine_init;
this->fe.xine_open = fe_xine_open;
this->fe.xine_play = fe_xine_play;
this->fe.xine_stop = fe_xine_stop;
diff --git a/xine_frontend.c b/xine_frontend.c
index b7261e0b..ee6bf11c 100644
--- a/xine_frontend.c
+++ b/xine_frontend.c
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: xine_frontend.c,v 1.58 2008-06-14 04:26:12 phintuka Exp $
+ * $Id: xine_frontend.c,v 1.59 2008-06-14 07:13:32 phintuka Exp $
*
*/
@@ -536,34 +536,6 @@ static int fe_xine_init(frontend_t *this_gen, const char *audio_driver,
if(this->fb_dev) {
if(video_driver && !strcmp(video_driver, "fb"))
x_upd_str("video.device.fb_device", this->fb_dev);
- else if(video_driver && !strcmp(video_driver, "DirectFB")) {
- /* DirectFBInit (NULL, NULL); */
- /* DirectFBSetOption ("fbdev", video_port); */
- char *orig = getenv("DFBARGS"), *head = NULL, *tail = NULL, *tmp = NULL;
- if(orig) {
- orig = strdup(orig);
- if(NULL != (head = strstr(orig,"fbdev="))) {
- tail = strchr(head, ',');
- if(head == orig)
- head = NULL;
- else
- *head = 0;
- asprintf(&tmp, "%sfbdev=%s%s",
- head ? orig : "", this->fb_dev, tail ? tail : "");
- } else {
- asprintf(&tmp, "fbdev=%s%s%s", this->fb_dev, orig?",":"", orig?orig:"");
- }
- LOGMSG("replacing environment variable DFBARGS with %s (original was %s)",
- tmp, getenv("DFBARGS"));
- free(orig);
- } else {
- asprintf(&tmp, "fbdev=%s", this->fb_dev);
- LOGMSG("setting environment variable DFBARGS to %s", tmp);
- }
- setenv("DFBARGS", tmp, 1);
- free(tmp);
- /*free(orig);*/
- }
}
#endif
@@ -947,7 +919,7 @@ static void fe_post_open(const fe_t *this, const char *name, const char *args)
if(!posts->post_pip_elements ||
!posts->post_vis_elements[0] ||
!posts->post_vis_elements[0]->enable)
- LOGMSG("enabling picture-in-picture (\"%s\") post plugin", initstr);
+ LOGMSG("enabling picture-in-picture (\"%s:%s\") post plugin", name, args);
}
if(args) {
@@ -1405,11 +1377,6 @@ static void *fe_control(frontend_t *this_gen, const char *cmd)
/* trigger forced redraw to make changes effective */
xine_set_param(this->stream, XINE_PARAM_VO_ZOOM_X, 100);
}
- } else if(!strncmp(cmd, "VO_ASPECT ", 10)) {
- int vo_aspect_ratio;
- if(1 == sscanf(cmd+10, "%d", &vo_aspect_ratio)) {
- xine_set_param(this->stream, XINE_PARAM_VO_ASPECT_RATIO, vo_aspect_ratio);
- }
}