diff options
author | Guenter Bartsch <guenter@users.sourceforge.net> | 2002-10-29 02:57:59 +0000 |
---|---|---|
committer | Guenter Bartsch <guenter@users.sourceforge.net> | 2002-10-29 02:57:59 +0000 |
commit | a61e4d68405657a42c59ea5bc9ebfbde0e0294e3 (patch) | |
tree | 7a70420e9605a89048db1f322b41f2a048d5281b | |
parent | 03e69bb1df2b5c19296fa234dd2e1ce010f1e43d (diff) | |
download | xine-lib-a61e4d68405657a42c59ea5bc9ebfbde0e0294e3.tar.gz xine-lib-a61e4d68405657a42c59ea5bc9ebfbde0e0294e3.tar.bz2 |
map brightness/contrast/... settings to specified ranges
CVS patchset: 3085
CVS date: 2002/10/29 02:57:59
-rw-r--r-- | TODO | 1 | ||||
-rw-r--r-- | src/video_out/video_out_xv.c | 13 | ||||
-rw-r--r-- | src/xine-engine/xine_interface.c | 47 |
3 files changed, 49 insertions, 12 deletions
@@ -13,7 +13,6 @@ required for 1.0 - decoder plugin garbage collection (unload unused decoder plugins) - fix memleaks -- brightness/contrast : map to specified ranges - implement get_audio/video_frame at least for 1 set of demuxer+decoders implement null_audio/video_output plugins implement test frontend that uses these functions diff --git a/src/video_out/video_out_xv.c b/src/video_out/video_out_xv.c index c4ee0deac..bbf71954b 100644 --- a/src/video_out/video_out_xv.c +++ b/src/video_out/video_out_xv.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: video_out_xv.c,v 1.144 2002/10/29 00:36:21 komadori Exp $ + * $Id: video_out_xv.c,v 1.145 2002/10/29 02:57:59 guenter Exp $ * * video_out_xv.c, X11 video extension interface for xine * @@ -738,6 +738,9 @@ static int xv_get_property (xine_vo_driver_t *this_gen, int property) { xv_driver_t *this = (xv_driver_t *) this_gen; + printf ("video_out_xv: property #%d = %d\n", property, + this->props[property].value); + return this->props[property].value; } @@ -1005,8 +1008,8 @@ static void xv_check_capability (xv_driver_t *this, XvGetPortAttribute (this->display, this->xv_port, this->props[property].atom, &int_default); - printf ("video_out_xv: port attribute %s value is %d\n", - str_prop, int_default); + printf ("video_out_xv: port attribute %s (%d) value is %d\n", + str_prop, property, int_default); if (config_name) { /* is this a boolean property ? */ @@ -1032,7 +1035,9 @@ static void xv_check_capability (xv_driver_t *this, this->use_colorkey = 1; this->colorkey = entry->num_value; } - } + } else + this->props[property].value = int_default; + } static void xv_update_deinterlace(void *this_gen, xine_cfg_entry_t *entry) { diff --git a/src/xine-engine/xine_interface.c b/src/xine-engine/xine_interface.c index 534674990..974458263 100644 --- a/src/xine-engine/xine_interface.c +++ b/src/xine-engine/xine_interface.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: xine_interface.c,v 1.26 2002/10/27 01:52:15 guenter Exp $ + * $Id: xine_interface.c,v 1.27 2002/10/29 02:57:59 guenter Exp $ * * convenience/abstraction layer, functions to implement * libxine's public interface @@ -360,12 +360,27 @@ void xine_set_param (xine_stream_t *stream, int param, int value) { case XINE_PARAM_VERBOSITY: stream->xine->verbosity = value; - case XINE_PARAM_VO_DEINTERLACE: - case XINE_PARAM_VO_ASPECT_RATIO: case XINE_PARAM_VO_HUE: case XINE_PARAM_VO_SATURATION: case XINE_PARAM_VO_CONTRAST: - case XINE_PARAM_VO_BRIGHTNESS: + case XINE_PARAM_VO_BRIGHTNESS: { + int v, min_v, max_v, range_v; + + + stream->video_driver->get_property_min_max (stream->video_driver, + param & 0xffffff, + &min_v, &max_v); + + range_v = max_v - min_v; + + v = (value * range_v) / 65535 + min_v; + + stream->video_driver->set_property(stream->video_driver, param & 0xffffff, v); + } + break; + + case XINE_PARAM_VO_DEINTERLACE: + case XINE_PARAM_VO_ASPECT_RATIO: case XINE_PARAM_VO_ZOOM_X: case XINE_PARAM_VO_ZOOM_Y: case XINE_PARAM_VO_PAN_SCAN: @@ -414,12 +429,30 @@ int xine_get_param (xine_stream_t *stream, int param) { case XINE_PARAM_VERBOSITY: return stream->xine->verbosity; - case XINE_PARAM_VO_DEINTERLACE: - case XINE_PARAM_VO_ASPECT_RATIO: case XINE_PARAM_VO_HUE: case XINE_PARAM_VO_SATURATION: case XINE_PARAM_VO_CONTRAST: - case XINE_PARAM_VO_BRIGHTNESS: + case XINE_PARAM_VO_BRIGHTNESS: { + int v, min_v, max_v, range_v; + + + stream->video_driver->get_property_min_max (stream->video_driver, + param & 0xffffff, + &min_v, &max_v); + + v = stream->video_driver->get_property (stream->video_driver, param & 0xffffff); + + range_v = max_v - min_v; + + /* printf ("xine_interface: %d [%d %d]\n", v, min_v, max_v); */ + + return (v-min_v) * 65535 / range_v; + } + break; + + + case XINE_PARAM_VO_DEINTERLACE: + case XINE_PARAM_VO_ASPECT_RATIO: case XINE_PARAM_VO_ZOOM_X: case XINE_PARAM_VO_ZOOM_Y: case XINE_PARAM_VO_PAN_SCAN: |