FFmpeg: Update to version 5.0, and add another patch for iTunes MP3 gapless info

CQTexperiment
Christopher Snowhill 2022-01-24 04:26:20 -08:00
parent 9e42df41bd
commit d771a58e69
65 changed files with 1587 additions and 2455 deletions

View File

@ -94,10 +94,6 @@
56C63D910D647DF300EAE25A /* NSComparisonPredicate+CogPredicate.m in Sources */ = {isa = PBXBuildFile; fileRef = 56C63D900D647DF300EAE25A /* NSComparisonPredicate+CogPredicate.m */; };
56DB084C0D6717DC00453B6A /* NSNumber+CogSort.m in Sources */ = {isa = PBXBuildFile; fileRef = 56DB084B0D6717DC00453B6A /* NSNumber+CogSort.m */; };
56DB08550D67185300453B6A /* NSArray+CogSort.m in Sources */ = {isa = PBXBuildFile; fileRef = 56DB08540D67185300453B6A /* NSArray+CogSort.m */; };
830595EF277EFEFA00EBFAAE /* libavcodec.58.dylib in CopyFiles */ = {isa = PBXBuildFile; fileRef = 830595E9277EFEA400EBFAAE /* libavcodec.58.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
830595F0277EFEFA00EBFAAE /* libavformat.58.dylib in CopyFiles */ = {isa = PBXBuildFile; fileRef = 830595EC277EFED900EBFAAE /* libavformat.58.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
830595F1277EFEFA00EBFAAE /* libavutil.56.dylib in CopyFiles */ = {isa = PBXBuildFile; fileRef = 830595ED277EFED900EBFAAE /* libavutil.56.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
830595F2277EFEFA00EBFAAE /* libswresample.3.dylib in CopyFiles */ = {isa = PBXBuildFile; fileRef = 830595EE277EFED900EBFAAE /* libswresample.3.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
8305963C277F013200EBFAAE /* File_Extractor.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 83059639277F011100EBFAAE /* File_Extractor.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
83059690277F04AB00EBFAAE /* Ogg.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 8305968D277F049600EBFAAE /* Ogg.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
830596EE277F05EE00EBFAAE /* Vorbis.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 830596E7277F05E200EBFAAE /* Vorbis.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
@ -155,6 +151,10 @@
8399D4E21805A55000B503B1 /* XmlContainer.m in Sources */ = {isa = PBXBuildFile; fileRef = 8399D4E01805A55000B503B1 /* XmlContainer.m */; };
839DA7CF274A2D4C001B18E5 /* NSDictionary+Merge.m in Sources */ = {isa = PBXBuildFile; fileRef = 839DA7CE274A2D4C001B18E5 /* NSDictionary+Merge.m */; };
83A360B220E4E81D00192DAB /* Flac.bundle in CopyFiles */ = {isa = PBXBuildFile; fileRef = 8303A30C20E4E3D000951EF8 /* Flac.bundle */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
83AA7D04279EBCA900087AA4 /* libavcodec.59.dylib in CopyFiles */ = {isa = PBXBuildFile; fileRef = 83AA7D00279EBC8200087AA4 /* libavcodec.59.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
83AA7D05279EBCAB00087AA4 /* libavformat.59.dylib in CopyFiles */ = {isa = PBXBuildFile; fileRef = 83AA7D03279EBC8300087AA4 /* libavformat.59.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
83AA7D06279EBCAD00087AA4 /* libavutil.57.dylib in CopyFiles */ = {isa = PBXBuildFile; fileRef = 83AA7D02279EBC8200087AA4 /* libavutil.57.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
83AA7D07279EBCAF00087AA4 /* libswresample.4.dylib in CopyFiles */ = {isa = PBXBuildFile; fileRef = 83AA7D01279EBC8200087AA4 /* libswresample.4.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
83B06704180D579E008E3612 /* MIDI.bundle in CopyFiles */ = {isa = PBXBuildFile; fileRef = 83B066A1180D5669008E3612 /* MIDI.bundle */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
83B72E3B279045B7006007A3 /* libfdk-aac.2.dylib in CopyFiles */ = {isa = PBXBuildFile; fileRef = 83B72E2A279044F6006007A3 /* libfdk-aac.2.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
83BC5AB220E4C87100631CD4 /* DualWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = 83BC5AB020E4C87100631CD4 /* DualWindow.m */; };
@ -732,14 +732,14 @@
dstPath = "";
dstSubfolderSpec = 10;
files = (
83AA7D07279EBCAF00087AA4 /* libswresample.4.dylib in CopyFiles */,
83AA7D06279EBCAD00087AA4 /* libavutil.57.dylib in CopyFiles */,
83AA7D05279EBCAB00087AA4 /* libavformat.59.dylib in CopyFiles */,
83AA7D04279EBCA900087AA4 /* libavcodec.59.dylib in CopyFiles */,
83B72E3B279045B7006007A3 /* libfdk-aac.2.dylib in CopyFiles */,
830596EE277F05EE00EBFAAE /* Vorbis.framework in CopyFiles */,
83059690277F04AB00EBFAAE /* Ogg.framework in CopyFiles */,
8305963C277F013200EBFAAE /* File_Extractor.framework in CopyFiles */,
830595EF277EFEFA00EBFAAE /* libavcodec.58.dylib in CopyFiles */,
830595F0277EFEFA00EBFAAE /* libavformat.58.dylib in CopyFiles */,
830595F1277EFEFA00EBFAAE /* libavutil.56.dylib in CopyFiles */,
830595F2277EFEFA00EBFAAE /* libswresample.3.dylib in CopyFiles */,
ED69CBCA25BE32E80090B90D /* MASShortcut.framework in CopyFiles */,
838F851F256B4E8B00C3E614 /* Sparkle.framework in CopyFiles */,
17F561400C3BD4F30019975C /* CogAudio.framework in CopyFiles */,
@ -904,10 +904,6 @@
56DB084B0D6717DC00453B6A /* NSNumber+CogSort.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "NSNumber+CogSort.m"; path = "Spotlight/NSNumber+CogSort.m"; sourceTree = "<group>"; };
56DB08530D67185300453B6A /* NSArray+CogSort.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NSArray+CogSort.h"; path = "Spotlight/NSArray+CogSort.h"; sourceTree = "<group>"; };
56DB08540D67185300453B6A /* NSArray+CogSort.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "NSArray+CogSort.m"; path = "Spotlight/NSArray+CogSort.m"; sourceTree = "<group>"; };
830595E9277EFEA400EBFAAE /* libavcodec.58.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libavcodec.58.dylib; path = ThirdParty/ffmpeg/lib/libavcodec.58.dylib; sourceTree = "<group>"; };
830595EC277EFED900EBFAAE /* libavformat.58.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libavformat.58.dylib; path = ThirdParty/ffmpeg/lib/libavformat.58.dylib; sourceTree = "<group>"; };
830595ED277EFED900EBFAAE /* libavutil.56.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libavutil.56.dylib; path = ThirdParty/ffmpeg/lib/libavutil.56.dylib; sourceTree = "<group>"; };
830595EE277EFED900EBFAAE /* libswresample.3.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libswresample.3.dylib; path = ThirdParty/ffmpeg/lib/libswresample.3.dylib; sourceTree = "<group>"; };
83059634277F011100EBFAAE /* File_Extractor.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = File_Extractor.xcodeproj; path = Frameworks/File_Extractor/File_Extractor.xcodeproj; sourceTree = "<group>"; };
83059684277F049600EBFAAE /* Ogg.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Ogg.xcodeproj; path = Frameworks/Ogg/macosx/Ogg.xcodeproj; sourceTree = "<group>"; };
830596DA277F05E200EBFAAE /* Vorbis.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Vorbis.xcodeproj; path = Frameworks/Vorbis/macosx/Vorbis.xcodeproj; sourceTree = "<group>"; };
@ -973,6 +969,10 @@
8399D4E11805A55000B503B1 /* XmlContainer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XmlContainer.h; sourceTree = "<group>"; };
839DA7CB274A2D4C001B18E5 /* NSDictionary+Merge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSDictionary+Merge.h"; sourceTree = "<group>"; };
839DA7CE274A2D4C001B18E5 /* NSDictionary+Merge.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSDictionary+Merge.m"; sourceTree = "<group>"; };
83AA7D00279EBC8200087AA4 /* libavcodec.59.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libavcodec.59.dylib; path = ThirdParty/ffmpeg/lib/libavcodec.59.dylib; sourceTree = "<group>"; };
83AA7D01279EBC8200087AA4 /* libswresample.4.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libswresample.4.dylib; path = ThirdParty/ffmpeg/lib/libswresample.4.dylib; sourceTree = "<group>"; };
83AA7D02279EBC8200087AA4 /* libavutil.57.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libavutil.57.dylib; path = ThirdParty/ffmpeg/lib/libavutil.57.dylib; sourceTree = "<group>"; };
83AA7D03279EBC8300087AA4 /* libavformat.59.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libavformat.59.dylib; path = ThirdParty/ffmpeg/lib/libavformat.59.dylib; sourceTree = "<group>"; };
83AB9031237CEFD300A433D5 /* MediaPlayer.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MediaPlayer.framework; path = System/Library/Frameworks/MediaPlayer.framework; sourceTree = SDKROOT; };
83B0669C180D5668008E3612 /* MIDI.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = MIDI.xcodeproj; path = Plugins/MIDI/MIDI.xcodeproj; sourceTree = "<group>"; };
83B72E2A279044F6006007A3 /* libfdk-aac.2.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libfdk-aac.2.dylib"; path = "ThirdParty/fdk-aac/lib/libfdk-aac.2.dylib"; sourceTree = "<group>"; };
@ -1098,13 +1098,13 @@
isa = PBXGroup;
children = (
83B72E2A279044F6006007A3 /* libfdk-aac.2.dylib */,
83AA7D00279EBC8200087AA4 /* libavcodec.59.dylib */,
83AA7D03279EBC8300087AA4 /* libavformat.59.dylib */,
83AA7D02279EBC8200087AA4 /* libavutil.57.dylib */,
83AA7D01279EBC8200087AA4 /* libswresample.4.dylib */,
830596DA277F05E200EBFAAE /* Vorbis.xcodeproj */,
83059684277F049600EBFAAE /* Ogg.xcodeproj */,
83059634277F011100EBFAAE /* File_Extractor.xcodeproj */,
830595E9277EFEA400EBFAAE /* libavcodec.58.dylib */,
830595EC277EFED900EBFAAE /* libavformat.58.dylib */,
830595ED277EFED900EBFAAE /* libavutil.56.dylib */,
830595EE277EFED900EBFAAE /* libswresample.3.dylib */,
17BB5EA50B8A87850009ACB1 /* IOKit.framework */,
17BB5CF60B8A86350009ACB1 /* AudioUnit.framework */,
17BB5CF70B8A86350009ACB1 /* CoreAudio.framework */,

View File

@ -28,10 +28,6 @@
83031EDC243C510500C3F3E0 /* vid1.c in Sources */ = {isa = PBXBuildFile; fileRef = 83031ED7243C510400C3F3E0 /* vid1.c */; };
83031EDD243C510500C3F3E0 /* xnb_streamfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 83031ED8243C510500C3F3E0 /* xnb_streamfile.h */; };
830595D8277EEAA500EBFAAE /* ffmpeg_decoder_custom_mp4.c in Sources */ = {isa = PBXBuildFile; fileRef = 830595D7277EEAA500EBFAAE /* ffmpeg_decoder_custom_mp4.c */; };
830595E5277EFE4E00EBFAAE /* libavcodec.58.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 830595E1277EFE4E00EBFAAE /* libavcodec.58.dylib */; };
830595E6277EFE4E00EBFAAE /* libswresample.3.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 830595E2277EFE4E00EBFAAE /* libswresample.3.dylib */; };
830595E7277EFE4E00EBFAAE /* libavformat.58.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 830595E3277EFE4E00EBFAAE /* libavformat.58.dylib */; };
830595E8277EFE4E00EBFAAE /* libavutil.56.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 830595E4277EFE4E00EBFAAE /* libavutil.56.dylib */; };
8306B08420984518000302D4 /* at3plus_decoder.c in Sources */ = {isa = PBXBuildFile; fileRef = 8306B08120984517000302D4 /* at3plus_decoder.c */; };
8306B08520984518000302D4 /* yamaha_decoder.c in Sources */ = {isa = PBXBuildFile; fileRef = 8306B08220984517000302D4 /* yamaha_decoder.c */; };
8306B08620984518000302D4 /* fadpcm_decoder.c in Sources */ = {isa = PBXBuildFile; fileRef = 8306B08320984517000302D4 /* fadpcm_decoder.c */; };
@ -575,6 +571,10 @@
83AA5D241F6E2F9C0020821C /* awc.c in Sources */ = {isa = PBXBuildFile; fileRef = 83AA5D201F6E2F9B0020821C /* awc.c */; };
83AA5D251F6E2F9C0020821C /* hca_keys.h in Headers */ = {isa = PBXBuildFile; fileRef = 83AA5D211F6E2F9C0020821C /* hca_keys.h */; };
83AA5D271F6E2F9C0020821C /* stm.c in Sources */ = {isa = PBXBuildFile; fileRef = 83AA5D231F6E2F9C0020821C /* stm.c */; };
83AA7D17279EBD0400087AA4 /* libavcodec.59.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 83AA7D13279EBCF900087AA4 /* libavcodec.59.dylib */; };
83AA7D18279EBD0900087AA4 /* libavformat.59.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 83AA7D14279EBCF900087AA4 /* libavformat.59.dylib */; };
83AA7D19279EBD0B00087AA4 /* libavutil.57.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 83AA7D16279EBCF900087AA4 /* libavutil.57.dylib */; };
83AA7D1A279EBD0D00087AA4 /* libswresample.4.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 83AA7D15279EBCF900087AA4 /* libswresample.4.dylib */; };
83AA7F722519BFEA004C5298 /* vorbis_bitreader.h in Headers */ = {isa = PBXBuildFile; fileRef = 83AA7F6D2519BFEA004C5298 /* vorbis_bitreader.h */; };
83AA7F732519BFEA004C5298 /* mpeg_bitreader.h in Headers */ = {isa = PBXBuildFile; fileRef = 83AA7F712519BFEA004C5298 /* mpeg_bitreader.h */; };
83AA7F7D2519C042004C5298 /* dsb.c in Sources */ = {isa = PBXBuildFile; fileRef = 83AA7F742519C041004C5298 /* dsb.c */; };
@ -850,10 +850,6 @@
83031ED7243C510400C3F3E0 /* vid1.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = vid1.c; sourceTree = "<group>"; };
83031ED8243C510500C3F3E0 /* xnb_streamfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = xnb_streamfile.h; sourceTree = "<group>"; };
830595D7277EEAA500EBFAAE /* ffmpeg_decoder_custom_mp4.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ffmpeg_decoder_custom_mp4.c; sourceTree = "<group>"; };
830595E1277EFE4E00EBFAAE /* libavcodec.58.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libavcodec.58.dylib; path = ../../ThirdParty/ffmpeg/lib/libavcodec.58.dylib; sourceTree = "<group>"; };
830595E2277EFE4E00EBFAAE /* libswresample.3.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libswresample.3.dylib; path = ../../ThirdParty/ffmpeg/lib/libswresample.3.dylib; sourceTree = "<group>"; };
830595E3277EFE4E00EBFAAE /* libavformat.58.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libavformat.58.dylib; path = ../../ThirdParty/ffmpeg/lib/libavformat.58.dylib; sourceTree = "<group>"; };
830595E4277EFE4E00EBFAAE /* libavutil.56.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libavutil.56.dylib; path = ../../ThirdParty/ffmpeg/lib/libavutil.56.dylib; sourceTree = "<group>"; };
8306B08120984517000302D4 /* at3plus_decoder.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = at3plus_decoder.c; sourceTree = "<group>"; };
8306B08220984517000302D4 /* yamaha_decoder.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = yamaha_decoder.c; sourceTree = "<group>"; };
8306B08320984517000302D4 /* fadpcm_decoder.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = fadpcm_decoder.c; sourceTree = "<group>"; };
@ -1396,6 +1392,10 @@
83AA5D201F6E2F9B0020821C /* awc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = awc.c; sourceTree = "<group>"; };
83AA5D211F6E2F9C0020821C /* hca_keys.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = hca_keys.h; sourceTree = "<group>"; };
83AA5D231F6E2F9C0020821C /* stm.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = stm.c; sourceTree = "<group>"; };
83AA7D13279EBCF900087AA4 /* libavcodec.59.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libavcodec.59.dylib; path = ../../ThirdParty/ffmpeg/lib/libavcodec.59.dylib; sourceTree = "<group>"; };
83AA7D14279EBCF900087AA4 /* libavformat.59.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libavformat.59.dylib; path = ../../ThirdParty/ffmpeg/lib/libavformat.59.dylib; sourceTree = "<group>"; };
83AA7D15279EBCF900087AA4 /* libswresample.4.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libswresample.4.dylib; path = ../../ThirdParty/ffmpeg/lib/libswresample.4.dylib; sourceTree = "<group>"; };
83AA7D16279EBCF900087AA4 /* libavutil.57.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libavutil.57.dylib; path = ../../ThirdParty/ffmpeg/lib/libavutil.57.dylib; sourceTree = "<group>"; };
83AA7F6D2519BFEA004C5298 /* vorbis_bitreader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vorbis_bitreader.h; sourceTree = "<group>"; };
83AA7F712519BFEA004C5298 /* mpeg_bitreader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mpeg_bitreader.h; sourceTree = "<group>"; };
83AA7F742519C041004C5298 /* dsb.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = dsb.c; sourceTree = "<group>"; };
@ -1504,23 +1504,23 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
83AA7D1A279EBD0D00087AA4 /* libswresample.4.dylib in Frameworks */,
83AA7D19279EBD0B00087AA4 /* libavutil.57.dylib in Frameworks */,
83AA7D18279EBD0900087AA4 /* libavformat.59.dylib in Frameworks */,
83AA7D17279EBD0400087AA4 /* libavcodec.59.dylib in Frameworks */,
83B72E3A27904589006007A3 /* libfdk-aac.2.dylib in Frameworks */,
83E22FC32772FD16000015EE /* AudioToolbox.framework in Frameworks */,
83E22FC12772FD06000015EE /* libbz2.tbd in Frameworks */,
838BDB7F1D3B1FD10022CA6F /* Cocoa.framework in Frameworks */,
838BDB7D1D3B1FCC0022CA6F /* CoreVideo.framework in Frameworks */,
838BDB7B1D3B1FC20022CA6F /* CoreMedia.framework in Frameworks */,
830595E6277EFE4E00EBFAAE /* libswresample.3.dylib in Frameworks */,
838BDB791D3B1FBE0022CA6F /* VideoToolbox.framework in Frameworks */,
838BDB771D3B1FB60022CA6F /* Security.framework in Frameworks */,
838BDB751D3B1FAD0022CA6F /* QuartzCore.framework in Frameworks */,
838BDB731D3B1FA50022CA6F /* VideoDecodeAcceleration.framework in Frameworks */,
838BDB711D3B1F990022CA6F /* CoreFoundation.framework in Frameworks */,
838BDB6A1D3AF7140022CA6F /* libiconv.tbd in Frameworks */,
830595E8277EFE4E00EBFAAE /* libavutil.56.dylib in Frameworks */,
830595E7277EFE4E00EBFAAE /* libavformat.58.dylib in Frameworks */,
838BDB681D3AF70D0022CA6F /* libz.tbd in Frameworks */,
830595E5277EFE4E00EBFAAE /* libavcodec.58.dylib in Frameworks */,
83D731891A749D1500CA1366 /* g719.framework in Frameworks */,
8313E3E61902020400B4B6F1 /* mpg123.framework in Frameworks */,
8315868D26F58AF900803A3A /* libspeex.a in Frameworks */,
@ -1592,10 +1592,10 @@
isa = PBXGroup;
children = (
83B72E342790452C006007A3 /* libfdk-aac.2.dylib */,
830595E1277EFE4E00EBFAAE /* libavcodec.58.dylib */,
830595E3277EFE4E00EBFAAE /* libavformat.58.dylib */,
830595E4277EFE4E00EBFAAE /* libavutil.56.dylib */,
830595E2277EFE4E00EBFAAE /* libswresample.3.dylib */,
83AA7D13279EBCF900087AA4 /* libavcodec.59.dylib */,
83AA7D14279EBCF900087AA4 /* libavformat.59.dylib */,
83AA7D16279EBCF900087AA4 /* libavutil.57.dylib */,
83AA7D15279EBCF900087AA4 /* libswresample.4.dylib */,
8315868C26F58AF900803A3A /* libspeex.a */,
83D731381A74968900CA1366 /* g719.xcodeproj */,
835FC6C123F62AEE006960FA /* libatrac9.xcodeproj */,

View File

@ -7,10 +7,6 @@
objects = {
/* Begin PBXBuildFile section */
830595DD277EFDE000EBFAAE /* libswresample.3.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 830595D9277EFDE000EBFAAE /* libswresample.3.dylib */; };
830595DE277EFDE000EBFAAE /* libavutil.56.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 830595DA277EFDE000EBFAAE /* libavutil.56.dylib */; };
830595DF277EFDE000EBFAAE /* libavcodec.58.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 830595DB277EFDE000EBFAAE /* libavcodec.58.dylib */; };
830595E0277EFDE000EBFAAE /* libavformat.58.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 830595DC277EFDE000EBFAAE /* libavformat.58.dylib */; };
8352D48F1CDDB023009D16AA /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8352D48E1CDDB023009D16AA /* CoreFoundation.framework */; };
8352D4911CDDB02A009D16AA /* VideoDecodeAcceleration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8352D4901CDDB02A009D16AA /* VideoDecodeAcceleration.framework */; };
8352D4931CDDB034009D16AA /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8352D4921CDDB034009D16AA /* QuartzCore.framework */; };
@ -20,6 +16,10 @@
8352D49B1CDDB8B2009D16AA /* VideoToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8352D49A1CDDB8B2009D16AA /* VideoToolbox.framework */; };
8352D49D1CDDB8C0009D16AA /* CoreMedia.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8352D49C1CDDB8C0009D16AA /* CoreMedia.framework */; };
8352D49F1CDDB8D7009D16AA /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8352D49E1CDDB8D7009D16AA /* CoreVideo.framework */; };
83AA7D0C279EBCC600087AA4 /* libavcodec.59.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 83AA7D08279EBCC600087AA4 /* libavcodec.59.dylib */; };
83AA7D0D279EBCC600087AA4 /* libavutil.57.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 83AA7D09279EBCC600087AA4 /* libavutil.57.dylib */; };
83AA7D0E279EBCC600087AA4 /* libswresample.4.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 83AA7D0A279EBCC600087AA4 /* libswresample.4.dylib */; };
83AA7D0F279EBCC600087AA4 /* libavformat.59.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 83AA7D0B279EBCC600087AA4 /* libavformat.59.dylib */; };
83B72E3927904557006007A3 /* libfdk-aac.2.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 83B72E3827904557006007A3 /* libfdk-aac.2.dylib */; };
83E22FC62772FD32000015EE /* libbz2.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 83E22FC52772FD32000015EE /* libbz2.tbd */; };
83E22FC82772FD3A000015EE /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 83E22FC72772FD3A000015EE /* AudioToolbox.framework */; };
@ -43,10 +43,6 @@
089C1672FE841209C02AAC07 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
089C167FFE841241C02AAC07 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
830595D9277EFDE000EBFAAE /* libswresample.3.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libswresample.3.dylib; path = ../../ThirdParty/ffmpeg/lib/libswresample.3.dylib; sourceTree = "<group>"; };
830595DA277EFDE000EBFAAE /* libavutil.56.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libavutil.56.dylib; path = ../../ThirdParty/ffmpeg/lib/libavutil.56.dylib; sourceTree = "<group>"; };
830595DB277EFDE000EBFAAE /* libavcodec.58.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libavcodec.58.dylib; path = ../../ThirdParty/ffmpeg/lib/libavcodec.58.dylib; sourceTree = "<group>"; };
830595DC277EFDE000EBFAAE /* libavformat.58.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libavformat.58.dylib; path = ../../ThirdParty/ffmpeg/lib/libavformat.58.dylib; sourceTree = "<group>"; };
8352D48E1CDDB023009D16AA /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = System/Library/Frameworks/CoreFoundation.framework; sourceTree = SDKROOT; };
8352D4901CDDB02A009D16AA /* VideoDecodeAcceleration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = VideoDecodeAcceleration.framework; path = System/Library/Frameworks/VideoDecodeAcceleration.framework; sourceTree = SDKROOT; };
8352D4921CDDB034009D16AA /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
@ -57,6 +53,10 @@
8352D49C1CDDB8C0009D16AA /* CoreMedia.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMedia.framework; path = System/Library/Frameworks/CoreMedia.framework; sourceTree = SDKROOT; };
8352D49E1CDDB8D7009D16AA /* CoreVideo.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreVideo.framework; path = System/Library/Frameworks/CoreVideo.framework; sourceTree = SDKROOT; };
8384913818081F6C00E7332D /* Logging.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Logging.h; path = ../../Utils/Logging.h; sourceTree = "<group>"; };
83AA7D08279EBCC600087AA4 /* libavcodec.59.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libavcodec.59.dylib; path = ../../ThirdParty/ffmpeg/lib/libavcodec.59.dylib; sourceTree = "<group>"; };
83AA7D09279EBCC600087AA4 /* libavutil.57.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libavutil.57.dylib; path = ../../ThirdParty/ffmpeg/lib/libavutil.57.dylib; sourceTree = "<group>"; };
83AA7D0A279EBCC600087AA4 /* libswresample.4.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libswresample.4.dylib; path = ../../ThirdParty/ffmpeg/lib/libswresample.4.dylib; sourceTree = "<group>"; };
83AA7D0B279EBCC600087AA4 /* libavformat.59.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libavformat.59.dylib; path = ../../ThirdParty/ffmpeg/lib/libavformat.59.dylib; sourceTree = "<group>"; };
83B72E3827904557006007A3 /* libfdk-aac.2.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libfdk-aac.2.dylib"; path = "../../ThirdParty/fdk-aac/lib/libfdk-aac.2.dylib"; sourceTree = "<group>"; };
83E22FC52772FD32000015EE /* libbz2.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libbz2.tbd; path = usr/lib/libbz2.tbd; sourceTree = SDKROOT; };
83E22FC72772FD3A000015EE /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; };
@ -74,20 +74,20 @@
buildActionMask = 2147483647;
files = (
83B72E3927904557006007A3 /* libfdk-aac.2.dylib in Frameworks */,
83AA7D0C279EBCC600087AA4 /* libavcodec.59.dylib in Frameworks */,
83E22FC82772FD3A000015EE /* AudioToolbox.framework in Frameworks */,
830595DE277EFDE000EBFAAE /* libavutil.56.dylib in Frameworks */,
83AA7D0E279EBCC600087AA4 /* libswresample.4.dylib in Frameworks */,
83E22FC62772FD32000015EE /* libbz2.tbd in Frameworks */,
83AA7D0D279EBCC600087AA4 /* libavutil.57.dylib in Frameworks */,
8352D4991CDDB06A009D16AA /* libz.tbd in Frameworks */,
8352D4971CDDB05E009D16AA /* Security.framework in Frameworks */,
830595DD277EFDE000EBFAAE /* libswresample.3.dylib in Frameworks */,
8352D4911CDDB02A009D16AA /* VideoDecodeAcceleration.framework in Frameworks */,
8352D49F1CDDB8D7009D16AA /* CoreVideo.framework in Frameworks */,
830595E0277EFDE000EBFAAE /* libavformat.58.dylib in Frameworks */,
8352D4931CDDB034009D16AA /* QuartzCore.framework in Frameworks */,
83AA7D0F279EBCC600087AA4 /* libavformat.59.dylib in Frameworks */,
8352D49D1CDDB8C0009D16AA /* CoreMedia.framework in Frameworks */,
8352D49B1CDDB8B2009D16AA /* VideoToolbox.framework in Frameworks */,
8352D48F1CDDB023009D16AA /* CoreFoundation.framework in Frameworks */,
830595DF277EFDE000EBFAAE /* libavcodec.58.dylib in Frameworks */,
8D5B49B4048680CD000E48DA /* Cocoa.framework in Frameworks */,
8352D4951CDDB03E009D16AA /* libiconv.tbd in Frameworks */,
);
@ -112,10 +112,10 @@
isa = PBXGroup;
children = (
83B72E3827904557006007A3 /* libfdk-aac.2.dylib */,
830595DB277EFDE000EBFAAE /* libavcodec.58.dylib */,
830595DC277EFDE000EBFAAE /* libavformat.58.dylib */,
830595DA277EFDE000EBFAAE /* libavutil.56.dylib */,
830595D9277EFDE000EBFAAE /* libswresample.3.dylib */,
83AA7D08279EBCC600087AA4 /* libavcodec.59.dylib */,
83AA7D0B279EBCC600087AA4 /* libavformat.59.dylib */,
83AA7D09279EBCC600087AA4 /* libavutil.57.dylib */,
83AA7D0A279EBCC600087AA4 /* libswresample.4.dylib */,
8352D4981CDDB06A009D16AA /* libz.tbd */,
8352D4941CDDB03E009D16AA /* libiconv.tbd */,
1058C7ACFEA557BF11CA2CBB /* Linked Frameworks */,

View File

@ -47,33 +47,6 @@ int64_t ffmpeg_seek(void *opaque, int64_t offset, int whence)
@implementation FFMPEGDecoder
int lockmgr_callback(void ** mutex, enum AVLockOp op)
{
switch (op)
{
case AV_LOCK_CREATE:
*mutex = malloc(sizeof(pthread_mutex_t));
pthread_mutex_init(*mutex, NULL);
break;
case AV_LOCK_DESTROY:
pthread_mutex_destroy(*mutex);
free(*mutex);
*mutex = NULL;
break;
case AV_LOCK_OBTAIN:
pthread_mutex_lock(*mutex);
break;
case AV_LOCK_RELEASE:
pthread_mutex_unlock(*mutex);
break;
}
return 0;
}
+ (void)initialize
{
if(self == [FFMPEGDecoder class])
@ -190,7 +163,7 @@ int lockmgr_callback(void ** mutex, enum AVLockOp op)
}
enum AVCodecID codec_id = codecCtx->codec_id;
AVCodec * codec = NULL;
const AVCodec * codec = NULL;
AVDictionary * dict = NULL;
if (@available(macOS 10.15, *))

View File

@ -33,7 +33,8 @@ ADPCM_CODECS=adpcm_4xm,adpcm_adx,adpcm_afx,adpcm_agm,adpcm_aica,adpcm_argo,adpcm
--enable-decoder=ac3,ac3_t,eac3,eac3_at,wmapro,wmav1,wmav2,wmavoice,wmalossless,xma1,xma2,dca,tak,dsd_lsbf,dsd_lsbf_planar,dsd_mbf,dsd_msbf_planar,aac,aac_at,libfdk_aac,atrac3,atrac3p,mp3float,mp3_at,mp2float,mp2_at,mp1float,mp1_at,bink,binkaudio_dct,binkaudio_rdft,flac,vorbis,ape,smackaud,opus,mpc7,mpc8,alac,alac_at,cook,tta,$PCM_CODECS,$ADPCM_CODECS\
--disable-parser=mpeg4video,h263\
--disable-decoder=mpeg2video,h263,h264,mpeg1video,mpeg2video,mpeg4,hevc,vp9\
--disable-version3
--disable-version3\
--disable-xlib
make -j$(sysctl -n hw.logicalcpu) install

View File

@ -31,7 +31,8 @@ ADPCM_CODECS=adpcm_4xm,adpcm_adx,adpcm_afx,adpcm_agm,adpcm_aica,adpcm_argo,adpcm
--enable-decoder=ac3,ac3_t,eac3,eac3_at,wmapro,wmav1,wmav2,wmavoice,wmalossless,xma1,xma2,dca,tak,dsd_lsbf,dsd_lsbf_planar,dsd_mbf,dsd_msbf_planar,aac,aac_at,libfdk_aac,atrac3,atrac3p,mp3float,mp3_at,mp2float,mp2_at,mp1float,mp1_at,bink,binkaudio_dct,binkaudio_rdft,flac,vorbis,ape,smackaud,opus,mpc7,mpc8,alac,alac_at,cook,tta,$PCM_CODECS,$ADPCM_CODECS\
--disable-parser=mpeg4video,h263\
--disable-decoder=mpeg2video,h263,h264,mpeg1video,mpeg2video,mpeg4,hevc,vp9\
--disable-version3
--disable-version3\
--disable-xlib
make -j$(sysctl -n hw.logicalcpu) install

File diff suppressed because it is too large Load Diff

View File

@ -34,8 +34,6 @@
* @{
*/
typedef struct AVBSFInternal AVBSFInternal;
/**
* The bitstream filter state.
*
@ -57,12 +55,6 @@ typedef struct AVBSFContext {
*/
const struct AVBitStreamFilter *filter;
/**
* Opaque libavcodec internal data. Must not be touched by the caller in any
* way.
*/
AVBSFInternal *internal;
/**
* Opaque filter-specific private data. If filter->priv_class is non-NULL,
* this is an AVOptions-enabled struct.

View File

@ -50,7 +50,12 @@
* avcodec_default_get_buffer2 or avcodec_default_get_encode_buffer.
*/
#define AV_CODEC_CAP_DR1 (1 << 1)
#if FF_API_FLAG_TRUNCATED
/**
* @deprecated Use parsers to always send proper frames.
*/
#define AV_CODEC_CAP_TRUNCATED (1 << 3)
#endif
/**
* Encoder or decoder requires flushing with NULL input at the end in order to
* give the complete and correct output.
@ -214,12 +219,12 @@ typedef struct AVCodec {
* see AV_CODEC_CAP_*
*/
int capabilities;
uint8_t max_lowres; ///< maximum value for lowres supported by the decoder
const AVRational *supported_framerates; ///< array of supported framerates, or NULL if any, array is terminated by {0,0}
const enum AVPixelFormat *pix_fmts; ///< array of supported pixel formats, or NULL if unknown, array is terminated by -1
const int *supported_samplerates; ///< array of supported audio samplerates, or NULL if unknown, array is terminated by 0
const enum AVSampleFormat *sample_fmts; ///< array of supported sample formats, or NULL if unknown, array is terminated by -1
const uint64_t *channel_layouts; ///< array of support channel layouts, or NULL if unknown. array is terminated by 0
uint8_t max_lowres; ///< maximum value for lowres supported by the decoder
const AVClass *priv_class; ///< AVClass for the private context
const AVProfile *profiles; ///< array of recognized profiles, or NULL if unknown, array is terminated by {FF_PROFILE_UNKNOWN}
@ -242,10 +247,13 @@ typedef struct AVCodec {
* New public fields should be added right above.
*****************************************************************
*/
/**
* Internal codec capabilities.
* See FF_CODEC_CAP_* in internal.h
*/
int caps_internal;
int priv_data_size;
#if FF_API_NEXT
struct AVCodec *next;
#endif
/**
* @name Frame-level threading support functions
* @{
@ -258,6 +266,11 @@ typedef struct AVCodec {
* dst and src will (rarely) point to the same context, in which case memcpy should be skipped.
*/
int (*update_thread_context)(struct AVCodecContext *dst, const struct AVCodecContext *src);
/**
* Copy variables back to the user-facing context
*/
int (*update_thread_context_for_user)(struct AVCodecContext *dst, const struct AVCodecContext *src);
/** @} */
/**
@ -321,11 +334,6 @@ typedef struct AVCodec {
* Will be called when seeking
*/
void (*flush)(struct AVCodecContext *);
/**
* Internal codec capabilities.
* See FF_CODEC_CAP_* in internal.h
*/
int caps_internal;
/**
* Decoding only, a comma-separated list of bitstream filters to apply to
@ -365,7 +373,7 @@ const AVCodec *av_codec_iterate(void **opaque);
* @param id AVCodecID of the requested decoder
* @return A decoder if one was found, NULL otherwise.
*/
AVCodec *avcodec_find_decoder(enum AVCodecID id);
const AVCodec *avcodec_find_decoder(enum AVCodecID id);
/**
* Find a registered decoder with the specified name.
@ -373,7 +381,7 @@ AVCodec *avcodec_find_decoder(enum AVCodecID id);
* @param name name of the requested decoder
* @return A decoder if one was found, NULL otherwise.
*/
AVCodec *avcodec_find_decoder_by_name(const char *name);
const AVCodec *avcodec_find_decoder_by_name(const char *name);
/**
* Find a registered encoder with a matching codec ID.
@ -381,7 +389,7 @@ AVCodec *avcodec_find_decoder_by_name(const char *name);
* @param id AVCodecID of the requested encoder
* @return An encoder if one was found, NULL otherwise.
*/
AVCodec *avcodec_find_encoder(enum AVCodecID id);
const AVCodec *avcodec_find_encoder(enum AVCodecID id);
/**
* Find a registered encoder with the specified name.
@ -389,7 +397,7 @@ AVCodec *avcodec_find_encoder(enum AVCodecID id);
* @param name name of the requested encoder
* @return An encoder if one was found, NULL otherwise.
*/
AVCodec *avcodec_find_encoder_by_name(const char *name);
const AVCodec *avcodec_find_encoder_by_name(const char *name);
/**
* @return a non-zero number if codec is an encoder, zero otherwise
*/
@ -400,6 +408,15 @@ int av_codec_is_encoder(const AVCodec *codec);
*/
int av_codec_is_decoder(const AVCodec *codec);
/**
* Return a name for the specified profile, if available.
*
* @param codec the codec that is searched for the given profile
* @param profile the profile value for which a name is requested
* @return A name for the profile if found, NULL otherwise.
*/
const char *av_get_profile_name(const AVCodec *codec, int profile);
enum {
/**
* The codec supports this format via the hw_device_ctx interface.

View File

@ -22,6 +22,7 @@
#define AVCODEC_CODEC_ID_H
#include "libavutil/avutil.h"
#include "libavutil/samplefmt.h"
/**
* @addtogroup lavc_core
@ -246,8 +247,7 @@ enum AVCodecID {
AV_CODEC_ID_MSP2,
AV_CODEC_ID_VVC,
#define AV_CODEC_ID_H266 AV_CODEC_ID_VVC
AV_CODEC_ID_Y41P = 0x8000,
AV_CODEC_ID_Y41P,
AV_CODEC_ID_AVRP,
AV_CODEC_ID_012V,
AV_CODEC_ID_AVUI,
@ -307,6 +307,7 @@ enum AVCodecID {
AV_CODEC_ID_CRI,
AV_CODEC_ID_SIMBIOSIS_IMX,
AV_CODEC_ID_SGA_VIDEO,
AV_CODEC_ID_GEM,
/* various PCM "codecs" */
AV_CODEC_ID_FIRST_AUDIO = 0x10000, ///< A dummy id pointing at the start of audio codecs
@ -341,8 +342,7 @@ enum AVCodecID {
AV_CODEC_ID_PCM_S24LE_PLANAR,
AV_CODEC_ID_PCM_S32LE_PLANAR,
AV_CODEC_ID_PCM_S16BE_PLANAR,
AV_CODEC_ID_PCM_S64LE = 0x10800,
AV_CODEC_ID_PCM_S64LE,
AV_CODEC_ID_PCM_S64BE,
AV_CODEC_ID_PCM_F16LE,
AV_CODEC_ID_PCM_F24LE,
@ -381,8 +381,7 @@ enum AVCodecID {
AV_CODEC_ID_ADPCM_G722,
AV_CODEC_ID_ADPCM_IMA_APC,
AV_CODEC_ID_ADPCM_VIMA,
AV_CODEC_ID_ADPCM_AFC = 0x11800,
AV_CODEC_ID_ADPCM_AFC,
AV_CODEC_ID_ADPCM_IMA_OKI,
AV_CODEC_ID_ADPCM_DTK,
AV_CODEC_ID_ADPCM_IMA_RAD,
@ -401,6 +400,7 @@ enum AVCodecID {
AV_CODEC_ID_ADPCM_IMA_MTF,
AV_CODEC_ID_ADPCM_IMA_CUNNING,
AV_CODEC_ID_ADPCM_IMA_MOFLEX,
AV_CODEC_ID_ADPCM_IMA_ACORN,
/* AMR */
AV_CODEC_ID_AMR_NB = 0x12000,
@ -415,8 +415,7 @@ enum AVCodecID {
AV_CODEC_ID_INTERPLAY_DPCM,
AV_CODEC_ID_XAN_DPCM,
AV_CODEC_ID_SOL_DPCM,
AV_CODEC_ID_SDX2_DPCM = 0x14800,
AV_CODEC_ID_SDX2_DPCM,
AV_CODEC_ID_GREMLIN_DPCM,
AV_CODEC_ID_DERF_DPCM,
@ -489,8 +488,7 @@ enum AVCodecID {
AV_CODEC_ID_ON2AVC,
AV_CODEC_ID_DSS_SP,
AV_CODEC_ID_CODEC2,
AV_CODEC_ID_FFWAVESYNTH = 0x15800,
AV_CODEC_ID_FFWAVESYNTH,
AV_CODEC_ID_SONIC,
AV_CODEC_ID_SONIC_LS,
AV_CODEC_ID_EVRC,
@ -517,6 +515,7 @@ enum AVCodecID {
AV_CODEC_ID_SIREN,
AV_CODEC_ID_HCA,
AV_CODEC_ID_FASTAUDIO,
AV_CODEC_ID_MSNSIREN,
/* subtitle codecs */
AV_CODEC_ID_FIRST_SUBTITLE = 0x17000, ///< A dummy ID pointing at the start of subtitle codecs.
@ -529,8 +528,7 @@ enum AVCodecID {
AV_CODEC_ID_HDMV_PGS_SUBTITLE,
AV_CODEC_ID_DVB_TELETEXT,
AV_CODEC_ID_SRT,
AV_CODEC_ID_MICRODVD = 0x17800,
AV_CODEC_ID_MICRODVD,
AV_CODEC_ID_EIA_608,
AV_CODEC_ID_JACOSUB,
AV_CODEC_ID_SAMI,
@ -554,7 +552,7 @@ enum AVCodecID {
AV_CODEC_ID_SCTE_35, ///< Contain timestamp estimated through PCR of program stream.
AV_CODEC_ID_EPG,
AV_CODEC_ID_BINTEXT = 0x18800,
AV_CODEC_ID_BINTEXT,
AV_CODEC_ID_XBIN,
AV_CODEC_ID_IDF,
AV_CODEC_ID_OTF,
@ -585,6 +583,45 @@ enum AVMediaType avcodec_get_type(enum AVCodecID codec_id);
*/
const char *avcodec_get_name(enum AVCodecID id);
/**
* Return codec bits per sample.
*
* @param[in] codec_id the codec
* @return Number of bits per sample or zero if unknown for the given codec.
*/
int av_get_bits_per_sample(enum AVCodecID codec_id);
/**
* Return codec bits per sample.
* Only return non-zero if the bits per sample is exactly correct, not an
* approximation.
*
* @param[in] codec_id the codec
* @return Number of bits per sample or zero if unknown for the given codec.
*/
int av_get_exact_bits_per_sample(enum AVCodecID codec_id);
/**
* Return a name for the specified profile, if available.
*
* @param codec_id the ID of the codec to which the requested profile belongs
* @param profile the profile value for which a name is requested
* @return A name for the profile if found, NULL otherwise.
*
* @note unlike av_get_profile_name(), which searches a list of profiles
* supported by a specific decoder or encoder implementation, this
* function searches the list of profiles from the AVCodecDescriptor
*/
const char *avcodec_profile_name(enum AVCodecID codec_id, int profile);
/**
* Return the PCM codec associated with a sample format.
* @param be endianness, 0 for little, 1 for big,
* -1 (or anything else) for native
* @return AV_CODEC_ID_PCM_* or AV_CODEC_ID_NONE
*/
enum AVCodecID av_get_pcm_codec(enum AVSampleFormat fmt, int be);
/**
* @}
*/

View File

@ -221,6 +221,11 @@ void avcodec_parameters_free(AVCodecParameters **par);
*/
int avcodec_parameters_copy(AVCodecParameters *dst, const AVCodecParameters *src);
/**
* This function is the same as av_get_audio_frame_duration(), except it works
* with AVCodecParameters instead of an AVCodecContext.
*/
int av_get_audio_frame_duration2(AVCodecParameters *par, int frame_bytes);
/**
* @}

View File

@ -0,0 +1,170 @@
/*
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AVCODEC_DEFS_H
#define AVCODEC_DEFS_H
/**
* @file
* @ingroup libavc
* Misc types and constants that do not belong anywhere else.
*/
#include <stdint.h>
#include <stdlib.h>
/**
* @ingroup lavc_decoding
* Required number of additionally allocated bytes at the end of the input bitstream for decoding.
* This is mainly needed because some optimized bitstream readers read
* 32 or 64 bit at once and could read over the end.<br>
* Note: If the first 23 bits of the additional bytes are not 0, then damaged
* MPEG bitstreams could cause overread and segfault.
*/
#define AV_INPUT_BUFFER_PADDING_SIZE 64
/**
* @ingroup lavc_decoding
*/
enum AVDiscard{
/* We leave some space between them for extensions (drop some
* keyframes for intra-only or drop just some bidir frames). */
AVDISCARD_NONE =-16, ///< discard nothing
AVDISCARD_DEFAULT = 0, ///< discard useless packets like 0 size packets in avi
AVDISCARD_NONREF = 8, ///< discard all non reference
AVDISCARD_BIDIR = 16, ///< discard all bidirectional frames
AVDISCARD_NONINTRA= 24, ///< discard all non intra frames
AVDISCARD_NONKEY = 32, ///< discard all frames except keyframes
AVDISCARD_ALL = 48, ///< discard all
};
enum AVAudioServiceType {
AV_AUDIO_SERVICE_TYPE_MAIN = 0,
AV_AUDIO_SERVICE_TYPE_EFFECTS = 1,
AV_AUDIO_SERVICE_TYPE_VISUALLY_IMPAIRED = 2,
AV_AUDIO_SERVICE_TYPE_HEARING_IMPAIRED = 3,
AV_AUDIO_SERVICE_TYPE_DIALOGUE = 4,
AV_AUDIO_SERVICE_TYPE_COMMENTARY = 5,
AV_AUDIO_SERVICE_TYPE_EMERGENCY = 6,
AV_AUDIO_SERVICE_TYPE_VOICE_OVER = 7,
AV_AUDIO_SERVICE_TYPE_KARAOKE = 8,
AV_AUDIO_SERVICE_TYPE_NB , ///< Not part of ABI
};
/**
* Pan Scan area.
* This specifies the area which should be displayed.
* Note there may be multiple such areas for one frame.
*/
typedef struct AVPanScan {
/**
* id
* - encoding: Set by user.
* - decoding: Set by libavcodec.
*/
int id;
/**
* width and height in 1/16 pel
* - encoding: Set by user.
* - decoding: Set by libavcodec.
*/
int width;
int height;
/**
* position of the top left corner in 1/16 pel for up to 3 fields/frames
* - encoding: Set by user.
* - decoding: Set by libavcodec.
*/
int16_t position[3][2];
} AVPanScan;
/**
* This structure describes the bitrate properties of an encoded bitstream. It
* roughly corresponds to a subset the VBV parameters for MPEG-2 or HRD
* parameters for H.264/HEVC.
*/
typedef struct AVCPBProperties {
/**
* Maximum bitrate of the stream, in bits per second.
* Zero if unknown or unspecified.
*/
int64_t max_bitrate;
/**
* Minimum bitrate of the stream, in bits per second.
* Zero if unknown or unspecified.
*/
int64_t min_bitrate;
/**
* Average bitrate of the stream, in bits per second.
* Zero if unknown or unspecified.
*/
int64_t avg_bitrate;
/**
* The size of the buffer to which the ratecontrol is applied, in bits.
* Zero if unknown or unspecified.
*/
int64_t buffer_size;
/**
* The delay between the time the packet this structure is associated with
* is received and the time when it should be decoded, in periods of a 27MHz
* clock.
*
* UINT64_MAX when unknown or unspecified.
*/
uint64_t vbv_delay;
} AVCPBProperties;
/**
* Allocate a CPB properties structure and initialize its fields to default
* values.
*
* @param size if non-NULL, the size of the allocated struct will be written
* here. This is useful for embedding it in side data.
*
* @return the newly allocated struct or NULL on failure
*/
AVCPBProperties *av_cpb_properties_alloc(size_t *size);
/**
* This structure supplies correlation between a packet timestamp and a wall clock
* production time. The definition follows the Producer Reference Time ('prft')
* as defined in ISO/IEC 14496-12
*/
typedef struct AVProducerReferenceTime {
/**
* A UTC timestamp, in microseconds, since Unix epoch (e.g, av_gettime()).
*/
int64_t wallclock;
int flags;
} AVProducerReferenceTime;
/**
* Encode extradata length to a buffer. Used by xiph codecs.
*
* @param s buffer to write to; must be at least (v/255+1) bytes long
* @param v size of extradata in bytes
* @return number of bytes written to the buffer.
*/
unsigned int av_xiphlacing(unsigned char *s, unsigned int v);
#endif // AVCODEC_DEFS_H

View File

@ -23,7 +23,6 @@
#include "libavutil/pixfmt.h"
#include "libavutil/rational.h"
#include "avcodec.h"
/* minimum number of bytes to read from a DV stream in order to
* determine the profile */

View File

@ -290,6 +290,14 @@ enum AVPacketSideDataType {
*/
AV_PKT_DATA_S12M_TIMECODE,
/**
* HDR10+ dynamic metadata associated with a video frame. The metadata is in
* the form of the AVDynamicHDRPlus struct and contains
* information for color volume transform - application 4 of
* SMPTE 2094-40:2016 standard.
*/
AV_PKT_DATA_DYNAMIC_HDR10_PLUS,
/**
* The number of side data types.
* This is not part of the public API/ABI in the sense that it may
@ -305,11 +313,7 @@ enum AVPacketSideDataType {
typedef struct AVPacketSideData {
uint8_t *data;
#if FF_API_BUFFER_SIZE_T
int size;
#else
size_t size;
#endif
enum AVPacketSideDataType type;
} AVPacketSideData;
@ -388,15 +392,29 @@ typedef struct AVPacket {
int64_t pos; ///< byte position in stream, -1 if unknown
#if FF_API_CONVERGENCE_DURATION
/**
* @deprecated Same as the duration field, but as int64_t. This was required
* for Matroska subtitles, whose duration values could overflow when the
* duration field was still an int.
* for some private data of the user
*/
attribute_deprecated
int64_t convergence_duration;
#endif
void *opaque;
/**
* AVBufferRef for free use by the API user. FFmpeg will never check the
* contents of the buffer ref. FFmpeg calls av_buffer_unref() on it when
* the packet is unreferenced. av_packet_copy_props() calls create a new
* reference with av_buffer_ref() for the target packet's opaque_ref field.
*
* This is unrelated to the opaque field, although it serves a similar
* purpose.
*/
AVBufferRef *opaque_ref;
/**
* Time base of the packet's timestamps.
* In the future, this field may be set on packets output by encoders or
* demuxers, but its value will be by default ignored on input to decoders
* or muxers.
*/
AVRational time_base;
} AVPacket;
#if FF_API_INIT_PACKET
@ -529,45 +547,6 @@ int av_grow_packet(AVPacket *pkt, int grow_by);
*/
int av_packet_from_data(AVPacket *pkt, uint8_t *data, int size);
#if FF_API_AVPACKET_OLD_API
/**
* @warning This is a hack - the packet memory allocation stuff is broken. The
* packet is allocated if it was not really allocated.
*
* @deprecated Use av_packet_ref or av_packet_make_refcounted
*/
attribute_deprecated
int av_dup_packet(AVPacket *pkt);
/**
* Copy packet, including contents
*
* @return 0 on success, negative AVERROR on fail
*
* @deprecated Use av_packet_ref
*/
attribute_deprecated
int av_copy_packet(AVPacket *dst, const AVPacket *src);
/**
* Copy packet side data
*
* @return 0 on success, negative AVERROR on fail
*
* @deprecated Use av_packet_copy_props
*/
attribute_deprecated
int av_copy_packet_side_data(AVPacket *dst, const AVPacket *src);
/**
* Free a packet.
*
* @deprecated Use av_packet_unref
*
* @param pkt packet to free
*/
attribute_deprecated
void av_free_packet(AVPacket *pkt);
#endif
/**
* Allocate new information of a packet.
*
@ -577,11 +556,7 @@ void av_free_packet(AVPacket *pkt);
* @return pointer to fresh allocated data or NULL otherwise
*/
uint8_t* av_packet_new_side_data(AVPacket *pkt, enum AVPacketSideDataType type,
#if FF_API_BUFFER_SIZE_T
int size);
#else
size_t size);
#endif
/**
* Wrap an existing array as a packet side data.
@ -608,11 +583,7 @@ int av_packet_add_side_data(AVPacket *pkt, enum AVPacketSideDataType type,
* @return 0 on success, < 0 on failure
*/
int av_packet_shrink_side_data(AVPacket *pkt, enum AVPacketSideDataType type,
#if FF_API_BUFFER_SIZE_T
int size);
#else
size_t size);
#endif
/**
* Get side information from packet.
@ -624,19 +595,7 @@ int av_packet_shrink_side_data(AVPacket *pkt, enum AVPacketSideDataType type,
* @return pointer to data if present or NULL otherwise
*/
uint8_t* av_packet_get_side_data(const AVPacket *pkt, enum AVPacketSideDataType type,
#if FF_API_BUFFER_SIZE_T
int *size);
#else
size_t *size);
#endif
#if FF_API_MERGE_SD_API
attribute_deprecated
int av_packet_merge_side_data(AVPacket *pkt);
attribute_deprecated
int av_packet_split_side_data(AVPacket *pkt);
#endif
const char *av_packet_side_data_name(enum AVPacketSideDataType type);
@ -647,11 +606,7 @@ const char *av_packet_side_data_name(enum AVPacketSideDataType type);
* @param size pointer to store the size of the returned data
* @return pointer to data if successful, NULL otherwise
*/
#if FF_API_BUFFER_SIZE_T
uint8_t *av_packet_pack_dictionary(AVDictionary *dict, int *size);
#else
uint8_t *av_packet_pack_dictionary(AVDictionary *dict, size_t *size);
#endif
/**
* Unpack a dictionary from side_data.
*
@ -660,12 +615,8 @@ uint8_t *av_packet_pack_dictionary(AVDictionary *dict, size_t *size);
* @param dict the metadata storage dictionary
* @return 0 on success, < 0 on failure
*/
#if FF_API_BUFFER_SIZE_T
int av_packet_unpack_dictionary(const uint8_t *data, int size, AVDictionary **dict);
#else
int av_packet_unpack_dictionary(const uint8_t *data, size_t size,
AVDictionary **dict);
#endif
/**
* Convenience function to free all the side data stored.

View File

@ -1,86 +0,0 @@
/*
* Video Acceleration API (shared data between FFmpeg and the video player)
* HW decode acceleration for MPEG-2, MPEG-4, H.264 and VC-1
*
* Copyright (C) 2008-2009 Splitted-Desktop Systems
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AVCODEC_VAAPI_H
#define AVCODEC_VAAPI_H
/**
* @file
* @ingroup lavc_codec_hwaccel_vaapi
* Public libavcodec VA API header.
*/
#include <stdint.h>
#include "libavutil/attributes.h"
#include "version.h"
#if FF_API_STRUCT_VAAPI_CONTEXT
/**
* @defgroup lavc_codec_hwaccel_vaapi VA API Decoding
* @ingroup lavc_codec_hwaccel
* @{
*/
/**
* This structure is used to share data between the FFmpeg library and
* the client video application.
* This shall be zero-allocated and available as
* AVCodecContext.hwaccel_context. All user members can be set once
* during initialization or through each AVCodecContext.get_buffer()
* function call. In any case, they must be valid prior to calling
* decoding functions.
*
* Deprecated: use AVCodecContext.hw_frames_ctx instead.
*/
struct attribute_deprecated vaapi_context {
/**
* Window system dependent data
*
* - encoding: unused
* - decoding: Set by user
*/
void *display;
/**
* Configuration ID
*
* - encoding: unused
* - decoding: Set by user
*/
uint32_t config_id;
/**
* Context ID (video decode pipeline)
*
* - encoding: unused
* - decoding: Set by user
*/
uint32_t context_id;
};
/* @} */
#endif /* FF_API_STRUCT_VAAPI_CONTEXT */
#endif /* AVCODEC_VAAPI_H */

View File

@ -55,7 +55,6 @@
#include "libavutil/attributes.h"
#include "avcodec.h"
#include "version.h"
struct AVCodecContext;
struct AVFrame;
@ -153,24 +152,6 @@ int av_vdpau_get_surface_parameters(AVCodecContext *avctx, VdpChromaType *type,
*/
AVVDPAUContext *av_vdpau_alloc_context(void);
#if FF_API_VDPAU_PROFILE
/**
* Get a decoder profile that should be used for initializing a VDPAU decoder.
* Should be called from the AVCodecContext.get_format() callback.
*
* @deprecated Use av_vdpau_bind_context() instead.
*
* @param avctx the codec context being used for decoding the stream
* @param profile a pointer into which the result will be written on success.
* The contents of profile are undefined if this function returns
* an error.
*
* @return 0 on success (non-negative), a negative AVERROR on failure.
*/
attribute_deprecated
int av_vdpau_get_profile(AVCodecContext *avctx, VdpDecoderProfile *profile);
#endif
/* @}*/
#endif /* AVCODEC_VDPAU_H */

View File

@ -27,8 +27,8 @@
#include "libavutil/version.h"
#define LIBAVCODEC_VERSION_MAJOR 58
#define LIBAVCODEC_VERSION_MINOR 134
#define LIBAVCODEC_VERSION_MAJOR 59
#define LIBAVCODEC_VERSION_MINOR 18
#define LIBAVCODEC_VERSION_MICRO 100
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
@ -51,122 +51,17 @@
* at once through the bump. This improves the git bisect-ability of the change.
*/
#ifndef FF_API_AVCTX_TIMEBASE
#define FF_API_AVCTX_TIMEBASE (LIBAVCODEC_VERSION_MAJOR < 59)
#endif
#ifndef FF_API_CODED_FRAME
#define FF_API_CODED_FRAME (LIBAVCODEC_VERSION_MAJOR < 59)
#endif
#ifndef FF_API_SIDEDATA_ONLY_PKT
#define FF_API_SIDEDATA_ONLY_PKT (LIBAVCODEC_VERSION_MAJOR < 59)
#endif
#ifndef FF_API_VDPAU_PROFILE
#define FF_API_VDPAU_PROFILE (LIBAVCODEC_VERSION_MAJOR < 59)
#endif
#ifndef FF_API_CONVERGENCE_DURATION
#define FF_API_CONVERGENCE_DURATION (LIBAVCODEC_VERSION_MAJOR < 59)
#endif
#ifndef FF_API_AVPICTURE
#define FF_API_AVPICTURE (LIBAVCODEC_VERSION_MAJOR < 59)
#endif
#ifndef FF_API_AVPACKET_OLD_API
#define FF_API_AVPACKET_OLD_API (LIBAVCODEC_VERSION_MAJOR < 59)
#endif
#ifndef FF_API_RTP_CALLBACK
#define FF_API_RTP_CALLBACK (LIBAVCODEC_VERSION_MAJOR < 59)
#endif
#ifndef FF_API_VBV_DELAY
#define FF_API_VBV_DELAY (LIBAVCODEC_VERSION_MAJOR < 59)
#endif
#ifndef FF_API_CODER_TYPE
#define FF_API_CODER_TYPE (LIBAVCODEC_VERSION_MAJOR < 59)
#endif
#ifndef FF_API_STAT_BITS
#define FF_API_STAT_BITS (LIBAVCODEC_VERSION_MAJOR < 59)
#endif
#ifndef FF_API_PRIVATE_OPT
#define FF_API_PRIVATE_OPT (LIBAVCODEC_VERSION_MAJOR < 59)
#endif
#ifndef FF_API_ASS_TIMING
#define FF_API_ASS_TIMING (LIBAVCODEC_VERSION_MAJOR < 59)
#endif
#ifndef FF_API_OLD_BSF
#define FF_API_OLD_BSF (LIBAVCODEC_VERSION_MAJOR < 59)
#endif
#ifndef FF_API_COPY_CONTEXT
#define FF_API_COPY_CONTEXT (LIBAVCODEC_VERSION_MAJOR < 59)
#endif
#ifndef FF_API_GET_CONTEXT_DEFAULTS
#define FF_API_GET_CONTEXT_DEFAULTS (LIBAVCODEC_VERSION_MAJOR < 59)
#endif
#ifndef FF_API_NVENC_OLD_NAME
#define FF_API_NVENC_OLD_NAME (LIBAVCODEC_VERSION_MAJOR < 59)
#endif
#ifndef FF_API_STRUCT_VAAPI_CONTEXT
#define FF_API_STRUCT_VAAPI_CONTEXT (LIBAVCODEC_VERSION_MAJOR < 59)
#endif
#ifndef FF_API_MERGE_SD_API
#define FF_API_MERGE_SD_API (LIBAVCODEC_VERSION_MAJOR < 59)
#endif
#ifndef FF_API_TAG_STRING
#define FF_API_TAG_STRING (LIBAVCODEC_VERSION_MAJOR < 59)
#endif
#ifndef FF_API_GETCHROMA
#define FF_API_GETCHROMA (LIBAVCODEC_VERSION_MAJOR < 59)
#endif
#ifndef FF_API_CODEC_GET_SET
#define FF_API_CODEC_GET_SET (LIBAVCODEC_VERSION_MAJOR < 59)
#endif
#ifndef FF_API_USER_VISIBLE_AVHWACCEL
#define FF_API_USER_VISIBLE_AVHWACCEL (LIBAVCODEC_VERSION_MAJOR < 59)
#endif
#ifndef FF_API_LOCKMGR
#define FF_API_LOCKMGR (LIBAVCODEC_VERSION_MAJOR < 59)
#endif
#ifndef FF_API_NEXT
#define FF_API_NEXT (LIBAVCODEC_VERSION_MAJOR < 59)
#endif
#ifndef FF_API_UNSANITIZED_BITRATES
#define FF_API_UNSANITIZED_BITRATES (LIBAVCODEC_VERSION_MAJOR < 59)
#endif
#ifndef FF_API_OPENH264_SLICE_MODE
#define FF_API_OPENH264_SLICE_MODE (LIBAVCODEC_VERSION_MAJOR < 59)
#endif
#ifndef FF_API_OPENH264_CABAC
#define FF_API_OPENH264_CABAC (LIBAVCODEC_VERSION_MAJOR < 59)
#endif
#ifndef FF_API_UNUSED_CODEC_CAPS
#define FF_API_UNUSED_CODEC_CAPS (LIBAVCODEC_VERSION_MAJOR < 59)
#endif
#ifndef FF_API_AVPRIV_PUT_BITS
#define FF_API_AVPRIV_PUT_BITS (LIBAVCODEC_VERSION_MAJOR < 59)
#endif
#ifndef FF_API_OLD_ENCDEC
#define FF_API_OLD_ENCDEC (LIBAVCODEC_VERSION_MAJOR < 59)
#endif
#ifndef FF_API_AVCODEC_PIX_FMT
#define FF_API_AVCODEC_PIX_FMT (LIBAVCODEC_VERSION_MAJOR < 59)
#endif
#ifndef FF_API_MPV_RC_STRATEGY
#define FF_API_MPV_RC_STRATEGY (LIBAVCODEC_VERSION_MAJOR < 59)
#endif
#ifndef FF_API_PARSER_CHANGE
#define FF_API_PARSER_CHANGE (LIBAVCODEC_VERSION_MAJOR < 59)
#endif
#ifndef FF_API_THREAD_SAFE_CALLBACKS
#define FF_API_OPENH264_SLICE_MODE (LIBAVCODEC_VERSION_MAJOR < 60)
#define FF_API_OPENH264_CABAC (LIBAVCODEC_VERSION_MAJOR < 60)
#define FF_API_UNUSED_CODEC_CAPS (LIBAVCODEC_VERSION_MAJOR < 60)
#define FF_API_THREAD_SAFE_CALLBACKS (LIBAVCODEC_VERSION_MAJOR < 60)
#endif
#ifndef FF_API_DEBUG_MV
#define FF_API_DEBUG_MV (LIBAVCODEC_VERSION_MAJOR < 60)
#endif
#ifndef FF_API_GET_FRAME_CLASS
#define FF_API_GET_FRAME_CLASS (LIBAVCODEC_VERSION_MAJOR < 60)
#endif
#ifndef FF_API_AUTO_THREADS
#define FF_API_AUTO_THREADS (LIBAVCODEC_VERSION_MAJOR < 60)
#endif
#ifndef FF_API_INIT_PACKET
#define FF_API_INIT_PACKET (LIBAVCODEC_VERSION_MAJOR < 60)
#endif
#define FF_API_AVCTX_TIMEBASE (LIBAVCODEC_VERSION_MAJOR < 60)
#define FF_API_MPEGVIDEO_OPTS (LIBAVCODEC_VERSION_MAJOR < 60)
#define FF_API_FLAG_TRUNCATED (LIBAVCODEC_VERSION_MAJOR < 60)
#define FF_API_SUB_TEXT_FORMAT (LIBAVCODEC_VERSION_MAJOR < 60)
#endif /* AVCODEC_VERSION_H */

View File

@ -309,7 +309,12 @@
#include <time.h>
#include <stdio.h> /* FILE */
#include "libavcodec/avcodec.h"
#include "libavcodec/codec.h"
#include "libavcodec/codec_par.h"
#include "libavcodec/defs.h"
#include "libavcodec/packet.h"
#include "libavutil/dict.h"
#include "libavutil/log.h"
@ -317,6 +322,7 @@
#include "libavformat/version.h"
struct AVFormatContext;
struct AVStream;
struct AVDeviceInfoList;
struct AVDeviceCapabilitiesQuery;
@ -457,6 +463,13 @@ typedef struct AVProbeData {
/// Demuxer will use avio_open, no opened file should be provided by the caller.
#define AVFMT_NOFILE 0x0001
#define AVFMT_NEEDNUMBER 0x0002 /**< Needs '%d' in filename. */
/**
* The muxer/demuxer is experimental and should be used with caution.
*
* - demuxers: will not be selected automatically by probing, must be specified
* explicitly.
*/
#define AVFMT_EXPERIMENTAL 0x0004
#define AVFMT_SHOW_IDS 0x0008 /**< Show format stream IDs numbers. */
#define AVFMT_GLOBALHEADER 0x0040 /**< Format wants global header. */
#define AVFMT_NOTIMESTAMPS 0x0080 /**< Format does not need / have any timestamps. */
@ -525,23 +538,16 @@ typedef struct AVOutputFormat {
* New public fields should be added right above.
*****************************************************************
*/
/**
* The ff_const59 define is not part of the public API and will
* be removed without further warning.
*/
#if FF_API_AVIOFORMAT
#define ff_const59
#else
#define ff_const59 const
#endif
#if FF_API_NEXT
ff_const59 struct AVOutputFormat *next;
#endif
/**
* size of private data so that it can be allocated in the wrapper
*/
int priv_data_size;
/**
* Internal flags. See FF_FMT_FLAG_* in internal.h.
*/
int flags_internal;
int (*write_header)(struct AVFormatContext *);
/**
* Write a packet. If AVFMT_ALLOW_FLUSH is set in flags,
@ -555,9 +561,21 @@ typedef struct AVOutputFormat {
/**
* A format-specific function for interleavement.
* If unset, packets will be interleaved by dts.
*
* @param s An AVFormatContext for output. pkt will be added to
* resp. taken from its packet buffer.
* @param[in,out] pkt A packet to be interleaved if has_packet is set;
* also used to return packets. If no packet is returned
* (e.g. on error), pkt is blank on return.
* @param flush 1 if no further packets are available as input and
* all remaining packets should be output.
* @param has_packet If set, pkt contains a packet to be interleaved
* on input; otherwise pkt is blank on input.
* @return 1 if a packet was output, 0 if no packet could be output,
* < 0 if an error occurred
*/
int (*interleave_packet)(struct AVFormatContext *, AVPacket *out,
AVPacket *in, int flush);
int (*interleave_packet)(struct AVFormatContext *s, AVPacket *pkt,
int flush, int has_packet);
/**
* Test if the given codec can be stored in this container.
*
@ -590,18 +608,6 @@ typedef struct AVOutputFormat {
* @see avdevice_list_devices() for more details.
*/
int (*get_device_list)(struct AVFormatContext *s, struct AVDeviceInfoList *device_list);
#if LIBAVFORMAT_VERSION_MAJOR < 59
/**
* Initialize device capabilities submodule.
* @see avdevice_capabilities_create() for more details.
*/
int (*create_device_capabilities)(struct AVFormatContext *s, struct AVDeviceCapabilitiesQuery *caps);
/**
* Free device capabilities submodule.
* @see avdevice_capabilities_free() for more details.
*/
int (*free_device_capabilities)(struct AVFormatContext *s, struct AVDeviceCapabilitiesQuery *caps);
#endif
enum AVCodecID data_codec; /**< default data codec */
/**
* Initialize format. May allocate data here, and set any AVFormatContext or
@ -625,9 +631,13 @@ typedef struct AVOutputFormat {
/**
* Set up any necessary bitstream filtering and extract any extra data needed
* for the global header.
*
* @note pkt might have been directly forwarded by a meta-muxer; therefore
* pkt->stream_index as well as the pkt's timebase might be invalid.
* Return 0 if more packets from this stream must be checked; 1 if not.
*/
int (*check_bitstream)(struct AVFormatContext *, const AVPacket *pkt);
int (*check_bitstream)(struct AVFormatContext *s, struct AVStream *st,
const AVPacket *pkt);
} AVOutputFormat;
/**
* @}
@ -683,10 +693,6 @@ typedef struct AVInputFormat {
* New public fields should be added right above.
*****************************************************************
*/
#if FF_API_NEXT
ff_const59 struct AVInputFormat *next;
#endif
/**
* Raw demuxers store their codec ID here.
*/
@ -697,6 +703,11 @@ typedef struct AVInputFormat {
*/
int priv_data_size;
/**
* Internal flags. See FF_FMT_FLAG_* in internal.h.
*/
int flags_internal;
/**
* Tell if a given file has a chance of being parsed as this format.
* The buffer provided is guaranteed to be AVPROBE_PADDING_SIZE bytes
@ -771,19 +782,6 @@ typedef struct AVInputFormat {
*/
int (*get_device_list)(struct AVFormatContext *s, struct AVDeviceInfoList *device_list);
#if LIBAVFORMAT_VERSION_MAJOR < 59
/**
* Initialize device capabilities submodule.
* @see avdevice_capabilities_create() for more details.
*/
int (*create_device_capabilities)(struct AVFormatContext *s, struct AVDeviceCapabilitiesQuery *caps);
/**
* Free device capabilities submodule.
* @see avdevice_capabilities_free() for more details.
*/
int (*free_device_capabilities)(struct AVFormatContext *s, struct AVDeviceCapabilitiesQuery *caps);
#endif
} AVInputFormat;
/**
* @}
@ -817,22 +815,56 @@ typedef struct AVIndexEntry {
int min_distance; /**< Minimum distance between this and the previous keyframe, used to avoid unneeded searching. */
} AVIndexEntry;
#define AV_DISPOSITION_DEFAULT 0x0001
#define AV_DISPOSITION_DUB 0x0002
#define AV_DISPOSITION_ORIGINAL 0x0004
#define AV_DISPOSITION_COMMENT 0x0008
#define AV_DISPOSITION_LYRICS 0x0010
#define AV_DISPOSITION_KARAOKE 0x0020
/**
* The stream should be chosen by default among other streams of the same type,
* unless the user has explicitly specified otherwise.
*/
#define AV_DISPOSITION_DEFAULT (1 << 0)
/**
* The stream is not in original language.
*
* @note AV_DISPOSITION_ORIGINAL is the inverse of this disposition. At most
* one of them should be set in properly tagged streams.
* @note This disposition may apply to any stream type, not just audio.
*/
#define AV_DISPOSITION_DUB (1 << 1)
/**
* The stream is in original language.
*
* @see the notes for AV_DISPOSITION_DUB
*/
#define AV_DISPOSITION_ORIGINAL (1 << 2)
/**
* The stream is a commentary track.
*/
#define AV_DISPOSITION_COMMENT (1 << 3)
/**
* The stream contains song lyrics.
*/
#define AV_DISPOSITION_LYRICS (1 << 4)
/**
* The stream contains karaoke audio.
*/
#define AV_DISPOSITION_KARAOKE (1 << 5)
/**
* Track should be used during playback by default.
* Useful for subtitle track that should be displayed
* even when user did not explicitly ask for subtitles.
*/
#define AV_DISPOSITION_FORCED 0x0040
#define AV_DISPOSITION_HEARING_IMPAIRED 0x0080 /**< stream for hearing impaired audiences */
#define AV_DISPOSITION_VISUAL_IMPAIRED 0x0100 /**< stream for visual impaired audiences */
#define AV_DISPOSITION_CLEAN_EFFECTS 0x0200 /**< stream without voice */
#define AV_DISPOSITION_FORCED (1 << 6)
/**
* The stream is intended for hearing impaired audiences.
*/
#define AV_DISPOSITION_HEARING_IMPAIRED (1 << 7)
/**
* The stream is intended for visually impaired audiences.
*/
#define AV_DISPOSITION_VISUAL_IMPAIRED (1 << 8)
/**
* The audio stream contains music and sound effects without voice.
*/
#define AV_DISPOSITION_CLEAN_EFFECTS (1 << 9)
/**
* The stream is stored in the file as an attached picture/"cover art" (e.g.
* APIC frame in ID3v2). The first (usually only) packet associated with it
@ -840,23 +872,53 @@ typedef struct AVIndexEntry {
* seeking takes place. It can also be accessed at any time in
* AVStream.attached_pic.
*/
#define AV_DISPOSITION_ATTACHED_PIC 0x0400
#define AV_DISPOSITION_ATTACHED_PIC (1 << 10)
/**
* The stream is sparse, and contains thumbnail images, often corresponding
* to chapter markers. Only ever used with AV_DISPOSITION_ATTACHED_PIC.
*/
#define AV_DISPOSITION_TIMED_THUMBNAILS 0x0800
typedef struct AVStreamInternal AVStreamInternal;
#define AV_DISPOSITION_TIMED_THUMBNAILS (1 << 11)
/**
* To specify text track kind (different from subtitles default).
* The subtitle stream contains captions, providing a transcription and possibly
* a translation of audio. Typically intended for hearing-impaired audiences.
*/
#define AV_DISPOSITION_CAPTIONS 0x10000
#define AV_DISPOSITION_DESCRIPTIONS 0x20000
#define AV_DISPOSITION_METADATA 0x40000
#define AV_DISPOSITION_DEPENDENT 0x80000 ///< dependent audio stream (mix_type=0 in mpegts)
#define AV_DISPOSITION_STILL_IMAGE 0x100000 ///< still images in video stream (still_picture_flag=1 in mpegts)
#define AV_DISPOSITION_CAPTIONS (1 << 16)
/**
* The subtitle stream contains a textual description of the video content.
* Typically intended for visually-impaired audiences or for the cases where the
* video cannot be seen.
*/
#define AV_DISPOSITION_DESCRIPTIONS (1 << 17)
/**
* The subtitle stream contains time-aligned metadata that is not intended to be
* directly presented to the user.
*/
#define AV_DISPOSITION_METADATA (1 << 18)
/**
* The audio stream is intended to be mixed with another stream before
* presentation.
* Corresponds to mix_type=0 in mpegts.
*/
#define AV_DISPOSITION_DEPENDENT (1 << 19)
/**
* The video stream contains still images.
*/
#define AV_DISPOSITION_STILL_IMAGE (1 << 20)
/**
* @return The AV_DISPOSITION_* flag corresponding to disp or a negative error
* code if disp does not correspond to a known stream disposition.
*/
int av_disposition_from_string(const char *disp);
/**
* @param disposition a combination of AV_DISPOSITION_* values
* @return The string description corresponding to the lowest set bit in
* disposition. NULL when the lowest set bit does not correspond
* to a known disposition or when disposition is 0.
*/
const char *av_disposition_to_string(int disposition);
/**
* Options for behavior on timestamp wrap detection.
@ -873,6 +935,13 @@ typedef struct AVStreamInternal AVStreamInternal;
* sizeof(AVStream) must not be used outside libav*.
*/
typedef struct AVStream {
#if FF_API_AVSTREAM_CLASS
/**
* A class for @ref avoptions. Set on stream creation.
*/
const AVClass *av_class;
#endif
int index; /**< stream index in AVFormatContext */
/**
* Format-specific stream ID.
@ -880,13 +949,7 @@ typedef struct AVStream {
* encoding: set by the user, replaced by libavformat if left unset
*/
int id;
#if FF_API_LAVF_AVCTX
/**
* @deprecated use the codecpar struct instead
*/
attribute_deprecated
AVCodecContext *codec;
#endif
void *priv_data;
/**
@ -925,7 +988,13 @@ typedef struct AVStream {
int64_t nb_frames; ///< number of frames in this stream if known or 0
int disposition; /**< AV_DISPOSITION_* bit field */
/**
* Stream disposition - a combination of AV_DISPOSITION_* flags.
* - demuxing: set by libavformat when creating the stream or in
* avformat_find_stream_info().
* - muxing: may be set by the caller before avformat_write_header().
*/
int disposition;
enum AVDiscard discard; ///< Selects which packets can be discarded at will and do not need to be demuxed.
@ -1016,18 +1085,6 @@ typedef struct AVStream {
*/
AVRational r_frame_rate;
#if FF_API_LAVF_FFSERVER
/**
* String containing pairs of key and values describing recommended encoder configuration.
* Pairs are separated by ','.
* Keys are separated from values by '='.
*
* @deprecated unused
*/
attribute_deprecated
char *recommended_encoder_configuration;
#endif
/**
* Codec parameters associated with this stream. Allocated and freed by
* libavformat in avformat_new_stream() and avformat_free_context()
@ -1039,99 +1096,16 @@ typedef struct AVStream {
*/
AVCodecParameters *codecpar;
/*****************************************************************
* All fields below this line are not part of the public API. They
* may not be used outside of libavformat and can be changed and
* removed at will.
* Internal note: be aware that physically removing these fields
* will break ABI. Replace removed fields with dummy fields, and
* add new fields to AVStreamInternal.
*****************************************************************
*/
#if LIBAVFORMAT_VERSION_MAJOR < 59
// kept for ABI compatibility only, do not access in any way
void *unused;
#endif
int pts_wrap_bits; /**< number of bits in pts (used for wrapping control) */
// Timestamp generation support:
/**
* Timestamp corresponding to the last dts sync point.
* Number of bits in timestamps. Used for wrapping control.
*
* - demuxing: set by libavformat
* - muxing: set by libavformat
*
* Initialized when AVCodecParserContext.dts_sync_point >= 0 and
* a DTS is received from the underlying container. Otherwise set to
* AV_NOPTS_VALUE by default.
*/
int64_t first_dts;
int64_t cur_dts;
int64_t last_IP_pts;
int last_IP_duration;
/**
* Number of packets to buffer for codec probing
*/
int probe_packets;
/**
* Number of frames that have been demuxed during avformat_find_stream_info()
*/
int codec_info_nb_frames;
/* av_read_frame() support */
enum AVStreamParseType need_parsing;
struct AVCodecParserContext *parser;
#if LIBAVFORMAT_VERSION_MAJOR < 59
// kept for ABI compatibility only, do not access in any way
void *unused7;
AVProbeData unused6;
int64_t unused5[16+1];
#endif
AVIndexEntry *index_entries; /**< Only used if the format does not
support seeking natively. */
int nb_index_entries;
unsigned int index_entries_allocated_size;
/**
* Stream Identifier
* This is the MPEG-TS stream identifier +1
* 0 means unknown
*/
int stream_identifier;
#if LIBAVFORMAT_VERSION_MAJOR < 59
// kept for ABI compatibility only, do not access in any way
int unused8;
int unused9;
int unused10;
#endif
/**
* An opaque field for libavformat internal usage.
* Must not be accessed in any way by callers.
*/
AVStreamInternal *internal;
int pts_wrap_bits;
} AVStream;
#if FF_API_FORMAT_GET_SET
/**
* Accessors for some AVStream fields. These used to be provided for ABI
* compatibility, and do not need to be used anymore.
*/
attribute_deprecated
AVRational av_stream_get_r_frame_rate(const AVStream *s);
attribute_deprecated
void av_stream_set_r_frame_rate(AVStream *s, AVRational r);
#if FF_API_LAVF_FFSERVER
attribute_deprecated
char* av_stream_get_recommended_encoder_configuration(const AVStream *s);
attribute_deprecated
void av_stream_set_recommended_encoder_configuration(AVStream *s, char *configuration);
#endif
#endif
struct AVCodecParserContext *av_stream_get_parser(const AVStream *s);
/**
@ -1185,11 +1159,7 @@ typedef struct AVProgram {
change dynamically at runtime. */
typedef struct AVChapter {
#if FF_API_CHAPTER_ID_INT
int id; ///< unique ID to identify the chapter
#else
int64_t id; ///< unique ID to identify the chapter
#endif
AVRational time_base; ///< time base in which the start/end timestamps are specified
int64_t start, end; ///< chapter start/end time in time_base units
AVDictionary *metadata;
@ -1215,8 +1185,6 @@ enum AVDurationEstimationMethod {
AVFMT_DURATION_FROM_BITRATE ///< Duration estimated from bitrate (less accurate)
};
typedef struct AVFormatInternal AVFormatInternal;
/**
* Format I/O context.
* New fields can be added to the end with minor version bumps.
@ -1243,14 +1211,14 @@ typedef struct AVFormatContext {
*
* Demuxing only, set by avformat_open_input().
*/
ff_const59 struct AVInputFormat *iformat;
const struct AVInputFormat *iformat;
/**
* The output container format.
*
* Muxing only, must be set by the caller before avformat_write_header().
*/
ff_const59 struct AVOutputFormat *oformat;
const struct AVOutputFormat *oformat;
/**
* Format private data. This is an AVOptions-enabled struct
@ -1301,19 +1269,6 @@ typedef struct AVFormatContext {
*/
AVStream **streams;
#if FF_API_FORMAT_FILENAME
/**
* input or output filename
*
* - demuxing: set by avformat_open_input()
* - muxing: may be set by the caller before avformat_write_header()
*
* @deprecated Use url instead.
*/
attribute_deprecated
char filename[1024];
#endif
/**
* input or output URL. Unlike the old filename field, this field has no
* length restriction.
@ -1380,24 +1335,24 @@ typedef struct AVFormatContext {
* This flag is mainly intended for testing.
*/
#define AVFMT_FLAG_BITEXACT 0x0400
#if FF_API_LAVF_MP4A_LATM
#define AVFMT_FLAG_MP4A_LATM 0x8000 ///< Deprecated, does nothing.
#endif
#define AVFMT_FLAG_SORT_DTS 0x10000 ///< try to interleave outputted packets by dts (using this flag can slow demuxing down)
#if FF_API_LAVF_PRIV_OPT
#define AVFMT_FLAG_PRIV_OPT 0x20000 ///< Enable use of private options by delaying codec open (deprecated, will do nothing once av_demuxer_open() is removed)
#endif
#if FF_API_LAVF_KEEPSIDE_FLAG
#define AVFMT_FLAG_KEEP_SIDE_DATA 0x40000 ///< Deprecated, does nothing.
#define AVFMT_FLAG_PRIV_OPT 0x20000 ///< Enable use of private options by delaying codec open (deprecated, does nothing)
#endif
#define AVFMT_FLAG_FAST_SEEK 0x80000 ///< Enable fast, but inaccurate seeks for some formats
#define AVFMT_FLAG_SHORTEST 0x100000 ///< Stop muxing when the shortest stream stops.
#define AVFMT_FLAG_AUTO_BSF 0x200000 ///< Add bitstream filters as requested by the muxer
/**
* Maximum size of the data read from input for determining
* the input container format.
* Maximum number of bytes read from input in order to determine stream
* properties. Used when reading the global header and in
* avformat_find_stream_info().
*
* Demuxing only, set by the caller before avformat_open_input().
*
* @note this is \e not used for determining the \ref AVInputFormat
* "input format"
* @sa format_probesize
*/
int64_t probesize;
@ -1672,9 +1627,13 @@ typedef struct AVFormatContext {
int probe_score;
/**
* number of bytes to read maximally to identify format.
* - encoding: unused
* - decoding: set by user
* Maximum number of bytes read from input in order to identify the
* \ref AVInputFormat "input format". Only used when the format is not set
* explicitly by the caller.
*
* Demuxing only, set by the caller before avformat_open_input().
*
* @sa probesize
*/
int format_probesize;
@ -1694,12 +1653,6 @@ typedef struct AVFormatContext {
*/
char *format_whitelist;
/**
* An opaque field for libavformat internal usage.
* Must not be accessed in any way by callers.
*/
AVFormatInternal *internal;
/**
* IO repositioned flag.
* This is set by avformat when the underlaying IO context read pointer
@ -1714,7 +1667,7 @@ typedef struct AVFormatContext {
* the same codec_id.
* Demuxing: Set by user
*/
AVCodec *video_codec;
const AVCodec *video_codec;
/**
* Forced audio codec.
@ -1722,7 +1675,7 @@ typedef struct AVFormatContext {
* the same codec_id.
* Demuxing: Set by user
*/
AVCodec *audio_codec;
const AVCodec *audio_codec;
/**
* Forced subtitle codec.
@ -1730,7 +1683,7 @@ typedef struct AVFormatContext {
* the same codec_id.
* Demuxing: Set by user
*/
AVCodec *subtitle_codec;
const AVCodec *subtitle_codec;
/**
* Forced data codec.
@ -1738,7 +1691,7 @@ typedef struct AVFormatContext {
* the same codec_id.
* Demuxing: Set by user
*/
AVCodec *data_codec;
const AVCodec *data_codec;
/**
* Number of bytes to be written as padding in a metadata header.
@ -1778,28 +1731,6 @@ typedef struct AVFormatContext {
*/
enum AVCodecID data_codec_id;
#if FF_API_OLD_OPEN_CALLBACKS
/**
* Called to open further IO contexts when needed for demuxing.
*
* This can be set by the user application to perform security checks on
* the URLs before opening them.
* The function should behave like avio_open2(), AVFormatContext is provided
* as contextual information and to reach AVFormatContext.opaque.
*
* If NULL then some simple checks are used together with avio_open2().
*
* Must not be accessed directly from outside avformat.
* @See av_format_set_open_cb()
*
* Demuxing: Set by user.
*
* @deprecated Use io_open and io_close.
*/
attribute_deprecated
int (*open_cb)(struct AVFormatContext *s, AVIOContext **p, const char *url, int flags, const AVIOInterruptCB *int_cb, AVDictionary **options);
#endif
/**
* ',' separated list of allowed protocols.
* - encoding: unused
@ -1862,48 +1793,20 @@ typedef struct AVFormatContext {
* - decoding: set by user
*/
int max_probe_packets;
} AVFormatContext;
#if FF_API_FORMAT_GET_SET
/**
* Accessors for some AVFormatContext fields. These used to be provided for ABI
* compatibility, and do not need to be used anymore.
*/
attribute_deprecated
int av_format_get_probe_score(const AVFormatContext *s);
attribute_deprecated
AVCodec * av_format_get_video_codec(const AVFormatContext *s);
attribute_deprecated
void av_format_set_video_codec(AVFormatContext *s, AVCodec *c);
attribute_deprecated
AVCodec * av_format_get_audio_codec(const AVFormatContext *s);
attribute_deprecated
void av_format_set_audio_codec(AVFormatContext *s, AVCodec *c);
attribute_deprecated
AVCodec * av_format_get_subtitle_codec(const AVFormatContext *s);
attribute_deprecated
void av_format_set_subtitle_codec(AVFormatContext *s, AVCodec *c);
attribute_deprecated
AVCodec * av_format_get_data_codec(const AVFormatContext *s);
attribute_deprecated
void av_format_set_data_codec(AVFormatContext *s, AVCodec *c);
attribute_deprecated
int av_format_get_metadata_header_padding(const AVFormatContext *s);
attribute_deprecated
void av_format_set_metadata_header_padding(AVFormatContext *s, int c);
attribute_deprecated
void * av_format_get_opaque(const AVFormatContext *s);
attribute_deprecated
void av_format_set_opaque(AVFormatContext *s, void *opaque);
attribute_deprecated
av_format_control_message av_format_get_control_message_cb(const AVFormatContext *s);
attribute_deprecated
void av_format_set_control_message_cb(AVFormatContext *s, av_format_control_message callback);
#if FF_API_OLD_OPEN_CALLBACKS
attribute_deprecated AVOpenCallback av_format_get_open_cb(const AVFormatContext *s);
attribute_deprecated void av_format_set_open_cb(AVFormatContext *s, AVOpenCallback callback);
#endif
#endif
/**
* A callback for closing the streams opened with AVFormatContext.io_open().
*
* Using this is preferred over io_close, because this can return an error.
* Therefore this callback is used instead of io_close by the generic
* libavformat code if io_close is NULL or the default.
*
* @param s the format context
* @param pb IO context to be closed and freed
* @return 0 on success, a negative AVERROR code on failure
*/
int (*io_close2)(struct AVFormatContext *s, AVIOContext *pb);
} AVFormatContext;
/**
* This function will cause global side data to be injected in the next packet
@ -1942,24 +1845,6 @@ const char *avformat_configuration(void);
*/
const char *avformat_license(void);
#if FF_API_NEXT
/**
* Initialize libavformat and register all the muxers, demuxers and
* protocols. If you do not call this function, then you can select
* exactly which formats you want to support.
*
* @see av_register_input_format()
* @see av_register_output_format()
*/
attribute_deprecated
void av_register_all(void);
attribute_deprecated
void av_register_input_format(AVInputFormat *format);
attribute_deprecated
void av_register_output_format(AVOutputFormat *format);
#endif
/**
* Do global initialization of network libraries. This is optional,
* and not recommended anymore.
@ -1982,24 +1867,6 @@ int avformat_network_init(void);
*/
int avformat_network_deinit(void);
#if FF_API_NEXT
/**
* If f is NULL, returns the first registered input format,
* if f is non-NULL, returns the next registered input format after f
* or NULL if f is the last one.
*/
attribute_deprecated
AVInputFormat *av_iformat_next(const AVInputFormat *f);
/**
* If f is NULL, returns the first registered output format,
* if f is non-NULL, returns the next registered output format after f
* or NULL if f is the last one.
*/
attribute_deprecated
AVOutputFormat *av_oformat_next(const AVOutputFormat *f);
#endif
/**
* Iterate over all registered muxers.
*
@ -2043,6 +1910,14 @@ void avformat_free_context(AVFormatContext *s);
*/
const AVClass *avformat_get_class(void);
/**
* Get the AVClass for AVStream. It can be used in combination with
* AV_OPT_SEARCH_FAKE_OBJ for examining options.
*
* @see av_opt_find().
*/
const AVClass *av_stream_get_class(void);
/**
* Add a new stream to a media file.
*
@ -2052,13 +1927,11 @@ const AVClass *avformat_get_class(void);
*
* When muxing, should be called by the user before avformat_write_header().
*
* User is required to call avcodec_close() and avformat_free_context() to
* clean up the allocation by avformat_new_stream().
* User is required to call avformat_free_context() to clean up the allocation
* by avformat_new_stream().
*
* @param s media file handle
* @param c If non-NULL, the AVCodecContext corresponding to the new stream
* will be initialized to use this codec. This is needed for e.g. codec-specific
* defaults to be set, so codec should be provided if it is known.
* @param c unused, does nothing
*
* @return newly created stream or NULL on error.
*/
@ -2088,11 +1961,7 @@ int av_stream_add_side_data(AVStream *st, enum AVPacketSideDataType type,
* @return pointer to fresh allocated data or NULL otherwise
*/
uint8_t *av_stream_new_side_data(AVStream *stream,
#if FF_API_BUFFER_SIZE_T
enum AVPacketSideDataType type, int size);
#else
enum AVPacketSideDataType type, size_t size);
#endif
/**
* Get side information from stream.
*
@ -2103,11 +1972,7 @@ uint8_t *av_stream_new_side_data(AVStream *stream,
* @return pointer to data if present or NULL otherwise
*/
uint8_t *av_stream_get_side_data(const AVStream *stream,
#if FF_API_BUFFER_SIZE_T
enum AVPacketSideDataType type, int *size);
#else
enum AVPacketSideDataType type, size_t *size);
#endif
AVProgram *av_new_program(AVFormatContext *s, int id);
@ -2132,7 +1997,7 @@ AVProgram *av_new_program(AVFormatContext *s, int id);
* @return >= 0 in case of success, a negative AVERROR code in case of
* failure
*/
int avformat_alloc_output_context2(AVFormatContext **ctx, ff_const59 AVOutputFormat *oformat,
int avformat_alloc_output_context2(AVFormatContext **ctx, const AVOutputFormat *oformat,
const char *format_name, const char *filename);
/**
@ -2143,7 +2008,7 @@ int avformat_alloc_output_context2(AVFormatContext **ctx, ff_const59 AVOutputFor
/**
* Find AVInputFormat based on the short name of the input format.
*/
ff_const59 AVInputFormat *av_find_input_format(const char *short_name);
const AVInputFormat *av_find_input_format(const char *short_name);
/**
* Guess the file format.
@ -2152,7 +2017,7 @@ ff_const59 AVInputFormat *av_find_input_format(const char *short_name);
* @param is_opened Whether the file is already opened; determines whether
* demuxers with or without AVFMT_NOFILE are probed.
*/
ff_const59 AVInputFormat *av_probe_input_format(ff_const59 AVProbeData *pd, int is_opened);
const AVInputFormat *av_probe_input_format(const AVProbeData *pd, int is_opened);
/**
* Guess the file format.
@ -2166,7 +2031,8 @@ ff_const59 AVInputFormat *av_probe_input_format(ff_const59 AVProbeData *pd, int
* If the score is <= AVPROBE_SCORE_MAX / 4 it is recommended
* to retry with a larger probe buffer.
*/
ff_const59 AVInputFormat *av_probe_input_format2(ff_const59 AVProbeData *pd, int is_opened, int *score_max);
const AVInputFormat *av_probe_input_format2(const AVProbeData *pd,
int is_opened, int *score_max);
/**
* Guess the file format.
@ -2175,7 +2041,8 @@ ff_const59 AVInputFormat *av_probe_input_format2(ff_const59 AVProbeData *pd, int
* demuxers with or without AVFMT_NOFILE are probed.
* @param score_ret The score of the best detection.
*/
ff_const59 AVInputFormat *av_probe_input_format3(ff_const59 AVProbeData *pd, int is_opened, int *score_ret);
const AVInputFormat *av_probe_input_format3(const AVProbeData *pd,
int is_opened, int *score_ret);
/**
* Probe a bytestream to determine the input format. Each time a probe returns
@ -2193,14 +2060,14 @@ ff_const59 AVInputFormat *av_probe_input_format3(ff_const59 AVProbeData *pd, int
* the maximal score is AVPROBE_SCORE_MAX
* AVERROR code otherwise
*/
int av_probe_input_buffer2(AVIOContext *pb, ff_const59 AVInputFormat **fmt,
int av_probe_input_buffer2(AVIOContext *pb, const AVInputFormat **fmt,
const char *url, void *logctx,
unsigned int offset, unsigned int max_probe_size);
/**
* Like av_probe_input_buffer2() but returns 0 on success
*/
int av_probe_input_buffer(AVIOContext *pb, ff_const59 AVInputFormat **fmt,
int av_probe_input_buffer(AVIOContext *pb, const AVInputFormat **fmt,
const char *url, void *logctx,
unsigned int offset, unsigned int max_probe_size);
@ -2223,15 +2090,8 @@ int av_probe_input_buffer(AVIOContext *pb, ff_const59 AVInputFormat **fmt,
*
* @note If you want to use custom IO, preallocate the format context and set its pb field.
*/
int avformat_open_input(AVFormatContext **ps, const char *url, ff_const59 AVInputFormat *fmt, AVDictionary **options);
#if FF_API_DEMUXER_OPEN
/**
* @deprecated Use an AVDictionary to pass options to a demuxer.
*/
attribute_deprecated
int av_demuxer_open(AVFormatContext *ic);
#endif
int avformat_open_input(AVFormatContext **ps, const char *url,
const AVInputFormat *fmt, AVDictionary **options);
/**
* Read packets of a media file to get stream information. This
@ -2298,7 +2158,7 @@ int av_find_best_stream(AVFormatContext *ic,
enum AVMediaType type,
int wanted_stream_nb,
int related_stream,
AVCodec **decoder_ret,
const AVCodec **decoder_ret,
int flags);
/**
@ -2512,7 +2372,7 @@ int av_write_frame(AVFormatContext *s, AVPacket *pkt);
* Write a packet to an output media file ensuring correct interleaving.
*
* This function will buffer the packets internally as needed to make sure the
* packets in the output file are properly interleaved in the order of
* packets in the output file are properly interleaved, usually ordered by
* increasing dts. Callers doing their own interleaving should call
* av_write_frame() instead of this function.
*
@ -2525,10 +2385,10 @@ int av_write_frame(AVFormatContext *s, AVPacket *pkt);
* <br>
* If the packet is reference-counted, this function will take
* ownership of this reference and unreference it later when it sees
* fit.
* The caller must not access the data through this reference after
* this function returns. If the packet is not reference-counted,
* libavformat will make a copy.
* fit. If the packet is not reference-counted, libavformat will
* make a copy.
* The returned packet will be blank (as if returned from
* av_packet_alloc()), even on error.
* <br>
* This parameter can be NULL (at any time, not just at the end), to
* flush the interleaving queues.
@ -2544,10 +2404,9 @@ int av_write_frame(AVFormatContext *s, AVPacket *pkt);
* The dts for subsequent packets in one stream must be strictly
* increasing (unless the output format is flagged with the
* AVFMT_TS_NONSTRICT, then they merely have to be nondecreasing).
* @ref AVPacket.duration "duration") should also be set if known.
* @ref AVPacket.duration "duration" should also be set if known.
*
* @return 0 on success, a negative AVERROR on error. Libavformat will always
* take care of freeing the packet, even if this function fails.
* @return 0 on success, a negative AVERROR on error.
*
* @see av_write_frame(), AVFormatContext.max_interleave_delta
*/
@ -2614,16 +2473,16 @@ int av_write_trailer(AVFormatContext *s);
* @param mime_type if non-NULL checks if mime_type matches with the
* MIME type of the registered formats
*/
ff_const59 AVOutputFormat *av_guess_format(const char *short_name,
const char *filename,
const char *mime_type);
const AVOutputFormat *av_guess_format(const char *short_name,
const char *filename,
const char *mime_type);
/**
* Guess the codec ID based upon muxer and filename.
*/
enum AVCodecID av_guess_codec(ff_const59 AVOutputFormat *fmt, const char *short_name,
const char *filename, const char *mime_type,
enum AVMediaType type);
enum AVCodecID av_guess_codec(const AVOutputFormat *fmt, const char *short_name,
const char *filename, const char *mime_type,
enum AVMediaType type);
/**
* Get timing information for the data currently output.
@ -2755,6 +2614,45 @@ int av_find_default_stream_index(AVFormatContext *s);
*/
int av_index_search_timestamp(AVStream *st, int64_t timestamp, int flags);
/**
* Get the index entry count for the given AVStream.
*
* @param st stream
* @return the number of index entries in the stream
*/
int avformat_index_get_entries_count(const AVStream *st);
/**
* Get the AVIndexEntry corresponding to the given index.
*
* @param st Stream containing the requested AVIndexEntry.
* @param idx The desired index.
* @return A pointer to the requested AVIndexEntry if it exists, NULL otherwise.
*
* @note The pointer returned by this function is only guaranteed to be valid
* until any function that takes the stream or the parent AVFormatContext
* as input argument is called.
*/
const AVIndexEntry *avformat_index_get_entry(AVStream *st, int idx);
/**
* Get the AVIndexEntry corresponding to the given timestamp.
*
* @param st Stream containing the requested AVIndexEntry.
* @param timestamp Timestamp to retrieve the index entry for.
* @param flags If AVSEEK_FLAG_BACKWARD then the returned entry will correspond
* to the timestamp which is <= the requested one, if backward
* is 0, then it will be >=
* if AVSEEK_FLAG_ANY seek to any frame, only keyframes otherwise.
* @return A pointer to the requested AVIndexEntry if it exists, NULL otherwise.
*
* @note The pointer returned by this function is only guaranteed to be valid
* until any function that takes the stream or the parent AVFormatContext
* as input argument is called.
*/
const AVIndexEntry *avformat_index_get_entry_from_timestamp(AVStream *st,
int64_t wanted_timestamp,
int flags);
/**
* Add an index entry into a sorted list. Update the entry if the list
* already contains it.
@ -2958,23 +2856,6 @@ int avformat_match_stream_specifier(AVFormatContext *s, AVStream *st,
int avformat_queue_attached_pictures(AVFormatContext *s);
#if FF_API_OLD_BSF
/**
* Apply a list of bitstream filters to a packet.
*
* @param codec AVCodecContext, usually from an AVStream
* @param pkt the packet to apply filters to. If, on success, the returned
* packet has size == 0 and side_data_elems == 0, it indicates that
* the packet should be dropped
* @param bsfc a NULL-terminated list of filters to apply
* @return >=0 on success;
* AVERROR code on failure
*/
attribute_deprecated
int av_apply_bitstream_filters(AVCodecContext *codec, AVPacket *pkt,
AVBitStreamFilterContext *bsfc);
#endif
enum AVTimebaseSource {
AVFMT_TBCF_AUTO = -1,
AVFMT_TBCF_DECODER,

View File

@ -148,9 +148,9 @@ enum AVIODataMarkerType {
/**
* Bytestream IO Context.
* New fields can be added to the end with minor version bumps.
* Removal, reordering and changes to existing fields require a major
* version bump.
* New public fields can be added with minor version bumps.
* Removal, reordering and changes to existing public fields require
* a major version bump.
* sizeof(AVIOContext) must not be used outside libav*.
*
* @note None of the function pointers in AVIOContext should be called
@ -237,12 +237,14 @@ typedef struct AVIOContext {
int64_t (*seek)(void *opaque, int64_t offset, int whence);
int64_t pos; /**< position in the file of the current buffer */
int eof_reached; /**< true if was unable to read due to error or eof */
int error; /**< contains the error code or 0 if no error happened */
int write_flag; /**< true if open for writing */
int max_packet_size;
int min_packet_size; /**< Try to buffer at least this amount of data
before flushing it. */
unsigned long checksum;
unsigned char *checksum_ptr;
unsigned long (*update_checksum)(unsigned long checksum, const uint8_t *buf, unsigned int size);
int error; /**< contains the error code or 0 if no error happened */
/**
* Pause or resume playback for network streaming protocols - e.g. MMS.
*/
@ -259,12 +261,6 @@ typedef struct AVIOContext {
*/
int seekable;
/**
* max filesize, used to limit allocations
* This field is internal to libavformat and access from outside is not allowed.
*/
int64_t maxsize;
/**
* avio_read and avio_write should if possible be satisfied directly
* instead of going through a buffer, and avio_seek will always
@ -272,37 +268,6 @@ typedef struct AVIOContext {
*/
int direct;
/**
* Bytes read statistic
* This field is internal to libavformat and access from outside is not allowed.
*/
int64_t bytes_read;
/**
* seek statistic
* This field is internal to libavformat and access from outside is not allowed.
*/
int seek_count;
/**
* writeout statistic
* This field is internal to libavformat and access from outside is not allowed.
*/
int writeout_count;
/**
* Original buffer size
* used internally after probing and ensure seekback to reset the buffer size
* This field is internal to libavformat and access from outside is not allowed.
*/
int orig_buffer_size;
/**
* Threshold to favor readahead over seek.
* This is current internal only, do not use from outside.
*/
int short_seek_threshold;
/**
* ',' separated list of allowed protocols.
*/
@ -325,19 +290,15 @@ typedef struct AVIOContext {
*/
int ignore_boundary_point;
#if FF_API_AVIOCONTEXT_WRITTEN
/**
* Internal, not meant to be used from outside of AVIOContext.
* @deprecated field utilized privately by libavformat. For a public
* statistic of how many bytes were written out, see
* AVIOContext::bytes_written.
*/
enum AVIODataMarkerType current_type;
int64_t last_time;
/**
* A callback that is used instead of short_seek_threshold.
* This is current internal only, do not use from outside.
*/
int (*short_seek_get)(void *opaque);
attribute_deprecated
int64_t written;
#endif
/**
* Maximum reached position before a backward seek in the write buffer,
@ -346,9 +307,14 @@ typedef struct AVIOContext {
unsigned char *buf_ptr_max;
/**
* Try to buffer at least this amount of data before flushing it
* Read-only statistic of bytes read for this AVIOContext.
*/
int min_packet_size;
int64_t bytes_read;
/**
* Read-only statistic of bytes written for this AVIOContext.
*/
int64_t bytes_written;
} AVIOContext;
/**
@ -374,25 +340,6 @@ const char *avio_find_protocol_name(const char *url);
*/
int avio_check(const char *url, int flags);
/**
* Move or rename a resource.
*
* @note url_src and url_dst should share the same protocol and authority.
*
* @param url_src url to resource to be moved
* @param url_dst new url to resource if the operation succeeded
* @return >=0 on success or negative on error.
*/
int avpriv_io_move(const char *url_src, const char *url_dst);
/**
* Delete a resource.
*
* @param url resource to be deleted.
* @return >=0 on success or negative on error.
*/
int avpriv_io_delete(const char *url);
/**
* Open directory for reading.
*

View File

@ -31,8 +31,8 @@
// Major bumping may affect Ticket5467, 5421, 5451(compatibility with Chromium)
// Also please add any ticket numbers that you believe might be affected here
#define LIBAVFORMAT_VERSION_MAJOR 58
#define LIBAVFORMAT_VERSION_MINOR 76
#define LIBAVFORMAT_VERSION_MAJOR 59
#define LIBAVFORMAT_VERSION_MINOR 16
#define LIBAVFORMAT_VERSION_MICRO 100
#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
@ -55,69 +55,13 @@
* at once through the bump. This improves the git bisect-ability of the change.
*
*/
#ifndef FF_API_COMPUTE_PKT_FIELDS2
#define FF_API_COMPUTE_PKT_FIELDS2 (LIBAVFORMAT_VERSION_MAJOR < 59)
#endif
#ifndef FF_API_OLD_OPEN_CALLBACKS
#define FF_API_OLD_OPEN_CALLBACKS (LIBAVFORMAT_VERSION_MAJOR < 59)
#endif
#ifndef FF_API_LAVF_AVCTX
#define FF_API_LAVF_AVCTX (LIBAVFORMAT_VERSION_MAJOR < 59)
#endif
#ifndef FF_API_HTTP_USER_AGENT
#define FF_API_HTTP_USER_AGENT (LIBAVFORMAT_VERSION_MAJOR < 59)
#endif
#ifndef FF_API_HLS_WRAP
#define FF_API_HLS_WRAP (LIBAVFORMAT_VERSION_MAJOR < 59)
#endif
#ifndef FF_API_HLS_USE_LOCALTIME
#define FF_API_HLS_USE_LOCALTIME (LIBAVFORMAT_VERSION_MAJOR < 59)
#endif
#ifndef FF_API_LAVF_KEEPSIDE_FLAG
#define FF_API_LAVF_KEEPSIDE_FLAG (LIBAVFORMAT_VERSION_MAJOR < 59)
#endif
#ifndef FF_API_OLD_ROTATE_API
#define FF_API_OLD_ROTATE_API (LIBAVFORMAT_VERSION_MAJOR < 59)
#endif
#ifndef FF_API_FORMAT_GET_SET
#define FF_API_FORMAT_GET_SET (LIBAVFORMAT_VERSION_MAJOR < 59)
#endif
#ifndef FF_API_OLD_AVIO_EOF_0
#define FF_API_OLD_AVIO_EOF_0 (LIBAVFORMAT_VERSION_MAJOR < 59)
#endif
#ifndef FF_API_LAVF_FFSERVER
#define FF_API_LAVF_FFSERVER (LIBAVFORMAT_VERSION_MAJOR < 59)
#endif
#ifndef FF_API_FORMAT_FILENAME
#define FF_API_FORMAT_FILENAME (LIBAVFORMAT_VERSION_MAJOR < 59)
#endif
#ifndef FF_API_OLD_RTSP_OPTIONS
#define FF_API_OLD_RTSP_OPTIONS (LIBAVFORMAT_VERSION_MAJOR < 59)
#endif
#ifndef FF_API_NEXT
#define FF_API_NEXT (LIBAVFORMAT_VERSION_MAJOR < 59)
#endif
#ifndef FF_API_DASH_MIN_SEG_DURATION
#define FF_API_DASH_MIN_SEG_DURATION (LIBAVFORMAT_VERSION_MAJOR < 59)
#endif
#ifndef FF_API_LAVF_MP4A_LATM
#define FF_API_LAVF_MP4A_LATM (LIBAVFORMAT_VERSION_MAJOR < 59)
#endif
#ifndef FF_API_AVIOFORMAT
#define FF_API_AVIOFORMAT (LIBAVFORMAT_VERSION_MAJOR < 59)
#endif
#ifndef FF_API_DEMUXER_OPEN
#define FF_API_DEMUXER_OPEN (LIBAVFORMAT_VERSION_MAJOR < 59)
#endif
#ifndef FF_API_CHAPTER_ID_INT
#define FF_API_CHAPTER_ID_INT (LIBAVFORMAT_VERSION_MAJOR < 59)
#endif
#ifndef FF_API_LAVF_PRIV_OPT
#define FF_API_LAVF_PRIV_OPT (LIBAVFORMAT_VERSION_MAJOR < 60)
#endif
#define FF_API_COMPUTE_PKT_FIELDS2 (LIBAVFORMAT_VERSION_MAJOR < 60)
#define FF_API_AVIOCONTEXT_WRITTEN (LIBAVFORMAT_VERSION_MAJOR < 60)
#define FF_HLS_TS_OPTIONS (LIBAVFORMAT_VERSION_MAJOR < 60)
#define FF_API_AVSTREAM_CLASS (LIBAVFORMAT_VERSION_MAJOR > 59)
#define FF_HTTP_CACHE_REDIRECT_DEFAULT (LIBAVFORMAT_VERSION_MAJOR < 60)
#ifndef FF_API_R_FRAME_RATE
#define FF_API_R_FRAME_RATE 1
#endif
#endif /* AVFORMAT_VERSION_H */

View File

@ -30,7 +30,6 @@
#include <stddef.h>
#include <stdint.h>
#include "attributes.h"
#include "version.h"
/**
* @defgroup lavu_adler32 Adler-32
@ -40,11 +39,7 @@
* @{
*/
#if FF_API_CRYPTO_SIZE_T
typedef unsigned long AVAdler;
#else
typedef uint32_t AVAdler;
#endif
/**
* Calculate the Adler32 checksum of a buffer.
@ -59,11 +54,7 @@ typedef uint32_t AVAdler;
* @return updated checksum
*/
AVAdler av_adler32_update(AVAdler adler, const uint8_t *buf,
#if FF_API_CRYPTO_SIZE_T
unsigned int len) av_pure;
#else
size_t len) av_pure;
#endif
/**
* @}

View File

@ -24,7 +24,6 @@
#include <stdint.h>
#include "attributes.h"
#include "version.h"
/**
* @defgroup lavu_aes AES

View File

@ -25,7 +25,6 @@
#include <stdint.h>
#include "attributes.h"
#include "version.h"
#define AES_CTR_KEY_SIZE (16)
#define AES_CTR_IV_SIZE (8)

View File

@ -28,8 +28,6 @@
#include <stddef.h>
#include <stdint.h>
#include "version.h"
/**
* @defgroup lavu_buffer AVBuffer
* @ingroup lavu_data
@ -93,11 +91,7 @@ typedef struct AVBufferRef {
/**
* Size of data in bytes.
*/
#if FF_API_BUFFER_SIZE_T
int size;
#else
size_t size;
#endif
} AVBufferRef;
/**
@ -105,21 +99,13 @@ typedef struct AVBufferRef {
*
* @return an AVBufferRef of given size or NULL when out of memory
*/
#if FF_API_BUFFER_SIZE_T
AVBufferRef *av_buffer_alloc(int size);
#else
AVBufferRef *av_buffer_alloc(size_t size);
#endif
/**
* Same as av_buffer_alloc(), except the returned buffer will be initialized
* to zero.
*/
#if FF_API_BUFFER_SIZE_T
AVBufferRef *av_buffer_allocz(int size);
#else
AVBufferRef *av_buffer_allocz(size_t size);
#endif
/**
* Always treat the buffer as read-only, even when it has only one
@ -142,11 +128,7 @@ AVBufferRef *av_buffer_allocz(size_t size);
*
* @return an AVBufferRef referring to data on success, NULL on failure.
*/
#if FF_API_BUFFER_SIZE_T
AVBufferRef *av_buffer_create(uint8_t *data, int size,
#else
AVBufferRef *av_buffer_create(uint8_t *data, size_t size,
#endif
void (*free)(void *opaque, uint8_t *data),
void *opaque, int flags);
@ -163,7 +145,7 @@ void av_buffer_default_free(void *opaque, uint8_t *data);
* @return a new AVBufferRef referring to the same AVBuffer as buf or NULL on
* failure.
*/
AVBufferRef *av_buffer_ref(AVBufferRef *buf);
AVBufferRef *av_buffer_ref(const AVBufferRef *buf);
/**
* Free a given reference and automatically free the buffer if there are no more
@ -214,11 +196,7 @@ int av_buffer_make_writable(AVBufferRef **buf);
* reference to it (i.e. the one passed to this function). In all other cases
* a new buffer is allocated and the data is copied.
*/
#if FF_API_BUFFER_SIZE_T
int av_buffer_realloc(AVBufferRef **buf, int size);
#else
int av_buffer_realloc(AVBufferRef **buf, size_t size);
#endif
/**
* Ensure dst refers to the same data as src.
@ -234,7 +212,7 @@ int av_buffer_realloc(AVBufferRef **buf, size_t size);
* @return 0 on success
* AVERROR(ENOMEM) on memory allocation failure.
*/
int av_buffer_replace(AVBufferRef **dst, AVBufferRef *src);
int av_buffer_replace(AVBufferRef **dst, const AVBufferRef *src);
/**
* @}
@ -285,11 +263,7 @@ typedef struct AVBufferPool AVBufferPool;
* (av_buffer_alloc()).
* @return newly created buffer pool on success, NULL on error.
*/
#if FF_API_BUFFER_SIZE_T
AVBufferPool *av_buffer_pool_init(int size, AVBufferRef* (*alloc)(int size));
#else
AVBufferPool *av_buffer_pool_init(size_t size, AVBufferRef* (*alloc)(size_t size));
#endif
/**
* Allocate and initialize a buffer pool with a more complex allocator.
@ -306,13 +280,8 @@ AVBufferPool *av_buffer_pool_init(size_t size, AVBufferRef* (*alloc)(size_t size
* data. May be NULL.
* @return newly created buffer pool on success, NULL on error.
*/
#if FF_API_BUFFER_SIZE_T
AVBufferPool *av_buffer_pool_init2(int size, void *opaque,
AVBufferRef* (*alloc)(void *opaque, int size),
#else
AVBufferPool *av_buffer_pool_init2(size_t size, void *opaque,
AVBufferRef* (*alloc)(void *opaque, size_t size),
#endif
void (*pool_free)(void *opaque));
/**
@ -344,7 +313,7 @@ AVBufferRef *av_buffer_pool_get(AVBufferPool *pool);
* therefore you have to use this function to access the original opaque
* parameter of an allocated buffer.
*/
void *av_buffer_pool_buffer_get_opaque(AVBufferRef *ref);
void *av_buffer_pool_buffer_get_opaque(const AVBufferRef *ref);
/**
* @}

View File

@ -42,13 +42,6 @@
#include "attributes.h"
#include "macros.h"
#include "version.h"
#include "libavutil/avconfig.h"
#if AV_HAVE_BIGENDIAN
# define AV_NE(be, le) (be)
#else
# define AV_NE(be, le) (le)
#endif
//rounded division & shift
#define RSHIFT(a,b) ((a) > 0 ? ((a) + ((1<<(b))>>1))>>(b) : ((a) + ((1<<(b))>>1)-1)>>(b))
@ -89,25 +82,6 @@
#define FFABSU(a) ((a) <= 0 ? -(unsigned)(a) : (unsigned)(a))
#define FFABS64U(a) ((a) <= 0 ? -(uint64_t)(a) : (uint64_t)(a))
/**
* Comparator.
* For two numerical expressions x and y, gives 1 if x > y, -1 if x < y, and 0
* if x == y. This is useful for instance in a qsort comparator callback.
* Furthermore, compilers are able to optimize this to branchless code, and
* there is no risk of overflow with signed types.
* As with many macros, this evaluates its argument multiple times, it thus
* must not have a side-effect.
*/
#define FFDIFFSIGN(x,y) (((x)>(y)) - ((x)<(y)))
#define FFMAX(a,b) ((a) > (b) ? (a) : (b))
#define FFMAX3(a,b,c) FFMAX(FFMAX(a,b),c)
#define FFMIN(a,b) ((a) > (b) ? (b) : (a))
#define FFMIN3(a,b,c) FFMIN(FFMIN(a,b),c)
#define FFSWAP(type,a,b) do{type SWAP_tmp= b; b= a; a= SWAP_tmp;}while(0)
#define FF_ARRAY_ELEMS(a) (sizeof(a) / sizeof((a)[0]))
/* misc math functions */
#ifdef HAVE_AV_CONFIG_H
@ -405,6 +379,8 @@ static av_always_inline int64_t av_sat_sub64_c(int64_t a, int64_t b) {
/**
* Clip a float value into the amin-amax range.
* If a is nan or -inf amin will be returned.
* If a is +inf amax will be returned.
* @param a value to clip
* @param amin minimum value of the clip range
* @param amax maximum value of the clip range
@ -415,13 +391,13 @@ static av_always_inline av_const float av_clipf_c(float a, float amin, float ama
#if defined(HAVE_AV_CONFIG_H) && defined(ASSERT_LEVEL) && ASSERT_LEVEL >= 2
if (amin > amax) abort();
#endif
if (a < amin) return amin;
else if (a > amax) return amax;
else return a;
return FFMIN(FFMAX(a, amin), amax);
}
/**
* Clip a double value into the amin-amax range.
* If a is nan or -inf amin will be returned.
* If a is +inf amax will be returned.
* @param a value to clip
* @param amin minimum value of the clip range
* @param amax maximum value of the clip range
@ -432,9 +408,7 @@ static av_always_inline av_const double av_clipd_c(double a, double amin, double
#if defined(HAVE_AV_CONFIG_H) && defined(ASSERT_LEVEL) && ASSERT_LEVEL >= 2
if (amin > amax) abort();
#endif
if (a < amin) return amin;
else if (a > amax) return amax;
else return a;
return FFMIN(FFMAX(a, amin), amax);
}
/** Compute ceil(log2(x)).
@ -475,9 +449,6 @@ static av_always_inline av_const int av_parity_c(uint32_t v)
return av_popcount(v) & 1;
}
#define MKTAG(a,b,c,d) ((a) | ((b) << 8) | ((c) << 16) | ((unsigned)(d) << 24))
#define MKBETAG(a,b,c,d) ((d) | ((c) << 8) | ((b) << 16) | ((unsigned)(a) << 24))
/**
* Convert a UTF-8 character (up to 4 bytes) to its 32-bit UCS-4 encoded form.
*

View File

@ -23,8 +23,6 @@
#include <stddef.h>
#include "attributes.h"
#define AV_CPU_FLAG_FORCE 0x80000000 /* force usage of selected flags (OR) */
/* lower 16 bits - CPU features */
@ -56,6 +54,7 @@
#define AV_CPU_FLAG_BMI1 0x20000 ///< Bit Manipulation Instruction Set 1
#define AV_CPU_FLAG_BMI2 0x40000 ///< Bit Manipulation Instruction Set 2
#define AV_CPU_FLAG_AVX512 0x100000 ///< AVX-512 functions: requires OS support even if YMM/ZMM registers aren't used
#define AV_CPU_FLAG_SLOW_GATHER 0x2000000 ///< CPU has slow gathers.
#define AV_CPU_FLAG_ALTIVEC 0x0001 ///< standard
#define AV_CPU_FLAG_VSX 0x0002 ///< ISA 2.06
@ -74,6 +73,10 @@
#define AV_CPU_FLAG_MMI (1 << 0)
#define AV_CPU_FLAG_MSA (1 << 1)
//Loongarch SIMD extension.
#define AV_CPU_FLAG_LSX (1 << 0)
#define AV_CPU_FLAG_LASX (1 << 1)
/**
* Return the flags which specify extensions supported by the CPU.
* The returned value is affected by av_force_cpu_flags() if that was used
@ -88,25 +91,6 @@ int av_get_cpu_flags(void);
*/
void av_force_cpu_flags(int flags);
/**
* Set a mask on flags returned by av_get_cpu_flags().
* This function is mainly useful for testing.
* Please use av_force_cpu_flags() and av_get_cpu_flags() instead which are more flexible
*/
attribute_deprecated void av_set_cpu_flags_mask(int mask);
/**
* Parse CPU flags from a string.
*
* The returned flags contain the specified flags as well as related unspecified flags.
*
* This function exists only for compatibility with libav.
* Please use av_parse_cpu_caps() when possible.
* @return a combination of AV_CPU_* flags, negative on error.
*/
attribute_deprecated
int av_parse_cpu_flags(const char *s);
/**
* Parse CPU caps from a string and update the given AV_CPU_* flags based on that.
*
@ -119,6 +103,12 @@ int av_parse_cpu_caps(unsigned *flags, const char *s);
*/
int av_cpu_count(void);
/**
* Overrides cpu count detection and forces the specified count.
* Count < 1 disables forcing of specific count.
*/
void av_cpu_force_count(int count);
/**
* Get the maximum data alignment that may be required by FFmpeg.
*

View File

@ -30,7 +30,6 @@
#include <stdint.h>
#include <stddef.h>
#include "attributes.h"
#include "version.h"
/**
* @defgroup lavu_crc32 CRC

View File

@ -0,0 +1,107 @@
/*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AVUTIL_DETECTION_BBOX_H
#define AVUTIL_DETECTION_BBOX_H
#include "rational.h"
#include "avassert.h"
#include "frame.h"
typedef struct AVDetectionBBox {
/**
* Distance in pixels from the left/top edge of the frame,
* together with width and height, defining the bounding box.
*/
int x;
int y;
int w;
int h;
#define AV_DETECTION_BBOX_LABEL_NAME_MAX_SIZE 64
/**
* Detect result with confidence
*/
char detect_label[AV_DETECTION_BBOX_LABEL_NAME_MAX_SIZE];
AVRational detect_confidence;
/**
* At most 4 classifications based on the detected bounding box.
* For example, we can get max 4 different attributes with 4 different
* DNN models on one bounding box.
* classify_count is zero if no classification.
*/
#define AV_NUM_DETECTION_BBOX_CLASSIFY 4
uint32_t classify_count;
char classify_labels[AV_NUM_DETECTION_BBOX_CLASSIFY][AV_DETECTION_BBOX_LABEL_NAME_MAX_SIZE];
AVRational classify_confidences[AV_NUM_DETECTION_BBOX_CLASSIFY];
} AVDetectionBBox;
typedef struct AVDetectionBBoxHeader {
/**
* Information about how the bounding box is generated.
* for example, the DNN model name.
*/
char source[256];
/**
* Number of bounding boxes in the array.
*/
uint32_t nb_bboxes;
/**
* Offset in bytes from the beginning of this structure at which
* the array of bounding boxes starts.
*/
size_t bboxes_offset;
/**
* Size of each bounding box in bytes.
*/
size_t bbox_size;
} AVDetectionBBoxHeader;
/*
* Get the bounding box at the specified {@code idx}. Must be between 0 and nb_bboxes.
*/
static av_always_inline AVDetectionBBox *
av_get_detection_bbox(const AVDetectionBBoxHeader *header, unsigned int idx)
{
av_assert0(idx < header->nb_bboxes);
return (AVDetectionBBox *)((uint8_t *)header + header->bboxes_offset +
idx * header->bbox_size);
}
/**
* Allocates memory for AVDetectionBBoxHeader, plus an array of {@code nb_bboxes}
* AVDetectionBBox, and initializes the variables.
* Can be freed with a normal av_free() call.
*
* @param out_size if non-NULL, the size in bytes of the resulting data array is
* written here.
*/
AVDetectionBBoxHeader *av_detection_bbox_alloc(uint32_t nb_bboxes, size_t *out_size);
/**
* Allocates memory for AVDetectionBBoxHeader, plus an array of {@code nb_bboxes}
* AVDetectionBBox, in the given AVFrame {@code frame} as AVFrameSideData of type
* AV_FRAME_DATA_DETECTION_BBOXES and initializes the variables.
*/
AVDetectionBBoxHeader *av_detection_bbox_create_side_data(AVFrame *frame, uint32_t nb_bboxes);
#endif

View File

@ -32,8 +32,6 @@
#include <stdint.h>
#include "version.h"
/**
* @addtogroup lavu_dict AVDictionary
* @ingroup lavu_data

View File

@ -88,7 +88,7 @@
double av_display_rotation_get(const int32_t matrix[9]);
/**
* Initialize a transformation matrix describing a pure counterclockwise
* Initialize a transformation matrix describing a pure clockwise
* rotation by the specified angle (in degrees).
*
* @param matrix an allocated transformation matrix (will be fully overwritten

View File

@ -29,6 +29,7 @@
#include <stdint.h>
#include <stddef.h>
#include "rational.h"
/*
* DOVI configuration
@ -67,4 +68,169 @@ typedef struct AVDOVIDecoderConfigurationRecord {
*/
AVDOVIDecoderConfigurationRecord *av_dovi_alloc(size_t *size);
/**
* Dolby Vision RPU data header.
*
* @note sizeof(AVDOVIRpuDataHeader) is not part of the public ABI.
*/
typedef struct AVDOVIRpuDataHeader {
uint8_t rpu_type;
uint16_t rpu_format;
uint8_t vdr_rpu_profile;
uint8_t vdr_rpu_level;
uint8_t chroma_resampling_explicit_filter_flag;
uint8_t coef_data_type; /* informative, lavc always converts to fixed */
uint8_t coef_log2_denom;
uint8_t vdr_rpu_normalized_idc;
uint8_t bl_video_full_range_flag;
uint8_t bl_bit_depth; /* [8, 16] */
uint8_t el_bit_depth; /* [8, 16] */
uint8_t vdr_bit_depth; /* [8, 16] */
uint8_t spatial_resampling_filter_flag;
uint8_t el_spatial_resampling_filter_flag;
uint8_t disable_residual_flag;
} AVDOVIRpuDataHeader;
enum AVDOVIMappingMethod {
AV_DOVI_MAPPING_POLYNOMIAL = 0,
AV_DOVI_MAPPING_MMR = 1,
};
/**
* Coefficients of a piece-wise function. The pieces of the function span the
* value ranges between two adjacent pivot values.
*/
#define AV_DOVI_MAX_PIECES 8
typedef struct AVDOVIReshapingCurve {
uint8_t num_pivots; /* [2, 9] */
uint16_t pivots[AV_DOVI_MAX_PIECES + 1]; /* sorted ascending */
enum AVDOVIMappingMethod mapping_idc[AV_DOVI_MAX_PIECES];
/* AV_DOVI_MAPPING_POLYNOMIAL */
uint8_t poly_order[AV_DOVI_MAX_PIECES]; /* [1, 2] */
int64_t poly_coef[AV_DOVI_MAX_PIECES][3]; /* x^0, x^1, x^2 */
/* AV_DOVI_MAPPING_MMR */
uint8_t mmr_order[AV_DOVI_MAX_PIECES]; /* [1, 3] */
int64_t mmr_constant[AV_DOVI_MAX_PIECES];
int64_t mmr_coef[AV_DOVI_MAX_PIECES][3/* order - 1 */][7];
} AVDOVIReshapingCurve;
enum AVDOVINLQMethod {
AV_DOVI_NLQ_NONE = -1,
AV_DOVI_NLQ_LINEAR_DZ = 0,
};
/**
* Coefficients of the non-linear inverse quantization. For the interpretation
* of these, see ETSI GS CCM 001.
*/
typedef struct AVDOVINLQParams {
uint16_t nlq_offset;
uint64_t vdr_in_max;
/* AV_DOVI_NLQ_LINEAR_DZ */
uint64_t linear_deadzone_slope;
uint64_t linear_deadzone_threshold;
} AVDOVINLQParams;
/**
* Dolby Vision RPU data mapping parameters.
*
* @note sizeof(AVDOVIDataMapping) is not part of the public ABI.
*/
typedef struct AVDOVIDataMapping {
uint8_t vdr_rpu_id;
uint8_t mapping_color_space;
uint8_t mapping_chroma_format_idc;
AVDOVIReshapingCurve curves[3]; /* per component */
/* Non-linear inverse quantization */
enum AVDOVINLQMethod nlq_method_idc;
uint32_t num_x_partitions;
uint32_t num_y_partitions;
AVDOVINLQParams nlq[3]; /* per component */
} AVDOVIDataMapping;
/**
* Dolby Vision RPU colorspace metadata parameters.
*
* @note sizeof(AVDOVIColorMetadata) is not part of the public ABI.
*/
typedef struct AVDOVIColorMetadata {
uint8_t dm_metadata_id;
uint8_t scene_refresh_flag;
/**
* Coefficients of the custom Dolby Vision IPT-PQ matrices. These are to be
* used instead of the matrices indicated by the frame's colorspace tags.
* The output of rgb_to_lms_matrix is to be fed into a BT.2020 LMS->RGB
* matrix based on a Hunt-Pointer-Estevez transform, but without any
* crosstalk. (See the definition of the ICtCp colorspace for more
* information.)
*/
AVRational ycc_to_rgb_matrix[9]; /* before PQ linearization */
AVRational ycc_to_rgb_offset[3]; /* input offset of neutral value */
AVRational rgb_to_lms_matrix[9]; /* after PQ linearization */
/**
* Extra signal metadata (see Dolby patents for more info).
*/
uint16_t signal_eotf;
uint16_t signal_eotf_param0;
uint16_t signal_eotf_param1;
uint32_t signal_eotf_param2;
uint8_t signal_bit_depth;
uint8_t signal_color_space;
uint8_t signal_chroma_format;
uint8_t signal_full_range_flag; /* [0, 3] */
uint16_t source_min_pq;
uint16_t source_max_pq;
uint16_t source_diagonal;
} AVDOVIColorMetadata;
/**
* Combined struct representing a combination of header, mapping and color
* metadata, for attaching to frames as side data.
*
* @note The struct must be allocated with av_dovi_metadata_alloc() and
* its size is not a part of the public ABI.
*/
typedef struct AVDOVIMetadata {
/**
* Offset in bytes from the beginning of this structure at which the
* respective structs start.
*/
size_t header_offset; /* AVDOVIRpuDataHeader */
size_t mapping_offset; /* AVDOVIDataMapping */
size_t color_offset; /* AVDOVIColorMetadata */
} AVDOVIMetadata;
static av_always_inline AVDOVIRpuDataHeader *
av_dovi_get_header(const AVDOVIMetadata *data)
{
return (AVDOVIRpuDataHeader *)((uint8_t *) data + data->header_offset);
}
static av_always_inline AVDOVIDataMapping *
av_dovi_get_mapping(const AVDOVIMetadata *data)
{
return (AVDOVIDataMapping *)((uint8_t *) data + data->mapping_offset);
}
static av_always_inline AVDOVIColorMetadata *
av_dovi_get_color(const AVDOVIMetadata *data)
{
return (AVDOVIColorMetadata *)((uint8_t *) data + data->color_offset);
}
/**
* Allocate an AVDOVIMetadata structure and initialize its
* fields to default values.
*
* @param size If this parameter is non-NULL, the size in bytes of the
* allocated struct will be written here on success
*
* @return the newly allocated struct or NULL on failure
*/
AVDOVIMetadata *av_dovi_metadata_alloc(size_t *size);
#endif /* AVUTIL_DOVI_META_H */

View File

@ -27,6 +27,8 @@
#include <errno.h>
#include <stddef.h>
#include "macros.h"
/**
* @addtogroup lavu_error
*

View File

@ -1,5 +1,5 @@
/* Automatically generated by version.sh, do not manually edit! */
#ifndef AVUTIL_FFVERSION_H
#define AVUTIL_FFVERSION_H
#define FFMPEG_VERSION "n4.4.1"
#define FFMPEG_VERSION "n5.0"
#endif /* AVUTIL_FFVERSION_H */

View File

@ -28,6 +28,11 @@ enum AVFilmGrainParamsType {
* The union is valid when interpreted as AVFilmGrainAOMParams (codec.aom)
*/
AV_FILM_GRAIN_PARAMS_AV1,
/**
* The union is valid when interpreted as AVFilmGrainH274Params (codec.h274)
*/
AV_FILM_GRAIN_PARAMS_H274,
};
/**
@ -117,6 +122,89 @@ typedef struct AVFilmGrainAOMParams {
int limit_output_range;
} AVFilmGrainAOMParams;
/**
* This structure describes how to handle film grain synthesis for codecs using
* the ITU-T H.274 Versatile suplemental enhancement information message.
*
* @note The struct must be allocated as part of AVFilmGrainParams using
* av_film_grain_params_alloc(). Its size is not a part of the public ABI.
*/
typedef struct AVFilmGrainH274Params {
/**
* Specifies the film grain simulation mode.
* 0 = Frequency filtering, 1 = Auto-regression
*/
int model_id;
/**
* Specifies the bit depth used for the luma component.
*/
int bit_depth_luma;
/**
* Specifies the bit depth used for the chroma components.
*/
int bit_depth_chroma;
enum AVColorRange color_range;
enum AVColorPrimaries color_primaries;
enum AVColorTransferCharacteristic color_trc;
enum AVColorSpace color_space;
/**
* Specifies the blending mode used to blend the simulated film grain
* with the decoded images.
*
* 0 = Additive, 1 = Multiplicative
*/
int blending_mode_id;
/**
* Specifies a scale factor used in the film grain characterization equations.
*/
int log2_scale_factor;
/**
* Indicates if the modelling of film grain for a given component is present.
*/
int component_model_present[3 /* y, cb, cr */];
/**
* Specifies the number of intensity intervals for which a specific set of
* model values has been estimated, with a range of [1, 256].
*/
uint16_t num_intensity_intervals[3 /* y, cb, cr */];
/**
* Specifies the number of model values present for each intensity interval
* in which the film grain has been modelled, with a range of [1, 6].
*/
uint8_t num_model_values[3 /* y, cb, cr */];
/**
* Specifies the lower ounds of each intensity interval for whichthe set of
* model values applies for the component.
*/
uint8_t intensity_interval_lower_bound[3 /* y, cb, cr */][256 /* intensity interval */];
/**
* Specifies the upper bound of each intensity interval for which the set of
* model values applies for the component.
*/
uint8_t intensity_interval_upper_bound[3 /* y, cb, cr */][256 /* intensity interval */];
/**
* Specifies the model values for the component for each intensity interval.
* - When model_id == 0, the following applies:
* For comp_model_value[y], the range of values is [0, 2^bit_depth_luma - 1]
* For comp_model_value[cb..cr], the range of values is [0, 2^bit_depth_chroma - 1]
* - Otherwise, the following applies:
* For comp_model_value[y], the range of values is [-2^(bit_depth_luma - 1), 2^(bit_depth_luma - 1) - 1]
* For comp_model_value[cb..cr], the range of values is [-2^(bit_depth_chroma - 1), 2^(bit_depth_chroma - 1) - 1]
*/
int16_t comp_model_value[3 /* y, cb, cr */][256 /* intensity interval */][6 /* model value */];
} AVFilmGrainH274Params;
/**
* This structure describes how to handle film grain synthesis in video
* for specific codecs. Must be present on every frame where film grain is
@ -133,6 +221,9 @@ typedef struct AVFilmGrainParams {
/**
* Seed to use for the synthesis process, if the codec allows for it.
*
* @note For H.264, this refers to `pic_offset` as defined in
* SMPTE RDD 5-2006.
*/
uint64_t seed;
@ -143,6 +234,7 @@ typedef struct AVFilmGrainParams {
*/
union {
AVFilmGrainAOMParams aom;
AVFilmGrainH274Params h274;
} codec;
} AVFilmGrainParams;

View File

@ -142,23 +142,6 @@ enum AVFrameSideDataType {
*/
AV_FRAME_DATA_ICC_PROFILE,
#if FF_API_FRAME_QP
/**
* Implementation-specific description of the format of AV_FRAME_QP_TABLE_DATA.
* The contents of this side data are undocumented and internal; use
* av_frame_set_qp_table() and av_frame_get_qp_table() to access this in a
* meaningful way instead.
*/
AV_FRAME_DATA_QP_TABLE_PROPERTIES,
/**
* Raw QP table data. Its format is described by
* AV_FRAME_DATA_QP_TABLE_PROPERTIES. Use av_frame_set_qp_table() and
* av_frame_get_qp_table() to access this instead.
*/
AV_FRAME_DATA_QP_TABLE_DATA,
#endif
/**
* Timecode which conforms to SMPTE ST 12-1. The data is an array of 4 uint32_t
* where the first uint32_t describes how many (1-3) of the other timecodes are used.
@ -198,6 +181,26 @@ enum AVFrameSideDataType {
* Must be present for every frame which should have film grain applied.
*/
AV_FRAME_DATA_FILM_GRAIN_PARAMS,
/**
* Bounding boxes for object detection and classification,
* as described by AVDetectionBBoxHeader.
*/
AV_FRAME_DATA_DETECTION_BBOXES,
/**
* Dolby Vision RPU raw data, suitable for passing to x265
* or other libraries. Array of uint8_t, with NAL emulation
* bytes intact.
*/
AV_FRAME_DATA_DOVI_RPU_BUFFER,
/**
* Parsed Dolby Vision metadata, suitable for passing to a software
* implementation. The payload is the AVDOVIMetadata struct defined in
* libavutil/dovi_meta.h.
*/
AV_FRAME_DATA_DOVI_METADATA,
};
enum AVActiveFormatDescription {
@ -220,11 +223,7 @@ enum AVActiveFormatDescription {
typedef struct AVFrameSideData {
enum AVFrameSideDataType type;
uint8_t *data;
#if FF_API_BUFFER_SIZE_T
int size;
#else
size_t size;
#endif
AVDictionary *metadata;
AVBufferRef *buf;
} AVFrameSideData;
@ -319,21 +318,32 @@ typedef struct AVFrame {
#define AV_NUM_DATA_POINTERS 8
/**
* pointer to the picture/channel planes.
* This might be different from the first allocated byte
* This might be different from the first allocated byte. For video,
* it could even point to the end of the image data.
*
* All pointers in data and extended_data must point into one of the
* AVBufferRef in buf or extended_buf.
*
* Some decoders access areas outside 0,0 - width,height, please
* see avcodec_align_dimensions2(). Some filters and swscale can read
* up to 16 bytes beyond the planes, if these filters are to be used,
* then 16 extra bytes must be allocated.
*
* NOTE: Except for hwaccel formats, pointers not needed by the format
* MUST be set to NULL.
* NOTE: Pointers not needed by the format MUST be set to NULL.
*
* @attention In case of video, the data[] pointers can point to the
* end of image data in order to reverse line order, when used in
* combination with negative values in the linesize[] array.
*/
uint8_t *data[AV_NUM_DATA_POINTERS];
/**
* For video, size in bytes of each picture line.
* For audio, size in bytes of each plane.
* For video, a positive or negative value, which is typically indicating
* the size in bytes of each picture line, but it can also be:
* - the negative byte size of lines for vertical flipping
* (with data[n] pointing to the end of the data
* - a positive or negative multiple of the byte size as for accessing
* even and odd fields of a frame (possibly flipped)
*
* For audio, only linesize[0] may be set. For planar audio, each channel
* plane must be the same size.
@ -345,6 +355,9 @@ typedef struct AVFrame {
*
* @note The linesize may be larger than the size of usable data -- there
* may be extra padding present for performance reasons.
*
* @attention In case of video, line size values can be negative to achieve
* a vertically inverted iteration over image lines.
*/
int linesize[AV_NUM_DATA_POINTERS];
@ -410,15 +423,6 @@ typedef struct AVFrame {
*/
int64_t pts;
#if FF_API_PKT_PTS
/**
* PTS copied from the AVPacket that was decoded to produce this frame.
* @deprecated use the pts field instead
*/
attribute_deprecated
int64_t pkt_pts;
#endif
/**
* DTS copied from the AVPacket that triggered returning this frame. (if frame threading isn't used)
* This is also the Presentation time of this AVFrame calculated from
@ -426,6 +430,14 @@ typedef struct AVFrame {
*/
int64_t pkt_dts;
/**
* Time base for the timestamps in this frame.
* In the future, this field may be set on frames output by decoders or
* filters, but its value will be by default ignored on input to encoders
* or filters.
*/
AVRational time_base;
/**
* picture number in bitstream order
*/
@ -445,14 +457,6 @@ typedef struct AVFrame {
*/
void *opaque;
#if FF_API_ERROR_FRAME
/**
* @deprecated unused
*/
attribute_deprecated
uint64_t error[AV_NUM_DATA_POINTERS];
#endif
/**
* When decoding, this signals how much the picture must be delayed.
* extra_delay = repeat_pict / (2*fps)
@ -495,10 +499,10 @@ typedef struct AVFrame {
uint64_t channel_layout;
/**
* AVBuffer references backing the data for this frame. If all elements of
* this array are NULL, then this frame is not reference counted. This array
* must be filled contiguously -- if buf[i] is non-NULL then buf[j] must
* also be non-NULL for all j < i.
* AVBuffer references backing the data for this frame. All the pointers in
* data and extended_data must point inside one of the buffers in buf or
* extended_buf. This array must be filled contiguously -- if buf[i] is
* non-NULL then buf[j] must also be non-NULL for all j < i.
*
* There may be at most one AVBuffer per data plane, so for video this array
* always contains all the references. For planar audio with more than
@ -632,24 +636,6 @@ typedef struct AVFrame {
*/
int pkt_size;
#if FF_API_FRAME_QP
/**
* QP table
*/
attribute_deprecated
int8_t *qscale_table;
/**
* QP store stride
*/
attribute_deprecated
int qstride;
attribute_deprecated
int qscale_type;
attribute_deprecated
AVBufferRef *qp_table_buf;
#endif
/**
* For hwaccel-format frames, this should be a reference to the
* AVHWFramesContext describing the frame.
@ -697,69 +683,16 @@ typedef struct AVFrame {
AVBufferRef *private_ref;
} AVFrame;
#if FF_API_FRAME_GET_SET
/**
* Accessors for some AVFrame fields. These used to be provided for ABI
* compatibility, and do not need to be used anymore.
*/
attribute_deprecated
int64_t av_frame_get_best_effort_timestamp(const AVFrame *frame);
attribute_deprecated
void av_frame_set_best_effort_timestamp(AVFrame *frame, int64_t val);
attribute_deprecated
int64_t av_frame_get_pkt_duration (const AVFrame *frame);
attribute_deprecated
void av_frame_set_pkt_duration (AVFrame *frame, int64_t val);
attribute_deprecated
int64_t av_frame_get_pkt_pos (const AVFrame *frame);
attribute_deprecated
void av_frame_set_pkt_pos (AVFrame *frame, int64_t val);
attribute_deprecated
int64_t av_frame_get_channel_layout (const AVFrame *frame);
attribute_deprecated
void av_frame_set_channel_layout (AVFrame *frame, int64_t val);
attribute_deprecated
int av_frame_get_channels (const AVFrame *frame);
attribute_deprecated
void av_frame_set_channels (AVFrame *frame, int val);
attribute_deprecated
int av_frame_get_sample_rate (const AVFrame *frame);
attribute_deprecated
void av_frame_set_sample_rate (AVFrame *frame, int val);
attribute_deprecated
AVDictionary *av_frame_get_metadata (const AVFrame *frame);
attribute_deprecated
void av_frame_set_metadata (AVFrame *frame, AVDictionary *val);
attribute_deprecated
int av_frame_get_decode_error_flags (const AVFrame *frame);
attribute_deprecated
void av_frame_set_decode_error_flags (AVFrame *frame, int val);
attribute_deprecated
int av_frame_get_pkt_size(const AVFrame *frame);
attribute_deprecated
void av_frame_set_pkt_size(AVFrame *frame, int val);
#if FF_API_FRAME_QP
attribute_deprecated
int8_t *av_frame_get_qp_table(AVFrame *f, int *stride, int *type);
attribute_deprecated
int av_frame_set_qp_table(AVFrame *f, AVBufferRef *buf, int stride, int type);
#endif
attribute_deprecated
enum AVColorSpace av_frame_get_colorspace(const AVFrame *frame);
attribute_deprecated
void av_frame_set_colorspace(AVFrame *frame, enum AVColorSpace val);
attribute_deprecated
enum AVColorRange av_frame_get_color_range(const AVFrame *frame);
attribute_deprecated
void av_frame_set_color_range(AVFrame *frame, enum AVColorRange val);
#endif
#if FF_API_COLORSPACE_NAME
/**
* Get the name of a colorspace.
* @return a static string identifying the colorspace; can be NULL.
* @deprecated use av_color_space_name()
*/
attribute_deprecated
const char *av_get_colorspace_name(enum AVColorSpace val);
#endif
/**
* Allocate an AVFrame and set its fields to default values. The resulting
* struct must be freed using av_frame_free().
@ -917,11 +850,7 @@ AVBufferRef *av_frame_get_plane_buffer(AVFrame *frame, int plane);
*/
AVFrameSideData *av_frame_new_side_data(AVFrame *frame,
enum AVFrameSideDataType type,
#if FF_API_BUFFER_SIZE_T
int size);
#else
size_t size);
#endif
/**
* Add a new side data to a frame from an existing AVBufferRef

View File

@ -30,8 +30,6 @@
#include <stddef.h>
#include <stdint.h>
#include "version.h"
/**
* @defgroup lavu_hash Hash Functions
* @ingroup lavu_crypto
@ -182,11 +180,7 @@ void av_hash_init(struct AVHashContext *ctx);
* @param[in] src Data to be added to the hash context
* @param[in] len Size of the additional data
*/
#if FF_API_CRYPTO_SIZE_T
void av_hash_update(struct AVHashContext *ctx, const uint8_t *src, int len);
#else
void av_hash_update(struct AVHashContext *ctx, const uint8_t *src, size_t len);
#endif
/**
* Finalize a hash context and compute the actual hash value.

View File

@ -23,7 +23,6 @@
#include <stdint.h>
#include "version.h"
/**
* @defgroup lavu_hmac HMAC
* @ingroup lavu_crypto

View File

@ -164,6 +164,15 @@ typedef struct AVD3D11VAFramesContext {
* This field is ignored/invalid if a user-allocated texture is provided.
*/
UINT MiscFlags;
/**
* In case if texture structure member above is not NULL contains the same texture
* pointer for all elements and different indexes into the array texture.
* In case if texture structure member above is NULL, all elements contains
* pointers to separate non-array textures and 0 indexes.
* This field is ignored/invalid if a user-allocated texture is provided.
*/
AVD3D11FrameDescriptor *texture_infos;
} AVD3D11VAFramesContext;
#endif /* AVUTIL_HWCONTEXT_D3D11VA_H */

View File

@ -29,11 +29,14 @@
* @file
* An API-specific header for AV_HWDEVICE_TYPE_VIDEOTOOLBOX.
*
* This API currently does not support frame allocation, as the raw VideoToolbox
* API does allocation, and FFmpeg itself never has the need to allocate frames.
* This API supports frame allocation using a native CVPixelBufferPool
* instead of an AVBufferPool.
*
* If the API user sets a custom pool, AVHWFramesContext.pool must return
* AVBufferRefs whose data pointer is a CVImageBufferRef or CVPixelBufferRef.
* Note that the underlying CVPixelBuffer could be retained by OS frameworks
* depending on application usage, so it is preferable to let CoreVideo manage
* the pool using the default implementation.
*
* Currently AVHWDeviceContext.hwctx and AVHWFramesContext.hwctx are always
* NULL.
@ -57,4 +60,36 @@ uint32_t av_map_videotoolbox_format_from_pixfmt(enum AVPixelFormat pix_fmt);
*/
uint32_t av_map_videotoolbox_format_from_pixfmt2(enum AVPixelFormat pix_fmt, bool full_range);
/**
* Convert an AVChromaLocation to a VideoToolbox/CoreVideo chroma location string.
* Returns 0 if no known equivalent was found.
*/
CFStringRef av_map_videotoolbox_chroma_loc_from_av(enum AVChromaLocation loc);
/**
* Convert an AVColorSpace to a VideoToolbox/CoreVideo color matrix string.
* Returns 0 if no known equivalent was found.
*/
CFStringRef av_map_videotoolbox_color_matrix_from_av(enum AVColorSpace space);
/**
* Convert an AVColorPrimaries to a VideoToolbox/CoreVideo color primaries string.
* Returns 0 if no known equivalent was found.
*/
CFStringRef av_map_videotoolbox_color_primaries_from_av(enum AVColorPrimaries pri);
/**
* Convert an AVColorTransferCharacteristic to a VideoToolbox/CoreVideo color transfer
* function string.
* Returns 0 if no known equivalent was found.
*/
CFStringRef av_map_videotoolbox_color_trc_from_av(enum AVColorTransferCharacteristic trc);
/**
* Update a CVPixelBufferRef's metadata to based on an AVFrame.
* Returns 0 if no known equivalent was found.
*/
int av_vt_pixbuf_set_attachments(void *log_ctx,
CVPixelBufferRef pixbuf, const struct AVFrame *src);
#endif /* AVUTIL_HWCONTEXT_VIDEOTOOLBOX_H */

View File

@ -19,6 +19,9 @@
#ifndef AVUTIL_HWCONTEXT_VULKAN_H
#define AVUTIL_HWCONTEXT_VULKAN_H
#if defined(_WIN32) && !defined(VK_USE_PLATFORM_WIN32_KHR)
#define VK_USE_PLATFORM_WIN32_KHR
#endif
#include <vulkan/vulkan.h>
#include "pixfmt.h"
@ -41,43 +44,37 @@ typedef struct AVVulkanDeviceContext {
* Custom memory allocator, else NULL
*/
const VkAllocationCallbacks *alloc;
/**
* Vulkan instance. Must be at least version 1.1.
* Pointer to the instance-provided vkGetInstanceProcAddr loading function.
* If NULL, will pick either libvulkan or libvolk, depending on libavutil's
* compilation settings, and set this field.
*/
PFN_vkGetInstanceProcAddr get_proc_addr;
/**
* Vulkan instance. Must be at least version 1.2.
*/
VkInstance inst;
/**
* Physical device
*/
VkPhysicalDevice phys_dev;
/**
* Active device
*/
VkDevice act_dev;
/**
* Queue family index for graphics
* @note av_hwdevice_create() will set all 3 queue indices if unset
* If there is no dedicated queue for compute or transfer operations,
* they will be set to the graphics queue index which can handle both.
* nb_graphics_queues indicates how many queues were enabled for the
* graphics queue (must be at least 1)
* This structure should be set to the set of features that present and enabled
* during device creation. When a device is created by FFmpeg, it will default to
* enabling all that are present of the shaderImageGatherExtended,
* fragmentStoresAndAtomics, shaderInt64 and vertexPipelineStoresAndAtomics features.
*/
int queue_family_index;
int nb_graphics_queues;
/**
* Queue family index to use for transfer operations, and the amount of queues
* enabled. In case there is no dedicated transfer queue, nb_tx_queues
* must be 0 and queue_family_tx_index must be the same as either the graphics
* queue or the compute queue, if available.
*/
int queue_family_tx_index;
int nb_tx_queues;
/**
* Queue family index for compute ops, and the amount of queues enabled.
* In case there are no dedicated compute queues, nb_comp_queues must be
* 0 and its queue family index must be set to the graphics queue.
*/
int queue_family_comp_index;
int nb_comp_queues;
VkPhysicalDeviceFeatures2 device_features;
/**
* Enabled instance extensions.
* If supplying your own device context, set this to an array of strings, with
@ -87,6 +84,7 @@ typedef struct AVVulkanDeviceContext {
*/
const char * const *enabled_inst_extensions;
int nb_enabled_inst_extensions;
/**
* Enabled device extensions. By default, VK_KHR_external_memory_fd,
* VK_EXT_external_memory_dma_buf, VK_EXT_image_drm_format_modifier,
@ -97,32 +95,91 @@ typedef struct AVVulkanDeviceContext {
*/
const char * const *enabled_dev_extensions;
int nb_enabled_dev_extensions;
/**
* This structure should be set to the set of features that present and enabled
* during device creation. When a device is created by FFmpeg, it will default to
* enabling all that are present of the shaderImageGatherExtended,
* fragmentStoresAndAtomics, shaderInt64 and vertexPipelineStoresAndAtomics features.
* Queue family index for graphics operations, and the number of queues
* enabled for it. If unavaiable, will be set to -1. Not required.
* av_hwdevice_create() will attempt to find a dedicated queue for each
* queue family, or pick the one with the least unrelated flags set.
* Queue indices here may overlap if a queue has to share capabilities.
*/
VkPhysicalDeviceFeatures2 device_features;
int queue_family_index;
int nb_graphics_queues;
/**
* Queue family index for transfer operations and the number of queues
* enabled. Required.
*/
int queue_family_tx_index;
int nb_tx_queues;
/**
* Queue family index for compute operations and the number of queues
* enabled. Required.
*/
int queue_family_comp_index;
int nb_comp_queues;
/**
* Queue family index for video encode ops, and the amount of queues enabled.
* If the device doesn't support such, queue_family_encode_index will be -1.
* Not required.
*/
int queue_family_encode_index;
int nb_encode_queues;
/**
* Queue family index for video decode ops, and the amount of queues enabled.
* If the device doesn't support such, queue_family_decode_index will be -1.
* Not required.
*/
int queue_family_decode_index;
int nb_decode_queues;
} AVVulkanDeviceContext;
/**
* Defines the behaviour of frame allocation.
*/
typedef enum AVVkFrameFlags {
/* Unless this flag is set, autodetected flags will be OR'd based on the
* device and tiling during av_hwframe_ctx_init(). */
AV_VK_FRAME_FLAG_NONE = (1ULL << 0),
/* Image planes will be allocated in a single VkDeviceMemory, rather
* than as per-plane VkDeviceMemory allocations. Required for exporting
* to VAAPI on Intel devices. */
AV_VK_FRAME_FLAG_CONTIGUOUS_MEMORY = (1ULL << 1),
} AVVkFrameFlags;
/**
* Allocated as AVHWFramesContext.hwctx, used to set pool-specific options
*/
typedef struct AVVulkanFramesContext {
/**
* Controls the tiling of allocated frames.
* Controls the tiling of allocated frames. If left as optimal tiling,
* then during av_hwframe_ctx_init() will decide based on whether the device
* supports DRM modifiers, or if the linear_images flag is set, otherwise
* will allocate optimally-tiled images.
*/
VkImageTiling tiling;
/**
* Defines extra usage of output frames. If left as 0, the following bits
* are set: TRANSFER_SRC, TRANSFER_DST. SAMPLED and STORAGE.
*/
VkImageUsageFlagBits usage;
/**
* Extension data for image creation.
* If VkImageDrmFormatModifierListCreateInfoEXT is present in the chain,
* and the device supports DRM modifiers, then images will be allocated
* with the specific requested DRM modifiers.
* Additional structures may be added at av_hwframe_ctx_init() time,
* which will be freed automatically on uninit(), so users need only free
* any structures they've allocated themselves.
*/
void *create_pnext;
/**
* Extension data for memory allocation. Must have as many entries as
* the number of planes of the sw_format.
@ -131,6 +188,13 @@ typedef struct AVVulkanFramesContext {
* extensions are present in enabled_dev_extensions.
*/
void *alloc_pnext[AV_NUM_DATA_POINTERS];
/**
* A combination of AVVkFrameFlags. Unless AV_VK_FRAME_FLAG_NONE is set,
* autodetected flags will be OR'd based on the device and tiling during
* av_hwframe_ctx_init().
*/
AVVkFrameFlags flags;
} AVVulkanFramesContext;
/*
@ -139,7 +203,7 @@ typedef struct AVVulkanFramesContext {
* All frames, imported or allocated, will be created with the
* VK_IMAGE_CREATE_ALIAS_BIT flag set, so the memory may be aliased if needed.
*
* If all three queue family indices in the device context are the same,
* If all queue family indices in the device context are the same,
* images will be created with the EXCLUSIVE sharing mode. Otherwise, all images
* will be created using the CONCURRENT sharing mode.
*
@ -158,8 +222,9 @@ typedef struct AVVkFrame {
VkImageTiling tiling;
/**
* Memory backing the images. Could be less than the amount of images
* if importing from a DRM or VAAPI frame.
* Memory backing the images. Could be less than the amount of planes,
* in which case the offset value will indicate the binding offset of
* each plane in the memory.
*/
VkDeviceMemory mem[AV_NUM_DATA_POINTERS];
size_t size[AV_NUM_DATA_POINTERS];
@ -176,17 +241,29 @@ typedef struct AVVkFrame {
VkImageLayout layout[AV_NUM_DATA_POINTERS];
/**
* Synchronization semaphores. Must not be freed manually. Must be waited on
* and signalled at every queue submission.
* Could be less than the amount of images: either one per VkDeviceMemory
* or one for the entire frame. All others will be set to VK_NULL_HANDLE.
* Synchronization timeline semaphores, one for each sw_format plane.
* Must not be freed manually. Must be waited on at every submission using
* the value in sem_value, and must be signalled at every submission,
* using an incremented value.
*/
VkSemaphore sem[AV_NUM_DATA_POINTERS];
/**
* Up to date semaphore value at which each image becomes accessible.
* Clients must wait on this value when submitting a command queue,
* and increment it when signalling.
*/
uint64_t sem_value[AV_NUM_DATA_POINTERS];
/**
* Internal data.
*/
struct AVVkFrameInternal *internal;
/**
* Describes the binding offset of each plane to the VkDeviceMemory.
*/
ptrdiff_t offset[AV_NUM_DATA_POINTERS];
} AVVkFrame;
/**

View File

@ -124,6 +124,24 @@ void av_image_copy_plane(uint8_t *dst, int dst_linesize,
const uint8_t *src, int src_linesize,
int bytewidth, int height);
/**
* Copy image data located in uncacheable (e.g. GPU mapped) memory. Where
* available, this function will use special functionality for reading from such
* memory, which may result in greatly improved performance compared to plain
* av_image_copy_plane().
*
* bytewidth must be contained by both absolute values of dst_linesize
* and src_linesize, otherwise the function behavior is undefined.
*
* @note The linesize parameters have the type ptrdiff_t here, while they are
* int for av_image_copy_plane().
* @note On x86, the linesizes currently need to be aligned to the cacheline
* size (i.e. 64) to get improved performance.
*/
void av_image_copy_plane_uc_from(uint8_t *dst, ptrdiff_t dst_linesize,
const uint8_t *src, ptrdiff_t src_linesize,
ptrdiff_t bytewidth, int height);
/**
* Copy image in src_data to dst_data.
*

View File

@ -24,7 +24,6 @@
#include <stdarg.h>
#include "avutil.h"
#include "attributes.h"
#include "version.h"
typedef enum {
AV_CLASS_CATEGORY_NA = 0,
@ -107,24 +106,6 @@ typedef struct AVClass {
*/
int parent_log_context_offset;
/**
* Return next AVOptions-enabled child or NULL
*/
void* (*child_next)(void *obj, void *prev);
#if FF_API_CHILD_CLASS_NEXT
/**
* Return an AVClass corresponding to the next potential
* AVOptions-enabled child.
*
* The difference between child_next and this is that
* child_next iterates over _already existing_ objects, while
* child_class_next iterates over _all possible_ children.
*/
attribute_deprecated
const struct AVClass* (*child_class_next)(const struct AVClass *prev);
#endif
/**
* Category used for visualization (like color)
* This is only set if the category is equal for all objects using this class.
@ -144,6 +125,11 @@ typedef struct AVClass {
*/
int (*query_ranges)(struct AVOptionRanges **, void *obj, const char *key, int flags);
/**
* Return next AVOptions-enabled child or NULL
*/
void* (*child_next)(void *obj, void *prev);
/**
* Iterate over the AVClasses corresponding to potential AVOptions-enabled
* children.

View File

@ -25,6 +25,36 @@
#ifndef AVUTIL_MACROS_H
#define AVUTIL_MACROS_H
#include "libavutil/avconfig.h"
#if AV_HAVE_BIGENDIAN
# define AV_NE(be, le) (be)
#else
# define AV_NE(be, le) (le)
#endif
/**
* Comparator.
* For two numerical expressions x and y, gives 1 if x > y, -1 if x < y, and 0
* if x == y. This is useful for instance in a qsort comparator callback.
* Furthermore, compilers are able to optimize this to branchless code, and
* there is no risk of overflow with signed types.
* As with many macros, this evaluates its argument multiple times, it thus
* must not have a side-effect.
*/
#define FFDIFFSIGN(x,y) (((x)>(y)) - ((x)<(y)))
#define FFMAX(a,b) ((a) > (b) ? (a) : (b))
#define FFMAX3(a,b,c) FFMAX(FFMAX(a,b),c)
#define FFMIN(a,b) ((a) > (b) ? (b) : (a))
#define FFMIN3(a,b,c) FFMIN(FFMIN(a,b),c)
#define FFSWAP(type,a,b) do{type SWAP_tmp= b; b= a; a= SWAP_tmp;}while(0)
#define FF_ARRAY_ELEMS(a) (sizeof(a) / sizeof((a)[0]))
#define MKTAG(a,b,c,d) ((a) | ((b) << 8) | ((c) << 16) | ((unsigned)(d) << 24))
#define MKBETAG(a,b,c,d) ((d) | ((c) << 8) | ((b) << 16) | ((unsigned)(a) << 24))
/**
* @addtogroup preproc_misc Preprocessor String Macros
*

View File

@ -31,7 +31,6 @@
#include <stdint.h>
#include "attributes.h"
#include "version.h"
/**
* @defgroup lavu_md5 MD5
@ -64,11 +63,7 @@ void av_md5_init(struct AVMD5 *ctx);
* @param src input data to update hash with
* @param len input data length
*/
#if FF_API_CRYPTO_SIZE_T
void av_md5_update(struct AVMD5 *ctx, const uint8_t *src, int len);
#else
void av_md5_update(struct AVMD5 *ctx, const uint8_t *src, size_t len);
#endif
/**
* Finish hashing and output digest value.
@ -85,11 +80,7 @@ void av_md5_final(struct AVMD5 *ctx, uint8_t *dst);
* @param src The data to hash
* @param len The length of the data, in bytes
*/
#if FF_API_CRYPTO_SIZE_T
void av_md5_sum(uint8_t *dst, const uint8_t *src, const int len);
#else
void av_md5_sum(uint8_t *dst, const uint8_t *src, size_t len);
#endif
/**
* @}

View File

@ -31,7 +31,6 @@
#include <stdint.h>
#include "attributes.h"
#include "error.h"
#include "avutil.h"
#include "version.h"
@ -238,14 +237,15 @@ av_alloc_size(1, 2) void *av_malloc_array(size_t nmemb, size_t size);
* @see av_mallocz()
* @see av_malloc_array()
*/
av_alloc_size(1, 2) void *av_mallocz_array(size_t nmemb, size_t size);
void *av_calloc(size_t nmemb, size_t size) av_malloc_attrib av_alloc_size(1, 2);
#if FF_API_AV_MALLOCZ_ARRAY
/**
* Non-inlined equivalent of av_mallocz_array().
*
* Created for symmetry with the calloc() C function.
* @deprecated use av_calloc()
*/
void *av_calloc(size_t nmemb, size_t size) av_malloc_attrib;
attribute_deprecated
void *av_mallocz_array(size_t nmemb, size_t size) av_malloc_attrib av_alloc_size(1, 2);
#endif
/**
* Allocate, reallocate, or free a block of memory.
@ -672,16 +672,7 @@ void *av_dynarray2_add(void **tab_ptr, int *nb_ptr, size_t elem_size,
* @param[out] r Pointer to the result of the operation
* @return 0 on success, AVERROR(EINVAL) on overflow
*/
static inline int av_size_mult(size_t a, size_t b, size_t *r)
{
size_t t = a * b;
/* Hack inspired from glibc: don't try the division if nelem and elsize
* are both less than sqrt(SIZE_MAX). */
if ((a | b) >= ((size_t)1 << (sizeof(size_t) * 4)) && a && t / a != b)
return AVERROR(EINVAL);
*r = t;
return 0;
}
int av_size_mult(size_t a, size_t b, size_t *r);
/**
* Set the maximum size that may be allocated in one block.

View File

@ -30,8 +30,6 @@
#include <stddef.h>
#include <stdint.h>
#include "version.h"
/**
* @defgroup lavu_murmur3 Murmur3
* @ingroup lavu_hash
@ -100,11 +98,7 @@ void av_murmur3_init(struct AVMurMur3 *c);
* @param[in] src Input data to update hash with
* @param[in] len Number of bytes to read from `src`
*/
#if FF_API_CRYPTO_SIZE_T
void av_murmur3_update(struct AVMurMur3 *c, const uint8_t *src, int len);
#else
void av_murmur3_update(struct AVMurMur3 *c, const uint8_t *src, size_t len);
#endif
/**
* Finish hashing and output digest value.

View File

@ -33,7 +33,6 @@
#include "log.h"
#include "pixfmt.h"
#include "samplefmt.h"
#include "version.h"
/**
* @defgroup avoptions AVOptions
@ -648,19 +647,6 @@ const AVOption *av_opt_next(const void *obj, const AVOption *prev);
*/
void *av_opt_child_next(void *obj, void *prev);
#if FF_API_CHILD_CLASS_NEXT
/**
* Iterate over potential AVOptions-enabled children of parent.
*
* @param prev result of a previous call to this function or NULL
* @return AVClass corresponding to next potential child or NULL
*
* @deprecated use av_opt_child_class_iterate
*/
attribute_deprecated
const AVClass *av_opt_child_class_next(const AVClass *parent, const AVClass *prev);
#endif
/**
* Iterate over potential AVOptions-enabled children of parent.
*
@ -804,9 +790,16 @@ int av_opt_query_ranges(AVOptionRanges **, void *obj, const char *key, int flags
/**
* Copy options from src object into dest object.
*
* The underlying AVClass of both src and dest must coincide. The guarantee
* below does not apply if this is not fulfilled.
*
* Options that require memory allocation (e.g. string or binary) are malloc'ed in dest object.
* Original memory allocated for such options is freed unless both src and dest options points to the same memory.
*
* Even on error it is guaranteed that allocated options from src and dest
* no longer alias each other afterwards; in particular calling av_opt_free()
* on both src and dest is safe afterwards if dest has been memdup'ed from src.
*
* @param dest Object to copy from
* @param src Object to copy into
* @return 0 on success, negative on error

View File

@ -26,7 +26,6 @@
#include "attributes.h"
#include "pixfmt.h"
#include "version.h"
typedef struct AVComponentDescriptor {
/**
@ -56,17 +55,6 @@ typedef struct AVComponentDescriptor {
* Number of bits in the component.
*/
int depth;
#if FF_API_PLUS1_MINUS1
/** deprecated, use step instead */
attribute_deprecated int step_minus1;
/** deprecated, use depth instead */
attribute_deprecated int depth_minus1;
/** deprecated, use offset instead */
attribute_deprecated int offset_plus1;
#endif
} AVComponentDescriptor;
/**
@ -147,26 +135,6 @@ typedef struct AVPixFmtDescriptor {
*/
#define AV_PIX_FMT_FLAG_RGB (1 << 5)
#if FF_API_PSEUDOPAL
/**
* The pixel format is "pseudo-paletted". This means that it contains a
* fixed palette in the 2nd plane but the palette is fixed/constant for each
* PIX_FMT. This allows interpreting the data as if it was PAL8, which can
* in some cases be simpler. Or the data can be interpreted purely based on
* the pixel format without using the palette.
* An example of a pseudo-paletted format is AV_PIX_FMT_GRAY8
*
* @deprecated This flag is deprecated, and will be removed. When it is removed,
* the extra palette allocation in AVFrame.data[1] is removed as well. Only
* actual paletted formats (as indicated by AV_PIX_FMT_FLAG_PAL) will have a
* palette. Starting with FFmpeg versions which have this flag deprecated, the
* extra "pseudo" palette is already ignored, and API users are not required to
* allocate a palette for AV_PIX_FMT_FLAG_PSEUDOPAL formats (it was required
* before the deprecation, though).
*/
#define AV_PIX_FMT_FLAG_PSEUDOPAL (1 << 6)
#endif
/**
* The pixel format has an alpha channel. This is set on all formats that
* support alpha in some way, including AV_PIX_FMT_PAL8. The alpha is always

View File

@ -112,21 +112,11 @@ enum AVPixelFormat {
AV_PIX_FMT_BGR555BE, ///< packed BGR 5:5:5, 16bpp, (msb)1X 5B 5G 5R(lsb), big-endian , X=unused/undefined
AV_PIX_FMT_BGR555LE, ///< packed BGR 5:5:5, 16bpp, (msb)1X 5B 5G 5R(lsb), little-endian, X=unused/undefined
#if FF_API_VAAPI
/** @name Deprecated pixel formats */
/**@{*/
AV_PIX_FMT_VAAPI_MOCO, ///< HW acceleration through VA API at motion compensation entry-point, Picture.data[3] contains a vaapi_render_state struct which contains macroblocks as well as various fields extracted from headers
AV_PIX_FMT_VAAPI_IDCT, ///< HW acceleration through VA API at IDCT entry-point, Picture.data[3] contains a vaapi_render_state struct which contains fields extracted from headers
AV_PIX_FMT_VAAPI_VLD, ///< HW decoding through VA API, Picture.data[3] contains a VASurfaceID
/**@}*/
AV_PIX_FMT_VAAPI = AV_PIX_FMT_VAAPI_VLD,
#else
/**
* Hardware acceleration through VA-API, data[3] contains a
* VASurfaceID.
*/
AV_PIX_FMT_VAAPI,
#endif
AV_PIX_FMT_YUV420P16LE, ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
AV_PIX_FMT_YUV420P16BE, ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
@ -360,6 +350,21 @@ enum AVPixelFormat {
AV_PIX_FMT_X2RGB10LE, ///< packed RGB 10:10:10, 30bpp, (msb)2X 10R 10G 10B(lsb), little-endian, X=unused/undefined
AV_PIX_FMT_X2RGB10BE, ///< packed RGB 10:10:10, 30bpp, (msb)2X 10R 10G 10B(lsb), big-endian, X=unused/undefined
AV_PIX_FMT_X2BGR10LE, ///< packed BGR 10:10:10, 30bpp, (msb)2X 10B 10G 10R(lsb), little-endian, X=unused/undefined
AV_PIX_FMT_X2BGR10BE, ///< packed BGR 10:10:10, 30bpp, (msb)2X 10B 10G 10R(lsb), big-endian, X=unused/undefined
AV_PIX_FMT_P210BE, ///< interleaved chroma YUV 4:2:2, 20bpp, data in the high bits, big-endian
AV_PIX_FMT_P210LE, ///< interleaved chroma YUV 4:2:2, 20bpp, data in the high bits, little-endian
AV_PIX_FMT_P410BE, ///< interleaved chroma YUV 4:4:4, 30bpp, data in the high bits, big-endian
AV_PIX_FMT_P410LE, ///< interleaved chroma YUV 4:4:4, 30bpp, data in the high bits, little-endian
AV_PIX_FMT_P216BE, ///< interleaved chroma YUV 4:2:2, 32bpp, big-endian
AV_PIX_FMT_P216LE, ///< interleaved chroma YUV 4:2:2, 32bpp, liddle-endian
AV_PIX_FMT_P416BE, ///< interleaved chroma YUV 4:4:4, 48bpp, big-endian
AV_PIX_FMT_P416LE, ///< interleaved chroma YUV 4:4:4, 48bpp, little-endian
AV_PIX_FMT_NB ///< number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions
};
@ -450,35 +455,41 @@ enum AVPixelFormat {
#define AV_PIX_FMT_Y210 AV_PIX_FMT_NE(Y210BE, Y210LE)
#define AV_PIX_FMT_X2RGB10 AV_PIX_FMT_NE(X2RGB10BE, X2RGB10LE)
#define AV_PIX_FMT_X2BGR10 AV_PIX_FMT_NE(X2BGR10BE, X2BGR10LE)
#define AV_PIX_FMT_P210 AV_PIX_FMT_NE(P210BE, P210LE)
#define AV_PIX_FMT_P410 AV_PIX_FMT_NE(P410BE, P410LE)
#define AV_PIX_FMT_P216 AV_PIX_FMT_NE(P216BE, P216LE)
#define AV_PIX_FMT_P416 AV_PIX_FMT_NE(P416BE, P416LE)
/**
* Chromaticity coordinates of the source primaries.
* These values match the ones defined by ISO/IEC 23001-8_2013 § 7.1.
* These values match the ones defined by ISO/IEC 23091-2_2019 subclause 8.1 and ITU-T H.273.
*/
enum AVColorPrimaries {
AVCOL_PRI_RESERVED0 = 0,
AVCOL_PRI_BT709 = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP177 Annex B
AVCOL_PRI_BT709 = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP 177 Annex B
AVCOL_PRI_UNSPECIFIED = 2,
AVCOL_PRI_RESERVED = 3,
AVCOL_PRI_BT470M = 4, ///< also FCC Title 47 Code of Federal Regulations 73.682 (a)(20)
AVCOL_PRI_BT470BG = 5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM
AVCOL_PRI_SMPTE170M = 6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC
AVCOL_PRI_SMPTE240M = 7, ///< functionally identical to above
AVCOL_PRI_SMPTE240M = 7, ///< identical to above, also called "SMPTE C" even though it uses D65
AVCOL_PRI_FILM = 8, ///< colour filters using Illuminant C
AVCOL_PRI_BT2020 = 9, ///< ITU-R BT2020
AVCOL_PRI_SMPTE428 = 10, ///< SMPTE ST 428-1 (CIE 1931 XYZ)
AVCOL_PRI_SMPTEST428_1 = AVCOL_PRI_SMPTE428,
AVCOL_PRI_SMPTE431 = 11, ///< SMPTE ST 431-2 (2011) / DCI P3
AVCOL_PRI_SMPTE432 = 12, ///< SMPTE ST 432-1 (2010) / P3 D65 / Display P3
AVCOL_PRI_EBU3213 = 22, ///< EBU Tech. 3213-E / JEDEC P22 phosphors
AVCOL_PRI_EBU3213 = 22, ///< EBU Tech. 3213-E (nothing there) / one of JEDEC P22 group phosphors
AVCOL_PRI_JEDEC_P22 = AVCOL_PRI_EBU3213,
AVCOL_PRI_NB ///< Not part of ABI
};
/**
* Color Transfer Characteristic.
* These values match the ones defined by ISO/IEC 23001-8_2013 § 7.2.
* These values match the ones defined by ISO/IEC 23091-2_2019 subclause 8.2.
*/
enum AVColorTransferCharacteristic {
AVCOL_TRC_RESERVED0 = 0,
@ -507,18 +518,18 @@ enum AVColorTransferCharacteristic {
/**
* YUV colorspace type.
* These values match the ones defined by ISO/IEC 23001-8_2013 § 7.3.
* These values match the ones defined by ISO/IEC 23091-2_2019 subclause 8.3.
*/
enum AVColorSpace {
AVCOL_SPC_RGB = 0, ///< order of coefficients is actually GBR, also IEC 61966-2-1 (sRGB)
AVCOL_SPC_BT709 = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / SMPTE RP177 Annex B
AVCOL_SPC_RGB = 0, ///< order of coefficients is actually GBR, also IEC 61966-2-1 (sRGB), YZX and ST 428-1
AVCOL_SPC_BT709 = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / derived in SMPTE RP 177 Annex B
AVCOL_SPC_UNSPECIFIED = 2,
AVCOL_SPC_RESERVED = 3,
AVCOL_SPC_RESERVED = 3, ///< reserved for future use by ITU-T and ISO/IEC just like 15-255 are
AVCOL_SPC_FCC = 4, ///< FCC Title 47 Code of Federal Regulations 73.682 (a)(20)
AVCOL_SPC_BT470BG = 5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM / IEC 61966-2-4 xvYCC601
AVCOL_SPC_SMPTE170M = 6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC
AVCOL_SPC_SMPTE240M = 7, ///< functionally identical to above
AVCOL_SPC_YCGCO = 8, ///< Used by Dirac / VC-2 and H.264 FRext, see ITU-T SG16
AVCOL_SPC_SMPTE170M = 6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC / functionally identical to above
AVCOL_SPC_SMPTE240M = 7, ///< derived from 170M primaries and D65 white point, 170M is derived from BT470 System M's primaries
AVCOL_SPC_YCGCO = 8, ///< used by Dirac / VC-2 and H.264 FRext, see ITU-T SG16
AVCOL_SPC_YCOCG = AVCOL_SPC_YCGCO,
AVCOL_SPC_BT2020_NCL = 9, ///< ITU-R BT2020 non-constant luminance system
AVCOL_SPC_BT2020_CL = 10, ///< ITU-R BT2020 constant luminance system
@ -540,9 +551,9 @@ enum AVColorSpace {
* recommended, as it also defines the full range representation.
*
* Common definitions:
* - For RGB and luminance planes such as Y in YCbCr and I in ICtCp,
* - For RGB and luma planes such as Y in YCbCr and I in ICtCp,
* 'E' is the original value in range of 0.0 to 1.0.
* - For chrominance planes such as Cb,Cr and Ct,Cp, 'E' is the original
* - For chroma planes such as Cb,Cr and Ct,Cp, 'E' is the original
* value in range of -0.5 to 0.5.
* - 'n' is the output bit depth.
* - For additional definitions such as rounding and clipping to valid n
@ -554,13 +565,13 @@ enum AVColorRange {
/**
* Narrow or limited range content.
*
* - For luminance planes:
* - For luma planes:
*
* (219 * E + 16) * 2^(n-8)
*
* F.ex. the range of 16-235 for 8 bits
*
* - For chrominance planes:
* - For chroma planes:
*
* (224 * E + 128) * 2^(n-8)
*
@ -571,13 +582,13 @@ enum AVColorRange {
/**
* Full range content.
*
* - For RGB and luminance planes:
* - For RGB and luma planes:
*
* (2^n - 1) * E
*
* F.ex. the range of 0-255 for 8 bits
*
* - For chrominance planes:
* - For chroma planes:
*
* (2^n - 1) * E + 2^(n - 1)
*

View File

@ -32,7 +32,6 @@
#include <stdint.h>
#include "attributes.h"
#include "version.h"
/**
* @defgroup lavu_ripemd RIPEMD
@ -67,11 +66,7 @@ int av_ripemd_init(struct AVRIPEMD* context, int bits);
* @param data input data to update hash with
* @param len input data length
*/
#if FF_API_CRYPTO_SIZE_T
void av_ripemd_update(struct AVRIPEMD* context, const uint8_t* data, unsigned int len);
#else
void av_ripemd_update(struct AVRIPEMD* context, const uint8_t* data, size_t len);
#endif
/**
* Finish hashing and output digest value.

View File

@ -195,9 +195,8 @@ int av_samples_get_buffer_size(int *linesize, int nb_channels, int nb_samples,
* @param nb_samples the number of samples in a single channel
* @param sample_fmt the sample format
* @param align buffer size alignment (0 = default, 1 = no alignment)
* @return >=0 on success or a negative error code on failure
* @todo return minimum size in bytes required for the buffer in case
* of success at the next bump
* @return minimum size in bytes required for the buffer on success,
* or a negative error code on failure
*/
int av_samples_fill_arrays(uint8_t **audio_data, int *linesize,
const uint8_t *buf,

View File

@ -31,7 +31,6 @@
#include <stdint.h>
#include "attributes.h"
#include "version.h"
/**
* @defgroup lavu_sha SHA
@ -74,11 +73,7 @@ int av_sha_init(struct AVSHA* context, int bits);
* @param data input data to update hash with
* @param len input data length
*/
#if FF_API_CRYPTO_SIZE_T
void av_sha_update(struct AVSHA *ctx, const uint8_t *data, unsigned int len);
#else
void av_sha_update(struct AVSHA *ctx, const uint8_t *data, size_t len);
#endif
/**
* Finish hashing and output digest value.

View File

@ -32,7 +32,6 @@
#include <stdint.h>
#include "attributes.h"
#include "version.h"
/**
* @defgroup lavu_sha512 SHA-512
@ -76,11 +75,7 @@ int av_sha512_init(struct AVSHA512* context, int bits);
* @param data input data to update hash with
* @param len input data length
*/
#if FF_API_CRYPTO_SIZE_T
void av_sha512_update(struct AVSHA512* context, const uint8_t* data, unsigned int len);
#else
void av_sha512_update(struct AVSHA512* context, const uint8_t* data, size_t len);
#endif
/**
* Finish hashing and output digest value.

View File

@ -28,7 +28,6 @@
#define AVUTIL_TREE_H
#include "attributes.h"
#include "version.h"
/**
* @addtogroup lavu_tree AVTree

View File

@ -49,11 +49,14 @@ enum AVTXType {
* float. Length is the frame size, not the window size (which is 2x frame)
* For forward transforms, the stride specifies the spacing between each
* sample in the output array in bytes. The input must be a flat array.
*
* For inverse transforms, the stride specifies the spacing between each
* sample in the input array in bytes. The output will be a flat array.
* Stride must be a non-zero multiple of sizeof(float).
*
* NOTE: the inverse transform is half-length, meaning the output will not
* contain redundant data. This is what most codecs work with.
* contain redundant data. This is what most codecs work with. To do a full
* inverse transform, set the AV_TX_FULL_IMDCT flag on init.
*/
AV_TX_FLOAT_MDCT = 1,
@ -93,7 +96,7 @@ enum AVTXType {
* @param stride the input or output stride in bytes
*
* The out and in arrays must be aligned to the maximum required by the CPU
* architecture.
* architecture unless the AV_TX_UNALIGNED flag was set in av_tx_init().
* The stride must follow the constraints the transform type has specified.
*/
typedef void (*av_tx_fn)(AVTXContext *s, void *out, void *in, ptrdiff_t stride);
@ -108,6 +111,20 @@ enum AVTXFlags {
* transform types.
*/
AV_TX_INPLACE = 1ULL << 0,
/**
* Relaxes alignment requirement for the in and out arrays of av_tx_fn().
* May be slower with certain transform types.
*/
AV_TX_UNALIGNED = 1ULL << 1,
/**
* Performs a full inverse MDCT rather than leaving out samples that can be
* derived through symmetry. Requires an output array of 'len' floats,
* rather than the usual 'len/2' floats.
* Ignored for all transforms but inverse MDCTs.
*/
AV_TX_FULL_IMDCT = 1ULL << 2,
};
/**

View File

@ -78,8 +78,8 @@
* @{
*/
#define LIBAVUTIL_VERSION_MAJOR 56
#define LIBAVUTIL_VERSION_MINOR 70
#define LIBAVUTIL_VERSION_MAJOR 57
#define LIBAVUTIL_VERSION_MINOR 17
#define LIBAVUTIL_VERSION_MICRO 100
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
@ -105,42 +105,10 @@
* @{
*/
#ifndef FF_API_VAAPI
#define FF_API_VAAPI (LIBAVUTIL_VERSION_MAJOR < 57)
#endif
#ifndef FF_API_FRAME_QP
#define FF_API_FRAME_QP (LIBAVUTIL_VERSION_MAJOR < 57)
#endif
#ifndef FF_API_PLUS1_MINUS1
#define FF_API_PLUS1_MINUS1 (LIBAVUTIL_VERSION_MAJOR < 57)
#endif
#ifndef FF_API_ERROR_FRAME
#define FF_API_ERROR_FRAME (LIBAVUTIL_VERSION_MAJOR < 57)
#endif
#ifndef FF_API_PKT_PTS
#define FF_API_PKT_PTS (LIBAVUTIL_VERSION_MAJOR < 57)
#endif
#ifndef FF_API_CRYPTO_SIZE_T
#define FF_API_CRYPTO_SIZE_T (LIBAVUTIL_VERSION_MAJOR < 57)
#endif
#ifndef FF_API_FRAME_GET_SET
#define FF_API_FRAME_GET_SET (LIBAVUTIL_VERSION_MAJOR < 57)
#endif
#ifndef FF_API_PSEUDOPAL
#define FF_API_PSEUDOPAL (LIBAVUTIL_VERSION_MAJOR < 57)
#endif
#ifndef FF_API_CHILD_CLASS_NEXT
#define FF_API_CHILD_CLASS_NEXT (LIBAVUTIL_VERSION_MAJOR < 57)
#endif
#ifndef FF_API_BUFFER_SIZE_T
#define FF_API_BUFFER_SIZE_T (LIBAVUTIL_VERSION_MAJOR < 57)
#endif
#ifndef FF_API_D2STR
#define FF_API_D2STR (LIBAVUTIL_VERSION_MAJOR < 58)
#endif
#ifndef FF_API_DECLARE_ALIGNED
#define FF_API_DECLARE_ALIGNED (LIBAVUTIL_VERSION_MAJOR < 58)
#endif
#define FF_API_COLORSPACE_NAME (LIBAVUTIL_VERSION_MAJOR < 58)
#define FF_API_AV_MALLOCZ_ARRAY (LIBAVUTIL_VERSION_MAJOR < 58)
/**
* @}

View File

@ -26,10 +26,10 @@
* Libswresample version macros
*/
#include "libavutil/avutil.h"
#include "libavutil/version.h"
#define LIBSWRESAMPLE_VERSION_MAJOR 3
#define LIBSWRESAMPLE_VERSION_MINOR 9
#define LIBSWRESAMPLE_VERSION_MAJOR 4
#define LIBSWRESAMPLE_VERSION_MINOR 3
#define LIBSWRESAMPLE_VERSION_MICRO 100
#define LIBSWRESAMPLE_VERSION_INT AV_VERSION_INT(LIBSWRESAMPLE_VERSION_MAJOR, \

Binary file not shown.

BIN
ThirdParty/ffmpeg/lib/libavformat.59.dylib vendored Executable file

Binary file not shown.

Binary file not shown.

BIN
ThirdParty/ffmpeg/lib/libavutil.57.dylib vendored Executable file

Binary file not shown.

View File

@ -0,0 +1,54 @@
From 58a0eebe4f0aa606909ffe7d7b1a2aa5f48b7ee6 Mon Sep 17 00:00:00 2001
From: Christopher Snowhill <kode54@gmail.com>
Date: Sat, 8 Jan 2022 16:25:39 -0800
Subject: [PATCH] avformat/id3v1: Update genre list
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
---
libavformat/id3v1.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/libavformat/id3v1.c b/libavformat/id3v1.c
index 3189a48b8c..19760595d5 100644
--- a/libavformat/id3v1.c
+++ b/libavformat/id3v1.c
@@ -53,7 +53,7 @@ const char * const ff_id3v1_genre_str[ID3v1_GENRE_MAX + 1] = {
[26] = "Ambient",
[27] = "Trip-Hop",
[28] = "Vocal",
- [29] = "Jazz+Funk",
+ [29] = "Jazz-Funk",
[30] = "Fusion",
[31] = "Trance",
[32] = "Classical",
@@ -114,7 +114,7 @@ const char * const ff_id3v1_genre_str[ID3v1_GENRE_MAX + 1] = {
[87] = "Revival",
[88] = "Celtic",
[89] = "Bluegrass",
- [90] = "Avantgarde",
+ [90] = "Avant-garde",
[91] = "Gothic Rock",
[92] = "Progressive Rock",
[93] = "Psychedelic Rock",
@@ -149,15 +149,15 @@ const char * const ff_id3v1_genre_str[ID3v1_GENRE_MAX + 1] = {
[122] = "Drum Solo",
[123] = "A Cappella",
[124] = "Euro-House",
- [125] = "Dance Hall",
+ [125] = "Dancehall",
[126] = "Goa",
[127] = "Drum & Bass",
[128] = "Club-House",
[129] = "Hardcore Techno",
[130] = "Terror",
[131] = "Indie",
- [132] = "BritPop",
- [133] = "Negerpunk",
+ [132] = "Britpop",
+ [133] = "Worldbeat",
[134] = "Polsk Punk",
[135] = "Beat",
[136] = "Christian Gangsta Rap",
--
2.32.0 (Apple Git-132)

View File

@ -0,0 +1,123 @@
diff --git a/libavformat/mp3dec.c b/libavformat/mp3dec.c
index f617348b2e..730ff3e480 100644
--- a/libavformat/mp3dec.c
+++ b/libavformat/mp3dec.c
@@ -313,6 +313,76 @@ static void mp3_parse_vbri_tag(AVFormatContext *s, AVStream *st, int64_t base)
}
}
+static void mp3_parse_itunes_tag(AVFormatContext *s, AVStream *st, MPADecodeHeader *c, int64_t base, int vbrtag_size, unsigned int *size, uint64_t *duration, uint32_t spf)
+{
+ uint32_t v;
+ AVDictionaryEntry *de;
+ FFStream *const sti = ffstream(st);
+ MP3DecContext *mp3 = s->priv_data;
+ size_t length;
+ uint32_t zero, start_pad, end_pad;
+ uint64_t last_eight_frames_offset;
+ int64_t temp_duration, file_size;
+ int i;
+
+ if (!s->metadata || !(de = av_dict_get(s->metadata, "iTunSMPB", NULL, 0)))
+ return;
+
+ length = strlen(de->value);
+
+ /* Minimum length is one digit per field plus the whitespace, maximum length should depend on field type
+ * There are four fields we need in the first six, the rest are currently zero padding */
+ if (length < (12 + 11) || length > (10 * 8 + 2 * 16 + 11))
+ return;
+
+ file_size = avio_size(s->pb);
+ if (file_size < 0)
+ file_size = 0;
+
+ if (sscanf(de->value, "%"PRIx32" %"PRIx32" %"PRIx32" %"PRIx64" %"PRIx32" %"PRIx64, &zero, &start_pad, &end_pad, &temp_duration, &zero, &last_eight_frames_offset) < 6 ||
+ temp_duration < 0 ||
+ start_pad > (576 * 2 * 32) ||
+ end_pad > (576 * 2 * 64) ||
+ (file_size && (last_eight_frames_offset >= (file_size - base - vbrtag_size)))) {
+ *duration = 0;
+ return;
+ }
+
+ *duration = temp_duration;
+
+ if (end_pad >= 528 + 1) {
+ mp3->start_pad = start_pad + 528 + 1;
+ mp3->end_pad = end_pad - (528 + 1);
+ sti->start_skip_samples = mp3->start_pad;
+ if (mp3->frames) {
+ sti->first_discard_sample = -mp3->end_pad + 528 + 1 + mp3->frames * (int64_t)spf;
+ sti->last_discard_sample = mp3->frames * (int64_t)spf;
+ }
+ if (!st->start_time)
+ st->start_time = av_rescale_q(sti->start_skip_samples,
+ (AVRational){1, c->sample_rate},
+ st->time_base);
+ av_log(s, AV_LOG_DEBUG, "pad %d %d\n", mp3->start_pad, mp3-> end_pad);
+ }
+ av_log(s, AV_LOG_DEBUG, "pad %d %d\n", mp3->start_pad, mp3->end_pad);
+ if (!s->pb->seekable)
+ return;
+
+ *size = (unsigned int) last_eight_frames_offset;
+ if (avio_seek(s->pb, base + vbrtag_size + last_eight_frames_offset, SEEK_SET) < 0)
+ return;
+
+ for (i = 0; i < 8; i++) {
+ v = avio_rb32(s->pb);
+ if (ff_mpa_check_header(v) < 0)
+ return;
+ if (avpriv_mpegaudio_decode_header(c, v) != 0)
+ break;
+ *size += c->frame_size;
+ avio_skip(s->pb, c->frame_size - 4);
+ }
+}
+
/**
* Try to find Xing/Info/VBRI tags and compute duration from info therein
*/
@@ -321,8 +391,10 @@ static int mp3_parse_vbr_tags(AVFormatContext *s, AVStream *st, int64_t base)
uint32_t v, spf;
MPADecodeHeader c;
int vbrtag_size = 0;
+ unsigned int size = 0;
MP3DecContext *mp3 = s->priv_data;
int ret;
+ uint64_t duration = 0;
ffio_init_checksum(s->pb, ff_crcA001_update, 0);
@@ -345,16 +417,29 @@ static int mp3_parse_vbr_tags(AVFormatContext *s, AVStream *st, int64_t base)
mp3_parse_vbri_tag(s, st, base);
if (!mp3->frames && !mp3->header_filesize)
+ vbrtag_size = 0;
+
+ mp3_parse_itunes_tag(s, st, &c, base, vbrtag_size, &size, &duration, spf);
+
+ if (!mp3->frames && !size && !duration)
return -1;
/* Skip the vbr tag frame */
avio_seek(s->pb, base + vbrtag_size, SEEK_SET);
- if (mp3->frames)
+ if (duration)
+ st->duration = av_rescale_q(duration, (AVRational){1, c.sample_rate}, st->time_base);
+ else if (mp3->frames)
st->duration = av_rescale_q(mp3->frames, (AVRational){spf, c.sample_rate},
st->time_base);
if (mp3->header_filesize && mp3->frames && !mp3->is_cbr)
st->codecpar->bit_rate = av_rescale(mp3->header_filesize, 8 * c.sample_rate, mp3->frames * (int64_t)spf);
+ if (size) {
+ if (duration)
+ st->codecpar->bit_rate = av_rescale(size, 8 * c.sample_rate, duration);
+ else if (mp3->frames)
+ st->codecpar->bit_rate = av_rescale(size, 8 * c.sample_rate, mp3->frames * (int64_t)spf);
+ }
return 0;
}