Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff -r 4af5d016a1cd configure
- --- a/configure Fri Jul 11 16:58:14 2014 +0300
- +++ b/configure Fri Jul 11 17:15:32 2014 +0300
- @@ -245,7 +245,7 @@
- if enabled_or_auto libav; then
- has_libav=true
- - if $has_libav && ! check_pkg libavcodec "<=55.0.0"; then
- + if $has_libav && ! check_pkg libavcodec "<=56.0.0"; then
- has_libav=false
- fi
- @@ -257,7 +257,7 @@
- has_libav=false
- fi
- - if $has_libav && ! check_pkg libavformat "<=55.0.0"; then
- + if $has_libav && ! check_pkg libavformat "<=56.0.0"; then
- has_libav=false
- fi
- diff -r 4af5d016a1cd src/libav.c
- --- a/src/libav.c Fri Jul 11 16:58:14 2014 +0300
- +++ b/src/libav.c Fri Jul 11 17:15:32 2014 +0300
- @@ -50,47 +50,47 @@
- /**
- * Translate a component type to a libavcodec id
- */
- -enum CodecID
- +enum AVCodecID
- streaming_component_type2codec_id(streaming_component_type_t type)
- {
- - enum CodecID codec_id = CODEC_ID_NONE;
- + enum AVCodecID codec_id = AV_CODEC_ID_NONE;
- switch(type) {
- case SCT_H264:
- - codec_id = CODEC_ID_H264;
- + codec_id = AV_CODEC_ID_H264;
- break;
- case SCT_MPEG2VIDEO:
- - codec_id = CODEC_ID_MPEG2VIDEO;
- + codec_id = AV_CODEC_ID_MPEG2VIDEO;
- break;
- case SCT_VP8:
- - codec_id = CODEC_ID_VP8;
- + codec_id = AV_CODEC_ID_VP8;
- break;
- case SCT_AC3:
- - codec_id = CODEC_ID_AC3;
- + codec_id = AV_CODEC_ID_AC3;
- break;
- case SCT_EAC3:
- - codec_id = CODEC_ID_EAC3;
- + codec_id = AV_CODEC_ID_EAC3;
- break;
- case SCT_AAC:
- - codec_id = CODEC_ID_AAC;
- + codec_id = AV_CODEC_ID_AAC;
- break;
- case SCT_MPEG2AUDIO:
- - codec_id = CODEC_ID_MP2;
- + codec_id = AV_CODEC_ID_MP2;
- break;
- case SCT_VORBIS:
- - codec_id = CODEC_ID_VORBIS;
- + codec_id = AV_CODEC_ID_VORBIS;
- break;
- case SCT_DVBSUB:
- - codec_id = CODEC_ID_DVB_SUBTITLE;
- + codec_id = AV_CODEC_ID_DVB_SUBTITLE;
- break;
- case SCT_TEXTSUB:
- - codec_id = CODEC_ID_TEXT;
- + codec_id = AV_CODEC_ID_TEXT;
- break;
- case SCT_TELETEXT:
- - codec_id = CODEC_ID_DVB_TELETEXT;
- + codec_id = AV_CODEC_ID_DVB_TELETEXT;
- break;
- default:
- - codec_id = CODEC_ID_NONE;
- + codec_id = AV_CODEC_ID_NONE;
- break;
- }
- @@ -102,45 +102,45 @@
- * Translate a libavcodec id to a component type
- */
- streaming_component_type_t
- -codec_id2streaming_component_type(enum CodecID id)
- +codec_id2streaming_component_type(enum AVCodecID id)
- {
- - streaming_component_type_t type = CODEC_ID_NONE;
- + streaming_component_type_t type = AV_CODEC_ID_NONE;
- switch(id) {
- - case CODEC_ID_H264:
- + case AV_CODEC_ID_H264:
- type = SCT_H264;
- break;
- - case CODEC_ID_MPEG2VIDEO:
- + case AV_CODEC_ID_MPEG2VIDEO:
- type = SCT_MPEG2VIDEO;
- break;
- - case CODEC_ID_VP8:
- + case AV_CODEC_ID_VP8:
- type = SCT_VP8;
- break;
- - case CODEC_ID_AC3:
- + case AV_CODEC_ID_AC3:
- type = SCT_AC3;
- break;
- - case CODEC_ID_EAC3:
- + case AV_CODEC_ID_EAC3:
- type = SCT_EAC3;
- break;
- - case CODEC_ID_AAC:
- + case AV_CODEC_ID_AAC:
- type = SCT_AAC;
- break;
- - case CODEC_ID_MP2:
- + case AV_CODEC_ID_MP2:
- type = SCT_MPEG2AUDIO;
- break;
- - case CODEC_ID_VORBIS:
- + case AV_CODEC_ID_VORBIS:
- type = SCT_VORBIS;
- break;
- - case CODEC_ID_DVB_SUBTITLE:
- + case AV_CODEC_ID_DVB_SUBTITLE:
- type = SCT_DVBSUB;
- break;
- - case CODEC_ID_TEXT:
- + case AV_CODEC_ID_TEXT:
- type = SCT_TEXTSUB;
- break;
- - case CODEC_ID_DVB_TELETEXT:
- + case AV_CODEC_ID_DVB_TELETEXT:
- type = SCT_TELETEXT;
- break;
- - case CODEC_ID_NONE:
- + case AV_CODEC_ID_NONE:
- type = SCT_NONE;
- break;
- default:
- diff -r 4af5d016a1cd src/libav.h
- --- a/src/libav.h Fri Jul 11 16:58:14 2014 +0300
- +++ b/src/libav.h Fri Jul 11 17:15:32 2014 +0300
- @@ -23,8 +23,8 @@
- #include <libavformat/avformat.h>
- #include "tvheadend.h"
- -enum CodecID streaming_component_type2codec_id(streaming_component_type_t type);
- -streaming_component_type_t codec_id2streaming_component_type(enum CodecID id);
- +enum AVCodecID streaming_component_type2codec_id(streaming_component_type_t type);
- +streaming_component_type_t codec_id2streaming_component_type(enum AVCodecID id);
- int libav_is_encoder(AVCodec *codec);
- void libav_init(void);
- diff -r 4af5d016a1cd src/plumbing/transcoding.c
- --- a/src/plumbing/transcoding.c Fri Jul 11 16:58:14 2014 +0300
- +++ b/src/plumbing/transcoding.c Fri Jul 11 17:15:32 2014 +0300
- @@ -108,9 +108,9 @@
- -#define WORKING_ENCODER(x) (x == CODEC_ID_H264 || x == CODEC_ID_MPEG2VIDEO || \
- - x == CODEC_ID_VP8 || x == CODEC_ID_AAC || \
- - x == CODEC_ID_MP2 || x == CODEC_ID_VORBIS)
- +#define WORKING_ENCODER(x) (x == AV_CODEC_ID_H264 || x == AV_CODEC_ID_MPEG2VIDEO || \
- + x == AV_CODEC_ID_VP8 || x == AV_CODEC_ID_AAC || \
- + x == AV_CODEC_ID_MP2 || x == AV_CODEC_ID_VORBIS)
- uint32_t transcoding_enabled = 0;
- @@ -121,11 +121,11 @@
- static AVCodec *
- transcoder_get_decoder(streaming_component_type_t ty)
- {
- - enum CodecID codec_id;
- + enum AVCodecID codec_id;
- AVCodec *codec;
- codec_id = streaming_component_type2codec_id(ty);
- - if (codec_id == CODEC_ID_NONE) {
- + if (codec_id == AV_CODEC_ID_NONE) {
- tvhlog(LOG_ERR, "transcode", "Unsupported input codec %s",
- streaming_component_type2txt(ty));
- return NULL;
- @@ -150,11 +150,11 @@
- static AVCodec *
- transcoder_get_encoder(streaming_component_type_t ty)
- {
- - enum CodecID codec_id;
- + enum AVCodecID codec_id;
- AVCodec *codec;
- codec_id = streaming_component_type2codec_id(ty);
- - if (codec_id == CODEC_ID_NONE) {
- + if (codec_id == AV_CODEC_ID_NONE) {
- tvhlog(LOG_ERR, "transcode", "Unable to find %s codec",
- streaming_component_type2txt(ty));
- return NULL;
- @@ -214,7 +214,7 @@
- icodec = ss->sub_icodec;
- //ocodec = ss->sub_ocodec;
- - if (ictx->codec_id == CODEC_ID_NONE) {
- + if (ictx->codec_id == AV_CODEC_ID_NONE) {
- ictx->codec_id = icodec->id;
- if (avcodec_open2(ictx, icodec, NULL) < 0) {
- @@ -272,7 +272,7 @@
- icodec = as->aud_icodec;
- ocodec = as->aud_ocodec;
- - if (ictx->codec_id == CODEC_ID_NONE) {
- + if (ictx->codec_id == AV_CODEC_ID_NONE) {
- ictx->codec_id = icodec->id;
- if (avcodec_open2(ictx, icodec, NULL) < 0) {
- @@ -391,7 +391,7 @@
- break;
- }
- - if (octx->codec_id == CODEC_ID_NONE) {
- + if (octx->codec_id == AV_CODEC_ID_NONE) {
- octx->codec_id = ocodec->id;
- if (avcodec_open2(octx, ocodec, NULL) < 0) {
- @@ -478,7 +478,7 @@
- buf = out = deint = NULL;
- opts = NULL;
- - if (ictx->codec_id == CODEC_ID_NONE) {
- + if (ictx->codec_id == AV_CODEC_ID_NONE) {
- ictx->codec_id = icodec->id;
- if (avcodec_open2(ictx, icodec, NULL) < 0) {
- @@ -523,7 +523,7 @@
- vs->vid_enc_frame->sample_aspect_ratio.num = vs->vid_dec_frame->sample_aspect_ratio.num;
- vs->vid_enc_frame->sample_aspect_ratio.den = vs->vid_dec_frame->sample_aspect_ratio.den;
- - if(octx->codec_id == CODEC_ID_NONE) {
- + if(octx->codec_id == AV_CODEC_ID_NONE) {
- // Common settings
- octx->width = vs->vid_width ? vs->vid_width : ictx->width;
- octx->height = vs->vid_height ? vs->vid_height : ictx->height;
- @@ -534,7 +534,7 @@
- switch (ts->ts_type) {
- case SCT_MPEG2VIDEO:
- - octx->codec_id = CODEC_ID_MPEG2VIDEO;
- + octx->codec_id = AV_CODEC_ID_MPEG2VIDEO;
- octx->pix_fmt = PIX_FMT_YUV420P;
- octx->flags |= CODEC_FLAG_GLOBAL_HEADER;
- @@ -547,7 +547,7 @@
- break;
- case SCT_VP8:
- - octx->codec_id = CODEC_ID_VP8;
- + octx->codec_id = AV_CODEC_ID_VP8;
- octx->pix_fmt = PIX_FMT_YUV420P;
- octx->qmin = 10;
- @@ -561,7 +561,7 @@
- break;
- case SCT_H264:
- - octx->codec_id = CODEC_ID_H264;
- + octx->codec_id = AV_CODEC_ID_H264;
- octx->pix_fmt = PIX_FMT_YUV420P;
- octx->flags |= CODEC_FLAG_GLOBAL_HEADER;
- @@ -951,8 +951,8 @@
- as->aud_ictx->thread_count = sysconf(_SC_NPROCESSORS_ONLN);
- as->aud_octx->thread_count = sysconf(_SC_NPROCESSORS_ONLN);
- - as->aud_dec_size = AVCODEC_MAX_AUDIO_FRAME_SIZE*2;
- - as->aud_enc_size = AVCODEC_MAX_AUDIO_FRAME_SIZE*2;
- + as->aud_dec_size = 192000*2;
- + as->aud_enc_size = 192000*2;
- as->aud_dec_sample = av_malloc(as->aud_dec_size + FF_INPUT_BUFFER_PADDING_SIZE);
- as->aud_enc_sample = av_malloc(as->aud_enc_size + FF_INPUT_BUFFER_PADDING_SIZE);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement