@@ -6,17 +6,13 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=34400b68072d710fecd0a2940a0d1658"
6
6
7
7
DEPENDS += "\
8
8
libwebsockets \
9
- gstreamer1.0 \
10
- gstreamer1.0-plugins-base \
11
- gstreamer1.0-plugins-good \
12
- gstreamer1.0-plugins-bad \
13
9
"
14
10
15
11
# default is stripped, we wanna do this by yocto
16
12
EXTRA_OECMAKE :append = " -DCMAKE_BUILD_TYPE=RelWithDebInfo"
17
13
18
- # set log message debug level
19
- EXTRA_OECMAKE :append = " -DLIBRARY_LOG_LEVEL=LOG_VERBOSE "
14
+ # set log level
15
+ EXTRA_OECMAKE :append = " -DLIBRARY_LOG_LEVEL=LOG_INFO "
20
16
21
17
# ##
22
18
# Use this for development to specify a local folder as source dir (cloned repo)
@@ -33,7 +29,7 @@ EXTRA_OECMAKE:append = " -DLIBRARY_LOG_LEVEL=LOG_VERBOSE"
33
29
# nooelint: oelint.vars.specific
34
30
CFLAGS :append :arm = " -Wno-error=format="
35
31
36
- SRC_URI = "\
32
+ SRC_URI + = "\
37
33
gitsm://github.com/awslabs/linux-webrtc-reference-for-amazon-kinesis-video-streams.git;protocol=https;branch=main \
38
34
file://run-ptest \
39
35
"
@@ -48,31 +44,81 @@ PACKAGECONFIG:append:x86-64 = " ${@bb.utils.contains('PTEST_ENABLED', '1', 'sani
48
44
49
45
PACKAGECONFIG [sanitize ] = ",, gcc-sanitizers"
50
46
47
+ # h264 gst plugin require setting: LICENSE_FLAGS_ACCEPTED += "commercial"
48
+ # and enable opus codec
49
+ # PACKAGECONFIG:append:pn-gstreamer1.0-plugins-base = " opus"
50
+ # and enable x264 codec
51
+ # PACKAGECONFIG:append:pn-gstreamer1.0-plugins-ugly = " x264"
52
+
53
+ PACKAGECONFIG :append = "${@ bb . utils . contains ("LICENSE_FLAGS_ACCEPTED" , "commercial" , "gstreamer" , "" , d )}"
54
+
55
+ PACKAGECONFIG [gstreamer ] = ",,\
56
+ gstreamer1.0 \
57
+ gstreamer1.0-plugins-base \
58
+ gstreamer1.0-plugins-good \
59
+ gstreamer1.0-plugins-bad \
60
+ gstreamer1.0-plugins-ugly \
61
+ ,\
62
+ gstreamer1.0 \
63
+ gstreamer1.0-plugins-base \
64
+ gstreamer1.0-plugins-good \
65
+ gstreamer1.0-plugins-bad \
66
+ gstreamer1.0-plugins-ugly \
67
+ gstreamer1.0-plugins-base-apps \
68
+ "
69
+
51
70
RDEPENDS :${PN} += "ca-certificates"
52
71
53
- # RDEPENDS:${PN}-ptest += "\
54
- # amazon-kvs-webrtc-sdk \
55
- # coreutils \
56
- # util-linux \
57
- # "
72
+ RDEPENDS :${PN} -ptest += "\
73
+ amazon-kvs-webrtc-sdk \
74
+ coreutils \
75
+ util-linux \
76
+ "
58
77
78
+ # overwrite these variables to use your own AWS credentials in your local.conf
79
+ AWS_REGION ?= "eu-central-1"
80
+ AWS_KVS_CHANNEL_NAME ?= "test-channel"
81
+ AWS_ACCESS_KEY_ID ?= ""
82
+ AWS_SECRET_ACCESS_KEY ?= ""
83
+ AWS_SESSION_TOKEN ?= ""
84
+ AWS_CA_CERT_PATH ?= "/etc/cert.pem"
85
+
86
+ # this can be used for key based authentication
59
87
do_configure :append () {
60
88
cp ${S} /examples /demo_config /demo_config_template . h ${S} /examples /demo_config /demo_config . h
89
+ sed -i '/#define AWS_REGION "us-west-2"/d' ${S} /examples /demo_config /demo_config . h
90
+ sed -i '/#define AWS_KVS_CHANNEL_NAME ""/d' ${S} /examples /demo_config /demo_config . h
91
+ sed -i '/#define AWS_CA_CERT_PATH "cert\/cert.pem"/d' ${S} /examples /demo_config /demo_config . h
61
92
sed -i '/^#if defined( AWS_ACCESS_KEY_ID ) && defined( AWS_IOT_THING_ROLE_ALIAS )/i\
62
- #define AWS_CREDENTIALS_ENDPOINT ""\
63
- #define AWS_IOT_THING_NAME ""\
64
- #define AWS_IOT_THING_ROLE_ALIAS ""\
65
- #define AWS_IOT_THING_CERT_PATH "certificate.pem"\
66
- #define AWS_IOT_THING_PRIVATE_KEY_PATH "private.key"\
93
+ #define AWS_REGION "${AWS_REGION} "\
94
+ #define AWS_KVS_CHANNEL_NAME "${AWS_KVS_CHANNEL_NAME} "\
95
+ #define AWS_REGION "${AWS_REGION} "\
96
+ #define AWS_ACCESS_KEY_ID "${AWS_ACCESS_KEY_ID} "\
97
+ #define AWS_SECRET_ACCESS_KEY "${AWS_SECRET_ACCESS_KEY} "\
98
+ #define AWS_SESSION_TOKEN "${AWS_SESSION_TOKEN} "\
99
+ #define AWS_CA_CERT_PATH "${AWS_CA_CERT_PATH} "\
67
100
' ${S} /examples /demo_config /demo_config . h
68
101
}
69
102
103
+ # this can be used for iot cert based authentication
104
+ # do_configure:append() {
105
+ # cp ${S}/examples/demo_config/demo_config_template.h ${S}/examples/demo_config/demo_config.h
106
+ # sed -i '/^#if defined( AWS_ACCESS_KEY_ID ) && defined( AWS_IOT_THING_ROLE_ALIAS )/i\
107
+ # #define AWS_CREDENTIALS_ENDPOINT ""\
108
+ # #define AWS_IOT_THING_NAME ""\
109
+ # #define AWS_IOT_THING_ROLE_ALIAS ""\
110
+ # #define AWS_IOT_THING_CERT_PATH "certificate.pem"\
111
+ # #define AWS_IOT_THING_PRIVATE_KEY_PATH "private.key"\
112
+ # ' ${S}/examples/demo_config/demo_config.h
113
+ # }
114
+ #
115
+
70
116
inherit cmake pkgconfig ptest
71
117
72
118
do_install () {
73
119
install -d ${D}${bindir}
74
120
install -m 0755 ${B} /WebRTCLinuxApplicationMaster ${D}${bindir}
75
- install -m 0755 ${B} /WebRTCLinuxApplicationGstMaster ${D}${bindir}
121
+ ${ @ bb . utils . contains ( "PACKAGECONFIG" , "gstreamer" , " install -m 0755 ${B} /WebRTCLinuxApplicationGstMaster ${D}${bindir} " , "" , d ) }
76
122
77
123
install -d ${D}${bindir} /examples /app_media_source /samples /h264SampleFrames
78
124
cp -r ${S} /examples /app_media_source /samples /h264SampleFrames /* ${D}${bindir} /examples /app_media_source /samples /h264SampleFrames /
@@ -82,10 +128,25 @@ do_install() {
82
128
83
129
install -d ${D}${sysconfdir}
84
130
install -m 0664 ${S} /cert /cert . pem ${D}${sysconfdir} /
85
- # install -m 0664 ${S}/certificate.pem ${D}${sysconfdir}/
86
- # install -m 0664 ${S}/private.key ${D}${sysconfdir}/
87
131
}
88
132
133
+ do_install_ptest :append () {
134
+ install -d ${D}${sysconfdir}
135
+ echo "${AWS_ACCESS_KEY_ID} " > ${D}${sysconfdir} /AWS_ACCESS_KEY_ID
136
+ echo "${AWS_SECRET_ACCESS_KEY} " > ${D}${sysconfdir} /AWS_SECRET_ACCESS_KEY
137
+ echo "${AWS_KVS_CHANNEL_NAME} " > ${D}${sysconfdir} /CHANNEL_NAME
138
+ echo "${AWS_REGION} " > ${D}${sysconfdir} /AWS_REGION
139
+
140
+ # cert based authentication
141
+ if [ -f ${S} /cert /private . key ]; then
142
+ install -m 0664 ${S} /cert /private . key ${D}${sysconfdir} /
143
+ fi
144
+ if [ -f ${S} /cert /certificate . pem ]; then
145
+ install -m 0664 ${S} /cert /certificate . pem ${D}${sysconfdir} /
146
+ fi
147
+ }
148
+
149
+ # TODO: add suport for cert based authentication
89
150
# do_install_ptest:append() {
90
151
# install -d ${D}${sysconfdir}
91
152
# install ${S}/tests/iot-credentials/THING_NAME ${D}${sysconfdir}/
0 commit comments