-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
efe47ac
commit 0e9c813
Showing
4 changed files
with
57 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
|
||
AUTOMAKE_OPTIONS = foreign | ||
|
||
CFLAGS += -Wall -DVERSION=\"$(VERSION)\" -DPROG="\"$(PACKAGE)\"" -D_FILE_OFFSET_BITS=64 -O3 \ | ||
-I$(top_srcdir)/src \ | ||
-L$(top_builddir)/src/.libs -lpthread -lklbars | ||
|
||
if DEBUG | ||
CFLAGS += -g | ||
endif | ||
|
||
CXXFLAGS = $(CFLAGS) | ||
|
||
SRC = klbars-test.c | ||
|
||
bin_PROGRAMS = klbars_test | ||
|
||
klbars_test_SOURCES = $(SRC) | ||
|
||
libklbars_noinst_includedir = $(includedir) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
#include <string.h> | ||
#include <fcntl.h> | ||
#include <unistd.h> | ||
#include <libklbars/klbars.h> | ||
|
||
int main() | ||
{ | ||
struct kl_colorbar_context osd_ctx; | ||
int width=640, height=480; | ||
unsigned char *buf; | ||
|
||
/* Use the custom V210 stride required by the Decklink stack */ | ||
int rowWidth = ((width + 47) / 48) * 128; | ||
fprintf(stderr, "row stride is %d\n", rowWidth); | ||
|
||
buf = malloc(rowWidth * height); | ||
memset(buf, 0, rowWidth * height); | ||
kl_colorbar_init(&osd_ctx, width, height, KL_COLORBAR_10BIT); | ||
kl_colorbar_fill_colorbars(&osd_ctx); | ||
kl_colorbar_finalize(&osd_ctx, buf, rowWidth); | ||
|
||
for (int i = 0; i < 32; i++) { | ||
printf("%02x ", buf[i]); | ||
} | ||
printf("\n"); | ||
|
||
int fd = open("foo.yuv", O_WRONLY | O_TRUNC | O_CREAT, 0644); | ||
write(fd, buf, rowWidth * height); | ||
close(fd); | ||
|
||
kl_colorbar_free(&osd_ctx); | ||
return 0; | ||
} |