diff options
author | William Grzybowski <wg@FreeBSD.org> | 2013-10-19 16:43:32 +0000 |
---|---|---|
committer | William Grzybowski <wg@FreeBSD.org> | 2013-10-19 16:43:32 +0000 |
commit | 3624ddf181da71b2f213d44844a13f92e7088879 (patch) | |
tree | 69155a2473ecd42904d8ae76e85c62fefb67950b /net | |
parent | 553546281034fefe3b27f6114931d6bbce236d38 (diff) | |
download | ports-3624ddf181da71b2f213d44844a13f92e7088879.tar.gz ports-3624ddf181da71b2f213d44844a13f92e7088879.zip |
Notes
Diffstat (limited to 'net')
-rw-r--r-- | net/mediatomb/files/patch-livav7 | 64 | ||||
-rw-r--r-- | net/mediatomb/files/patch-livav9 | 42 | ||||
-rw-r--r-- | net/opal/Makefile | 6 | ||||
-rw-r--r-- | net/opal/files/patch-ffmpeg | 189 |
4 files changed, 301 insertions, 0 deletions
diff --git a/net/mediatomb/files/patch-livav7 b/net/mediatomb/files/patch-livav7 new file mode 100644 index 000000000000..91be32119b22 --- /dev/null +++ b/net/mediatomb/files/patch-livav7 @@ -0,0 +1,64 @@ +=== modified file 'src/metadata/ffmpeg_handler.cc' +--- src/metadata/ffmpeg_handler.cc.orig 2010-08-25 17:07:03 +0000 ++++ src/metadata/ffmpeg_handler.cc 2011-05-19 04:33:32 +0000 +@@ -89,6 +89,33 @@ + + Ref<StringConverter> sc = StringConverter::m2i(); + ++ /* Tabs are 4 characters here */ ++ typedef struct {const char *avname; metadata_fields_t field;} mapping_t; ++ static const mapping_t mapping[] = ++ { ++ {"title", M_TITLE}, ++ {"artist", M_ARTIST}, ++ {"album", M_ALBUM}, ++ {"date", M_DATE}, ++ {"genre", M_GENRE}, ++ {"comment", M_DESCRIPTION}, ++ {"track", M_TRACKNUMBER}, ++ {NULL, M_MAX}, ++ }; ++ ++ if (!pFormatCtx->metadata) ++ return; ++ for (const mapping_t *m = mapping; m->avname != NULL; m++) ++ { ++ AVMetadataTag *tag = NULL; ++ tag = av_metadata_get(pFormatCtx->metadata, m->avname, NULL, 0); ++ if (tag && tag->value && tag->value[0]) ++ { ++ log_debug("Added metadata %s: %s\n", m->avname, tag->value); ++ item->setMetadata(MT_KEYS[m->field].upnp, sc->convert(tag->value)); ++ } ++ } ++ /* Old algorithm (doesn't work with libav >= 0.7) + if (strlen(pFormatCtx->title) > 0) + { + log_debug("Added metadata title: %s\n", pFormatCtx->title); +@@ -131,6 +158,7 @@ + item->setMetadata(MT_KEYS[M_TRACKNUMBER].upnp, + sc->convert(String::from(pFormatCtx->track))); + } ++ */ + } + + // ffmpeg library calls +@@ -178,7 +206,7 @@ + for(i=0; i<pFormatCtx->nb_streams; i++) + { + AVStream *st = pFormatCtx->streams[i]; +- if((st != NULL) && (videoset == false) && (st->codec->codec_type == CODEC_TYPE_VIDEO)) ++ if((st != NULL) && (videoset == false) && (st->codec->codec_type == AVMEDIA_TYPE_VIDEO)) + { + if (st->codec->codec_tag > 0) + { +@@ -209,7 +237,7 @@ + *y = st->codec->height; + } + } +- if(st->codec->codec_type == CODEC_TYPE_AUDIO) ++ if(st->codec->codec_type == AVMEDIA_TYPE_AUDIO) + { + // Increase number of audiochannels + audioch++; + diff --git a/net/mediatomb/files/patch-livav9 b/net/mediatomb/files/patch-livav9 new file mode 100644 index 000000000000..9a706fc2cef8 --- /dev/null +++ b/net/mediatomb/files/patch-livav9 @@ -0,0 +1,42 @@ +diff -burN mediatomb-0.12.1.old//src/metadata/ffmpeg_handler.cc mediatomb-0.12.1/src/metadata/ffmpeg_handler.cc +--- src/metadata/ffmpeg_handler.cc.orig 2012-11-25 14:55:05.335753129 +0100 ++++ src/metadata/ffmpeg_handler.cc 2012-11-25 15:29:42.840677486 +0100 +@@ -110,8 +110,8 @@ + return; + for (const mapping_t *m = mapping; m->avname != NULL; m++) + { +- AVMetadataTag *tag = NULL; +- tag = av_metadata_get(pFormatCtx->metadata, m->avname, NULL, 0); ++ AVDictionaryEntry *tag = NULL; ++ tag = av_dict_get(pFormatCtx->metadata, m->avname, NULL, 0); + if (tag && tag->value && tag->value[0]) + { + log_debug("Added metadata %s: %s\n", m->avname, tag->value); +@@ -290,14 +290,14 @@ + av_register_all(); + + // Open video file +- if (av_open_input_file(&pFormatCtx, +- item->getLocation().c_str(), NULL, 0, NULL) != 0) ++ if (avformat_open_input(&pFormatCtx, ++ item->getLocation().c_str(), NULL, NULL) != 0) + return; // Couldn't open file + + // Retrieve stream information +- if (av_find_stream_info(pFormatCtx) < 0) ++ if (avformat_find_stream_info(pFormatCtx, NULL) < 0) + { +- av_close_input_file(pFormatCtx); ++ avformat_close_input(&pFormatCtx); + return; // Couldn't find stream information + } + // Add metadata using ffmpeg library calls +@@ -306,7 +306,7 @@ + addFfmpegResourceFields(item, pFormatCtx, &x, &y); + + // Close the video file +- av_close_input_file(pFormatCtx); ++ avformat_close_input(&pFormatCtx); + } + + static bool _mkdir(const char *path) diff --git a/net/opal/Makefile b/net/opal/Makefile index b5bd6d4c700a..9182ca110e0e 100644 --- a/net/opal/Makefile +++ b/net/opal/Makefile @@ -287,6 +287,12 @@ CONFIGURE_ARGS+= --disable-debug CONFIGURE_ARGS+= --disable-gsmamr \ --disable-ruby +post-patch: + @${REINPLACE_CMD} -e 's/CODEC_ID/AV_CODEC_ID/g' \ + -e 's/CodecID/AVCodecID/g' \ + ${WRKSRC}/plugins/video/H.263-1998/h263-1998.* \ + ${WRKSRC}/plugins/video/common/dyna.* + post-install: ${LN} -sf libopal.so.${PORTVERSION} ${PREFIX}/lib/libopal.so.${PVERSION_MAJOR} ${LN} -sf libopal.so.${PORTVERSION} ${PREFIX}/lib/libopal.so.${PVERSION_MINOR} diff --git a/net/opal/files/patch-ffmpeg b/net/opal/files/patch-ffmpeg new file mode 100644 index 000000000000..c0ef5c00664e --- /dev/null +++ b/net/opal/files/patch-ffmpeg @@ -0,0 +1,189 @@ +Note: This is not optimal but is backported from what is in the 3.12 branch. + + +r28871 | rjongbloed | 2013-01-13 02:18:43 -0300 (Sun, 13 Jan 2013) | 2 lines + +Fixed compile against latest FFMPEG, specifically Mac OS-X "port" version. Have no idea what all the deprecated symbols are replaced by! + +Index: plugins/video/H.263-1998/h263-1998.cxx +=================================================================== +--- plugins/video/H.263-1998/h263-1998.cxx.orig ++++ plugins/video/H.263-1998/h263-1998.cxx +@@ -312,6 +312,7 @@ void H263_Base_EncoderContext::SetOption + return; + } + ++#ifdef CODEC_FLAG_H263P_UMV + if (STRCMPI(option, H263_ANNEX_D) == 0) { + // Annex D: Unrestructed Motion Vectors + // Level 2+ +@@ -322,7 +323,9 @@ void H263_Base_EncoderContext::SetOption + m_context->flags &= ~CODEC_FLAG_H263P_UMV; + return; + } ++#endif + ++#ifdef CODEC_FLAG_OBMC + #if 0 // DO NOT ENABLE THIS FLAG. FFMPEG IS NOT THREAD_SAFE WHEN THIS FLAG IS SET + if (STRCMPI(option, H263_ANNEX_F) == 0) { + // Annex F: Advanced Prediction Mode +@@ -334,7 +337,9 @@ void H263_Base_EncoderContext::SetOption + return; + } + #endif ++#endif + ++#ifdef CODEC_FLAG_AC_PRED + if (STRCMPI(option, H263_ANNEX_I) == 0) { + // Annex I: Advanced Intra Coding + // Level 3+ +@@ -345,7 +350,9 @@ void H263_Base_EncoderContext::SetOption + m_context->flags &= ~CODEC_FLAG_AC_PRED; + return; + } ++#endif + ++#ifdef CODEC_FLAG_LOOP_FILTER + if (STRCMPI(option, H263_ANNEX_J) == 0) { + // Annex J: Deblocking Filter + // works with eyeBeam +@@ -355,7 +362,9 @@ void H263_Base_EncoderContext::SetOption + m_context->flags &= ~CODEC_FLAG_LOOP_FILTER; + return; + } ++#endif + ++#ifdef CODEC_FLAG_H263P_SLICE_STRUCT + if (STRCMPI(option, H263_ANNEX_K) == 0) { + // Annex K: Slice Structure + // does not work with eyeBeam +@@ -365,7 +374,9 @@ void H263_Base_EncoderContext::SetOption + m_context->flags &= ~CODEC_FLAG_H263P_SLICE_STRUCT; + return; + } ++#endif + ++#ifdef CODEC_FLAG_H263P_AIV + if (STRCMPI(option, H263_ANNEX_S) == 0) { + // Annex S: Alternative INTER VLC mode + // does not work with eyeBeam +@@ -375,6 +386,7 @@ void H263_Base_EncoderContext::SetOption + m_context->flags &= ~CODEC_FLAG_H263P_AIV; + return; + } ++#endif + + if (STRCMPI(option, PLUGINCODEC_MEDIA_PACKETIZATION) == 0 || + STRCMPI(option, PLUGINCODEC_MEDIA_PACKETIZATIONS) == 0) { +@@ -452,12 +464,24 @@ bool H263_Base_EncoderContext::OpenCodec + + #define CODEC_TRACER_FLAG(tracer, flag) \ + PTRACE(4, m_prefix, #flag " is " << ((m_context->flags & flag) ? "enabled" : "disabled")); ++#ifdef CODEC_FLAG_H263P_UMV + CODEC_TRACER_FLAG(tracer, CODEC_FLAG_H263P_UMV); ++#endif ++#ifdef CODEC_FLAG_OBMC + CODEC_TRACER_FLAG(tracer, CODEC_FLAG_OBMC); ++#endif ++#ifdef CODEC_FLAG_AC_PRED + CODEC_TRACER_FLAG(tracer, CODEC_FLAG_AC_PRED); ++#endif ++#ifdef CODEC_FLAG_H263P_SLICE_STRUCT + CODEC_TRACER_FLAG(tracer, CODEC_FLAG_H263P_SLICE_STRUCT) ++#endif ++#ifdef CODEC_FLAG_LOOP_FILTER + CODEC_TRACER_FLAG(tracer, CODEC_FLAG_LOOP_FILTER); ++#endif ++#ifdef CODEC_FLAG_H263P_AIV + CODEC_TRACER_FLAG(tracer, CODEC_FLAG_H263P_AIV); ++#endif + + return FFMPEGLibraryInstance.AvcodecOpen(m_context, m_codec) == 0; + } +@@ -521,7 +545,7 @@ bool H263_Base_EncoderContext::EncodeFra + + // Need to copy to local buffer to guarantee 16 byte alignment + memcpy(m_inputFrame->data[0], OPAL_VIDEO_FRAME_DATA_PTR(header), header->width*header->height*3/2); +- m_inputFrame->pict_type = (flags & PluginCodec_CoderForceIFrame) ? FF_I_TYPE : AV_PICTURE_TYPE_NONE; ++ m_inputFrame->pict_type = (flags & PluginCodec_CoderForceIFrame) ? AV_PICTURE_TYPE_I : AV_PICTURE_TYPE_NONE; + + /* + m_inputFrame->pts = (int64_t)srcRTP.GetTimestamp()*m_context->time_base.den/m_context->time_base.num/VIDEO_CLOCKRATE; +@@ -603,13 +627,21 @@ bool H263_RFC2190_EncoderContext::Init() + m_context->rtp_callback = &H263_RFC2190_EncoderContext::RTPCallBack; + m_context->opaque = this; // used to separate out packets from different encode threads + ++#ifdef CODEC_FLAG_H263P_UMV + m_context->flags &= ~CODEC_FLAG_H263P_UMV; ++#endif ++#ifdef CODEC_FLAG_4MV + m_context->flags &= ~CODEC_FLAG_4MV; +-#if LIBAVCODEC_RTP_MODE ++#endif ++#if LIBAVCODEC_RTP_MODE && defined(CODEC_FLAG_H263P_AIC) + m_context->flags &= ~CODEC_FLAG_H263P_AIC; + #endif ++#ifdef CODEC_FLAG_H263P_AIV + m_context->flags &= ~CODEC_FLAG_H263P_AIV; ++#endif ++#ifdef CODEC_FLAG_H263P_SLICE_STRUCT + m_context->flags &= ~CODEC_FLAG_H263P_SLICE_STRUCT; ++#endif + + return true; + } +Index: plugins/video/H.264/h264-x264.cxx +=================================================================== +--- plugins/video/H.264/h264-x264.cxx.orig ++++ plugins/video/H.264/h264-x264.cxx +@@ -1071,13 +1071,13 @@ class MyDecoder : public PluginCodec<MY_ + return false; + + m_context->workaround_bugs = FF_BUG_AUTODETECT; ++#ifdef FF_ER_AGGRESSIVE + m_context->error_recognition = FF_ER_AGGRESSIVE; ++#endif + m_context->idct_algo = FF_IDCT_H264; + m_context->error_concealment = FF_EC_GUESS_MVS | FF_EC_DEBLOCK; + m_context->flags = CODEC_FLAG_INPUT_PRESERVED | CODEC_FLAG_EMU_EDGE; +- m_context->flags2 = CODEC_FLAG2_BRDO | +- CODEC_FLAG2_MEMC_ONLY | +- CODEC_FLAG2_DROP_FRAME_TIMECODE | ++ m_context->flags2 = CODEC_FLAG2_DROP_FRAME_TIMECODE | + CODEC_FLAG2_SKIP_RD | + CODEC_FLAG2_CHUNKS; + +Index: plugins/video/MPEG4-ffmpeg/mpeg4.cxx +=================================================================== +--- plugins/video/MPEG4-ffmpeg/mpeg4.cxx.orig ++++ plugins/video/MPEG4-ffmpeg/mpeg4.cxx +@@ -594,12 +594,10 @@ void MPEG4EncoderContext::SetStaticEncod + #else + m_avcontext->max_b_frames=0; /*don't use b frames*/ + m_avcontext->flags|=CODEC_FLAG_AC_PRED; +- m_avcontext->flags|=CODEC_FLAG_H263P_UMV; + /*c->flags|=CODEC_FLAG_QPEL;*/ /*don't enable this one: this forces profile_level to advanced simple profile */ + m_avcontext->flags|=CODEC_FLAG_4MV; + m_avcontext->flags|=CODEC_FLAG_GMC; + m_avcontext->flags|=CODEC_FLAG_LOOP_FILTER; +- m_avcontext->flags|=CODEC_FLAG_H263P_SLICE_STRUCT; + #endif + m_avcontext->opaque = this; // for use in RTP callback + } +@@ -804,7 +802,7 @@ int MPEG4EncoderContext::EncodeFrames(co + // Should the next frame be an I-Frame? + if ((flags & PluginCodec_CoderForceIFrame) || (m_frameNum == 0)) + { +- m_avpicture->pict_type = FF_I_TYPE; ++ m_avpicture->pict_type = AV_PICTURE_TYPE_I; + } + else // No IFrame requested, let avcodec decide what to do + { +@@ -1325,7 +1323,6 @@ void MPEG4DecoderContext::SetFrameHeight + + void MPEG4DecoderContext::SetStaticDecodingParams() { + m_avcontext->flags |= CODEC_FLAG_4MV; +- m_avcontext->flags |= CODEC_FLAG_PART; + m_avcontext->workaround_bugs = 0; // no workaround for buggy implementations + } + |