Skip to content

Commit

Permalink
fix Media.clip
Browse files Browse the repository at this point in the history
  • Loading branch information
rectalogic committed Dec 23, 2023
1 parent 9fc4e40 commit 221890d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ jobs:
with:
submodules: true
- name: Build/test mediaFX
run: DOCKER_OPTS="-e MEDIAFX_TEST=" TARGET=opengl builders/Linux/docker-run.sh /mediafx/builders/Linux/mediafx-build.sh
run: DOCKER_OPTS="-e MEDIAFX_TEST=" TARGET=opengl builders/Linux/docker-run.sh
- name: Build/test mediaFX vulkan
run: DOCKER_OPTS="-e MEDIAFX_TEST=" TARGET=vulkan builders/Linux/docker-run.sh /mediafx/builders/Linux/mediafx-build.sh
run: DOCKER_OPTS="-e MEDIAFX_TEST=" TARGET=vulkan builders/Linux/docker-run.sh
- name: Upload Failed Artifacts
if: failure()
uses: actions/upload-artifact@v3
Expand Down
1 change: 1 addition & 0 deletions builders/Linux/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,4 @@ COPY entrypoint.sh /entrypoint.sh

USER mediafx
ENTRYPOINT ["/usr/bin/xvfb-run", "--server-args", "-screen 0 640x480x24 -nolisten unix", "--error-file", "/dev/stderr", "/entrypoint.sh"]
CMD ["/mediafx/builders/Linux/mediafx-build.sh"]
1 change: 1 addition & 0 deletions src/mediafx/media.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ void MediaAttached::setClip(MediaClip* clip)
}
}
}
m_clip = clip;
emit clipChanged();
}
}
3 changes: 3 additions & 0 deletions tests/qml/video-ad-insertion.qml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,15 @@ Item {
source: Qt.resolvedUrl("../../build/assets/red-320x180-15fps-8s.nut")

Component.onCompleted: {
// End encoding when main videoClip finishes
videoClip.clipEnded.connect(MediaFX.finishEncoding);
}
}
MediaClip {
id: adClip

source: Qt.resolvedUrl("../../build/assets/blue-320x180-30fps-3s.nut")
// Switch back to default state when ad ends - main videoClip playing
onClipEnded: videoOutput.state = ""
}
VideoOutput {
Expand All @@ -40,6 +42,7 @@ Item {
states: [
State {
name: "ad"
// 4 sec into the main video, switch to playing the ad
when: (videoClip.clipCurrentTime.contains(4000))
PropertyChanges {
target: videoOutput
Expand Down

0 comments on commit 221890d

Please sign in to comment.