Commit 5bceffdc authored by Julius Künzel's avatar Julius Künzel Committed by Jean-Baptiste Mardelle
Browse files

mlt7: follow renaming

Related to #991
parent 72d3eef9
......@@ -1001,7 +1001,7 @@ void ProjectItemModel::loadBinPlaylist(Mlt::Tractor *documentTractor, Mlt::Tract
Mlt::Properties retainList(mlt_properties(documentTractor->get_data("xml_retain")));
if (retainList.is_valid()) {
Mlt::Playlist playlist(mlt_playlist(retainList.get_data(BinPlaylist::binPlaylistId.toUtf8().constData())));
if (playlist.is_valid() && playlist.type() == playlist_type) {
if (playlist.is_valid() && playlist.type() == mlt_service_playlist_type) {
if (progressDialog == nullptr && playlist.count() > 0) {
// Display message on splash screen
emit pCore->loadingMessageUpdated(i18n("Loading project clips..."));
......
......@@ -94,7 +94,7 @@ bool MltDeviceCapture::buildConsumer(const QString &profileName)
// OpenGL monitor
m_mltConsumer = new Mlt::Consumer(*m_mltProfile, KdenliveSettings::audiobackend().toUtf8().constData());
m_mltConsumer->set("preview_off", 1);
m_mltConsumer->set("preview_format", mlt_image_rgb24);
m_mltConsumer->set("preview_format", mlt_image_rgb);
m_showFrameEvent = m_mltConsumer->listen("consumer-frame-show", this, mlt_listener(consumer_gl_frame_show));
// m_mltConsumer->set("resize", 1);
// m_mltConsumer->set("terminate_on_pause", 1);
......@@ -155,7 +155,7 @@ void MltDeviceCapture::stop()
if (m_mltProducer) {
Mlt::Service service(m_mltProducer->parent().get_service());
mlt_service_lock(service.get_service());
if (service.type() == tractor_type) {
if (service.type() == mlt_service_tractor_type) {
isPlaylist = true;
Mlt::Tractor tractor(service);
mlt_tractor_close(tractor.get_tractor());
......@@ -196,7 +196,7 @@ void MltDeviceCapture::emitFrameUpdated(Mlt::Frame &frame)
/*
//TEST: is it better to convert the frame in a thread outside of MLT??
if (processingImage) return;
mlt_image_format format = (mlt_image_format) frame.get_int("format"); //mlt_image_rgb24;
mlt_image_format format = (mlt_image_format) frame.get_int("format"); //mlt_image_rgb;
int width = frame.get_int("width");
int height = frame.get_int("height");
unsigned char *buffer = (unsigned char *) frame.get_data("image");
......@@ -205,7 +205,7 @@ void MltDeviceCapture::emitFrameUpdated(Mlt::Frame &frame)
}
*/
mlt_image_format format = mlt_image_rgb24;
mlt_image_format format = mlt_image_rgb;
int width = 0;
int height = 0;
const uchar *image = frame.get_image(format, width, height);
......@@ -217,7 +217,7 @@ void MltDeviceCapture::emitFrameUpdated(Mlt::Frame &frame)
void MltDeviceCapture::showFrame(Mlt::Frame &frame)
{
mlt_image_format format = mlt_image_rgb24;
mlt_image_format format = mlt_image_rgb;
int width = 0;
int height = 0;
const uchar *image = frame.get_image(format, width, height);
......@@ -301,7 +301,7 @@ void MltDeviceCapture::slotCheckDroppedFrames()
void MltDeviceCapture::saveFrame(Mlt::Frame &frame)
{
mlt_image_format format = mlt_image_rgb24;
mlt_image_format format = mlt_image_rgb;
int width = 0;
int height = 0;
const uchar *image = frame.get_image(format, width, height);
......@@ -401,7 +401,7 @@ bool MltDeviceCapture::slotStartCapture(const QString &params, const QString &pa
// OpenGL monitor
previewProps->set("mlt_service", KdenliveSettings::audiobackend().toUtf8().constData());
previewProps->set("preview_off", 1);
previewProps->set("preview_format", mlt_image_rgb24);
previewProps->set("preview_format", mlt_image_rgb);
previewProps->set("terminate_on_pause", 0);
m_showFrameEvent = m_mltConsumer->listen("consumer-frame-show", this, mlt_listener(consumer_gl_frame_show));
// m_mltConsumer->set("resize", 1);
......@@ -469,7 +469,7 @@ void MltDeviceCapture::setOverlay(const QString &path)
}
Mlt::Service service(parentProd.get_service());
if (service.type() != tractor_type) {
if (service.type() != mlt_service_tractor_type) {
qCWarning(KDENLIVE_LOG) << "// TRACTOR PROBLEM";
return;
}
......
......@@ -109,7 +109,7 @@ QImage KThumb::getFrame(Mlt::Frame *frame, int width, int height, int scaledWidt
}
int ow = width;
int oh = height;
mlt_image_format format = mlt_image_rgb24a;
mlt_image_format format = mlt_image_rgba;
const uchar *imagedata = frame->get_image(format, ow, oh);
if (imagedata) {
QImage temp(ow, oh, QImage::Format_ARGB32);
......
......@@ -63,7 +63,7 @@ Mlt::Properties *EffectsRepository::retrieveListFromMlt() const
Mlt::Properties *EffectsRepository::getMetadata(const QString &effectId) const
{
return pCore->getMltRepository()->metadata(filter_type, effectId.toLatin1().data());
return pCore->getMltRepository()->metadata(mlt_service_filter_type, effectId.toLatin1().data());
}
void EffectsRepository::parseCustomAssetFile(const QString &file_name, std::unordered_map<QString, Info> &customAssets) const
......
......@@ -415,7 +415,7 @@ bool GLWidget::acquireSharedFrameTextures()
// C & D
m_contextSharedAccess.lock();
if (m_sharedFrame.is_valid()) {
m_texture[0] = *(reinterpret_cast<const GLuint *>(m_sharedFrame.get_image(mlt_image_glsl_texture)));
m_texture[0] = *(reinterpret_cast<const GLuint *>(m_sharedFrame.get_image(mlt_image_opengl_texture)));
}
}
......
......@@ -88,10 +88,10 @@ bool constructTimelineFromMelt(const std::shared_ptr<TimelineItemModel> &timelin
continue;
}
switch (track->type()) {
case producer_type:
case mlt_service_producer_type:
// TODO check that it is the black track, and otherwise log an error
break;
case tractor_type: {
case mlt_service_tractor_type: {
// that is a double track
int tid;
bool audioTrack = track->get_int("kdenlive:audio_track") == 1;
......@@ -109,7 +109,7 @@ bool constructTimelineFromMelt(const std::shared_ptr<TimelineItemModel> &timelin
timeline->setTrackProperty(tid, QStringLiteral("kdenlive:timeline_active"), track->get("kdenlive:timeline_active"));
break;
}
case playlist_type: {
case mlt_service_playlist_type: {
// that is a single track
int tid;
Mlt::Playlist local_playlist(*track);
......@@ -143,7 +143,7 @@ bool constructTimelineFromMelt(const std::shared_ptr<TimelineItemModel> &timelin
QScopedPointer<Mlt::Service> service(tractor.producer());
QList<Mlt::Transition *> compositions;
while ((service != nullptr) && service->is_valid()) {
if (service->type() == transition_type) {
if (service->type() == mlt_service_transition_type) {
Mlt::Transition t(mlt_transition(service->get_service()));
if (t.get_b_track() >= timeline->tractor()->count()) {
// Composition outside of available track, maybe because of a preview track
......@@ -225,7 +225,7 @@ bool constructTrackFromMelt(const std::shared_ptr<TimelineItemModel> &timeline,
QScopedPointer<Mlt::Service> service(track.field());
QList<Mlt::Transition *> compositions;
while ((service != nullptr) && service->is_valid()) {
if (service->type() == transition_type) {
if (service->type() == mlt_service_transition_type) {
Mlt::Transition t(mlt_transition(service->get_service()));
QString id(t.get("kdenlive_id"));
compositions << new Mlt::Transition(t);
......@@ -238,7 +238,7 @@ bool constructTrackFromMelt(const std::shared_ptr<TimelineItemModel> &timeline,
}
for (int i = 0; i < track.count(); i++) {
std::unique_ptr<Mlt::Producer> sub_track(track.track(i));
if (sub_track->type() != playlist_type) {
if (sub_track->type() != mlt_service_playlist_type) {
qWarning() << "subtrack must be playlist";
return false;
}
......@@ -322,8 +322,8 @@ bool constructTrackFromMelt(const std::shared_ptr<TimelineItemModel> &timeline,
std::shared_ptr<Mlt::Producer> clip(track.get_clip(i));
int position = track.clip_start(i);
switch (clip->type()) {
case unknown_type:
case producer_type: {
case mlt_service_unknown_type:
case mlt_service_producer_type: {
QString binId;
if (clip->parent().get_int("_kdenlive_processed") == 1) {
// This is a bin clip, already processed no need to change id
......@@ -369,7 +369,7 @@ bool constructTrackFromMelt(const std::shared_ptr<TimelineItemModel> &timeline,
}
break;
}
case tractor_type: {
case mlt_service_tractor_type: {
// TODO This is a nested timeline
qWarning() << "nested timelines not yet implemented";
break;
......
......@@ -1030,7 +1030,7 @@ QStringList TimelineFunctions::enableMultitrackView(const std::shared_ptr<Timeli
Mlt::Field *field = timeline->m_tractor->field();
field->lock();
while ((service != nullptr) && service->is_valid()) {
if (service->type() == transition_type) {
if (service->type() == mlt_service_transition_type) {
Mlt::Transition t(mlt_transition(service->get_service()));
service.reset(service->producer());
QString serviceName = t.get("mlt_service");
......
......@@ -646,7 +646,7 @@ void TimelineItemModel::buildTrackCompositing(bool rebuild)
// Make sure all previous track compositing is removed
if (rebuild) {
while (service != nullptr && service->is_valid()) {
if (service->type() == transition_type) {
if (service->type() == mlt_service_transition_type) {
Mlt::Transition t(mlt_transition(service->get_service()));
service.reset(service->producer());
if (t.get_int("internal_added") == 237) {
......
......@@ -4311,7 +4311,7 @@ bool TimelineModel::replantCompositions(int currentCompo, bool updateView)
mlt_service_type mlt_type = mlt_service_identify(nextservice);
QList<Mlt::Transition *> trackCompositions;
while (mlt_type == transition_type) {
while (mlt_type == mlt_service_transition_type) {
Mlt::Transition transition(reinterpret_cast<mlt_transition>(nextservice));
nextservice = mlt_service_producer(nextservice);
int internal = transition.get_int("internal_added");
......@@ -4507,7 +4507,7 @@ bool TimelineModel::checkConsistency()
mlt_service nextservice = mlt_service_get_producer(field->get_service());
mlt_service_type mlt_type = mlt_service_identify(nextservice);
while (nextservice != nullptr) {
if (mlt_type == transition_type) {
if (mlt_type == mlt_service_transition_type) {
auto tr = mlt_transition(nextservice);
if (mlt_properties_get_int( MLT_TRANSITION_PROPERTIES(tr), "internal_added") > 0) {
// Skip track compositing
......@@ -4828,7 +4828,7 @@ void TimelineModel::updateProfile(Mlt::Profile *profile)
for (int i = 0; i < m_tractor->count(); i++) {
std::shared_ptr<Mlt::Producer> tk(m_tractor->track(i));
tk->set_profile(*m_profile);
if (tk->type() == tractor_type) {
if (tk->type() == mlt_service_tractor_type) {
Mlt::Tractor sub(*tk.get());
for (int j = 0; j < sub.count(); j++) {
std::shared_ptr<Mlt::Producer> subtk(sub.track(j));
......
......@@ -1046,7 +1046,7 @@ bool TrackModel::checkConsistency()
int mixCount = 0;
qDebug()<<"=== STARTING MIX CHECK ======";
while (service != nullptr && service->is_valid()) {
if (service->type() == transition_type) {
if (service->type() == mlt_service_transition_type) {
Mlt::Transition t(mlt_transition(service->get_service()));
service.reset(service->producer());
// Check that the mix has correct in/out
......
......@@ -2210,7 +2210,7 @@ void TimelineController::switchCompositing(int mode)
QScopedPointer<Mlt::Field>field(m_model->m_tractor->field());
field->lock();
while ((service != nullptr) && service->is_valid()) {
if (service->type() == transition_type) {
if (service->type() == mlt_service_transition_type) {
Mlt::Transition t(mlt_transition(service->get_service()));
service.reset(service->producer());
QString serviceName = t.get("mlt_service");
......
......@@ -60,7 +60,7 @@ Mlt::Properties *TransitionsRepository::retrieveListFromMlt() const
Mlt::Properties *TransitionsRepository::getMetadata(const QString &assetId) const
{
return pCore->getMltRepository()->metadata(transition_type, assetId.toLatin1().data());
return pCore->getMltRepository()->metadata(mlt_service_transition_type, assetId.toLatin1().data());
}
void TransitionsRepository::parseCustomAssetFile(const QString &file_name, std::unordered_map<QString, Info> &customAssets) const
......
......@@ -109,7 +109,7 @@ QImage MltPreview::getFrame(std::shared_ptr<Mlt::Producer> producer, int framepo
return mltImage;
}
mlt_image_format format = mlt_image_rgb24a;
mlt_image_format format = mlt_image_rgba;
const uchar *imagedata = frame->get_image(format, width, height);
if (imagedata != nullptr) {
memcpy(mltImage.bits(), imagedata, size_t(width * height * 4));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment