Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added scaled video output for VA-API. #4

Merged
merged 1 commit into from
Mar 2, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 35 additions & 2 deletions video.c
Original file line number Diff line number Diff line change
Expand Up @@ -6419,6 +6419,26 @@ static void VaapiSetVideoMode(void)
}
}

///
/// Set VA-API video output position.
///
/// @param decoder VA-API decoder
/// @param x video output x coordinate inside the window
/// @param y video output y coordinate inside the window
/// @param width video output width
/// @param height video output height
///
static void VaapiSetOutputPosition(VaapiDecoder * decoder, int x, int y,
int width, int height)
{
Debug(3, "video/vaapi: output %dx%d%+d%+d\n", width, height, x, y);

decoder->VideoX = x;
decoder->VideoY = y;
decoder->VideoWidth = width;
decoder->VideoHeight = height;
}

#ifdef USE_VIDEO_THREAD

///
Expand Down Expand Up @@ -12141,8 +12161,21 @@ void VideoSetOutputPosition(VideoHwDecoder * hw_decoder, int x, int y,
}
#endif
#ifdef USE_VAAPI
// FIXME: not supported by vaapi without unscaled OSD,
// FIXME: if used to position video inside osd
if (VideoUsedModule == &VaapiModule) {
// check values to be able to avoid
// interfering with the video thread if possible

if (x == hw_decoder->Vaapi.VideoX && y == hw_decoder->Vaapi.VideoY
&& width == hw_decoder->Vaapi.VideoWidth
&& height == hw_decoder->Vaapi.VideoHeight) {
// not necessary...
return;
}
VideoThreadLock();
VaapiSetOutputPosition(&hw_decoder->Vaapi, x, y, width, height);
VaapiUpdateOutput(&hw_decoder->Vaapi);
VideoThreadUnlock();
}
#endif
(void)hw_decoder;
}
Expand Down