[Mplayer-cvslog] CVS: main/libvo vosub_vidix.c,1.14,1.15
Alex Beregszaszi
alex at mplayer.dev.hu
Sat Jan 19 23:42:10 CET 2002
Update of /cvsroot/mplayer/main/libvo
In directory mplayer:/var/tmp.root/cvs-serv21746
Modified Files:
vosub_vidix.c
Log Message:
clearing safely the buffer, queryfourcc returns 0x2 (hw accel, noconv.), setting eq only if drivers i able
Index: vosub_vidix.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vosub_vidix.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- vosub_vidix.c 19 Jan 2002 16:58:33 -0000 1.14
+++ vosub_vidix.c 19 Jan 2002 22:42:08 -0000 1.15
@@ -41,10 +41,6 @@
static vidix_playback_t vidix_play;
static vidix_fourcc_t vidix_fourcc;
-#define PIXEL_SIZE() ((video_mode_info.BitsPerPixel+7)/8)
-#define SCREEN_LINE_SIZE(pixel_size) (video_mode_info.XResolution*(pixel_size) )
-#define IMAGE_LINE_SIZE(pixel_size) (image_width*(pixel_size))
-
int vidix_preinit(const char *drvname,void *server)
{
int err;
@@ -130,6 +126,8 @@
vidix_play.fourcc = format;
vidix_play.capability = vidix_cap.flags; /* every ;) */
vidix_play.blend_factor = 0; /* for now */
+ /* display the full picture.
+ Nick: we could implement here zooming to a specified area -- alex */
vidix_play.src.x = vidix_play.src.y = 0;
vidix_play.src.w = src_width;
vidix_play.src.h = src_height;
@@ -144,14 +142,17 @@
return -1;
}
+ vidix_mem = vidix_play.dga_addr;
+
+ /* select first frame */
next_frame = 0;
- if(vo_doublebuffering)
- vdlPlaybackFrameSelect(vidix_handler,next_frame);
- vidix_mem =vidix_play.dga_addr;
-
- /*clear the buffer*/
- memset(vidix_mem + vidix_play.offsets[0],0x80,vidix_play.frame_size*vidix_play.num_frames);
- return 0;
+// vdlPlaybackFrameSelect(vidix_handler,next_frame);
+
+ /* clear every frame with correct address and frame_size */
+ for (i = 0; i < vidix_play.num_frames; i++)
+ memset(vidix_mem + vidix_play.offsets[i], 0x80,
+ vidix_play.frame_size);
+ return 0;
}
extern int vo_gamma_brightness;
@@ -167,10 +168,17 @@
int vidix_start(void)
{
int err;
+ if((err=vdlPlaybackOn(vidix_handler))!=0)
+ {
+ printf("vosub_vidix: Can't start playback: %s\n",strerror(err));
+ return -1;
+ }
- if(verbose > 1)
+ if (vidix_cap.flags & FLAG_EQUALIZER)
{
- printf("vosub_vidix: vo_gamma_brightness=%i\n"
+ if(verbose > 1)
+ {
+ printf("vosub_vidix: vo_gamma_brightness=%i\n"
"vosub_vidix: vo_gamma_saturation=%i\n"
"vosub_vidix: vo_gamma_contrast=%i\n"
"vosub_vidix: vo_gamma_hue=%i\n"
@@ -184,22 +192,17 @@
,vo_gamma_red_intense
,vo_gamma_green_intense
,vo_gamma_blue_intense);
+ }
+ vid_eq.brightness = vo_gamma_brightness;
+ vid_eq.saturation = vo_gamma_saturation;
+ vid_eq.contrast = vo_gamma_contrast;
+ vid_eq.hue = vo_gamma_hue;
+ vid_eq.red_intense = vo_gamma_red_intense;
+ vid_eq.green_intense = vo_gamma_green_intense;
+ vid_eq.blue_intense = vo_gamma_blue_intense;
+ vid_eq.flags = VEQ_FLG_ITU_R_BT_601;
+ vdlPlaybackSetEq(vidix_handler,&vid_eq);
}
- if((err=vdlPlaybackOn(vidix_handler))!=0)
- {
- printf("vosub_vidix: Can't start playback: %s\n",strerror(err));
- return -1;
- }
-
- vid_eq.brightness = vo_gamma_brightness;
- vid_eq.saturation = vo_gamma_saturation;
- vid_eq.contrast = vo_gamma_contrast;
- vid_eq.hue = vo_gamma_hue;
- vid_eq.red_intense = vo_gamma_red_intense;
- vid_eq.green_intense = vo_gamma_green_intense;
- vid_eq.blue_intense = vo_gamma_blue_intense;
- vid_eq.flags = VEQ_FLG_ITU_R_BT_601;
- vdlPlaybackSetEq(vidix_handler,&vid_eq);
return 0;
}
@@ -229,7 +232,7 @@
int i;
apitch = vidix_play.dest.pitch.y-1;
bespitch = (w + apitch) & ~apitch;
-
+
dest = vidix_mem + vidix_play.offsets[next_frame] + vidix_play.offset.y;
dest += bespitch*y + x;
src = image[0];
@@ -371,12 +374,14 @@
if(verbose > 1) printf("vosub_vidix: query_format was called: %x (%s)\n",format,vo_format_name(format));
vidix_fourcc.fourcc = format;
vdlQueryFourcc(vidix_handler,&vidix_fourcc);
- return vidix_fourcc.depth != VID_DEPTH_NONE;
+ if (vidix_fourcc.depth == VID_DEPTH_NONE)
+ return(0);
+ return(0x2); /* hw support without conversion */
}
int vidix_grkey_support(void)
{
- return (vidix_fourcc.flags & VID_CAP_COLORKEY);
+ return(vidix_fourcc.flags & VID_CAP_COLORKEY);
}
int vidix_grkey_get(vidix_grkey_t *gr_key)
More information about the MPlayer-cvslog
mailing list