summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorphintuka <phintuka>2006-08-19 19:18:21 +0000
committerphintuka <phintuka>2006-08-19 19:18:21 +0000
commit90e85832d5ecb8eac69d1e75a39e291d75e1d6ee (patch)
treecdd32f7fcf394b4606ee7c9ae174d448e552c8a2
parentdeba22f72d3917bb8ffd65b6b4f0d58823019bd6 (diff)
downloadxineliboutput-90e85832d5ecb8eac69d1e75a39e291d75e1d6ee.tar.gz
xineliboutput-90e85832d5ecb8eac69d1e75a39e291d75e1d6ee.tar.bz2
Added video size event generation to frontends
Added 16:10 aspect ratio setting
-rw-r--r--config.c4
-rw-r--r--config.h9
-rw-r--r--xine_fbfe_frontend.c60
-rw-r--r--xine_frontend.c27
-rw-r--r--xine_sxfe_frontend.c4
5 files changed, 66 insertions, 38 deletions
diff --git a/config.c b/config.c
index c80eb1f8..ae482440 100644
--- a/config.c
+++ b/config.c
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: config.c,v 1.5 2006-08-18 02:24:56 phintuka Exp $
+ * $Id: config.c,v 1.6 2006-08-19 19:18:21 phintuka Exp $
*
*/
@@ -24,7 +24,7 @@ const char *config_t::s_bufferSize[] =
const int config_t::i_pesBufferSize[] =
{0,50,250,500,1000,2000,500};
const char *config_t::s_aspects[] =
- {"automatic", "default", "4:3", "16:9", "Pan&Scan", "CenterCutOut", 0};
+ {"automatic", "default", "4:3", "16:9", "16:10", "Pan&Scan", "CenterCutOut", 0};
const char *config_t::s_deinterlaceMethods[] =
{"none", "bob", "weave", "greedy", "onefield", "onefield_xv",
"linearblend", "tvtime", 0};
diff --git a/config.h b/config.h
index 24ad6f91..86d3df9c 100644
--- a/config.h
+++ b/config.h
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: config.h,v 1.4 2006-08-17 18:56:03 phintuka Exp $
+ * $Id: config.h,v 1.5 2006-08-19 19:18:21 phintuka Exp $
*
*/
@@ -27,9 +27,10 @@
#define ASPECT_DEFAULT 1
#define ASPECT_4_3 2
#define ASPECT_16_9 3
-#define ASPECT_PAN_SCAN 4
-#define ASPECT_CENTER_CUT_OUT 5
-#define ASPECT_count 6
+#define ASPECT_16_10 4
+#define ASPECT_PAN_SCAN 5
+#define ASPECT_CENTER_CUT_OUT 6
+#define ASPECT_count 7
// De-interlace method
#define DEINTERLACE_NONE 0
diff --git a/xine_fbfe_frontend.c b/xine_fbfe_frontend.c
index 8c915de7..1332a266 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.4 2006-08-16 21:46:34 phintuka Exp $
+ * $Id: xine_fbfe_frontend.c,v 1.5 2006-08-19 19:18:21 phintuka Exp $
*
*/
@@ -54,48 +54,50 @@
typedef struct fbfe_t {
/* function pointers */
- frontend_t fe;
+ frontend_t fe;
void (*update_display_size)(frontend_t*);
/* xine stuff */
- xine_t *xine;
- xine_stream_t *stream;
- input_plugin_t *input;
- xine_video_port_t *video_port;
- xine_audio_port_t *audio_port;
- xine_event_queue_t *event_queue;
+ xine_t *xine;
+ xine_stream_t *stream;
+ input_plugin_t *input;
+ xine_video_port_t *video_port;
+ xine_audio_port_t *audio_port;
+ xine_event_queue_t *event_queue;
- post_plugins_t *postplugins;
+ post_plugins_t *postplugins;
- char configfile[256];
+ char configfile[256];
- int xine_visual_type;
- fb_visual_t vis;
+ int xine_visual_type;
+ fb_visual_t vis;
- double display_ratio;
+ double display_ratio;
- int pes_buffers;
- int aspect;
- int cropping;
- int scale_video;
- int priority;
+ int pes_buffers;
+ int aspect;
+ int cropping;
+ int scale_video;
+ int priority;
/* frontend */
- int playback_finished;
- int slave_playback_finished;
+ int playback_finished;
+ int slave_playback_finished;
/* vdr */
- fe_keypress_f keypress;
+ fe_keypress_f keypress;
/* display */
- int display;
- int fullscreen;
- int vmode_switch;
- int field_order;
- char modeline[256];
-
- int xpos, ypos;
- int width, height;
+ int display;
+ int fullscreen;
+ int vmode_switch;
+ int field_order;
+ char modeline[256];
+
+ int xpos, ypos;
+ int width, height;
+
+ int video_width, video_height;
} fe_t;
diff --git a/xine_frontend.c b/xine_frontend.c
index 834a851f..ccbe884e 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.11 2006-08-18 02:18:28 phintuka Exp $
+ * $Id: xine_frontend.c,v 1.12 2006-08-19 19:18:21 phintuka Exp $
*
*/
@@ -130,6 +130,8 @@ static double fe_dest_pixel_aspect(fe_t *this, double video_pixel_aspect,
case 2: result = (4.0/3.0 * (double)this->height/(double)this->width); break;
/* 16:9 */
case 3: result = (16.0/9.0 * (double)this->height/(double)this->width); break;
+ /* 16:10 */
+ case 4: result = (16.0/10.0 * (double)this->height/(double)this->width); break;
/* Pan&Scan */
case 4: {
double aspect_diff /*= video_pixel_aspect - 1.0*/;
@@ -172,6 +174,7 @@ aspect_diff=(video_pixel_aspect*(double)video_width/(double)video_height) - 4.0
this->cropping = 1;
}
#endif
+
return result;
}
@@ -226,7 +229,7 @@ static void fe_frame_output_cb (void *data,
#if 0
static int n=0,t=25/**10*/; n++;
- static char *s_aspect[] = {"Auto","Default","4:3","16:9","Pan&Scan"};
+ static char *s_aspect[] = {"Auto","Default","4:3","16:9","16:10","Pan&Scan"};
if((n % t) == 0) {
LOGMSG("fe_frame_output_cb:");
LOGMSG(" vid=%dx%d (frame %2d:9, pixel %2d:9)",
@@ -253,6 +256,24 @@ static void fe_frame_output_cb (void *data,
#warning TODO: vmode_switch, scale_video
}
#endif
+
+ if(this->video_width != video_width ||
+ this->video_height != video_height) {
+ xine_event_t event;
+ xine_format_change_data_t framedata;
+ event.type = XINE_EVENT_FRAME_FORMAT_CHANGE;
+ event.stream = this->stream;
+ event.data = &framedata;
+ event.data_length = sizeof(framedata);
+ framedata.width = video_width;
+ framedata.height = video_height;
+ framedata.aspect = 0; /* TODO */
+ framedata.pan_scan = 0;
+ xine_event_send(this->stream, &event);
+ /*printf("emit FRAME_FORMAT_CHANGE %dx%d\n", video_width, video_height);*/
+ this->video_width = video_width;
+ this->video_height = video_height;
+ }
}
static void xine_event_cb (void *user_data, const xine_event_t *event)
@@ -571,6 +592,8 @@ static int fe_xine_init(frontend_t *this_gen, const char *audio_driver,
posts->post_audio_enable = 1;
}
+ this->video_width = this->video_height = 0;
+
return 1;
}
diff --git a/xine_sxfe_frontend.c b/xine_sxfe_frontend.c
index 10cd7364..521ca568 100644
--- a/xine_sxfe_frontend.c
+++ b/xine_sxfe_frontend.c
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: xine_sxfe_frontend.c,v 1.8 2006-08-16 21:46:34 phintuka Exp $
+ * $Id: xine_sxfe_frontend.c,v 1.9 2006-08-19 19:18:21 phintuka Exp $
*
*/
@@ -148,6 +148,8 @@ typedef struct sxfe_s {
Atom atom_state_add, atom_state_del;
Atom atom_state_above, atom_state_fullscreen, atom_state_on_top;
+ int video_width, video_height;
+
} fe_t, sxfe_t;