void InbandTextTrack::addWebVTTCue(double start, double end, const WebString& id, const WebString& content, const WebString& settings) { HTMLMediaElement* owner = mediaElement(); ASSERT(owner); RefPtrWillBeRawPtr<VTTCue> cue = VTTCue::create(owner->document(), start, end, content); cue->setId(id); cue->parseSettings(settings); addCue(cue); }
void InbandTextTrack::addWebVTTCue(InbandTextTrackPrivate* trackPrivate, double start, double end, const String& id, const String& content, const String& settings) { UNUSED_PARAM(trackPrivate); ASSERT(trackPrivate == m_private); RefPtr<TextTrackCue> cue = TextTrackCue::create(scriptExecutionContext(), start, end, content); cue->setId(id); cue->setCueSettings(settings); if (hasCue(cue.get())) return; addCue(cue); }
void InbandWebVTTTextTrack::newCuesParsed() { Vector<RefPtr<WebVTTCueData>> cues; parser().getNewCues(cues); for (auto& cueData : cues) { RefPtr<VTTCue> vttCue = VTTCue::create(*scriptExecutionContext(), *cueData); if (hasCue(vttCue.get(), TextTrackCue::IgnoreDuration)) { LOG(Media, "InbandWebVTTTextTrack::newCuesParsed ignoring already added cue: start=%.2f, end=%.2f, content=\"%s\"\n", vttCue->startTime(), vttCue->endTime(), vttCue->text().utf8().data()); return; } addCue(vttCue.release(), ASSERT_NO_EXCEPTION); } }
void InbandWebVTTTextTrack::newCuesParsed() { Vector<RefPtr<WebVTTCueData>> cues; m_webVTTParser->getNewCues(cues); for (size_t i = 0; i < cues.size(); ++i) { RefPtr<WebVTTCueData> cueData = cues[i]; RefPtr<TextTrackCue> cue = TextTrackCue::create(scriptExecutionContext(), cueData->startTime(), cueData->endTime(), cueData->content()); cue->setId(cueData->id()); cue->setCueSettings(cueData->settings()); if (hasCue(cue.get(), TextTrackCue::IgnoreDuration)) { LOG(Media, "InbandWebVTTTextTrack::newCuesParsed ignoring already added cue: start=%.2f, end=%.2f, content=\"%s\"\n", cueData->startTime(), cueData->endTime(), cueData->content().utf8().data()); return; } addCue(cue.release()); } }
void InbandDataTextTrack::addDataCue(InbandTextTrackPrivate*, const MediaTime& start, const MediaTime& end, PassRefPtr<SerializedPlatformRepresentation> prpPlatformValue, const String& type) { RefPtr<SerializedPlatformRepresentation> platformValue = prpPlatformValue; if (m_incompleteCueMap.find(platformValue.get()) != m_incompleteCueMap.end()) return; auto cue = DataCue::create(*scriptExecutionContext(), start, end, platformValue.copyRef(), type); if (hasCue(cue.ptr(), TextTrackCue::IgnoreDuration)) { LOG(Media, "InbandDataTextTrack::addDataCue ignoring already added cue: start=%s, end=%s\n", toString(cue->startTime()).utf8().data(), toString(cue->endTime()).utf8().data()); return; } if (end.isPositiveInfinite() && mediaElement()) { cue->setEndTime(mediaElement()->durationMediaTime()); m_incompleteCueMap.add(WTFMove(platformValue), cue.copyRef()); } addCue(WTFMove(cue), ASSERT_NO_EXCEPTION); }
void InbandGenericTextTrack::addGenericCue(InbandTextTrackPrivate* trackPrivate, PassRefPtr<GenericCueData> prpCueData) { ASSERT_UNUSED(trackPrivate, trackPrivate == m_private); RefPtr<GenericCueData> cueData = prpCueData; if (m_cueMap.find(cueData.get())) return; RefPtr<TextTrackCueGeneric> cue = TextTrackCueGeneric::create(scriptExecutionContext(), cueData->startTime(), cueData->endTime(), cueData->content()); updateCueFromCueData(cue.get(), cueData.get()); if (hasCue(cue.get(), TextTrackCue::IgnoreDuration)) { LOG(Media, "InbandGenericTextTrack::addGenericCue ignoring already added cue: start=%.2f, end=%.2f, content=\"%s\"\n", cueData->startTime(), cueData->endTime(), cueData->content().utf8().data()); return; } if (cueData->status() != GenericCueData::Complete) m_cueMap.add(cueData.get(), cue.get()); addCue(cue); }
void InbandTextTrack::addGenericCue(InbandTextTrackPrivate* trackPrivate, GenericCueData* cueData) { UNUSED_PARAM(trackPrivate); ASSERT(trackPrivate == m_private); RefPtr<TextTrackCueGeneric> cue = TextTrackCueGeneric::create(scriptExecutionContext(), cueData->startTime(), cueData->endTime(), cueData->content()); cue->setId(cueData->id()); cue->setBaseFontSizeRelativeToVideoHeight(cueData->baseFontSize()); cue->setFontSizeMultiplier(cueData->relativeFontSize()); cue->setFontName(cueData->fontName()); if (cueData->position() > 0) cue->setPosition(lround(cueData->position()), IGNORE_EXCEPTION); if (cueData->line() > 0) cue->setLine(lround(cueData->line()), IGNORE_EXCEPTION); if (cueData->size() > 0) cue->setSize(lround(cueData->size()), IGNORE_EXCEPTION); if (cueData->backgroundColor().isValid()) cue->setBackgroundColor(cueData->backgroundColor().rgb()); if (cueData->foregroundColor().isValid()) cue->setForegroundColor(cueData->foregroundColor().rgb()); if (cueData->align() == GenericCueData::Start) cue->setAlign(ASCIILiteral("start"), IGNORE_EXCEPTION); else if (cueData->align() == GenericCueData::Middle) cue->setAlign(ASCIILiteral("middle"), IGNORE_EXCEPTION); else if (cueData->align() == GenericCueData::End) cue->setAlign(ASCIILiteral("end"), IGNORE_EXCEPTION); cue->setSnapToLines(false); if (hasCue(cue.get())) { LOG(Media, "InbandTextTrack::addGenericCue ignoring already added cue: start=%.2f, end=%.2f, content=\"%s\"\n", cueData->startTime(), cueData->endTime(), cueData->content().utf8().data()); return; } addCue(cue); }
void ScannerManagerComponent::setNewPosition (const int pos, bool createNewCue, bool silent, bool withoutStart) { if (createNewCue) { addCue (pos); } else { scanner.setPosition (pos, withoutStart); scanner.setTopLeftPosition (scanner.getPosition() - startPos, 0); if (! silent) { findNextCue (); sendChangeMessage(); } else { checkCues (); } } repaint(); }
bool Detector::qt_invoke( int _id, QUObject* _o ) { switch ( _id - staticMetaObject()->slotOffset() ) { case 0: clearDetector(); break; case 1: loadDetector(); break; case 2: loadDetector((string)(*((string*)static_QUType_ptr.get(_o+1)))); break; case 3: loadDetector((string)(*((string*)static_QUType_ptr.get(_o+1))),(bool)static_QUType_bool.get(_o+2)); break; case 4: saveDetector(); break; case 5: saveDetector((string)(*((string*)static_QUType_ptr.get(_o+1)))); break; case 6: saveDetector((string)(*((string*)static_QUType_ptr.get(_o+1))),(bool)static_QUType_bool.get(_o+2)); break; case 7: addCue(); break; case 8: addCue((string)(*((string*)static_QUType_ptr.get(_o+1))),(string)(*((string*)static_QUType_ptr.get(_o+2)))); break; case 9: addCue((string)(*((string*)static_QUType_ptr.get(_o+1))),(string)(*((string*)static_QUType_ptr.get(_o+2))),(bool)static_QUType_bool.get(_o+3)); break; case 10: loadCodebook((unsigned)(*((unsigned*)static_QUType_ptr.get(_o+1)))); break; case 11: loadCodebook((unsigned)(*((unsigned*)static_QUType_ptr.get(_o+1))),(bool)static_QUType_bool.get(_o+2)); break; case 12: loadCodebook((unsigned)(*((unsigned*)static_QUType_ptr.get(_o+1))),(string)(*((string*)static_QUType_ptr.get(_o+2)))); break; case 13: loadCodebook((unsigned)(*((unsigned*)static_QUType_ptr.get(_o+1))),(string)(*((string*)static_QUType_ptr.get(_o+2))),(bool)static_QUType_bool.get(_o+3)); break; case 14: loadCodebook((unsigned)(*((unsigned*)static_QUType_ptr.get(_o+1))),(string)(*((string*)static_QUType_ptr.get(_o+2))),(bool)static_QUType_bool.get(_o+3),(bool)static_QUType_bool.get(_o+4)); break; case 15: loadOccurrences((unsigned)(*((unsigned*)static_QUType_ptr.get(_o+1)))); break; case 16: loadOccurrences((unsigned)(*((unsigned*)static_QUType_ptr.get(_o+1))),(bool)static_QUType_bool.get(_o+2)); break; case 17: loadOccurrences((unsigned)(*((unsigned*)static_QUType_ptr.get(_o+1))),(string)(*((string*)static_QUType_ptr.get(_o+2)))); break; case 18: loadOccurrences((unsigned)(*((unsigned*)static_QUType_ptr.get(_o+1))),(string)(*((string*)static_QUType_ptr.get(_o+2))),(bool)static_QUType_bool.get(_o+3)); break; case 19: propagateDetectorUpdate(); break; case 20: propagateDetectorUpdate((const QString&)static_QUType_QString.get(_o+1)); break; case 21: propagateCueUpdate(); break; case 22: compareFeatures((vector<vector<FeatureVector> >&)*((vector<vector<FeatureVector> >*)static_QUType_ptr.get(_o+1)),(vector<vector<FeatureVector> >&)*((vector<vector<FeatureVector> >*)static_QUType_ptr.get(_o+2))); break; case 23: compareFeatures((vector<vector<FeatureVector> >&)*((vector<vector<FeatureVector> >*)static_QUType_ptr.get(_o+1)),(vector<vector<FeatureVector> >&)*((vector<vector<FeatureVector> >*)static_QUType_ptr.get(_o+2)),(bool)static_QUType_bool.get(_o+3)); break; case 24: compareFeatures((unsigned)(*((unsigned*)static_QUType_ptr.get(_o+1))),(vector<FeatureVector>&)*((vector<FeatureVector>*)static_QUType_ptr.get(_o+2))); break; case 25: compareFeatures((unsigned)(*((unsigned*)static_QUType_ptr.get(_o+1))),(vector<FeatureVector>&)*((vector<FeatureVector>*)static_QUType_ptr.get(_o+2)),(bool)static_QUType_bool.get(_o+3)); break; case 26: compareFeaturesLeft((unsigned)(*((unsigned*)static_QUType_ptr.get(_o+1))),(vector<FeatureVector>&)*((vector<FeatureVector>*)static_QUType_ptr.get(_o+2))); break; case 27: compareFeaturesLeft((unsigned)(*((unsigned*)static_QUType_ptr.get(_o+1))),(vector<FeatureVector>&)*((vector<FeatureVector>*)static_QUType_ptr.get(_o+2)),(bool)static_QUType_bool.get(_o+3)); break; case 28: processTestImg((int)static_QUType_int.get(_o+1),(int)static_QUType_int.get(_o+2),(int)static_QUType_int.get(_o+3),(vector<Hypothesis>&)*((vector<Hypothesis>*)static_QUType_ptr.get(_o+4)),(vector<Segmentation>&)*((vector<Segmentation>*)static_QUType_ptr.get(_o+5)),(bool)static_QUType_bool.get(_o+6),(bool)static_QUType_bool.get(_o+7)); break; case 29: processTestImg((int)static_QUType_int.get(_o+1),(int)static_QUType_int.get(_o+2),(int)static_QUType_int.get(_o+3),(vector<Hypothesis>&)*((vector<Hypothesis>*)static_QUType_ptr.get(_o+4)),(vector<Segmentation>&)*((vector<Segmentation>*)static_QUType_ptr.get(_o+5)),(bool)static_QUType_bool.get(_o+6),(bool)static_QUType_bool.get(_o+7),(bool)static_QUType_bool.get(_o+8)); break; case 30: processTestImg((int)static_QUType_int.get(_o+1),(int)static_QUType_int.get(_o+2),(int)static_QUType_int.get(_o+3),(vector<Hypothesis>&)*((vector<Hypothesis>*)static_QUType_ptr.get(_o+4)),(vector<Segmentation>&)*((vector<Segmentation>*)static_QUType_ptr.get(_o+5)),(bool)static_QUType_bool.get(_o+6),(bool)static_QUType_bool.get(_o+7),(bool)static_QUType_bool.get(_o+8),(bool)static_QUType_bool.get(_o+9)); break; case 31: getPatchHypotheses(); break; case 32: getPatchHypotheses((bool)static_QUType_bool.get(_o+1)); break; case 33: getPatchHypotheses((bool)static_QUType_bool.get(_o+1),(bool)static_QUType_bool.get(_o+2)); break; case 34: adjustHypoScoresGP((const vector<Hypothesis>&)*((const vector<Hypothesis>*)static_QUType_ptr.get(_o+1))); break; case 35: removeDuplicateHypos((const vector<Hypothesis>&)*((const vector<Hypothesis>*)static_QUType_ptr.get(_o+1))); break; case 36: removeDuplicateHypos((const vector<Hypothesis>&)*((const vector<Hypothesis>*)static_QUType_ptr.get(_o+1)),(bool)static_QUType_bool.get(_o+2)); break; case 37: setHypoBBox((const vector<Hypothesis>&)*((const vector<Hypothesis>*)static_QUType_ptr.get(_o+1)),(int)static_QUType_int.get(_o+2),(int)static_QUType_int.get(_o+3)); break; case 38: flipHypothesis((const Hypothesis&)*((const Hypothesis*)static_QUType_ptr.get(_o+1)),(int)static_QUType_int.get(_o+2)); break; case 39: getHypoSegmentation((Hypothesis)(*((Hypothesis*)static_QUType_ptr.get(_o+1))),(int)static_QUType_int.get(_o+2),(int)static_QUType_int.get(_o+3),(int)static_QUType_int.get(_o+4),(int)static_QUType_int.get(_o+5)); break; case 40: getHypoSegmentationLeft((Hypothesis)(*((Hypothesis*)static_QUType_ptr.get(_o+1))),(int)static_QUType_int.get(_o+2),(int)static_QUType_int.get(_o+3),(int)static_QUType_int.get(_o+4),(int)static_QUType_int.get(_o+5)); break; case 41: splitUpCueVotes((const list<HoughVote>&)*((const list<HoughVote>*)static_QUType_ptr.get(_o+1))); break; case 42: showSupportingPatches((int)static_QUType_int.get(_o+1),(int)static_QUType_int.get(_o+2),(int)static_QUType_int.get(_o+3)); break; case 43: showSupportingPatches((unsigned)(*((unsigned*)static_QUType_ptr.get(_o+1))),(FeatureVector)(*((FeatureVector*)static_QUType_ptr.get(_o+2)))); break; case 44: showSupportingPatches((unsigned)(*((unsigned*)static_QUType_ptr.get(_o+1))),(FeatureVector)(*((FeatureVector*)static_QUType_ptr.get(_o+2))),(bool)static_QUType_bool.get(_o+3)); break; case 45: displayOccScaleFootprint(); break; case 46: saveFVMatlab(); break; case 47: saveFVMatlab((unsigned)(*((unsigned*)static_QUType_ptr.get(_o+1)))); break; case 48: saveClustersMatlab(); break; case 49: saveClustersMatlab((unsigned)(*((unsigned*)static_QUType_ptr.get(_o+1)))); break; case 50: savePatchActivationsMatlab(); break; case 51: savePatchActivationsMatlab((unsigned)(*((unsigned*)static_QUType_ptr.get(_o+1)))); break; case 52: saveClusterImages(); break; case 53: saveClusterImages((unsigned)(*((unsigned*)static_QUType_ptr.get(_o+1)))); break; default: return QObject::qt_invoke( _id, _o ); } return TRUE; }
void InbandDataTextTrack::addDataCue(InbandTextTrackPrivate*, const MediaTime& start, const MediaTime& end, const void* data, unsigned length) { auto cue = DataCue::create(*scriptExecutionContext(), start, end, data, length); addCue(WTFMove(cue), ASSERT_NO_EXCEPTION); }
void ScannerManagerComponent::loadFromDocument (ValueTree data) { for (unsigned i = 0; i < data.getNumChildren(); i++) if (data.getChild(i).hasType("CUE")) addCue (data.getChild(i).getProperty("x")); }
void InbandDataTextTrack::addDataCue(InbandTextTrackPrivate*, const MediaTime& start, const MediaTime& end, const void* data, unsigned length) { addCue(DataCue::create(*scriptExecutionContext(), start, end, data, length)); }