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
d8982000
Commit
d8982000
authored
Oct 03, 2015
by
Carl Eugen Hoyos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavf/shortendec: Autodetect raw Shorten streams.
Move the demuxer into its own file.
parent
9762554d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
72 additions
and
13 deletions
+72
-13
Makefile
libavformat/Makefile
+1
-1
rawdec.c
libavformat/rawdec.c
+0
-12
shortendec.c
libavformat/shortendec.c
+71
-0
No files found.
libavformat/Makefile
View file @
d8982000
...
...
@@ -403,7 +403,7 @@ OBJS-$(CONFIG_SDP_DEMUXER) += rtsp.o
OBJS-$(CONFIG_SDR2_DEMUXER)
+=
sdr2.o
OBJS-$(CONFIG_SEGAFILM_DEMUXER)
+=
segafilm.o
OBJS-$(CONFIG_SEGMENT_MUXER)
+=
segment.o
OBJS-$(CONFIG_SHORTEN_DEMUXER)
+=
rawdec.o
OBJS-$(CONFIG_SHORTEN_DEMUXER)
+=
shortendec.o
rawdec.o
OBJS-$(CONFIG_SIFF_DEMUXER)
+=
siff.o
OBJS-$(CONFIG_SINGLEJPEG_MUXER)
+=
rawenc.o
OBJS-$(CONFIG_SMACKER_DEMUXER)
+=
smacker.o
...
...
libavformat/rawdec.c
View file @
d8982000
...
...
@@ -266,18 +266,6 @@ AVInputFormat ff_truehd_demuxer = {
};
#endif
#if CONFIG_SHORTEN_DEMUXER
AVInputFormat
ff_shorten_demuxer
=
{
.
name
=
"shn"
,
.
long_name
=
NULL_IF_CONFIG_SMALL
(
"raw Shorten"
),
.
read_header
=
ff_raw_audio_read_header
,
.
read_packet
=
ff_raw_read_partial_packet
,
.
flags
=
AVFMT_NOBINSEARCH
|
AVFMT_NOGENSEARCH
|
AVFMT_NO_BYTE_SEEK
|
AVFMT_NOTIMESTAMPS
,
.
extensions
=
"shn"
,
.
raw_codec_id
=
AV_CODEC_ID_SHORTEN
,
};
#endif
#if CONFIG_VC1_DEMUXER
FF_DEF_RAWVIDEO_DEMUXER2
(
vc1
,
"raw VC-1"
,
NULL
,
"vc1"
,
AV_CODEC_ID_VC1
,
AVFMT_GENERIC_INDEX
|
AVFMT_NOTIMESTAMPS
)
#endif
libavformat/shortendec.c
0 → 100644
View file @
d8982000
/*
* Shorten demuxer
* Copyright (c) 2001 Fabrice Bellard
* Copyright (c) 2005 Alex Beregszaszi
* Copyright (c) 2015 Carl Eugen Hoyos
*
* 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 "avformat.h"
#include "rawdec.h"
#include "libavcodec/golomb.h"
static
int
shn_probe
(
AVProbeData
*
p
)
{
GetBitContext
gb
;
int
version
,
internal_ftype
,
channels
,
blocksize
;
if
(
AV_RB32
(
p
->
buf
)
!=
0x616a6b67
)
return
0
;
version
=
p
->
buf
[
4
];
if
(
init_get_bits8
(
&
gb
,
p
->
buf
+
5
,
p
->
buf_size
-
5
-
AV_INPUT_BUFFER_PADDING_SIZE
)
<
0
)
return
0
;
if
(
!
version
)
{
internal_ftype
=
get_ur_golomb_shorten
(
&
gb
,
4
);
channels
=
get_ur_golomb_shorten
(
&
gb
,
0
);
blocksize
=
256
;
}
else
{
int
k
;
k
=
get_ur_golomb_shorten
(
&
gb
,
2
);
internal_ftype
=
get_ur_golomb_shorten
(
&
gb
,
k
);
k
=
get_ur_golomb_shorten
(
&
gb
,
2
);
channels
=
get_ur_golomb_shorten
(
&
gb
,
k
);
k
=
get_ur_golomb_shorten
(
&
gb
,
2
);
blocksize
=
get_ur_golomb_shorten
(
&
gb
,
k
);
}
if
(
internal_ftype
!=
2
&&
internal_ftype
!=
3
&&
internal_ftype
!=
5
)
return
0
;
if
(
channels
<
1
||
channels
>
8
)
return
0
;
if
(
blocksize
<
1
||
blocksize
>
65535
)
return
0
;
return
AVPROBE_SCORE_EXTENSION
+
1
;
}
AVInputFormat
ff_shorten_demuxer
=
{
.
name
=
"shn"
,
.
long_name
=
NULL_IF_CONFIG_SMALL
(
"raw Shorten"
),
.
read_probe
=
shn_probe
,
.
read_header
=
ff_raw_audio_read_header
,
.
read_packet
=
ff_raw_read_partial_packet
,
.
flags
=
AVFMT_NOBINSEARCH
|
AVFMT_NOGENSEARCH
|
AVFMT_NO_BYTE_SEEK
|
AVFMT_NOTIMESTAMPS
,
.
extensions
=
"shn"
,
.
raw_codec_id
=
AV_CODEC_ID_SHORTEN
,
};
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