#include <QCoreApplication>#include "Link.h"#include <stdio.h>int main(int argc, char *argv[]){QCoreApplication a(argc, argv);Link::init();LinkObject *vo=Link::create("OutputVo");QVariantMap dataVo;dataVo["type"]="hdmi";vo->start(dataVo);LinkObject *file=Link::create("InputFile");QVariantMap dataFile;dataFile["path"]="test.mp4";file->start(dataFile);LinkObject *dec=Link::create("DecodeV");dec->start();file->linkV(dec)->linkV(vo);QObject::connect(file,&LinkObject::newEvent,[=](QString type,QVariant){if(type=="EOF"){exit(0);}});//空格键暂停,左键后退,右键前进,A键回到指定时间bool pause=false;while(true){int key=getchar();if(key==32)//space{pause=!pause;file->invoke("pause",pause);}else if(key==68)//left{int cur=file->invoke("getPosition").toInt();qDebug()<<cur;cur-=5000;file->invoke("seek",cur);}else if(key==67)//right{int cur=file->invoke("getPosition").toInt();cur+=5000;file->invoke("seek",cur);}else if(key==97)//a{file->invoke("seek",5500);}}return a.exec();}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。