资源简介
参考文章http://www.cnblogs.com/xiezhidong/p/6924775.html
代码片段和文件信息
/*
* Copyright (c) 2014 Lukasz Marek
*
* Permission is hereby granted free of charge to any person obtaining a copy
* of this software and associated documentation files (the “Software“) to deal
* in the Software without restriction including without limitation the rights
* to use copy modify merge publish distribute sublicense and/or sell
* copies of the Software and to permit persons to whom the Software is
* furnished to do so subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED “AS IS“ WITHOUT WARRANTY OF ANY KIND EXPRESS OR
* IMPLIED INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM DAMAGES OR OTHER
* LIABILITY WHETHER IN AN ACTION OF CONTRACT TORT OR OTHERWISE ARISING FROM
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include
#include
#include
static const char *type_string(int type)
{
switch (type) {
case AVIO_ENTRY_DIRECTORY:
return ““;
case AVIO_ENTRY_FILE:
return ““;
case AVIO_ENTRY_BLOCK_DEVICE:
return ““;
case AVIO_ENTRY_CHARACTER_DEVICE:
return ““;
case AVIO_ENTRY_NAMED_PIPE:
return ““;
case AVIO_ENTRY_SYMBOLIC_link:
return “nk>“;
case AVIO_ENTRY_SOCKET:
return ““;
case AVIO_ENTRY_SERVER:
return ““;
case AVIO_ENTRY_SHARE:
return ““;
case AVIO_ENTRY_WORKGROUP:
return ““;
case AVIO_ENTRY_UNKNOWN:
default:
break;
}
return ““;
}
int main(int argc char *argv[])
{
const char *input_dir = NULL;
AVIODirEntry *entry = NULL;
AVIODirContext *ctx = NULL;
int cnt ret;
char filemode[4] uid_and_gid[20];
av_log_set_level(AV_LOG_DEBUG);
if (argc != 2) {
fprintf(stderr “usage: %s input_dir\n“
“API example program to show how to list files in directory “
“accessed through AVIOContext.\n“ argv[0]);
return 1;
}
input_dir = argv[1];
/* register codecs and formats and other lavf/lavc components*/
av_register_all();
avformat_network_init();
if ((ret = avio_open_dir(&ctx input_dir NULL)) < 0) {
av_log(NULL AV_LOG_ERROR “Cannot open directory: %s.\n“ av_err2str(ret));
goto fail;
}
cnt = 0;
for (;;) {
if ((ret = avio_read_dir(ctx &entry)) < 0) {
av_log(NULL AV_LOG_ERROR “Cannot list directory: %s.\n“ av_err2str(ret));
goto fail;
}
if (!entry)
break;
if (entry->fil
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 25301504 2016-12-20 23:18 ffmpeg\bin\avcodec-56.dll
文件 1508352 2016-12-20 22:47 ffmpeg\bin\avdevice-56.dll
文件 2696192 2016-12-20 22:50 ffmpeg\bin\avfilter-5.dll
文件 6366208 2016-12-20 22:52 ffmpeg\bin\avformat-56.dll
文件 473600 2016-12-20 22:45 ffmpeg\bin\avutil-54.dll
文件 342528 2016-12-20 22:45 ffmpeg\bin\ffmpeg.exe
文件 546816 2016-12-20 22:45 ffmpeg\bin\ffplay.exe
文件 167424 2016-12-20 22:45 ffmpeg\bin\ffprobe.exe
文件 140800 2016-12-20 22:44 ffmpeg\bin\postproc-53.dll
文件 293888 2016-12-20 22:45 ffmpeg\bin\swresample-1.dll
文件 516608 2016-12-20 22:44 ffmpeg\bin\swscale-3.dll
文件 39663 2016-12-20 22:44 ffmpeg\doc\developer.html
文件 4018 2016-12-20 23:01 ffmpeg\doc\examples\avio_list_dir.c
文件 4060 2016-12-20 23:01 ffmpeg\doc\examples\avio_reading.c
文件 19620 2016-12-20 23:01 ffmpeg\doc\examples\decoding_encoding.c
文件 15310 2016-12-20 23:01 ffmpeg\doc\examples\demuxing_decoding.c
文件 5746 2016-12-20 23:01 ffmpeg\doc\examples\extract_mvs.c
文件 10088 2016-12-20 23:01 ffmpeg\doc\examples\filtering_audio.c
文件 9065 2016-12-20 23:01 ffmpeg\doc\examples\filtering_video.c
文件 11854 2016-12-20 23:02 ffmpeg\doc\examples\filter_audio.c
文件 5212 2016-12-20 23:01 ffmpeg\doc\examples\http_multiclient.c
文件 1758 2016-12-20 23:00 ffmpeg\doc\examples\Makefile
文件 1941 2016-12-20 23:00 ffmpeg\doc\examples\me
文件 21678 2016-12-20 23:00 ffmpeg\doc\examples\muxing.c
文件 14302 2016-12-20 23:00 ffmpeg\doc\examples\qsvdec.c
文件 888 2016-12-20 23:00 ffmpeg\doc\examples\README
文件 5630 2016-12-20 23:00 ffmpeg\doc\examples\remuxing.c
文件 8005 2016-12-20 23:00 ffmpeg\doc\examples\resampling_audio.c
文件 5028 2016-12-20 23:00 ffmpeg\doc\examples\scaling_video.c
文件 28543 2016-12-20 23:00 ffmpeg\doc\examples\transcode_aac.c
............此处省略84个文件信息
评论
共有 条评论