~jhodapp/media-hub/fix-1398047

« back to all changes in this revision

Viewing changes to src/core/media/gstreamer/engine.cpp

  • Committer: CI bot
  • Author(s): Jim Hodapp, Justin McPherson
  • Date: 2014-11-26 14:45:56 UTC
  • mfrom: (40.2.15 oxide-support)
  • Revision ID: ps-jenkins@lists.canonical.com-20141126144556-df4zk197s9dhjscx
Resubmitting with prerequisite branch Fixes: #1331041
Approved by: Jim Hodapp

Show diffs side-by-side

added added

removed removed

Lines of Context:
79
79
        orientation.set(o);
80
80
    }
81
81
 
 
82
    void on_lifetime_changed(const media::Player::Lifetime& lifetime)
 
83
    {
 
84
        playbin.set_lifetime(lifetime);
 
85
    }
 
86
 
82
87
    void on_about_to_finish()
83
88
    {
84
89
        state = Engine::State::ready;
146
151
                      &Private::on_orientation_changed,
147
152
                      this,
148
153
                      std::placeholders::_1))),
 
154
          on_lifetime_changed_connection(
 
155
              lifetime.changed().connect(
 
156
                  std::bind(
 
157
                      &Private::on_lifetime_changed,
 
158
                      this,
 
159
                      std::placeholders::_1))),
149
160
          on_seeked_to_connection(
150
161
              playbin.signals.on_seeked_to.connect(
151
162
                  std::bind(
184
195
    core::Property<media::Engine::Volume> volume;
185
196
    core::Property<media::Player::AudioStreamRole> audio_role;
186
197
    core::Property<media::Player::Orientation> orientation;
 
198
    core::Property<media::Player::Lifetime> lifetime;
187
199
    core::Property<bool> is_video_source;
188
200
    core::Property<bool> is_audio_source;
189
201
 
193
205
    core::ScopedConnection on_volume_changed_connection;
194
206
    core::ScopedConnection on_audio_stream_role_changed_connection;
195
207
    core::ScopedConnection on_orientation_changed_connection;
 
208
    core::ScopedConnection on_lifetime_changed_connection;
196
209
    core::ScopedConnection on_seeked_to_connection;
197
210
    core::ScopedConnection client_disconnected_connection;
198
211
    core::ScopedConnection on_end_of_stream_connection;
233
246
    return true;
234
247
}
235
248
 
 
249
bool gstreamer::Engine::open_resource_for_uri(const media::Track::UriType& uri, const core::ubuntu::media::Player::HeadersType& headers)
 
250
{
 
251
    d->playbin.set_uri(uri, headers);
 
252
    return true;
 
253
}
 
254
 
236
255
void gstreamer::Engine::create_video_sink(uint32_t texture_id)
237
256
{
238
257
    d->playbin.create_video_sink(texture_id);
338
357
    return d->audio_role;
339
358
}
340
359
 
 
360
const core::Property<core::ubuntu::media::Player::Lifetime>& gstreamer::Engine::lifetime() const
 
361
{
 
362
    return d->lifetime;
 
363
}
 
364
 
341
365
core::Property<core::ubuntu::media::Player::AudioStreamRole>& gstreamer::Engine::audio_stream_role()
342
366
{
343
367
    return d->audio_role;
348
372
    return d->orientation;
349
373
}
350
374
 
 
375
core::Property<core::ubuntu::media::Player::Lifetime>& gstreamer::Engine::lifetime()
 
376
{
 
377
    return d->lifetime;
 
378
}
 
379
 
351
380
const core::Property<std::tuple<media::Track::UriType, media::Track::MetaData>>&
352
381
gstreamer::Engine::track_meta_data() const
353
382
{