Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an example of 2ch video capture. #2538

Merged
merged 9 commits into from
Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions examples/device/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,5 @@ family_add_subdirectory(net_lwip_webserver)
family_add_subdirectory(uac2_headset)
family_add_subdirectory(usbtmc)
family_add_subdirectory(video_capture)
family_add_subdirectory(video_capture_2ch)
family_add_subdirectory(webusb_serial)
4 changes: 2 additions & 2 deletions examples/device/video_capture/src/usb_descriptors.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ char const* string_desc_arr[] = {
"TinyUSB", // 1: Manufacturer
"TinyUSB Device", // 2: Product
NULL, // 3: Serials will use unique ID if possible
"TinyUSB UVC Control", // 4: UVC Interface
"TinyUSB UVC Streaming", // 5: UVC Interface
"UVC Control", // 4: UVC Interface
"UVC Streaming", // 5: UVC Interface
};

//--------------------------------------------------------------------+
Expand Down
39 changes: 39 additions & 0 deletions examples/device/video_capture_2ch/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
cmake_minimum_required(VERSION 3.17)

include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)

# gets PROJECT name for the example (e.g. <BOARD>-<DIR_NAME>)
family_get_project_name(PROJECT ${CMAKE_CURRENT_LIST_DIR})

project(${PROJECT} C CXX ASM)

# Checks this example is valid for the family and initializes the project
family_initialize_project(${PROJECT} ${CMAKE_CURRENT_LIST_DIR})

# Espressif has its own cmake build system
if(FAMILY STREQUAL "espressif")
return()
endif()

add_executable(${PROJECT})

if (FORCE_READONLY)
target_compile_definitions(${PROJECT} PRIVATE
CFG_EXAMPLE_VIDEO_READONLY
)
endif()

# Example source
target_sources(${PROJECT} PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
${CMAKE_CURRENT_SOURCE_DIR}/src/usb_descriptors.c
)

# Example include
target_include_directories(${PROJECT} PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/src
)

# Configure compilation flags and libraries for the example without RTOS.
# See the corresponding function in hw/bsp/FAMILY/family.cmake for details.
family_configure_device_example(${PROJECT} noos)
18 changes: 18 additions & 0 deletions examples/device/video_capture_2ch/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
include ../../build_system/make/make.mk

ifeq ($(DISABLE_MJPEG),1)
CFLAGS += -DCFG_EXAMPLE_VIDEO_DISABLE_MJPEG
endif
ifeq ($(FORCE_READONLY),1)
CFLAGS += -DCFG_EXAMPLE_VIDEO_READONLY
endif

INC += \
src \
$(TOP)/hw \

# Example source
EXAMPLE_SOURCE += $(wildcard src/*.c)
SRC_C += $(addprefix $(CURRENT_PATH)/, $(EXAMPLE_SOURCE))

include ../../build_system/make/rules.mk
13 changes: 13 additions & 0 deletions examples/device/video_capture_2ch/skip.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
mcu:MSP430x5xx
mcu:NUC121
mcu:SAMD11
mcu:GD32VF103
mcu:CH32V307
family:espressif
board:curiosity_nano
board:kuiic
board:frdm_k32l2b
board:lpcxpresso11u68
board:stm32f303disco
board:stm32l412nucleo
board:ek_tm4c123gxl
4 changes: 4 additions & 0 deletions examples/device/video_capture_2ch/src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# This file is for ESP-IDF only
idf_component_register(SRCS "main.c" "usb_descriptors.c"
INCLUDE_DIRS "."
REQUIRES boards tinyusb_src)
1,934 changes: 1,934 additions & 0 deletions examples/device/video_capture_2ch/src/images.h

Large diffs are not rendered by default.

Loading
Loading