|
52 | 52 | }
|
53 | 53 |
|
54 | 54 | //--------------------------------------------------------------
|
55 |
| -void ofAVFoundationPlayer::loadAsync(std::string name){ |
56 |
| - loadPlayer(name, true); |
| 55 | +void ofAVFoundationPlayer::loadAsync(const of::filesystem::path & fileName){ |
| 56 | + loadPlayer(fileName, true); |
57 | 57 | }
|
58 | 58 |
|
59 | 59 | //--------------------------------------------------------------
|
60 |
| -bool ofAVFoundationPlayer::load(std::string name) { |
61 |
| - return loadPlayer(name, false); |
| 60 | +bool ofAVFoundationPlayer::load(const of::filesystem::path & fileName) { |
| 61 | + return loadPlayer(fileName, false); |
62 | 62 | }
|
63 | 63 |
|
64 | 64 | //--------------------------------------------------------------
|
65 |
| -// FIXME: fs::path |
66 |
| -bool ofAVFoundationPlayer::loadPlayer(std::string name, bool bAsync) { |
| 65 | +bool ofAVFoundationPlayer::loadPlayer(const of::filesystem::path & fileName, bool bAsync) { |
67 | 66 | if( ofGetUsingArbTex() == false ){
|
68 | 67 | killTextureCache();
|
69 | 68 | bUseTextureCache = false;
|
70 | 69 | }
|
71 | 70 |
|
72 |
| - NSString * videoPath = [NSString stringWithUTF8String:name.c_str()]; |
73 |
| - NSString * videoLocalPath = [NSString stringWithUTF8String:ofToDataPath(name).c_str()]; |
| 71 | + NSString * videoPath = [NSString stringWithUTF8String:fileName.c_str()]; |
| 72 | + NSString * videoLocalPath = [NSString stringWithUTF8String:ofToDataPath(fileName).c_str()]; |
74 | 73 |
|
75 | 74 | BOOL bStream = NO;
|
76 | 75 |
|
77 |
| - bStream = bStream || (ofIsStringInString(name, "http://")); |
78 |
| - bStream = bStream || (ofIsStringInString(name, "https://")); |
79 |
| - bStream = bStream || (ofIsStringInString(name, "rtsp://")); |
| 76 | + std::string fileNameStr { ofPathToString(fileName) }; |
| 77 | + bStream = bStream || (ofIsStringInString(fileNameStr, "http://")); |
| 78 | + bStream = bStream || (ofIsStringInString(fileNameStr, "https://")); |
| 79 | + bStream = bStream || (ofIsStringInString(fileNameStr, "rtsp://")); |
80 | 80 |
|
81 | 81 | NSURL * url = nil;
|
82 | 82 | if(bStream == YES) {
|
|
762 | 762 | #endif
|
763 | 763 |
|
764 | 764 | //-------------------------------------------------------------- DEPRECATED.
|
765 |
| -bool ofAVFoundationPlayer::loadMovie(std::string name) { |
766 |
| - return load(name); |
| 765 | +bool ofAVFoundationPlayer::loadMovie(const of::filesystem::path & fileName) { |
| 766 | + return load(fileName); |
767 | 767 | }
|
768 | 768 |
|
769 | 769 | ofPixels & ofAVFoundationPlayer::getPixelsRef() {
|
|
0 commit comments