Make av_log_missing_feature an internal function, and change its name
to ff_log_missing_feature. Originally committed as revision 16037 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
6cffaea8db
commit
dbbec0c2f2
@ -77,6 +77,7 @@
|
|||||||
|
|
||||||
|
|
||||||
#include "avcodec.h"
|
#include "avcodec.h"
|
||||||
|
#include "internal.h"
|
||||||
#include "bitstream.h"
|
#include "bitstream.h"
|
||||||
#include "dsputil.h"
|
#include "dsputil.h"
|
||||||
#include "lpc.h"
|
#include "lpc.h"
|
||||||
@ -262,7 +263,7 @@ static int decode_ga_specific_config(AACContext * ac, GetBitContext * gb, int ch
|
|||||||
int extension_flag, ret;
|
int extension_flag, ret;
|
||||||
|
|
||||||
if(get_bits1(gb)) { // frameLengthFlag
|
if(get_bits1(gb)) { // frameLengthFlag
|
||||||
av_log_missing_feature(ac->avccontext, "960/120 MDCT window is", 1);
|
ff_log_missing_feature(ac->avccontext, "960/120 MDCT window is", 1);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -521,7 +522,7 @@ static int decode_ics_info(AACContext * ac, IndividualChannelStream * ics, GetBi
|
|||||||
memset(ics, 0, sizeof(IndividualChannelStream));
|
memset(ics, 0, sizeof(IndividualChannelStream));
|
||||||
return -1;
|
return -1;
|
||||||
} else {
|
} else {
|
||||||
av_log_missing_feature(ac->avccontext, "Predictor bit set but LTP is", 1);
|
ff_log_missing_feature(ac->avccontext, "Predictor bit set but LTP is", 1);
|
||||||
memset(ics, 0, sizeof(IndividualChannelStream));
|
memset(ics, 0, sizeof(IndividualChannelStream));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -955,7 +956,7 @@ static int decode_ics(AACContext * ac, SingleChannelElement * sce, GetBitContext
|
|||||||
if ((tns->present = get_bits1(gb)) && decode_tns(ac, tns, gb, ics))
|
if ((tns->present = get_bits1(gb)) && decode_tns(ac, tns, gb, ics))
|
||||||
return -1;
|
return -1;
|
||||||
if (get_bits1(gb)) {
|
if (get_bits1(gb)) {
|
||||||
av_log_missing_feature(ac->avccontext, "SSR", 1);
|
ff_log_missing_feature(ac->avccontext, "SSR", 1);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1159,7 +1160,7 @@ static int decode_cce(AACContext * ac, GetBitContext * gb, ChannelElement * che)
|
|||||||
*/
|
*/
|
||||||
static int decode_sbr_extension(AACContext * ac, GetBitContext * gb, int crc, int cnt) {
|
static int decode_sbr_extension(AACContext * ac, GetBitContext * gb, int crc, int cnt) {
|
||||||
// TODO : sbr_extension implementation
|
// TODO : sbr_extension implementation
|
||||||
av_log_missing_feature(ac->avccontext, "SBR", 0);
|
ff_log_missing_feature(ac->avccontext, "SBR", 0);
|
||||||
skip_bits_long(gb, 8*cnt - 4); // -4 due to reading extension type
|
skip_bits_long(gb, 8*cnt - 4); // -4 due to reading extension type
|
||||||
return cnt;
|
return cnt;
|
||||||
}
|
}
|
||||||
|
@ -35,6 +35,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "libavutil/crc.h"
|
#include "libavutil/crc.h"
|
||||||
|
#include "internal.h"
|
||||||
#include "ac3_parser.h"
|
#include "ac3_parser.h"
|
||||||
#include "ac3dec.h"
|
#include "ac3dec.h"
|
||||||
#include "ac3dec_data.h"
|
#include "ac3dec_data.h"
|
||||||
@ -826,7 +827,7 @@ static int decode_audio_block(AC3DecodeContext *s, int blk)
|
|||||||
/* spectral extension strategy */
|
/* spectral extension strategy */
|
||||||
if (s->eac3 && (!blk || get_bits1(gbc))) {
|
if (s->eac3 && (!blk || get_bits1(gbc))) {
|
||||||
if (get_bits1(gbc)) {
|
if (get_bits1(gbc)) {
|
||||||
av_log_missing_feature(s->avctx, "Spectral extension", 1);
|
ff_log_missing_feature(s->avctx, "Spectral extension", 1);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
/* TODO: parse spectral extension strategy info */
|
/* TODO: parse spectral extension strategy info */
|
||||||
@ -851,7 +852,7 @@ static int decode_audio_block(AC3DecodeContext *s, int blk)
|
|||||||
/* check for enhanced coupling */
|
/* check for enhanced coupling */
|
||||||
if (s->eac3 && get_bits1(gbc)) {
|
if (s->eac3 && get_bits1(gbc)) {
|
||||||
/* TODO: parse enhanced coupling strategy info */
|
/* TODO: parse enhanced coupling strategy info */
|
||||||
av_log_missing_feature(s->avctx, "Enhanced coupling", 1);
|
ff_log_missing_feature(s->avctx, "Enhanced coupling", 1);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
|
|
||||||
#define LIBAVCODEC_VERSION_MAJOR 52
|
#define LIBAVCODEC_VERSION_MAJOR 52
|
||||||
#define LIBAVCODEC_VERSION_MINOR 6
|
#define LIBAVCODEC_VERSION_MINOR 6
|
||||||
#define LIBAVCODEC_VERSION_MICRO 0
|
#define LIBAVCODEC_VERSION_MICRO 1
|
||||||
|
|
||||||
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
|
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
|
||||||
LIBAVCODEC_VERSION_MINOR, \
|
LIBAVCODEC_VERSION_MINOR, \
|
||||||
@ -2998,18 +2998,6 @@ int av_parse_video_frame_size(int *width_ptr, int *height_ptr, const char *str);
|
|||||||
*/
|
*/
|
||||||
int av_parse_video_frame_rate(AVRational *frame_rate, const char *str);
|
int av_parse_video_frame_rate(AVRational *frame_rate, const char *str);
|
||||||
|
|
||||||
/**
|
|
||||||
* Logs a generic warning message about a missing feature.
|
|
||||||
* @param[in] avc a pointer to an arbitrary struct of which the first field is
|
|
||||||
* a pointer to an AVClass struct
|
|
||||||
* @param[in] feature string containing the name of the missing feature
|
|
||||||
* @param[in] want_sample indicates if samples are wanted which exhibit this feature.
|
|
||||||
* If \p want_sample is non-zero, additional verbage will be added to the log
|
|
||||||
* message which tells the user how to report samples to the development
|
|
||||||
* mailing list.
|
|
||||||
*/
|
|
||||||
void av_log_missing_feature(void *avc, const char *feature, int want_sample);
|
|
||||||
|
|
||||||
/* error handling */
|
/* error handling */
|
||||||
#if EINVAL > 0
|
#if EINVAL > 0
|
||||||
#define AVERROR(e) (-(e)) /**< Returns a negative error code from a POSIX error code, to return from library functions. */
|
#define AVERROR(e) (-(e)) /**< Returns a negative error code from a POSIX error code, to return from library functions. */
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "avcodec.h"
|
#include "avcodec.h"
|
||||||
|
#include "internal.h"
|
||||||
#include "ac3.h"
|
#include "ac3.h"
|
||||||
#include "ac3_parser.h"
|
#include "ac3_parser.h"
|
||||||
#include "ac3dec.h"
|
#include "ac3dec.h"
|
||||||
@ -182,7 +183,7 @@ int ff_eac3_parse_header(AC3DecodeContext *s)
|
|||||||
application can select from. each independent stream can also contain
|
application can select from. each independent stream can also contain
|
||||||
dependent streams which are used to add or replace channels. */
|
dependent streams which are used to add or replace channels. */
|
||||||
if (s->frame_type == EAC3_FRAME_TYPE_DEPENDENT) {
|
if (s->frame_type == EAC3_FRAME_TYPE_DEPENDENT) {
|
||||||
av_log_missing_feature(s->avctx, "Dependent substream decoding", 1);
|
ff_log_missing_feature(s->avctx, "Dependent substream decoding", 1);
|
||||||
return AC3_PARSE_ERROR_FRAME_TYPE;
|
return AC3_PARSE_ERROR_FRAME_TYPE;
|
||||||
} else if (s->frame_type == EAC3_FRAME_TYPE_RESERVED) {
|
} else if (s->frame_type == EAC3_FRAME_TYPE_RESERVED) {
|
||||||
av_log(s->avctx, AV_LOG_ERROR, "Reserved frame type\n");
|
av_log(s->avctx, AV_LOG_ERROR, "Reserved frame type\n");
|
||||||
@ -194,7 +195,7 @@ int ff_eac3_parse_header(AC3DecodeContext *s)
|
|||||||
associated to an independent stream have matching substream id's. */
|
associated to an independent stream have matching substream id's. */
|
||||||
if (s->substreamid) {
|
if (s->substreamid) {
|
||||||
/* only decode substream with id=0. skip any additional substreams. */
|
/* only decode substream with id=0. skip any additional substreams. */
|
||||||
av_log_missing_feature(s->avctx, "Additional substreams", 1);
|
ff_log_missing_feature(s->avctx, "Additional substreams", 1);
|
||||||
return AC3_PARSE_ERROR_FRAME_TYPE;
|
return AC3_PARSE_ERROR_FRAME_TYPE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -203,7 +204,7 @@ int ff_eac3_parse_header(AC3DecodeContext *s)
|
|||||||
rates in bit allocation. The best assumption would be that it is
|
rates in bit allocation. The best assumption would be that it is
|
||||||
handled like AC-3 DolbyNet, but we cannot be sure until we have a
|
handled like AC-3 DolbyNet, but we cannot be sure until we have a
|
||||||
sample which utilizes this feature. */
|
sample which utilizes this feature. */
|
||||||
av_log_missing_feature(s->avctx, "Reduced sampling rates", 1);
|
ff_log_missing_feature(s->avctx, "Reduced sampling rates", 1);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
skip_bits(gbc, 5); // skip bitstream id
|
skip_bits(gbc, 5); // skip bitstream id
|
||||||
@ -460,7 +461,7 @@ int ff_eac3_parse_header(AC3DecodeContext *s)
|
|||||||
|
|
||||||
/* spectral extension attenuation data */
|
/* spectral extension attenuation data */
|
||||||
if (parse_spx_atten_data) {
|
if (parse_spx_atten_data) {
|
||||||
av_log_missing_feature(s->avctx, "Spectral extension attenuation", 1);
|
ff_log_missing_feature(s->avctx, "Spectral extension attenuation", 1);
|
||||||
for (ch = 1; ch <= s->fbw_channels; ch++) {
|
for (ch = 1; ch <= s->fbw_channels; ch++) {
|
||||||
if (get_bits1(gbc)) { // channel has spx attenuation
|
if (get_bits1(gbc)) { // channel has spx attenuation
|
||||||
skip_bits(gbc, 5); // skip spx attenuation code
|
skip_bits(gbc, 5); // skip spx attenuation code
|
||||||
@ -476,7 +477,7 @@ int ff_eac3_parse_header(AC3DecodeContext *s)
|
|||||||
It is likely the offset of each block within the frame. */
|
It is likely the offset of each block within the frame. */
|
||||||
int block_start_bits = (s->num_blocks-1) * (4 + av_log2(s->frame_size-2));
|
int block_start_bits = (s->num_blocks-1) * (4 + av_log2(s->frame_size-2));
|
||||||
skip_bits_long(gbc, block_start_bits);
|
skip_bits_long(gbc, block_start_bits);
|
||||||
av_log_missing_feature(s->avctx, "Block start info", 1);
|
ff_log_missing_feature(s->avctx, "Block start info", 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* syntax state initialization */
|
/* syntax state initialization */
|
||||||
|
39
libavcodec/internal.h
Normal file
39
libavcodec/internal.h
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of FFmpeg.
|
||||||
|
*
|
||||||
|
* FFmpeg is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 2.1 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* FFmpeg is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with FFmpeg; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @file internal.h
|
||||||
|
* common internal api header.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef AVCODEC_INTERNAL_H
|
||||||
|
#define AVCODEC_INTERNAL_H
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Logs a generic warning message about a missing feature.
|
||||||
|
* @param[in] avc a pointer to an arbitrary struct of which the first field is
|
||||||
|
* a pointer to an AVClass struct
|
||||||
|
* @param[in] feature string containing the name of the missing feature
|
||||||
|
* @param[in] want_sample indicates if samples are wanted which exhibit this feature.
|
||||||
|
* If \p want_sample is non-zero, additional verbage will be added to the log
|
||||||
|
* message which tells the user how to report samples to the development
|
||||||
|
* mailing list.
|
||||||
|
*/
|
||||||
|
void ff_log_missing_feature(void *avc, const char *feature, int want_sample);
|
||||||
|
|
||||||
|
#endif /* AVCODEC_INTERNAL_H */
|
@ -30,6 +30,7 @@
|
|||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
|
||||||
#include "avcodec.h"
|
#include "avcodec.h"
|
||||||
|
#include "internal.h"
|
||||||
#include "bitstream.h"
|
#include "bitstream.h"
|
||||||
|
|
||||||
#include "qcelpdata.h"
|
#include "qcelpdata.h"
|
||||||
@ -442,7 +443,7 @@ static void apply_gain_ctrl(float *v_out, const float *v_ref,
|
|||||||
scalefactor = sqrt(ff_dot_productf(v_ref + j, v_ref + j, 40)
|
scalefactor = sqrt(ff_dot_productf(v_ref + j, v_ref + j, 40)
|
||||||
/ scalefactor);
|
/ scalefactor);
|
||||||
else
|
else
|
||||||
av_log_missing_feature(NULL, "Zero energy for gain control", 1);
|
ff_log_missing_feature(NULL, "Zero energy for gain control", 1);
|
||||||
for(len=j+40; j<len; j++)
|
for(len=j+40; j<len; j++)
|
||||||
v_out[j] = scalefactor * v_in[j];
|
v_out[j] = scalefactor * v_in[j];
|
||||||
}
|
}
|
||||||
@ -655,7 +656,7 @@ static int determine_bitrate(AVCodecContext *avctx, const int buf_size,
|
|||||||
if(bitrate == SILENCE)
|
if(bitrate == SILENCE)
|
||||||
{
|
{
|
||||||
// FIXME: the decoder should not handle SILENCE frames as I_F_Q frames
|
// FIXME: the decoder should not handle SILENCE frames as I_F_Q frames
|
||||||
av_log_missing_feature(avctx, "Blank frame", 1);
|
ff_log_missing_feature(avctx, "Blank frame", 1);
|
||||||
bitrate = I_F_Q;
|
bitrate = I_F_Q;
|
||||||
}
|
}
|
||||||
return bitrate;
|
return bitrate;
|
||||||
|
@ -1508,7 +1508,7 @@ int av_parse_video_frame_rate(AVRational *frame_rate, const char *arg)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void av_log_missing_feature(void *avc, const char *feature, int want_sample)
|
void ff_log_missing_feature(void *avc, const char *feature, int want_sample)
|
||||||
{
|
{
|
||||||
av_log(avc, AV_LOG_WARNING, "%s not implemented. Update your FFmpeg "
|
av_log(avc, AV_LOG_WARNING, "%s not implemented. Update your FFmpeg "
|
||||||
"version to the newest one from SVN. If the problem still "
|
"version to the newest one from SVN. If the problem still "
|
||||||
|
Loading…
x
Reference in New Issue
Block a user