1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

Merge remote-tracking branch 'qatar/master'

* qatar/master:
  build: ppc: drop stray leftover backslash
  build: Only clean the architecture subdirectory we build for.
  build: drop some unnecessary dependencies from the H.264 parser
  build: prettyprinting cosmetics
  libavutil: Remove pointless rational test program.
  libavutil: Remove broken and pointless lzo test program.
  lavf doxy: expand AVStream.codec doxy.
  lavf doxy: improve AVStream.time_base doxy.
  lavf doxy: add some basic documentation about reading from the demuxer.
  lavf doxy: document passing options to demuxers.
  lavf doxy: clarify that an AVPacket contains encoded data.
  mpegtsenc: allow user triggered PES packet flushing
  APIchanges: mark the place where 0.7 was cut.
  APIchanges: mark the place where 0.8 was cut.
  APIchanges: fill in missing dates and hashes.
  smacker: convert palette and header reading to bytestream2.
  alac: convert extradata reading to bytestream2.

Conflicts:
	doc/APIchanges
	libavcodec/smacker.c
	libavcodec/x86/Makefile
	libavfilter/Makefile
	libavutil/Makefile

Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2012-03-26 20:34:29 +02:00
commit 7e496e1545
19 changed files with 257 additions and 172 deletions

View File

@ -64,9 +64,10 @@ config.h: .config
@-printf '\nWARNING: $(?F) newer than config.h, rerun configure\n\n'
@-tput sgr0 2>/dev/null
SUBDIR_VARS := OBJS FFLIBS CLEANFILES DIRS TESTPROGS EXAMPLES SKIPHEADERS \
ALTIVEC-OBJS MMX-OBJS NEON-OBJS YASM-OBJS \
HOSTPROGS BUILT_HEADERS TESTOBJS ARCH_HEADERS ARMV6-OBJS TOOLS
SUBDIR_VARS := CLEANFILES EXAMPLES FFLIBS HOSTPROGS TESTPROGS TOOLS \
ARCH_HEADERS BUILT_HEADERS SKIPHEADERS \
ALTIVEC-OBJS ARMV6-OBJS MMX-OBJS NEON-OBJS YASM-OBJS \
OBJS TESTOBJS
define RESET
$(1) :=

2
configure vendored
View File

@ -1545,7 +1545,7 @@ vda_deps="VideoDecodeAcceleration_VDADecoder_h pthreads"
vdpau_deps="vdpau_vdpau_h vdpau_vdpau_x11_h"
# parsers
h264_parser_select="golomb h264chroma h264dsp h264pred h264qpel"
h264_parser_select="golomb h264dsp h264pred"
# external libraries
libaacplus_encoder_deps="libaacplus"

View File

@ -38,22 +38,23 @@ API changes, most recent first:
2012-01-24 - xxxxxxx - lavfi 2.60.100
Add avfilter_graph_dump.
2012-xx-xx - lavc 54.8.0
xxxxxxx Add av_get_exact_bits_per_sample()
xxxxxxx Add av_get_audio_frame_duration()
2012-03-05 - lavc 54.8.0
6699d07 Add av_get_exact_bits_per_sample()
9524cf7 Add av_get_audio_frame_duration()
2012-03-xx - xxxxxxx - lavc 54.7.0 - avcodec.h
2012-03-04 - 44fe77b - lavc 54.7.0 - avcodec.h
Add av_codec_is_encoder/decoder().
2012-xx-xx - xxxxxxx - lavc 54.3.0 - avcodec.h
2012-03-01 - 442c132 - lavc 54.3.0 - avcodec.h
Add av_packet_shrink_side_data.
2012-xx-xx - xxxxxxx - lavf 54.2.0 - avformat.h
2012-02-29 - dd2a4bc - lavf 54.2.0 - avformat.h
Add AVStream.attached_pic and AV_DISPOSITION_ATTACHED_PIC,
used for dealing with attached pictures/cover art.
2012-02-25 - c9bca80 - lavu 51.24.0 - error.h
Add AVERROR_UNKNOWN
NOTE: this was backported to 0.8
2012-02-20 - e9cda85 - lavc 54.2.0
Add duration field to AVCodecParserContext
@ -74,13 +75,16 @@ API changes, most recent first:
2012-01-31 - dd6d3b0 - lavf 54.01.0
Add avformat_get_riff_video_tags() and avformat_get_riff_audio_tags().
NOTE: this was backported to 0.8
2012-01-31 - af08d9a - lavc 54.01.0
Add avcodec_is_open() function.
NOTE: this was backported to 0.8
2012-01-30 - 8b93312 - lavu 51.22.0 - intfloat.h
Add a new installed header libavutil/intfloat.h with int/float punning
functions.
NOTE: this was backported to 0.8
2012-01-25 - lavf 53.22.0
f1caf01 Allow doing av_write_frame(ctx, NULL) for flushing possible
@ -286,9 +290,12 @@ API changes, most recent first:
2011-07-10 - a67c061 - lavf 53.6.0
Add avformat_find_stream_info(), deprecate av_find_stream_info().
NOTE: this was backported to 0.7
2011-07-10 - 0b950fe - lavc 53.8.0
Add avcodec_open2(), deprecate avcodec_open().
NOTE: this was backported to 0.7
Add avcodec_alloc_context3. Deprecate avcodec_alloc_context() and
avcodec_alloc_context2().

