Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
blender-vr-interactive
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
blender
blender-vr-interactive
Commits
ab3223a8
Commit
ab3223a8
authored
5 years ago
by
Martin Pulec
Browse files
Options
Downloads
Patches
Plain Diff
UltraGrid plugin: added a test driver
parent
4564986a
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
client/ultragrid/test.cpp
+37
-0
37 additions, 0 deletions
client/ultragrid/test.cpp
with
37 additions
and
0 deletions
client/ultragrid/test.cpp
0 → 100644
+
37
−
0
View file @
ab3223a8
#ifdef _WIN32
#include
<windows.h>
#include
<io.h>
#include
<signal.h>
#define usleep(us) Sleep(us / 1000)
#else
#include
<unistd.h>
#endif
#include
<cstdio>
#include
<vector>
#include
"ultragrid.h"
#define WIDTH 5120
#define HEIGHT 1440
#define FPS 30
using
std
::
vector
;
bool
should_exit
=
false
;
static
void
signal_handler
(
int
signal
)
{
char
msg
[]
=
"Signal caught... Exiting
\n
"
;
write
(
2
,
msg
,
sizeof
msg
-
1
);
should_exit
=
true
;
}
int
main
()
{
vector
<
unsigned
char
>
buffer
(
WIDTH
*
HEIGHT
/
2
*
3
,
0xff
);
signal
(
SIGINT
,
signal_handler
);
signal
(
SIGTERM
,
signal_handler
);
while
(
!
should_exit
)
{
cesnet_set_render_buffer_yuv_i420
(
buffer
.
data
(),
buffer
.
data
()
+
WIDTH
*
HEIGHT
,
buffer
.
data
()
+
WIDTH
*
HEIGHT
/
4
,
WIDTH
,
HEIGHT
);
usleep
(
1000L
*
1000
/
FPS
);
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment