Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JET fixes/findings #409

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
julia-arch: [x64, x86]
julia-version: ['1.6','1','1.9-nightly','nightly']
julia-version: ['1.6','1','1.10-nightly','nightly']
exclude:
- os: macOS-latest
julia-arch: x86
Expand Down
2,561 changes: 1,288 additions & 1,273 deletions lib/libffmpeg.jl

Large diffs are not rendered by default.

9 changes: 7 additions & 2 deletions src/avio.jl
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@

For some codecs, the time base is closer to the field rate than the frame rate.
Most notably, H.264 and MPEG-2 specify time_base as half of frame duration if no telecine is used ...
Set to time_base ticks per frame. Default 1, e.g., H.264/MPEG-2 set it to 2.
Set to time_base ticks per frame. Default 1, e.g., H.264/MPEG-2 set it to 2.
=#
framerate(f::VideoReader) =
f.codec_context.time_base.den // f.codec_context.time_base.num // f.codec_context.ticks_per_frame
Expand All @@ -432,6 +432,7 @@

function unpack_stashed_planes!(r::VideoReader, imgbuf)
frame = graph_input_frame(r)
# `VideoIO.av_make_writable` is not defined:
av_make_writable(frame)
av_image_fill_arrays(
frame,
Expand Down Expand Up @@ -558,6 +559,7 @@
function retrieve(r::VideoReader{TRANSCODE}) # true=transcode
pix_fmt = out_frame_format(r)
if !is_pixel_type_supported(pix_fmt)
# `VideoIO.unsupported_retrieveal_format` is not defined:
unsupported_retrieveal_format(pix_fmt)
end
elt = VIO_PIX_FMT_DEF_ELTYPE_LU[pix_fmt]
Expand Down Expand Up @@ -832,7 +834,7 @@
function get_frame_period_timebase(r::VideoReader)
# This is probably not valid for many codecs, frame period in timebase
# units
stream = get_stream(s)
stream = get_stream(r)

Check warning on line 837 in src/avio.jl

View check run for this annotation

Codecov / codecov/patch

src/avio.jl#L837

Added line #L837 was not covered by tests
time_base = convert(Rational, stream.time_base)
time_base == 0 && return nothing
frame_rate = convert(Rational, av_stream_get_r_frame_rate(stream))
Expand All @@ -849,6 +851,9 @@
function seek(r::VideoReader, seconds::Number)
!isopen(r) && throw(ErrorException("Video input stream is not open!"))
video_stream_idx = get_video_stream_index(r)
# ┌ seek(r::VideoIO.VideoReader, seconds::Number) @ VideoIO /Users/ian/Documents/GitHub/VideoIO.jl/src/avio.jl:852
# │ no matching method found `seek(::VideoIO.AVInput, ::Number, ::Nothing)` (1/2 union split): VideoIO.seek((r::VideoIO.VideoReader).avin::VideoIO.AVInput, seconds::Number, video_stream_idx)
# └────────────────────
seek(r.avin, seconds, video_stream_idx)
return r
end
Expand Down
3 changes: 3 additions & 0 deletions src/encoding.jl
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,9 @@ function get_array_from_avarray(ptr::Union{Ptr{T},Ref{T},NestedCStruct{T}}, term
len = i - 1
if make_copy
dst = Vector{T}(undef, len)
# ┌ get_array_from_avarray(ptr::Union{Ptr{T}, Ref{T}, VideoIO.NestedCStruct{T}}, term::Any; make_copy::Any) where T @ VideoIO /Users/ian/Documents/GitHub/VideoIO.jl/src/encoding.jl:134
# │ no matching method found `unsafe_copyto!(::Vector, ::Union{Ptr{T}, Ref{T}, VideoIO.NestedCStruct{T}} where T, ::Int64)`: VideoIO.unsafe_copyto!(dst, ptr::Union{Ptr{T}, Ref{T}, VideoIO.NestedCStruct{T}} where T, len::Int64)
# └────────────────────
unsafe_copyto!(dst, ptr, len)
else
dst = unsafe_wrap(Array, ptr, len)
Expand Down
2 changes: 1 addition & 1 deletion src/frame_graph.jl
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ end

function pix_fmt_to_bits_per_pixel(pix_fmt)
fmt_desc = av_pix_fmt_desc_get(pix_fmt)
check_ptr_valid(fmt_desc, false) || error("Unknown pixel format $dst_pix_fmt")
check_ptr_valid(fmt_desc, false) || error("Unknown pixel format $pix_fmt")
padded_bits = av_get_padded_bits_per_pixel(fmt_desc)
bits = av_get_bits_per_pixel(fmt_desc)
return bits, padded_bits
Expand Down
2 changes: 1 addition & 1 deletion src/util.jl
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function loglevel()
VideoIO.libffmpeg.AV_LOG_TRACE,
]
i = findfirst(level_values .== current_level)
if i > 0
if i !== nothing
return level_strings[i]
else
return "Unknown log level: $current_level"
Expand Down
Loading