-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvideo_test.cpp
More file actions
49 lines (38 loc) · 1.52 KB
/
Copy pathvideo_test.cpp
File metadata and controls
49 lines (38 loc) · 1.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#include <libvisual/libvisual.h>
#include <iostream>
int main(int argc, char* argv[]) {
std::cout << "Testing libvisual video initialization..." << std::endl;
// Test basic initialization
int result = visual_init(&argc, &argv);
if (result != VISUAL_OK) {
std::cerr << "visual_init failed with code: " << result << std::endl;
return 1;
}
std::cout << "LibVisual initialized successfully!" << std::endl;
// Test video with exact same setup as Visualizer
VisVideo* video = visual_video_new();
if (!video) {
std::cerr << "Failed to create video object" << std::endl;
visual_quit();
return 1;
}
std::cout << "Video object created successfully!" << std::endl;
// Set same properties as in Visualizer
int width = 800, height = 600;
visual_video_set_dimension(video, width, height);
visual_video_set_depth(video, VISUAL_VIDEO_DEPTH_24BIT);
std::cout << "Video properties set, attempting buffer allocation..." << std::endl;
// This is where it crashes
if (visual_video_allocate_buffer(video) != VISUAL_OK) {
std::cerr << "Failed to allocate video buffer" << std::endl;
visual_object_unref(VISUAL_OBJECT(video));
visual_quit();
return 1;
}
std::cout << "Video buffer allocated successfully!" << std::endl;
// Cleanup
visual_object_unref(VISUAL_OBJECT(video));
visual_quit();
std::cout << "Test completed successfully!" << std::endl;
return 0;
}