Skip to content

Commit 39dc184

Browse files
committed
Merge remote-tracking branch 'up/master' into android_fixes
2 parents 499a407 + 39e25cf commit 39dc184

145 files changed

Lines changed: 3115 additions & 3594 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: build-linux-arm
2+
3+
# make the action not run on the local repo if the branch is also in a pull request to OF/OF
4+
on:
5+
push:
6+
if: github.event_name == 'push' && github.event.pull_request == null
7+
paths-ignore:
8+
- '**/*.md'
9+
- 'examples/**'
10+
pull_request:
11+
if: github.event_name == 'pull_request' && github.repository == 'openframeworks/openFrameworks'
12+
paths-ignore:
13+
- '**/*.md'
14+
- 'examples/**'
15+
16+
concurrency:
17+
group: ${{ github.workflow }}-${{ github.ref }}
18+
cancel-in-progress: true
19+
20+
jobs:
21+
build-linux-platforms:
22+
runs-on: ubuntu-latest
23+
strategy:
24+
matrix:
25+
cfg:
26+
- {target: linuxarmv6l, libs: armv6l}
27+
- {target: linuxaarch64, libs: aarch64}
28+
env:
29+
TARGET: ${{matrix.cfg.target}}
30+
steps:
31+
- uses: actions/checkout@v3
32+
- name: Download libs
33+
run: ./scripts/linux/download_libs.sh -a ${{matrix.cfg.libs}};
34+
- name: Install dependencies
35+
run: ./scripts/ci/$TARGET/install.sh;
36+
- name: Build
37+
run: ./scripts/ci/$TARGET/build.sh;

.github/workflows/build-linux-nightly.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
- cron: "0 6 * * *"
66
jobs:
77
build-linux-platforms:
8-
runs-on: ubuntu-22.04
8+
runs-on: ubuntu-latest
99
if: github.repository == 'openframeworks/openFrameworks' && github.ref == 'refs/heads/master'
1010
strategy:
1111
matrix:
@@ -18,7 +18,7 @@ jobs:
1818
- name: Install libunwind
1919
run: sudo apt-get install libunwind-dev
2020
- name: Install dependencies
21-
run: sudo ./scripts/linux/ubuntu/install_dependencies.sh -y;
21+
run: ./scripts/ci/$TARGET/install.sh;
2222
- name: Download libs
2323
run: ./scripts/linux/download_libs.sh -a ${{matrix.cfg.libs}};
2424
- name: Create Package

.github/workflows/build-linux.yml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: build-linux64-and-arm
1+
name: build-linux64
22

33
# make the action not run on the local repo if the branch is also in a pull request to OF/OF
44
on:
@@ -25,8 +25,6 @@ jobs:
2525
matrix:
2626
cfg:
2727
- {target: linux64, libs: 64gcc6}
28-
- {target: linuxarmv6l, libs: armv6l}
29-
# - {target: linuxarmv7l, libs: armv7l}
3028
env:
3129
TARGET: ${{matrix.cfg.target}}
3230
steps:
@@ -39,12 +37,6 @@ jobs:
3937
fi
4038
- name: Install dependencies
4139
run: ./scripts/ci/$TARGET/install.sh;
42-
# - name: Install gcc4
43-
# run: if [ ${{matrix.cfg.target}} = "64gcc4" ]; then
44-
# sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test;
45-
# sudo apt-get update -q;
46-
# sudo apt-get install gcc-4.9 g++-4.9;
47-
# fi
4840
- name: Build
4941
run: if [ "$TARGET" = "linux64" ]; then
5042
scripts/ci/$TARGET/build.sh;
Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
name: manual-nightly
22

