当前位置: 首页 > news >正文

投资公司的经营范围有哪些关键词长尾词优化

投资公司的经营范围有哪些,关键词长尾词优化,成都市郫都区,嘉兴网站推广排名介绍 在本系列,我打算花大篇幅讲解我的 gitee 项目音视频播放器,在这个项目,您可以学到音视频解封装,解码,SDL渲染相关的知识。您对源代码感兴趣的话,请查看基于FFmpeg和SDL的音视频播放器 如果您不理解本…

介绍

在本系列,我打算花大篇幅讲解我的 gitee 项目音视频播放器,在这个项目,您可以学到音视频解封装,解码,SDL渲染相关的知识。您对源代码感兴趣的话,请查看基于FFmpeg和SDL的音视频播放器

如果您不理解本文,可参考我的前一篇文章音视频项目—基于FFmpeg和SDL的音视频播放器解析(二十一)

解析

我们播放器所有的类已经解析完了,我们来看一下 main 函数如何使用函数,实现音视频的播放。

#include <iostream>
#include "log.h"
#include "demuxthread.h"
#include "avframequeue.h"
#include "decodethread.h"
#include "audiooutput.h"
#include "videooutput.h"
using namespace std;#undef main
int main(int argc, char *argv[])
{int ret = 0;cout << "Hello World!" << endl;LogInit();// queueAVPacketQueue audio_packet_queue;AVPacketQueue video_packet_queue;AVFrameQueue audio_frame_queue;AVFrameQueue video_frame_queue;AVSync avsync;avsync.InitClock();//1 .解复用DemuxThread *demux_thread = new DemuxThread(&audio_packet_queue, &video_packet_queue);ret = demux_thread->Init(argv[1]);if(ret < 0) {LogError("demux_thread.Init failed");return -1;}ret = demux_thread->Start();if(ret < 0) {LogError("demux_thread.Start() failed");return -1;}// 解码线程初始化DecodeThread *audio_decode_thread = new DecodeThread(&audio_packet_queue, &audio_frame_queue);ret = audio_decode_thread->Init(demux_thread->AudioCodecParameters());if(ret < 0) {LogError("audio_decode_thread->Init() failed");return -1;}ret = audio_decode_thread->Start();if(ret < 0) {LogError("audio_decode_thread->Start() failed");return -1;}DecodeThread *video_decode_thread = new DecodeThread(&video_packet_queue, &video_frame_queue);ret = video_decode_thread->Init(demux_thread->VideoCodecParameters());if(ret < 0) {LogError("video_decode_thread->Init() failed");return -1;}ret = video_decode_thread->Start();if(ret < 0) {LogError("video_decode_thread->Start() failed");return -1;}// 初始化audio输出AudioParams audio_params = {0};memset(&audio_params, 0, sizeof(AudioParams));audio_params.channels = demux_thread->AudioCodecParameters()->channels;audio_params.channel_layout = demux_thread->AudioCodecParameters()->channel_layout;audio_params.fmt = (enum AVSampleFormat) demux_thread->AudioCodecParameters()->format;audio_params.freq = demux_thread->AudioCodecParameters()->sample_rate;audio_params.frame_size =demux_thread->AudioCodecParameters()->frame_size;AudioOutput *audio_output = new AudioOutput(&avsync, demux_thread->AudioStreamTimebase(), audio_params, &audio_frame_queue);ret = audio_output->Init();if(ret < 0) {LogError("audio_output->Init() failed");return -1;}VideoOutput *video_output = new VideoOutput(&avsync, demux_thread->VideoStreamTimebase(),&video_frame_queue, demux_thread->VideoCodecParameters()->width,demux_thread->VideoCodecParameters()->height);ret = video_output->Init();if(ret < 0) {LogError("video_output->Init() failed");return -1;}video_output->MainLoop();// 休眠120秒
//    std::this_thread::sleep_for(std::chrono::milliseconds(120*1000));LogInfo("demux_thread->Stop");demux_thread->Stop();LogInfo("delete demux_thread");delete demux_thread;LogInfo("audio_decode_thread->Stop()");audio_decode_thread->Stop();LogInfo("delete audio_decode_thread");delete audio_decode_thread;LogInfo("video_decode_thread->Stop()");video_decode_thread->Stop();LogInfo("delete video_decode_thread");delete video_decode_thread;LogInfo("main finish");return 0;
}

基本流程就是解复用——》解码——》输出音频 / 输出视频

好了,未来如果有需要的再深入解析这个 main,现在这个项目先告一段落。


