@@ -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
"
@@ -46,31 +42,81 @@ PACKAGECONFIG:append:x86-64 = " ${@bb.utils.contains('PTEST_ENABLED', '1', 'sani
46
42
47
43
PACKAGECONFIG [sanitize ] = ",, gcc-sanitizers"
48
44
45
+ # h264 gst plugin require setting: LICENSE_FLAGS_ACCEPTED += "commercial"
46
+ # and enable opus codec
47
+ # PACKAGECONFIG:append:pn-gstreamer1.0-plugins-base = " opus"
48
+ # and enable x264 codec
49
+ # PACKAGECONFIG:append:pn-gstreamer1.0-plugins-ugly = " x264"
50
+
51
+ PACKAGECONFIG :append = " ${@ bb . utils . contains ("LICENSE_FLAGS_ACCEPTED" , "commercial" , "gstreamer" , "" , d )}"
52
+
53
+ PACKAGECONFIG [gstreamer ] = ",,\
54
+ gstreamer1.0 \
55
+ gstreamer1.0-plugins-base \
56
+ gstreamer1.0-plugins-good \
57
+ gstreamer1.0-plugins-bad \
58
+ gstreamer1.0-plugins-ugly \
59
+ ,\
60
+ gstreamer1.0 \
61
+ gstreamer1.0-plugins-base \
62
+ gstreamer1.0-plugins-good \
63
+ gstreamer1.0-plugins-bad \
64
+ gstreamer1.0-plugins-ugly \
65
+ gstreamer1.0-plugins-base-apps \
66
+ "
67
+
49
68
RDEPENDS :${PN} += "ca-certificates"
50
69
51
- # RDEPENDS:${PN}-ptest += "\
52
- # amazon-kvs-webrtc-sdk \
53
- # coreutils \
54
- # util-linux \
55
- # "
70
+ RDEPENDS :${PN} -ptest += "\
71
+ amazon-kvs-webrtc-sdk \
72
+ coreutils \
73
+ util-linux \
74
+ "
56
75
76
+ # overwrite these variables to use your own AWS credentials in your local.conf
77
+ AWS_REGION ?= "eu-central-1"
78
+ AWS_KVS_CHANNEL_NAME ?= "test-channel"
79
+ AWS_ACCESS_KEY_ID ?= ""
80
+ AWS_SECRET_ACCESS_KEY ?= ""
81
+ AWS_SESSION_TOKEN ?= ""
82
+ AWS_CA_CERT_PATH ?= "/etc/cert.pem"
83
+
84
+ # this can be used for key based authentication
57
85
do_configure :append () {
58
86
cp ${S} /examples /demo_config /demo_config_template . h ${S} /examples /demo_config /demo_config . h
87
+ sed -i '/#define AWS_REGION "us-west-2"/d' ${S} /examples /demo_config /demo_config . h
88
+ sed -i '/#define AWS_KVS_CHANNEL_NAME ""/d' ${S} /examples /demo_config /demo_config . h
89
+ sed -i '/#define AWS_CA_CERT_PATH "cert\/cert.pem"/d' ${S} /examples /demo_config /demo_config . h
59
90
sed -i '/^#if defined( AWS_ACCESS_KEY_ID ) && defined( AWS_IOT_THING_ROLE_ALIAS )/i\
60
- #define AWS_CREDENTIALS_ENDPOINT ""\
61
- #define AWS_IOT_THING_NAME ""\
62
- #define AWS_IOT_THING_ROLE_ALIAS ""\
63
- #define AWS_IOT_THING_CERT_PATH "certificate.pem"\
64
- #define AWS_IOT_THING_PRIVATE_KEY_PATH "private.key"\
91
+ #define AWS_REGION "${AWS_REGION} "\
92
+ #define AWS_KVS_CHANNEL_NAME "${AWS_KVS_CHANNEL_NAME} "\
93
+ #define AWS_REGION "${AWS_REGION} "\
94
+ #define AWS_ACCESS_KEY_ID "${AWS_ACCESS_KEY_ID} "\
95
+ #define AWS_SECRET_ACCESS_KEY "${AWS_SECRET_ACCESS_KEY} "\
96
+ #define AWS_SESSION_TOKEN "${AWS_SESSION_TOKEN} "\
97
+ #define AWS_CA_CERT_PATH "${AWS_CA_CERT_PATH} "\
65
98
' ${S} /examples /demo_config /demo_config . h
66
99
}
67
100
101
+ # this can be used for iot cert based authentication
102
+ # do_configure:append() {
103
+ # cp ${S}/examples/demo_config/demo_config_template.h ${S}/examples/demo_config/demo_config.h
104
+ # sed -i '/^#if defined( AWS_ACCESS_KEY_ID ) && defined( AWS_IOT_THING_ROLE_ALIAS )/i\
105
+ # #define AWS_CREDENTIALS_ENDPOINT ""\
106
+ # #define AWS_IOT_THING_NAME ""\
107
+ # #define AWS_IOT_THING_ROLE_ALIAS ""\
108
+ # #define AWS_IOT_THING_CERT_PATH "certificate.pem"\
109
+ # #define AWS_IOT_THING_PRIVATE_KEY_PATH "private.key"\
110
+ # ' ${S}/examples/demo_config/demo_config.h
111
+ # }
112
+ #
113
+
68
114
inherit cmake pkgconfig ptest
69
115
70
116
do_install () {
71
117
install -d ${D}${bindir}
72
118
install -m 0755 ${B} /WebRTCLinuxApplicationMaster ${D}${bindir}
73
- install -m 0755 ${B} /WebRTCLinuxApplicationGstMaster ${D}${bindir}
119
+ ${ @ bb . utils . contains ( "PACKAGECONFIG" , "gstreamer" , " install -m 0755 ${B} /WebRTCLinuxApplicationGstMaster ${D}${bindir} " , "" , d ) }
74
120
75
121
install -d ${D}${bindir} /examples /app_media_source /samples /h264SampleFrames
76
122
cp -r ${S} /examples /app_media_source /samples /h264SampleFrames /* ${D}${bindir} /examples /app_media_source /samples /h264SampleFrames /
@@ -80,10 +126,25 @@ do_install() {
80
126
81
127
install -d ${D}${sysconfdir}
82
128
install -m 0664 ${S} /cert /cert . pem ${D}${sysconfdir} /
83
- # install -m 0664 ${S}/certificate.pem ${D}${sysconfdir}/
84
- # install -m 0664 ${S}/private.key ${D}${sysconfdir}/
85
129
}
86
130
131
+ do_install_ptest :append () {
132
+ install -d ${D}${sysconfdir}
133
+ echo "${AWS_ACCESS_KEY_ID} " > ${D}${sysconfdir} /AWS_ACCESS_KEY_ID
134
+ echo "${AWS_SECRET_ACCESS_KEY} " > ${D}${sysconfdir} /AWS_SECRET_ACCESS_KEY
135
+ echo "${AWS_KVS_CHANNEL_NAME} " > ${D}${sysconfdir} /CHANNEL_NAME
136
+ echo "${AWS_REGION} " > ${D}${sysconfdir} /AWS_REGION
137
+
138
+ # cert based authentication
139
+ if [ -f ${S} /cert /private . key ]; then
140
+ install -m 0664 ${S} /cert /private . key ${D}${sysconfdir} /
141
+ fi
142
+ if [ -f ${S} /cert /certificate . pem ]; then
143
+ install -m 0664 ${S} /cert /certificate . pem ${D}${sysconfdir} /
144
+ fi
145
+ }
146
+
147
+ # TODO: add suport for cert based authentication
87
148
# do_install_ptest:append() {
88
149
# install -d ${D}${sysconfdir}
89
150
# install ${S}/tests/iot-credentials/THING_NAME ${D}${sysconfdir}/
0 commit comments