Skip to content

Commit 6c30fba

Browse files
author
root
committed
Schedule decoder.new() on dirtyio scheduler. Exlude tests when running on GPU
1 parent 998ecdb commit 6c30fba

4 files changed

Lines changed: 5 additions & 2 deletions

File tree

native/vkvideo_decoder/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ fn load(env: Env, _: Term) -> bool {
2222
rustler::resource!(DecoderResource, env)
2323
}
2424

25-
#[rustler::nif]
25+
#[rustler::nif(schedule = "DirtyIo")]
2626
fn new() -> Result<(Atom, ResourceArc<DecoderResource>), Error> {
2727
let instance = vk_video::VulkanInstance::new()
2828
.map_err(|_| Error::Term(Box::new(vk_instance_creation_failure())))?;

test/decoder_native_test.exs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ defmodule Decoder.NativeTest do
22
use ExUnit.Case, async: true
33
alias Membrane.VKVideo.Decoder.Native
44

5+
@tag :requires_gpu
56
test "Decoder decoded H.264 stream" do
67
in_path = "./fixtures/input-100.h264" |> Path.expand(__DIR__)
78

test/decoder_test.exs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ defmodule Decoder.Test do
88
@frame_duration_ms div(1000, @framerate_numerator)
99

1010
describe "Decoder decodes" do
11+
@tag :requires_gpu
1112
test "one hundred H.264 frames with B-frames in presentation order" do
1213
in_path = "./fixtures/input-100.h264" |> Path.expand(__DIR__)
1314

@@ -41,6 +42,7 @@ defmodule Decoder.Test do
4142
end
4243

4344
@tag :tmp_dir
45+
@tag :requires_gpu
4446
test "ten H.264 frames", ctx do
4547
in_path = "./fixtures/input-10.h264" |> Path.expand(__DIR__)
4648
out_path = Path.join(ctx.tmp_dir, "out.nv12")

test/test_helper.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
opts =
22
if System.get_env("CIRCLECI") == "true" do
3-
[capture_log: true, include: :doesnt_require_gpu]
3+
[capture_log: true, exclude: [requires_gpu: true]]
44
else
55
[capture_log: true]
66
end

0 commit comments

Comments
 (0)