본문 바로가기

프로그래밍

(287)
[WebRTC] android camera 관련 webrtc의 카메라 캡처러 부분은 아래와 같은 구조로 여러 카메라 api에 대응하도록 설계되어 있다. enumerator 의 createCapturer() 를 호출해 CameraVideoCapturer 를 생성 camera2enumerator 의 경우 Camera2Capturer 를 생성 CameraCapturer 의 startCapture() 를 호출하면 Camera2Capturer의 createCameraSession() 호출 실제 카메라 처리 부분은 CameraSession 에서 이루어지며, 캡처된 데이터는 opengl es 를 통해 렌더링 되어 CameraCapturer 에 구현되어 있는 CameraSession.Events.onFrameCaptured() 콜백으로 VideoFrame을 전달한다..
안드로이드 ndk 테스트 코드 ndk 사용해야 하는데, 사용한지 너무 오래되어 다시한번 정리 Project/app/build.gradle android { externalNativeBuild { cmake { path "CMakeLists.txt" cppFlags "-std=c++11" } } } Project/app/CMakeLists.txt cmake_minimum_required(VERSION 3.6) add_library(test-lib SHARED ./src/main/cpp/test.c) include_directories(./src/main/cpp) 클라이언트 // kotlin class Native { init { System.loadLibrary("test-lib") } external fun test(a:Int):vo..
[WebRTC] 사이멀캐스트? 네이티브를 위한 레거시 simulcast * 개인적으로 simulcast를 위한 iOS, Android 클라이언트를 구성하면서 판단한 경험에 대한 내용이라 실제 표준과 다를 수 있습니다. * 추가) 레거시 planB 는 2021년 12월말에 크롬에서 삭제될 예정 현재 웹 환경(브라우저)에서 지원하는 simulcast의 경우 unified plan기반으로 tranceiver 를 사용해 불필요한 SDP 정의를 최소화하는 것으로 변화되었다. 별다른 설정없이 tranceiver 설정에 encoding parameter만 설정하면, SDP 에 아래와 같은 문자열이 추가된다. a=rid:label1 send a=simulcast:send label1;lable2;label3 webrtc 라이브러리는 로컬, 리모트 SDP가 위와 같이 설정되면 로컬 송출 트..
[WebRTC] iOS Audio 관련 클래스 RTCPeerConnectionFactory sdk/objc/api/peerconnection/RTCPeerConnectionFactory.mm webrtc peer connection 객체를 생성하는 factory 클래스, init 시에 비디오 encoder, decoder factory 를 설정하고, audio device module 을 생성한다. 아래 함수를 통해 audio device module을 설정하게 된다. #if defined(WEBRTC_IOS) #import "sdk/objc/native/api/audio_device_module.h" #endif - (rtc::scoped_refptr)audioDevicdeModule { #if defined(WEBRTC_IOS) return we..
[iOS] CoreAudio AudioUnit Audio Unit Hosting Fundamentals (apple.com) Audio Unit Hosting Fundamentals Audio Unit Hosting Fundamentals All audio technologies in iOS are built on top of audio units, as shown in Figure 1-1. The higher-level technologies shown here—Media Player, AV Foundation, OpenAL, and Audio Toolbox—wrap audio units to provide dedicated developer.apple.com AudioUnit 은 2개의 Element 이루어져 있으며, 각 element의 inpu..
[Android] gson , 복합적인 요소의 파싱 간단히 예를 들어보자. 단일 string, string 배열 두가지 형태가 전달되는 경우 { "item":[ {"name":"kim", "phone":"1234"}, {"name":"park", "phone":["12345","67890"]} ] } POJO 클래스의 구성 자체에 문제가 생긴다. public class Item implements Serializable { private static final long serialVersionUID = -11111L; public String name; // 어느거? public String phone; public List phone; } 이와 같은 경우 별도의 serializer, deserializer 를 구성해 주어야 한다. public class..
[Android] gradle android 빌드 구성 어플리케이션 apply plugin: 'com.android.application' android.applicationVariants.all { variant -> if( variant.name == 'release' ) { parent.classpath += variant.javaCompile.classpaths } } 라이브러리 apply plugin: 'com.android.library' android.libraryVariants.all { variant -> if( variant.name == 'release' ) { parent.classpath += variant.javaCompile.classpaths } } 소스 폴더 // 소스 폴더 구성 // 빌드타입이나 falvor 에 따라 각각의 소..
[Android] ConstraintSet ConstraintSet 은 ConstraintLayout 의 각 뷰들에 대한 Constraint 정보를 담고있는 배열 레이아웃 구성시 각 뷰에 constraint 를 기술하지만 실제 데이터는 부모 ConstraintLayout 의 ConstraintSet 에 저장된다. 동적으로 코드에서 구성시 ConstraintSet 를 생성해 기존 데이터를 clone 하거나 새로 값을 입력 후 ConstraintLayout 에 적용 시켜주면 된다. https://developer.android.com/reference/android/support/constraint/ConstraintSet ConstraintSet | Android Developers ConstraintSet public class Constrain..