Skip to content

Commit

Permalink
chore: bump structures to support latest ffmpeg release
Browse files Browse the repository at this point in the history
  • Loading branch information
stakach committed Jul 28, 2024
1 parent 0055472 commit bf2fabb
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 13 deletions.
2 changes: 1 addition & 1 deletion shard.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: ffmpeg
version: 1.2.1
version: 1.3.0

dependencies:
# we use stumpy to extract each pixels colour and draw bounding boxes
Expand Down
15 changes: 9 additions & 6 deletions src/ffmpeg/libav/codec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -27,45 +27,49 @@ module FFmpeg::LibAV

fun packet_unref = av_packet_unref(pkt : Packet*)

# https://ffmpeg.org//doxygen/trunk/structAVCodec.html
type AVCodec = Void*
# type Context = Void*
type AVCodecParameters = Void*

# https://ffmpeg.org//doxygen/trunk/structAVCodecContext.html
# https://ffmpeg.org//doxygen/trunk/avcodec_8h_source.html
struct Context
av_class : Void*
log_level_offset : LibC::Int
codec_type : MediaType
codec : AVCodec
codec_id : LibC::Int
codec_tag : LibC::UInt
stream_codec_tag : LibC::UInt
priv_data : Void*
internal : Void*
opaque : Void*
bit_rate : LibC::Int64T
bit_rate_tolerance : LibC::Int
global_quality : LibC::Int
compression_level : LibC::Int
flags : LibC::Int
flags2 : LibC::Int
extradata : LibC::UInt8T*
extradata_size : LibC::Int
time_base : Rational
pkt_timebase : Rational
framerate : Rational
ticks_per_frame : LibC::Int
delay : LibC::Int
width : LibC::Int
height : LibC::Int
coded_width : LibC::Int
coded_height : LibC::Int
gop_size : LibC::Int
sample_aspect_ratio : Rational
pix_fmt : PixelFormat
sw_pix_fmt : PixelFormat
end

struct Rational
num : LibC::Int
den : LibC::Int
end

# https://ffmpeg.org//doxygen/trunk/structAVPacket.html
# https://ffmpeg.org//doxygen/trunk/packet_8h_source.html
struct Packet
buf : Void*
pts : LibC::Long
Expand All @@ -78,7 +82,6 @@ module FFmpeg::LibAV
side_data_elems : LibC::Int
duration : LibC::Long
pos : LibC::Long
convergence_duration : LibC::Long
end

# https://ffmpeg4d.dpldocs.info/ffmpeg.libavcodec.avcodec.avcodec_open2.html
Expand Down
13 changes: 8 additions & 5 deletions src/ffmpeg/libav/format.cr
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ module FFmpeg::LibAV
ctx_flags : LibC::Int
nb_streams : LibC::UInt
streams : AVStream**
nb_stream_groups : LibC::UInt
stream_groups : Void*
nb_chapters : LibC::UInt
chapters : Void*
url : UInt8*
start_time : LibC::Int64T
duration : LibC::Int64T
Expand All @@ -63,10 +67,12 @@ module FFmpeg::LibAV
max_analyze_duration : LibC::Int64T
end

# https://ffmpeg.org/doxygen/trunk/structAVStream.html
struct AVStream
av_class : Void*
index : LibC::Int
id : LibC::Int
codec : Codec::Context*
codecpar : Codec::AVCodecParameters
priv_data : Void*
time_base : Codec::Rational
start_time : LibC::Long
Expand All @@ -78,12 +84,9 @@ module FFmpeg::LibAV
metadata : Void*
avg_frame_rate : Codec::Rational
attached_pic : Codec::Packet
side_data : Void*
nb_side_data : LibC::Int
event_flags : LibC::Int
r_frame_rate : Codec::Rational
recommended_encoder_configuration : LibC::Char*
codecpar : Codec::AVCodecParameters
pts_wrap_bits : LibC::Int
end
end
end
2 changes: 1 addition & 1 deletion src/ffmpeg/libav/util.cr
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ module FFmpeg::LibAV
lib Util
AV_NUM_DATA_POINTERS = 8

# https://ffmpeg.org//doxygen/trunk/frame_8h_source.html
struct AVFrame
data : UInt8*[8]
linesize : LibC::Int[8]
Expand All @@ -13,7 +14,6 @@ module FFmpeg::LibAV
height : LibC::Int
nb_samples : LibC::Int
format : PixelFormat
key_frame : LibC::Int
end

fun version_info = av_version_info : LibC::Char*
Expand Down

0 comments on commit bf2fabb

Please sign in to comment.