Music Hub
..
A session-wide music playback service
platform_default_sink.cpp
Go to the documentation of this file.
1
/*
2
* Copyright © 2014 Canonical Ltd.
3
*
4
* This program is free software: you can redistribute it and/or modify it
5
* under the terms of the GNU Lesser General Public License version 3,
6
* as published by the Free Software Foundation.
7
*
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU Lesser General Public License for more details.
12
*
13
* You should have received a copy of the GNU Lesser General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
15
*
16
* Authored by: Thomas Voß <thomas.voss@canonical.com>
17
*/
18
19
#include <
core/media/video/platform_default_sink.h
>
20
21
namespace
media
=
core::ubuntu::media
;
22
namespace
video
=
core::ubuntu::media::video
;
23
24
namespace
25
{
26
struct
NullSink :
public
video::Sink
27
{
28
// The signal is emitted whenever a new frame is available and a subsequent
29
// call to swap_buffers will not block and return true.
30
const
core::Signal<void>&
frame_available
()
const
31
{
32
return
signal_frame_available;
33
}
34
35
// Queries the transformation matrix for the current frame, placing the data into 'matrix'
36
// and returns true or returns false and leaves 'matrix' unchanged in case
37
// of issues.
38
bool
transformation_matrix
(
float
*)
const
39
{
40
return
true
;
41
}
42
43
// Releases the current buffer, and consumes the next buffer in the queue,
44
// making it available for consumption by consumers of this API in an
45
// implementation-specific way. Clients will usually rely on a GL texture
46
// to receive the latest buffer.
47
bool
swap_buffers
()
const
48
{
49
return
true
;
50
}
51
52
core::Signal<void> signal_frame_available;
53
};
54
}
55
56
#if defined(MEDIA_HUB_HAVE_HYBRIS_MEDIA_COMPAT_LAYER)
57
#include <
core/media/video/hybris_gl_sink.h
>
58
59
video::SinkFactory
video::make_platform_default_sink_factory
(
const
media::Player::PlayerKey
& key)
60
{
61
return
video::HybrisGlSink::factory_for_key
(key);
62
}
63
#else // MEDIA_HUB_HAVE_HYBRIS_MEDIA_COMPAT_LAYER
64
video::SinkFactory
video::make_platform_default_sink_factory
(
const
media::Player::PlayerKey
&)
65
{
66
return
[](std::uint32_t) {
return
video::Sink::Ptr
{}; };
67
}
68
#endif // MEDIA_HUB_HAVE_HYBRIS_MEDIA_COMPAT_LAYER
core::ubuntu::media::video::make_platform_default_sink_factory
SinkFactory make_platform_default_sink_factory(const Player::PlayerKey &key)
Definition:
platform_default_sink.cpp:64
core::ubuntu::media::Player::PlayerKey
uint32_t PlayerKey
Definition:
player.h:47
platform_default_sink.h
core::ubuntu::media::video::Sink::transformation_matrix
virtual bool transformation_matrix(float *matrix) const =0
Queries the 4x4 transformation matrix for the current frame, placing the data into 'matrix'...
core::ubuntu::media::video
Definition:
dimensions.h:31
core::ubuntu::media::video::Sink
A video sink abstracts a queue of buffers, that receives a stream of decoded video buffers from an ar...
Definition:
sink.h:36
core::ubuntu::media::video::Sink::frame_available
virtual const core::Signal< void > & frame_available() const =0
The signal is emitted whenever a new frame is available and a subsequent call to swap_buffers will no...
core::ubuntu::media::video::Sink::Ptr
std::shared_ptr< Sink > Ptr
To save us some typing.
Definition:
sink.h:39
core::ubuntu::media
Definition:
player.h:37
core::ubuntu::media::video::SinkFactory
std::function< Sink::Ptr(std::uint32_t)> SinkFactory
Definition:
platform_default_sink.h:36
core::ubuntu::media::video::HybrisGlSink::factory_for_key
static std::function< video::Sink::Ptr(std::uint32_t)> factory_for_key(const media::Player::PlayerKey &)
core::ubuntu::media::video::Sink::swap_buffers
virtual bool swap_buffers() const =0
Releases the current buffer, and consumes the next buffer in the queue, making it available for consu...
hybris_gl_sink.h
src
core
media
video
platform_default_sink.cpp
Generated on Thu Jun 4 2015 14:25:35 for Music Hub by
1.8.9.1