View File

@ -763,8 +763,6 @@ HOSTPROGS = aac_tablegen aacps_tablegen cbrt_tablegen cos_tablegen \
dv_tablegen motionpixels_tablegen mpegaudio_tablegen \
pcm_tablegen qdm2_tablegen sinewin_tablegen
DIRS = alpha arm avr32 bfin mips ppc sh4 sparc x86
CLEANFILES = *_tables.c *_tables.h *_tablegen$(HOSTEXESUF)
$(SUBDIR)dct-test$(EXESUF): $(SUBDIR)dctref.o

View File

@ -602,29 +602,30 @@ buf_alloc_fail:
static int alac_set_info(ALACContext *alac)
{
const unsigned char *ptr = alac->avctx->extradata;
GetByteContext gb;
ptr += 4; /* size */
ptr += 4; /* alac */
ptr += 4; /* version */
bytestream2_init(&gb, alac->avctx->extradata,
alac->avctx->extradata_size);
if(AV_RB32(ptr) >= UINT_MAX/4){
av_log(alac->avctx, AV_LOG_ERROR, "setinfo_max_samples_per_frame too large\n");
return -1;
}
bytestream2_skipu(&gb, 12); // size:4, alac:4, version:4
/* buffer size / 2 ? */
alac->setinfo_max_samples_per_frame = bytestream_get_be32(&ptr);
ptr++; /* compatible version */
alac->setinfo_sample_size = *ptr++;
alac->setinfo_rice_historymult = *ptr++;
alac->setinfo_rice_initialhistory = *ptr++;
alac->setinfo_rice_kmodifier = *ptr++;
alac->numchannels = *ptr++;
bytestream_get_be16(&ptr); /* maxRun */
bytestream_get_be32(&ptr); /* max coded frame size */
bytestream_get_be32(&ptr); /* average bitrate */
bytestream_get_be32(&ptr); /* samplerate */
alac->setinfo_max_samples_per_frame = bytestream2_get_be32u(&gb);
if (alac->setinfo_max_samples_per_frame >= UINT_MAX/4){
av_log(alac->avctx, AV_LOG_ERROR,
"setinfo_max_samples_per_frame too large\n");
return AVERROR_INVALIDDATA;
}
bytestream2_skipu(&gb, 1); // compatible version
alac->setinfo_sample_size = bytestream2_get_byteu(&gb);
alac->setinfo_rice_historymult = bytestream2_get_byteu(&gb);
alac->setinfo_rice_initialhistory = bytestream2_get_byteu(&gb);
alac->setinfo_rice_kmodifier = bytestream2_get_byteu(&gb);
alac->numchannels = bytestream2_get_byteu(&gb);
bytestream2_get_be16u(&gb); // maxRun
bytestream2_get_be32u(&gb); // max coded frame size
bytestream2_get_be32u(&gb); // average bitrate
bytestream2_get_be32u(&gb); // samplerate
return 0;
}

View File

