diff options
Diffstat (limited to 'src/xine-engine/xine_interface.c')
-rw-r--r-- | src/xine-engine/xine_interface.c | 47 |
1 files changed, 40 insertions, 7 deletions
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: |