~medibuntu-maintainers/ffmpeg/medibuntu.maverick

« back to all changes in this revision

Viewing changes to libavformat/mm.c

  • Committer: Gauvain Pocentek
  • Date: 2010-09-25 08:17:46 UTC
  • mfrom: (5.1.14 maverick)
  • Revision ID: gauvain@images-20100925081746-i08nj1jyzsx971cs
* Merge from maverick.
* debian/control:
  - update maintainer and uploaders
  - use our addresses in Vcs-* fields
  - build-depends on libfaac-dev, libopencore-amrnb-dev and
    libopencore-amrwb-dev to add aac encoding and amr support lp: #490227
  - recommends apport-hooks-medibuntu for lib*-extra-* to catch all bug
    reports.
* Add myself to uploaders
* Add libxfixes-dev to build-depends, LP: #631103. Thanks to
  Dominic Evans for the initial patch against ffmpeg.
* merge from 'main' package. Changes:
  - build against faad, dirac, libopenjpeg, x264, mp3lame, librtmp and xvidcore
* merge from debian/experimental. remaining changes:
  - don't disable encoders
  - don't build against libfaad, libdirac, librtmp and libopenjpeg (all in universe)
* Enable RTMP[E] support via librtmp.
* Disable aac encoder, see README.Debian.
* Fix obsolete-relation-form for the internal dependencies.
* Merge debian/README.Source into debian/README.source and add section
  headers.
* Remove obsoleted support for the non-free libamr-nb/wb.
* enable runtime-cpudetect
* conditionally build against opencore-amr if installed in the build
  environment
* update upstream url in debian/copyright
* fix usage documentation in debian/get-orig-source.sh
* update dep3 headers for debian/patches/900_doxyfile
* add proper replaces for moving presets back to ffmpeg
* make debian/patches gbp-pq friendly
* Add VP80 fourcc to libavformat/riff.c
* Backport-AAC-HE-v2
* bump Standards-Version, no changes needed
* merge from 'main' package. Changes:
  - build against faad, dirac, libopenjpeg, x264, mp3lame and xvidcore
* merge from debian/experimental. remaining changes:
  - don't disable encoders
  - don't build against libfaad, libdirac and libopenjpeg (all in universe)
* new upstream release
  - internal vorbis encoder is disabled. LP: #585330
  - includes native AMR-NB decoder, LP: #93849
  - api-example is fixed: LP: #557319
* new upstream release
  - adds VP8 support via libvpx, Closes: #582274
* depend on libavfilter-extra-1 instead of -0, Closes: #583728
* add conflicts to the ffprobe package, it has been merged upstream now
* add proper replaces, fixes: LP: #587369
* fix typo in dependency on libavfilter-extra-1. LP: #587431
* install files into libavfilter-extra-1.install. LP: #587424
* bump soname for package libavutil49->libavutil50
* fix installation rule, LP: #587424
* remove all install rules that are related to non-library packages
  Fixes FTBFS
* don't try install html files, we don't build ffmpeg-doc in ffmpeg-extra
  Fixes FTBFS
* merge from 'main' package. Changes
  - build against faad, dirac, libopenjpeg, x264, mp3lame and xvidcore
* merge from debian/experimental. remaining changes:
  - don't disable encoders
  - don't build against libfaad, libdirac and libopenjpeg (all in universe)
* update to new upstream. Closes: #569727
  - fixes various segfaults and other minor feature improvements
    Closes: #374931, #522449, #501891, #559712, #420231, #369127, #538082,
            #298095, #294422, #561553, #525385, #495274, #420230
    LP: #305286, #457106, #529200, #301723, #305315, #336479, #420230,
        #412063, #428912, #432181, #440591, #453732, #453732, #453732,
          #514259, #515243, #521472, #530186, #530186, #197842, #483317,
          #483317, #539407, #280098, #331255, #566107, #569823, #570305,
          #573190
