Sony Ericsson MW600의 실신

한달여 동안 잘 샀다고만 생각해 왔던 MW600 bluetooth headset이 고장나고 말았다. 충전기에 꽂았는데 charging 할 때 깜빡이는 battery 그림이 움직이지 않아서 끄려고 전원 버튼을 눌렀는데 꿈쩍도 않는다.

락업된상태로 계속 남아있는데 인터넷을 찾아보니 같은 증상을 겪은 사람들이 꽤나 많았다. 인터넷에서 구할 수 있는 이 문제에 대한 해결 책은 두가지 인데 하나는 전원이 다 될 때까지 기다렸다가 켜는 것이고 다른 하나는 분해 해서 베터리를 단락 시키는 것이다.

두 번째 방법이 빠르고 효과가 확실하지만, 출장중이어서 작은 일자 드라이버가 없기 때문에 그냥 베터리가 다 닳을 때까지 기다리기로 했다. 액정이 계속 켜진상태에서 락업된 것 때문인지 다음날 아침에는 베터리가 다 닳아 있었다.

전원을 연결하니 다행히 부활. lol

하드 리셋 버튼 하나 달아주지 이넘들 자신감 하고는…

Ubuntu 12.04의 airvideo property

Airvideo설정을 위한 property file을 여기에 기록해 둔다.

대부분의 한국어 자막파일은 windows에서 작성되므로 encoding을 euc-kr로 설정하고, 12.04에 기본으로 들어 있는 undotum으로 font를 설정했다.

Airvideo client에서 보여줄 위치를 선언하는 folders 항목은 영화를 올려두는 Movies와 외장 하드를  경로로 넣어준다.

path.ffmpeg = /usr/local/bin/ffmpeg
path.mp4creator = /usr/local/bin/mp4creator
path.faac = /usr/local/bin/faac
password = 1234
subtitles.encoding = euc-kr
subtitles.font = undotum
folders = Movies:/media/data_/Movies,Extern:/media/untitled

 

mpeg4ip-1.5.0.1을 ubuntu 12.04에서 컴파일 하기 2 – 패치 내용 정리

다음은 mpeg4ip가 gcc/g++ 4.4에서 빌드되도록 하기 위해 빌드 오류를 수정한 내역에 대한 설명이다. 작성된 패치 및 적용하는 방법은 “mpeg4ip-1.5.0.1을 ubuntu 12.04에서 컴파일 하기 1“를 참고.

bootstrap script 수정

bootstrap command를 수행하면 configure를 수행해 주는데 다음과 같은 에러가 나온다.

mpeg4ip-1.5.0.1$ ./bootstrap --disable-player
dir: .
SDL appears to be installed
./bootstrap: 77: ./bootstrap: Syntax error: Bad fd number

faac까지 모두 설치되고 ldconfig를 수행한 상태이므로 faac가 잘 동작하는 상태라고 가정하고 다음 부분을 comment-out 한다.

if test $target_system = "Linux"; then
    have_faac=no
    if which faac >/dev/null 2>/dev/null; then
        have_faac=yes
    fi  

#    if test $have_faac = "yes"; then정
#       # we have lame and faac - see if faac is built with mp4 support
#       faac --help >&faac_help
#       sdf=`grep "MP4 support unavailable" faac_help`
#       rm -f faac_help
#       if test -z "$sdf"; then
#           if which mpeg4ip-config >/dev/null 2>/dev/null; then
#               echo "Warning - faac uses libmp4v, but we've detected a version"
#               echo "of mpeg4ip.  If you get errors building mp4live, please"
#               echo "rebuild faac without mp4v2 support"
#           else
#               echo "Error - we have detected a version of faac that has libmp4v2 support"
#               echo "and no copy of mpeg4ip-config.  This means faac was built with"
#               echo "faad2 and the libraries will be incompatible".
#               echo "Please reinstall faac without mp4v2 support"
#               exit 1
#           fi
#       fi
#    fi
fi
set -x

Compile Errors 수정

error: ambiguates old declaration ‘const char* strcasestr(const char*, const char*)’

 : /usr/include/string.h에 정의된 것과 mpeg4ip의 include/mpeg4ip.h에서 정의하고 있는 function signature가 서로 다르게 때문이다. 다음과 같이 mpeg4ip.h의 선언 부분을 막아준다.

#ifdef __cplusplus
extern "C" {
#endif
//char *strcasestr(const char *haystack, const char *needle);
#ifdef __cplusplus
}
#endif

