Skip to content

Commit

Permalink
Merge pull request #408 from ashwani-rathee/ash/get_ch
Browse files Browse the repository at this point in the history
Remove need of redundant argument ffmpeg
  • Loading branch information
sjkelly authored Oct 13, 2023
2 parents 45801ef + 993ea86 commit e2d0c05
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
11 changes: 7 additions & 4 deletions src/VideoIO.jl
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ include("frame_graph.jl")
include("avio.jl")
include("encoding.jl")
include("testvideos.jl")

include("deprecations.jl")

using .TestVideos

if Sys.islinux()
Expand All @@ -56,7 +59,7 @@ if Sys.islinux()
end
elseif Sys.iswindows()
function init_camera_devices()
append!(CAMERA_DEVICES, get_camera_devices(ffmpeg, "dshow", "dummy"))
append!(CAMERA_DEVICES, get_camera_devices("dshow", "dummy"))
return DEFAULT_CAMERA_FORMAT[] = libffmpeg.av_find_input_format("dshow")
end
function init_camera_settings()
Expand All @@ -66,11 +69,11 @@ elseif Sys.iswindows()
elseif Sys.isapple()
function init_camera_devices()
try
append!(CAMERA_DEVICES, get_camera_devices(ffmpeg, "avfoundation", "\"\""))
append!(CAMERA_DEVICES, get_camera_devices("avfoundation", "\"\""))
DEFAULT_CAMERA_FORMAT[] = libffmpeg.av_find_input_format("avfoundation")
catch
try
append!(CAMERA_DEVICES, get_camera_devices(ffmpeg, "qtkit", "\"\""))
append!(CAMERA_DEVICES, get_camera_devices("qtkit", "\"\""))
DEFAULT_CAMERA_FORMAT[] = libffmpeg.av_find_input_format("qtkit")
catch
end
Expand All @@ -85,7 +88,7 @@ elseif Sys.isapple()
elseif Sys.isbsd()
# copied loosely from apple above - needs figuring out
function init_camera_devices()
append!(CAMERA_DEVICES, get_camera_devices(ffmpeg, "avfoundation", "\"\""))
append!(CAMERA_DEVICES, get_camera_devices("avfoundation", "\"\""))
return DEFAULT_CAMERA_FORMAT[] = libffmpeg.av_find_input_format("avfoundation")
end
function init_camera_settings()
Expand Down
2 changes: 1 addition & 1 deletion src/avio.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1017,7 +1017,7 @@ const CAMERA_DEVICES = String[]
const DEFAULT_CAMERA_DEVICE = Ref{String}()
const DEFAULT_CAMERA_OPTIONS = AVDict()

function get_camera_devices(ffmpeg, idev, idev_name)
function get_camera_devices(idev, idev_name)
camera_devices = String[]

read_vid_devs = false
Expand Down
3 changes: 3 additions & 0 deletions src/deprecations.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# current deprecations

@deprecate get_camera_devices(ffmpeg, idev, idev_name) get_camera_devices(idev, idev_name)

0 comments on commit e2d0c05

Please sign in to comment.