* Fixup lintian overrides for new upstream snapshot
* Bump Standards-Version to 3.8.4
* Many upstream changes, see upstream Changelog for details
* Prepare new upload for Debian.
* Update gbp.conf for master.extra branch.
* Bump Standards-Version to 3.8.4.
* Don't include build-depends-indep when only building arch-dependent
  packages.
* Include ${misc:Depends} for all packages.
* Set the team as maintainers.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 */
21
21
 
22
22
/**
23
 
 * @file libavformat/mm.c
 
23
 * @file
24
24
 * American Laser Games MM Format Demuxer
25
 
 * by Peter Ross (suxen_drol at hotmail dot com)
 
25
 * by Peter Ross (pross@xvid.org)
26
26
 *
27
27
 * The MM format was used by IBM-PC ports of ALG's "arcade shooter" games,
28
28
 * including Mad Dog McCree and Crime Patrol.
56
56
  unsigned int audio_pts, video_pts;
57
57
} MmDemuxContext;
58
58
 
59
 
static int mm_probe(AVProbeData *p)
 
59
static int probe(AVProbeData *p)
60
60
{
 
61
    int len, type, fps, w, h;
 
62
    if (p->buf_size < MM_HEADER_LEN_AV + MM_PREAMBLE_SIZE)
 
63
        return 0;
61
64
    /* the first chunk is always the header */
62
65
    if (AV_RL16(&p->buf[0]) != MM_TYPE_HEADER)
63
66
        return 0;
64
 
    if (AV_RL32(&p->buf[2]) != MM_HEADER_LEN_V && AV_RL32(&p->buf[2]) != MM_HEADER_LEN_AV)
 
67
    len = AV_RL32(&p->buf[2]);
 
68
    if (len != MM_HEADER_LEN_V && len != MM_HEADER_LEN_AV)
 
69
        return 0;
 
70
    fps = AV_RL16(&p->buf[8]);
 
71
    w = AV_RL16(&p->buf[12]);
 
72
    h = AV_RL16(&p->buf[14]);
 
73
    if (!fps || fps > 60 || !w || w > 2048 || !h || h > 2048)
 
74
        return 0;
 
75
    type = AV_RL16(&p->buf[len]);
 
76
    if (!type || type > 0x31)
65
77
        return 0;
66
78
 
67
79
    /* only return half certainty since this check is a bit sketchy */
68
80
    return AVPROBE_SCORE_MAX / 2;
69
81
}
70
82
 
71
 
static int mm_read_header(AVFormatContext *s,
 
83
static int read_header(AVFormatContext *s,
72
84
                           AVFormatParameters *ap)
73
85
{
74
86
    MmDemuxContext *mm = s->priv_data;
96
108
    st = av_new_stream(s, 0);
97
109
    if (!st)
98
110
        return AVERROR(ENOMEM);
99
 
    st->codec->codec_type = CODEC_TYPE_VIDEO;
 
111
    st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
100
112
    st->codec->codec_id = CODEC_ID_MMVIDEO;
101
113
    st->codec->codec_tag = 0;  /* no fourcc */
102
114
    st->codec->width = width;
108
120
        st = av_new_stream(s, 0);
109
121
        if (!st)
110
122
            return AVERROR(ENOMEM);
111
 
        st->codec->codec_type = CODEC_TYPE_AUDIO;
 
123
        st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
112
124
        st->codec->codec_tag = 0; /* no fourcc */
113
125
        st->codec->codec_id = CODEC_ID_PCM_U8;
114
126
        st->codec->channels = 1;
121
133
    return 0;
122
134
}
123
135
 
124
 
static int mm_read_packet(AVFormatContext *s,
 
136
static int read_packet(AVFormatContext *s,
125
137
                           AVPacket *pkt)
126
138
{
127
139
    MmDemuxContext *mm = s->priv_data;
180
192
    "mm",
181
193
    NULL_IF_CONFIG_SMALL("American Laser Games MM format"),
182
194
    sizeof(MmDemuxContext),
183
 
    mm_probe,
184
 
    mm_read_header,
185
 
    mm_read_packet,
 
195
    probe,
 
196
    read_header,
 
197
    read_packet,
186
198
};