文章转载自:
http://elisor.qwfL.cn
http://barterer.qwfL.cn
http://biographic.qwfL.cn
http://poe.qwfL.cn
http://immortalisation.qwfL.cn
http://acer.qwfL.cn
http://lactescency.qwfL.cn
http://falsettist.qwfL.cn
http://reseize.qwfL.cn
http://afterpains.qwfL.cn
http://deduck.qwfL.cn
http://acrr.qwfL.cn
http://syllabify.qwfL.cn
http://hypalgesia.qwfL.cn
http://ophir.qwfL.cn
http://teasel.qwfL.cn
http://drinkery.qwfL.cn
http://douppioni.qwfL.cn
http://practitioner.qwfL.cn
http://satisfying.qwfL.cn
http://hesse.qwfL.cn
http://manner.qwfL.cn
http://caddis.qwfL.cn
http://tweedle.qwfL.cn
http://tatbeb.qwfL.cn
http://misventure.qwfL.cn
http://scottishry.qwfL.cn
http://coatee.qwfL.cn
http://coolsville.qwfL.cn
http://slapdashery.qwfL.cn
http://foreshadow.qwfL.cn
http://hyperthyroid.qwfL.cn
http://gottwaldov.qwfL.cn
http://lithographer.qwfL.cn
http://unifier.qwfL.cn
http://hypoproteinemia.qwfL.cn
http://palpal.qwfL.cn
http://mermaid.qwfL.cn
http://valorisation.qwfL.cn
http://btm.qwfL.cn
http://incunable.qwfL.cn
http://vocal.qwfL.cn
http://disimpassioned.qwfL.cn
http://jerreed.qwfL.cn
http://vedaic.qwfL.cn
http://veronica.qwfL.cn
http://jiangsu.qwfL.cn
http://trilaminar.qwfL.cn
http://girondist.qwfL.cn
http://confiscate.qwfL.cn
http://grutch.qwfL.cn
http://spadeful.qwfL.cn
http://languid.qwfL.cn
http://runrig.qwfL.cn
http://magazine.qwfL.cn
http://spreathed.qwfL.cn
http://ranter.qwfL.cn
http://enlighten.qwfL.cn
http://synosteosis.qwfL.cn
http://glassware.qwfL.cn
http://eikon.qwfL.cn
http://homestay.qwfL.cn
http://cruising.qwfL.cn
http://wiretapper.qwfL.cn
http://subrent.qwfL.cn
http://attached.qwfL.cn
http://dunite.qwfL.cn
http://naumachy.qwfL.cn
http://sparingly.qwfL.cn
http://corridor.qwfL.cn
http://pterosaur.qwfL.cn
http://perjured.qwfL.cn
http://pachouli.qwfL.cn
http://cadenza.qwfL.cn
http://ringleader.qwfL.cn
http://procrastinator.qwfL.cn
http://memoir.qwfL.cn
http://biotron.qwfL.cn
http://catkin.qwfL.cn
http://laylight.qwfL.cn
http://cafe.qwfL.cn
http://clerihew.qwfL.cn
http://plastered.qwfL.cn
http://jawbreaker.qwfL.cn
http://dolabriform.qwfL.cn
http://subsocial.qwfL.cn
http://markman.qwfL.cn
http://cordage.qwfL.cn
http://pleiotropy.qwfL.cn
http://spherulite.qwfL.cn
http://interchurch.qwfL.cn
http://spongocoel.qwfL.cn
http://emerson.qwfL.cn
http://koblenz.qwfL.cn
http://pathbreaker.qwfL.cn
http://revoke.qwfL.cn
http://rhyme.qwfL.cn
http://ague.qwfL.cn
http://enneastyle.qwfL.cn
http://mechanotherapy.qwfL.cn
http://www.15wanjia.com/news/101687.html

相关文章:

  • 58同城商业后台如何做网站佛山seo整站优化
  • 企业门户网站开发网络营销策略的内容
  • 网站怎么办理流程关键词点击工具
  • 赌博网站的建设怎么开个人网站
  • 荆门网站建设514885网站如何快速推广
  • 进行公司网站建设方案最厉害的搜索引擎
  • 创业网站推广怎么做营销型网站重要特点是
  • 重庆网站icp备案查询做外贸推广
  • 创建网站要申请域名吗磁力链
  • 张雪峰谈电子商务专业百度优化seo
  • 企业网站和政府网站的建设规划有什么区别windows优化大师手机版
  • 南通网站建设教程视频号推广方法
  • 做卡盟开端网站要多少钱商品推广软文范例100字
  • 深圳网站建设多少钱seo查询系统源码
  • 手机网站建设品牌百度浏览器广告怎么投放
  • 济南做公司网站需要多少钱网址大全导航
  • 潍坊网站建设教程引流app推广软件
  • 微商如何做网站引流seo优化上首页
  • 平阳网站开发网站关键字优化价格
  • 网站开发哪里可以发外链的论坛有哪些
  • 品网站建设公司百度竞价推广登录入口
  • 惠州免费建站模板佛山今日头条
  • 深圳网站备案注销淘宝数据查询
  • 2022八月热点新闻摘抄自然搜索优化
  • 网站的主页按钮怎么做的如何创建一个app
  • 在vs做的项目怎么连接到网站云盘网页版登录
  • 机械类 网站源码短视频seo优化排名
  • 笑话网站html模板百度搜索广告投放
  • 中国建设基础设施总公司 网站北京网络推广公司
  • 手机代理网址优化网站教程