comparison transform/RealTimeEffectModelTransformer.cpp @ 689:573d45e9487b

Merge from debug-output branch
author Chris Cannam
date Tue, 14 Jun 2011 14:47:59 +0100
parents f84f147572b9 06f13a3b9e9e
children 1424aa29ae95
comparison
equal deleted inserted replaced
688:be43b2fe68e8 689:573d45e9487b
41 41
42 QString pluginId = transform.getPluginIdentifier(); 42 QString pluginId = transform.getPluginIdentifier();
43 43
44 if (!m_transform.getBlockSize()) m_transform.setBlockSize(1024); 44 if (!m_transform.getBlockSize()) m_transform.setBlockSize(1024);
45 45
46 // std::cerr << "RealTimeEffectModelTransformer::RealTimeEffectModelTransformer: plugin " << pluginId.toStdString() << ", output " << output << std::endl; 46 // DEBUG << "RealTimeEffectModelTransformer::RealTimeEffectModelTransformer: plugin " << pluginId << ", output " << output << endl;
47 47
48 RealTimePluginFactory *factory = 48 RealTimePluginFactory *factory =
49 RealTimePluginFactory::instanceFor(pluginId); 49 RealTimePluginFactory::instanceFor(pluginId);
50 50
51 if (!factory) { 51 if (!factory) {
52 std::cerr << "RealTimeEffectModelTransformer: No factory available for plugin id \"" 52 std::cerr << "RealTimeEffectModelTransformer: No factory available for plugin id \""
53 << pluginId.toStdString() << "\"" << std::endl; 53 << pluginId << "\"" << std::endl;
54 return; 54 return;
55 } 55 }
56 56
57 DenseTimeValueModel *input = getConformingInput(); 57 DenseTimeValueModel *input = getConformingInput();
58 if (!input) return; 58 if (!input) return;
62 m_transform.getBlockSize(), 62 m_transform.getBlockSize(),
63 input->getChannelCount()); 63 input->getChannelCount());
64 64
65 if (!m_plugin) { 65 if (!m_plugin) {
66 std::cerr << "RealTimeEffectModelTransformer: Failed to instantiate plugin \"" 66 std::cerr << "RealTimeEffectModelTransformer: Failed to instantiate plugin \""
67 << pluginId.toStdString() << "\"" << std::endl; 67 << pluginId << "\"" << std::endl;
68 return; 68 return;
69 } 69 }
70 70
71 TransformFactory::getInstance()->setPluginParameters(m_transform, m_plugin); 71 TransformFactory::getInstance()->setPluginParameters(m_transform, m_plugin);
72 72
108 RealTimeEffectModelTransformer::getConformingInput() 108 RealTimeEffectModelTransformer::getConformingInput()
109 { 109 {
110 DenseTimeValueModel *dtvm = 110 DenseTimeValueModel *dtvm =
111 dynamic_cast<DenseTimeValueModel *>(getInputModel()); 111 dynamic_cast<DenseTimeValueModel *>(getInputModel());
112 if (!dtvm) { 112 if (!dtvm) {
113 std::cerr << "RealTimeEffectModelTransformer::getConformingInput: WARNING: Input model is not conformable to DenseTimeValueModel" << std::endl; 113 DEBUG << "RealTimeEffectModelTransformer::getConformingInput: WARNING: Input model is not conformable to DenseTimeValueModel" << endl;
114 } 114 }
115 return dtvm; 115 return dtvm;
116 } 116 }
117 117
118 void 118 void
120 { 120 {
121 DenseTimeValueModel *input = getConformingInput(); 121 DenseTimeValueModel *input = getConformingInput();
122 if (!input) return; 122 if (!input) return;
123 123
124 while (!input->isReady() && !m_abandoned) { 124 while (!input->isReady() && !m_abandoned) {
125 std::cerr << "RealTimeEffectModelTransformer::run: Waiting for input model to be ready..." << std::endl; 125 DEBUG << "RealTimeEffectModelTransformer::run: Waiting for input model to be ready..." << endl;
126 usleep(500000); 126 usleep(500000);
127 } 127 }
128 if (m_abandoned) return; 128 if (m_abandoned) return;
129 129
130 SparseTimeValueModel *stvm = dynamic_cast<SparseTimeValueModel *>(m_output); 130 SparseTimeValueModel *stvm = dynamic_cast<SparseTimeValueModel *>(m_output);