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
3601eb04
Commit
3601eb04
authored
Dec 18, 2018
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec: add g732_1 parser
parent
d360a79c
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
62 additions
and
2 deletions
+62
-2
Makefile
libavcodec/Makefile
+1
-0
g723_1_parser.c
libavcodec/g723_1_parser.c
+60
-0
parsers.c
libavcodec/parsers.c
+1
-0
utils.c
libavcodec/utils.c
+0
-2
No files found.
libavcodec/Makefile
View file @
3601eb04
...
@@ -1025,6 +1025,7 @@ OBJS-$(CONFIG_DVD_NAV_PARSER) += dvd_nav_parser.o
...
@@ -1025,6 +1025,7 @@ OBJS-$(CONFIG_DVD_NAV_PARSER) += dvd_nav_parser.o
OBJS-$(CONFIG_DVDSUB_PARSER)
+=
dvdsub_parser.o
OBJS-$(CONFIG_DVDSUB_PARSER)
+=
dvdsub_parser.o
OBJS-$(CONFIG_FLAC_PARSER)
+=
flac_parser.o
flacdata.o
flac.o
\
OBJS-$(CONFIG_FLAC_PARSER)
+=
flac_parser.o
flacdata.o
flac.o
\
vorbis_data.o
vorbis_data.o
OBJS-$(CONFIG_G723_1_PARSER)
+=
g723_1_parser.o
OBJS-$(CONFIG_G729_PARSER)
+=
g729_parser.o
OBJS-$(CONFIG_G729_PARSER)
+=
g729_parser.o
OBJS-$(CONFIG_GIF_PARSER)
+=
gif_parser.o
OBJS-$(CONFIG_GIF_PARSER)
+=
gif_parser.o
OBJS-$(CONFIG_GSM_PARSER)
+=
gsm_parser.o
OBJS-$(CONFIG_GSM_PARSER)
+=
gsm_parser.o
...
...
libavcodec/g723_1_parser.c
0 → 100644
View file @
3601eb04
/*
* 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
*/
/**
* @file
* G723_1 audio parser
*/
#include "parser.h"
#include "g723_1.h"
typedef
struct
G723_1ParseContext
{
ParseContext
pc
;
}
G723_1ParseContext
;
static
int
g723_1_parse
(
AVCodecParserContext
*
s1
,
AVCodecContext
*
avctx
,
const
uint8_t
**
poutbuf
,
int
*
poutbuf_size
,
const
uint8_t
*
buf
,
int
buf_size
)
{
G723_1ParseContext
*
s
=
s1
->
priv_data
;
ParseContext
*
pc
=
&
s
->
pc
;
int
next
=
END_NOT_FOUND
;
if
(
buf_size
>
0
)
next
=
frame_size
[
buf
[
0
]
&
3
]
*
FFMAX
(
1
,
avctx
->
channels
);
if
(
ff_combine_frame
(
pc
,
next
,
&
buf
,
&
buf_size
)
<
0
||
!
buf_size
)
{
*
poutbuf
=
NULL
;
*
poutbuf_size
=
0
;
return
buf_size
;
}
s1
->
duration
=
240
;
*
poutbuf
=
buf
;
*
poutbuf_size
=
buf_size
;
return
next
;
}
AVCodecParser
ff_g723_1_parser
=
{
.
codec_ids
=
{
AV_CODEC_ID_G723_1
},
.
priv_data_size
=
sizeof
(
G723_1ParseContext
),
.
parser_parse
=
g723_1_parse
,
.
parser_close
=
ff_parse_close
,
};
libavcodec/parsers.c
View file @
3601eb04
...
@@ -40,6 +40,7 @@ extern AVCodecParser ff_dvbsub_parser;
...
@@ -40,6 +40,7 @@ extern AVCodecParser ff_dvbsub_parser;
extern
AVCodecParser
ff_dvdsub_parser
;
extern
AVCodecParser
ff_dvdsub_parser
;
extern
AVCodecParser
ff_dvd_nav_parser
;
extern
AVCodecParser
ff_dvd_nav_parser
;
extern
AVCodecParser
ff_flac_parser
;
extern
AVCodecParser
ff_flac_parser
;
extern
AVCodecParser
ff_g723_1_parser
;
extern
AVCodecParser
ff_g729_parser
;
extern
AVCodecParser
ff_g729_parser
;
extern
AVCodecParser
ff_gif_parser
;
extern
AVCodecParser
ff_gif_parser
;
extern
AVCodecParser
ff_gsm_parser
;
extern
AVCodecParser
ff_gsm_parser
;
...
...
libavcodec/utils.c
View file @
3601eb04
...
@@ -1599,8 +1599,6 @@ static int get_audio_frame_duration(enum AVCodecID id, int sr, int ch, int ba,
...
@@ -1599,8 +1599,6 @@ static int get_audio_frame_duration(enum AVCodecID id, int sr, int ch, int ba,
return
256
*
(
frame_bytes
/
64
);
return
256
*
(
frame_bytes
/
64
);
if
(
id
==
AV_CODEC_ID_RA_144
)
if
(
id
==
AV_CODEC_ID_RA_144
)
return
160
*
(
frame_bytes
/
20
);
return
160
*
(
frame_bytes
/
20
);
if
(
id
==
AV_CODEC_ID_G723_1
)
return
240
*
(
frame_bytes
/
24
);
if
(
bps
>
0
)
{
if
(
bps
>
0
)
{
/* calc from frame_bytes and bits_per_coded_sample */
/* calc from frame_bytes and bits_per_coded_sample */
...
...
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