본문 바로가기

development5

Custom IO-Context of FFmpeg 구현 FFmpeg에 Custom File IO를 추가하여 콘텐츠 데이터를 직접 전해주기 FFmpeg을 통해 콘텐츠를 디코딩할 때 libavformat에서 제공하는 avformat_open_input() 메소드에 콘텐츠의 경로를 설정하는 것이 일반적이다. 이렇게 하면 libavformat에서 알아서 경로의 콘텐츠 데이터를 읽어간다. 만약, libavformat에 직접 콘텐츠의 데이터를 제공하고 싶다면 어떻게 해야할까?(내가 만든 IO를 통해서 데이터를 읽어갈 수 있도록) 구글링을 열심히해서 Code Project에 관련 글을 찾았다. @ Creating Custom FFmpeg IO-Context http://www.codeproject.com/Tips/489450/Creating-Custom-FFmpeg-IO.. 2015. 1. 28.
화면 크기에 맞는 영상 크기 구하기 미디어 플레이어 관련 개발을 하다보면 콘텐츠의 Video 크기를미디어 플레이어의 화면 사이즈와 콘텐츠의 Video 비율에 맞게 조정할 필요가 있다.아래는 위 요구에 맞게 구현한 코드다. void adjustVideoSize(int viewWidth,int viewHeight,int videoWidth,int videoHeight,int *adjustedVideoWidth,int *adjustedVideoHeight) { // Get GCD of videoint gcd; {int max, min; if (videoWidth > videoHeight) {max = videoHeight;min = videoWidth;} else {max = videoWidth;min = videoHeight;} int tem.. 2015. 1. 23.
[SDL] 오디오 볼륨 조절하기 SDL에서 오디오 볼륨 조절하기 아래의 SDL_MixAudioFormat() function을 사용하면 된다. 좀더 자세한 내용은 SDL Wiki를 참고한다. void SDL_MixAudioFormat(Uint8* dst, const Uint8* src, SDL_AudioFormat format, Uint32 len, int volume) 아래는 예제 코드라고 하기에는 좀 그렇고 SDL_MixAudioFormat () function을 사용한 코드다. #include "SDL_audio.h" // SDL_MIX_MAXVOLUME is 128. int audioVolume = (SDL_MIX_MAXVOLUME / (float) 100) * ; // SDL_MixAudioFormat() controls th.. 2015. 1. 14.
데이터 타입 크기와 signed/unsigned 체크 방법 1. 아래의 코드를 헤더 파일에 정의하고 #if !defined(DC__TEST_TYPE_SIZE) #define DC__TEST_TYPE_SIZE(_type, _size) \ typedef int DC__TEST_TYPE_SIZE_##_type[(sizeof(_type) == (_size)) ? 1 : -1] #endif #if !defined(DC__TEST_TYPE_IS_SIGNED) #define DC__TEST_TYPE_IS_SIGNED(_type) \ typedef int DC__TEST_TYPE_IS_SIGNED_##_type[((_type)((_type)1 2014. 12. 16.
JDK7 환경에서 Android APK 수동 서명 Android APK 파일을 수동으로 서명할 때, JDK7 환경에서 수행하면 Lollipop 이전 버전에서는 APK를 설치할 때 Certificate 관련 에러가 발생한다.(JDK7을 베이스로 하는 Lollipop 이상에서는 잘된다.) 이것은 JDK6와 JDK7의 Digest 알고리즘의 차이로 발생하는 문제이다. 참고로, JDK6는 SHA1withDSA, JDK7은 SHA-256을 사용한다. 해결 방법은 서명할 때 아래의 옵션을 추가하자. "-sigalg MD5withRSA -digestalg SHA1" ex) $ jarsigner -verbose -sigalg MD5withRSA -digestalg SHA1 -keystore [release_key_location]/release-key.store -s.. 2014. 12. 14.