Skip to content

Commit

Permalink
[eServiceDVD]
Browse files Browse the repository at this point in the history
* remove old DDVD_SUPPORTS_GET_BLIT_DESTINATION
* add sVideoInfo
  • Loading branch information
jbleyel committed Jan 14, 2025
1 parent e8ce36e commit 0c6975b
Showing 1 changed file with 19 additions and 8 deletions.
27 changes: 19 additions & 8 deletions lib/service/servicedvd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -281,13 +281,11 @@ void eServiceDVD::gotMessage(int /*what*/)

int x_offset = 0, y_offset = 0, width = 720, height = 576;

#ifdef DDVD_SUPPORTS_GET_BLIT_DESTINATION
ddvd_get_blit_destination(m_ddvdconfig, &x_offset, &y_offset, &width, &height);
eDebug("[eServiceDVD] DVD_SCREEN_UPDATE: values got from ddvd: %d %d %d %d", x_offset, y_offset, width, height);
y_offset = -y_offset;
width -= x_offset * 2;
height -= y_offset * 2;
#endif
eRect dest(x_offset, y_offset, width, height);

if (dest.width() && dest.height())
Expand Down Expand Up @@ -702,8 +700,26 @@ std::string eServiceDVD::getInfoString(int w)
case sServiceref:
eDebug("[eServiceDVD] getInfoString ServiceRef %s", m_ref.toString().c_str());
return m_ref.toString();
case sVideoInfo:
{
#ifdef DDVD_SUPPORTS_PICTURE_INFO
std::string videoInfo;
char buff[100];
snprintf(buff, sizeof(buff), "%d|%d|%d|%d|%d|1",
m_width,
m_height,
m_framerate,
m_progressive,
m_aspect
);
videoInfo = buff;
return videoInfo;
#else
return std::string("720|576|50|1|0|1");
#endif
}
default:
eDebug("[eServiceDVD] getInfoString %d unsupported", w);
eTrace("[eServiceDVD] getInfoString %d unsupported", w);
}
return "";
}
Expand Down Expand Up @@ -796,12 +812,7 @@ RESULT eServiceDVD::enableSubtitles(iSubtitleUser *user, SubtitleTrack &track)
if (!m_pixmap)
{
m_pixmap = new gPixmap(size, 32, 1); /* allocate accel surface (if possible) */
#ifdef DDVD_SUPPORTS_GET_BLIT_DESTINATION
ddvd_set_lfb_ex(m_ddvdconfig, (unsigned char *)m_pixmap->surface->data, size.width(), size.height(), 4, size.width()*4, 1);
#else
ddvd_set_lfb(m_ddvdconfig, (unsigned char *)m_pixmap->surface->data, size.width(), size.height(), 4, size.width()*4);
#warning please update libdreamdvd for fast scaling
#endif
run(); // start the thread
}

Expand Down

0 comments on commit 0c6975b

Please sign in to comment.