Skip to content

Commit e39e16f

Browse files
authored
[Examples] Create common tv-app sources (project-chip#27408)
Move cluster handlers, app platform and shell command implementations, ZCL callbacks from Linux to tv-common directory. Create source set with tv-app source files. Create cmake macro to add common tv-app sources to the specific target. Use common tv-app sources in Linux tv-app example. Sources can now be easily shared across platform implementations. Signed-off-by: ATmobica <artur.tynecki@arm.com>
1 parent 43c1738 commit e39e16f

38 files changed

+405
-400
lines changed

examples/tv-app/linux/BUILD.gn

+2-34
Original file line numberDiff line numberDiff line change
@@ -20,43 +20,12 @@ import("${chip_root}/src/lib/lib.gni")
2020
assert(chip_build_tools)
2121

2222
executable("chip-tv-app") {
23-
sources = [
24-
"${chip_root}/examples/tv-app/tv-common/include/CHIPProjectAppConfig.h",
25-
"AppImpl.cpp",
26-
"AppImpl.h",
27-
"ZclCallbacks.cpp",
28-
"include/account-login/AccountLoginManager.cpp",
29-
"include/account-login/AccountLoginManager.h",
30-
"include/application-basic/ApplicationBasicManager.cpp",
31-
"include/application-basic/ApplicationBasicManager.h",
32-
"include/application-launcher/ApplicationLauncherManager.cpp",
33-
"include/application-launcher/ApplicationLauncherManager.h",
34-
"include/audio-output/AudioOutputManager.cpp",
35-
"include/audio-output/AudioOutputManager.h",
36-
"include/channel/ChannelManager.cpp",
37-
"include/channel/ChannelManager.h",
38-
"include/cluster-change-attribute.cpp",
39-
"include/cluster-init.cpp",
40-
"include/content-launcher/ContentLauncherManager.cpp",
41-
"include/content-launcher/ContentLauncherManager.h",
42-
"include/keypad-input/KeypadInputManager.cpp",
43-
"include/keypad-input/KeypadInputManager.h",
44-
"include/low-power/LowPowerManager.cpp",
45-
"include/low-power/LowPowerManager.h",
46-
"include/media-input/MediaInputManager.cpp",
47-
"include/media-input/MediaInputManager.h",
48-
"include/media-playback/MediaPlaybackManager.cpp",
49-
"include/media-playback/MediaPlaybackManager.h",
50-
"include/target-navigator/TargetNavigatorManager.cpp",
51-
"include/target-navigator/TargetNavigatorManager.h",
52-
"include/wake-on-lan/WakeOnLanManager.cpp",
53-
"include/wake-on-lan/WakeOnLanManager.h",
54-
"main.cpp",
55-
]
23+
sources = [ "main.cpp" ]
5624

5725
deps = [
5826
"${chip_root}/examples/platform/linux:app-main",
5927
"${chip_root}/examples/tv-app/tv-common",
28+
"${chip_root}/examples/tv-app/tv-common:tv-common-sources",
6029
"${chip_root}/src/lib",
6130
"${chip_root}/third_party/inipp",
6231
]
@@ -71,7 +40,6 @@ executable("chip-tv-app") {
7140

7241
if (chip_build_libshell) {
7342
defines += [ "ENABLE_CHIP_SHELL" ]
74-
sources += [ "AppPlatformShellCommands.cpp" ]
7543
}
7644

7745
output_dir = root_out_dir

examples/tv-app/linux/README.md

+9-8
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,15 @@ As an app platform, Content Apps can be launched and assigned to endpoints
7474
following (see Video Player Architecture in the Device Library spec).
7575

7676
There is a dummy app platform included in the linux tv-app which includes a
77-
small number of hardcoded apps. See AppImpl.h/.cpp for this dummy
78-
implementation. These apps have hardcoded values for many operations - on a real
79-
device, these apps would usually be developed by streaming video content
80-
providers and the native platform may or may not provide Matter interfaces to
81-
these apps. In some cases, the video player platform will bridge its existing
82-
internal interfaces to Matter, allowing apps to continue to not be Matter-aware,
83-
while other platforms may provide Matter interfaces to Content Apps so that they
84-
can directly respond to each Matter cluster.
77+
small number of hardcoded apps. See `examples/tv-app/tv-common/src/AppTv.h` and
78+
`examples/tv-app/tv-common/src/AppTv.cpp` for this dummy implementation. These
79+
apps have hardcoded values for many operations - on a real device, these apps
80+
would usually be developed by streaming video content providers and the native
81+
platform may or may not provide Matter interfaces to these apps. In some cases,
82+
the video player platform will bridge its existing internal interfaces to
83+
Matter, allowing apps to continue to not be Matter-aware, while other platforms
84+
may provide Matter interfaces to Content Apps so that they can directly respond
85+
to each Matter cluster.
8586

8687
On Linux, there are shell commands to start and stop the dummy apps (by vendor
8788
id):

examples/tv-app/linux/ZclCallbacks.cpp

-70
This file was deleted.

examples/tv-app/linux/include/cluster-change-attribute.cpp

-67
This file was deleted.

examples/tv-app/linux/include/cluster-init.cpp

-54
This file was deleted.

0 commit comments

Comments
 (0)