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: lavfi: add select filter oggdec: fix out of bound write in the ogg demuxer movenc: create an alternate group for each media type lavd: add libcdio-paranoia input device for audio CD grabbing rawdec: refactor private option for raw video demuxers pcmdec: use unique classes for all pcm demuxers. rawdec: g722 is always 1 channel/16kHz Conflicts: Changelog configure doc/filters.texi libavdevice/avdevice.h libavfilter/avfilter.h libavfilter/vf_select.c tests/ref/lavf/mov Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
commit
9a9ceb8776
@ -57,6 +57,7 @@ easier to use. The changes are:
|
||||
- BIN/XBIN/ADF/IDF text file decoder
|
||||
- aconvert audio filter added
|
||||
- audio support to lavfi input device added
|
||||
- libcdio-paranoia input device for audio CD grabbing
|
||||
|
||||
|
||||
version 0.8:
|
||||
|
8
configure
vendored
8
configure
vendored
@ -167,6 +167,7 @@ External library support:
|
||||
--enable-libopencore-amrnb enable AMR-NB de/encoding via libopencore-amrnb [no]
|
||||
--enable-libopencore-amrwb enable AMR-WB decoding via libopencore-amrwb [no]
|
||||
--enable-libopencv enable video filtering via libopencv [no]
|
||||
--enable-libcdio enable audio CD grabbing with libcdio
|
||||
--enable-libdc1394 enable IIDC-1394 grabbing using libdc1394
|
||||
and libraw1394 [no]
|
||||
--enable-libdirac enable Dirac support via libdirac [no]
|
||||
@ -992,6 +993,7 @@ CONFIG_LIST="
|
||||
h264pred
|
||||
hardcoded_tables
|
||||
huffman
|
||||
libcdio
|
||||
libcelt
|
||||
libdc1394
|
||||
libdirac
|
||||
@ -1548,6 +1550,7 @@ dv1394_indev_deps="dv1394 dv_demuxer"
|
||||
fbdev_indev_deps="linux_fb_h"
|
||||
jack_indev_deps="jack_jack_h sem_timedwait"
|
||||
lavfi_indev_deps="avfilter"
|
||||
libcdio_indev_deps="libcdio"
|
||||
libdc1394_indev_deps="libdc1394"
|
||||
openal_indev_deps="openal"
|
||||
oss_indev_deps_any="soundcard_h sys_soundcard_h"
|
||||
@ -2669,6 +2672,7 @@ die_license_disabled() {
|
||||
enabled $1 || { enabled $2 && die "$2 is $1 and --enable-$1 is not specified."; }
|
||||
}
|
||||
|
||||
die_license_disabled gpl libcdio
|
||||
die_license_disabled gpl libx264
|
||||
die_license_disabled gpl libxavs
|
||||
die_license_disabled gpl libxvid
|
||||
@ -3092,6 +3096,9 @@ enabled jack_indev && check_lib2 jack/jack.h jack_client_open -ljack && check_fu
|
||||
|
||||
enabled_any sndio_indev sndio_outdev && check_lib2 sndio.h sio_open -lsndio
|
||||
|
||||
enabled libcdio &&
|
||||
check_lib2 "cdio/cdda.h cdio/paranoia.h" cdio_cddap_open "-lcdio_paranoia -lcdio_cdda -lcdio"
|
||||
|
||||
enabled x11grab &&
|
||||
check_header X11/Xlib.h &&
|
||||
check_header X11/extensions/XShm.h &&
|
||||
@ -3315,6 +3322,7 @@ echo "libvdpau enabled ${vdpau-no}"
|
||||
echo "AVISynth enabled ${avisynth-no}"
|
||||
echo "libcelt enabled ${libcelt-no}"
|
||||
echo "frei0r enabled ${frei0r-no}"
|
||||
echo "libcdio support ${libcdio-no}"
|
||||
echo "libdc1394 support ${libdc1394-no}"
|
||||
echo "libdirac enabled ${libdirac-no}"
|
||||
echo "libfaac enabled ${libfaac-no}"
|
||||
|
@ -1680,26 +1680,26 @@ the PTS of the first video frame in the video, NAN if undefined
|
||||
the time of the first video frame in the video, NAN if undefined
|
||||
|
||||
@item pict_type
|
||||
the picture type of the filtered frame, can assume one of the following
|
||||
the type of the filtered frame, can assume one of the following
|
||||
values:
|
||||
@table @option
|
||||
@item PICT_TYPE_I
|
||||
@item PICT_TYPE_P
|
||||
@item PICT_TYPE_B
|
||||
@item PICT_TYPE_S
|
||||
@item PICT_TYPE_SI
|
||||
@item PICT_TYPE_SP
|
||||
@item PICT_TYPE_BI
|
||||
@item I
|
||||
@item P
|
||||
@item B
|
||||
@item S
|
||||
@item SI
|
||||
@item SP
|
||||
@item BI
|
||||
@end table
|
||||
|
||||
@item interlace_type
|
||||
the frame interlace type, can assume one of the following values:
|
||||
@table @option
|
||||
@item INTERLACE_TYPE_P
|
||||
@item PROGRESSIVE
|
||||
the frame is progressive (not interlaced)
|
||||
@item INTERLACE_TYPE_T
|
||||
@item TOPFIRST
|
||||
the frame is top-field-first
|
||||
@item INTERLACE_TYPE_B
|
||||
@item BOTTOMFIRST
|
||||
the frame is bottom-field-first
|
||||
@end table
|
||||
|
||||
@ -1726,7 +1726,7 @@ select=1
|
||||
select=0
|
||||
|
||||
# select only I-frames
|
||||
select='eq(pict_type\,PICT_TYPE_I)'
|
||||
select='eq(pict_type\,I)'
|
||||
|
||||
# select one frame every 100
|
||||
select='not(mod(n\,100))'
|
||||
@ -1735,7 +1735,7 @@ select='not(mod(n\,100))'
|
||||
select='gte(t\,10)*lte(t\,20)'
|
||||
|
||||
# select only I frames contained in the 10-20 time interval
|
||||
select='gte(t\,10)*lte(t\,20)*eq(pict_type\,PICT_TYPE_I)'
|
||||
select='gte(t\,10)*lte(t\,20)*eq(pict_type\,I)'
|
||||
|
||||
# select frames with a minimum distance of 10 seconds
|
||||
select='isnan(prev_selected_t)+gte(t-prev_selected_t\,10)'
|
||||
|
@ -33,6 +33,7 @@ OBJS-$(CONFIG_VFWCAP_INDEV) += vfwcap.o
|
||||
OBJS-$(CONFIG_X11_GRAB_DEVICE_INDEV) += x11grab.o
|
||||
|
||||
# external libraries
|
||||
OBJS-$(CONFIG_LIBCDIO_INDEV) += libcdio.o
|
||||
OBJS-$(CONFIG_LIBDC1394_INDEV) += libdc1394.o
|
||||
|
||||
SKIPHEADERS-$(HAVE_ALSA_ASOUNDLIB_H) += alsa-audio.h
|
||||
|
@ -57,5 +57,6 @@ void avdevice_register_all(void)
|
||||
REGISTER_INDEV (X11_GRAB_DEVICE, x11_grab_device);
|
||||
|
||||
/* external libraries */
|
||||
REGISTER_INDEV (LIBCDIO, libcdio);
|
||||
REGISTER_INDEV (LIBDC1394, libdc1394);
|
||||
}
|
||||
|
@ -23,8 +23,8 @@
|
||||
#include "libavformat/avformat.h"
|
||||
|
||||
#define LIBAVDEVICE_VERSION_MAJOR 53
|
||||
#define LIBAVDEVICE_VERSION_MINOR 3
|
||||
#define LIBAVDEVICE_VERSION_MICRO 3
|
||||
#define LIBAVDEVICE_VERSION_MINOR 4
|
||||
#define LIBAVDEVICE_VERSION_MICRO 0
|
||||
|
||||
#define LIBAVDEVICE_VERSION_INT AV_VERSION_INT(LIBAVDEVICE_VERSION_MAJOR, \
|
||||
LIBAVDEVICE_VERSION_MINOR, \
|
||||
|
186
libavdevice/libcdio.c
Normal file
186
libavdevice/libcdio.c
Normal file
@ -0,0 +1,186 @@
|
||||
/*
|
||||
* Copyright (c) 2011 Anton Khirnov <anton@khirnov.net>
|
||||
*
|
||||
* This file is part of Libav.
|
||||
*
|
||||
* Libav 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.
|
||||
*
|
||||
* Libav 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 Libav; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* libcdio CD grabbing
|
||||
*/
|
||||
|
||||
#include <cdio/cdda.h>
|
||||
#include <cdio/paranoia.h>
|
||||
|
||||
#include "libavutil/log.h"
|
||||
#include "libavutil/mem.h"
|
||||
#include "libavutil/opt.h"
|
||||
|
||||
#include "libavformat/avformat.h"
|
||||
#include "libavformat/internal.h"
|
||||
|
||||
/* cdio returns some malloced strings that need to be free()d */
|
||||
#undef free
|
||||
|
||||
typedef struct CDIOContext {
|
||||
cdrom_drive_t *drive;
|
||||
cdrom_paranoia_t *paranoia;
|
||||
int32_t last_sector;
|
||||
|
||||
/* private options */
|
||||
int speed;
|
||||
int paranoia_mode;
|
||||
} CDIOContext;
|
||||
|
||||
static av_cold int read_header(AVFormatContext *ctx, AVFormatParameters *ap)
|
||||
{
|
||||
CDIOContext *s = ctx->priv_data;
|
||||
AVStream *st;
|
||||
int ret, i;
|
||||
char *err = NULL;
|
||||
|
||||
if (!(st = av_new_stream(ctx, 0)))
|
||||
return AVERROR(ENOMEM);
|
||||
s->drive = cdio_cddap_identify(ctx->filename, CDDA_MESSAGE_LOGIT, &err);
|
||||
if (!s->drive) {
|
||||
av_log(ctx, AV_LOG_ERROR, "Could not open drive %s.\n", ctx->filename);
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
if (err) {
|
||||
av_log(ctx, AV_LOG_VERBOSE, "%s\n", err);
|
||||
free(err);
|
||||
}
|
||||
if ((ret = cdio_cddap_open(s->drive)) < 0 || !s->drive->opened) {
|
||||
av_log(ctx, AV_LOG_ERROR, "Could not open disk in drive %s.\n", ctx->filename);
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
|
||||
cdio_cddap_verbose_set(s->drive, CDDA_MESSAGE_LOGIT, CDDA_MESSAGE_LOGIT);
|
||||
if (s->speed)
|
||||
cdio_cddap_speed_set(s->drive, s->speed);
|
||||
|
||||
s->paranoia = cdio_paranoia_init(s->drive);
|
||||
if (!s->paranoia) {
|
||||
av_log(ctx, AV_LOG_ERROR, "Could not init paranoia.\n");
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
cdio_paranoia_modeset(s->paranoia, s->paranoia_mode);
|
||||
|
||||
st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
|
||||
if (s->drive->bigendianp)
|
||||
st->codec->codec_id = CODEC_ID_PCM_S16BE;
|
||||
else
|
||||
st->codec->codec_id = CODEC_ID_PCM_S16LE;
|
||||
st->codec->sample_rate = 44100;
|
||||
st->codec->channels = 2;
|
||||
if (s->drive->audio_last_sector != CDIO_INVALID_LSN &&
|
||||
s->drive->audio_first_sector != CDIO_INVALID_LSN)
|
||||
st->duration = s->drive->audio_last_sector - s->drive->audio_first_sector;
|
||||
else if (s->drive->tracks)
|
||||
st->duration = s->drive->disc_toc[s->drive->tracks].dwStartSector;
|
||||
av_set_pts_info(st, 64, CDIO_CD_FRAMESIZE_RAW, 2*st->codec->channels*st->codec->sample_rate);
|
||||
|
||||
for (i = 0; i < s->drive->tracks; i++) {
|
||||
char title[16];
|
||||
snprintf(title, sizeof(title), "track %02d", s->drive->disc_toc[i].bTrack);
|
||||
ff_new_chapter(ctx, i, st->time_base, s->drive->disc_toc[i].dwStartSector,
|
||||
s->drive->disc_toc[i+1].dwStartSector, title);
|
||||
}
|
||||
|
||||
s->last_sector = cdio_cddap_disc_lastsector(s->drive);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int read_packet(AVFormatContext *ctx, AVPacket *pkt)
|
||||
{
|
||||
CDIOContext *s = ctx->priv_data;
|
||||
int ret;
|
||||
uint16_t *buf;
|
||||
char *err = NULL;
|
||||
|
||||
if (ctx->streams[0]->cur_dts > s->last_sector)
|
||||
return AVERROR_EOF;
|
||||
|
||||
buf = cdio_paranoia_read(s->paranoia, NULL);
|
||||
if (!buf)
|
||||
return AVERROR_EOF;
|
||||
|
||||
if (err = cdio_cddap_errors(s->drive)) {
|
||||
av_log(ctx, AV_LOG_ERROR, "%s\n", err);
|
||||
free(err);
|
||||
err = NULL;
|
||||
}
|
||||
if (err = cdio_cddap_messages(s->drive)) {
|
||||
av_log(ctx, AV_LOG_VERBOSE, "%s\n", err);
|
||||
free(err);
|
||||
err = NULL;
|
||||
}
|
||||
|
||||
if ((ret = av_new_packet(pkt, CDIO_CD_FRAMESIZE_RAW)) < 0)
|
||||
return ret;
|
||||
memcpy(pkt->data, buf, CDIO_CD_FRAMESIZE_RAW);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static av_cold int read_close(AVFormatContext *ctx)
|
||||
{
|
||||
CDIOContext *s = ctx->priv_data;
|
||||
cdio_paranoia_free(s->paranoia);
|
||||
cdio_cddap_close(s->drive);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int read_seek(AVFormatContext *ctx, int stream_index, int64_t timestamp,
|
||||
int flags)
|
||||
{
|
||||
CDIOContext *s = ctx->priv_data;
|
||||
AVStream *st = ctx->streams[0];
|
||||
|
||||
cdio_paranoia_seek(s->paranoia, timestamp, SEEK_SET);
|
||||
st->cur_dts = timestamp;
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define OFFSET(x) offsetof(CDIOContext, x)
|
||||
#define DEC AV_OPT_FLAG_DECODING_PARAM
|
||||
static const AVOption options[] = {
|
||||
{ "speed", "Drive reading speed.", OFFSET(speed), FF_OPT_TYPE_INT, { 0 }, 0, INT_MAX, DEC },
|
||||
{ "paranoia_mode", "Error recovery mode.", OFFSET(paranoia_mode), FF_OPT_TYPE_FLAGS, { 0 }, INT_MIN, INT_MAX, DEC, "paranoia_mode" },
|
||||
{ "verify", "Verify data integrity in overlap area", 0, FF_OPT_TYPE_CONST, { PARANOIA_MODE_VERIFY }, 0, 0, DEC, "paranoia_mode" },
|
||||
{ "overlap", "Perform overlapped reads.", 0, FF_OPT_TYPE_CONST, { PARANOIA_MODE_OVERLAP }, 0, 0, DEC, "paranoia_mode" },
|
||||
{ "neverskip", "Do not skip failed reads.", 0, FF_OPT_TYPE_CONST, { PARANOIA_MODE_NEVERSKIP }, 0, 0, DEC, "paranoia_mode" },
|
||||
{ NULL },
|
||||
};
|
||||
|
||||
static const AVClass libcdio_class = {
|
||||
.class_name = "libcdio indev",
|
||||
.item_name = av_default_item_name,
|
||||
.option = options,
|
||||
.version = LIBAVUTIL_VERSION_INT,
|
||||
};
|
||||
|
||||
AVInputFormat ff_libcdio_demuxer = {
|
||||
.name = "libcdio",
|
||||
.read_header = read_header,
|
||||
.read_packet = read_packet,
|
||||
.read_close = read_close,
|
||||
.read_seek = read_seek,
|
||||
.priv_data_size = sizeof(CDIOContext),
|
||||
.flags = AVFMT_NOFILE,
|
||||
.priv_class = &libcdio_class,
|
||||
};
|
@ -45,18 +45,18 @@ static const char *var_names[] = {
|
||||
"prev_selected_t", ///< previously selected time
|
||||
|
||||
"pict_type", ///< the type of picture in the movie
|
||||
"PICT_TYPE_I",
|
||||
"PICT_TYPE_P",
|
||||
"PICT_TYPE_B",
|
||||
"PICT_TYPE_S",
|
||||
"PICT_TYPE_SI",
|
||||
"PICT_TYPE_SP",
|
||||
"PICT_TYPE_BI",
|
||||
"I",
|
||||
"P",
|
||||
"B",
|
||||
"S",
|
||||
"SI",
|
||||
"SP",
|
||||
"BI",
|
||||
|
||||
"interlace_type", ///< the frame interlace type
|
||||
"INTERLACE_TYPE_P",
|
||||
"INTERLACE_TYPE_T",
|
||||
"INTERLACE_TYPE_B",
|
||||
"PROGRESSIVE",
|
||||
"TOPFIRST",
|
||||
"BOTTOMFIRST",
|
||||
|
||||
"n", ///< frame number (starting from zero)
|
||||
"selected_n", ///< selected frame number (starting from zero)
|
||||
@ -317,19 +317,14 @@ static av_cold void uninit(AVFilterContext *ctx)
|
||||
{
|
||||
SelectContext *select = ctx->priv;
|
||||
AVFilterBufferRef *picref;
|
||||
int i;
|
||||
|
||||
if (select->expr)
|
||||
av_expr_free(select->expr);
|
||||
av_expr_free(select->expr);
|
||||
select->expr = NULL;
|
||||
|
||||
if (select->pending_frames) {
|
||||
for (i = 0; i < av_fifo_size(select->pending_frames)/sizeof(picref); i++) {
|
||||
av_fifo_generic_read(select->pending_frames, &picref, sizeof(picref), NULL);
|
||||
avfilter_unref_buffer(picref);
|
||||
}
|
||||
av_fifo_free(select->pending_frames);
|
||||
}
|
||||
while (select->pending_frames &&
|
||||
av_fifo_generic_read(select->pending_frames, &picref, sizeof(picref), NULL) == sizeof(picref))
|
||||
avfilter_unref_buffer(picref);
|
||||
av_fifo_free(select->pending_frames);
|
||||
select->pending_frames = NULL;
|
||||
}
|
||||
|
||||
|
@ -58,6 +58,8 @@ static int ingenient_read_packet(AVFormatContext *s, AVPacket *pkt)
|
||||
return ret;
|
||||
}
|
||||
|
||||
FF_RAWVIDEO_DEMUXER_CLASS(ingenient)
|
||||
|
||||
AVInputFormat ff_ingenient_demuxer = {
|
||||
.name = "ingenient",
|
||||
.long_name = NULL_IF_CONFIG_SMALL("raw Ingenient MJPEG"),
|
||||
@ -67,5 +69,5 @@ AVInputFormat ff_ingenient_demuxer = {
|
||||
.flags= AVFMT_GENERIC_INDEX,
|
||||
.extensions = "cgi", // FIXME
|
||||
.value = CODEC_ID_MJPEG,
|
||||
.priv_class = &ff_rawvideo_demuxer_class,
|
||||
.priv_class = &ingenient_demuxer_class,
|
||||
};
|
||||
|
@ -1225,7 +1225,8 @@ static int mov_write_tkhd_tag(AVIOContext *pb, MOVTrack *track, AVStream *st)
|
||||
|
||||
avio_wb32(pb, 0); /* reserved */
|
||||
avio_wb32(pb, 0); /* reserved */
|
||||
avio_wb32(pb, 0x0); /* reserved (Layer & Alternate group) */
|
||||
avio_wb16(pb, 0); /* layer */
|
||||
avio_wb16(pb, st->codec->codec_type); /* alternate group) */
|
||||
/* Volume, only for audio */
|
||||
if(track->enc->codec_type == AVMEDIA_TYPE_AUDIO)
|
||||
avio_wb16(pb, 0x0100);
|
||||
|
@ -22,6 +22,8 @@
|
||||
#include "avformat.h"
|
||||
#include "rawdec.h"
|
||||
#include "pcm.h"
|
||||
#include "libavutil/log.h"
|
||||
#include "libavutil/opt.h"
|
||||
|
||||
#define RAW_SAMPLES 1024
|
||||
|
||||
@ -46,7 +48,19 @@ static int raw_read_packet(AVFormatContext *s, AVPacket *pkt)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static const AVOption pcm_options[] = {
|
||||
{ "sample_rate", "", offsetof(RawAudioDemuxerContext, sample_rate), FF_OPT_TYPE_INT, {.dbl = 0}, 0, INT_MAX, AV_OPT_FLAG_DECODING_PARAM },
|
||||
{ "channels", "", offsetof(RawAudioDemuxerContext, channels), FF_OPT_TYPE_INT, {.dbl = 0}, 0, INT_MAX, AV_OPT_FLAG_DECODING_PARAM },
|
||||
{ NULL },
|
||||
};
|
||||
|
||||
#define PCMDEF(name, long_name, ext, codec) \
|
||||
static const AVClass name ## _demuxer_class = {\
|
||||
.class_name = #name " demuxer",\
|
||||
.item_name = av_default_item_name,\
|
||||
.option = pcm_options,\
|
||||
.version = LIBAVUTIL_VERSION_INT,\
|
||||
};\
|
||||
AVInputFormat ff_pcm_ ## name ## _demuxer = {\
|
||||
#name,\
|
||||
NULL_IF_CONFIG_SMALL(long_name),\
|
||||
@ -59,7 +73,7 @@ AVInputFormat ff_pcm_ ## name ## _demuxer = {\
|
||||
.flags= AVFMT_GENERIC_INDEX,\
|
||||
.extensions = ext,\
|
||||
.value = codec,\
|
||||
.priv_class = &ff_rawaudio_demuxer_class,\
|
||||
.priv_class = &name ## _demuxer_class,\
|
||||
};
|
||||
|
||||
PCMDEF(f64be, "PCM 64 bit floating-point big-endian format",
|
||||
|
@ -51,9 +51,12 @@ int ff_raw_read_header(AVFormatContext *s, AVFormatParameters *ap)
|
||||
|
||||
st->codec->channels = 1;
|
||||
|
||||
if (s1->sample_rate)
|
||||
if (id == CODEC_ID_ADPCM_G722)
|
||||
st->codec->sample_rate = 16000;
|
||||
|
||||
if (s1 && s1->sample_rate)
|
||||
st->codec->sample_rate = s1->sample_rate;
|
||||
if (s1->channels)
|
||||
if (s1 && s1->channels)
|
||||
st->codec->channels = s1->channels;
|
||||
|
||||
st->codec->bits_per_coded_sample = av_get_bits_per_sample(st->codec->codec_id);
|
||||
@ -165,48 +168,22 @@ fail:
|
||||
|
||||
/* Note: Do not forget to add new entries to the Makefile as well. */
|
||||
|
||||
static const AVOption audio_options[] = {
|
||||
{ "sample_rate", "", offsetof(RawAudioDemuxerContext, sample_rate), FF_OPT_TYPE_INT, {.dbl = 0}, 0, INT_MAX, AV_OPT_FLAG_DECODING_PARAM },
|
||||
{ "channels", "", offsetof(RawAudioDemuxerContext, channels), FF_OPT_TYPE_INT, {.dbl = 0}, 0, INT_MAX, AV_OPT_FLAG_DECODING_PARAM },
|
||||
{ NULL },
|
||||
};
|
||||
|
||||
const AVClass ff_rawaudio_demuxer_class = {
|
||||
.class_name = "rawaudio demuxer",
|
||||
.item_name = av_default_item_name,
|
||||
.option = audio_options,
|
||||
.version = LIBAVUTIL_VERSION_INT,
|
||||
};
|
||||
|
||||
#define OFFSET(x) offsetof(FFRawVideoDemuxerContext, x)
|
||||
#define DEC AV_OPT_FLAG_DECODING_PARAM
|
||||
static const AVOption video_options[] = {
|
||||
{ "video_size", "A string describing frame size, such as 640x480 or hd720.", OFFSET(video_size), FF_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC },
|
||||
{ "pixel_format", "", OFFSET(pixel_format), FF_OPT_TYPE_STRING, {.str = "yuv420p"}, 0, 0, DEC },
|
||||
{ "framerate", "", OFFSET(framerate), FF_OPT_TYPE_STRING, {.str = "25"}, 0, 0, DEC },
|
||||
const AVOption ff_rawvideo_options[] = {
|
||||
{ "framerate", "", OFFSET(framerate), FF_OPT_TYPE_STRING, {.str = "25"}, 0, 0, DEC},
|
||||
{ NULL },
|
||||
};
|
||||
#undef OFFSET
|
||||
#undef DEC
|
||||
|
||||
const AVClass ff_rawvideo_demuxer_class = {
|
||||
.class_name = "rawvideo demuxer",
|
||||
.item_name = av_default_item_name,
|
||||
.option = video_options,
|
||||
.version = LIBAVUTIL_VERSION_INT,
|
||||
};
|
||||
|
||||
#if CONFIG_G722_DEMUXER
|
||||
AVInputFormat ff_g722_demuxer = {
|
||||
.name = "g722",
|
||||
.long_name = NULL_IF_CONFIG_SMALL("raw G.722"),
|
||||
.priv_data_size = sizeof(RawAudioDemuxerContext),
|
||||
.read_header = ff_raw_read_header,
|
||||
.read_packet = ff_raw_read_partial_packet,
|
||||
.flags= AVFMT_GENERIC_INDEX,
|
||||
.extensions = "g722,722",
|
||||
.value = CODEC_ID_ADPCM_G722,
|
||||
.priv_class = &ff_rawaudio_demuxer_class,
|
||||
};
|
||||
#endif
|
||||
|
||||
|
@ -24,6 +24,7 @@
|
||||
|
||||
#include "avformat.h"
|
||||
#include "libavutil/log.h"
|
||||
#include "libavutil/opt.h"
|
||||
|
||||
typedef struct RawAudioDemuxerContext {
|
||||
AVClass *class;
|
||||
@ -38,8 +39,7 @@ typedef struct FFRawVideoDemuxerContext {
|
||||
char *framerate; /**< String describing framerate, set by a private option. */
|
||||
} FFRawVideoDemuxerContext;
|
||||
|
||||
extern const AVClass ff_rawaudio_demuxer_class;
|
||||
extern const AVClass ff_rawvideo_demuxer_class;
|
||||
extern const AVOption ff_rawvideo_options[];
|
||||
|
||||
int ff_raw_read_header(AVFormatContext *s, AVFormatParameters *ap);
|
||||
|
||||
@ -49,7 +49,16 @@ int ff_raw_audio_read_header(AVFormatContext *s, AVFormatParameters *ap);
|
||||
|
||||
int ff_raw_video_read_header(AVFormatContext *s, AVFormatParameters *ap);
|
||||
|
||||
#define FF_RAWVIDEO_DEMUXER_CLASS(name)\
|
||||
static const AVClass name ## _demuxer_class = {\
|
||||
.class_name = #name " demuxer",\
|
||||
.item_name = av_default_item_name,\
|
||||
.option = ff_rawvideo_options,\
|
||||
.version = LIBAVUTIL_VERSION_INT,\
|
||||
};
|
||||
|
||||
#define FF_DEF_RAWVIDEO_DEMUXER(shortname, longname, probe, ext, id)\
|
||||
FF_RAWVIDEO_DEMUXER_CLASS(shortname)\
|
||||
AVInputFormat ff_ ## shortname ## _demuxer = {\
|
||||
.name = #shortname,\
|
||||
.long_name = NULL_IF_CONFIG_SMALL(longname),\
|
||||
@ -60,7 +69,7 @@ AVInputFormat ff_ ## shortname ## _demuxer = {\
|
||||
.flags = AVFMT_GENERIC_INDEX,\
|
||||
.value = id,\
|
||||
.priv_data_size = sizeof(FFRawVideoDemuxerContext),\
|
||||
.priv_class = &ff_rawvideo_demuxer_class,\
|
||||
.priv_class = &shortname ## _demuxer_class,\
|
||||
};
|
||||
|
||||
#endif /* AVFORMAT_RAWDEC_H */
|
||||
|
@ -44,6 +44,22 @@ static int rawvideo_read_packet(AVFormatContext *s, AVPacket *pkt)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define OFFSET(x) offsetof(FFRawVideoDemuxerContext, x)
|
||||
#define DEC AV_OPT_FLAG_DECODING_PARAM
|
||||
static const AVOption rawvideo_options[] = {
|
||||
{ "video_size", "A string describing frame size, such as 640x480 or hd720.", OFFSET(video_size), FF_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC },
|
||||
{ "pixel_format", "", OFFSET(pixel_format), FF_OPT_TYPE_STRING, {.str = "yuv420p"}, 0, 0, DEC },
|
||||
{ "framerate", "", OFFSET(framerate), FF_OPT_TYPE_STRING, {.str = "25"}, 0, 0, DEC },
|
||||
{ NULL },
|
||||
};
|
||||
|
||||
static const AVClass rawvideo_demuxer_class = {
|
||||
.class_name = "rawvideo demuxer",
|
||||
.item_name = av_default_item_name,
|
||||
.option = rawvideo_options,
|
||||
.version = LIBAVUTIL_VERSION_INT,
|
||||
};
|
||||
|
||||
AVInputFormat ff_rawvideo_demuxer = {
|
||||
.name = "rawvideo",
|
||||
.long_name = NULL_IF_CONFIG_SMALL("raw video format"),
|
||||
@ -53,5 +69,5 @@ AVInputFormat ff_rawvideo_demuxer = {
|
||||
.flags= AVFMT_GENERIC_INDEX,
|
||||
.extensions = "yuv,cif,qcif,rgb",
|
||||
.value = CODEC_ID_RAWVIDEO,
|
||||
.priv_class = &ff_rawvideo_demuxer_class,
|
||||
.priv_class = &rawvideo_demuxer_class,
|
||||
};
|
||||
|
@ -131,7 +131,7 @@ FATE_TESTS += fate-gsm-ms
|
||||
fate-gsm-ms: CMD = framecrc -i $(SAMPLES)/gsm/ciao.wav
|
||||
|
||||
FATE_TESTS += fate-g722dec-1
|
||||
fate-g722dec-1: CMD = framecrc -ar 16000 -i $(SAMPLES)/g722/conf-adminmenu-162.g722
|
||||
fate-g722dec-1: CMD = framecrc -i $(SAMPLES)/g722/conf-adminmenu-162.g722
|
||||
|
||||
FATE_TESTS += fate-msmpeg4v1
|
||||
fate-msmpeg4v1: CMD = framecrc -flags +bitexact -dct fastint -idct simple -i $(SAMPLES)/msmpeg4v1/mpg4.avi -an
|
||||
|
@ -1,4 +1,4 @@
|
||||
c68f649777ab8e7c9a0f1f221451d3ad *./tests/data/acodec/alac.m4a
|
||||
b25bcc7ec3f5c19cdfc01a6bbd32edb8 *./tests/data/acodec/alac.m4a
|
||||
389386 ./tests/data/acodec/alac.m4a
|
||||
95e54b261530a1bcf6de6fe3b21dc5f6 *./tests/data/alac.acodec.out.wav
|
||||
stddev: 0.00 PSNR:999.99 MAXDIFF: 0 bytes: 1058400/ 1058400
|
||||
|
@ -6,7 +6,7 @@ f443a8eeb1647ec1eeb8370c939e52d4 *./tests/data/acodec/pcm_mulaw.wav
|
||||
529256 ./tests/data/acodec/pcm_mulaw.wav
|
||||
1c3eeaa8814ebd4916780dff80ed6dc5 *./tests/data/pcm.acodec.out.wav
|
||||
stddev: 103.38 PSNR: 56.04 MAXDIFF: 644 bytes: 1058400/ 1058400
|
||||
b7936d7170e0efefb379349d81aed360 *./tests/data/acodec/pcm_s8.mov
|
||||
760f85fb9f4e8aba326fb44ae84c9507 *./tests/data/acodec/pcm_s8.mov
|
||||
530837 ./tests/data/acodec/pcm_s8.mov
|
||||
652edf30f35ad89bf27bcc9d2f9c7b53 *./tests/data/pcm.acodec.out.wav
|
||||
stddev: 147.89 PSNR: 52.93 MAXDIFF: 255 bytes: 1058400/ 1058400
|
||||
@ -14,7 +14,7 @@ stddev: 147.89 PSNR: 52.93 MAXDIFF: 255 bytes: 1058400/ 1058400
|
||||
529244 ./tests/data/acodec/pcm_u8.wav
|
||||
652edf30f35ad89bf27bcc9d2f9c7b53 *./tests/data/pcm.acodec.out.wav
|
||||
stddev: 147.89 PSNR: 52.93 MAXDIFF: 255 bytes: 1058400/ 1058400
|
||||
c42b9c04305455250366c84e17c1023f *./tests/data/acodec/pcm_s16be.mov
|
||||
a4e18d1ca9ef5b8132a84d43625ddc47 *./tests/data/acodec/pcm_s16be.mov
|
||||
1060037 ./tests/data/acodec/pcm_s16be.mov
|
||||
95e54b261530a1bcf6de6fe3b21dc5f6 *./tests/data/pcm.acodec.out.wav
|
||||
stddev: 0.00 PSNR:999.99 MAXDIFF: 0 bytes: 1058400/ 1058400
|
||||
@ -30,7 +30,7 @@ c4f51bf32fad2f7af8ea5beedb56168b *./tests/data/acodec/pcm_s16le.mkv
|
||||
1060638 ./tests/data/acodec/pcm_s16le.mkv
|
||||
95e54b261530a1bcf6de6fe3b21dc5f6 *./tests/data/pcm.acodec.out.wav
|
||||
stddev: 0.00 PSNR:999.99 MAXDIFF: 0 bytes: 1058400/ 1058400
|
||||
07ffe7ffb78f3648b6524debdde5aec1 *./tests/data/acodec/pcm_s24be.mov
|
||||
971d2d2633e41a0326fe2d04a2d0350f *./tests/data/acodec/pcm_s24be.mov
|
||||
1589237 ./tests/data/acodec/pcm_s24be.mov
|
||||
95e54b261530a1bcf6de6fe3b21dc5f6 *./tests/data/pcm.acodec.out.wav
|
||||
stddev: 0.00 PSNR:999.99 MAXDIFF: 0 bytes: 1058400/ 1058400
|
||||
@ -38,7 +38,7 @@ a85380fb79b0d4fff38e24ac1e34bb94 *./tests/data/acodec/pcm_s24le.wav
|
||||
1587668 ./tests/data/acodec/pcm_s24le.wav
|
||||
95e54b261530a1bcf6de6fe3b21dc5f6 *./tests/data/pcm.acodec.out.wav
|
||||
stddev: 0.00 PSNR:999.99 MAXDIFF: 0 bytes: 1058400/ 1058400
|
||||
d7792f0343cd66fda8b50b569e2bcc48 *./tests/data/acodec/pcm_s32be.mov
|
||||
fc4f4e3e195bbde037ed31021d229f12 *./tests/data/acodec/pcm_s32be.mov
|
||||
2118437 ./tests/data/acodec/pcm_s32be.mov
|
||||
95e54b261530a1bcf6de6fe3b21dc5f6 *./tests/data/pcm.acodec.out.wav
|
||||
stddev: 0.00 PSNR:999.99 MAXDIFF: 0 bytes: 1058400/ 1058400
|
||||
|
@ -1,3 +1,3 @@
|
||||
a901cd05609080e8f5c09ca5da7290f0 *./tests/data/lavf/lavf.mov
|
||||
2e2529d01dbe42e4dd63580a351898f5 *./tests/data/lavf/lavf.mov
|
||||
357681 ./tests/data/lavf/lavf.mov
|
||||
./tests/data/lavf/lavf.mov CRC=0x2f6a9b26
|
||||
|
Loading…
Reference in New Issue
Block a user