diff options
| author | tim <tim@eclectronics.org> | 2018-04-16 21:04:05 +0100 |
|---|---|---|
| committer | tim <tim@eclectronics.org> | 2018-04-16 21:04:05 +0100 |
| commit | d085782d6192d9c8498e2c5489097fff4db6815b (patch) | |
| tree | 60851506743ed50b5d69483109c6479daabf5c77 | |
| parent | 7c080ed914ad1291bc07cd8b6ce58e5093b14203 (diff) | |
OMX fixes
| -rw-r--r-- | menuApp/addons.make | 1 | ||||
| -rw-r--r-- | menuApp/src/dirscanner.cpp | 33 | ||||
| -rw-r--r-- | menuApp/src/dirscanner.h | 7 |
3 files changed, 33 insertions, 8 deletions
diff --git a/menuApp/addons.make b/menuApp/addons.make index b771d86..cb0f7f4 100644 --- a/menuApp/addons.make +++ b/menuApp/addons.make @@ -1,4 +1,5 @@ ofxInstagram ofxJSON ofxThreadedImageLoader +ofxOMXPlayer diff --git a/menuApp/src/dirscanner.cpp b/menuApp/src/dirscanner.cpp index 5ba830b..5a8b91b 100644 --- a/menuApp/src/dirscanner.cpp +++ b/menuApp/src/dirscanner.cpp @@ -2,9 +2,10 @@ void playItem::play(){ //ofLogNotice() << "playing----->"<<filename; - if (video.isLoaded()){ - video.setFrame(0); - video.play(); + if (video.getIsOpen()){ + //video.setFrame(0); + //video.play(); + video.restartMovie(); //ofLogNotice() << "video: "<<filename; } if (image.isAllocated()){ @@ -24,14 +25,30 @@ bool playItem::load(string _filename){ } } if (ext=="mp4"||ext=="mov"){ + /* if (video.load(filename)){ video.setLoopState(OF_LOOP_NONE); ofLogNotice() << "loaded clip: "<<filename; loaded=2; } - } + */ + string videoPath1 = ofToDataPath(_filename, true); + videosettings.videoPath = videoPath1; + videosettings.useHDMIForAudio = true; //default true + videosettings.enableTexture = true; //default true + videosettings.enableLooping = true; //default true + videosettings.enableAudio = false; //default true, save resources by disabling + + if (video.setup(videosettings)){ + //video.setLoopState(OF_LOOP_NONE); + ofLogNotice() << "loaded clip: "<<filename; + loaded=2; + } + return loaded>0; + } } + void playItem::draw(){ if (image.isAllocated()){ @@ -44,11 +61,13 @@ void playItem::draw(){ isFinished=true; } } - if (video.isLoaded()){ - video.update(); + //if (video.isLoaded()){ + //video.update(); + if (video.getIsOpen()){ video.draw(0,0,1080*FACTOR,1920*FACTOR); //ofLogNotice() << "position: "<<video.getPosition(); - if (video.getIsMovieDone()){ + //if (video.getIsMovieDone()){ + if (!video.isPlaying()){ isFinished=true; } } diff --git a/menuApp/src/dirscanner.h b/menuApp/src/dirscanner.h index 4512842..f6351e5 100644 --- a/menuApp/src/dirscanner.h +++ b/menuApp/src/dirscanner.h @@ -1,6 +1,7 @@ #pragma once #include "ofMain.h" +#include "ofxOMXPlayer.h" class timeSlot { public: @@ -26,7 +27,11 @@ class playItem { } string filename; ofImage image; - ofVideoPlayer video; + //ofVideoPlayer video; + + ofxOMXPlayer video; + ofxOMXPlayerSettings videosettings; + int loaded; //0- none, 1- image, 2- mov bool load(string filename); void play(); |
