From 1cf6e7dd37c6613c04a8afccaa51be603587380b Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Fri, 29 Jul 2011 12:01:37 +0200 Subject: [PATCH 01/10] mpegenc: remove disabled code --- libavformat/mpegenc.c | 116 ------------------------------------------ 1 file changed, 116 deletions(-) diff --git a/libavformat/mpegenc.c b/libavformat/mpegenc.c index 7bcf289c07..ecb7cdaeb2 100644 --- a/libavformat/mpegenc.c +++ b/libavformat/mpegenc.c @@ -378,14 +378,6 @@ static int mpeg_mux_init(AVFormatContext *ctx) av_log(ctx, AV_LOG_WARNING, "VBV buffer size not set, muxing may fail\n"); stream->max_buffer_size = 230*1024; //FIXME this is probably too small as default } -#if 0 - /* see VCD standard, p. IV-7*/ - stream->max_buffer_size = 46 * 1024; - else - /* This value HAS to be used for SVCD (see SVCD standard, p. 26 V.2.3.2). - Right now it is also used for everything else.*/ - stream->max_buffer_size = 230 * 1024; -#endif s->video_bound++; break; case AVMEDIA_TYPE_SUBTITLE: @@ -531,92 +523,6 @@ static int get_vcd_padding_size(AVFormatContext *ctx, int64_t pts) } -#if 0 /* unused, remove? */ -/* return the exact available payload size for the next packet for - stream 'stream_index'. 'pts' and 'dts' are only used to know if - timestamps are needed in the packet header. */ -static int get_packet_payload_size(AVFormatContext *ctx, int stream_index, - int64_t pts, int64_t dts) -{ - MpegMuxContext *s = ctx->priv_data; - int buf_index; - StreamInfo *stream; - - stream = ctx->streams[stream_index]->priv_data; - - buf_index = 0; - if (((s->packet_number % s->pack_header_freq) == 0)) { - /* pack header size */ - if (s->is_mpeg2) - buf_index += 14; - else - buf_index += 12; - - if (s->is_vcd) { - /* there is exactly one system header for each stream in a VCD MPEG, - One in the very first video packet and one in the very first - audio packet (see VCD standard p. IV-7 and IV-8).*/ - - if (stream->packet_number==0) - /* The system headers refer only to the stream they occur in, - so they have a constant size.*/ - buf_index += 15; - - } else { - if ((s->packet_number % s->system_header_freq) == 0) - buf_index += s->system_header_size; - } - } - - if ((s->is_vcd && stream->packet_number==0) - || (s->is_svcd && s->packet_number==0)) - /* the first pack of each stream contains only the pack header, - the system header and some padding (see VCD standard p. IV-6) - Add the padding size, so that the actual payload becomes 0.*/ - buf_index += s->packet_size - buf_index; - else { - /* packet header size */ - buf_index += 6; - if (s->is_mpeg2) { - buf_index += 3; - if (stream->packet_number==0) - buf_index += 3; /* PES extension */ - buf_index += 1; /* obligatory stuffing byte */ - } - if (pts != AV_NOPTS_VALUE) { - if (dts != pts) - buf_index += 5 + 5; - else - buf_index += 5; - - } else { - if (!s->is_mpeg2) - buf_index++; - } - - if (stream->id < 0xc0) { - /* AC-3/LPCM private data header */ - buf_index += 4; - if (stream->id >= 0xa0) { - int n; - buf_index += 3; - /* NOTE: we round the payload size to an integer number of - LPCM samples */ - n = (s->packet_size - buf_index) % stream->lpcm_align; - if (n) - buf_index += (stream->lpcm_align - n); - } - } - - if (s->is_vcd && (stream->id & 0xe0) == AUDIO_ID) - /* The VCD standard demands that 20 zero bytes follow - each audio packet (see standard p. IV-8).*/ - buf_index+=20; - } - return s->packet_size - buf_index; -} -#endif - /* Write an MPEG padding packet header. */ static void put_padding_packet(AVFormatContext *ctx, AVIOContext *pb,int packet_bytes) { @@ -982,28 +888,6 @@ static void put_vcd_padding_sector(AVFormatContext *ctx) s->packet_number++; } -#if 0 /* unused, remove? */ -static int64_t get_vcd_scr(AVFormatContext *ctx,int stream_index,int64_t pts) -{ - MpegMuxContext *s = ctx->priv_data; - int64_t scr; - - /* Since the data delivery rate is constant, SCR is computed - using the formula C + i * 1200 where C is the start constant - and i is the pack index. - It is recommended that SCR 0 is at the beginning of the VCD front - margin (a sequence of empty Form 2 sectors on the CD). - It is recommended that the front margin is 30 sectors long, so - we use C = 30*1200 = 36000 - (Note that even if the front margin is not 30 sectors the file - will still be correct according to the standard. It just won't have - the "recommended" value).*/ - scr = 36000 + s->packet_number * 1200; - - return scr; -} -#endif - static int remove_decoded_packets(AVFormatContext *ctx, int64_t scr){ // MpegMuxContext *s = ctx->priv_data; int i; From 07e3f9af9fc0d21682ab248c3ece99228d57b09f Mon Sep 17 00:00:00 2001 From: Mans Rullgard Date: Wed, 18 Jul 2012 20:40:38 +0100 Subject: [PATCH 02/10] configure: set icc_version where it is needed This variable is only used once, so setting it there is clearer. Signed-off-by: Mans Rullgard --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index 6760c0ee43..9e65bc4645 100755 --- a/configure +++ b/configure @@ -1974,7 +1974,6 @@ elif $cc -v 2>&1 | grep -qi ^gcc; then elif $cc --version 2>/dev/null | grep -q Intel; then cc_type=icc cc_ident=$($cc --version | head -n1) - icc_version=$($cc -dumpversion) CC_DEPFLAGS='-MMD' AS_DEPFLAGS='-MMD' speed_cflags='-O3' @@ -3146,6 +3145,7 @@ if enabled icc; then # icc 11.0 and 11.1 work with ebp_available, but don't pass the test enable ebp_available if enabled x86_32; then + icc_version=$($cc -dumpversion) test ${icc_version%%.*} -ge 11 && check_cflags -falign-stack=maintain-16-byte || disable aligned_stack From cd52ec95bb2bf4c5dd9787451800e5dbe0a4b949 Mon Sep 17 00:00:00 2001 From: Mans Rullgard Date: Fri, 20 Jul 2012 12:02:29 +0100 Subject: [PATCH 03/10] configure: remove filter_cppflags This is not used and the current design would not work properly if mixing tools needing different filters. Signed-off-by: Mans Rullgard --- configure | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/configure b/configure index 9e65bc4645..5e0865568c 100755 --- a/configure +++ b/configure @@ -585,7 +585,7 @@ prepend(){ } add_cppflags(){ - append CPPFLAGS $($filter_cppflags "$@") + append CPPFLAGS "$@" } add_cflags(){ @@ -676,7 +676,6 @@ check_code(){ check_cppflags(){ log check_cppflags "$@" - set -- $($filter_cppflags "$@") check_cc "$@" < #if !($condition) #error "unsatisfied condition: $condition" @@ -1948,7 +1947,6 @@ fi filter_asflags=echo filter_cflags=echo -filter_cppflags=echo if $cc -v 2>&1 | grep -q '^gcc.*LLVM'; then cc_type=llvm_gcc From 01d31e16f1f430fbbd77ee5ffb82d6dd99167bd7 Mon Sep 17 00:00:00 2001 From: Mans Rullgard Date: Fri, 20 Jul 2012 12:02:18 +0100 Subject: [PATCH 04/10] configure: name some variables more consistently Name variables pertaining to various types of flags with 'cflags' etc as prefix instead of suffix. Signed-off-by: Mans Rullgard --- configure | 82 +++++++++++++++++++++++++++---------------------------- 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/configure b/configure index 5e0865568c..4907c75505 100755 --- a/configure +++ b/configure @@ -589,11 +589,11 @@ add_cppflags(){ } add_cflags(){ - append CFLAGS $($filter_cflags "$@") + append CFLAGS $($cflags_filter "$@") } add_asflags(){ - append ASFLAGS $($filter_asflags "$@") + append ASFLAGS $($asflags_filter "$@") } add_ldflags(){ @@ -656,7 +656,7 @@ check_ld(){ for f; do test "${f}" = "${f#-l}" && flags="$flags $f" || libs="$libs $f" done - check_cc $($filter_cflags $flags) || return + check_cc $($cflags_filter $flags) || return check_cmd $ld $LDFLAGS $flags -o $TMPE $TMPO $libs $extralibs } @@ -683,7 +683,7 @@ EOF check_cflags(){ log check_cflags "$@" - set -- $($filter_cflags "$@") + set -- $($cflags_filter "$@") check_cc "$@" <&1 | grep -q '^gcc.*LLVM'; then cc_type=llvm_gcc @@ -1954,8 +1954,8 @@ if $cc -v 2>&1 | grep -q '^gcc.*LLVM'; then cc_ident="llvm-gcc $($cc -dumpversion) $gcc_extra_ver" CC_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@' AS_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@' - speed_cflags='-O3' - size_cflags='-Os' + cflags_speed='-O3' + cflags_size='-Os' elif $cc -v 2>&1 | grep -qi ^gcc; then cc_type=gcc gcc_version=$($cc --version | head -n1) @@ -1967,29 +1967,29 @@ elif $cc -v 2>&1 | grep -qi ^gcc; then CC_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@' AS_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@' fi - speed_cflags='-O3' - size_cflags='-Os' + cflags_speed='-O3' + cflags_size='-Os' elif $cc --version 2>/dev/null | grep -q Intel; then cc_type=icc cc_ident=$($cc --version | head -n1) CC_DEPFLAGS='-MMD' AS_DEPFLAGS='-MMD' - speed_cflags='-O3' - size_cflags='-Os' - noopt_cflags='-O1' + cflags_speed='-O3' + cflags_size='-Os' + cflags_noopt='-O1' elif $cc -v 2>&1 | grep -q xlc; then cc_type=xlc cc_ident=$($cc -qversion 2>/dev/null | head -n1) - speed_cflags='-O5' - size_cflags='-O5 -qcompact' + cflags_speed='-O5' + cflags_size='-O5 -qcompact' elif $cc -V 2>/dev/null | grep -q Compaq; then cc_type=ccc cc_ident=$($cc -V | head -n1 | cut -d' ' -f1-3) DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -M' debuglevel=3 add_ldflags -Wl,-z,now # calls to libots crash without this - speed_cflags='-fast' - size_cflags='-O1' + cflags_speed='-fast' + cflags_size='-O1' elif $cc --vsn 2>/dev/null | grep -q "ARM C/C++ Compiler"; then test -d "$sysroot" || die "No valid sysroot specified." cc_type=armcc @@ -2005,9 +2005,9 @@ elif $cc --vsn 2>/dev/null | grep -q "ARM C/C++ Compiler"; then as_default="${cross_prefix}gcc" CC_DEPFLAGS='-MMD' AS_DEPFLAGS='-MMD' - speed_cflags='-O3' - size_cflags='-Os' - filter_asflags="filter_out -W${armcc_opt}*" + cflags_speed='-O3' + cflags_size='-Os' + asflags_filter="filter_out -W${armcc_opt}*" elif $cc -version 2>/dev/null | grep -q TMS470; then cc_type=tms470 cc_ident=$($cc -version | head -n1 | tr -s ' ') @@ -2020,9 +2020,9 @@ elif $cc -version 2>/dev/null | grep -q TMS470; then add_cflags -D__gnuc_va_list=va_list -D__USER_LABEL_PREFIX__= CC_DEPFLAGS='-ppa -ppd=$(@:.o=.d)' AS_DEPFLAGS='-MMD' - speed_cflags='-O3 -mf=5' - size_cflags='-O3 -mf=2' - filter_cflags=tms470_flags + cflags_speed='-O3 -mf=5' + cflags_size='-O3 -mf=2' + cflags_filter=tms470_flags tms470_flags(){ for flag; do case $flag in @@ -2052,17 +2052,17 @@ elif $cc -v 2>&1 | grep -q clang; then cc_ident=$($cc --version | head -n1) CC_DEPFLAGS='-MMD' AS_DEPFLAGS='-MMD' - speed_cflags='-O3' - size_cflags='-Os' + cflags_speed='-O3' + cflags_size='-Os' elif $cc -V 2>&1 | grep -q Sun; then cc_type=suncc cc_ident=$($cc -V 2>&1 | head -n1 | cut -d' ' -f 2-) DEPEND_CMD='$(DEPCC) $(DEPFLAGS) $< | sed -e "1s,^.*: ,$@: ," -e "\$$!s,\$$, \\\," -e "1!s,^.*: , ," > $(@:.o=.d)' DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -xM1' add_ldflags -xc99 - speed_cflags='-O5' - size_cflags='-O5 -xspace' - filter_cflags=suncc_flags + cflags_speed='-O5' + cflags_size='-O5 -xspace' + cflags_filter=suncc_flags suncc_flags(){ for flag; do case $flag in @@ -2101,25 +2101,25 @@ elif $cc -v 2>&1 | grep -q 'PathScale\|Path64'; then cc_ident=$($cc -v 2>&1 | head -n1 | tr -d :) CC_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@' AS_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@' - speed_cflags='-O2' - size_cflags='-Os' - filter_cflags='filter_out -Wdisabled-optimization' + cflags_speed='-O2' + cflags_size='-Os' + cflags_filter='filter_out -Wdisabled-optimization' elif $cc -v 2>&1 | grep -q Open64; then cc_type=open64 cc_ident=$($cc -v 2>&1 | head -n1 | tr -d :) CC_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@' AS_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@' - speed_cflags='-O2' - size_cflags='-Os' - filter_cflags='filter_out -Wdisabled-optimization|-Wtype-limits|-fno-signed-zeros' + cflags_speed='-O2' + cflags_size='-Os' + cflags_filter='filter_out -Wdisabled-optimization|-Wtype-limits|-fno-signed-zeros' elif $cc -V 2>&1 | grep -q Portland; then cc_type=pgi cc_ident="PGI $($cc -V 2>&1 | awk '/^pgcc/ { print $2; exit }')" opt_common='-alias=ansi -Mlre -Mpre' - speed_cflags="-O3 -Mautoinline -Munroll=c:4 $opt_common" - size_cflags="-O2 -Munroll=c:1 $opt_common" - noopt_cflags="-O1" - filter_cflags=pgi_flags + cflags_speed="-O3 -Mautoinline -Munroll=c:4 $opt_common" + cflags_size="-O2 -Munroll=c:1 $opt_common" + cflags_noopt="-O1" + cflags_filter=pgi_flags pgi_flags(){ for flag; do case $flag in @@ -3115,11 +3115,11 @@ fi if [ -n "$optflags" ]; then add_cflags $optflags elif enabled small; then - add_cflags $size_cflags + add_cflags $cflags_size elif enabled optimizations; then - add_cflags $speed_cflags + add_cflags $cflags_speed else - add_cflags $noopt_cflags + add_cflags $cflags_noopt fi check_cflags -fno-math-errno check_cflags -fno-signed-zeros From 64933b6c94dc6dd4c52078c2bf3863bdaf083cf2 Mon Sep 17 00:00:00 2001 From: Mans Rullgard Date: Fri, 20 Jul 2012 03:06:49 +0100 Subject: [PATCH 05/10] configure: add filtering of linker flags This allows filtering of linker flags the same was as already supported for CFLAGS. The filter must be initialised to 'echo' early since it is invoked by --extra-ldflags. Signed-off-by: Mans Rullgard --- configure | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 4907c75505..9692921f4a 100755 --- a/configure +++ b/configure @@ -597,11 +597,11 @@ add_asflags(){ } add_ldflags(){ - append LDFLAGS "$@" + append LDFLAGS $($ldflags_filter "$@") } add_extralibs(){ - prepend extralibs "$@" + prepend extralibs $($ldflags_filter "$@") } check_cmd(){ @@ -657,6 +657,8 @@ check_ld(){ test "${f}" = "${f#-l}" && flags="$flags $f" || libs="$libs $f" done check_cc $($cflags_filter $flags) || return + flags=$($ldflags_filter $flags) + libs=$($ldflags_filter $libs) check_cmd $ld $LDFLAGS $flags -o $TMPE $TMPO $libs $extralibs } @@ -1706,6 +1708,8 @@ LIB_INSTALL_EXTRA_CMD='$$(RANLIB) "$(LIBDIR)/$(LIBNAME)"' SLIB_INSTALL_NAME='$(SLIBNAME_WITH_VERSION)' SLIB_INSTALL_LINKS='$(SLIBNAME_WITH_MAJOR) $(SLIBNAME)' +ldflags_filter=echo + AS_O='-o $@' CC_O='-o $@' From 68485d1f32ae92c15047c567657b33a71bbed1a3 Mon Sep 17 00:00:00 2001 From: Mans Rullgard Date: Fri, 20 Jul 2012 12:20:23 +0100 Subject: [PATCH 06/10] configure: initialise all flag filters at the same place This is more consistent, and doing it earlier is harmless. Signed-off-by: Mans Rullgard --- configure | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/configure b/configure index 9692921f4a..d7ce44a6e6 100755 --- a/configure +++ b/configure @@ -1708,6 +1708,8 @@ LIB_INSTALL_EXTRA_CMD='$$(RANLIB) "$(LIBDIR)/$(LIBNAME)"' SLIB_INSTALL_NAME='$(SLIBNAME_WITH_VERSION)' SLIB_INSTALL_LINKS='$(SLIBNAME_WITH_MAJOR) $(SLIBNAME)' +asflags_filter=echo +cflags_filter=echo ldflags_filter=echo AS_O='-o $@' @@ -1949,9 +1951,6 @@ EOF die "Sanity test failed." fi -asflags_filter=echo -cflags_filter=echo - if $cc -v 2>&1 | grep -q '^gcc.*LLVM'; then cc_type=llvm_gcc gcc_extra_ver=$(expr "$($cc --version | head -n1)" : '.*\((.*)\)') From 6c3fa06a85ea50a91d373164e77299f339bf7616 Mon Sep 17 00:00:00 2001 From: Mans Rullgard Date: Fri, 20 Jul 2012 13:48:13 +0100 Subject: [PATCH 07/10] configure: add filtering of host cflags/ldflags This is in preparation for supporting host compilers with non-standard flags. Signed-off-by: Mans Rullgard --- configure | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/configure b/configure index d7ce44a6e6..890621b8bb 100755 --- a/configure +++ b/configure @@ -604,6 +604,14 @@ add_extralibs(){ prepend extralibs $($ldflags_filter "$@") } +add_host_cflags(){ + append host_cflags $($host_cflags_filter "$@") +} + +add_host_ldflags(){ + append host_ldflags $($host_ldflags_filter "$@") +} + check_cmd(){ log "$@" "$@" >> $logfile 2>&1 @@ -878,6 +886,7 @@ check_host_cc(){ check_host_cflags(){ log check_host_cflags "$@" + set -- $($host_cflags_filter "$@") check_host_cc "$@" < Date: Thu, 19 Jul 2012 14:16:01 +0200 Subject: [PATCH 08/10] configure: Remove redundant RTMPT/RTMPTS dependencies The incompatibility with librtmp is already expressed in the ffrtmphttp protocol dependency declaration, which both RTMPT and RTMPTS depend on. Signed-off-by: Diego Biurrun --- configure | 2 -- 1 file changed, 2 deletions(-) diff --git a/configure b/configure index 890621b8bb..8c13df820b 100755 --- a/configure +++ b/configure @@ -1558,9 +1558,7 @@ rtmp_protocol_deps="!librtmp_protocol" rtmp_protocol_select="tcp_protocol" rtmps_protocol_deps="!librtmp_protocol" rtmps_protocol_select="tls_protocol" -rtmpt_protocol_deps="!librtmp_protocol" rtmpt_protocol_select="ffrtmphttp_protocol" -rtmpts_protocol_deps="!librtmp_protocol" rtmpts_protocol_select="ffrtmphttp_protocol" rtp_protocol_select="udp_protocol" sctp_protocol_deps="network netinet_sctp_h" From 5354a904fe9f1a0c4160d614b764d9826c723b9f Mon Sep 17 00:00:00 2001 From: "Ronald S. Bultje" Date: Sat, 21 Jul 2012 14:13:48 +0000 Subject: [PATCH 09/10] rtsp: remove terminal comma in FF_RTP_FLAG_OPTS macro. This makes usage of the macro look more natural when used with array entries. Signed-off-by: Derek Buitenhuis --- libavformat/movenc.c | 2 +- libavformat/rtpenc.c | 2 +- libavformat/rtpenc.h | 2 +- libavformat/rtsp.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libavformat/movenc.c b/libavformat/movenc.c index 350ac951f6..2a5f1d7a3c 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -51,7 +51,7 @@ static const AVOption options[] = { { "separate_moof", "Write separate moof/mdat atoms for each track", 0, AV_OPT_TYPE_CONST, {.dbl = FF_MOV_FLAG_SEPARATE_MOOF}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "movflags" }, { "frag_custom", "Flush fragments on caller requests", 0, AV_OPT_TYPE_CONST, {.dbl = FF_MOV_FLAG_FRAG_CUSTOM}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "movflags" }, { "isml", "Create a live smooth streaming feed (for pushing to a publishing point)", 0, AV_OPT_TYPE_CONST, {.dbl = FF_MOV_FLAG_ISML}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "movflags" }, - FF_RTP_FLAG_OPTS(MOVMuxContext, rtp_flags) + FF_RTP_FLAG_OPTS(MOVMuxContext, rtp_flags), { "skip_iods", "Skip writing iods atom.", offsetof(MOVMuxContext, iods_skip), AV_OPT_TYPE_INT, {.dbl = 0}, 0, 1, AV_OPT_FLAG_ENCODING_PARAM}, { "iods_audio_profile", "iods audio profile atom.", offsetof(MOVMuxContext, iods_audio_profile), AV_OPT_TYPE_INT, {.dbl = -1}, -1, 255, AV_OPT_FLAG_ENCODING_PARAM}, { "iods_video_profile", "iods video profile atom.", offsetof(MOVMuxContext, iods_video_profile), AV_OPT_TYPE_INT, {.dbl = -1}, -1, 255, AV_OPT_FLAG_ENCODING_PARAM}, diff --git a/libavformat/rtpenc.c b/libavformat/rtpenc.c index 9cf1a165d2..d0b17e0970 100644 --- a/libavformat/rtpenc.c +++ b/libavformat/rtpenc.c @@ -31,7 +31,7 @@ //#define DEBUG static const AVOption options[] = { - FF_RTP_FLAG_OPTS(RTPMuxContext, flags) + FF_RTP_FLAG_OPTS(RTPMuxContext, flags), { "payload_type", "Specify RTP payload type", offsetof(RTPMuxContext, payload_type), AV_OPT_TYPE_INT, {.dbl = -1 }, -1, 127, AV_OPT_FLAG_ENCODING_PARAM }, { "ssrc", "Stream identifier", offsetof(RTPMuxContext, ssrc), AV_OPT_TYPE_INT, { 0 }, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM }, { NULL }, diff --git a/libavformat/rtpenc.h b/libavformat/rtpenc.h index f81cc7a6b8..8878a5614a 100644 --- a/libavformat/rtpenc.h +++ b/libavformat/rtpenc.h @@ -73,7 +73,7 @@ typedef struct RTPMuxContext RTPMuxContext; { "latm", "Use MP4A-LATM packetization instead of MPEG4-GENERIC for AAC", 0, AV_OPT_TYPE_CONST, {.dbl = FF_RTP_FLAG_MP4A_LATM}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "rtpflags" }, \ { "rfc2190", "Use RFC 2190 packetization instead of RFC 4629 for H.263", 0, AV_OPT_TYPE_CONST, {.dbl = FF_RTP_FLAG_RFC2190}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "rtpflags" }, \ { "skip_rtcp", "Don't send RTCP sender reports", 0, AV_OPT_TYPE_CONST, {.dbl = FF_RTP_FLAG_SKIP_RTCP}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "rtpflags" }, \ - { "h264_mode0", "Use mode 0 for H264 in RTP", 0, AV_OPT_TYPE_CONST, {.dbl = FF_RTP_FLAG_H264_MODE0}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "rtpflags" }, \ + { "h264_mode0", "Use mode 0 for H264 in RTP", 0, AV_OPT_TYPE_CONST, {.dbl = FF_RTP_FLAG_H264_MODE0}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "rtpflags" } \ void ff_rtp_send_data(AVFormatContext *s1, const uint8_t *buf1, int len, int m); diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c index f98dc6b4fd..f6f5ac7146 100644 --- a/libavformat/rtsp.c +++ b/libavformat/rtsp.c @@ -74,7 +74,7 @@ const AVOption ff_rtsp_options[] = { { "initial_pause", "Don't start playing the stream immediately", OFFSET(initial_pause), AV_OPT_TYPE_INT, {0}, 0, 1, DEC }, - FF_RTP_FLAG_OPTS(RTSPState, rtp_muxer_flags) + FF_RTP_FLAG_OPTS(RTSPState, rtp_muxer_flags), { "rtsp_transport", "RTSP transport protocols", OFFSET(lower_transport_mask), AV_OPT_TYPE_FLAGS, {0}, INT_MIN, INT_MAX, DEC|ENC, "rtsp_transport" }, \ { "udp", "UDP", 0, AV_OPT_TYPE_CONST, {1 << RTSP_LOWER_TRANSPORT_UDP}, 0, 0, DEC|ENC, "rtsp_transport" }, \ { "tcp", "TCP", 0, AV_OPT_TYPE_CONST, {1 << RTSP_LOWER_TRANSPORT_TCP}, 0, 0, DEC|ENC, "rtsp_transport" }, \ From b2668c85e9d3745847f716f909ba4d3f6de0e12e Mon Sep 17 00:00:00 2001 From: "Ronald S. Bultje" Date: Sat, 14 Jul 2012 21:25:55 -0700 Subject: [PATCH 10/10] x86: swscale: Place inline assembly code under appropriate #ifdefs Fixes compilation for compilers that do not support gcc inline assembly. Signed-off-by: Diego Biurrun --- libswscale/x86/rgb2rgb.c | 6 ++++++ libswscale/x86/swscale_mmx.c | 6 ++++++ libswscale/x86/yuv2rgb_mmx.c | 6 ++++++ 3 files changed, 18 insertions(+) diff --git a/libswscale/x86/rgb2rgb.c b/libswscale/x86/rgb2rgb.c index 282618c301..353b0aab22 100644 --- a/libswscale/x86/rgb2rgb.c +++ b/libswscale/x86/rgb2rgb.c @@ -33,6 +33,8 @@ #include "libswscale/swscale.h" #include "libswscale/swscale_internal.h" +#if HAVE_INLINE_ASM + DECLARE_ASM_CONST(8, uint64_t, mmx_ff) = 0x00000000000000FFULL; DECLARE_ASM_CONST(8, uint64_t, mmx_null) = 0x0000000000000000ULL; DECLARE_ASM_CONST(8, uint64_t, mmx_one) = 0xFFFFFFFFFFFFFFFFULL; @@ -123,8 +125,11 @@ DECLARE_ASM_CONST(8, uint64_t, blue_15mask) = 0x0000001f0000001fULL; 32-bit C version, and and&add trick by Michael Niedermayer */ +#endif /* HAVE_INLINE_ASM */ + void rgb2rgb_init_x86(void) { +#if HAVE_INLINE_ASM int cpu_flags = av_get_cpu_flags(); if (cpu_flags & AV_CPU_FLAG_MMX) @@ -135,4 +140,5 @@ void rgb2rgb_init_x86(void) rgb2rgb_init_MMX2(); if (HAVE_SSE && cpu_flags & AV_CPU_FLAG_SSE2) rgb2rgb_init_SSE2(); +#endif /* HAVE_INLINE_ASM */ } diff --git a/libswscale/x86/swscale_mmx.c b/libswscale/x86/swscale_mmx.c index 37d786a87d..b57b7a4c58 100644 --- a/libswscale/x86/swscale_mmx.c +++ b/libswscale/x86/swscale_mmx.c @@ -27,6 +27,8 @@ #include "libavutil/cpu.h" #include "libavutil/pixdesc.h" +#if HAVE_INLINE_ASM + #define DITHER1XBPP DECLARE_ASM_CONST(8, uint64_t, bF8)= 0xF8F8F8F8F8F8F8F8LL; @@ -199,6 +201,8 @@ void updateMMXDitherTables(SwsContext *c, int dstY, int lumBufIndex, int chrBufI } } +#endif /* HAVE_INLINE_ASM */ + #define SCALE_FUNC(filter_n, from_bpc, to_bpc, opt) \ extern void ff_hscale ## from_bpc ## to ## to_bpc ## _ ## filter_n ## _ ## opt( \ SwsContext *c, int16_t *data, \ @@ -300,12 +304,14 @@ void ff_sws_init_swScale_mmx(SwsContext *c) { int cpu_flags = av_get_cpu_flags(); +#if HAVE_INLINE_ASM if (cpu_flags & AV_CPU_FLAG_MMX) sws_init_swScale_MMX(c); #if HAVE_MMX2 if (cpu_flags & AV_CPU_FLAG_MMX2) sws_init_swScale_MMX2(c); #endif +#endif /* HAVE_INLINE_ASM */ #if HAVE_YASM #define ASSIGN_SCALE_FUNC2(hscalefn, filtersize, opt1, opt2) do { \ diff --git a/libswscale/x86/yuv2rgb_mmx.c b/libswscale/x86/yuv2rgb_mmx.c index 0eaea77485..f534e0e6bd 100644 --- a/libswscale/x86/yuv2rgb_mmx.c +++ b/libswscale/x86/yuv2rgb_mmx.c @@ -36,6 +36,8 @@ #include "libavutil/x86_cpu.h" #include "libavutil/cpu.h" +#if HAVE_INLINE_ASM + #define DITHER1XBPP // only for MMX /* hope these constant values are cache line aligned */ @@ -64,8 +66,11 @@ DECLARE_ASM_CONST(8, uint64_t, pb_07) = 0x0707070707070707ULL; #include "yuv2rgb_template.c" #endif /* HAVE_MMX2 */ +#endif /* HAVE_INLINE_ASM */ + SwsFunc ff_yuv2rgb_init_mmx(SwsContext *c) { +#if HAVE_INLINE_ASM int cpu_flags = av_get_cpu_flags(); if (c->srcFormat != PIX_FMT_YUV420P && @@ -103,6 +108,7 @@ SwsFunc ff_yuv2rgb_init_mmx(SwsContext *c) case PIX_FMT_RGB555: return yuv420_rgb15_MMX; } } +#endif /* HAVE_INLINE_ASM */ return NULL; }