Skip to content

Commit 6b48793

Browse files
authored
Merge branch 'mltframework:master' into work/qtblend-size
2 parents 6bef760 + 3608bca commit 6b48793

File tree

17 files changed

+135
-64
lines changed

17 files changed

+135
-64
lines changed

src/framework/mlt_multitrack.c

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* \brief multitrack service class
44
* \see mlt_multitrack_s
55
*
6-
* Copyright (C) 2003-2020 Meltytech, LLC
6+
* Copyright (C) 2003-2025 Meltytech, LLC
77
*
88
* This library is free software; you can redistribute it and/or
99
* modify it under the terms of the GNU Lesser General Public
@@ -583,11 +583,15 @@ static int producer_get_frame(mlt_producer parent, mlt_frame_ptr frame, int inde
583583
// Get the speed
584584
double speed = mlt_properties_get_double(producer_properties, "_speed");
585585

586-
// Make sure we're at the same point
587-
mlt_producer_seek(producer, position);
586+
if (hide == 3) {
587+
*frame = mlt_frame_init(MLT_PRODUCER_SERVICE(producer));
588+
} else {
589+
// Make sure we're at the same point
590+
mlt_producer_seek(producer, position);
588591

589-
// Get the frame from the producer
590-
mlt_service_get_frame(MLT_PRODUCER_SERVICE(producer), frame, 0);
592+
// Get the frame from the producer
593+
mlt_service_get_frame(MLT_PRODUCER_SERVICE(producer), frame, 0);
594+
}
591595

592596
// Indicate speed of this producer
593597
mlt_properties properties = MLT_FRAME_PROPERTIES(*frame);

src/tests/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
set(CMAKE_AUTOMOC ON)
22

3-
foreach(QT_TEST_NAME animation audio events filter frame image playlist producer properties repository service tractor xml)
3+
foreach(QT_TEST_NAME animation audio events filter frame image multitrack playlist producer properties repository service tractor xml)
44
add_executable(test_${QT_TEST_NAME} test_${QT_TEST_NAME}/test_${QT_TEST_NAME}.cpp)
55
target_compile_options(test_${QT_TEST_NAME} PRIVATE ${MLT_COMPILE_OPTIONS})
66
target_link_libraries(test_${QT_TEST_NAME} PRIVATE Qt${QT_MAJOR_VERSION}::Core Qt${QT_MAJOR_VERSION}::Test mlt++)

src/tests/test_animation/test_animation.pro

Lines changed: 0 additions & 3 deletions
This file was deleted.

src/tests/test_audio/test_audio.pro

Lines changed: 0 additions & 3 deletions
This file was deleted.

src/tests/test_events/test_events.pro

Lines changed: 0 additions & 3 deletions
This file was deleted.

src/tests/test_filter/test_filter.pro

Lines changed: 0 additions & 4 deletions
This file was deleted.

src/tests/test_frame/test_frame.pro

Lines changed: 0 additions & 4 deletions
This file was deleted.

src/tests/test_image/test_image.pro

Lines changed: 0 additions & 3 deletions
This file was deleted.
Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
/*
2+
* Copyright (C) 2025 Meltytech, LLC
3+
*
4+
* This library is free software; you can redistribute it and/or
5+
* modify it under the terms of the GNU Lesser General Public
6+
* License as published by the Free Software Foundation; either
7+
* version 2.1 of the License, or (at your option) any later version.
8+
*
9+
* This library is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12+
* Lesser General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU Lesser General Public
15+
* License along with consumer library; if not, write to the Free Software
16+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17+
*/
18+
19+
#include <mlt++/Mlt.h>
20+
#include <QtTest>
21+
using namespace Mlt;
22+
23+
class TestMultitrack : public QObject
24+
{
25+
Q_OBJECT
26+
27+
Profile profile;
28+
29+
public:
30+
TestMultitrack()
31+
: profile("dv_pal")
32+
{
33+
Factory::init();
34+
}
35+
36+
private Q_SLOTS:
37+
38+
void TestConstructor()
39+
{
40+
mlt_multitrack multitrack = mlt_multitrack_init();
41+
QVERIFY(multitrack != nullptr);
42+
43+
Multitrack multiTrack(multitrack);
44+
QVERIFY(multiTrack.get_multitrack() == multitrack);
45+
46+
mlt_multitrack_close(multitrack);
47+
}
48+
49+
void ConnectAndDisconnect()
50+
{
51+
mlt_multitrack multitrack = mlt_multitrack_init();
52+
Producer producer(profile, "color");
53+
54+
Multitrack multiTrack(multitrack);
55+
QVERIFY(multiTrack.connect(producer, 0) == 0);
56+
QCOMPARE(multiTrack.count(), 1);
57+
58+
QVERIFY(multiTrack.disconnect(0) == 0);
59+
QCOMPARE(multiTrack.count(), 0);
60+
61+
mlt_multitrack_close(multitrack);
62+
}
63+
64+
void InsertAndClip()
65+
{
66+
mlt_multitrack multitrack = mlt_multitrack_init();
67+
Producer producer(profile, "color");
68+
69+
Multitrack multiTrack(multitrack);
70+
QVERIFY(multiTrack.insert(producer, 0) == 0);
71+
QCOMPARE(multiTrack.count(), 1);
72+
73+
QVERIFY(multiTrack.clip(::mlt_whence_relative_start, 0) == 0);
74+
75+
mlt_multitrack_close(multitrack);
76+
}
77+
78+
void GetTrack()
79+
{
80+
mlt_multitrack multitrack = mlt_multitrack_init();
81+
Producer producer(profile, "color");
82+
83+
Multitrack multiTrack(multitrack);
84+
QVERIFY(multiTrack.insert(producer, 0) == 0);
85+
86+
Producer *track = multiTrack.track(0);
87+
QVERIFY(track != nullptr);
88+
QCOMPARE(track->get_producer(), producer.get_producer());
89+
delete track;
90+
91+
mlt_multitrack_close(multitrack);
92+
}
93+
94+
void GetFrame()
95+
{
96+
mlt_multitrack multitrack = mlt_multitrack_init();
97+
Producer producer(profile, "color");
98+
99+
Multitrack multiTrack(multitrack);
100+
QVERIFY(multiTrack.connect(producer, 0) == 0);
101+
102+
auto position = 3;
103+
multiTrack.seek(position);
104+
auto frame = multiTrack.get_frame();
105+
QVERIFY(frame != nullptr);
106+
QCOMPARE(frame->get_position(), position);
107+
// The color producer created the frame
108+
QCOMPARE(frame->get_int("progressive"), 1);
109+
delete frame;
110+
111+
// Test hiding and muting the producer
112+
producer.set("hide", 3);
113+
frame = multiTrack.get_frame();
114+
QVERIFY(frame != nullptr);
115+
// Returns a dummy frame
116+
QCOMPARE(frame->get_int("progressive"), 0);
117+
delete frame;
118+
119+
mlt_multitrack_close(multitrack);
120+
}
121+
};
122+
123+
QTEST_APPLESS_MAIN(TestMultitrack)
124+
125+
#include "test_multitrack.moc"

src/tests/test_playlist/test_playlist.pro

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)