91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 65KB
    文件類型: .gz
    金幣: 1
    下載: 0 次
    發布日期: 2021-05-16
  • 語言: 其他
  • 標簽: QT??gstreamer??

資源簡介

基于 qt的gstreamer 應用,實現視頻播放,外國人寫的linux系統,需要本機安裝 gstreamer 插件

資源截圖

代碼片段和文件信息

#include?“apetoflac.h“

#define?TIME?200

GstElement?*audiobin;
ApeToFlac?*apetoflac?=?0;

static?gboolean
bus_call?(GstBus?????*bus
??GstMessage?*msg
??gpointer????data)
{
bus?=?NULL;
data?=?NULL;

??switch?(GST_MESSAGE_TYPE?(msg))?{

case?GST_MESSAGE_EOS:
??g_print?(“Конец?потока\n“);
??apetoflac->stopCode();
??break;
case?GST_MESSAGE_STATE_CHANGED:?{
??GstState?oldstate;
??GstState?newstate;
??GstState?pending;
??if?(!strcmp(gst_element_get_name(GST_MESSAGE_SRC(msg))?“atf-transcoder“))
{
gst_message_parse_state_changed(msg?&oldstate?&newstate?&pending);
//g_print?(“%s?changed?state?from?%d?to?%d?pending?%d\n“?GST_ELEMENT_NAME(GST_MESSAGE_SRC(msg))?oldstate?newstate?pending);
if?(newstate?==?GST_STATE_PLAYING)
apetoflac->decoding();
}
??break;
}
case?GST_MESSAGE_ERROR:?{
??gchar??*debug;
??GError?*error;

??gst_message_parse_error?(msg?&error?&debug);
??g_free?(debug);

??g_printerr?(“Ошибка:?%s\n“?error->message);
??g_error_free?(error);

??break;
}
default:
??break;
??}
??return?TRUE;
}

static?void
cb_newpad?(GstElement?*decodebin
???GstPad?????*pad
???gboolean????last
???gpointer????data)
{
??GstCaps?*caps;
??GstStructure?*str;
??GstPad?*audiopad;

??audiopad?=?gst_element_get_static_pad?(audiobin?“sink“);
??if?(GST_PAD_IS_linkED?(audiopad))?{
g_object_unref?(audiopad);
decodebin?=?NULL;
last?=?NULL;
data?=?NULL;
return;
??}

??caps?=?gst_pad_get_caps?(pad);
??str?=?gst_caps_get_structure?(caps?0);
??if?(!g_strrstr?(gst_structure_get_name?(str)?“audio“))?{
gst_caps_unref?(caps);
gst_object_unref?(audiopad);
return;
??}
??gst_caps_unref?(caps);

??gst_pad_link?(pad?audiopad);
}

//?Конструктор
ApeToFlac::ApeToFlac(QWidget?*parent)?:?QDialog(parent)
{
setupUi(this);
apetoflac?=?this;

timer?=?new?QTimer(this);

connect(okButton?SIGNAL(clicked())?this?SLOT(startDecoder()));
connect(timer?SIGNAL(timeout())?this?SLOT(progressUpd()));
}

//?Получение?имен?файлов
void?ApeToFlac::setFileNames(QString?cuefile?QString?apefile)
{
QString?line;
QRegExp?rxFilename(“(.*)\\.(.{3})“);
QRegExp?rxFilename2(“.*/([^/]*)$“);
QRegExp?rxSoundfile(“^FILE?\“(.*)\““);
QFile?inCuefile(cuefile);

atfCuefile?=?cuefile;
atfApefile?=?apefile;

rxFilename.indexIn(atfApefile);
outFile?=?rxFilename.cap(1)?+?“.flac“;

rxFilename.indexIn(atfCuefile);
outCue?=?rxFilename.cap(1);
if?(rxFilename.indexIn(outCue)?!=?-1)
outCue?=?rxFilename.cap(1)?+?“.flac.cue“;
else
outCue?+=?“.flac.cue“;
QFile?outCueFile(outCue);
outCueFile.open(QFile::WriteOnly?|?QFile::Truncate);
inCuefile.open(QFile::ReadOnly);
QTextStream?cueInText(&inCuefile);
QTextStream?cueOutText(&outCueFile);
cueInText.setCodec(“Windows-1251“);
cueOutText.setCodec(“Windows-1251“);
do?{
line?=?cueInText.readLine();
if?(rxSoundfile.indexIn(line)?!=?-1)
{
if?(rxFilename2.indexIn(atfApefile)?!=?-1)
if(rxFilename.indexIn(rxFilename2.cap(1))?!=?-1)
cueOutText?<

評論

共有 條評論