FFmpeg: libavformat/s337m.c Source File
Go to the documentation of this file. 1 /*
2 * Copyright (C) 2017 foo86
3 *
4 * This file is part of FFmpeg.
5 *
6 * FFmpeg is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * FFmpeg is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with FFmpeg; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
26
27 #define MARKER_16LE 0x72F81F4E
28 #define MARKER_20LE 0x20876FF0E154
29 #define MARKER_24LE 0x72F8961F4EA5
30
31 #define IS_16LE_MARKER(state) ((state & 0xFFFFFFFF) == MARKER_16LE)
32 #define IS_20LE_MARKER(state) ((state & 0xF0FFFFF0FFFF) == MARKER_20LE)
33 #define IS_24LE_MARKER(state) ((state & 0xFFFFFFFFFFFF) == MARKER_24LE)
34 #define IS_LE_MARKER(state) (IS_16LE_MARKER(state) || IS_20LE_MARKER(state) || IS_24LE_MARKER(state))
35
38 int data_type, int data_size,
40 {
41 int word_bits;
42
44 word_bits = 16;
46 data_type >>= 8;
47 data_size >>= 4;
48 word_bits = 20;
49 } else {
50 data_type >>= 8;
51 word_bits = 24;
52 }
53
54 if ((data_type & 0x1F) != 0x1C) {
55 if (avc)
58 }
59
60 if (codec)
62
63 switch (data_size / word_bits) {
64 case 3648:
66 break;
67 case 3644:
69 break;
70 case 3640:
72 break;
73 case 3040:
75 break;
76 default:
77 if (avc)
80 }
81
83 *
offset *= (word_bits + 7 >> 3) * 2;
84 return 0;
85 }
86
88 {
90 int markers[3] = { 0 };
92 uint8_t *buf;
93
97 continue;
98
99 buf =
p->buf +
pos + 1;
103 } else {
106 }
107
109 continue;
110
113
117 }
118
122 if (markers[
max] < markers[
i])
124 }
125
126 if (markers[
max] > 3 && markers[
max] * 4 > sum * 3)
128
129 return 0;
130 }
131
133 {
135 return 0;
136 }
137
139 {
141
144 }
145
147 {
152
157 }
158
162 } else {
165 }
166
169
172
175 else
177
178 if (!
s->nb_streams) {
180 if (!st) {
182 }
186 }
187
188 return 0;
189 }
190
198 };
static void bswap_buf24(uint8_t *data, int size)
Filter the word "frame" indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
enum AVMediaType codec_type
General type of the encoded data.
AVStream * avformat_new_stream(AVFormatContext *s, const struct AVCodec *c)
Add a new stream to a media file.
#define AVERROR_EOF
End of file.
static int s337m_read_packet(AVFormatContext *s, AVPacket *pkt)
#define IS_20LE_MARKER(state)
unsigned int avio_rl16(AVIOContext *s)
#define FF_ARRAY_ELEMS(a)
void ff_spdif_bswap_buf16(uint16_t *dst, const uint16_t *src, int w)
#define IS_16LE_MARKER(state)
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_RL16
enum AVStreamParseType need_parsing
AVCodecParameters * codecpar
Codec parameters associated with this stream.
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
const FFInputFormat ff_s337m_demuxer
static int s337m_read_header(AVFormatContext *s)
This structure contains the data a format has to probe a file.
static int s337m_probe(const AVProbeData *p)
AVCodecID
Identify the syntax and semantics of the bitstream.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
void avpriv_report_missing_feature(void *avc, const char *msg,...) av_printf_format(2
Log a generic warning message about a missing feature.
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_RL24
int avio_r8(AVIOContext *s)
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf offset
#define i(width, name, range_min, range_max)
unsigned int avio_rl24(AVIOContext *s)
#define IS_LE_MARKER(state)
#define FFSWAP(type, a, b)
IDirect3DDxgiInterfaceAccess _COM_Outptr_ void ** p
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
This structure stores compressed data.
static int s337m_get_offset_and_codec(void *avc, uint64_t state, int data_type, int data_size, int *offset, enum AVCodecID *codec)
int avio_feof(AVIOContext *s)
Similar to feof() but also returns nonzero on read errors.
Generated on Sat Oct 18 2025 19:23:29 for FFmpeg by
doxygen
1.8.17