Mercurial > mplayer.hg
comparison libvo/vo_sdl.c @ 5313:0b7229832d2a
Two fixes:
- Planar formats don't use draw_frame. Code dealing with that has been removed.
- Calculate y_screen_bottom correctly
author | ksorim |
---|---|
date | Sun, 24 Mar 2002 18:42:27 +0000 |
parents | 6280f4ac324f |
children | 29b5e5facb53 |
comparison
equal
deleted
inserted
replaced
5312:211c0f1ec065 | 5313:0b7229832d2a |
---|---|
919 surfheight = priv->height + (priv->surface->h - priv->dstheight) / v_scale; | 919 surfheight = priv->height + (priv->surface->h - priv->dstheight) / v_scale; |
920 | 920 |
921 /* Place the image in the middle of the screen */ | 921 /* Place the image in the middle of the screen */ |
922 priv->y = (surfheight - priv->height) / 2; | 922 priv->y = (surfheight - priv->height) / 2; |
923 priv->y_screen_top = priv->y * v_scale; | 923 priv->y_screen_top = priv->y * v_scale; |
924 priv->y_screen_bottom = (priv->y + priv->dstheight) * v_scale; | 924 priv->y_screen_bottom = priv->y_screen_top + priv->dstheight; |
925 | 925 |
926 priv->dirty_off_frame[0].x = -1; | 926 priv->dirty_off_frame[0].x = -1; |
927 priv->dirty_off_frame[0].y = -1; | 927 priv->dirty_off_frame[0].y = -1; |
928 priv->dirty_off_frame[1].x = -1; | 928 priv->dirty_off_frame[1].x = -1; |
929 priv->dirty_off_frame[1].y = -1; | 929 priv->dirty_off_frame[1].y = -1; |
1031 struct sdl_priv_s *priv = &sdl_priv; | 1031 struct sdl_priv_s *priv = &sdl_priv; |
1032 uint8_t *dst; | 1032 uint8_t *dst; |
1033 int i; | 1033 int i; |
1034 uint8_t *mysrc = src[0]; | 1034 uint8_t *mysrc = src[0]; |
1035 | 1035 |
1036 switch(priv->format){ | 1036 switch(priv->format){ |
1037 case IMGFMT_YV12: | |
1038 case IMGFMT_I420: | |
1039 case IMGFMT_IYUV: | |
1040 SDL_OVR_LOCK(-1) | |
1041 | |
1042 dst = priv->overlay->pixels[0] + priv->y*priv->overlay->pitches[0]; | |
1043 memcpy(dst, src[0], priv->overlay->pitches[0]*priv->overlay->h); | |
1044 dst = priv->overlay->pixels[1] + priv->y*priv->overlay->pitches[1]/2; | |
1045 memcpy(dst, src[1], priv->overlay->pitches[1]*priv->overlay->h/2); | |
1046 dst = priv->overlay->pixels[2] + priv->y*priv->overlay->pitches[2]/2; | |
1047 memcpy(dst, src[2], priv->overlay->pitches[2]*priv->overlay->h/2); | |
1048 | |
1049 SDL_OVR_UNLOCK | |
1050 break; | |
1051 | |
1052 case IMGFMT_YUY2: | 1037 case IMGFMT_YUY2: |
1053 case IMGFMT_UYVY: | 1038 case IMGFMT_UYVY: |
1054 case IMGFMT_YVYU: | 1039 case IMGFMT_YVYU: |
1055 SDL_OVR_LOCK(-1) | 1040 SDL_OVR_LOCK(-1) |
1056 dst = (uint8_t *) *(priv->overlay->pixels) + priv->overlay->pitches[0]*priv->y; | 1041 dst = (uint8_t *) *(priv->overlay->pixels) + priv->overlay->pitches[0]*priv->y; |