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

Incorrect format when used with ofVideoPlayer #10

Open
prisonerjohn opened this issue Aug 29, 2016 · 7 comments
Open

Incorrect format when used with ofVideoPlayer #10

prisonerjohn opened this issue Aug 29, 2016 · 7 comments

Comments

@prisonerjohn
Copy link
Contributor

I'm trying to use the ofxDSHapVidePlayer inside ofVideoPlayer:

shared_ptr<ofxDSHapVideoPlayer> hapPlayer = make_shared<ofxDSHapVideoPlayer>();
videoPlayer.setPlayer(hapPlayer);
videoPlayer.load("sample-1080p30-Hap.avi");

It's running but interpreting the format wrong:
capture-hap

@mantissa
Copy link
Contributor

hey prisonerjohn-just confirmed the issue over here and am looking into it

@mantissa
Copy link
Contributor

mantissa commented Aug 31, 2016

using a shared_ptr to ofxDSHapVideoPlayer, ofVideoPlayer both overwrites the HAP texture data in ofVideoPlayer::update and never calls ofxDSHapVideoPlayer::draw, which contains some critical logic.

ofVideoPlayer::update isn't a virtual function, so ofxDSHapVideoPlayer::update cant override it.

unfortunately, it looks like this addon doesn't align with OF's intended architecture for extending video players. i'm happy to chat about mitigating this if you have any ideas.

@prisonerjohn
Copy link
Contributor Author

Ah I see. It would be nice to solve this if possible, I can look into it more closely and reply here if I find a suitable solution.

@mantissa
Copy link
Contributor

mantissa commented Sep 3, 2016

I spent a bit more time on this the other day. If the ofxDSHapVideoPlayer extends ofBaseVideoDraws then it can override the virtual draw() function but ofBaseVideoPlayer doesn't have a virtual update() function that can be overridden. You can cast the player pointer from getplayer() and then call update on it.

@mantissa
Copy link
Contributor

mantissa commented Sep 7, 2016

I was wrong in my last post: ofxDSHapVideoPlayer::update() will be called if ofxDSHapVideoPlayer extends ofBaseVideoDraws, but due to the way ofVideoPlayer is structured, ofxDSHapVideoPlayer::draw() will never be called. This is critical if ofxDSHapVideoPlayer is playing a DXT5 encoded file. Let me know if you can think of any other workarounds.

@indefinit
Copy link

indefinit commented Aug 7, 2017

@mantissa Just curious if this issue was ever resolved? found myself bumping into this issue because I was creating a vector of shared_ptr<ofxDSHapVideoPlayer> and I need a reliable way to call update on each of the players.

When I switch from a vector of shared pointers to a vector<ofxDSHapVideoPlayer> I throw a read access exception in the updatePlayState() method in ofxDSHapVideoPlayer.cpp:

ln 919: hr = controlInterface->GetState(4000, (OAFilterState*)&fs)

Any suggestions? Thanks for your help in advance!

@LightAct
Copy link

Hi,

I am facing a very similar issue in my cinder port of this of addon. Did you ever found a way to solve this problem in OF?

Thanks!

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

No branches or pull requests

3 participants