|
|
@ -6,7 +6,6 @@ namespace ofx { |
|
|
|
bool VideoSource::enableAudio = false; |
|
|
|
|
|
|
|
VideoSource::VideoSource() { |
|
|
|
//cout << "VideoSource constr" << endl;
|
|
|
|
loadable = true; |
|
|
|
loaded = false; |
|
|
|
type = SourceType::SOURCE_TYPE_VIDEO; |
|
|
@ -14,30 +13,25 @@ namespace ofx { |
|
|
|
omxPlayer = NULL; |
|
|
|
#else |
|
|
|
videoPlayer = NULL; |
|
|
|
|
|
|
|
#endif |
|
|
|
} |
|
|
|
|
|
|
|
VideoSource::~VideoSource() {} |
|
|
|
|
|
|
|
void VideoSource::loadVideo(std::string& filePath) { |
|
|
|
void VideoSource::loadVideo(std::string & filePath) { |
|
|
|
path = filePath; |
|
|
|
//cout << "loading video: " << filePath << endl;
|
|
|
|
setNameFromPath(filePath); |
|
|
|
#ifdef TARGET_RASPBERRY_PI |
|
|
|
// Do things with the OMX player
|
|
|
|
ofxOMXPlayerSettings settings; |
|
|
|
settings.videoPath = filePath; |
|
|
|
settings.useHDMIForAudio = true; //default true
|
|
|
|
settings.enableTexture = true; //default true
|
|
|
|
settings.enableLooping = true; //default true
|
|
|
|
settings.enableAudio = VideoSource::enableAudio; //default true, save resources by disabling
|
|
|
|
//settings.doFlipTexture = true; //default false
|
|
|
|
settings.useHDMIForAudio = true; |
|
|
|
settings.enableTexture = true; |
|
|
|
settings.enableLooping = true; |
|
|
|
settings.enableAudio = VideoSource::enableAudio |
|
|
|
omxPlayer = new ofxOMXPlayer(); |
|
|
|
omxPlayer->setup(settings); |
|
|
|
texture = &(omxPlayer->getTextureReference()); |
|
|
|
#else |
|
|
|
// regular ofVideoPlayer
|
|
|
|
videoPlayer = new ofVideoPlayer(); |
|
|
|
videoPlayer->loadMovie(filePath); |
|
|
|
videoPlayer->setLoopState(OF_LOOP_NORMAL); |
|
|
@ -62,17 +56,15 @@ namespace ofx { |
|
|
|
delete videoPlayer; |
|
|
|
videoPlayer = NULL; |
|
|
|
#endif |
|
|
|
//path = "";
|
|
|
|
//name = "";
|
|
|
|
loaded = false; |
|
|
|
} |
|
|
|
|
|
|
|
#ifndef TARGET_RASPBERRY_PI |
|
|
|
void VideoSource::update(ofEventArgs &args) { |
|
|
|
void VideoSource::update(ofEventArgs & args) { |
|
|
|
if (videoPlayer != NULL) { |
|
|
|
videoPlayer->update(); |
|
|
|
} |
|
|
|
} |
|
|
|
#endif |
|
|
|
} |
|
|
|
} |
|
|
|
} // namespace piMapper
|
|
|
|
} // namespace ofx
|