aizvorski / h264bitstream

A complete set of functions to read and write H.264 video bitstreams, in particular to examine or modify headers.
GNU Lesser General Public License v2.1
732 stars 238 forks source link

platform support #35

Open blacktrain opened 5 years ago

blacktrain commented 5 years ago

could we compile by mingw for ms windows? if not,could we support cmake?

in addition,compile on centos 6.7 with gcc 4.4.7(which have not full support for c99)will result in some error,that's this version of gcc doesn't supoort anonymous union,below is part of compile error: h264_stream.h:199: warning: declaration does not declare anything h264_stream.c: In function ‘read_subset_seq_parameter_set_rbsp’: h264_stream.c:504: error: ‘sps_subset_t’ has no member named ‘sps_svc_ext’ h264_stream.c: In function ‘read_seq_parameter_set_svc_extension’: h264_stream.c:529: error: ‘sps_subset_t’ has no member named ‘sps_svc_ext’ h264_stream.c: In function ‘read_pic_parameter_set_rbsp’: h264_stream.c:771: warning: suggest parentheses around comparison in operand of ‘|’ h264_stream.c: In function ‘read_slice_header_in_scalable_extension’: h264_stream.c:1334: error: ‘sps_subset_t’ has no member named ‘sps_svc_ext’ h264_stream.c:1371: error: ‘sps_subset_t’ has no member named ‘sps_svc_ext’ we can fix this issue by modify configure.ac modify EXTRA_CFLAGS='-std=c99 -Wno-error' to EXTRA_CFLAGS='-std=gnu99 -Wno-error'

LostInKadath commented 10 months ago

Since #53 has been merged, building with CMake is supported. =)

I've also tried to build the project with MSYS2 gcc-13.2.0 using CMake and Ninja generator on Windows:

cmake -S . -B .build -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=gcc
cd .build
ninja -v

Everything works ok for me.