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
5130acf3
Commit
5130acf3
authored
Sep 21, 2020
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder/ffmpeg: implement protocols() and uri_decode() (for RTSP)
This implements the feature that was missing/broken in this bug report:
https://github.com/MusicPlayerDaemon/MPD/issues/930
parent
a22d1c88
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
0 deletions
+34
-0
NEWS
NEWS
+1
-0
FfmpegDecoderPlugin.cxx
src/decoder/plugins/FfmpegDecoderPlugin.cxx
+33
-0
No files found.
NEWS
View file @
5130acf3
...
...
@@ -18,6 +18,7 @@ ver 0.22 (not yet released)
* playlist
- cue: integrate contents in database
* decoder
- ffmpeg: support RTSP
- mad: remove option "gapless", always do gapless
- sidplay: add option "default_genre"
- sidplay: map SID name field to "Album" tag
...
...
src/decoder/plugins/FfmpegDecoderPlugin.cxx
View file @
5130acf3
...
...
@@ -42,6 +42,7 @@
#include "pcm/CheckAudioFormat.hxx"
#include "util/ScopeExit.hxx"
#include "util/ConstBuffer.hxx"
#include "util/StringAPI.hxx"
#include "LogV.hxx"
extern
"C"
{
...
...
@@ -638,6 +639,37 @@ ffmpeg_scan_stream(InputStream &is, TagHandler &handler)
return
FfmpegScanStream
(
*
f
,
handler
);
}
static
void
ffmpeg_uri_decode
(
DecoderClient
&
client
,
const
char
*
uri
)
{
auto
format_context
=
FfmpegOpenInput
(
nullptr
,
uri
,
nullptr
);
const
auto
*
input_format
=
format_context
->
iformat
;
FormatDebug
(
ffmpeg_domain
,
"detected input format '%s' (%s)"
,
input_format
->
name
,
input_format
->
long_name
);
FfmpegDecode
(
client
,
nullptr
,
*
format_context
);
}
static
std
::
set
<
std
::
string
>
ffmpeg_protocols
()
noexcept
{
std
::
set
<
std
::
string
>
protocols
;
const
AVInputFormat
*
format
=
nullptr
;
void
*
opaque
=
nullptr
;
while
((
format
=
av_demuxer_iterate
(
&
opaque
))
!=
nullptr
)
{
if
(
StringIsEqual
(
format
->
name
,
"rtsp"
))
{
protocols
.
emplace
(
"rtsp://"
);
protocols
.
emplace
(
"rtsps://"
);
}
else
if
(
StringIsEqual
(
format
->
name
,
"rtp"
))
protocols
.
emplace
(
"rtp://"
);
}
return
protocols
;
}
/**
* A list of extensions found for the formats supported by ffmpeg.
* This list is current as of 02-23-09; To find out if there are more
...
...
@@ -761,5 +793,6 @@ static const char *const ffmpeg_mime_types[] = {
constexpr
DecoderPlugin
ffmpeg_decoder_plugin
=
DecoderPlugin
(
"ffmpeg"
,
ffmpeg_decode
,
ffmpeg_scan_stream
)
.
WithInit
(
ffmpeg_init
,
ffmpeg_finish
)
.
WithProtocols
(
ffmpeg_protocols
,
ffmpeg_uri_decode
)
.
WithSuffixes
(
ffmpeg_suffixes
)
.
WithMimeTypes
(
ffmpeg_mime_types
);
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