-
Notifications
You must be signed in to change notification settings - Fork 80
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
WebM Movie Player (VP9/Opus) #458
Conversation
- Fixes stretched cursor during movie playback.
…layer all to milliseconds. Fix assertion when end of movie is reached
// TODO: Figure out video and audio based on current language | ||
// For now... just take the first one. | ||
const mkvparser::Tracks* tracks = fSegment->GetTracks(); | ||
for (uint32_t i = 0; i < tracks->GetTracksCount(); ++i) |
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.
Just so I can make sure I understand this: This will use the first audio and video tracks, UNLESS a later one happens to match the current language?
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.
Correct.
VPX() { } | ||
|
||
public: | ||
#ifdef VIDEO_AVAILABLE |
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.
Should this ifdef be one line higher? Currently you'd end up with the following if VIDEO_AVAILABLE were not defined:
class VPX
{
VPX() { }
public:
}
Moved that ifdef. Also, the last libwebm release is over a year old, so I took the latest files from master and updated the TrackMgr to respect the CodecDelay (libwebm supports that now, see mkv specs). This means that our track synchronization should be a few ms more exact, now. The specific change is a one-liner squashed into 2d990ae. |
Includes some reorganization and cleanup
*sigh* This happens when you copy the formula from somewhere else... Let's do it correctly now and fix the source in plVoiceChat as well.
Also: Do not start the video again if it is already playing. Update files from libwebm
Also, do not show the plate before there is anything on it.
Scale plate using pixels and limit it to viewport size
As I mentioned in the IRC, it looks like URU sometimes doesn't like it if we decode our audio frames on-demand. I added a new commit that changes it to preload them when we start the video. I haven't experienced any noticeable delay with this change and it fixes old record player like crackling problems in release mode. |
if (!(mov->GetCmd() & plMovieMsg::kMake)) | ||
{ | ||
for (i = 0; i < fMovies.GetCount(); i++) | ||
for (i = 0; i < fMovies.size(); i++) |
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.
It would be super awesome if this were a range-based for instead
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.
Uhm... i is used outside the loop, so I didn't touch it.
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.
Hmm... crazy code. This can be addressed later.
if (fPlate) | ||
fPlate->SetVisible(false); | ||
|
||
for (int i = 0; i < fCallbacks.size(); i++) |
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.
range based for?
I know I wrote the original code here, and it's probably awful that I'm going to say this, but I've since changed my mind about how our code formatting should look. It would be really awesome if we could get this to use the same style as DirtSand. My newer additions, such as pfPatcher sort of do this. The most relevant change here is that class and method definitions have a newline before the opening braces, but loops and conditional statements do not. Also, I believe congratulations are in order for getting this to work! |
Heh, I definitely agree. The Plasma code style is really annoying. In fact, when writing on this I sometimes had to fight with my VS editor, because it didn't like how I wrote. Neither did I. If you say that it's time for a revolution, I'm going to jump right into the front lines. |
It can be hard to decide how to write any given thing, since there's no consistent style through the entire codebase (which given its size and the length of time it was worked on, isn't surprising), or sometimes even in within the same project. So, is it finally time to merge this: 8590ba4? |
Updated. One commit addresses what you pointed out, the other one changes the code style. |
Tested it and seems to work fine. |
👍 |
and reenable as much USE_BINK_SDK stuff as empirically needed to get the Yeesha intro movie cave to disappear on its own, as before merging Cyan's Build 918. Not the cleanest way, but I'm trying to minimize effort spent on this until we can get the proper solution, VP9 video support, from H-uru/Plasma#458 . --HG-- branch : bink-stub-2
Fix stuck-in-intro-cave bug This reintroduces the plBinkPlayer stub removed in 8a1346b in order to fix the bug where a new player is stuck in the intro cave with the rotating wall until it occurs to them to press the esc key. I have not spent much effort on checking that this is the correct and minimal change but it appears to work for me. This is a quick fix, the definitive solution will be to port VP9/Opus support from H-uru/Plasma#458.
Now, this is what I call a collaboration.
This, finally, implements our movie player. It can play webm containers that include vp9 video and opus audio. As a bonus, it supports multiple tracks and tries to select the track that matches the game language, if possible.