-
Notifications
You must be signed in to change notification settings - Fork 812
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
Showing
6 changed files
with
579 additions
and
448 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
############################################################################### | ||
# common | ||
############################################################################### | ||
#ARCH: linux/pi/android/ios/win | ||
LD = link | ||
AR = lib | ||
RM = del | ||
|
||
############################################################################### | ||
# target and object | ||
############################################################################### | ||
LIBNAME = libuvc | ||
TGT_LIB_A = $(LIBNAME).lib | ||
TGT_LIB_SO = $(LIBNAME).dll | ||
TGT_UNIT_TEST = test_$(LIBNAME).exe | ||
|
||
OBJS_LIB = $(LIBNAME).obj dshow.obj | ||
OBJS_UNIT_TEST = test_$(LIBNAME).obj | ||
|
||
############################################################################### | ||
# cflags and ldflags | ||
############################################################################### | ||
CFLAGS = /Iinclude /I../libposix4win/ /I. | ||
CFLAGS = $(CFLAGS) /Od /W3 /Zi | ||
|
||
LDFLAGS = /LIBPATH:../libposix4win/ /LIBPATH:./ | ||
|
||
############################################################################### | ||
# target | ||
############################################################################### | ||
TGT = $(TGT_LIB_A) $(TGT_LIB_SO) $(TGT_UNIT_TEST) | ||
|
||
OBJS = $(OBJS_LIB) $(OBJS_UNIT_TEST) | ||
|
||
all: $(TGT) | ||
|
||
$(TGT_LIB_A): $(OBJS_LIB) | ||
$(AR) $(OBJS_LIB) $(LIBS) /o:$(TGT_LIB_A) | ||
|
||
$(TGT_LIB_SO): $(OBJS_LIB) | ||
$(LD) $(LDFLAGS) /Dll $(OBJS_LIB) $(LIBS) /o:$(TGT_LIB_SO) | ||
|
||
$(TGT_UNIT_TEST): $(OBJS_UNIT_TEST) | ||
$(CC) $(TGT_LIB_A) $(OBJS_UNIT_TEST) /o $(TGT_UNIT_TEST) /link $(LDFLAGS) | ||
|
||
clean: | ||
$(RM) $(OBJS) | ||
$(RM) $(TGT) | ||
$(RM) $(TGT_LIB_SO)* |
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,30 @@ | ||
|
||
#include "libuvc.h" | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
#include "libposix4win.h" | ||
|
||
struct dshow_ctx { | ||
int fd; | ||
|
||
}; | ||
|
||
static struct dshow_ctx *dshow_open(struct uvc_ctx *uvc, const char *dev, int width, int height) | ||
{ | ||
struct dshow_ctx *dc = calloc(1, sizeof(struct dshow_ctx)); | ||
if (!dc) { | ||
printf("malloc dshow_ctx failed!\n"); | ||
return NULL; | ||
} | ||
|
||
return dc; | ||
} | ||
|
||
struct uvc_ops dshow_ops = { | ||
dshow_open, | ||
NULL, | ||
NULL, | ||
NULL, | ||
NULL, | ||
NULL, | ||
}; |
Oops, something went wrong.