Skip to content

Commit 17a2d02

Browse files
committed
Remove AAC related changes
1 parent de6a26f commit 17a2d02

10 files changed

+15
-78
lines changed

Diff for: CMakeLists.txt

-1
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,6 @@ if (BUILD_SAMPLE)
440440
# copy sample frames to build folder, in case developer runs sample program with command `samples/kvsWebrtcClientMaster` from `build` dir.
441441
file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/samples/opusSampleFrames" DESTINATION .)
442442
file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/samples/h264SampleFrames" DESTINATION .)
443-
file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/samples/aacSampleFrames" DESTINATION .)
444443
file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/samples/h265SampleFrames" DESTINATION .)
445444

446445
add_subdirectory(samples)

Diff for: README.md

+4-16
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ To use the **Storage for WebRTC** feature, run the same command as above but wit
277277
./samples/kvsWebrtcClientMaster <channelName> 1 <audio-codec> <video-codec>
278278
```
279279

280-
Allowed audio-codec: opus (default codec if nothing is specified), aac
280+
Allowed audio-codec: opus (default codec if nothing is specified)
281281
Allowed video-codec: h264 (default codec if nothing is specified), h265
282282

283283
#### Sample: kvsWebrtcClientMasterGstSample
@@ -301,7 +301,7 @@ Example:
301301
./samples/kvsWebrtcClientMasterGstSample <channelName> audio-video testsrc opus h264
302302
```
303303

304-
Allowed audio-codec: opus (default codec if nothing is specified), aac
304+
Allowed audio-codec: opus (default codec if nothing is specified)
305305
Allowed video-codec: h264 (default codec if nothing is specified), h265
306306

307307
#### Sample: kvsWebrtcClientViewer
@@ -312,7 +312,7 @@ To run:
312312
./samples/kvsWebrtcClientViewer <channelName> <audio-codec> <video-codec>
313313
```
314314

315-
Allowed audio-codec: opus (default codec if nothing is specified), aac
315+
Allowed audio-codec: opus (default codec if nothing is specified)
316316
Allowed video-codec: h264 (default codec if nothing is specified), h265
317317

318318
#### Sample: kvsWebrtcClientViewerGstSample
@@ -323,7 +323,7 @@ To run:
323323
./samples/kvsWebrtcClientViewerGstSample <channelName> <mediaType> <audio-codec> <video-codec>
324324
```
325325

326-
Allowed audio-codec: opus (default codec if nothing is specified), aac
326+
Allowed audio-codec: opus (default codec if nothing is specified)
327327
Allowed video-codec: h264 (default codec if nothing is specified), h265
328328

329329
##### Known issues:
@@ -346,18 +346,6 @@ gst-launch-1.0 videotestsrc pattern=ball num-buffers=1500 ! timeoverlay ! videoc
346346
gst-launch-1.0 videotestsrc pattern=ball num-buffers=1500 ! timeoverlay ! videoconvert ! video/x-raw,format=I420,width=1280,height=720,framerate=25/1 ! queue ! x265enc speed-preset=veryfast bitrate=512 tune=zerolatency ! video/x-h265,stream-format=byte-stream,alignment=au,profile=main ! multifilesink location="frame-%04d.h265" index=1
347347
```
348348

349-
##### AAC
350-
351-
###### ADTS LC
352-
```shell
353-
gst-launch-1.0 audiotestsrc num-buffers=1500 ! audioconvert ! audioresample ! faac ! capsfilter caps=audio/mpeg,mpegversion=4,stream-format=adts,base-profile=lc,channels=2,rate=16000 ! multifilesink location="sample-%03d.aac" index=1
354-
```
355-
356-
###### RAW LC
357-
```shell
358-
gst-launch-1.0 audiotestsrc num-buffers=1500 ! audioconvert ! audioresample ! faac ! capsfilter caps=audio/mpeg,mpegversion=4,stream-format=raw,base-profile=lc,channels=2,rate=16000 ! multifilesink location="sample-%03d.aac" index=1
359-
```
360-
361349
### Viewing Master Samples
362350

363351
After running one of the master samples, when the command line application prints "Signaling client connection to socket established", indicating that your signaling channel is created and the connected master is streaming media to it, you can view the stream. To do so, check the media playback viewer on the KVS Signaling Channels console or open the [WebRTC SDK Test Page](https://awslabs.github.io/amazon-kinesis-video-streams-webrtc-sdk-js/examples/index.html).

Diff for: samples/CMakeLists.txt

-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ link_directories(${OPEN_SRC_INSTALL_PREFIX}/lib)
5656
# copy sample frames to this subproject build folder, in case developer runs sample program with command `kvsWebrtcClientMaster` from `build/samples` dir.
5757
file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/opusSampleFrames" DESTINATION .)
5858
file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/h264SampleFrames" DESTINATION .)
59-
file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/aacSampleFrames" DESTINATION .)
6059
file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/h265SampleFrames" DESTINATION .)
6160

6261
add_executable(

Diff for: samples/GstAudioVideoReceiver.c

+2-16
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
static UINT64 presentationTsIncrement = 0;
77
static BOOL eos = FALSE;
8-
static RTC_CODEC audioCodec = RTC_CODEC_OPUS;
98

109
// This function is a callback for the transceiver for every single video frame it receives
1110
// It writes these frames to a buffer and pushes it to the `appsrcVideo` element of the
@@ -68,12 +67,8 @@ VOID onGstAudioFrameReady(UINT64 customData, PFrame pFrame)
6867

6968
GST_BUFFER_DTS(buffer) = presentationTsIncrement;
7069
GST_BUFFER_PTS(buffer) = presentationTsIncrement;
71-
72-
if (audioCodec == RTC_CODEC_AAC) {
73-
GST_BUFFER_DURATION(buffer) = gst_util_uint64_scale(pFrame->size, GST_SECOND, DEFAULT_AUDIO_AAC_BYTE_RATE);
74-
} else {
75-
GST_BUFFER_DURATION(buffer) = gst_util_uint64_scale(pFrame->size, GST_SECOND, DEFAULT_AUDIO_OPUS_BYTE_RATE);
76-
}
70+
GST_BUFFER_DURATION(buffer) = gst_util_uint64_scale(pFrame->size, GST_SECOND, DEFAULT_AUDIO_OPUS_BYTE_RATE);
71+
7772
// TODO: check for other codecs once the pipelines are added
7873

7974
if (gst_buffer_fill(buffer, 0, pFrame->frameData, pFrame->size) != pFrame->size) {
@@ -118,8 +113,6 @@ PVOID receiveGstreamerAudioVideo(PVOID args)
118113
roleType = "Master";
119114
}
120115

121-
audioCodec = pSampleConfiguration->audioCodec;
122-
123116
CHK_ERR(gst_init_check(NULL, NULL, &error), STATUS_INTERNAL_ERROR, "[KVS GStreamer %s] GStreamer initialization failed");
124117

125118
CHK_ERR(pSampleStreamingSession != NULL, STATUS_NULL_ARG, "[KVS Gstreamer %s] Sample streaming session is NULL", roleType);
@@ -156,13 +149,6 @@ PVOID receiveGstreamerAudioVideo(PVOID args)
156149
G_TYPE_INT, 1, NULL);
157150
break;
158151

159-
case RTC_CODEC_AAC:
160-
audioDescription = "appsrc name=appsrc-audio ! queue ! aacparse ! mux.";
161-
audiocaps = gst_caps_new_simple("audio/mpeg", "mpegversion", G_TYPE_INT, 4, "rate", G_TYPE_INT, DEFAULT_AUDIO_AAC_SAMPLE_RATE_HZ,
162-
"channels", G_TYPE_INT, DEFAULT_AUDIO_AAC_CHANNELS, "stream-format", G_TYPE_STRING, "adts",
163-
"base-profile", G_TYPE_STRING, "lc", NULL);
164-
break;
165-
166152
// TODO: make sure this pipeline works. Figure out the caps for this
167153
case RTC_CODEC_MULAW:
168154
case RTC_CODEC_ALAW:

Diff for: samples/Samples.h

-5
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,13 @@ extern "C" {
1919
#define DEFAULT_VIDEO_HEIGHT_PIXELS 720
2020
#define DEFAULT_VIDEO_WIDTH_PIXELS 1280
2121
#define DEFAULT_AUDIO_OPUS_CHANNELS 2
22-
#define DEFAULT_AUDIO_AAC_CHANNELS 2
2322
#define DEFAULT_AUDIO_OPUS_SAMPLE_RATE_HZ 48000
24-
#define DEFAULT_AUDIO_AAC_SAMPLE_RATE_HZ 16000
2523
#define DEFAULT_AUDIO_OPUS_BITS_PER_SAMPLE 16
26-
#define DEFAULT_AUDIO_AAC_BITS_PER_SAMPLE 16
2724
#define DEFAULT_MAX_CONCURRENT_STREAMING_SESSION 10
2825

2926
#define AUDIO_CODEC_NAME_ALAW "alaw"
3027
#define AUDIO_CODEC_NAME_MULAW "mulaw"
3128
#define AUDIO_CODEC_NAME_OPUS "opus"
32-
#define AUDIO_CODEC_NAME_AAC "aac"
3329
#define VIDEO_CODEC_NAME_H264 "h264"
3430
#define VIDEO_CODEC_NAME_H265 "h265"
3531
#define VIDEO_CODEC_NAME_VP8 "vp8"
@@ -39,7 +35,6 @@ extern "C" {
3935
#define SAMPLE_CHANNEL_NAME (PCHAR) "ScaryTestChannel"
4036

4137
#define DEFAULT_AUDIO_OPUS_BYTE_RATE (DEFAULT_AUDIO_OPUS_SAMPLE_RATE_HZ * DEFAULT_AUDIO_OPUS_CHANNELS * DEFAULT_AUDIO_OPUS_BITS_PER_SAMPLE) / 8
42-
#define DEFAULT_AUDIO_AAC_BYTE_RATE (DEFAULT_AUDIO_AAC_SAMPLE_RATE_HZ * DEFAULT_AUDIO_AAC_CHANNELS * DEFAULT_AUDIO_AAC_BITS_PER_SAMPLE) / 8
4338

4439
#define SAMPLE_AUDIO_FRAME_DURATION (20 * HUNDREDS_OF_NANOS_IN_A_MILLISECOND)
4540
#define SAMPLE_STATS_DURATION (60 * HUNDREDS_OF_NANOS_IN_A_SECOND)

Diff for: samples/kvsWebRTCClientMaster.c

+3-10
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,8 @@ INT32 main(INT32 argc, CHAR* argv[])
3030
CHK_STATUS(createSampleConfiguration(pChannelName, SIGNALING_CHANNEL_ROLE_TYPE_MASTER, TRUE, TRUE, logLevel, &pSampleConfiguration));
3131

3232
if (argc > 3) {
33-
if (!STRCMP(argv[3], AUDIO_CODEC_NAME_AAC)) {
34-
audioCodec = RTC_CODEC_AAC;
35-
} else {
36-
DLOGI("[KVS Master] Defaulting to opus as the specified codec's sample frames may not be available");
33+
if (!STRCMP(argv[3], AUDIO_CODEC_NAME_OPUS)) {
34+
audioCodec = RTC_CODEC_OPUS;
3735
}
3836
}
3937

@@ -75,9 +73,6 @@ INT32 main(INT32 argc, CHAR* argv[])
7573
if (audioCodec == RTC_CODEC_OPUS) {
7674
CHK_STATUS(readFrameFromDisk(NULL, &frameSize, "./opusSampleFrames/sample-001.opus"));
7775
DLOGI("[KVS Master] Checked Opus sample audio frame availability....available");
78-
} else if (audioCodec == RTC_CODEC_AAC) {
79-
CHK_STATUS(readFrameFromDisk(NULL, &frameSize, "./aacSampleFrames/sample-001.aac"));
80-
DLOGI("[KVS Master] Checked AAC sample audio frame availability....available");
8176
}
8277

8378
// Initialize KVS WebRTC. This must be done before anything else, and must only be done once.
@@ -253,9 +248,7 @@ PVOID sendAudioPackets(PVOID args)
253248
while (!ATOMIC_LOAD_BOOL(&pSampleConfiguration->appTerminateFlag)) {
254249
fileIndex = fileIndex % NUMBER_OF_OPUS_FRAME_FILES + 1;
255250

256-
if (pSampleConfiguration->audioCodec == RTC_CODEC_AAC) {
257-
SNPRINTF(filePath, MAX_PATH_LEN, "./aacSampleFrames/sample-%03d.aac", fileIndex);
258-
} else if (pSampleConfiguration->audioCodec == RTC_CODEC_OPUS) {
251+
if (pSampleConfiguration->audioCodec == RTC_CODEC_OPUS) {
259252
SNPRINTF(filePath, MAX_PATH_LEN, "./opusSampleFrames/sample-%03d.opus", fileIndex);
260253
}
261254

Diff for: samples/kvsWebRTCClientViewer.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ INT32 main(INT32 argc, CHAR* argv[])
6060
#endif
6161

6262
if (argc > 2) {
63-
if (!STRCMP(argv[2], AUDIO_CODEC_NAME_AAC)) {
64-
audioCodec = RTC_CODEC_AAC;
63+
if (!STRCMP(argv[2], AUDIO_CODEC_NAME_OPUS)) {
64+
audioCodec = RTC_CODEC_OPUS;
6565
} else if (!STRCMP(argv[2], AUDIO_CODEC_NAME_ALAW)) {
6666
audioCodec = RTC_CODEC_ALAW;
6767
} else if (!STRCMP(argv[2], AUDIO_CODEC_NAME_MULAW)) {

Diff for: samples/kvsWebRTCClientViewerGstSample.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ INT32 main(INT32 argc, CHAR* argv[])
6060
#endif
6161

6262
if (argc > 3) {
63-
if (!STRCMP(argv[3], AUDIO_CODEC_NAME_AAC)) {
64-
audioCodec = RTC_CODEC_AAC;
63+
if (!STRCMP(argv[3], AUDIO_CODEC_NAME_OPUS)) {
64+
audioCodec = RTC_CODEC_OPUS;
6565
} else {
6666
DLOGI("[KVS Gstreamer Viewer] Defaulting to Opus audio codec");
6767
}

Diff for: samples/kvsWebrtcClientMasterGstSample.c

+2-24
Original file line numberDiff line numberDiff line change
@@ -171,17 +171,6 @@ PVOID sendGstreamerAudioVideo(PVOID args)
171171
* vp8enc error-resilient=partitions keyframe-max-dist=10 auto-alt-ref=true cpu-used=5 deadline=1 !
172172
* appsink sync=TRUE emit-signals=TRUE name=appsink-video
173173
*
174-
* For H265/AAC
175-
* pipeline =
176-
* gst_parse_launch("videotestsrc pattern=ball is-live=TRUE ! timeoverlay ! queue ! videoconvert !
177-
* "video/x-raw,format=I420,width=1280,height=720,framerate=25/1 ! " "queue ! "
178-
* "x265enc speed-preset=veryfast bitrate=512 tune=zerolatency ! "
179-
* "video/x-h265,stream-format=byte-stream,alignment=au,profile=main ! appsink sync=TRUE "
180-
* "emit-signals=TRUE name=appsink-video audiotestsrc wave=triangle is-live=TRUE ! "
181-
* "queue leaky=2 max-size-buffers=400 ! audioconvert ! audioresample ! faac ! "
182-
* "capsfilter caps=audio/mpeg,mpegversion=4,stream-format=adts,base-profile=lc,channels=2,rate=48000 ! "
183-
* "appsink sync=TRUE emit-signals=TRUE name=appsink-audio",
184-
* &error);
185174
*
186175
* Raspberry Pi Hardware Encode Example
187176
* "v4l2src device=\"/dev/video0\" ! queue ! v4l2convert ! "
@@ -275,17 +264,6 @@ PVOID sendGstreamerAudioVideo(PVOID args)
275264
"audio/x-opus,rate=48000,channels=2 ! appsink sync=TRUE emit-signals=TRUE name=appsink-audio",
276265
&error);
277266

278-
} else if (pSampleConfiguration->videoCodec == RTC_CODEC_H265 && pSampleConfiguration->audioCodec == RTC_CODEC_AAC) {
279-
senderPipeline =
280-
gst_parse_launch("videotestsrc pattern=ball is-live=TRUE ! timeoverlay ! queue ! videoconvert ! "
281-
"video/x-raw,format=I420,width=1280,height=720,framerate=25/1 ! queue ! "
282-
"x265enc speed-preset=veryfast bitrate=512 tune=zerolatency ! "
283-
"video/x-h265,stream-format=byte-stream,alignment=au,profile=main ! appsink sync=TRUE "
284-
"emit-signals=TRUE name=appsink-video audiotestsrc wave=triangle is-live=TRUE ! "
285-
"queue leaky=2 max-size-buffers=400 ! audioconvert ! audioresample ! faac ! "
286-
"capsfilter caps=audio/mpeg,mpegversion=4,stream-format=adts,base-profile=lc,channels=2,rate=48000 ! "
287-
"appsink sync=TRUE emit-signals=TRUE name=appsink-audio",
288-
&error);
289267
}
290268
// TODO: test and add more such combinations
291269
break;
@@ -399,8 +377,8 @@ INT32 main(INT32 argc, CHAR* argv[])
399377

400378
if (argc > 3 && STRCMP(argv[3], "testsrc") == 0) {
401379
if (argc > 4) {
402-
if (!STRCMP(argv[4], AUDIO_CODEC_NAME_AAC)) {
403-
audioCodec = RTC_CODEC_AAC;
380+
if (!STRCMP(argv[4], AUDIO_CODEC_NAME_OPUS)) {
381+
audioCodec = RTC_CODEC_OPUS;
404382
}
405383
}
406384

Diff for: src/include/com/amazonaws/kinesis/video/webrtcclient/Include.h

-1
Original file line numberDiff line numberDiff line change
@@ -836,7 +836,6 @@ typedef enum {
836836
RTC_CODEC_ALAW = 5, //!< ALAW audio codec
837837
RTC_CODEC_UNKNOWN = 6,
838838
RTC_CODEC_H265 = 7, //!< H265 video codec
839-
RTC_CODEC_AAC = 8, //!< AAC audio codec
840839

841840
// RTC_CODEC_MAX **MUST** be the last enum in the list **ALWAYS** and not assigned a value
842841
RTC_CODEC_MAX //!< Placeholder for max number of supported codecs

0 commit comments

Comments
 (0)