error: invalid conversion from ‘const char*’ to ‘char*’

 : 간단하게 type casting으로 (char*)를 붙여서 막는다. function signature를 고치는게 더 바람직 할것 같다고 생각했으나, 일부 header file들은 c와 c++에서 함께 불리기 때문에 const string으로 변경하면 c compiler에서 오류가 생긴다. signature는 그냥 두고, caller쪽에서 type casting을 해주는 것이 더 편한 방법이 될 것 같다.

error: dereferencing type-punned pointer will break strict-aliasing rules

 : lib/rtp/Makefile의 CFLAGS에 -fno-strict-aliasing를 추가한다. 이 Makefile은 bootstrap을 실행해야 생성되는 것임에 주의.

CC = gcc 
CCDEPMODE = depmode=gcc3
CFLAGS = -g -O2 -Wall -Werror -W  -Wmissing-prototypes -Wmissing-declarations -Wbad-function-cast -Wwrite-strings -Wformat=2 -fno-strict-aliasing
CPP = gcc -E
CPPFLAGS =

fatal error: istream.h: No such file or directory

 : 몇몇 컴파일러에서는 ISO compliant 파일인 iostream을 사용하도록 장려된다고 한다 (참조).  entropy.hpp와 bitstrm.hpp의 해당 부분을 iostream으로 대체하고, using 구문을 추가해 준다.
common/video/iso-mpeg4/include/entropy.hpp

#ifndef __ENTROPY_HPP_
#define __ENTROPY_HPP_
#include <iostream>
//#include <istream.h>
//#include <ostream.h>

using std::istream;
using std::ostream;

common/video/iso-mpeg4/include/bitstrm.hpp

#include <iostream>
#include "inbits.h"
//#include <istream.h>
//#include <ostream.h>

error: suggest parentheses around ‘&&’ within ‘||’

 : 오류가 난 라인을 찾아가서 조건문에 괄호를 붙여 준다.

error: suggest explicit braces to avoid ambiguous ‘else’

 : 표시된 라인을 찾아가서 중괄호를 붙여 준다.

error: iostream.h: No such file or directory

 : iostream.h로 #include한 구문을 찾지 못하는 문제. 어느 c++ 책에서 읽은 기억이 있는데, include되는 것을 file별로 구분하는 것은 컴파일러의 구현에 따라 달라질 수 있는 사항이어서 실제로 파일별로 존재할 수도 있고 그렇지 않을 수도 있다. 따라서 .h를 명시하지 않는 것이 추천되는 방법이라고 했던 기억이 난다. 오류난 곳을 찾아 #include <iostream>으로 변경해 준다. fstream.h에 대해서도 동일하게 #include <fstream>으로 변경해 준다.

error: ‘vctCandMV2’ may be used uninitialized in this function

 : Class가 초기화 되지 않고 사용되었다는 오류이다. 실제로는 생성자를 불러줘야 하지만, 사용법을 모르니 그냥 common/video/iso-mpeg4/src/Makefile의 BILLS_CPPWARNINGS와 BILL_CWARNINGS에서 -Wall option을 삭제 한다.

//BILLS_CPPWARNINGS = -Wall -Wno-char-subscripts -Woverloaded-virtual -Wno-unknown-pragmas -Wno-deprecated -Wformat=2
BILLS_CPPWARNINGS = -Wno-char-subscripts -Woverloaded-virtual -Wno-unknown-pragmas -Wno-deprecated -Wformat=2
//BILLS_CWARNINGS = -Wall -Wmissing-prototypes -Wmissing-declarations -Wno-char-subscripts -Wno-unknown-pragmas -Wformat=2
BILLS_CWARNINGS = -Wmissing-prototypes -Wmissing-declarations -Wno-char-subscripts -Wno-unknown-pragmas -Wformat=2

error: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result

 : -Werror가 선언되어 있으면, 이것을 오류로 보고 한다. common/video/iso-mpeg4/src/Makefile의 AM_CXXFLAGS에서 -Wall과 -Werror를 삭제한다.

//AM_CXXFLAGS = -D__TRACE_AND_STATS_ -D__DOUBLE_PRECISION_ -D_REENTRANT -DNOCONTROLS -fexceptions -Wall -Werror -D_OBSS_ -Wall -Wno-char-subscripts -Woverloaded-virtual -Wno-unknown-pragmas -Wno-deprecated -Wformat=2
AM_CXXFLAGS = -D__TRACE_AND_STATS_ -D__DOUBLE_PRECISION_ -D_REENTRANT -DNOCONTROLS -fexceptions -D_OBSS_ -Wno-char-subscripts -Woverloaded-virtual -Wno-unknown-pragmas -Wno-deprecated -Wformat=2

* 만들어진 패치와 그것을 적용하는 방법에 대해서는 “mpeg4ip-1.5.0.1을 ubuntu 12.04에서 컴파일 하기 1“을 참조.