@ -1,19 +1,16 @@
OBJS += ppc/dsputil_ppc.o \
FFT-OBJS-$(HAVE_GNU_AS) += ppc/fft_altivec_s.o
ALTIVEC-OBJS-$(CONFIG_FFT) += ppc/fft_altivec.o \
$(FFT-OBJS-yes)
ALTIVEC-OBJS-$(CONFIG_H264DSP) += ppc/h264_altivec.o
ALTIVEC-OBJS-$(CONFIG_MPEGAUDIODSP) += ppc/mpegaudiodec_altivec.o
ALTIVEC-OBJS-$(CONFIG_VC1_DECODER) += ppc/vc1dsp_altivec.o
ALTIVEC-OBJS-$(CONFIG_VP3_DECODER) += ppc/vp3dsp_altivec.o
ALTIVEC-OBJS-$(CONFIG_VP5_DECODER) += ppc/vp3dsp_altivec.o
ALTIVEC-OBJS-$(CONFIG_VP6_DECODER) += ppc/vp3dsp_altivec.o
ALTIVEC-OBJS-$(CONFIG_VP8_DECODER) += ppc/vp8dsp_altivec.o
ALTIVEC-OBJS-$(CONFIG_MPEGAUDIODSP) += ppc/mpegaudiodec_altivec.o
FFT-OBJS-$(HAVE_GNU_AS) += ppc/fft_altivec_s.o \
ALTIVEC-OBJS-$(CONFIG_FFT) += ppc/fft_altivec.o \
$(FFT-OBJS-yes)
OBJS-$(HAVE_ALTIVEC) += ppc/dsputil_altivec.o \
ppc/fdct_altivec.o \
ppc/float_altivec.o \

View File

@ -362,17 +362,17 @@ static av_always_inline int smk_get_code(GetBitContext *gb, int *recode, int *la
static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt)
{
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
SmackVContext * const smk = avctx->priv_data;
uint8_t *out;
uint32_t *pal;
GetByteContext gb2;
GetBitContext gb;
int blocks, blk, bw, bh;
int i;
int stride;
int flags;
if(buf_size <= 769)
if (avpkt->size <= 769)
return 0;
smk->pic.reference = 3;
@ -384,23 +384,23 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
/* make the palette available on the way out */
pal = (uint32_t*)smk->pic.data[1];
smk->pic.palette_has_changed = buf[0] & 1;
smk->pic.key_frame = !!(buf[0] & 2);
bytestream2_init(&gb2, avpkt->data, avpkt->size);
flags = bytestream2_get_byteu(&gb2);
smk->pic.palette_has_changed = flags & 1;
smk->pic.key_frame = !!(flags & 2);
if(smk->pic.key_frame)
smk->pic.pict_type = AV_PICTURE_TYPE_I;
else
smk->pic.pict_type = AV_PICTURE_TYPE_P;
buf++;
for(i = 0; i < 256; i++)
*pal++ = 0xFF << 24 | bytestream_get_be24(&buf);
buf_size -= 769;
*pal++ = 0xFF << 24 | bytestream2_get_be24u(&gb2);
last_reset(smk->mmap_tbl, smk->mmap_last);
last_reset(smk->mclr_tbl, smk->mclr_last);
last_reset(smk->full_tbl, smk->full_last);
last_reset(smk->type_tbl, smk->type_last);
init_get_bits(&gb, buf, buf_size * 8);
init_get_bits(&gb, avpkt->data + 769, (avpkt->size - 769) * 8);
blk = 0;
bw = avctx->width >> 2;
@ -511,7 +511,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
*(AVFrame*)data = smk->pic;
/* always report that the buffer was completely consumed */
return buf_size;
return avpkt->size;
}

View File

@ -1,80 +1,6 @@
OBJS-$(CONFIG_MLP_DECODER) += x86/mlpdsp.o
OBJS-$(CONFIG_TRUEHD_DECODER) += x86/mlpdsp.o
YASM-OBJS-$(CONFIG_DCT) += x86/dct32_sse.o
YASM-OBJS-FFT-$(HAVE_AMD3DNOW) += x86/fft_3dn.o
YASM-OBJS-FFT-$(HAVE_AMD3DNOWEXT) += x86/fft_3dn2.o
YASM-OBJS-FFT-$(HAVE_SSE) += x86/fft_sse.o
YASM-OBJS-$(CONFIG_FFT) += x86/fft_mmx.o \
$(YASM-OBJS-FFT-yes)
YASM-OBJS-$(CONFIG_DWT) += x86/dwt_yasm.o
YASM-OBJS-$(CONFIG_H264CHROMA) += x86/h264_chromamc.o \
x86/h264_chromamc_10bit.o
MMX-OBJS-$(CONFIG_H264DSP) += x86/h264dsp_mmx.o
YASM-OBJS-$(CONFIG_H264DSP) += x86/h264_deblock.o \
x86/h264_deblock_10bit.o \
x86/h264_idct.o \
x86/h264_idct_10bit.o \
x86/h264_weight.o \
x86/h264_weight_10bit.o \
YASM-OBJS-$(CONFIG_H264PRED) += x86/h264_intrapred.o \
x86/h264_intrapred_10bit.o
MMX-OBJS-$(CONFIG_H264PRED) += x86/h264_intrapred_init.o
YASM-OBJS-$(CONFIG_H264QPEL) += x86/h264_qpel_10bit.o
MMX-OBJS-$(CONFIG_RV30_DECODER) += x86/rv34dsp_init.o
YASM-OBJS-$(CONFIG_RV30_DECODER) += x86/rv34dsp.o
MMX-OBJS-$(CONFIG_RV40_DECODER) += x86/rv34dsp_init.o \
x86/rv40dsp_init.o
YASM-OBJS-$(CONFIG_RV40_DECODER) += x86/rv34dsp.o \
x86/rv40dsp.o
YASM-OBJS-$(CONFIG_VC1_DECODER) += x86/vc1dsp_yasm.o
YASM-OBJS-$(CONFIG_DIRAC_DECODER) += x86/diracdsp_mmx.o x86/diracdsp_yasm.o
MMX-OBJS-$(CONFIG_AC3DSP) += x86/ac3dsp_mmx.o
YASM-OBJS-$(CONFIG_AC3DSP) += x86/ac3dsp.o
MMX-OBJS-$(CONFIG_CAVS_DECODER) += x86/cavsdsp_mmx.o
MMX-OBJS-$(CONFIG_DNXHD_ENCODER) += x86/dnxhd_mmx.o
MMX-OBJS-$(CONFIG_MPEGAUDIODSP) += x86/mpegaudiodec_mmx.o
YASM-OBJS-$(CONFIG_MPEGAUDIODSP) += x86/imdct36_sse.o
MMX-OBJS-$(CONFIG_ENCODERS) += x86/dsputilenc_mmx.o
YASM-OBJS-$(CONFIG_ENCODERS) += x86/dsputilenc_yasm.o
MMX-OBJS-$(CONFIG_GPL) += x86/idct_mmx.o
MMX-OBJS-$(CONFIG_LPC) += x86/lpc_mmx.o
YASM-OBJS-$(CONFIG_PRORES_LGPL_DECODER) += x86/proresdsp.o
MMX-OBJS-$(CONFIG_PRORES_LGPL_DECODER) += x86/proresdsp-init.o
YASM-OBJS-$(CONFIG_PNG_DECODER) += x86/pngdsp.o
MMX-OBJS-$(CONFIG_PNG_DECODER) += x86/pngdsp-init.o
YASM-OBJS-$(CONFIG_PRORES_DECODER) += x86/proresdsp.o
MMX-OBJS-$(CONFIG_PRORES_DECODER) += x86/proresdsp-init.o
MMX-OBJS-$(CONFIG_AAC_DECODER) += x86/sbrdsp_init.o
YASM-OBJS-$(CONFIG_AAC_DECODER) += x86/sbrdsp.o
MMX-OBJS-$(CONFIG_DWT) += x86/snowdsp_mmx.o \
x86/dwt.o
YASM-OBJS-$(CONFIG_V210_DECODER) += x86/v210.o
MMX-OBJS-$(CONFIG_V210_DECODER) += x86/v210-init.o
MMX-OBJS-$(CONFIG_VC1_DECODER) += x86/vc1dsp_mmx.o
YASM-OBJS-$(CONFIG_VP3_DECODER) += x86/vp3dsp.o
YASM-OBJS-$(CONFIG_VP5_DECODER) += x86/vp3dsp.o
MMX-OBJS-$(CONFIG_VP5_DECODER) += x86/vp56dsp_init.o
YASM-OBJS-$(CONFIG_VP6_DECODER) += x86/vp3dsp.o \
x86/vp56dsp.o
MMX-OBJS-$(CONFIG_VP6_DECODER) += x86/vp56dsp_init.o
YASM-OBJS-$(CONFIG_VP8_DECODER) += x86/vp8dsp.o
MMX-OBJS-$(CONFIG_VP8_DECODER) += x86/vp8dsp-init.o
MMX-OBJS-$(HAVE_YASM) += x86/dsputil_yasm.o \
x86/deinterlace.o \
x86/fmtconvert.o \
$(YASM-OBJS-yes)
MMX-OBJS-$(CONFIG_FFT) += x86/fft.o
OBJS-$(CONFIG_XMM_CLOBBER_TEST) += x86/w64xmmtest.o
OBJS-$(HAVE_MMX) += x86/dsputil_mmx.o \
x86/fdct_mmx.o \
@ -85,4 +11,70 @@ OBJS-$(HAVE_MMX) += x86/dsputil_mmx.o \
x86/mpegvideo_mmx.o \
x86/simple_idct_mmx.o \
OBJS-$(CONFIG_XMM_CLOBBER_TEST) += x86/w64xmmtest.o
MMX-OBJS-$(CONFIG_AAC_DECODER) += x86/sbrdsp_init.o
MMX-OBJS-$(CONFIG_AC3DSP) += x86/ac3dsp_mmx.o
MMX-OBJS-$(CONFIG_CAVS_DECODER) += x86/cavsdsp_mmx.o
MMX-OBJS-$(CONFIG_DNXHD_ENCODER) += x86/dnxhd_mmx.o
MMX-OBJS-$(CONFIG_DWT) += x86/snowdsp_mmx.o \
x86/dwt.o
MMX-OBJS-$(CONFIG_ENCODERS) += x86/dsputilenc_mmx.o
MMX-OBJS-$(CONFIG_FFT) += x86/fft.o
MMX-OBJS-$(CONFIG_GPL) += x86/idct_mmx.o
MMX-OBJS-$(CONFIG_H264DSP) += x86/h264dsp_mmx.o
MMX-OBJS-$(CONFIG_H264PRED) += x86/h264_intrapred_init.o
MMX-OBJS-$(CONFIG_LPC) += x86/lpc_mmx.o
MMX-OBJS-$(CONFIG_MPEGAUDIODSP) += x86/mpegaudiodec_mmx.o
MMX-OBJS-$(CONFIG_PNG_DECODER) += x86/pngdsp-init.o
MMX-OBJS-$(CONFIG_PRORES_DECODER) += x86/proresdsp-init.o
MMX-OBJS-$(CONFIG_PRORES_LGPL_DECODER) += x86/proresdsp-init.o
MMX-OBJS-$(CONFIG_RV30_DECODER) += x86/rv34dsp_init.o
MMX-OBJS-$(CONFIG_RV40_DECODER) += x86/rv34dsp_init.o \
x86/rv40dsp_init.o
MMX-OBJS-$(CONFIG_V210_DECODER) += x86/v210-init.o
MMX-OBJS-$(CONFIG_VC1_DECODER) += x86/vc1dsp_mmx.o
MMX-OBJS-$(CONFIG_VP5_DECODER) += x86/vp56dsp_init.o
MMX-OBJS-$(CONFIG_VP6_DECODER) += x86/vp56dsp_init.o
MMX-OBJS-$(CONFIG_VP8_DECODER) += x86/vp8dsp-init.o
YASM-OBJS-$(CONFIG_AAC_DECODER) += x86/sbrdsp.o
YASM-OBJS-$(CONFIG_AC3DSP) += x86/ac3dsp.o
YASM-OBJS-$(CONFIG_DCT) += x86/dct32_sse.o
YASM-OBJS-$(CONFIG_DIRAC_DECODER) += x86/diracdsp_mmx.o x86/diracdsp_yasm.o
YASM-OBJS-$(CONFIG_ENCODERS) += x86/dsputilenc_yasm.o
YASM-OBJS-FFT-$(HAVE_AMD3DNOW) += x86/fft_3dn.o
YASM-OBJS-FFT-$(HAVE_AMD3DNOWEXT) += x86/fft_3dn2.o
YASM-OBJS-FFT-$(HAVE_SSE) += x86/fft_sse.o
YASM-OBJS-$(CONFIG_FFT) += x86/fft_mmx.o \
$(YASM-OBJS-FFT-yes)
YASM-OBJS-$(CONFIG_DWT) += x86/dwt_yasm.o
YASM-OBJS-$(CONFIG_H264CHROMA) += x86/h264_chromamc.o \
x86/h264_chromamc_10bit.o
YASM-OBJS-$(CONFIG_H264DSP) += x86/h264_deblock.o \
x86/h264_deblock_10bit.o \
x86/h264_idct.o \
x86/h264_idct_10bit.o \
x86/h264_weight.o \
x86/h264_weight_10bit.o
YASM-OBJS-$(CONFIG_H264PRED) += x86/h264_intrapred.o \
x86/h264_intrapred_10bit.o
YASM-OBJS-$(CONFIG_H264QPEL) += x86/h264_qpel_10bit.o
YASM-OBJS-$(CONFIG_MPEGAUDIODSP) += x86/imdct36_sse.o
YASM-OBJS-$(CONFIG_PNG_DECODER) += x86/pngdsp.o
YASM-OBJS-$(CONFIG_PRORES_DECODER) += x86/proresdsp.o
YASM-OBJS-$(CONFIG_PRORES_LGPL_DECODER) += x86/proresdsp.o
YASM-OBJS-$(CONFIG_RV30_DECODER) += x86/rv34dsp.o
YASM-OBJS-$(CONFIG_RV40_DECODER) += x86/rv34dsp.o \
x86/rv40dsp.o
YASM-OBJS-$(CONFIG_V210_DECODER) += x86/v210.o
YASM-OBJS-$(CONFIG_VC1_DECODER) += x86/vc1dsp_yasm.o
YASM-OBJS-$(CONFIG_VP3_DECODER) += x86/vp3dsp.o
YASM-OBJS-$(CONFIG_VP5_DECODER) += x86/vp3dsp.o
YASM-OBJS-$(CONFIG_VP6_DECODER) += x86/vp3dsp.o \
x86/vp56dsp.o
YASM-OBJS-$(CONFIG_VP8_DECODER) += x86/vp8dsp.o
MMX-OBJS-$(HAVE_YASM) += x86/dsputil_yasm.o \
x86/deinterlace.o \
x86/fmtconvert.o \
$(YASM-OBJS-yes)

View File

@ -168,8 +168,6 @@ OBJS-$(CONFIG_MP_FILTER) += libmpcodecs/vf_yvu9.o
OBJS-$(CONFIG_MP_FILTER) += libmpcodecs/pullup.o
DIRS = x86 libmpcodecs
TESTPROGS = drawutils formats
TOOLS = graph2dot lavfi-showfiltfmts

View File

@ -6,6 +6,8 @@ FFLIBS = avcodec avutil
HEADERS = avformat.h avio.h version.h
OBJS = allformats.o \
avio.o \
aviobuf.o \
cutils.o \
id3v1.o \
id3v2.o \
@ -351,8 +353,6 @@ OBJS-$(CONFIG_LIBNUT_MUXER) += libnut.o
OBJS-$(CONFIG_LIBRTMP) += librtmp.o
# protocols I/O
OBJS+= avio.o aviobuf.o
OBJS-$(CONFIG_APPLEHTTP_PROTOCOL) += hlsproto.o
OBJS-$(CONFIG_BLURAY_PROTOCOL) += bluray.o
OBJS-$(CONFIG_CACHE_PROTOCOL) += cache.o

View File

@ -66,11 +66,23 @@
* set by user for input, always set by user for output (unless you are dealing
* with an AVFMT_NOFILE format).
*
* @section lavf_options Passing options to (de)muxers
* Lavf allows to configure muxers and demuxers using the @ref avoptions
* mechanism. Generic (format-independent) libavformat options are provided by
* AVFormatContext, they can be examined from a user program by calling
* av_opt_next() / av_opt_find() on an allocated AVFormatContext (or its AVClass
* from avformat_get_class()). Private (format-specific) options are provided by
* AVFormatContext.priv_data if and only if AVInputFormat.priv_class /
* AVOutputFormat.priv_class of the corresponding format struct is non-NULL.
* Further options may be provided by the @ref AVFormatContext.pb "I/O context",
* if its AVClass is non-NULL, and the protocols layer. See the discussion on
* nesting in @ref avoptions documentation to learn how to access those.
*
* @defgroup lavf_decoding Demuxing
* @{
* Demuxers read a media file and split it into chunks of data (@em packets). A
* @ref AVPacket "packet" contains one or more frames which belong a single
* elementary stream. In lavf API this process is represented by the
* @ref AVPacket "packet" contains one or more encoded frames which belongs to a
* single elementary stream. In the lavf API this process is represented by the
* avformat_open_input() function for opening a file, av_read_frame() for
* reading a single packet and finally avformat_close_input(), which does the
* cleanup.
@ -100,10 +112,55 @@
* your reading callbacks to it. Then set the @em pb field of your
* AVFormatContext to newly created AVIOContext.
*
* Since the format of the opened file is in general not known until after
* avformat_open_input() has returned, it is not possible to set demuxer private
* options on a preallocated context. Instead, the options should be passed to
* avformat_open_input() wrapped in an AVDictionary:
* @code
* AVDictionary *options = NULL;
* av_dict_set(&options, "video_size", "640x480", 0);
* av_dict_set(&options, "pixel_format", "rgb24", 0);
*
* if (avformat_open_input(&s, url, NULL, &options) < 0)
* abort();
* av_dict_free(&options);
* @endcode
* This code passes the private options 'video_size' and 'pixel_format' to the
* demuxer. They would be necessary for e.g. the rawvideo demuxer, since it
* cannot know how to interpret raw video data otherwise. If the format turns
* out to be something different than raw video, those options will not be
* recognized by the demuxer and therefore will not be applied. Such unrecognized
* options are then returned in the options dictionary (recognized options are
* consumed). The calling program can handle such unrecognized options as it
* wishes, e.g.
* @code
* AVDictionaryEntry *e;
* if (e = av_dict_get(options, "", NULL, AV_DICT_IGNORE_SUFFIX)) {
* fprintf(stderr, "Option %s not recognized by the demuxer.\n", e->key);
* abort();
* }
* @endcode
*
* After you have finished reading the file, you must close it with
* avformat_close_input(). It will free everything associated with the file.
*
* @section lavf_decoding_read Reading from an opened file
* Reading data from an opened AVFormatContext is done by repeatedly calling
* av_read_frame() on it. Each call, if successful, will return an AVPacket
* containing encoded data for one AVStream, identified by
* AVPacket.stream_index. This packet may be passed straight into the libavcodec
* decoding functions avcodec_decode_video2(), avcodec_decode_audio4() or
* avcodec_decode_subtitle2() if the caller wishes to decode the data.
*
* AVPacket.pts, AVPacket.dts and AVPacket.duration timing information will be
* set if known. They may also be unset (i.e. AV_NOPTS_VALUE for
* pts/dts, 0 for duration) if the stream does not provide them. The timing
* information will be in AVStream.time_base units, i.e. it has to be
* multiplied by the timebase to convert them to seconds.
*
* The packet data belongs to the demuxer and is invalid after the next call to
* av_read_frame(). The user must free the packet with av_free_packet() before
* calling av_read_frame() again or closing the file.
*
* @section lavf_decoding_seek Seeking
* @}
@ -564,7 +621,18 @@ typedef struct AVStream {
* encoding: set by the user
*/
int id;
AVCodecContext *codec; /**< codec context */
/**
* Codec context associated with this stream. Allocated and freed by
* libavformat.
*
* - decoding: The demuxer exports codec information stored in the headers
* here.
* - encoding: The user sets codec information, the muxer writes it to the
* output. Mandatory fields as specified in AVCodecContext
* documentation must be set even if this AVCodecContext is
* not actually used for encoding.
*/
AVCodecContext *codec;
/**
* Real base framerate of the stream.
* This is the lowest framerate with which all timestamps can be
@ -583,10 +651,12 @@ typedef struct AVStream {
/**
* This is the fundamental unit of time (in seconds) in terms
* of which frame timestamps are represented. For fixed-fps content,
* time base should be 1/framerate and timestamp increments should be 1.
* of which frame timestamps are represented.
*
* decoding: set by libavformat
* encoding: set by libavformat in av_write_header
* encoding: set by libavformat in av_write_header. The muxer may use the
* user-provided value of @ref AVCodecContext.time_base "codec->time_base"
* as a hint.
*/
AVRational time_base;

View File

@ -974,7 +974,7 @@ static void mpegts_write_pes(AVFormatContext *s, AVStream *st,
ts_st->prev_payload_key = key;
}
static int mpegts_write_packet(AVFormatContext *s, AVPacket *pkt)
static int mpegts_write_packet_internal(AVFormatContext *s, AVPacket *pkt)
{
AVStream *st = s->streams[pkt->stream_index];
int size = pkt->size;
@ -1091,27 +1091,48 @@ static int mpegts_write_packet(AVFormatContext *s, AVPacket *pkt)
return 0;
}
static int mpegts_write_end(AVFormatContext *s)
static void mpegts_write_flush(AVFormatContext *s)
{
MpegTSWrite *ts = s->priv_data;
MpegTSWriteStream *ts_st;
MpegTSService *service;
AVStream *st;
int i;
/* flush current packets */
for(i = 0; i < s->nb_streams; i++) {
st = s->streams[i];
ts_st = st->priv_data;
AVStream *st = s->streams[i];
MpegTSWriteStream *ts_st = st->priv_data;
if (ts_st->payload_size > 0) {
mpegts_write_pes(s, st, ts_st->payload, ts_st->payload_size,
ts_st->payload_pts, ts_st->payload_dts,
ts_st->payload_flags & AV_PKT_FLAG_KEY);
ts_st->payload_size = 0;
}
}
avio_flush(s->pb);
}
static int mpegts_write_packet(AVFormatContext *s, AVPacket *pkt)
{
if (!pkt) {
mpegts_write_flush(s);
return 1;
} else {
return mpegts_write_packet_internal(s, pkt);
}
}
static int mpegts_write_end(AVFormatContext *s)
{
MpegTSWrite *ts = s->priv_data;
MpegTSService *service;
int i;
mpegts_write_flush(s);
for(i = 0; i < s->nb_streams; i++) {
AVStream *st = s->streams[i];
MpegTSWriteStream *ts_st = st->priv_data;
av_freep(&ts_st->payload);
av_freep(&ts_st->adts);
}
avio_flush(s->pb);
for(i = 0; i < ts->nb_services; i++) {
service = ts->services[i];
@ -1135,5 +1156,6 @@ AVOutputFormat ff_mpegts_muxer = {
.write_header = mpegts_write_header,
.write_packet = mpegts_write_packet,
.write_trailer = mpegts_write_end,
.flags = AVFMT_ALLOW_FLUSH,
.priv_class = &mpegts_muxer_class,
};

View File

@ -82,15 +82,12 @@ OBJS = adler32.o \
OBJS-$(ARCH_PPC) += ppc/cpu.o
OBJS-$(ARCH_X86) += x86/cpu.o
TESTPROGS = adler32 aes avstring base64 bprint cpu crc des eval file fifo \
lfg lls md5 opt pca parseutils random_seed rational sha tree
TESTPROGS-$(HAVE_LZO1X_999_COMPRESS) += lzo
TOOLS = ffeval
DIRS = arm avr32 bfin mips ppc sh4 tomi x86
ARCH_HEADERS = bswap.h intmath.h intreadwrite.h timer.h
$(SUBDIR)lzo-test$(EXESUF): ELIBS = -llzo2

View File

@ -51,12 +51,10 @@ endif
clean::
$(RM) $(addprefix $(SUBDIR),*-example$(EXESUF) *-test$(EXESUF) $(CLEANFILES) $(CLEANSUFFIXES) $(LIBSUFFIXES)) \
$(foreach dir,$(DIRS),$(CLEANSUFFIXES:%=$(SUBDIR)$(dir)/%)) \
$(HOSTOBJS) $(HOSTPROGS)
$(CLEANSUFFIXES:%=$(SUBDIR)$(ARCH)/%) $(HOSTOBJS) $(HOSTPROGS)
distclean:: clean
$(RM) $(DISTCLEANSUFFIXES:%=$(SUBDIR)%) \
$(foreach dir,$(DIRS),$(DISTCLEANSUFFIXES:%=$(SUBDIR)$(dir)/%))
$(RM) $(DISTCLEANSUFFIXES:%=$(SUBDIR)%) $(DISTCLEANSUFFIXES:%=$(SUBDIR)$(ARCH)/%)
install-lib$(NAME)-shared: $(SUBDIR)$(SLIBNAME)
$(Q)mkdir -p "$(SHLIBDIR)"

View File

@ -5,8 +5,14 @@ FFLIBS = avutil
HEADERS = swscale.h
OBJS = input.o options.o output.o rgb2rgb.o swscale.o \
swscale_unscaled.o utils.o yuv2rgb.o
OBJS = input.o \
options.o \
output.o \
rgb2rgb.o \
swscale.o \
swscale_unscaled.o \
utils.o \
yuv2rgb.o \
OBJS-$(ARCH_BFIN) += bfin/internal_bfin.o \
bfin/swscale_bfin.o \
@ -27,5 +33,3 @@ $(SUBDIR)x86/swscale_mmx.o: CFLAGS += $(NOREDZONE_FLAGS)
OBJS-$(CONFIG_XMM_CLOBBER_TEST) += x86/w64xmmtest.o
TESTPROGS = colorspace swscale
DIRS = bfin ppc sparc x86