资源简介
包含FFmpeg 32 64位版本的C++库 .
代码片段和文件信息
/*
* Copyright (c) 2014 Stefano Sabatini
*
* 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.
*/
/**
* @file
* libavformat AVIOContext API example.
*
* Make libavformat demuxer access media content through a custom
* AVIOContext read callback.
* @example avio_reading.c
*/
#include
#include
#include
#include
struct buffer_data {
uint8_t *ptr;
size_t size; ///< size left in the buffer
};
static int read_packet(void *opaque uint8_t *buf int buf_size)
{
struct buffer_data *bd = (struct buffer_data *)opaque;
buf_size = FFMIN(buf_size bd->size);
printf(“ptr:%p size:%zu\n“ bd->ptr bd->size);
/* copy internal buffer data to buf */
memcpy(buf bd->ptr buf_size);
bd->ptr += buf_size;
bd->size -= buf_size;
return buf_size;
}
int main(int argc char *argv[])
{
AVFormatContext *fmt_ctx = NULL;
AVIOContext *avio_ctx = NULL;
uint8_t *buffer = NULL *avio_ctx_buffer = NULL;
size_t buffer_size avio_ctx_buffer_size = 4096;
char *input_filename = NULL;
int ret = 0;
struct buffer_data bd = { 0 };
if (argc != 2) {
fprintf(stderr “usage: %s input_file\n“
“API example program to show how to read from a custom buffer “
“accessed through AVIOContext.\n“ argv[0]);
return 1;
}
input_filename = argv[1];
/* register codecs and formats and other lavf/lavc components*/
av_register_all();
/* slurp file content into buffer */
ret = av_file_map(input_filename &buffer &buffer_size 0 NULL);
if (ret < 0)
goto end;
/* fill opaque structure used by the AVIOContext read callback */
bd.ptr = buffer;
bd.size = buffer_size;
if (!(fmt_ctx = avformat_alloc_context())) {
ret = AVERROR(ENOMEM);
goto end;
}
avio_ctx_buffer = av_malloc(avio_ctx_buffer_size);
if (!avio_ctx_
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 26501 2016-02-16 18:52 Include\config.h
文件 36806 2016-02-16 18:52 Include\doc\developer.html
文件 4060 2016-02-16 18:52 Include\doc\examples\avio_reading.c
文件 19627 2016-02-16 18:52 Include\doc\examples\decoding_encoding.c
文件 14368 2016-02-16 18:52 Include\doc\examples\demuxing_decoding.c
文件 9521 2016-02-16 18:52 Include\doc\examples\filtering_audio.c
文件 8440 2016-02-16 18:52 Include\doc\examples\filtering_video.c
文件 11827 2016-02-16 18:52 Include\doc\examples\filter_audio.c
文件 1566 2016-02-16 18:52 Include\doc\examples\Makefile
文件 1941 2016-02-16 18:52 Include\doc\examples\me
文件 20280 2016-02-16 18:52 Include\doc\examples\muxing.c
文件 888 2016-02-16 18:52 Include\doc\examples\README
文件 5625 2016-02-16 18:52 Include\doc\examples\remuxing.c
文件 8027 2016-02-16 18:52 Include\doc\examples\resampling_audio.c
文件 5050 2016-02-16 18:52 Include\doc\examples\scaling_video.c
文件 27979 2016-02-16 18:52 Include\doc\examples\transcode_aac.c
文件 21369 2016-02-16 18:52 Include\doc\examples\transcoding.c
文件 45152 2016-02-16 18:52 Include\doc\faq.html
文件 11997 2016-02-16 18:52 Include\doc\fate.html
文件 974065 2016-02-16 18:52 Include\doc\ffmpeg-all.html
文件 10585 2016-02-16 18:52 Include\doc\ffmpeg-bitstream-filters.html
文件 158923 2016-02-16 18:52 Include\doc\ffmpeg-codecs.html
文件 65776 2016-02-16 18:52 Include\doc\ffmpeg-devices.html
文件 461027 2016-02-16 18:52 Include\doc\ffmpeg-filters.html
文件 89727 2016-02-16 18:52 Include\doc\ffmpeg-formats.html
文件 54654 2016-02-16 18:52 Include\doc\ffmpeg-protocols.html
文件 13300 2016-02-16 18:52 Include\doc\ffmpeg-resampler.html
文件 7043 2016-02-16 18:52 Include\doc\ffmpeg-scaler.html
文件 44729 2016-02-16 18:52 Include\doc\ffmpeg-utils.html
文件 93335 2016-02-16 18:52 Include\doc\ffmpeg.html
............此处省略212个文件信息
相关资源
- Effective C++改善程序与设计的55个具体
- OpenGL迷宫山东大学图形学实验三
- VC++24点游戏完整程序源码
- VC++外挂框架.rar
- VC++技术内幕第五版中文pdf
- C和C++程序员面试秘笈-董山海_高清版
- 线性代数C++模板库 Eigen 3.1.1 的CHM文档
- Effective C++中文版(第三版)
- VisualC++网络高级编程.(人民邮电.陈坚
- C++黑客编程揭秘与防范.pdf
- COM本质论.pdf )
- 基于VC++利用MFC做的图书管理系统
- MFC智能停车场管理系统
- c++版学生成绩管理系统实验报告及源
- c++游戏程序(包含源代码,有扫雷,
- VC++阳历(公历)到阴历(农历)转换
- NOIP2006-2017普及组初赛c++版试题+答案
- c++编写病毒方法+100个病毒源码
- 新概念C++程序设计大学教程第2版张基
- C++实现的职工管理系统
- Visual C++数字图像实用工程案例精选源
- 常用数值计算方法c++源代码实现
- 粒子群算法及其代码实现
- 椭圆曲线ECC加密解密算法的c语言实现
- 格雷码图片生成与保存C++实现代码
- hill密码的加密、解密以及破译.zip
- C++生存游戏
- 职工工作量统计系统.rar
- lbm模拟液滴从壁面滑落
- C++学生成绩管理系统 2018
评论
共有 条评论