본문 바로가기

전체 글27

injecting XML(Document) into SOAP body(SOAPBody) XML 데이터를 SOAP Body에 넣기 public static SOAPMessage makeSoapRequest(Document document)throws Exception {MessageFactory messageFactory = MessageFactory.newInstance(SOAPConstants.DEFAULT_SOAP_PROTOCOL);SOAPMessage soapMessage = messageFactory.createMessage();SOAPPart soapPart = soapMessage.getSOAPPart(); SOAPEnvelope envelope = soapPart.getEnvelope();SOAPBody soapBody = envelope.getBody();soapBody.ad.. 2016. 11. 15.
Convert date(String) to XMLGregorianCalendar String형의 일시를 XMLGregorianCalendar의 인스턴스로 변환 /** * * @param strDate Date(Date format: yyyy-MM-dd hh:mm:ss(e.g. 2016-11-15 09:30:01)) * @return instance of the XMLGregorianCalendar(Saved date: 2016-11-15T09:30:01) * @throws ParseException * @throws DatatypeConfigurationException */public static XMLGregorianCalendar strDateToXMLGregorianCalendar(String strDate)throws ParseException, DatatypeConfigu.. 2016. 11. 15.
HLS(HTTP Live Streaming) - HTTP Streaming Architecture HTTP Streaming Architecture HTTP Live Streaming(HLS)은 일반적인 서버로 HTTP 기반 재생을 위해 오디오와 비디오를 전송할 수 있다. Live broadcast와 Prerecorded content(Video on demand)를 지원한다. Different bit rates로 Multiple alternate streams을 지원한다, 그리고 클라이언트 소프트웨어는 네트워크 Bandwidth에 따라 스트림을 지능적으로 변경(Switch)한다. 또한, HLS는 Publisher가 그들의 저작물을 보호할 수 있도록 HTTPS 에서 Media encryption과 User authentication을 제공한다. HLS는 3가지의 파트로 구성된다. - Server co.. 2016. 4. 8.
Ubuntu에서 Apache Web Server와 Apache Tomcat 설치 및 연결 # Ubuntu에서 Apache Web Server와 Apache Tomcat 설치 및 연결 1. Ubuntu를 설치한다. - 설치한 버전은 14.04.04 Desktop 64bit 이다. 2. Ubuntu 관리자(Root) 계정의 패스워드 설정한다. - Terminal에서 passwd 명령어로 설정한다. - e.g. sudo passwd root ※ 갑자기 sudo, su가 무엇이냐? passwd 명령어로 관리자 계정의 패스워드를 설정하기 위해서는 관리자 권한이 필요하다. sudo, su는 관리지 권한을 획득하기 위한 명령이다. sudo는 Super User DO, 그리고 su는 Super User의 약자이다. sudo는 수행하려는 명령을 관리자 권한으로 수행할 때 사용하고, su는 현재 쉘에 관리자 .. 2016. 4. 7.
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.