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
6896f95b
Commit
6896f95b
authored
Oct 29, 2014
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vorbis_parser: add an AV prefix to VorbisParseContext
This is done in preparation for making it public.
parent
87479264
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
14 deletions
+14
-14
libvorbis.c
libavcodec/libvorbis.c
+1
-1
vorbis_parser.c
libavcodec/vorbis_parser.c
+7
-7
vorbis_parser.h
libavcodec/vorbis_parser.h
+5
-5
oggparsevorbis.c
libavformat/oggparsevorbis.c
+1
-1
No files found.
libavcodec/libvorbis.c
View file @
6896f95b
...
@@ -58,7 +58,7 @@ typedef struct LibvorbisContext {
...
@@ -58,7 +58,7 @@ typedef struct LibvorbisContext {
vorbis_comment
vc
;
/**< VorbisComment info */
vorbis_comment
vc
;
/**< VorbisComment info */
ogg_packet
op
;
/**< ogg packet */
ogg_packet
op
;
/**< ogg packet */
double
iblock
;
/**< impulse block bias option */
double
iblock
;
/**< impulse block bias option */
VorbisParseContext
vp
;
/**< parse context to get durations */
AVVorbisParseContext
vp
;
/**< parse context to get durations */
AudioFrameQueue
afq
;
/**< frame queue for timestamps */
AudioFrameQueue
afq
;
/**< frame queue for timestamps */
}
LibvorbisContext
;
}
LibvorbisContext
;
...
...
libavcodec/vorbis_parser.c
View file @
6896f95b
...
@@ -38,7 +38,7 @@ static const AVClass vorbis_parser_class = {
...
@@ -38,7 +38,7 @@ static const AVClass vorbis_parser_class = {
.
version
=
LIBAVUTIL_VERSION_INT
,
.
version
=
LIBAVUTIL_VERSION_INT
,
};
};
static
int
parse_id_header
(
VorbisParseContext
*
s
,
static
int
parse_id_header
(
AV
VorbisParseContext
*
s
,
const
uint8_t
*
buf
,
int
buf_size
)
const
uint8_t
*
buf
,
int
buf_size
)
{
{
/* Id header should be 30 bytes */
/* Id header should be 30 bytes */
...
@@ -70,7 +70,7 @@ static int parse_id_header(VorbisParseContext *s,
...
@@ -70,7 +70,7 @@ static int parse_id_header(VorbisParseContext *s,
return
0
;
return
0
;
}
}
static
int
parse_setup_header
(
VorbisParseContext
*
s
,
static
int
parse_setup_header
(
AV
VorbisParseContext
*
s
,
const
uint8_t
*
buf
,
int
buf_size
)
const
uint8_t
*
buf
,
int
buf_size
)
{
{
GetBitContext
gb
,
gb0
;
GetBitContext
gb
,
gb0
;
...
@@ -181,7 +181,7 @@ bad_header:
...
@@ -181,7 +181,7 @@ bad_header:
return
ret
;
return
ret
;
}
}
int
avpriv_vorbis_parse_extradata
(
AVCodecContext
*
avctx
,
VorbisParseContext
*
s
)
int
avpriv_vorbis_parse_extradata
(
AVCodecContext
*
avctx
,
AV
VorbisParseContext
*
s
)
{
{
uint8_t
*
header_start
[
3
];
uint8_t
*
header_start
[
3
];
int
header_len
[
3
];
int
header_len
[
3
];
...
@@ -209,7 +209,7 @@ int avpriv_vorbis_parse_extradata(AVCodecContext *avctx, VorbisParseContext *s)
...
@@ -209,7 +209,7 @@ int avpriv_vorbis_parse_extradata(AVCodecContext *avctx, VorbisParseContext *s)
return
0
;
return
0
;
}
}
int
avpriv_vorbis_parse_frame
(
VorbisParseContext
*
s
,
const
uint8_t
*
buf
,
int
avpriv_vorbis_parse_frame
(
AV
VorbisParseContext
*
s
,
const
uint8_t
*
buf
,
int
buf_size
)
int
buf_size
)
{
{
int
duration
=
0
;
int
duration
=
0
;
...
@@ -242,7 +242,7 @@ int avpriv_vorbis_parse_frame(VorbisParseContext *s, const uint8_t *buf,
...
@@ -242,7 +242,7 @@ int avpriv_vorbis_parse_frame(VorbisParseContext *s, const uint8_t *buf,
return
duration
;
return
duration
;
}
}
void
avpriv_vorbis_parse_reset
(
VorbisParseContext
*
s
)
void
avpriv_vorbis_parse_reset
(
AV
VorbisParseContext
*
s
)
{
{
if
(
s
->
valid_extradata
)
if
(
s
->
valid_extradata
)
s
->
previous_blocksize
=
s
->
mode_blocksize
[
0
];
s
->
previous_blocksize
=
s
->
mode_blocksize
[
0
];
...
@@ -253,7 +253,7 @@ static int vorbis_parse(AVCodecParserContext *s1, AVCodecContext *avctx,
...
@@ -253,7 +253,7 @@ static int vorbis_parse(AVCodecParserContext *s1, AVCodecContext *avctx,
const
uint8_t
**
poutbuf
,
int
*
poutbuf_size
,
const
uint8_t
**
poutbuf
,
int
*
poutbuf_size
,
const
uint8_t
*
buf
,
int
buf_size
)
const
uint8_t
*
buf
,
int
buf_size
)
{
{
VorbisParseContext
*
s
=
s1
->
priv_data
;
AV
VorbisParseContext
*
s
=
s1
->
priv_data
;
int
duration
;
int
duration
;
if
(
!
s
->
extradata_parsed
&&
avctx
->
extradata
&&
avctx
->
extradata_size
)
if
(
!
s
->
extradata_parsed
&&
avctx
->
extradata
&&
avctx
->
extradata_size
)
...
@@ -273,7 +273,7 @@ end:
...
@@ -273,7 +273,7 @@ end:
AVCodecParser
ff_vorbis_parser
=
{
AVCodecParser
ff_vorbis_parser
=
{
.
codec_ids
=
{
AV_CODEC_ID_VORBIS
},
.
codec_ids
=
{
AV_CODEC_ID_VORBIS
},
.
priv_data_size
=
sizeof
(
VorbisParseContext
),
.
priv_data_size
=
sizeof
(
AV
VorbisParseContext
),
.
parser_parse
=
vorbis_parse
,
.
parser_parse
=
vorbis_parse
,
};
};
#endif
/* CONFIG_VORBIS_PARSER */
#endif
/* CONFIG_VORBIS_PARSER */
libavcodec/vorbis_parser.h
View file @
6896f95b
...
@@ -30,7 +30,7 @@
...
@@ -30,7 +30,7 @@
#include "avcodec.h"
#include "avcodec.h"
typedef
struct
VorbisParseContext
{
typedef
struct
AV
VorbisParseContext
{
const
AVClass
*
class
;
const
AVClass
*
class
;
int
extradata_parsed
;
///< we have attempted to parse extradata
int
extradata_parsed
;
///< we have attempted to parse extradata
int
valid_extradata
;
///< extradata is valid, so we can calculate duration
int
valid_extradata
;
///< extradata is valid, so we can calculate duration
...
@@ -40,7 +40,7 @@ typedef struct VorbisParseContext {
...
@@ -40,7 +40,7 @@ typedef struct VorbisParseContext {
int
mode_count
;
///< number of modes
int
mode_count
;
///< number of modes
int
mode_mask
;
///< bitmask used to get the mode in each packet
int
mode_mask
;
///< bitmask used to get the mode in each packet
int
prev_mask
;
///< bitmask used to get the previous mode flag in each packet
int
prev_mask
;
///< bitmask used to get the previous mode flag in each packet
}
VorbisParseContext
;
}
AV
VorbisParseContext
;
/**
/**
* Initialize the Vorbis parser using headers in the extradata.
* Initialize the Vorbis parser using headers in the extradata.
...
@@ -48,7 +48,7 @@ typedef struct VorbisParseContext {
...
@@ -48,7 +48,7 @@ typedef struct VorbisParseContext {
* @param avctx codec context
* @param avctx codec context
* @param s Vorbis parser context
* @param s Vorbis parser context
*/
*/
int
avpriv_vorbis_parse_extradata
(
AVCodecContext
*
avctx
,
VorbisParseContext
*
s
);
int
avpriv_vorbis_parse_extradata
(
AVCodecContext
*
avctx
,
AV
VorbisParseContext
*
s
);
/**
/**
* Get the duration for a Vorbis packet.
* Get the duration for a Vorbis packet.
...
@@ -60,9 +60,9 @@ int avpriv_vorbis_parse_extradata(AVCodecContext *avctx, VorbisParseContext *s);
...
@@ -60,9 +60,9 @@ int avpriv_vorbis_parse_extradata(AVCodecContext *avctx, VorbisParseContext *s);
* @param buf buffer containing a Vorbis frame
* @param buf buffer containing a Vorbis frame
* @param buf_size size of the buffer
* @param buf_size size of the buffer
*/
*/
int
avpriv_vorbis_parse_frame
(
VorbisParseContext
*
s
,
const
uint8_t
*
buf
,
int
avpriv_vorbis_parse_frame
(
AV
VorbisParseContext
*
s
,
const
uint8_t
*
buf
,
int
buf_size
);
int
buf_size
);
void
avpriv_vorbis_parse_reset
(
VorbisParseContext
*
s
);
void
avpriv_vorbis_parse_reset
(
AV
VorbisParseContext
*
s
);
#endif
/* AVCODEC_VORBIS_PARSER_H */
#endif
/* AVCODEC_VORBIS_PARSER_H */
libavformat/oggparsevorbis.c
View file @
6896f95b
...
@@ -208,7 +208,7 @@ int ff_vorbis_comment(AVFormatContext *as, AVDictionary **m,
...
@@ -208,7 +208,7 @@ int ff_vorbis_comment(AVFormatContext *as, AVDictionary **m,
struct
oggvorbis_private
{
struct
oggvorbis_private
{
unsigned
int
len
[
3
];
unsigned
int
len
[
3
];
unsigned
char
*
packet
[
3
];
unsigned
char
*
packet
[
3
];
VorbisParseContext
vp
;
AV
VorbisParseContext
vp
;
int64_t
final_pts
;
int64_t
final_pts
;
int
final_duration
;
int
final_duration
;
};
};
...
...
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