GK SDK 源码库: XMIPCLinuxV100R005C00SPC030 (kernel/tools/open_source excluded)
This commit is contained in:
Executable
+35
@@ -0,0 +1,35 @@
|
||||
ifeq ($(CFG_XMEDIA_EXPORT_FLAG),)
|
||||
SDK_DIR := $(shell cd $(CURDIR)/../../../ && /bin/pwd)
|
||||
endif
|
||||
|
||||
include $(SDK_DIR)/build/base.mk
|
||||
include $(SDK_DIR)/sample/quickstart/quickstart_base.mk
|
||||
|
||||
INCLUDES := -I$(SDK_DIR)/sample/quickstart/media_comm
|
||||
INCLUDES += -I$(SDK_DIR)/sample/quickstart
|
||||
INCLUDES += $(SAMPLE_INCLUDES)
|
||||
|
||||
LIBS := $(SAMPLE_LIBS)
|
||||
|
||||
TARGET:= quickstart_rootfs
|
||||
|
||||
CFLAGS := $(SAMPLE_CFLAGS) $(LIBS) $(INCLUDES)
|
||||
|
||||
SRCS := $(wildcard ./quickstart_rootfs.c)
|
||||
SRCS += $(wildcard ./../quickstart_comm.c)
|
||||
SRCS += $(wildcard ./../media_comm/media_comm.c)
|
||||
|
||||
OBJS := $(patsubst %.c, %.o, $(SRCS))
|
||||
|
||||
|
||||
.PHONY: all clean
|
||||
|
||||
all: $(OBJS)
|
||||
$(AT)$(CC) -o $(TARGET) $^ $(CFLAGS)
|
||||
$(AT)$(STRIP) $(TARGET)
|
||||
|
||||
%.o : %.c
|
||||
$(AT)$(CC) -c -o $@ $< $(CFLAGS)
|
||||
|
||||
clean:
|
||||
$(AT)rm -rf $(OBJS) $(TARGET)
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "quickstart_comm.h"
|
||||
|
||||
|
||||
xmedia_void quickstart_media_start(xmedia_void)
|
||||
{
|
||||
xmedia_s32 s32Ret = XMEDIA_FAILURE;
|
||||
xmedia_s32 venc_chn[2] = {0,1};
|
||||
|
||||
s32Ret = media_comm_media_init();
|
||||
if (XMEDIA_SUCCESS != s32Ret) {
|
||||
MEDIA_PRT("media init fail \n");
|
||||
goto error0;
|
||||
}
|
||||
|
||||
s32Ret = quickstart_comm_venc_start_get_stream(venc_chn, 2);
|
||||
if (XMEDIA_SUCCESS != s32Ret) {
|
||||
MEDIA_PRT("media init fail \n");
|
||||
goto error1;
|
||||
}
|
||||
|
||||
sleep(15);
|
||||
|
||||
error1:
|
||||
quickstart_comm_venc_stop_get_stream();
|
||||
|
||||
error0:
|
||||
media_comm_media_exit();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
xmedia_s32 main(xmedia_void)
|
||||
{
|
||||
quickstart_media_start();
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user