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

WebM Movie Player (VP9/Opus) #458

Merged
merged 16 commits into from
Dec 26, 2014
Merged

WebM Movie Player (VP9/Opus) #458

merged 16 commits into from
Dec 26, 2014

Conversation

Mystler
Copy link
Contributor

@Mystler Mystler commented Oct 29, 2014

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.

// 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)
Copy link
Member

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?

Copy link
Contributor Author

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
Copy link
Member

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:
}

@Mystler
Copy link
Contributor Author

Mystler commented Oct 30, 2014

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
@Mystler
Copy link
Contributor Author

Mystler commented Oct 31, 2014

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++)
Copy link
Member

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

Copy link
Contributor Author

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.

Copy link
Member

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++)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

range based for?

@Hoikas
Copy link
Member

Hoikas commented Nov 1, 2014

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!

@Mystler
Copy link
Contributor Author

Mystler commented Nov 1, 2014

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.

@Deledrius
Copy link
Member

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?

@Mystler
Copy link
Contributor Author

Mystler commented Nov 1, 2014

Updated. One commit addresses what you pointed out, the other one changes the code style.

@Lunanne
Copy link
Member

Lunanne commented Nov 26, 2014

Tested it and seems to work fine.
The only issue I found is that when you pres the escape key more than once to exit the intro video (because you're impatient and there is a slight delay) you can get the help gui to show up more than once. You can just click them away so I don't think this is a huge issue. The screen did flicker for me sometimes during the intro video, but that might be on my end.

@Deledrius
Copy link
Member

👍

Hoikas added a commit that referenced this pull request Dec 26, 2014
WebM Movie Player (VP9/Opus)
@Hoikas Hoikas merged commit 990f42c into H-uru:master Dec 26, 2014
@Mystler Mystler deleted the webm branch December 26, 2014 19:49
FelixWolf pushed a commit to openuruunofficial/CWE-ou that referenced this pull request Mar 20, 2019
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
FelixWolf pushed a commit to openuruunofficial/CWE-ou that referenced this pull request Mar 20, 2019
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants