Skip to content

Commit

Permalink
Add codecov token
Browse files Browse the repository at this point in the history
  • Loading branch information
disa6302 committed Apr 30, 2024
1 parent aec05b5 commit e2e7d1d
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 16 deletions.
1 change: 1 addition & 0 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ jobs:
runs-on: ubuntu-20.04
env:
AWS_KVS_LOG_LEVEL: 2
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
permissions:
id-token: write
contents: read
Expand Down
7 changes: 3 additions & 4 deletions samples/Common.c
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,7 @@ VOID sampleSenderBandwidthEstimationHandler(UINT64 customData, UINT32 txBytes, U

currentTimeMs = GETTIME();
timeDiff = currentTimeMs - pSampleStreamingSession->twccMetadata.lastAdjustmentTimeMs;
if (timeDiff < TWCC_BITRATE_ADJUSTMENT_INTERVAL_SECONDS) {
if (timeDiff < TWCC_BITRATE_ADJUSTMENT_INTERVAL_MS) {
// Too soon for another adjustment
return;
}
Expand Down Expand Up @@ -768,9 +768,8 @@ VOID sampleSenderBandwidthEstimationHandler(UINT64 customData, UINT32 txBytes, U

pSampleStreamingSession->twccMetadata.lastAdjustmentTimeMs = currentTimeMs;

DLOGD("Adjustment made: average packet loss = %.2f%%, timediff: %llu ms", pSampleStreamingSession->twccMetadata.averagePacketLoss,
TWCC_BITRATE_ADJUSTMENT_INTERVAL_SECONDS, timeDiff);
DLOGD("Suggested video bitrate %u kbps, suggested audio bitrate: %u bps, sent: %u bytes %u packets received: %u bytes %u packets in %lu msec",
DLOGI("Adjustment made: average packet loss = %.2f%%, timediff: %llu ms", pSampleStreamingSession->twccMetadata.averagePacketLoss, timeDiff);
DLOGI("Suggested video bitrate %u kbps, suggested audio bitrate: %u bps, sent: %u bytes %u packets received: %u bytes %u packets in %lu msec",
videoBitrate, audioBitrate, txBytes, txPacketsCnt, rxBytes, rxPacketsCnt, duration / 10000ULL);
}

Expand Down
10 changes: 5 additions & 5 deletions samples/Samples.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,11 @@ extern "C" {
#define MAX_SIGNALING_CLIENT_METRICS_MESSAGE_SIZE 736 // strlen(SIGNALING_CLIENT_METRICS_JSON_TEMPLATE) + 20 * 10
#define MAX_ICE_AGENT_METRICS_MESSAGE_SIZE 113 // strlen(ICE_AGENT_METRICS_JSON_TEMPLATE) + 20 * 2

#define TWCC_BITRATE_ADJUSTMENT_INTERVAL_SECONDS 1 * HUNDREDS_OF_NANOS_IN_A_SECOND
#define MIN_VIDEO_BITRATE_KBPS 512 // Unit kilobits/sec. Value could change based on codec.
#define MAX_VIDEO_BITRATE_KBPS 2048000 // Unit kilobits/sec. Value could change based on codec.
#define MIN_AUDIO_BITRATE_BPS 4000 // Unit bits/sec. Value could change based on codec.
#define MAX_AUDIO_BITRATE_BPS 650000 // Unit bits/sec. Value could change based on codec.
#define TWCC_BITRATE_ADJUSTMENT_INTERVAL_MS 1000 * HUNDREDS_OF_NANOS_IN_A_MILLISECOND
#define MIN_VIDEO_BITRATE_KBPS 512 // Unit kilobits/sec. Value could change based on codec.
#define MAX_VIDEO_BITRATE_KBPS 2048000 // Unit kilobits/sec. Value could change based on codec.
#define MIN_AUDIO_BITRATE_BPS 4000 // Unit bits/sec. Value could change based on codec.
#define MAX_AUDIO_BITRATE_BPS 650000 // Unit bits/sec. Value could change based on codec.

typedef enum {
SAMPLE_STREAMING_VIDEO_ONLY,
Expand Down
20 changes: 13 additions & 7 deletions samples/kvsWebRTCClientMasterGstSample.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,18 +199,22 @@ PVOID sendGstreamerAudioVideo(PVOID args)
switch (pSampleConfiguration->srcType) {
case TEST_SOURCE: {
senderPipeline = gst_parse_launch(
"videotestsrc pattern=ball is-live=TRUE ! queue ! videoconvert ! video/x-raw,width=1280,height=720,framerate=25/1 ! "
"videotestsrc pattern=ball is-live=TRUE ! "
"queue ! videoconvert ! videoscale ! video/x-raw,width=1280,height=720 ! "
"clockoverlay halignment=right valignment=top time-format=\"%Y-%m-%d %H:%M:%S\" ! "
"videorate ! video/x-raw,framerate=25/1 ! "
"x264enc name=sampleVideoEncoder bframes=0 speed-preset=veryfast bitrate=512 byte-stream=TRUE tune=zerolatency ! "
"video/x-h264,stream-format=byte-stream,alignment=au,profile=baseline ! appsink sync=TRUE emit-signals=TRUE "
"name=appsink-video",
"video/x-h264,stream-format=byte-stream,alignment=au,profile=baseline ! "
"appsink sync=TRUE emit-signals=TRUE name=appsink-video",
&error);
break;
}
case DEVICE_SOURCE: {
senderPipeline = gst_parse_launch(
"autovideosrc ! queue ! videoconvert ! video/x-raw,width=1280,height=720,framerate=25/1 ! "
"x264enc name=sampleVideoEncoder bframes=0 speed-preset=veryfast bitrate=512 byte-stream=TRUE tune=zerolatency ! "
"video/x-h264,stream-format=byte-stream,alignment=au,profile=baseline ! appsink sync=TRUE "
"video/x-h264,stream-format=byte-stream,alignment=au,profile=baseline ! "
" appsink sync=TRUE "
"emit-signals=TRUE name=appsink-video",
&error);
break;
Expand Down Expand Up @@ -240,10 +244,12 @@ PVOID sendGstreamerAudioVideo(PVOID args)
switch (pSampleConfiguration->srcType) {
case TEST_SOURCE: {
senderPipeline = gst_parse_launch(
"videotestsrc pattern=ball is-live=TRUE ! queue ! videoconvert ! video/x-raw,width=1280,height=720,framerate=25/1 ! "
"videotestsrc pattern=ball is-live=TRUE ! "
"queue ! videorate ! videoscale ! videoconvert ! video/x-raw,width=1280,height=720,framerate=25/1 ! "
"clockoverlay halignment=right valignment=top time-format=\"%Y-%m-%d %H:%M:%S\" ! "
"x264enc name=sampleVideoEncoder bframes=0 speed-preset=veryfast bitrate=512 byte-stream=TRUE tune=zerolatency ! "
"video/x-h264,stream-format=byte-stream,alignment=au,profile=baseline ! appsink sync=TRUE "
"emit-signals=TRUE name=appsink-video audiotestsrc wave=ticks is-live=TRUE ! "
"video/x-h264,stream-format=byte-stream,alignment=au,profile=baseline ! "
"appsink sync=TRUE emit-signals=TRUE name=appsink-video audiotestsrc wave=ticks is-live=TRUE ! "
"queue leaky=2 max-size-buffers=400 ! audioconvert ! audioresample ! opusenc name=sampleAudioEncoder ! "
"audio/x-opus,rate=48000,channels=2 ! appsink sync=TRUE emit-signals=TRUE name=appsink-audio",
&error);
Expand Down

0 comments on commit e2e7d1d

Please sign in to comment.