aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvektor <devnull@localhost>2005-08-14 17:49:44 (GMT)
committervektor <devnull@localhost>2005-08-14 17:49:44 (GMT)
commit96ebbfa2687cef16e63be2c63a84bad073f5552a (patch)
treef312422a42e7aa279a25461c4f1785b1680d178c
parentecbd68a3e42c87b326f77eeb139d11673bf9f91a (diff)
* tvtime/src/tvtimeconf.c: Add a new config option for square pixel mode.
Default to square pixels. * tvtime/src/tvtimeconf.h: Accessor. * tvtime/src/tvtime.c: Pass to the backend. * tvtime/src/outputapi.h: Add a square pixel parameter to the init function. * tvtime/src/xcommon.c: Add a mode for forcing square pixels. * tvtime/src/xcommon.h: API. * tvtime/src/xvoutput.c: Use the xcommon implementation. * tvtime/docs/html/default.tvtime.xml: Document the new SquarePixels option. * tvtime/docs/man/en/tvtime.xml.5: Document it here too. * tvtime/NEWS: This is a newsworthy change. * tvtime/ChangeLog: Note it here too.
-rw-r--r--ChangeLog4
-rw-r--r--NEWS5
-rw-r--r--docs/html/default.tvtime.xml8
-rw-r--r--docs/man/en/tvtime.xml.57
-rw-r--r--src/outputapi.h2
-rw-r--r--src/tvtime.c3
-rw-r--r--src/tvtimeconf.c11
-rw-r--r--src/tvtimeconf.h1
-rw-r--r--src/xcommon.c14
-rw-r--r--src/xcommon.h1
-rw-r--r--src/xvoutput.c3
11 files changed, 54 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index b2ca0dc..274eec2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,8 @@
1.0 -
+ * vektor: Add a new config option, SquarePixels. By default, tvtime
+ will now assume that the output device is square pixel, since
+ X servers are so often misconfigured anyway and all LCD panels
+ have square pixels.
* vektor: Add a South Africa station list submitted by Jan Gutter.
* vektor: Add mattes for 16:10 monitors.
* vektor: Compile fixes for gcc4 from Than Ngo.
diff --git a/NEWS b/NEWS
index 8b1df23..40b1c86 100644
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,11 @@ For news and updates on tvtime, please visit our website at:
http://tvtime.net/
+News for 1.0
+
+ * By default, tvtime now assumes that pixels are square. This
+ avoids problems with many misconfigured X servers.
+
News for 0.99
* Test release for 1.0.
diff --git a/docs/html/default.tvtime.xml b/docs/html/default.tvtime.xml
index cff7947..55dd068 100644
--- a/docs/html/default.tvtime.xml
+++ b/docs/html/default.tvtime.xml
@@ -130,6 +130,14 @@
<option name="Widescreen" value="0"/>
<!--
+ Disabling this option tells tvtime to use the X server DPI to determine
+ pixel shape. By default, tvtime assumes pixels are square. Set this
+ to 0 if you have a 4:3 monitor but run it at 1280x1024 and want tvtime
+ to do the right thing.
+ -->
+ <option name="SquarePixels" value="1"/>
+
+ <!--
Sets the geometry of the window. A width value of 0 signifies
that the appropriate width for the given height will be used.
For 4:3 content on a square pixel display, this defaults to a
diff --git a/docs/man/en/tvtime.xml.5 b/docs/man/en/tvtime.xml.5
index 2f3e222..f0c5b54 100644
--- a/docs/man/en/tvtime.xml.5
+++ b/docs/man/en/tvtime.xml.5
@@ -245,6 +245,13 @@ name:channel name. Valid channels are:
.hy
.TP
+<option name="SquarePixels" value="1"/>
+Disabling this option tells tvtime to use the X server DPI to determine
+pixel shape. By default, tvtime assumes pixels are square. Set this
+to 0 if you have a 4:3 monitor but run it at 1280x1024 and want tvtime
+to do the right thing.
+
+.TP
<option name="Widescreen" value="0"/>
This option enables 16:9 aspect ratio mode by default on startup.
diff --git a/src/outputapi.h b/src/outputapi.h
index f26a408..2725e4f 100644
--- a/src/outputapi.h
+++ b/src/outputapi.h
@@ -28,7 +28,7 @@
typedef struct output_api_s
{
- int (* init)( const char *user_geometry, int aspect, int verbose );
+ int (* init)( const char *user_geometry, int aspect, int squarepixel, int verbose );
int (* set_input_size)( int inputwidth, int inputheight );
diff --git a/src/tvtime.c b/src/tvtime.c
index da7b836..15aa97a 100644
--- a/src/tvtime.c
+++ b/src/tvtime.c
@@ -1242,7 +1242,8 @@ int tvtime_main( rtctimer_t *rtctimer, int read_stdin, int realtime,
sixteennine = config_get_aspect( ct );
if( !output || !output->init( config_get_geometry( ct ),
- sixteennine, verbose ) ) {
+ sixteennine, config_get_square_pixels( ct ),
+ verbose ) ) {
/* Error messages are driver specific. */
return 1;
}
diff --git a/src/tvtimeconf.c b/src/tvtimeconf.c
index 5666f0b..ba9265b 100644
--- a/src/tvtimeconf.c
+++ b/src/tvtimeconf.c
@@ -56,6 +56,7 @@ struct config_s
char *geometry;
int verbose;
int aspect;
+ int squarepixels;
int debug;
int fullscreen;
int alwaysontop;
@@ -281,6 +282,10 @@ static void parse_option( config_t *ct, xmlNodePtr node )
}
}
+ if( !xmlStrcasecmp( name, BAD_CAST "SquarePixels" ) ) {
+ ct->squarepixels = atoi( curval );
+ }
+
if( !xmlStrcasecmp( name, BAD_CAST "Widescreen" ) ) {
ct->aspect = atoi( curval );
}
@@ -707,6 +712,7 @@ config_t *config_new( void )
ct->geometry = strdup( "0x576" );
ct->verbose = 0;
ct->aspect = 0;
+ ct->squarepixels = 1;
ct->debug = 0;
ct->fullscreen = 0;
ct->alwaysontop = 0;
@@ -1649,3 +1655,8 @@ int config_get_show_taglines( config_t *ct )
return ct->show_taglines;
}
+int config_get_square_pixels( config_t *ct )
+{
+ return ct->squarepixels;
+}
+
diff --git a/src/tvtimeconf.h b/src/tvtimeconf.h
index 6c9b4bb..a451450 100644
--- a/src/tvtimeconf.h
+++ b/src/tvtimeconf.h
@@ -191,6 +191,7 @@ int config_get_unmute_volume( config_t *ct );
int config_get_muted( config_t *ct );
int config_get_mute_on_exit( config_t *ct );
int config_get_show_taglines( config_t *ct );
+int config_get_square_pixels( config_t *ct );
#ifdef __cplusplus
};
diff --git a/src/xcommon.c b/src/xcommon.c
index 54f326b..8e3be4c 100644
--- a/src/xcommon.c
+++ b/src/xcommon.c
@@ -86,6 +86,7 @@ static int matte_height;
static int alwaysontop;
static int has_focus;
static int wm_is_metacity;
+static int use_square_pixels;
static xfullscreen_t *xf;
static Atom net_supporting_wm_check;
@@ -309,7 +310,11 @@ static void xv_get_output_aspect( int *px_widthratio, int *px_heightratio )
metric_widthratio = matte_width;
}
- xfullscreen_get_pixel_aspect( xf, &sar_frac_w, &sar_frac_h );
+ if( use_square_pixels ) {
+ sar_frac_w = sar_frac_h = 1;
+ } else {
+ xfullscreen_get_pixel_aspect( xf, &sar_frac_w, &sar_frac_h );
+ }
if( xcommon_verbose ) {
fprintf( stderr, "xcommon: Pixel aspect ratio %d:%d.\n",
@@ -830,7 +835,7 @@ int xcommon_open_display( const char *user_geometry, int aspect, int verbose )
XSetWindowAttributes xswa;
const char *hello = "tvtime";
unsigned long mask;
- char *wmname;
+ char *wmname = 0;
int wx, wy;
unsigned int ww, wh;
int gflags;
@@ -1832,3 +1837,8 @@ void xcommon_update_xawtv_station( int frequency, int channel_id,
(unsigned char *) data, length );
}
+void xcommon_set_square_pixel_mode( int squarepixel )
+{
+ use_square_pixels = squarepixel;
+}
+
diff --git a/src/xcommon.h b/src/xcommon.h
index 8ecb113..1607310 100644
--- a/src/xcommon.h
+++ b/src/xcommon.h
@@ -62,6 +62,7 @@ void xcommon_set_colourkey( int colourkey );
void xcommon_frame_drawn( void );
void xcommon_set_fullscreen_position( int pos );
void xcommon_set_matte( int ystart, int height );
+void xcommon_set_square_pixel_mode( int squarepixel );
int xcommon_is_fullscreen_supported( void );
int xcommon_is_alwaysontop_supported( void );
void xcommon_update_xawtv_station( int frequency, int channel_id,
diff --git a/src/xvoutput.c b/src/xvoutput.c
index 10b3c10..1fedb96 100644
--- a/src/xvoutput.c
+++ b/src/xvoutput.c
@@ -293,7 +293,7 @@ static int get_colourkey( void )
return 0;
}
-static int xv_init( const char *user_geometry, int aspect, int verbose )
+static int xv_init( const char *user_geometry, int aspect, int squarepixel, int verbose )
{
xvoutput_verbose = verbose;
@@ -302,6 +302,7 @@ static int xv_init( const char *user_geometry, int aspect, int verbose )
fprintf( stderr, "xvoutput: Not using shared memory XVIDEO.\n" );
}
+ xcommon_set_square_pixel_mode( squarepixel );
if( !xcommon_open_display( user_geometry, aspect, verbose ) ) {
return 0;
}

Privacy Policy