3-
on: workflow_dispatch
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
release:
7+
description: 'release'
8+
required: true
9+
default: 'nightly'
410
jobs:
511
manual-nightly:
6-
runs-on: ubuntu-22.04
12+
runs-on: ubuntu-latest
713
strategy:
814
matrix:
915
cfg:
@@ -15,18 +21,18 @@ jobs:
1521
- name: Install libunwind
1622
run: sudo apt-get install libunwind-dev
1723
- name: Install dependencies
18-
run: sudo ./scripts/linux/ubuntu/install_dependencies.sh -y;
24+
run: ./scripts/ci/$TARGET/install.sh;
1925
- name: Download libs
2026
run: ./scripts/linux/download_libs.sh -a ${{matrix.cfg.libs}};
2127
- name: Create Package
22-
run: scripts/ci/package_builds.sh;
28+
run: scripts/ci/package_builds.sh ${{ github.event.inputs.release }};
2329
id: createpackage
2430
- name: Update Release
2531
uses: IsaacShelton/update-existing-release@v1.3.2
2632
with:
2733
token: ${{ secrets.GITHUB_TOKEN }}
28-
tag: nightly
29-
release: nightly
34+
tag: ${{ github.event.inputs.release }}
35+
release: ${{ github.event.inputs.release }}
3036
prerelease: false
3137
replace: true
3238
files: ${{ steps.createpackage.outputs.FILES_OUT }}

CHANGELOG.md

Lines changed: 523 additions & 0 deletions
Large diffs are not rendered by default.

