Skip to content

Commit 183ea9b

Browse files
committed
Merge commit '18df276bbff9526d1f1f0a60d0958406abffce58' into macOS-xcframeworks
* commit '18df276bbff9526d1f1f0a60d0958406abffce58': Fix for set volume function in Media Foundation player. (#8025) Fix for emscripten not being able to render wireframe. though it just renders as GL_LINES and is not visually the same as polygonMode (#8023) macOS video player thread priority (#8018) Submodules sync and pg fix paths (#8014) # Conflicts: # scripts/apothecary
2 parents baa294e + 18df276 commit 183ea9b

File tree

4 files changed

+43
-25
lines changed

4 files changed

+43
-25
lines changed

libs/openFrameworks/gl/ofGLProgrammableRenderer.cpp

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -233,20 +233,35 @@ void ofGLProgrammableRenderer::drawInstanced(const ofVboMesh & mesh, ofPolyRende
233233
#if !defined( TARGET_OPENGLES ) || defined(TARGET_EMSCRIPTEN)
234234
#if !defined(TARGET_EMSCRIPTEN)
235235
glPolygonMode(GL_FRONT_AND_BACK, ofGetGLPolyMode(renderType));
236-
#endif
237-
if (mesh.getNumIndices() && renderType != OF_MESH_POINTS) {
238-
if (primCount <= 1) {
239-
drawElements(mesh.getVbo(), mode, mesh.getNumIndices());
236+
#else
237+
// nh: glPolygonMode is not supported via emscripten,
238+
// we can not render wire frames with vbos.
239+
// this is not the best solution, but does provide some information
240+
// and does not render as solid when wireframe mode is requested.
241+
if (renderType == OF_MESH_WIREFRAME) {
242+
if (mesh.getNumIndices()) {
243+
drawElements(mesh.getVbo(), GL_LINES, mesh.getNumIndices());
240244
} else {
241-
drawElementsInstanced(mesh.getVbo(), mode, mesh.getNumIndices(), primCount);
245+
draw(mesh.getVbo(), GL_LINES, 0, mesh.getNumVertices());
242246
}
243247
} else {
244-
if (primCount <= 1) {
245-
draw(mesh.getVbo(), mode, 0, mesh.getNumVertices());
248+
#endif
249+
if (mesh.getNumIndices() && renderType != OF_MESH_POINTS) {
250+
if (primCount <= 1) {
251+
drawElements(mesh.getVbo(), mode, mesh.getNumIndices());
252+
} else {
253+
drawElementsInstanced(mesh.getVbo(), mode, mesh.getNumIndices(), primCount);
254+
}
246255
} else {
247-
drawInstanced(mesh.getVbo(), mode, 0, mesh.getNumVertices(), primCount);
256+
if (primCount <= 1) {
257+
draw(mesh.getVbo(), mode, 0, mesh.getNumVertices());
258+
} else {
259+
drawInstanced(mesh.getVbo(), mode, 0, mesh.getNumVertices(), primCount);
260+
}
248261
}
249-
}
262+
#if defined(TARGET_EMSCRIPTEN)
263+
} // close the if for checking for wireframe
264+
#endif
250265

251266
// tig: note further that we could glGet() and store the current polygon mode, but don't, since that would
252267
// infer a massive performance hit. instead, we revert the glPolygonMode to mirror the current ofFill state

libs/openFrameworks/video/ofAVFoundationVideoPlayer.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ - (BOOL)loadWithURL:(NSURL*)url async:(BOOL)bAsync {
170170
if(bAsync == YES){
171171
queue = dispatch_get_main_queue();
172172
} else {
173-
queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
173+
queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0);
174174
}
175175

176176
dispatch_async(queue, ^{

libs/openFrameworks/video/ofMediaFoundationPlayer.cpp

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1084,11 +1084,17 @@ void ofMediaFoundationPlayer::setSpeed(float speed) {
10841084

10851085
//----------------------------------------------
10861086
void ofMediaFoundationPlayer::setVolume(float volume) {
1087-
if (m_spMediaEngine) {
1088-
ofMediaFoundationUtils::CallAsyncBlocking(
1089-
[&] {m_spMediaEngine->SetVolume(static_cast<double>(volume));
1090-
});
1091-
}
1087+
if (m_spMediaEngine) {
1088+
double cvolume = ofClamp(volume, 0.0f, 1.0f);
1089+
HRESULT hr = m_spMediaEngine->SetVolume(cvolume);
1090+
if (hr != S_OK) {
1091+
ofLogVerbose("ofMediaFoundationPlayer :: setVolume : Unable to set volume to ") << volume << ".";
1092+
}
1093+
//ofMediaFoundationUtils::CallAsyncBlocking(
1094+
//[&] {m_spMediaEngine->SetVolume(static_cast<double>(volume));
1095+
//[&] {m_spMediaEngine->SetVolume(cvolume);
1096+
//});
1097+
}
10921098
}
10931099

10941100
//----------------------------------------------

scripts/dev/download_pg.sh

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ trapError() {
5454

5555
if [ -e openFrameworksLibs* ]; then
5656
echo "removing packages"
57-
rm openFrameworksLibs*
57+
rm openFrameworksLibs*
5858
fi
5959
exit "${code}"
6060
}
@@ -157,7 +157,7 @@ fi
157157
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
158158
cd "$SCRIPT_DIR"
159159

160-
OUTDIR=../../../../
160+
OUTDIR=../../
161161

162162

163163
if [[ $BLEEDING_EDGE = 1 ]] ; then
@@ -190,7 +190,7 @@ cd download
190190

191191
download $PKG
192192

193-
echo " Uncompressing Project Generator for $PLATFORM from $PKG"
193+
echo " Uncompressing Project Generator for [$PLATFORM] from [$PKG] to [${OUTDIR}/$OUTPUT]"
194194
if [ "$PLATFORM" == "msys2" ] || [ "$PLATFORM" == "vs" ]; then
195195
unzip -q "$PKG" -d "$OUTPUT"
196196
#rm $PKG
@@ -207,17 +207,17 @@ if [ "$PLATFORM" == "msys2" ] || [ "$PLATFORM" == "vs" ]; then
207207

208208
if ! command -v rsync &> /dev/null
209209
then
210-
cp -ar ${OUTPUT}/ ${OUTDIR}/${OUTPUT}
210+
cp -arX ${OUTPUT}/ ${OUTDIR}/${OUTPUT}
211211
else
212212
rsync -a ${OUTPUT}/ ${OUTDIR}/${OUTPUT}
213213
fi
214214
rm -rf $OUTPUT
215215
else
216216
if ! command -v rsync &> /dev/null
217217
then
218-
cp -ar $OUTPUT/projectGenerator$EXT $OUTDIR/
218+
cp -arX $OUTPUT/projectGenerator$EXT $OUTDIR/
219219
else
220-
rsync -a $OUTPUT/projectGenerator$EXT $OUTDIR
220+
rsync -a $OUTPUT/projectGenerator$EXT $OUTDIR
221221
fi
222222
rm -rf $OUTPUT/projectGenerator$EXT
223223

@@ -227,7 +227,4 @@ rm -rf $OUTPUT
227227
# rm -rf $PKG
228228

229229
echo " ------ "
230-
echo " openFrameworks download projectGenerator and install complete!"
231-
232-
233-
230+
echo " openFrameworks download projectGenerator and install complete!"

0 commit comments

Comments
 (0)