This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* https://rtmp.veriskope.com/docs/spec/#531chunk-format | |
*/ | |
srs_error_t SrsProtocol::recv_interlaced_message(SrsCommonMessage** pmsg) | |
{ | |
srs_error_t err = srs_success; | |
// chunk stream basic header. | |
char fmt = 0; | |
int cid = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* https://github.com/ossrs/srs/blob/fa8096ad0117a085515729e12a3758ca26036552/trunk/src/protocol/srs_protocol_rtmp_handshake.hpp#L401-L431 | |
*/ | |
// Simple handshake. | |
// user can try complex handshake first, | |
// rollback to simple handshake if error ERROR_RTMP_TRY_SIMPLE_HS | |
class SrsSimpleHandshake | |
{ | |
public: | |
SrsSimpleHandshake(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* https://github.com/ossrs/srs/blob/fa8096ad0117a085515729e12a3758ca26036552/trunk/src/protocol/srs_protocol_rtmp_stack.cpp#L843-L924 | |
*/ | |
/** | |
* 6.1.1. Chunk Basic Header | |
* The Chunk Basic Header encodes the chunk stream ID and the chunk | |
* type(represented by fmt field in the figure below). Chunk type | |
* determines the format of the encoded message header. Chunk Basic | |
* Header field may be 1, 2, or 3 bytes, depending on the chunk stream | |
* ID. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required (VERSION 2.8) | |
cmake_policy(VERSION 2.8) | |
project (GStreamerTest) | |
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/) | |
find_package(GLib) | |
if (GLib_FOUND) | |
message(STATUS "GLIB 2.0 FOUND!!") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# use pkg-config system | |
find_package(PkgConfig QUIET) | |
# FIND_GLIB_COMPONENT macro | |
macro(FIND_GLIB_COMPONENT _component_prefix _pkgconfig_name _library) | |
pkg_check_modules(PC_${_component_prefix} ${_pkgconfig_name}) | |
set(${_component_prefix}_INCLUDE_DIRS ${PC_${_component_prefix}_INCLUDE_DIRS}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// editText -> unfocusable EditText | |
// customeKeyboardView -> simulated keyboard | |
// inputDelegateView -> Delegate system keyboard input to EditText | |
func wireUpConnections() { | |
val inputConnection = editText.onCreateInputConnection(EditorInfo()) | |
customeKeyboardView.inputConnection = inputConnection | |
val keyboardInputConnection = editText.onCreateInputConnection(EditorInfo()) | |
inputDelegateView.delegateConnection = keyboardInputConnection | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CustomKeyboardView @JvmOverloads constructor(context: Context, | |
attrs: AttributeSet? = null, | |
defStyle: Int = 0, | |
defStyleRes: Int = 0) : | |
ViewGroup(context, attrs, defStyle, defStyleRes) { | |
var inputConnection: InputConnection? = null | |
private val childViews: Array<View> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class InputDelegateView @JvmOverloads constructor(context: Context, | |
attrs: AttributeSet? = null, | |
defStyle: Int = 0, | |
defStyleRes: Int = 0): | |
View(context, attrs, defStyle, defStyleRes) { | |
var delegateConnection: InputConnection? = null | |
init { | |
isFocusable = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension CGDirectDisplayID { | |
func getIOService() -> io_service_t { | |
var serialPortIterator = io_iterator_t() | |
var ioServ: io_service_t = 0 | |
let matching = IOServiceMatching("IODisplayConnect") | |
let kernResult = IOServiceGetMatchingServices(kIOMasterPortDefault, matching, &serialPortIterator) | |
if KERN_SUCCESS == kernResult && serialPortIterator != 0 { | |
ioServ = IOIteratorNext(serialPortIterator) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private lazy var audioInputVolumeListener: AudioObjectPropertyListenerBlock = { | |
return { _, _ in | |
// report self.getDefaultAudioInputVolume() | |
} | |
}() | |
private func listenDefaultAudioInputVolume() { | |
var audioVolumeAddr = AudioObjectPropertyAddress( | |
mSelector: kAudioHardwareServiceDeviceProperty_VirtualMasterVolume, | |
mScope: kAudioObjectPropertyScopeInput, |
NewerOlder