Open jonalm opened 2 years ago
The following makes me suspect that something's broken with getproperty
or with propertynames
for a VideoIO.NestedCStruct{VideoIO.libffmpeg.AVCodecContext}
.
julia> dump(handle.codec_context, maxdepth=2)
VideoIO.NestedCStruct{VideoIO.libffmpeg.AVCodecContext}
data: Base.RefValue{Ptr{VideoIO.libffmpeg.AVCodecContext}}
x: Ptr{VideoIO.libffmpeg.AVCodecContext} @0x0000000003e90cc0
julia> handle.codec_context.data
ERROR: type Ptr has no field data
Stacktrace:
[1] getproperty(x::Ptr{VideoIO.libffmpeg.AVCodecContext}, f::Symbol)
@ VideoIO.libffmpeg ~/.julia/packages/VideoIO/3LUls/lib/libffmpeg.jl:2908
[2] field_ptr
@ ~/.julia/packages/VideoIO/3LUls/src/util.jl:67 [inlined]
[3] getproperty(ap::VideoIO.NestedCStruct{VideoIO.libffmpeg.AVCodecContext}, s::Symbol)
@ VideoIO ~/.julia/packages/VideoIO/3LUls/src/avptr.jl:44
[4] top-level scope
@ REPL[21]:1
julia> propertynames(handle.codec_context)
(:data, :data)
julia> getfield(handle.codec_context, :data)
Base.RefValue{Ptr{VideoIO.libffmpeg.AVCodecContext}}(Ptr{VideoIO.libffmpeg.AVCodecContext} @0x0000000003e90cc0)
julia> getproperty(handle.codec_context, :data)
ERROR: type Ptr has no field data
Stacktrace:
[1] getproperty(x::Ptr{VideoIO.libffmpeg.AVCodecContext}, f::Symbol)
@ VideoIO.libffmpeg ~/.julia/packages/VideoIO/3LUls/lib/libffmpeg.jl:2908
[2] field_ptr
@ ~/.julia/packages/VideoIO/3LUls/src/util.jl:67 [inlined]
[3] getproperty(ap::VideoIO.NestedCStruct{VideoIO.libffmpeg.AVCodecContext}, s::Symbol)
@ VideoIO ~/.julia/packages/VideoIO/3LUls/src/avptr.jl:44
[4] top-level scope
@ REPL[24]:1
Maybe I should include a try
in there somewhere to catch objects that are broken like this.
Or maybe fallback to getfield
.
Hi,
I stumbled upon a case where
eye
fails. Consider this