void MotionPlayerClient::tryPlayDelayedMotion() { if(m_has_delayed_motion == false) return; if(requestUpdate(m_delayed_motion, TYPE_MOTION) == false) return; requestPlay(m_delayed_motion, TYPE_MOTION); m_has_delayed_motion = false; }
QVVideo::QVVideo(QDomElement xml_desc, QString container, QWidget *parent = 0) : QVElement(xml_desc,container,parent) { if (xml_desc.firstChildElement("url").isNull()) { player = 0; return; } player = new QVVideoPlayer(this,xml_desc.firstChildElement("url").text()); QThread *thread = new QThread(); player->moveToThread(thread); QObject::connect(this,SIGNAL(requestPlay()),player,SLOT(play())); QObject::connect(this,SIGNAL(requestStop()),player,SLOT(stop())); thread->start(); }
GstPlayer::GstPlayer(QObject *parent): IMediaPlayer(parent), playing(false), loaded(false), error(false), playingRequested(false), mustSeek(true), duration(-1), position(0), formatTime(GST_FORMAT_TIME), pipeline(0), gstObjectName("player") { GstPlayer::ensureInitGst(); connect(this,SIGNAL(requestPause()),this,SLOT(doPause())); connect(this,SIGNAL(requestPlay()),this,SLOT(doPlay())); connect(this,SIGNAL(requestStop()),this,SLOT(doStop())); //watcher = NULL; theVol = new GValue(); g_value_init(theVol,G_TYPE_DOUBLE); positionQueryTimer = new QTimer(this); }
void MotionPlayerClient::playFrame(KeyframePtr frame, std::vector<std::string> joint_list, float duration_factor) { // Construct temp motion motionfile::Motion tempMotion; tempMotion.motionName = "FramePlay"; tempMotion.jointList = joint_list; tempMotion.playState = "init"; tempMotion.preState = "init"; tempMotion.postState = "init"; // Caclulate duration with factor double duration = frame->duration * duration_factor; if(duration < 1) duration = 1; // Minimum possible duration frame->duration = duration; tempMotion.frames.push_back(frame); tempMotion.frames.push_back(frame); // Update & play frame requestUpdate(tempMotion, TYPE_FRAME); requestPlay(tempMotion, TYPE_FRAME); }
void QVVideo::showEvent(QShowEvent*) { qDebug() << "video shown"; emit requestPlay(); }