[FFmpeg-devel] [PATCH] avformat/cache: rename the class name fro Cache to cache

Steven Liu lq at chinaffmpeg.org
Wed Dec 4 11:17:18 EET 2019


Because the protocol name is cache, but the class name is Cache.

for example:
ffmpeg -protocols will show:
Supported file protocols:
Input:
  async
  bluray
  cache
  concat
  crypto
  data
  ffrtmphttp
  file
  ftp
  gopher
  hls
  http
  httpproxy
  https
  mmsh
  mmst
  pipe
  rtmp
  rtmps
  rtmpt
  rtmpts
  rtp
  srtp
  subfile
  tcp
  tls
  udp
  udplite
  unix
Output:
  crypto
  ffrtmphttp
  file
  ftp
  gopher
  http
  httpproxy
  https
  icecast
  md5
  pipe
  prompeg
  rtmp
  rtmps
  rtmpt
  rtmpts
  rtp
  srtp
  tee
  tcp
  tls
  udp
  udplite
  unix

But i cannot find the cache protocol in help message
liuqideMacBook-Pro:build liuqi$ ffmpeg --help full | grep cache
ffmpeg version N-95812-gd73f062706 Copyright (c) 2000-2019 the FFmpeg developers
  built with Apple LLVM version 10.0.0 (clang-1000.11.45.5)
  configuration: --enable-fontconfig --enable-gpl --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libspeex --enable-libx264 --enable-libx265 --enable-libfdk-aac --enable-version3 --enable-nonfree --enable-videotoolbox --enable-libxml2 --samples=fate-suite/ --enable-libopencv
  libavutil      56. 36.100 / 56. 36.100
  libavcodec     58. 62.100 / 58. 62.100
  libavformat    58. 35.100 / 58. 35.100
  libavdevice    58.  9.101 / 58.  9.101
  libavfilter     7. 66.100 /  7. 66.100
  libswscale      5.  6.100 /  5.  6.100
  libswresample   3.  6.100 /  3.  6.100
  libpostproc    55.  6.100 / 55.  6.100
  -hls_allow_cache   <int>        E......... explicitly set whether the client MAY (1) or MUST NOT (0) cache media segments (from INT_MIN to INT_MAX) (default -1)
  -segment_list_flags <flags>      E......... set flags affecting segment list generation (default cache)
     cache                        E......... allow list caching
  -segment_list_flags <flags>      E......... set flags affecting segment list generation (default cache)
     cache                        E......... allow list caching
  frames            <int>        ..FV...... set number of frames in cache (from 2 to 512) (default 30)
liuqideMacBook-Pro:build liuqi$

after patch:

bogon:dash liuqi$ ./ffmpeg --help full | grep cache
ffmpeg version N-95942-gece617e849 Copyright (c) 2000-2019 the FFmpeg developers
  built with Apple LLVM version 10.0.0 (clang-1000.11.45.5)
  configuration: --enable-fontconfig --enable-gpl --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libspeex --enable-libx264 --enable-libx265 --enable-libfdk-aac --enable-version3 --enable-nonfree --enable-videotoolbox --enable-libxml2 --samples=fate-suite/ --enable-libopencv --enable-libopus
  libavutil      56. 36.101 / 56. 36.101
  libavcodec     58. 64.101 / 58. 64.101
  libavformat    58. 35.100 / 58. 35.100
  libavdevice    58.  9.101 / 58.  9.101
  libavfilter     7. 67.100 /  7. 67.100
  libswscale      5.  6.100 /  5.  6.100
  libswresample   3.  6.100 /  3.  6.100
  libpostproc    55.  6.100 / 55.  6.100
cache AVOptions:
  -hls_allow_cache   <int>        E......... explicitly set whether the client MAY (1) or MUST NOT (0) cache media segments (from INT_MIN to INT_MAX) (default -1)
  -segment_list_flags <flags>      E......... set flags affecting segment list generation (default cache)
     cache                        E......... allow list caching
  -segment_list_flags <flags>      E......... set flags affecting segment list generation (default cache)
     cache                        E......... allow list caching
  frames            <int>        ..FV...... set number of frames in cache (from 2 to 512) (default 30)
bogon:dash liuqi$

can find the cache AVOptions after patch.

Signed-off-by: Steven Liu <lq at chinaffmpeg.org>
---
 libavformat/cache.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/cache.c b/libavformat/cache.c
index 3425be9350..09e5d5f832 100644
--- a/libavformat/cache.c
+++ b/libavformat/cache.c
@@ -326,7 +326,7 @@ static const AVOption options[] = {
 };
 
 static const AVClass cache_context_class = {
-    .class_name = "Cache",
+    .class_name = "cache",
     .item_name  = av_default_item_name,
     .option     = options,
     .version    = LIBAVUTIL_VERSION_INT,
-- 
2.15.1





More information about the ffmpeg-devel mailing list