-
Notifications
You must be signed in to change notification settings - Fork 160
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
AGS 4: non-blocking video playback #2338
AGS 4: non-blocking video playback #2338
Conversation
929aec2
to
ed35175
Compare
I know this is ugly but it was the best place I found at the time to throw the polling for audio Lines 72 to 74 in 84ab2b5
The video thread will require polling there too as we can't use threads in the Emscripten port currently. |
a537633
to
2c7fe24
Compare
The CI failure in Android just looks like it failed to download the SDL sources it uses when building it, maybe just rerunning that task should make it complete now. |
Pushed a proper Video API (still a draft though), which now looks like this:
Most of the functionality works, except Seek and few less important getters. |
Uhm, maybe add a CanSeek in the video API for now and return false? Is there a chance we sometime use a new stream class type that can't seek? |
540a1a2
to
7bc3587
Compare
Rebased, squashed commits. Made Seek return new position or error value. Seek(0) now works as a rewind so long as stream may be reused. |
3b24e7f
to
8dfeb73
Compare
8dfeb73
to
c1918ac
Compare
Rebased and redone PR after #2348. Now this PR contains much less commits. Old branch is still available here, temporarily: |
Engine/media/video/video.cpp
Outdated
frame = _player->GetReadyFrame(); | ||
auto player = video_core_get_player(_playerID); | ||
#if defined(AGS_DISABLE_THREADS) | ||
if (!_player->Poll()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a typo, it should be player->Poll()
here.
656e205
to
c26b7e9
Compare
Hmm, actually I removed the video polling inside BlockingVideoPlayer, because it's polled in WaitForNextFrame in case of "no threads" build. |
Written in compliance with "audio core".
c26b7e9
to
4b4e900
Compare
4b4e900
to
6b569f9
Compare
6b569f9
to
fea8fc3
Compare
3dcf778
to
fbbcb5a
Compare
For #2155.
This is not a complete functionality, but a draft, meant to test out the idea. Random mistakes are to be expected.
A key point is a Graphic property that returns an index of a sprite where the video renders to. This sprite may then be assigned to anything that may normally have a sprite, such as Overlay, GUI button, etc.
Basic script example may be:
TODO:
POTENTIAL OPTIMIZATIONS
OTHER THINGS: