Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
88bbd847
Commit
88bbd847
authored
Feb 17, 2018
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test/FakeDecoderAPI: rename to DumpDecoderClient
parent
34d14df2
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
27 deletions
+27
-27
Makefile.am
Makefile.am
+1
-1
DumpDecoderClient.cxx
test/DumpDecoderClient.cxx
+15
-15
DumpDecoderClient.hxx
test/DumpDecoderClient.hxx
+4
-4
run_decoder.cxx
test/run_decoder.cxx
+7
-7
No files found.
Makefile.am
View file @
88bbd847
...
...
@@ -2056,7 +2056,7 @@ test_run_decoder_LDADD = \
libsystem.a
\
libutil.a
test_run_decoder_SOURCES
=
test
/run_decoder.cxx
\
test
/
FakeDecoderAPI.cxx
test
/FakeDecoderAPI
.hxx
\
test
/
DumpDecoderClient.cxx
test
/DumpDecoderClient
.hxx
\
src/DetachedSong.cxx
\
src/Log.cxx src/LogBackend.cxx
\
src/ReplayGainInfo.cxx
...
...
test/
FakeDecoderAPI
.cxx
→
test/
DumpDecoderClient
.cxx
View file @
88bbd847
/*
* Copyright 2003-201
7
The Music Player Daemon Project
* Copyright 2003-201
8
The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
...
...
@@ -18,7 +18,7 @@
*/
#include "config.h"
#include "
FakeDecoderAPI
.hxx"
#include "
DumpDecoderClient
.hxx"
#include "decoder/DecoderAPI.hxx"
#include "input/InputStream.hxx"
#include "util/StringBuffer.hxx"
...
...
@@ -28,7 +28,7 @@
#include <stdio.h>
void
FakeDecoder
::
Ready
(
const
AudioFormat
audio_format
,
DumpDecoderClient
::
Ready
(
const
AudioFormat
audio_format
,
gcc_unused
bool
seekable
,
SignedSongTime
duration
)
{
...
...
@@ -43,41 +43,41 @@ FakeDecoder::Ready(const AudioFormat audio_format,
}
DecoderCommand
FakeDecoder
::
GetCommand
()
noexcept
DumpDecoderClient
::
GetCommand
()
noexcept
{
return
DecoderCommand
::
NONE
;
}
void
FakeDecoder
::
CommandFinished
()
DumpDecoderClient
::
CommandFinished
()
{
}
SongTime
FakeDecoder
::
GetSeekTime
()
noexcept
DumpDecoderClient
::
GetSeekTime
()
noexcept
{
return
SongTime
();
}
uint64_t
FakeDecoder
::
GetSeekFrame
()
noexcept
DumpDecoderClient
::
GetSeekFrame
()
noexcept
{
return
1
;
}
void
FakeDecoder
::
SeekError
()
DumpDecoderClient
::
SeekError
()
{
}
InputStreamPtr
FakeDecoder
::
OpenUri
(
const
char
*
uri
)
DumpDecoderClient
::
OpenUri
(
const
char
*
uri
)
{
return
InputStream
::
OpenReady
(
uri
,
mutex
,
cond
);
}
size_t
FakeDecoder
::
Read
(
InputStream
&
is
,
void
*
buffer
,
size_t
length
)
DumpDecoderClient
::
Read
(
InputStream
&
is
,
void
*
buffer
,
size_t
length
)
{
try
{
return
is
.
LockRead
(
buffer
,
length
);
...
...
@@ -87,12 +87,12 @@ FakeDecoder::Read(InputStream &is, void *buffer, size_t length)
}
void
FakeDecoder
::
SubmitTimestamp
(
gcc_unused
double
t
)
DumpDecoderClient
::
SubmitTimestamp
(
gcc_unused
double
t
)
{
}
DecoderCommand
FakeDecoder
::
SubmitData
(
gcc_unused
InputStream
*
is
,
DumpDecoderClient
::
SubmitData
(
gcc_unused
InputStream
*
is
,
const
void
*
data
,
size_t
datalen
,
gcc_unused
uint16_t
kbit_rate
)
{
...
...
@@ -107,7 +107,7 @@ FakeDecoder::SubmitData(gcc_unused InputStream *is,
}
DecoderCommand
FakeDecoder
::
SubmitTag
(
gcc_unused
InputStream
*
is
,
DumpDecoderClient
::
SubmitTag
(
gcc_unused
InputStream
*
is
,
Tag
&&
tag
)
{
fprintf
(
stderr
,
"TAG: duration=%f
\n
"
,
tag
.
duration
.
ToDoubleS
());
...
...
@@ -134,14 +134,14 @@ DumpReplayGainInfo(const ReplayGainInfo &info)
}
void
FakeDecoder
::
SubmitReplayGain
(
const
ReplayGainInfo
*
rgi
)
DumpDecoderClient
::
SubmitReplayGain
(
const
ReplayGainInfo
*
rgi
)
{
if
(
rgi
!=
nullptr
)
DumpReplayGainInfo
(
*
rgi
);
}
void
FakeDecoder
::
SubmitMixRamp
(
gcc_unused
MixRampInfo
&&
mix_ramp
)
DumpDecoderClient
::
SubmitMixRamp
(
gcc_unused
MixRampInfo
&&
mix_ramp
)
{
fprintf
(
stderr
,
"MixRamp: start='%s' end='%s'
\n
"
,
mix_ramp
.
GetStart
(),
mix_ramp
.
GetEnd
());
...
...
test/
FakeDecoderAPI
.hxx
→
test/
DumpDecoderClient
.hxx
View file @
88bbd847
/*
* Copyright 2003-201
7
The Music Player Daemon Project
* Copyright 2003-201
8
The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
...
...
@@ -17,15 +17,15 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef
FAKE_DECODER_API
_HXX
#define
FAKE_DECODER_API
_HXX
#ifndef
DUMP_DECODER_CLIENT
_HXX
#define
DUMP_DECODER_CLIENT
_HXX
#include "check.h"
#include "decoder/Client.hxx"
#include "thread/Mutex.hxx"
#include "thread/Cond.hxx"
struct
FakeDecoder
final
:
DecoderClient
{
struct
DumpDecoderClient
final
:
DecoderClient
{
Mutex
mutex
;
Cond
cond
;
...
...
test/run_decoder.cxx
View file @
88bbd847
...
...
@@ -22,7 +22,7 @@
#include "event/Thread.hxx"
#include "decoder/DecoderList.hxx"
#include "decoder/DecoderPlugin.hxx"
#include "
FakeDecoderAPI
.hxx"
#include "
DumpDecoderClient
.hxx"
#include "input/Init.hxx"
#include "input/InputStream.hxx"
#include "fs/Path.hxx"
...
...
@@ -119,19 +119,19 @@ try {
return
EXIT_FAILURE
;
}
FakeDecoder
decoder
;
DumpDecoderClient
client
;
if
(
plugin
->
file_decode
!=
nullptr
)
{
plugin
->
FileDecode
(
decoder
,
Path
::
FromFS
(
c
.
uri
));
plugin
->
FileDecode
(
client
,
Path
::
FromFS
(
c
.
uri
));
}
else
if
(
plugin
->
stream_decode
!=
nullptr
)
{
auto
is
=
InputStream
::
OpenReady
(
c
.
uri
,
decoder
.
mutex
,
decoder
.
cond
);
plugin
->
StreamDecode
(
decoder
,
*
is
);
auto
is
=
InputStream
::
OpenReady
(
c
.
uri
,
client
.
mutex
,
client
.
cond
);
plugin
->
StreamDecode
(
client
,
*
is
);
}
else
{
fprintf
(
stderr
,
"Decoder plugin is not usable
\n
"
);
return
EXIT_FAILURE
;
}
if
(
!
decoder
.
initialized
)
{
if
(
!
client
.
initialized
)
{
fprintf
(
stderr
,
"Decoding failed
\n
"
);
return
EXIT_FAILURE
;
}
...
...
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