Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
c0aeee94
Commit
c0aeee94
authored
Oct 13, 2015
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avformat: add vag demuxer
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
af70117c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
88 additions
and
1 deletion
+88
-1
Makefile
libavformat/Makefile
+1
-0
allformats.c
libavformat/allformats.c
+1
-0
vag.c
libavformat/vag.c
+85
-0
version.h
libavformat/version.h
+1
-1
No files found.
libavformat/Makefile
View file @
c0aeee94
...
...
@@ -440,6 +440,7 @@ OBJS-$(CONFIG_TTA_DEMUXER) += tta.o apetag.o img2.o
OBJS-$(CONFIG_TTY_DEMUXER)
+=
tty.o
sauce.o
OBJS-$(CONFIG_TXD_DEMUXER)
+=
txd.o
OBJS-$(CONFIG_UNCODEDFRAMECRC_MUXER)
+=
uncodedframecrcenc.o
framehash.o
OBJS-$(CONFIG_VAG_DEMUXER)
+=
vag.o
OBJS-$(CONFIG_VC1_DEMUXER)
+=
rawdec.o
vc1dec.o
OBJS-$(CONFIG_VC1_MUXER)
+=
rawenc.o
OBJS-$(CONFIG_VC1T_DEMUXER)
+=
vc1test.o
...
...
libavformat/allformats.c
View file @
c0aeee94
...
...
@@ -308,6 +308,7 @@ void av_register_all(void)
REGISTER_DEMUXER
(
TXD
,
txd
);
REGISTER_DEMUXER
(
TTY
,
tty
);
REGISTER_MUXER
(
UNCODEDFRAMECRC
,
uncodedframecrc
);
REGISTER_DEMUXER
(
VAG
,
vag
);
REGISTER_MUXDEMUX
(
VC1
,
vc1
);
REGISTER_MUXDEMUX
(
VC1T
,
vc1t
);
REGISTER_DEMUXER
(
VIVO
,
vivo
);
...
...
libavformat/vag.c
0 → 100644
View file @
c0aeee94
/*
* VAG demuxer
* Copyright (c) 2015 Paul B Mahol
*
* This file is part of FFmpeg.
*
* FFmpeg 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.
*
* FFmpeg 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 FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "libavutil/channel_layout.h"
#include "avformat.h"
#include "internal.h"
typedef
struct
VAGDemuxContext
{
int64_t
data_end
;
}
VAGDemuxContext
;
static
int
vag_probe
(
AVProbeData
*
p
)
{
if
(
memcmp
(
p
->
buf
,
"VAGp
\0\0\0
"
,
7
))
return
0
;
return
AVPROBE_SCORE_MAX
;
}
static
int
vag_read_header
(
AVFormatContext
*
s
)
{
VAGDemuxContext
*
c
=
s
->
priv_data
;
AVStream
*
st
;
st
=
avformat_new_stream
(
s
,
NULL
);
if
(
!
st
)
return
AVERROR
(
ENOMEM
);
avio_skip
(
s
->
pb
,
4
);
st
->
codec
->
codec_type
=
AVMEDIA_TYPE_AUDIO
;
st
->
codec
->
codec_id
=
AV_CODEC_ID_ADPCM_PSX
;
st
->
codec
->
channels
=
1
+
(
avio_rb32
(
s
->
pb
)
==
0x00000004
);
avio_skip
(
s
->
pb
,
4
);
c
->
data_end
=
avio_rb32
(
s
->
pb
);
st
->
duration
=
(
c
->
data_end
-
avio_tell
(
s
->
pb
))
/
(
16
*
st
->
codec
->
channels
)
*
28
;
st
->
codec
->
sample_rate
=
avio_rb32
(
s
->
pb
);
if
(
st
->
codec
->
sample_rate
<=
0
)
return
AVERROR_INVALIDDATA
;
st
->
codec
->
block_align
=
16
*
st
->
codec
->
channels
;
avio_skip
(
s
->
pb
,
28
);
avpriv_set_pts_info
(
st
,
64
,
1
,
st
->
codec
->
sample_rate
);
return
0
;
}
static
int
vag_read_packet
(
AVFormatContext
*
s
,
AVPacket
*
pkt
)
{
VAGDemuxContext
*
c
=
s
->
priv_data
;
AVCodecContext
*
codec
=
s
->
streams
[
0
]
->
codec
;
int
size
;
size
=
FFMIN
(
c
->
data_end
-
avio_tell
(
s
->
pb
),
codec
->
block_align
);
if
(
size
<=
0
)
return
AVERROR_EOF
;
return
av_get_packet
(
s
->
pb
,
pkt
,
size
);
}
AVInputFormat
ff_vag_demuxer
=
{
.
name
=
"vag"
,
.
long_name
=
NULL_IF_CONFIG_SMALL
(
"Sony VAG"
),
.
priv_data_size
=
sizeof
(
VAGDemuxContext
),
.
read_probe
=
vag_probe
,
.
read_header
=
vag_read_header
,
.
read_packet
=
vag_read_packet
,
.
extensions
=
"vag"
,
};
libavformat/version.h
View file @
c0aeee94
...
...
@@ -30,7 +30,7 @@
#include "libavutil/version.h"
#define LIBAVFORMAT_VERSION_MAJOR 57
#define LIBAVFORMAT_VERSION_MINOR
5
#define LIBAVFORMAT_VERSION_MINOR
6
#define LIBAVFORMAT_VERSION_MICRO 100
#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment