Music Hub  ..
A session-wide music playback service
engine.cpp
Go to the documentation of this file.
1 /*
2  * Copyright © 2013-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  * Jim Hodapp <jim.hodapp@canonical.com>
18  */
19 
20 #include <stdio.h>
21 #include <stdlib.h>
22 
23 #include "bus.h"
24 #include "engine.h"
25 #include "meta_data_extractor.h"
26 #include "playbin.h"
27 
29 
30 #include <cassert>
31 
32 namespace media = core::ubuntu::media;
33 
34 using namespace std;
35 
36 namespace gstreamer
37 {
38 struct Init
39 {
40  Init()
41  {
42  gst_init(nullptr, nullptr);
43  }
44 
46  {
47  gst_deinit();
48  }
49 } init;
50 }
51 
53 {
55  {
56  if (state.new_state == GST_STATE_PLAYING)
57  return media::Player::PlaybackStatus::playing;
58  else if (state.new_state == GST_STATE_PAUSED)
59  return media::Player::PlaybackStatus::paused;
60  else if (state.new_state == GST_STATE_READY)
61  return media::Player::PlaybackStatus::ready;
62  else if (state.new_state == GST_STATE_NULL)
63  return media::Player::PlaybackStatus::null;
64  else
65  return media::Player::PlaybackStatus::stopped;
66  }
67 
68  void on_playbin_state_changed(const std::pair<gstreamer::Bus::Message::Detail::StateChanged,std::string>& p)
69  {
70  if (p.second == "playbin")
71  {
72  MH_INFO("State changed on playbin: %s",
73  gst_element_state_get_name(p.first.new_state));
74  const auto status = gst_state_to_player_status(p.first);
75  /*
76  * When state moves to "paused" the pipeline is already set. We check that we
77  * have streams to play.
78  */
79  if (status == media::Player::PlaybackStatus::paused &&
80  !playbin.can_play_streams()) {
81  MH_ERROR("** Cannot play: some codecs are missing");
82  playbin.reset();
83  const media::Player::Error e = media::Player::Error::format_error;
84  error(e);
85  } else {
86  playback_status_changed(status);
87  }
88  }
89  }
90 
91  // Converts from a GStreamer GError to a media::Player:Error enum
93  {
94  media::Player::Error ret_error = media::Player::Error::no_error;
95 
96  if (g_strcmp0(g_quark_to_string(ewi.error->domain), "gst-core-error-quark") == 0)
97  {
98  switch (ewi.error->code)
99  {
100  case GST_CORE_ERROR_FAILED:
101  MH_ERROR("** Encountered a GST_CORE_ERROR_FAILED");
102  ret_error = media::Player::Error::resource_error;
103  break;
104  case GST_CORE_ERROR_NEGOTIATION:
105  MH_ERROR("** Encountered a GST_CORE_ERROR_NEGOTIATION");
106  ret_error = media::Player::Error::resource_error;
107  break;
108  case GST_CORE_ERROR_MISSING_PLUGIN:
109  MH_ERROR("** Encountered a GST_CORE_ERROR_MISSING_PLUGIN");
110  ret_error = media::Player::Error::format_error;
111  break;
112  default:
113  MH_ERROR("** Encountered an unhandled core error: '%s' (code: %d)",
114  ewi.debug, ewi.error->code);
115  ret_error = media::Player::Error::no_error;
116  break;
117  }
118  }
119  else if (g_strcmp0(g_quark_to_string(ewi.error->domain), "gst-resource-error-quark") == 0)
120  {
121  switch (ewi.error->code)
122  {
123  case GST_RESOURCE_ERROR_FAILED:
124  MH_ERROR("** Encountered a GST_RESOURCE_ERROR_FAILED");
125  ret_error = media::Player::Error::resource_error;
126  break;
127  case GST_RESOURCE_ERROR_NOT_FOUND:
128  MH_ERROR("** Encountered a GST_RESOURCE_ERROR_NOT_FOUND");
129  ret_error = media::Player::Error::resource_error;
130  break;
131  case GST_RESOURCE_ERROR_OPEN_READ:
132  MH_ERROR("** Encountered a GST_RESOURCE_ERROR_OPEN_READ");
133  ret_error = media::Player::Error::resource_error;
134  break;
135  case GST_RESOURCE_ERROR_OPEN_WRITE:
136  MH_ERROR("** Encountered a GST_RESOURCE_ERROR_OPEN_WRITE");
137  ret_error = media::Player::Error::resource_error;
138  break;
139  case GST_RESOURCE_ERROR_READ:
140  MH_ERROR("** Encountered a GST_RESOURCE_ERROR_READ");
141  ret_error = media::Player::Error::resource_error;
142  break;
143  case GST_RESOURCE_ERROR_WRITE:
144  MH_ERROR("** Encountered a GST_RESOURCE_ERROR_WRITE");
145  ret_error = media::Player::Error::resource_error;
146  break;
147  case GST_RESOURCE_ERROR_NOT_AUTHORIZED:
148  MH_ERROR("** Encountered a GST_RESOURCE_ERROR_NOT_AUTHORIZED");
149  ret_error = media::Player::Error::access_denied_error;
150  break;
151  default:
152  MH_ERROR("** Encountered an unhandled resource error: '%s' (code: %d)",
153  ewi.debug, ewi.error->code);
154  ret_error = media::Player::Error::no_error;
155  break;
156  }
157  }
158  else if (g_strcmp0(g_quark_to_string(ewi.error->domain), "gst-stream-error-quark") == 0)
159  {
160  switch (ewi.error->code)
161  {
162  case GST_STREAM_ERROR_FAILED:
163  MH_ERROR("** Encountered a GST_STREAM_ERROR_FAILED");
164  ret_error = media::Player::Error::resource_error;
165  break;
166  case GST_STREAM_ERROR_CODEC_NOT_FOUND:
167  MH_ERROR("** Encountered a GST_STREAM_ERROR_CODEC_NOT_FOUND");
168  // Missing codecs are handled later, when state switches to "paused"
169  ret_error = media::Player::Error::no_error;
170  break;
171  case GST_STREAM_ERROR_DECODE:
172  MH_ERROR("** Encountered a GST_STREAM_ERROR_DECODE");
173  ret_error = media::Player::Error::format_error;
174  break;
175  default:
176  MH_ERROR("** Encountered an unhandled stream error: '%s' code(%d)",
177  ewi.debug, ewi.error->code);
178  ret_error = media::Player::Error::no_error;
179  break;
180  }
181  }
182 
183  if (ret_error != media::Player::Error::no_error) {
184  MH_ERROR("Resetting playbin pipeline after unrecoverable error");
185  playbin.reset();
186  }
187  return ret_error;
188  }
189 
191  {
192  const media::Player::Error e = from_gst_errorwarning(ewi);
193  if (e != media::Player::Error::no_error)
194  error(e);
195  }
196 
198  {
199  const media::Player::Error e = from_gst_errorwarning(ewi);
200  if (e != media::Player::Error::no_error)
201  error(e);
202  }
203 
205  {
206  MH_DEBUG("Got a playbin info message (no action taken): %s", ewi.debug);
207  }
208 
210  {
211  media::Track::MetaData md;
212 
213  // We update instead of creating from scratch if same uri
214  auto &tuple = track_meta_data.get();
215  if (playbin.uri() == std::get<0>(tuple))
216  md = std::get<1>(tuple);
217 
219  track_meta_data.set(std::make_tuple(playbin.uri(), md));
220  }
221 
222  void on_volume_changed(const media::Engine::Volume& new_volume)
223  {
224  playbin.set_volume(new_volume.value);
225  }
226 
228  {
229  playbin.set_audio_stream_role(new_audio_role);
230  }
231 
233  {
234  // Update the local orientation Property, which should then update the Player
235  // orientation Property
236  orientation.set(o);
237  }
238 
240  {
241  playbin.set_lifetime(lifetime);
242  }
243 
245  {
246  state = Engine::State::ready;
247  about_to_finish();
248  }
249 
250  void on_seeked_to(uint64_t value)
251  {
252  seeked_to(value);
253  }
254 
256  {
257  client_disconnected();
258  }
259 
261  {
262  end_of_stream();
263  }
264 
266  {
267  video_dimension_changed(dimensions);
268  }
269 
270  void on_buffering_changed(int value)
271  {
272  buffering_changed(value);
273  }
274 
276  : meta_data_extractor(new gstreamer::MetaDataExtractor()),
277  volume(media::Engine::Volume(1.)),
278  orientation(media::Player::Orientation::rotate0),
279  is_video_source(false),
280  is_audio_source(false),
281  about_to_finish_connection(
282  playbin.signals.about_to_finish.connect(
283  std::bind(
284  &Private::on_about_to_finish,
285  this))),
286  on_state_changed_connection(
287  playbin.signals.on_state_changed.connect(
288  std::bind(
289  &Private::on_playbin_state_changed,
290  this,
291  std::placeholders::_1))),
292  on_error_connection(
293  playbin.signals.on_error.connect(
294  std::bind(
295  &Private::on_playbin_error,
296  this,
297  std::placeholders::_1))),
298  on_warning_connection(
299  playbin.signals.on_warning.connect(
300  std::bind(
301  &Private::on_playbin_warning,
302  this,
303  std::placeholders::_1))),
304  on_info_connection(
305  playbin.signals.on_info.connect(
306  std::bind(
307  &Private::on_playbin_info,
308  this,
309  std::placeholders::_1))),
310  on_tag_available_connection(
311  playbin.signals.on_tag_available.connect(
312  std::bind(
313  &Private::on_tag_available,
314  this,
315  std::placeholders::_1))),
316  on_volume_changed_connection(
317  volume.changed().connect(
318  std::bind(
319  &Private::on_volume_changed,
320  this,
321  std::placeholders::_1))),
322  on_audio_stream_role_changed_connection(
323  audio_role.changed().connect(
324  std::bind(
325  &Private::on_audio_stream_role_changed,
326  this,
327  std::placeholders::_1))),
328  on_orientation_changed_connection(
329  playbin.signals.on_orientation_changed.connect(
330  std::bind(
331  &Private::on_orientation_changed,
332  this,
333  std::placeholders::_1))),
334  on_lifetime_changed_connection(
335  lifetime.changed().connect(
336  std::bind(
337  &Private::on_lifetime_changed,
338  this,
339  std::placeholders::_1))),
340  on_seeked_to_connection(
341  playbin.signals.on_seeked_to.connect(
342  std::bind(
343  &Private::on_seeked_to,
344  this,
345  std::placeholders::_1))),
346  client_disconnected_connection(
347  playbin.signals.client_disconnected.connect(
348  std::bind(
349  &Private::on_client_disconnected,
350  this))),
351  on_end_of_stream_connection(
352  playbin.signals.on_end_of_stream.connect(
353  std::bind(
354  &Private::on_end_of_stream,
355  this))),
356  on_video_dimension_changed_connection(
357  playbin.signals.on_video_dimensions_changed.connect(
358  std::bind(
359  &Private::on_video_dimension_changed,
360  this,
361  std::placeholders::_1))),
362  on_buffering_changed_connection(
363  playbin.signals.on_buffering_changed.connect(
364  std::bind(
365  &Private::on_buffering_changed,
366  this,
367  std::placeholders::_1)))
368  {
369  }
370 
371  // Ensure the playbin is the last item destroyed
372  // otherwise properties could try to access a dead playbin object
374 
375  std::shared_ptr<Engine::MetaDataExtractor> meta_data_extractor;
376  core::Property<Engine::State> state;
377  core::Property<std::tuple<media::Track::UriType, media::Track::MetaData>> track_meta_data;
378  core::Property<uint64_t> position;
379  core::Property<uint64_t> duration;
380  core::Property<media::Engine::Volume> volume;
381  core::Property<media::Player::AudioStreamRole> audio_role;
382  core::Property<media::Player::Orientation> orientation;
383  core::Property<media::Player::Lifetime> lifetime;
384  core::Property<bool> is_video_source;
385  core::Property<bool> is_audio_source;
386 
387  core::ScopedConnection about_to_finish_connection;
388  core::ScopedConnection on_state_changed_connection;
389  core::ScopedConnection on_error_connection;
390  core::ScopedConnection on_warning_connection;
391  core::ScopedConnection on_info_connection;
392  core::ScopedConnection on_tag_available_connection;
393  core::ScopedConnection on_volume_changed_connection;
395  core::ScopedConnection on_orientation_changed_connection;
396  core::ScopedConnection on_lifetime_changed_connection;
397  core::ScopedConnection on_seeked_to_connection;
398  core::ScopedConnection client_disconnected_connection;
399  core::ScopedConnection on_end_of_stream_connection;
401  core::ScopedConnection on_buffering_changed_connection;
402 
403  core::Signal<void> about_to_finish;
404  core::Signal<uint64_t> seeked_to;
405  core::Signal<void> client_disconnected;
406  core::Signal<void> end_of_stream;
407  core::Signal<media::Player::PlaybackStatus> playback_status_changed;
408  core::Signal<core::ubuntu::media::video::Dimensions> video_dimension_changed;
409  core::Signal<media::Player::Error> error;
410  core::Signal<int> buffering_changed;
411 };
412 
414 {
415  d->state = media::Engine::State::no_media;
416 }
417 
419 {
420  stop();
421  d->state = media::Engine::State::no_media;
422 }
423 
424 const std::shared_ptr<media::Engine::MetaDataExtractor>&
426 {
427  return d->meta_data_extractor;
428 }
429 
430 const core::Property<media::Engine::State>& gstreamer::Engine::state() const
431 {
432  return d->state;
433 }
434 
436  bool do_pipeline_reset)
437 {
438  d->playbin.set_uri(uri, core::ubuntu::media::Player::HeadersType{}, do_pipeline_reset);
439  return true;
440 }
441 
444 {
445  d->playbin.set_uri(uri, headers);
446  return true;
447 }
448 
449 void gstreamer::Engine::create_video_sink(uint32_t texture_id)
450 {
451  d->playbin.create_video_sink(texture_id);
452 }
453 
454 bool gstreamer::Engine::play(bool use_main_thread /* = false */)
455 {
456  const auto result = d->playbin.set_state_and_wait(GST_STATE_PLAYING, use_main_thread);
457 
458  if (result)
459  {
460  d->state = media::Engine::State::playing;
461  MH_INFO("Engine: playing uri: %s", d->playbin.uri());
462  d->playback_status_changed(media::Player::PlaybackStatus::playing);
463  }
464 
465  return result;
466 }
467 
468 bool gstreamer::Engine::stop(bool use_main_thread /* = false */)
469 {
470  // No need to wait, and we can immediately return.
471  if (d->state == media::Engine::State::stopped)
472  {
473  MH_DEBUG("Current player state is already stopped - no need to change state to stopped");
474  return true;
475  }
476 
477  const auto result = d->playbin.set_state_and_wait(GST_STATE_NULL, use_main_thread);
478  if (result)
479  {
480  d->state = media::Engine::State::stopped;
481  MH_TRACE("");
482  d->playback_status_changed(media::Player::PlaybackStatus::stopped);
483  }
484 
485  return result;
486 }
487 
489 {
490  const auto result = d->playbin.set_state_and_wait(GST_STATE_PAUSED);
491 
492  if (result)
493  {
494  d->state = media::Engine::State::paused;
495  MH_TRACE("");
496  d->playback_status_changed(media::Player::PlaybackStatus::paused);
497  }
498 
499  return result;
500 }
501 
502 bool gstreamer::Engine::seek_to(const std::chrono::microseconds& ts)
503 {
504  return d->playbin.seek(ts);
505 }
506 
507 const core::Property<bool>& gstreamer::Engine::is_video_source() const
508 {
509  gstreamer::Playbin::MediaFileType type = d->playbin.media_file_type();
510  if (type == gstreamer::Playbin::MediaFileType::MEDIA_FILE_TYPE_VIDEO)
511  d->is_video_source.set(true);
512  else
513  d->is_video_source.set(false);
514 
515  return d->is_video_source;
516 }
517 
518 const core::Property<bool>& gstreamer::Engine::is_audio_source() const
519 {
520  gstreamer::Playbin::MediaFileType type = d->playbin.media_file_type();
521  if (type == gstreamer::Playbin::MediaFileType::MEDIA_FILE_TYPE_AUDIO)
522  d->is_audio_source.set(true);
523  else
524  d->is_audio_source.set(false);
525 
526  return d->is_audio_source;
527 }
528 
529 const core::Property<uint64_t>& gstreamer::Engine::position() const
530 {
531  d->position.set(d->playbin.position());
532  return d->position;
533 }
534 
535 const core::Property<uint64_t>& gstreamer::Engine::duration() const
536 {
537  d->duration.set(d->playbin.duration());
538  return d->duration;
539 }
540 
541 const core::Property<core::ubuntu::media::Engine::Volume>& gstreamer::Engine::volume() const
542 {
543  return d->volume;
544 }
545 
546 core::Property<core::ubuntu::media::Engine::Volume>& gstreamer::Engine::volume()
547 {
548  return d->volume;
549 }
550 
551 const core::Property<core::ubuntu::media::Player::AudioStreamRole>& gstreamer::Engine::audio_stream_role() const
552 {
553  return d->audio_role;
554 }
555 
556 const core::Property<core::ubuntu::media::Player::Lifetime>& gstreamer::Engine::lifetime() const
557 {
558  return d->lifetime;
559 }
560 
561 core::Property<core::ubuntu::media::Player::AudioStreamRole>& gstreamer::Engine::audio_stream_role()
562 {
563  return d->audio_role;
564 }
565 
566 const core::Property<core::ubuntu::media::Player::Orientation>& gstreamer::Engine::orientation() const
567 {
568  return d->orientation;
569 }
570 
571 core::Property<core::ubuntu::media::Player::Lifetime>& gstreamer::Engine::lifetime()
572 {
573  return d->lifetime;
574 }
575 
576 const core::Property<std::tuple<media::Track::UriType, media::Track::MetaData>>&
578 {
579  return d->track_meta_data;
580 }
581 
582 const core::Signal<void>& gstreamer::Engine::about_to_finish_signal() const
583 {
584  return d->about_to_finish;
585 }
586 
587 const core::Signal<uint64_t>& gstreamer::Engine::seeked_to_signal() const
588 {
589  return d->seeked_to;
590 }
591 
592 const core::Signal<void>& gstreamer::Engine::client_disconnected_signal() const
593 {
594  return d->client_disconnected;
595 }
596 
597 const core::Signal<void>& gstreamer::Engine::end_of_stream_signal() const
598 {
599  return d->end_of_stream;
600 }
601 
602 const core::Signal<media::Player::PlaybackStatus>& gstreamer::Engine::playback_status_changed_signal() const
603 {
604  return d->playback_status_changed;
605 }
606 
607 const core::Signal<core::ubuntu::media::video::Dimensions>& gstreamer::Engine::video_dimension_changed_signal() const
608 {
609  return d->video_dimension_changed;
610 }
611 
612 const core::Signal<core::ubuntu::media::Player::Error>& gstreamer::Engine::error_signal() const
613 {
614  return d->error;
615 }
616 
617 const core::Signal<int>& gstreamer::Engine::on_buffering_changed_signal() const
618 {
619  return d->buffering_changed;
620 }
621 
623 {
624  d->playbin.reset();
625 }
void on_tag_available(const gstreamer::Bus::Message::Detail::Tag &tag)
Definition: engine.cpp:209
core::ScopedConnection on_state_changed_connection
Definition: engine.cpp:388
core::ScopedConnection on_video_dimension_changed_connection
Definition: engine.cpp:400
core::Signal< core::ubuntu::media::video::Dimensions > video_dimension_changed
Definition: engine.cpp:408
const core::Property< core::ubuntu::media::Engine::Volume > & volume() const
Definition: engine.cpp:541
core::Property< bool > is_video_source
Definition: engine.cpp:384
const core::Signal< core::ubuntu::media::Player::PlaybackStatus > & playback_status_changed_signal() const
Definition: engine.cpp:602
const core::Property< core::ubuntu::media::Player::AudioStreamRole > & audio_stream_role() const
Definition: engine.cpp:551
std::tuple< Height, Width > Dimensions
Height and Width of a video.
Definition: dimensions.h:139
const core::Property< bool > & is_video_source() const
Definition: engine.cpp:507
const core::Signal< void > & client_disconnected_signal() const
Definition: engine.cpp:592
core::ScopedConnection on_info_connection
Definition: engine.cpp:391
core::Signal< void > end_of_stream
Definition: engine.cpp:406
Definition: bus.h:33
core::ScopedConnection on_buffering_changed_connection
Definition: engine.cpp:401
core::ScopedConnection on_lifetime_changed_connection
Definition: engine.cpp:396
void on_seeked_to(uint64_t value)
Definition: engine.cpp:250
#define MH_INFO(...)
Definition: logger.h:125
void on_playbin_warning(const gstreamer::Bus::Message::Detail::ErrorWarningInfo &ewi)
Definition: engine.cpp:197
bool stop(bool use_main_thread=false)
Definition: engine.cpp:468
STL namespace.
const core::Property< State > & state() const
Definition: engine.cpp:430
const core::Property< core::ubuntu::media::Player::Lifetime > & lifetime() const
Definition: engine.cpp:556
#define MH_ERROR(...)
Definition: logger.h:128
core::ScopedConnection on_seeked_to_connection
Definition: engine.cpp:397
core::Signal< int > buffering_changed
Definition: engine.cpp:410
core::ScopedConnection on_end_of_stream_connection
Definition: engine.cpp:399
void on_orientation_changed(const media::Player::Orientation &o)
Definition: engine.cpp:232
core::Signal< media::Player::Error > error
Definition: engine.cpp:409
std::map< std::string, std::string > HeadersType
Definition: player.h:64
gstreamer::Playbin playbin
Definition: engine.cpp:373
bool seek_to(const std::chrono::microseconds &ts)
Definition: engine.cpp:502
#define MH_DEBUG(...)
Definition: logger.h:123
core::ScopedConnection on_warning_connection
Definition: engine.cpp:390
bool open_resource_for_uri(const core::ubuntu::media::Track::UriType &uri, bool do_pipeline_reset)
const core::Signal< uint64_t > & seeked_to_signal() const
Definition: engine.cpp:587
const core::Signal< int > & on_buffering_changed_signal() const
Definition: engine.cpp:617
struct gstreamer::Init init
void create_video_sink(uint32_t texture_id)
Definition: engine.cpp:449
const core::Property< std::tuple< core::ubuntu::media::Track::UriType, core::ubuntu::media::Track::MetaData > > & track_meta_data() const
Definition: engine.cpp:577
core::ScopedConnection client_disconnected_connection
Definition: engine.cpp:398
void on_playbin_error(const gstreamer::Bus::Message::Detail::ErrorWarningInfo &ewi)
Definition: engine.cpp:190
media::Player::Error from_gst_errorwarning(const gstreamer::Bus::Message::Detail::ErrorWarningInfo &ewi)
Definition: engine.cpp:92
const core::Property< bool > & is_audio_source() const
Definition: engine.cpp:518
void on_volume_changed(const media::Engine::Volume &new_volume)
Definition: engine.cpp:222
const core::Signal< core::ubuntu::media::Player::Error > & error_signal() const
Definition: engine.cpp:612
const core::Property< uint64_t > & duration() const
Definition: engine.cpp:535
core::ScopedConnection on_volume_changed_connection
Definition: engine.cpp:393
const core::Signal< void > & about_to_finish_signal() const
Definition: engine.cpp:582
core::Property< media::Player::Orientation > orientation
Definition: engine.cpp:382
core::Property< media::Player::AudioStreamRole > audio_role
Definition: engine.cpp:381
const core::Signal< void > & end_of_stream_signal() const
Definition: engine.cpp:597
const core::Signal< core::ubuntu::media::video::Dimensions > & video_dimension_changed_signal() const
Definition: engine.cpp:607
core::Signal< void > client_disconnected
Definition: engine.cpp:405
core::Signal< uint64_t > seeked_to
Definition: engine.cpp:404
bool play(bool use_main_thread=false)
Definition: engine.cpp:454
void on_playbin_info(const gstreamer::Bus::Message::Detail::ErrorWarningInfo &ewi)
Definition: engine.cpp:204
core::ScopedConnection on_error_connection
Definition: engine.cpp:389
#define MH_TRACE(...)
Definition: logger.h:121
core::Property< media::Player::Lifetime > lifetime
Definition: engine.cpp:383
std::shared_ptr< Engine::MetaDataExtractor > meta_data_extractor
Definition: engine.cpp:375
static void on_tag_available(const gstreamer::Bus::Message::Detail::Tag &tag, core::ubuntu::media::Track::MetaData &md)
core::ScopedConnection on_tag_available_connection
Definition: engine.cpp:392
void on_buffering_changed(int value)
Definition: engine.cpp:270
const std::shared_ptr< MetaDataExtractor > & meta_data_extractor() const
Definition: engine.cpp:425
core::Property< media::Engine::Volume > volume
Definition: engine.cpp:380
void on_playbin_state_changed(const std::pair< gstreamer::Bus::Message::Detail::StateChanged, std::string > &p)
Definition: engine.cpp:68
media::Player::PlaybackStatus gst_state_to_player_status(const gstreamer::Bus::Message::Detail::StateChanged &state)
Definition: engine.cpp:54
std::string UriType
Definition: track.h:40
core::ScopedConnection about_to_finish_connection
Definition: engine.cpp:387
core::Property< Engine::State > state
Definition: engine.cpp:376
const core::Property< core::ubuntu::media::Player::Orientation > & orientation() const
Definition: engine.cpp:566
core::Property< uint64_t > position
Definition: engine.cpp:378
core::Property< std::tuple< media::Track::UriType, media::Track::MetaData > > track_meta_data
Definition: engine.cpp:377
core::Signal< void > about_to_finish
Definition: engine.cpp:403
core::Signal< media::Player::PlaybackStatus > playback_status_changed
Definition: engine.cpp:407
const core::Property< uint64_t > & position() const
Definition: engine.cpp:529
core::ScopedConnection on_orientation_changed_connection
Definition: engine.cpp:395
void on_audio_stream_role_changed(const media::Player::AudioStreamRole &new_audio_role)
Definition: engine.cpp:227
void on_video_dimension_changed(const media::video::Dimensions &dimensions)
Definition: engine.cpp:265
void on_lifetime_changed(const media::Player::Lifetime &lifetime)
Definition: engine.cpp:239
core::Property< bool > is_audio_source
Definition: engine.cpp:385
core::Property< uint64_t > duration
Definition: engine.cpp:379
core::ScopedConnection on_audio_stream_role_changed_connection
Definition: engine.cpp:394