Skip to content

Instantly share code, notes, and snippets.

View SCG82's full-sized avatar

SCG82

  • Southern California
  • 00:02 (UTC -07:00)
View GitHub Profile
@SCG82
SCG82 / Conductor.cc
Created February 24, 2020 23:56 — forked from mysteryjeans/Conductor.cc
WebRTC Conductor using custom Audio & Video source
#include "audiorenderer.h"
#include "videorenderer.h"
#include "audiocapturemodule.h"
#include "yuvframecapture.h"
#include "conductor.h"
#include "webrtc/api/test/fakeconstraints.h"
#include "webrtc/video_encoder.h"
#include "webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.h"
@SCG82
SCG82 / AudioCaptureModule.cc
Created February 24, 2020 23:55 — forked from mysteryjeans/AudioCaptureModule.cc
WebRTC AudioDeviceModule implementation for custom source
/*
* libjingle
* Copyright 2012, Google Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
@SCG82
SCG82 / basic_client.cpp
Created April 30, 2019 09:51 — forked from zaphoyd/basic_client.cpp
An example of a basic WebSocket++ client that sends a message, waits for a response, then closes the connection
#include <websocketpp/config/asio_no_tls_client.hpp>
#include <websocketpp/client.hpp>
#include <iostream>
typedef websocketpp::client<websocketpp::config::asio_client> client;
using websocketpp::lib::placeholders::_1;
using websocketpp::lib::placeholders::_2;
@SCG82
SCG82 / common_h264_codec_strings_used_in_youtube__no_parsing.js
Created March 16, 2019 21:36
H.264 Codec String Parser (video, profile, level) - August 2017
//"avcoti" hexadecimal representation of the following three bytes in the (subset) sequence parameter set Network Abstraction Layer (NAL) unit specified in AVC: 1.profile_idc, 2.the byte containing the constraint_set flags (currently constraint_set0_flag through constraint_set5_flag, and the reserved_zero_2bits), 3.level_idc.
AVC1_CODEC_MAP = {
,"avc1.66.30": {profile:"Baseline", level:3.0, max_bit_rate:10000} //iOS friendly variation (iOS 3.0-3.1.2)
"avc1.42001e": {profile:"Baseline", level:3.0, max_bit_rate:10000}
,"avc1.42001f": {profile:"Baseline", level:3.1, max_bit_rate:14000}
//other variations
,"avc1.77.30": {profile:"Main", level:3.0, max_bit_rate:10000} //iOS friendly variation (iOS 3.0-3.1.2)
,"avc1.4d001e": {profile:"Main", level:3.0, max_bit_rate:10000}
,"avc1.4d001f": {profile:"Main", level:3.1, max_bit_rate:14000}
const shuffleArray = function(array) {
const a = array.slice();
for (let i = a.length - 1; i > 0; i--) {
const j = Math.floor(Math.random() * (i + 1));
[a[i], a[j]] = [a[j], a[i]];
}
return a;
};