Skip to content

Commit 20f16fe

Browse files
authored
Fix of video player path (#8150)
1 parent fd2286b commit 20f16fe

2 files changed

Lines changed: 27 additions & 1 deletion

File tree

libs/openFrameworks/types/ofBaseTypes.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,24 @@ ofBaseVideoPlayer::~ofBaseVideoPlayer(){
4747

4848
}
4949

50+
//---------------------------------------------------------------------------
51+
bool ofBaseVideoPlayer::load(const of::filesystem::path & fileName){
52+
return load(ofPathToString(fileName));
53+
}
54+
55+
//---------------------------------------------------------------------------
56+
bool ofBaseVideoPlayer::load(const std::string & fileName){
57+
ofLogError("ofBaseVideoPlayer") << " One of the two load functions need to be implemented ";
58+
return false;
59+
}
60+
61+
//---------------------------------------------------------------------------
5062
void ofBaseVideoPlayer::loadAsync(const of::filesystem::path & fileName){
63+
loadAsync(ofPathToString(fileName));
64+
}
65+
66+
//---------------------------------------------------------------------------
67+
void ofBaseVideoPlayer::loadAsync(const std::string & fileName){
5168
ofLogWarning("ofBaseVideoPlayer") << "loadAsync() not implemented, loading synchronously";
5269
load(fileName);
5370
}

libs/openFrameworks/video/ofVideoBaseTypes.h

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,13 @@ class ofBaseVideoPlayer: virtual public ofBaseVideo{
207207
/// \param name The name of the video resource to load.
208208
/// \return True if the video was loaded successfully.
209209
/// \sa loadAsync()
210+
virtual bool load(const of::filesystem::path & fileName);
211+
212+
/// \brief Legacy approach for loading videos for older inherited classes
213+
/// \param name The name of the video resource to load.
214+
/// \return True if the video was loaded successfully.
215+
virtual bool load(const std::string & fileName);
210216

211-
virtual bool load(const of::filesystem::path & fileName) = 0;
212217
/// \brief Asynchronously load a video resource by name.
213218
///
214219
/// The list of supported video types and sources (e.g. rtsp:// sources) is
@@ -220,6 +225,10 @@ class ofBaseVideoPlayer: virtual public ofBaseVideo{
220225
/// \param name The name of the video resource to load.
221226
/// \sa isLoaded()
222227
virtual void loadAsync(const of::filesystem::path & fileName);
228+
229+
/// \brief Legacy approach for Asynchronously load a video resource by name.
230+
/// \param name The name of the video resource to load.
231+
virtual void loadAsync(const std::string & fileName);
223232

224233
/// \brief Play the video from the current playhead position.
225234
///

0 commit comments

Comments
 (0)