// make sure we know the correct texture size
GetPlaneTextureSize(plane);
- CalculateTextureSourceRects(index, 1);
// Try some clamping or wrapping
glTexParameteri(m_textureTarget, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
}
else
{
- glTexCoord2f(m_rotatedDestCoords[0].x, m_rotatedDestCoords[0].y); glVertex4f(m_rotatedDestCoords[0].x, m_rotatedDestCoords[0].y, 0.0f, 0.0f);
- glTexCoord2f(m_rotatedDestCoords[1].x, m_rotatedDestCoords[1].y); glVertex4f(m_rotatedDestCoords[1].x, m_rotatedDestCoords[1].y, 1.0f, 0.0f);
- glTexCoord2f(m_rotatedDestCoords[2].x, m_rotatedDestCoords[2].y); glVertex4f(m_rotatedDestCoords[2].x, m_rotatedDestCoords[2].y, 1.0f, 1.0f);
- glTexCoord2f(m_rotatedDestCoords[3].x, m_rotatedDestCoords[3].y); glVertex4f(m_rotatedDestCoords[3].x, m_rotatedDestCoords[3].y, 0.0f, 1.0f);
+ glTexCoord2f(plane.rect.x1, plane.rect.y1); glVertex4f(m_rotatedDestCoords[0].x, m_rotatedDestCoords[0].y, 0.0f, 0.0f);
+ glTexCoord2f(plane.rect.x2, plane.rect.y1); glVertex4f(m_rotatedDestCoords[1].x, m_rotatedDestCoords[1].y, 1.0f, 0.0f);
+ glTexCoord2f(plane.rect.x2, plane.rect.y2); glVertex4f(m_rotatedDestCoords[2].x, m_rotatedDestCoords[2].y, 1.0f, 1.0f);
+ glTexCoord2f(plane.rect.x1, plane.rect.y2); glVertex4f(m_rotatedDestCoords[3].x, m_rotatedDestCoords[3].y, 0.0f, 1.0f);
}
glEnd();
VerifyGLState();
plane.id = vdpau->texture[0];
+ // in stereoscopic mode sourceRect may only
+ // be a part of the source video surface
plane.rect = m_sourceRect;
- plane.width = im.width;
- plane.height = im.height;
- plane.height /= plane.pixpertex_y;
- plane.rect.y1 /= plane.pixpertex_y;
- plane.rect.y2 /= plane.pixpertex_y;
- plane.width /= plane.pixpertex_x;
- plane.rect.x1 /= plane.pixpertex_x;
- plane.rect.x2 /= plane.pixpertex_x;
+ // clip rect
+ if (vdpau->crop.x1 > plane.rect.x1)
+ plane.rect.x1 = vdpau->crop.x1;
+ if (vdpau->crop.x2 < plane.rect.x2)
+ plane.rect.x2 = vdpau->crop.x2;
+ if (vdpau->crop.y1 > plane.rect.y1)
+ plane.rect.y1 = vdpau->crop.y1;
+ if (vdpau->crop.y2 < plane.rect.y2)
+ plane.rect.y2 = vdpau->crop.y2;
+
+ plane.texheight = vdpau->texHeight;
+ plane.texwidth = vdpau->texWidth;
if (m_textureTarget == GL_TEXTURE_2D)
{
- plane.height /= plane.texheight;
plane.rect.y1 /= plane.texheight;
plane.rect.y2 /= plane.texheight;
- plane.width /= plane.texwidth;
plane.rect.x1 /= plane.texwidth;
plane.rect.x2 /= plane.texwidth;
}
&m_videoMixer);
CheckStatus(vdp_st, __LINE__);
- // create 3 pitches of black lines needed for clipping top
- // and bottom lines when de-interlacing
- m_BlackBar = new uint32_t[3*m_config.outWidth];
- memset(m_BlackBar, 0, 3*m_config.outWidth*sizeof(uint32_t));
-
}
void CMixer::InitCSCMatrix(int Width)
m_Sharpness = 0.0;
m_DeintMode = 0;
m_Deint = 0;
+ m_Upscale = 0;
+ m_SeenInterlaceFlag = false;
m_ColorMatrix = 0;
m_PostProc = false;
m_vdpError = false;
m_outputSurfaces.pop();
}
m_config.context->GetProcs().vdp_video_mixer_destroy(m_videoMixer);
-
- delete [] m_BlackBar;
}
void CMixer::Flush()
EDEINTERLACEMODE mode = CMediaSettings::Get().GetCurrentVideoSettings().m_DeinterlaceMode;
EINTERLACEMETHOD method = GetDeinterlacingMethod();
bool interlaced = m_mixerInput[1].DVDPic.iFlags & DVP_FLAG_INTERLACED;
+ m_SeenInterlaceFlag |= interlaced;
// TODO
if (//!(flags & DVP_FLAG_NO_POSTPROC) &&
m_processPicture.outputSurface = m_outputSurfaces.front();
m_mixerInput[1].DVDPic.iWidth = m_config.outWidth;
m_mixerInput[1].DVDPic.iHeight = m_config.outHeight;
+ if (m_SeenInterlaceFlag)
+ {
+ double ratio = (double)m_mixerInput[1].DVDPic.iDisplayHeight / m_mixerInput[1].DVDPic.iHeight;
+ m_mixerInput[1].DVDPic.iHeight -= 6;
+ m_mixerInput[1].DVDPic.iDisplayHeight = lrint(ratio*m_mixerInput[1].DVDPic.iHeight);
+ }
}
else
{
0,
NULL);
CheckStatus(vdp_st, __LINE__);
-
- if (m_mixerfield != VDP_VIDEO_MIXER_PICTURE_STRUCTURE_FRAME)
- {
- // in order to clip top and bottom lines when de-interlacing
- // we black those lines as a work around for not working
- // background colour using the mixer
- // pixel perfect is preferred over overscanning or zooming
-
- VdpRect clipRect = destRect;
- clipRect.y1 = clipRect.y0 + 2;
- uint32_t *data[] = {m_BlackBar};
- uint32_t pitches[] = {destRect.x1};
- vdp_st = m_config.context->GetProcs().vdp_output_surface_put_bits_native(m_processPicture.outputSurface,
- (void**)data,
- pitches,
- &clipRect);
- CheckStatus(vdp_st, __LINE__);
-
- clipRect = destRect;
- clipRect.y0 = clipRect.y1 - 2;
- vdp_st = m_config.context->GetProcs().vdp_output_surface_put_bits_native(m_processPicture.outputSurface,
- (void**)data,
- pitches,
- &clipRect);
- CheckStatus(vdp_st, __LINE__);
- }
}
GLMapSurfaces();
retPic->sourceIdx = procPic.outputSurface;
retPic->texture[0] = m_bufferPool.glOutputSurfaceMap[procPic.outputSurface].texture[0];
- retPic->crop = CRect(0,0,0,0);
+ retPic->texWidth = m_config.outWidth;
+ retPic->texHeight = m_config.outHeight;
+ retPic->crop.x1 = 0;
+ retPic->crop.y1 = (m_config.outHeight - retPic->DVDPic.iHeight) / 2;
+ retPic->crop.x2 = m_config.outWidth;
+ retPic->crop.y2 = m_config.outHeight - retPic->crop.y1;
}
else
{