+bool DocClipBase::hasVideoCodec(const QString &codec) const
+{
+ Mlt::Producer *prod = NULL;
+ if (m_baseTrackProducers.count() == 0) return false;
+ for (int i = 0; i < m_baseTrackProducers.count(); i++) {
+ if (m_baseTrackProducers.at(i) != NULL) {
+ prod = m_baseTrackProducers.at(i);
+ break;
+ }
+ }
+
+ if (!prod) return false;
+ int default_video = prod->get_int("video_index");
+ char property[200];
+ snprintf(property, sizeof(property), "meta.media.%d.codec.name", default_video);
+ return prod->get(property) == codec;
+}
+
+bool DocClipBase::hasAudioCodec(const QString &codec) const
+{
+ Mlt::Producer *prod = NULL;
+ if (m_baseTrackProducers.count() == 0) return false;
+ for (int i = 0; i < m_baseTrackProducers.count(); i++) {
+ if (m_baseTrackProducers.at(i) != NULL) {
+ prod = m_baseTrackProducers.at(i);
+ break;
+ }
+ }
+ if (!prod) return false;
+ int default_video = prod->get_int("audio_index");
+ char property[200];
+ snprintf(property, sizeof(property), "meta.media.%d.codec.name", default_video);
+ return prod->get(property) == codec;
+}
+
+
+void DocClipBase::slotExtractImage(QList <int> frames)
+{
+ if (m_thumbProd == NULL) return;
+ m_thumbProd->extractImage(frames);
+}
+
+QImage DocClipBase::extractImage(int frame, int width, int height)
+{
+ if (m_thumbProd == NULL) return QImage();
+ QMutexLocker locker(&m_producerMutex);
+ return m_thumbProd->extractImage(frame, width, height);
+}
+
+