Music Hub  ..
A session-wide music playback service
gstreamer::Playbin Struct Reference

#include <playbin.h>

+ Collaboration diagram for gstreamer::Playbin:

Public Types

enum  PlayFlags {
  GST_PLAY_FLAG_VIDEO = (1 << 0),
  GST_PLAY_FLAG_AUDIO = (1 << 1),
  GST_PLAY_FLAG_TEXT = (1 << 2)
}
 
enum  MediaFileType {
  MEDIA_FILE_TYPE_NONE,
  MEDIA_FILE_TYPE_AUDIO,
  MEDIA_FILE_TYPE_VIDEO
}
 

Public Member Functions

 Playbin ()
 
 ~Playbin ()
 
void reset ()
 
void reset_pipeline ()
 
void on_new_message (const Bus::Message &message)
 
void on_new_message_async (const Bus::Message &message)
 
void process_message_element (GstMessage *message)
 
gstreamer::Busmessage_bus ()
 
void setup_pipeline_for_audio_video ()
 
void create_video_sink (uint32_t texture_id)
 
void set_volume (double new_volume)
 
void set_lifetime (core::ubuntu::media::Player::Lifetime)
 
core::ubuntu::media::Player::Orientation orientation_lut (const gchar *orientation)
 
void set_audio_stream_role (core::ubuntu::media::Player::AudioStreamRole new_audio_role)
 
uint64_t position () const
 
uint64_t duration () const
 
void set_uri (const std::string &uri, const core::ubuntu::media::Player::HeadersType &headers, bool do_pipeline_reset=true)
 
std::string uri () const
 
void setup_source (GstElement *source)
 
bool set_state_and_wait (GstState new_state)
 
bool seek (const std::chrono::microseconds &ms)
 
core::ubuntu::media::video::Dimensions get_video_dimensions () const
 
void emit_video_dimensions_changed_if_changed (const core::ubuntu::media::video::Dimensions &new_dimensions)
 
std::string file_info_from_uri (const std::string &uri) const
 
std::string encode_uri (const std::string &uri) const
 
std::string decode_uri (const std::string &uri) const
 
std::string get_file_content_type (const std::string &uri) const
 
bool is_audio_file (const std::string &uri) const
 
bool is_video_file (const std::string &uri) const
 
MediaFileType media_file_type () const
 
bool can_play_streams () const
 

Static Public Member Functions

static std::string get_audio_role_str (core::ubuntu::media::Player::AudioStreamRole audio_role)
 
static const std::string & pipeline_name ()
 
static void about_to_finish (GstElement *, gpointer user_data)
 
static void source_setup (GstElement *, GstElement *source, gpointer user_data)
 

Public Attributes

GstElement * pipeline
 
gstreamer::Bus bus
 
MediaFileType file_type
 
GstElement * video_sink
 
GstElement * audio_sink
 
core::Connection on_new_message_connection_async
 
bool is_seeking
 
uint64_t previous_position
 
core::ubuntu::media::video::Dimensions cached_video_dimensions
 
core::ubuntu::media::Player::HeadersType request_headers
 
core::ubuntu::media::Player::Lifetime player_lifetime
 
gulong about_to_finish_handler_id
 
gulong source_setup_handler_id
 
struct {
   core::Signal< void >   about_to_finish
 
   core::Signal< Bus::Message::Detail::ErrorWarningInfo >   on_error
 
   core::Signal< Bus::Message::Detail::ErrorWarningInfo >   on_warning
 
   core::Signal< Bus::Message::Detail::ErrorWarningInfo >   on_info
 
   core::Signal< Bus::Message::Detail::Tag >   on_tag_available
 
   core::Signal< std::pair< Bus::Message::Detail::StateChanged, std::string > >   on_state_changed
 
   core::Signal< uint64_t >   on_seeked_to
 
   core::Signal< void >   on_end_of_stream
 
   core::Signal< core::ubuntu::media::Player::PlaybackStatus >   on_playback_status_changed
 
