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
604fbb31
Commit
604fbb31
authored
Mar 14, 2017
by
Diego Biurrun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mov: Move code shared with CAF to a separate file
parent
3d197514
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
59 additions
and
40 deletions
+59
-40
Makefile
libavformat/Makefile
+2
-3
isom.h
libavformat/isom.h
+14
-1
mov.c
libavformat/mov.c
+0
-36
mov_esds.c
libavformat/mov_esds.c
+43
-0
No files found.
libavformat/Makefile
View file @
604fbb31
...
...
@@ -93,8 +93,7 @@ OBJS-$(CONFIG_BFI_DEMUXER) += bfi.o
OBJS-$(CONFIG_BINK_DEMUXER)
+=
bink.o
OBJS-$(CONFIG_BMV_DEMUXER)
+=
bmv.o
OBJS-$(CONFIG_C93_DEMUXER)
+=
c93.o
voc_packet.o
voc.o
OBJS-$(CONFIG_CAF_DEMUXER)
+=
cafdec.o
caf.o
mov.o
mov_chan.o
\
replaygain.o
OBJS-$(CONFIG_CAF_DEMUXER)
+=
cafdec.o
caf.o
mov_chan.o
mov_esds.o
OBJS-$(CONFIG_CAVSVIDEO_DEMUXER)
+=
cavsvideodec.o
rawdec.o
OBJS-$(CONFIG_CAVSVIDEO_MUXER)
+=
rawenc.o
OBJS-$(CONFIG_CDG_DEMUXER)
+=
cdg.o
...
...
@@ -193,7 +192,7 @@ OBJS-$(CONFIG_MLP_MUXER) += rawenc.o
OBJS-$(CONFIG_MM_DEMUXER)
+=
mm.o
OBJS-$(CONFIG_MMF_DEMUXER)
+=
mmf.o
pcm.o
OBJS-$(CONFIG_MMF_MUXER)
+=
mmf.o
OBJS-$(CONFIG_MOV_DEMUXER)
+=
mov.o
mov_chan.o
replaygain.o
OBJS-$(CONFIG_MOV_DEMUXER)
+=
mov.o
mov_chan.o
mov_esds.o
replaygain.o
OBJS-$(CONFIG_MOV_MUXER)
+=
movenc.o
avc.o
hevc.o
\
movenchint.o
mov_chan.o
OBJS-$(CONFIG_MP2_MUXER)
+=
rawenc.o
...
...
libavformat/isom.h
View file @
604fbb31
...
...
@@ -239,8 +239,21 @@ void ff_mp4_parse_es_descr(AVIOContext *pb, int *es_id);
int
ff_mov_read_esds
(
AVFormatContext
*
fc
,
AVIOContext
*
pb
);
enum
AVCodecID
ff_mov_get_lpcm_codec_id
(
int
bps
,
int
flags
);
int
ff_mov_read_stsd_entries
(
MOVContext
*
c
,
AVIOContext
*
pb
,
int
entries
);
/**
* Compute codec id for 'lpcm' tag.
* See CoreAudioTypes and AudioStreamBasicDescription at Apple.
*/
static
inline
enum
AVCodecID
ff_mov_get_lpcm_codec_id
(
int
bps
,
int
flags
)
{
/* lpcm flags:
* 0x1 = float
* 0x2 = big-endian
* 0x4 = signed
*/
return
ff_get_pcm_codec_id
(
bps
,
flags
&
1
,
flags
&
2
,
flags
&
4
?
-
1
:
0
);
}
#endif
/* AVFORMAT_ISOM_H */
libavformat/mov.c
View file @
604fbb31
...
...
@@ -674,28 +674,6 @@ static int mov_read_hdlr(MOVContext *c, AVIOContext *pb, MOVAtom atom)
return
0
;
}
int
ff_mov_read_esds
(
AVFormatContext
*
fc
,
AVIOContext
*
pb
)
{
AVStream
*
st
;
int
tag
;
if
(
fc
->
nb_streams
<
1
)
return
0
;
st
=
fc
->
streams
[
fc
->
nb_streams
-
1
];
avio_rb32
(
pb
);
/* version + flags */
ff_mp4_read_descr
(
fc
,
pb
,
&
tag
);
if
(
tag
==
MP4ESDescrTag
)
{
ff_mp4_parse_es_descr
(
pb
,
NULL
);
}
else
avio_rb16
(
pb
);
/* ID */
ff_mp4_read_descr
(
fc
,
pb
,
&
tag
);
if
(
tag
==
MP4DecConfigDescrTag
)
ff_mp4_read_dec_config_descr
(
fc
,
st
,
pb
);
return
0
;
}
static
int
mov_read_esds
(
MOVContext
*
c
,
AVIOContext
*
pb
,
MOVAtom
atom
)
{
return
ff_mov_read_esds
(
c
->
fc
,
pb
);
...
...
@@ -1377,20 +1355,6 @@ static int mov_read_stco(MOVContext *c, AVIOContext *pb, MOVAtom atom)
return
0
;
}
/**
* Compute codec id for 'lpcm' tag.
* See CoreAudioTypes and AudioStreamBasicDescription at Apple.
*/
enum
AVCodecID
ff_mov_get_lpcm_codec_id
(
int
bps
,
int
flags
)
{
/* lpcm flags:
* 0x1 = float
* 0x2 = big-endian
* 0x4 = signed
*/
return
ff_get_pcm_codec_id
(
bps
,
flags
&
1
,
flags
&
2
,
flags
&
4
?
-
1
:
0
);
}
static
int
mov_codec_id
(
AVStream
*
st
,
uint32_t
format
)
{
int
id
=
ff_codec_get_id
(
ff_codec_movaudio_tags
,
format
);
...
...
libavformat/mov_esds.c
0 → 100644
View file @
604fbb31
/*
* This file is part of Libav.
*
* Libav 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.
*
* Libav 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 Libav; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "avformat.h"
#include "avio.h"
#include "isom.h"
int
ff_mov_read_esds
(
AVFormatContext
*
fc
,
AVIOContext
*
pb
)
{
AVStream
*
st
;
int
tag
;
if
(
fc
->
nb_streams
<
1
)
return
0
;
st
=
fc
->
streams
[
fc
->
nb_streams
-
1
];
avio_rb32
(
pb
);
/* version + flags */
ff_mp4_read_descr
(
fc
,
pb
,
&
tag
);
if
(
tag
==
MP4ESDescrTag
)
{
ff_mp4_parse_es_descr
(
pb
,
NULL
);
}
else
avio_rb16
(
pb
);
/* ID */
ff_mp4_read_descr
(
fc
,
pb
,
&
tag
);
if
(
tag
==
MP4DecConfigDescrTag
)
ff_mp4_read_dec_config_descr
(
fc
,
st
,
pb
);
return
0
;
}
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