I’m experiencing a problem with this addon… It seems to work fine, unless I try to put instances of ofxDSHapVideoPlayer into an std::vector. In the below code, the active code does not work, but the commented-out code does.
ofApp.h
class ofApp : public ofBaseApp{
public:
//...generic oF stuff
std::vector<ofxDSHapVideoPlayer> m_videos;
ofxDSHapVideoPlayer m_noVecVid1;
ofxDSHapVideoPlayer m_noVecVid2;
};
ofApp.cpp
#include "ofApp.h"
//--------------------------------------------------------------
void ofApp::setup(){
ofxDSHapVideoPlayer video;
m_videos.push_back(video);
m_videos[0].load("D:\\momPhone\\hapAvi\\video\\IMG_0144.avi");
m_videos[0].play();
ofxDSHapVideoPlayer video2;
m_videos.push_back(video2);
m_videos[1].load("D:\\momPhone\\hapAvi\\video\\IMG_0145.avi");
m_videos[1].play();
// m_noVecVid1.load("D:\\video1.avi");
// m_noVecVid1.play();
//
// m_noVecVid2.load("D:\\video2.avi");
// m_noVecVid2.play();
}
//--------------------------------------------------------------
void ofApp::update(){
m_videos[0].update();
m_videos[1].update();
//m_noVecVid1.update();
//m_noVecVid2.update();
}
//--------------------------------------------------------------
void ofApp::draw(){
m_videos[0].draw(0, 0, 800, 600);
m_videos[1].draw(800, 0, 800, 600);
//m_noVecVid1.draw(0, 0, 800, 800);
//m_noVecVid2.draw(800, 0, 800, 600);
}
For the code that doesn’t work, only the 2nd video is played, and when I close the window, an exception is thrown for for the exception
is_block_type_valid(header-> _block_use)
Also, not sure if it’s relevant, but there are openGL warnings in the output console, though I think these are always there:
[warning] ofShader: GL_FRAGMENT_SHADER, offending line 1 :
1 uniform sampler2D cocgsy_src; const vec4 offsets = vec4(-0.50196078431373, -0.50196078431373, 0.0, 0.0); void main() { vec4 CoCgSY = texture2D(cocgsy_src, gl_TexCoord[0].xy); CoCgSY += offsets; float scale = ( CoCgSY.z * ( 255.0 / 8.0 ) ) + 1.0; float Co = CoCgSY.x / scale; float Cg = CoCgSY.y / scale; float Y = CoCgSY.w; vec4 rgba = vec4(Y + Co - Cg, Y + Cg, Y - Co - Cg, 1.0); gl_FragColor = rgba; }