   core::Signal< core::ubuntu::media::Player::Orientation >   on_orientation_changed
 
   core::Signal< core::ubuntu::media::video::Dimensions >   on_video_dimensions_changed
 
   core::Signal< void >   client_disconnected
 
signals
 
bool is_missing_audio_codec
 
bool is_missing_video_codec
 
gint audio_stream_id
 
gint video_stream_id
 

Detailed Description

Definition at line 41 of file playbin.h.

Member Enumeration Documentation

Enumerator
MEDIA_FILE_TYPE_NONE 
MEDIA_FILE_TYPE_AUDIO 
MEDIA_FILE_TYPE_VIDEO 

Definition at line 50 of file playbin.h.

Enumerator
GST_PLAY_FLAG_VIDEO 
GST_PLAY_FLAG_AUDIO 
GST_PLAY_FLAG_TEXT 

Definition at line 43 of file playbin.h.

Constructor & Destructor Documentation

gstreamer::Playbin::~Playbin ( )

Definition at line 167 of file playbin.cpp.

References about_to_finish_handler_id, pipeline, and source_setup_handler_id.

Member Function Documentation

static void gstreamer::Playbin::about_to_finish ( GstElement *  ,
gpointer  user_data 
)
static
bool gstreamer::Playbin::can_play_streams ( ) const
void gstreamer::Playbin::create_video_sink ( uint32_t  texture_id)

Definition at line 352 of file playbin.cpp.

References pipeline, and video_sink.

std::string gstreamer::Playbin::decode_uri ( const std::string &  uri) const

Definition at line 721 of file playbin.cpp.

Referenced by set_uri().

uint64_t gstreamer::Playbin::duration ( ) const

Definition at line 447 of file playbin.cpp.

References pipeline.

Referenced by position().

void gstreamer::Playbin::emit_video_dimensions_changed_if_changed ( const core::ubuntu::media::video::Dimensions new_dimensions)

Definition at line 620 of file playbin.cpp.

References cached_video_dimensions, and signals.

Referenced by set_state_and_wait().

std::string gstreamer::Playbin::encode_uri ( const std::string &  uri) const

Definition at line 648 of file playbin.cpp.

References uri().

Referenced by get_file_content_type(), and set_uri().

+ Here is the call graph for this function:

std::string gstreamer::Playbin::file_info_from_uri ( const std::string &  uri) const

Definition at line 628 of file playbin.cpp.

Referenced by get_file_content_type().

std::string gstreamer::Playbin::get_audio_role_str ( core::ubuntu::media::Player::AudioStreamRole  audio_role)
static

Translate the AudioStreamRole enum into a string

Definition at line 368 of file playbin.cpp.

Referenced by set_audio_stream_role().

std::string gstreamer::Playbin::get_file_content_type ( const std::string &  uri) const

Definition at line 735 of file playbin.cpp.

References encode_uri(), and file_info_from_uri().

Referenced by is_audio_file(), and is_video_file().

+ Here is the call graph for this function:

core::ubuntu::media::video::Dimensions gstreamer::Playbin::get_video_dimensions ( ) const

Definition at line 599 of file playbin.cpp.

References video_sink.

Referenced by set_state_and_wait().

bool gstreamer::Playbin::is_audio_file ( const std::string &  uri) const

Definition at line 754 of file playbin.cpp.

References get_file_content_type().

Referenced by set_uri().

+ Here is the call graph for this function:

bool gstreamer::Playbin::is_video_file ( const std::string &  uri) const

Definition at line 768 of file playbin.cpp.

References get_file_content_type().

Referenced by set_uri().

+ Here is the call graph for this function:

gstreamer::Playbin::MediaFileType gstreamer::Playbin::media_file_type ( ) const

Definition at line 782 of file playbin.cpp.

References file_type.

gstreamer::Bus & gstreamer::Playbin::message_bus ( )

Definition at line 307 of file playbin.cpp.

References bus.

void gstreamer::Playbin::on_new_message ( const Bus::Message message)
media::Player::Orientation gstreamer::Playbin::orientation_lut ( const gchar *  orientation)

Definition at line 390 of file playbin.cpp.

Referenced by on_new_message_async().

const std::string & gstreamer::Playbin::pipeline_name ( )
static

Definition at line 80 of file playbin.cpp.

References about_to_finish, and signals.

uint64_t gstreamer::Playbin::position ( ) const

Definition at line 427 of file playbin.cpp.

References duration(), is_seeking, pipeline, and previous_position.

+ Here is the call graph for this function:

void gstreamer::Playbin::process_message_element ( GstMessage *  message)

Definition at line 222 of file playbin.cpp.

References is_missing_audio_codec, and is_missing_video_codec.

Referenced by on_new_message_async().

void gstreamer::Playbin::reset ( )

Definition at line 184 of file playbin.cpp.

References player_lifetime, reset_pipeline(), and signals.

+ Here is the call graph for this function:

void gstreamer::Playbin::reset_pipeline ( )
bool gstreamer::Playbin::seek ( const std::chrono::microseconds &  ms)

Definition at line 589 of file playbin.cpp.

References is_seeking, and pipeline.

void gstreamer::Playbin::set_audio_stream_role ( core::ubuntu::media::Player::AudioStreamRole  new_audio_role)

Sets the new audio stream role on the pulsesink in playbin

Definition at line 405 of file playbin.cpp.

References audio_sink, and get_audio_role_str().

+ Here is the call graph for this function:

void gstreamer::Playbin::set_lifetime ( core::ubuntu::media::Player::Lifetime  )

Definition at line 422 of file playbin.cpp.

References player_lifetime.

bool gstreamer::Playbin::set_state_and_wait ( GstState  new_state)

Definition at line 529 of file playbin.cpp.

References cached_video_dimensions, emit_video_dimensions_changed_if_changed(), get_video_dimensions(), and pipeline.

+ Here is the call graph for this function:

void gstreamer::Playbin::set_uri ( const std::string &  uri,
const core::ubuntu::media::Player::HeadersType headers = core::ubuntu::media::Player::HeadersType(),
bool  do_pipeline_reset = true 
)

Definition at line 456 of file playbin.cpp.

References decode_uri(), encode_uri(), file_type, is_audio_file(), is_video_file(), MEDIA_FILE_TYPE_AUDIO, MEDIA_FILE_TYPE_VIDEO, pipeline, request_headers, reset_pipeline(), and uri().

+ Here is the call graph for this function:

void gstreamer::Playbin::set_volume ( double  new_volume)

Definition at line 362 of file playbin.cpp.

References pipeline.

void gstreamer::Playbin::setup_pipeline_for_audio_video ( )

Definition at line 312 of file playbin.cpp.

References audio_sink, GST_PLAY_FLAG_AUDIO, GST_PLAY_FLAG_TEXT, GST_PLAY_FLAG_VIDEO, pipeline, and video_sink.

Referenced by Playbin().

void gstreamer::Playbin::setup_source ( GstElement *  source)

Definition at line 496 of file playbin.cpp.

References request_headers.

Referenced by source_setup().

void gstreamer::Playbin::source_setup ( GstElement *  ,
GstElement *  source,
gpointer  user_data 
)
static

Definition at line 92 of file playbin.cpp.

References setup_source().

Referenced by Playbin().

+ Here is the call graph for this function:

std::string gstreamer::Playbin::uri ( ) const

Definition at line 518 of file playbin.cpp.

References pipeline.

Referenced by encode_uri(), and set_uri().

Member Data Documentation

void gstreamer::Playbin::about_to_finish

Definition at line 134 of file playbin.h.

Referenced by pipeline_name(), and Playbin().

gulong gstreamer::Playbin::about_to_finish_handler_id

Definition at line 130 of file playbin.h.

Referenced by Playbin(), and ~Playbin().

GstElement* gstreamer::Playbin::audio_sink

Definition at line 123 of file playbin.h.

Referenced by Playbin(), set_audio_stream_role(), and setup_pipeline_for_audio_video().

gint gstreamer::Playbin::audio_stream_id

Definition at line 149 of file playbin.h.

Referenced by can_play_streams(), on_new_message_async(), Playbin(), and reset_pipeline().

gstreamer::Bus gstreamer::Playbin::bus

Definition at line 120 of file playbin.h.

Referenced by message_bus(), and Playbin().

core::ubuntu::media::video::Dimensions gstreamer::Playbin::cached_video_dimensions
core::Signal<void> gstreamer::Playbin::client_disconnected

Definition at line 145 of file playbin.h.

MediaFileType gstreamer::Playbin::file_type

Definition at line 121 of file playbin.h.

Referenced by media_file_type(), Playbin(), reset_pipeline(), and set_uri().

bool gstreamer::Playbin::is_missing_audio_codec

Definition at line 147 of file playbin.h.

Referenced by can_play_streams(), Playbin(), process_message_element(), and reset_pipeline().

bool gstreamer::Playbin::is_missing_video_codec

Definition at line 148 of file playbin.h.

Referenced by can_play_streams(), Playbin(), process_message_element(), and reset_pipeline().

bool gstreamer::Playbin::is_seeking

Definition at line 125 of file playbin.h.

Referenced by on_new_message_async(), Playbin(), position(), and seek().

core::Signal<void> gstreamer::Playbin::on_end_of_stream

Definition at line 141 of file playbin.h.

core::Signal<Bus::Message::Detail::ErrorWarningInfo> gstreamer::Playbin::on_error

Definition at line 135 of file playbin.h.

core::Signal<Bus::Message::Detail::ErrorWarningInfo> gstreamer::Playbin::on_info

Definition at line 137 of file playbin.h.

core::Connection gstreamer::Playbin::on_new_message_connection_async

Definition at line 124 of file playbin.h.

Referenced by Playbin().

core::Signal<core::ubuntu::media::Player::Orientation> gstreamer::Playbin::on_orientation_changed

Definition at line 143 of file playbin.h.

core::Signal<core::ubuntu::media::Player::PlaybackStatus> gstreamer::Playbin::on_playback_status_changed

Definition at line 142 of file playbin.h.

core::Signal<uint64_t> gstreamer::Playbin::on_seeked_to

Definition at line 140 of file playbin.h.

core::Signal<std::pair<Bus::Message::Detail::StateChanged,std::string> > gstreamer::Playbin::on_state_changed

Definition at line 139 of file playbin.h.

core::Signal<Bus::Message::Detail::Tag> gstreamer::Playbin::on_tag_available

Definition at line 138 of file playbin.h.

core::Signal<core::ubuntu::media::video::Dimensions> gstreamer::Playbin::on_video_dimensions_changed

Definition at line 144 of file playbin.h.

core::Signal<Bus::Message::Detail::ErrorWarningInfo> gstreamer::Playbin::on_warning

Definition at line 136 of file playbin.h.

core::ubuntu::media::Player::Lifetime gstreamer::Playbin::player_lifetime

Definition at line 129 of file playbin.h.

Referenced by Playbin(), reset(), and set_lifetime().

uint64_t gstreamer::Playbin::previous_position
mutable

Definition at line 126 of file playbin.h.

Referenced by Playbin(), and position().

core::ubuntu::media::Player::HeadersType gstreamer::Playbin::request_headers

Definition at line 128 of file playbin.h.

Referenced by set_uri(), and setup_source().

struct { ... } gstreamer::Playbin::signals
gulong gstreamer::Playbin::source_setup_handler_id

Definition at line 131 of file playbin.h.

Referenced by Playbin(), and ~Playbin().

GstElement* gstreamer::Playbin::video_sink
gint gstreamer::Playbin::video_stream_id

Definition at line 150 of file playbin.h.

Referenced by can_play_streams(), on_new_message_async(), Playbin(), and reset_pipeline().


The documentation for this struct was generated from the following files: