Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
audiowmark
Project
Project
Details
Activity
Releases
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Stefan Westerfeld
audiowmark
Commits
558e01d1
Commit
558e01d1
authored
Jun 17, 2020
by
Stefan Westerfeld
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use audio stream as input for HLS audio watermark generation.
Signed-off-by:
Stefan Westerfeld
<
stefan@space.twc.de
>
parent
2bc38ad1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
19 deletions
+13
-19
testhls.cc
src/testhls.cc
+13
-19
No files found.
src/testhls.cc
View file @
558e01d1
...
...
@@ -74,22 +74,6 @@ ff_decode (const string& filename, WavData& out_wav_data)
return
err
;
}
Error
decode_context
(
const
TSReader
&
reader
,
WavData
&
out_wav_data
)
{
auto
full_wav
=
reader
.
find
(
"full.wav"
);
if
(
!
full_wav
)
return
Error
(
"no embedded context found"
);
SFInputStream
input_stream
;
Error
err
=
input_stream
.
open
(
&
full_wav
->
data
);
if
(
err
)
return
err
;
err
=
out_wav_data
.
load
(
&
input_stream
);
return
err
;
}
Error
ff_encode
(
const
WavData
&
wav_data
,
const
string
&
filename
,
size_t
start_pos
,
size_t
cut_start
,
size_t
cut_end
,
double
pts_start
)
{
...
...
@@ -374,8 +358,15 @@ hls_mark (const string& infile, const string& outfile, const string& bits)
printf
(
"hls_elapsed_load %f
\n
"
,
(
get_time
()
-
start_time
)
*
1000
/* ms */
);
double
start_time1
=
get_time
();
WavData
wav_data
;
err
=
decode_context
(
reader
,
wav_data
);
const
TSReader
::
Entry
*
full_wav
=
reader
.
find
(
"full.wav"
);
if
(
!
full_wav
)
{
error
(
"hls_mark: no embedded context found in %s
\n
"
,
infile
.
c_str
());
return
1
;
}
SFInputStream
in_stream
;
err
=
in_stream
.
open
(
&
full_wav
->
data
);
if
(
err
)
{
error
(
"hls_mark: %s
\n
"
,
err
.
message
());
...
...
@@ -399,7 +390,10 @@ hls_mark (const string& infile, const string& outfile, const string& bits)
printf
(
"hls_time_elapsed_decode %f
\n
"
,
(
get_time
()
-
start_time1
)
*
1000
/* ms */
);
start_time1
=
get_time
();
int
zrc
=
mark_zexpand
(
wav_data
,
start_pos
-
prev_size
,
bits
);
WavData
wav_data
({
/* no samples */
},
in_stream
.
n_channels
(),
in_stream
.
sample_rate
(),
in_stream
.
bit_depth
());
WDOutputStream
out_stream
(
&
wav_data
);
int
zrc
=
add_stream_watermark
(
&
in_stream
,
&
out_stream
,
bits
,
start_pos
-
prev_size
);
if
(
zrc
!=
0
)
return
zrc
;
...
...
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