-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial implementation of camera-controller app (#37835)
* Initial implemenation of camera-controller app * Fix build errors * Remove ICD stuff since it is not needed for camera
- Loading branch information
1 parent
e7a2952
commit 5becd81
Showing
53 changed files
with
8,790 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
## Camera | ||
|
||
```{toctree} | ||
:glob: | ||
:maxdepth: 1 | ||
camera-controller/README | ||
``` |
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,25 @@ | ||
# Copyright (c) 2025 Project CHIP Authors | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
import("//build_overrides/build.gni") | ||
|
||
# The location of the build configuration file. | ||
buildconfig = "${build_root}/config/BUILDCONFIG.gn" | ||
|
||
# CHIP uses angle bracket includes. | ||
check_system_includes = true | ||
|
||
default_args = { | ||
import("//args.gni") | ||
} |
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,117 @@ | ||
# Copyright (c) 2025 Project CHIP Authors | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
import("//build_overrides/build.gni") | ||
import("//build_overrides/chip.gni") | ||
|
||
import("//build_overrides/editline.gni") | ||
import("${chip_root}/build/chip/tools.gni") | ||
import("${chip_root}/examples/camera-controller/camera-controller.gni") | ||
import("${chip_root}/src/lib/core/core.gni") | ||
|
||
assert(chip_build_tools) | ||
|
||
config("config") { | ||
include_dirs = [ | ||
".", | ||
"${chip_root}/examples/common", | ||
"${chip_root}/zzz_generated/app-common/app-common", | ||
"${chip_root}/zzz_generated/chip-tool", | ||
"${chip_root}/src/lib", | ||
] | ||
|
||
defines = [ "CONFIG_USE_SEPARATE_EVENTLOOP=${config_use_separate_eventloop}" ] | ||
|
||
# Note: CONFIG_USE_LOCAL_STORAGE is tested for via #ifdef, not #if. | ||
if (config_use_local_storage) { | ||
defines += [ "CONFIG_USE_LOCAL_STORAGE" ] | ||
} | ||
} | ||
|
||
static_library("camera-controller-utils") { | ||
sources = [ | ||
"${chip_root}/src/controller/ExamplePersistentStorage.cpp", | ||
"${chip_root}/src/controller/ExamplePersistentStorage.h", | ||
"${chip_root}/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp", | ||
"${chip_root}/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp", | ||
"commands/clusters/ModelCommand.cpp", | ||
"commands/clusters/ModelCommand.h", | ||
"commands/clusters/ReportCommand.cpp", | ||
"commands/clusters/ReportCommand.h", | ||
"commands/common/CHIPCommand.cpp", | ||
"commands/common/CHIPCommand.h", | ||
"commands/common/Command.cpp", | ||
"commands/common/Command.h", | ||
"commands/common/Commands.cpp", | ||
"commands/common/Commands.h", | ||
"commands/common/CredentialIssuerCommands.h", | ||
"commands/common/HexConversion.h", | ||
"commands/common/RemoteDataModelLogger.cpp", | ||
"commands/common/RemoteDataModelLogger.h", | ||
"commands/pairing/OpenCommissioningWindowCommand.cpp", | ||
"commands/pairing/OpenCommissioningWindowCommand.h", | ||
"commands/pairing/PairingCommand.cpp", | ||
"commands/pairing/ToTLVCert.cpp", | ||
] | ||
|
||
deps = [ "${chip_root}/src/app:events" ] | ||
|
||
sources += [ "commands/interactive/InteractiveCommands.cpp" ] | ||
deps += [ | ||
"${chip_root}/src/platform/logging:headers", | ||
"${editline_root}:editline", | ||
] | ||
|
||
if (chip_device_platform == "darwin") { | ||
sources += [ "commands/common/DeviceScanner.cpp" ] | ||
} | ||
|
||
public_deps = [ | ||
"${chip_root}/examples/common/tracing:commandline", | ||
"${chip_root}/src/app/server", | ||
"${chip_root}/src/app/tests/suites/commands/interaction_model", | ||
"${chip_root}/src/controller/data_model", | ||
"${chip_root}/src/credentials:file_attestation_trust_store", | ||
"${chip_root}/src/lib", | ||
"${chip_root}/src/lib/core:types", | ||
"${chip_root}/src/lib/support/jsontlv", | ||
"${chip_root}/src/platform", | ||
"${chip_root}/third_party/inipp", | ||
"${chip_root}/third_party/jsoncpp", | ||
] | ||
|
||
public_configs = [ ":config" ] | ||
|
||
if (chip_enable_transport_trace) { | ||
public_deps += | ||
[ "${chip_root}/examples/common/tracing:trace_handlers_decoder" ] | ||
} | ||
|
||
output_dir = root_out_dir | ||
} | ||
|
||
executable("camera-controller") { | ||
sources = [ "main.cpp" ] | ||
|
||
deps = [ | ||
":camera-controller-utils", | ||
"${chip_root}/src/platform/logging:stdio", | ||
] | ||
|
||
output_dir = root_out_dir | ||
} | ||
|
||
group("default") { | ||
deps = [ ":camera-controller" ] | ||
} |
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,25 @@ | ||
# Matter Camera Controller Example | ||
|
||
This example application demonstrates the CHIP Camera Controller running on a | ||
Linux platform and explains how to build and run the Camera Controller Example | ||
on Linux. | ||
|
||
In a typical setup, the Camera Controller app manages a CameraDevice app running | ||
on a Raspberry Pi. The CameraDevice captures and encodes the video feed before | ||
streaming it through a WebRTC track, while the CameraController receives this | ||
video stream and displays it, creating a complete end-to-end camera solution. | ||
|
||
--- | ||
|
||
- [Building the Example Application](#building-the-example-application) | ||
|
||
--- | ||
|
||
## Building the Example Application | ||
|
||
For Linux host example: | ||
|
||
``` | ||
source scripts/activate.sh | ||
./scripts/build/build_examples.py --target linux-x64-camera-controller build | ||
``` |
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,34 @@ | ||
# Copyright (c) 2025 Project CHIP Authors | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
import("//build_overrides/chip.gni") | ||
|
||
import("${chip_root}/config/standalone/args.gni") | ||
|
||
chip_device_project_config_include = "<CHIPProjectAppConfig.h>" | ||
chip_project_config_include = "<CHIPProjectAppConfig.h>" | ||
chip_system_project_config_include = "<SystemProjectConfig.h>" | ||
|
||
chip_project_config_include_dirs = | ||
[ "${chip_root}/examples/camera-controller/include" ] | ||
chip_project_config_include_dirs += [ "${chip_root}/config/standalone" ] | ||
|
||
matter_enable_tracing_support = true | ||
|
||
matter_log_json_payload_hex = true | ||
matter_log_json_payload_decode_full = true | ||
|
||
# make camera-controller very strict by default | ||
chip_tlv_validate_char_string_on_read = true | ||
chip_tlv_validate_char_string_on_write = true |
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 @@ | ||
../build_overrides |
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,22 @@ | ||
# Copyright (c) 2025 Project CHIP Authors | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
import("//build_overrides/build.gni") | ||
import("//build_overrides/chip.gni") | ||
|
||
declare_args() { | ||
# Use a separate eventloop for CHIP tasks | ||
config_use_separate_eventloop = true | ||
config_use_local_storage = true | ||
} |
Oops, something went wrong.