Browse Source

Improve indentation of `VideoSource`

master
Krisjanis Rijnieks 10 years ago
parent
commit
ffc2a54151
  1. 20
      src/Sources/VideoSource.cpp
  2. 20
      src/Sources/VideoSource.h

20
src/Sources/VideoSource.cpp

@ -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,7 +13,6 @@ namespace ofx {
omxPlayer = NULL;
#else
videoPlayer = NULL;
#endif
}
@ -22,22 +20,18 @@ namespace ofx {
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,8 +56,6 @@ namespace ofx {
delete videoPlayer;
videoPlayer = NULL;
#endif
//path = "";
//name = "";
loaded = false;
}
@ -74,5 +66,5 @@ namespace ofx {
}
}
#endif
}
}
} // namespace piMapper
} // namespace ofx

20
src/Sources/VideoSource.h

@ -2,23 +2,8 @@
#include "ofMain.h"
#include "BaseSource.h"
#ifdef TARGET_RASPBERRY_PI
/*
Notice that if you get an error like this:
fatal error: libavcodec/opt.h: No such file or directory
Create a file opt.h in addons/ofxOMXPlayer/libs/ffmpeg/libavcodec/
with the following contents:
#ifndef AVCODEC_OPT_H
#define AVCODEC_OPT_H
#include "libavcodec/version.h"
#if FF_API_OPT_H
#include "libavutil/opt.h"
#endif
#endif // AVCODEC_OPT_H
More here: https://github.com/jvcleave/ofxOMXPlayer/issues/34
*/
#ifdef TARGET_RASPBERRY_PI
#include "ofxOMXPlayer.h"
#endif
@ -33,14 +18,17 @@ namespace ofx {
VideoSource();
~VideoSource();
std::string & getPath();
void loadVideo(std::string & path);
void clear();
#ifndef TARGET_RASPBERRY_PI
void update(ofEventArgs & args);
#endif
private:
#ifdef TARGET_RASPBERRY_PI
ofxOMXPlayer * omxPlayer; // Naming different for less confusion
#else

Loading…
Cancel
Save