addons/ofxAssimpModelLoader/src/ofxAssimpModelLoader.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ void ofxAssimpModelLoader::calculateDimensions(){
218218
normalizedScale = scene_max.x-scene_min.x;
219219
normalizedScale = std::max(double(scene_max.y - scene_min.y), normalizedScale);
220220
normalizedScale = std::max(double(scene_max.z - scene_min.z), normalizedScale);
221-
if (abs(normalizedScale) < std::numeric_limits<float>::epsilon()){
221+
if (fabs(normalizedScale) < std::numeric_limits<float>::epsilon()){
222222
ofLogWarning("ofxAssimpModelLoader") << "Error calculating normalized scale of scene" << std::endl;
223223
normalizedScale = 1.0;
224224
} else {

addons/ofxEmscripten/libs/html5video/include/html5video.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ extern "C"{
44
extern int html5video_player_create();
55
extern void html5video_player_delete(int id);
66
extern void html5video_player_load(int id,const char* src);
7+
extern void html5video_player_load_url(int id,const char* src);
78
extern const char* html5video_player_pixel_format(int it);
89
extern void html5video_player_set_pixel_format(int it, const char* format);
910
extern int html5video_player_update(int id, int update_pixels, unsigned char* pixels);

addons/ofxEmscripten/libs/html5video/lib/emscripten/library_html5video.js

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ var LibraryHTML5Video = {
111111
},
112112

113113
html5video_player_load__deps: ['$GL'],
114-
html5video_player_load: function(player_id, src) {
114+
html5video_player_load_url: function(player_id, src) {
115115
VIDEO.player[player_id].src = UTF8ToString(src);
116116
var texId = GL.getNewId(GL.textures);
117117
var texture = GLctx.createTexture();
@@ -125,6 +125,40 @@ var LibraryHTML5Video = {
125125
VIDEO.player[player_id].textureId = texId;
126126
},
127127

128+
html5video_player_load: function(player_id, src) {
129+
130+
try {
131+
var filePath = UTF8ToString(src); // The path to your file in MEMFS
132+
var data = FS.readFile(filePath, { encoding: 'binary' });
133+
var ext = filePath.split('.').pop();
134+
135+
var stats = FS.stat(filePath)
136+
var fileSizeInBytes = stats.size;
137+
138+
const blob = new Blob([data], { type: 'video/' + ext });
139+
const videoSrc = URL.createObjectURL(blob);
140+
141+
VIDEO.player[player_id].src = videoSrc;
142+
var texId = GL.getNewId(GL.textures);
143+
var texture = GLctx.createTexture();
144+
texture.name = texId;
145+
GL.textures[texId] = texture;
146+
GLctx.bindTexture(GLctx.TEXTURE_2D, texture);
147+
GLctx.texParameteri(GLctx.TEXTURE_2D, GLctx.TEXTURE_MAG_FILTER, GLctx.LINEAR);
148+
GLctx.texParameteri(GLctx.TEXTURE_2D, GLctx.TEXTURE_MIN_FILTER, GLctx.LINEAR);
149+
GLctx.texParameteri(GLctx.TEXTURE_2D, GLctx.TEXTURE_WRAP_S, GLctx.CLAMP_TO_EDGE);
150+
GLctx.texParameteri(GLctx.TEXTURE_2D, GLctx.TEXTURE_WRAP_T, GLctx.CLAMP_TO_EDGE);
151+
VIDEO.player[player_id].textureId = texId;
152+
153+
// Check the file size
154+
//console.log('File size:' + fileSizeInBytes);
155+
//console.log('data size:' + data.length);
156+
} catch (error) {
157+
console.error('Error reading file:' + filePath + " " + error);
158+
}
159+
},
160+
161+
128162
html5video_player_pixel_format: function(player_id) {
129163
var string = VIDEO.player[player_id].pixelFormat;
130164
var size = lengthBytesUTF8(string) + 1;
@@ -333,7 +367,7 @@ var LibraryHTML5Video = {
333367
html5video_grabber_update__deps: ['$GL'],
334368
html5video_grabber_update: function(grabber_id, update_pixels, pixels) {
335369
var grabber = VIDEO.grabber[grabber_id];
336-
if ( grabber.readyState == grabber.HAVE_METADATA ) {
370+
if ( grabber.readyState > grabber.HAVE_NOTHING ) {
337371
VIDEO.update(update_pixels, grabber, VIDEO.grabber[grabber_id].context, pixels);
338372
return true;
339373
}else{

addons/ofxEmscripten/src/ofxEmscriptenVideoPlayer.cpp

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ ofxEmscriptenVideoPlayer::~ofxEmscriptenVideoPlayer() {
2929
}
3030

3131
bool ofxEmscriptenVideoPlayer::load(string name){
32-
if (name.substr(0, 12) == "blob:http://" || name.substr(0, 13) == "blob:https://"){
33-
html5video_player_load(player_id, name.c_str());
32+
if (name.substr(0, 7) == "http://" || name.substr(0, 8) == "https://"){
33+
html5video_player_load_url(player_id, name.c_str());
3434
} else{
3535
html5video_player_load(player_id, ofToDataPath(name).c_str());
3636
}
@@ -86,7 +86,16 @@ void ofxEmscriptenVideoPlayer::update(){
8686
texture.texData.bAllocated = true;
8787
texture.setUseExternalTextureID(html5video_player_texture_id(player_id));
8888
}
89-
}
89+
}else{
90+
if( !bHadValidFrame && !bWarnBlocked ){
91+
if( ofGetElapsedTimef() - timePlayRequested > 3.0 ){
92+
string errorMsg = "ofxEmscriptenVideoPlayer::update video is not playing - check your browser preferences 'Auto Play' and click allow for this site ";
93+
ofLogError() << errorMsg << endl;
94+
std::cout << errorMsg << endl;
95+
bWarnBlocked = true;
96+
}
97+
}
98+
}
9099
}
91100

92101
void ofxEmscriptenVideoPlayer::play(){

addons/ofxEmscripten/src/ofxEmscriptenVideoPlayer.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,7 @@ class ofxEmscriptenVideoPlayer: public ofBaseVideoPlayer {
6767
ofTexture texture;
6868
ofPixels pixels;
6969
bool usePixels;
70+
float timePlayRequested = 0;
71+
bool bHadValidFrame = false;
72+
bool bWarnBlocked = false;
7073
};

0 commit comments

Comments
 (0)