1 /*
2 * ADP demuxer
3 * Copyright (c) 2013 James Almer
4 *
5 * This file is part of FFmpeg.
6 *
7 * FFmpeg is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * FFmpeg is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with FFmpeg; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
26
28 {
29 int i, changes = 0;
30 char last = 0;
31
33 return 0;
34
35 for (i = 0; i < p->
buf_size - 3; i+=32) {
36 if (p->
buf[i] != p->
buf[i+2] || p->
buf[i+1] != p->
buf[i+3])
37 return 0;
38 if (p->
buf[i] != last)
39 changes++;
41 }
42 if (changes <= 1)
43 return 0;
44
46 }
47
49 {
51
53 if (!st)
55
64
66
67 return 0;
68 }
69
71 {
73
76
78
79 if (ret != size) {
80 if (ret < 0) {
82 return ret;
83 }
85 }
87
88 return ret;
89 }
90
97 .extensions = "adp,dtk",
98 };
static int adp_read_packet(AVFormatContext *s, AVPacket *pkt)
int64_t avio_size(AVIOContext *s)
Get the filesize.
AVInputFormat ff_adp_demuxer
void av_shrink_packet(AVPacket *pkt, int size)
Reduce packet size, correctly zeroing padding.
static int adp_read_header(AVFormatContext *s)
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
#define AV_CH_LAYOUT_STEREO
AVStream * avformat_new_stream(AVFormatContext *s, const AVCodec *c)
Add a new stream to a media file.
#define AVERROR_EOF
End of file.
uint64_t channel_layout
Audio only.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
enum AVMediaType codec_type
General type of the encoded data.
int av_get_audio_frame_duration2(AVCodecParameters *par, int frame_bytes)
This function is the same as av_get_audio_frame_duration(), except it works with AVCodecParameters in...
int buf_size
Size of buf except extra allocated bytes.
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
int seekable
A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable.
audio channel layout utility functions
static int adp_probe(AVProbeData *p)
AVIOContext * pb
I/O context.
void av_packet_unref(AVPacket *pkt)
Wipe the packet.
This structure contains the data a format has to probe a file.
int64_t duration
Decoding: duration of the stream, in stream time base.
int sample_rate
Audio only.
int64_t start_time
Decoding: pts of the first frame of the stream in presentation order, in stream time base...
AVCodecParameters * codecpar
int avio_feof(AVIOContext *s)
feof() equivalent for AVIOContext.
This structure stores compressed data.