ofxHAPAVPlayer .bind() texture


#1

I am using the ofxHAPAVPlayer add-on to play HAP encoded videos.
It has the normal drawSubsection which works great.

I was now hoping to use texture.bind() but it seems to only pick a single pixels, since the resulting image is nothing like the original.

When using ofImage or the regular ofVideoPlayer the binding works as excepted.

   ofxHAPAVPlayer video;
makePieceOfPie(videoH,displayH);
video.getTexture().bind();
maskMesh.draw();
video.getTexture().![25%20PM|653x500](upload://pJbaAFrUy5aS3JxJ4RARfX9FNk7.jpeg) unbind();
 void makePieceOfPie(int img_h, int display_h){
        int innerRadius = 0;
        int outerRadius = display_h;
        int half = img_h / 2;
        int num_slices = 300;
        
        if(myID == 0){
//            ofLog()<<"half "<<half;
        }
        maskMesh.clear();
        
        for(int i = 0; i <= num_slices; i++){
            float pct = i /(float)num_slices;
            float angle = ofMap(ofGetMouseX(),0,ofGetWidth(),0,TWO_PI,true)* pct;
            float s = sin(angle);
            float c = cos(angle);

            maskMesh.addVertex( ofVec3f(s*innerRadius, c*innerRadius));
            maskMesh.addColor(ofColor(255,255,255,255));
            maskMesh.addTexCoord(ofVec3f(half,half));
            
            maskMesh.addVertex( ofVec3f(s*outerRadius, c*outerRadius));
            maskMesh.addColor(ofColor(255,255,255,255));
            maskMesh.addTexCoord(ofVec3f(half+s*half, half+c*half));
        }
    }

here you see te drawSubsection as a rectangle and the mesh masking with texture bind() as a semi-circle. The semi-circle should also show a proper part of the video.


#2

maskMesh.addTexCoord() needed to be between 0 and 1; i.e normalized values