6월, 2014의 게시물 표시

std::string::find(...) 사용시 실수..

bool DoTest() {     std::string temp("TEST0006.ts");     if (temp.find("TEST") == 0 && temp.find(".m3u8") > 0) {         return true;     }     return false; } 위 함수를 수행하면 결과는? 결과는 false를 예상했지만... true 가 나온다. 왜? temp.find(".m3u8") 이 -1 이 나오니까 false가 나올꺼 같은데... c++ standard를 찾아보니...     size_type find(const _CharT* __s, size_type __pos = 0) const { ...} 으로 되어 있다. size_type을 찾아보니.. unsigned integral type 이다. unsigned int에서 -1은 최대값 65535이므로 true가 맞다. 앞으론 실수하지 않아야겠다.. -_-;;

gstreamer debug log 출력하는 방법

gstreamer 이용한 실행 파일 실행 전에 $ export GST_DEBUG=[Level] Level = 1 : GST_ERROR()  Level = 2 : Level 1 + GST_WARNING() Level = 3 : Level 2 + GST_INFO() Level = 4 : Level 3 + GST_DEBUG() Level = 5 : outputs everything 을 입력 후 실행