Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
c56ee724
Commit
c56ee724
authored
May 10, 2014
by
Rafaël Carré
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
opus_header: opus_header_to_packet doesn't need to be exported
parent
f04c25c8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
52 deletions
+52
-52
modules/codec/opus_header.c
modules/codec/opus_header.c
+52
-51
modules/codec/opus_header.h
modules/codec/opus_header.h
+0
-1
No files found.
modules/codec/opus_header.c
View file @
c56ee724
...
...
@@ -313,57 +313,7 @@ int opus_prepare_header(unsigned channels, unsigned rate, OpusHeader *header)
return
0
;
}
int
opus_write_header
(
uint8_t
**
p_extra
,
int
*
i_extra
,
OpusHeader
*
header
)
{
unsigned
char
header_data
[
100
];
const
int
packet_size
=
opus_header_to_packet
(
header
,
header_data
,
sizeof
(
header_data
));
ogg_packet
headers
[
2
];
headers
[
0
].
packet
=
header_data
;
headers
[
0
].
bytes
=
packet_size
;
headers
[
0
].
b_o_s
=
1
;
headers
[
0
].
e_o_s
=
0
;
headers
[
0
].
granulepos
=
0
;
headers
[
0
].
packetno
=
0
;
size_t
comments_length
;
char
*
comments
=
comment_init
(
&
comments_length
);
if
(
!
comments
)
return
1
;
if
(
comment_add
(
&
comments
,
&
comments_length
,
"ENCODER="
,
"VLC media player"
))
{
free
(
comments
);
return
1
;
}
if
(
comment_pad
(
&
comments
,
&
comments_length
))
{
free
(
comments
);
return
1
;
}
headers
[
1
].
packet
=
(
unsigned
char
*
)
comments
;
headers
[
1
].
bytes
=
comments_length
;
headers
[
1
].
b_o_s
=
0
;
headers
[
1
].
e_o_s
=
0
;
headers
[
1
].
granulepos
=
0
;
headers
[
1
].
packetno
=
1
;
for
(
unsigned
i
=
0
;
i
<
ARRAY_SIZE
(
headers
);
++
i
)
{
if
(
xiph_AppendHeaders
(
i_extra
,
(
void
**
)
p_extra
,
headers
[
i
].
bytes
,
headers
[
i
].
packet
))
{
*
i_extra
=
0
;
*
p_extra
=
NULL
;
}
}
return
0
;
}
int
opus_header_to_packet
(
const
OpusHeader
*
h
,
unsigned
char
*
packet
,
int
len
)
static
int
opus_header_to_packet
(
const
OpusHeader
*
h
,
unsigned
char
*
packet
,
int
len
)
{
Packet
p
;
unsigned
char
ch
;
...
...
@@ -416,3 +366,54 @@ int opus_header_to_packet(const OpusHeader *h, unsigned char *packet, int len)
return
p
.
pos
;
}
int
opus_write_header
(
uint8_t
**
p_extra
,
int
*
i_extra
,
OpusHeader
*
header
)
{
unsigned
char
header_data
[
100
];
const
int
packet_size
=
opus_header_to_packet
(
header
,
header_data
,
sizeof
(
header_data
));
ogg_packet
headers
[
2
];
headers
[
0
].
packet
=
header_data
;
headers
[
0
].
bytes
=
packet_size
;
headers
[
0
].
b_o_s
=
1
;
headers
[
0
].
e_o_s
=
0
;
headers
[
0
].
granulepos
=
0
;
headers
[
0
].
packetno
=
0
;
size_t
comments_length
;
char
*
comments
=
comment_init
(
&
comments_length
);
if
(
!
comments
)
return
1
;
if
(
comment_add
(
&
comments
,
&
comments_length
,
"ENCODER="
,
"VLC media player"
))
{
free
(
comments
);
return
1
;
}
if
(
comment_pad
(
&
comments
,
&
comments_length
))
{
free
(
comments
);
return
1
;
}
headers
[
1
].
packet
=
(
unsigned
char
*
)
comments
;
headers
[
1
].
bytes
=
comments_length
;
headers
[
1
].
b_o_s
=
0
;
headers
[
1
].
e_o_s
=
0
;
headers
[
1
].
granulepos
=
0
;
headers
[
1
].
packetno
=
1
;
for
(
unsigned
i
=
0
;
i
<
ARRAY_SIZE
(
headers
);
++
i
)
{
if
(
xiph_AppendHeaders
(
i_extra
,
(
void
**
)
p_extra
,
headers
[
i
].
bytes
,
headers
[
i
].
packet
))
{
*
i_extra
=
0
;
*
p_extra
=
NULL
;
}
}
return
0
;
}
modules/codec/opus_header.h
View file @
c56ee724
...
...
@@ -45,7 +45,6 @@ typedef struct {
}
OpusHeader
;
int
opus_header_parse
(
const
unsigned
char
*
header
,
int
len
,
OpusHeader
*
h
);
int
opus_header_to_packet
(
const
OpusHeader
*
h
,
unsigned
char
*
packet
,
int
len
);
int
opus_prepare_header
(
unsigned
channels
,
unsigned
rate
,
OpusHeader
*
header
);
int
opus_write_header
(
uint8_t
**
p_extra
,
int
*
i_extra
,
OpusHeader
*
header
);
...
...
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