#include <playbin.h>
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::Bus & | message_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) |
gstreamer::Playbin::Playbin | ( | ) |
Definition at line 102 of file playbin.cpp.
References about_to_finish, about_to_finish_handler_id, audio_sink, audio_stream_id, bus, cached_video_dimensions, file_type, is_missing_audio_codec, is_missing_video_codec, is_seeking, MEDIA_FILE_TYPE_NONE, on_new_message_async(), gstreamer::Bus::on_new_message_async, on_new_message_connection_async, pipeline, player_lifetime, previous_position, setup_pipeline_for_audio_video(), source_setup(), source_setup_handler_id, video_sink, and video_stream_id.
gstreamer::Playbin::~Playbin | ( | ) |
Definition at line 167 of file playbin.cpp.
References about_to_finish_handler_id, pipeline, and source_setup_handler_id.
|
static |
bool gstreamer::Playbin::can_play_streams | ( | ) | const |
Definition at line 787 of file playbin.cpp.
References audio_stream_id, is_missing_audio_codec, is_missing_video_codec, and video_stream_id.
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 |
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().
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().
|
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().
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().
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().
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 | ) |
void gstreamer::Playbin::on_new_message_async | ( | const Bus::Message & | message | ) |
Definition at line 256 of file playbin.cpp.
References audio_stream_id, gstreamer::Bus::Message::detail, gstreamer::Bus::Message::Detail::error_warning_info, is_seeking, gstreamer::Bus::Message::message, orientation_lut(), pipeline, process_message_element(), signals, gstreamer::Bus::Message::source, gstreamer::Bus::Message::Detail::state_changed, gstreamer::Bus::Message::Detail::tag, gstreamer::Bus::Message::Detail::Tag::tag_list, gstreamer::Bus::Message::type, and video_stream_id.
Referenced by Playbin().
media::Player::Orientation gstreamer::Playbin::orientation_lut | ( | const gchar * | orientation | ) |
Definition at line 390 of file playbin.cpp.
Referenced by on_new_message_async().
|
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.
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.
void gstreamer::Playbin::reset_pipeline | ( | ) |
Definition at line 199 of file playbin.cpp.
References audio_stream_id, file_type, is_missing_audio_codec, is_missing_video_codec, MEDIA_FILE_TYPE_NONE, pipeline, and video_stream_id.
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().
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.
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().
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().
|
static |
Definition at line 92 of file playbin.cpp.
References setup_source().
Referenced by Playbin().
std::string gstreamer::Playbin::uri | ( | ) | const |
Definition at line 518 of file playbin.cpp.
References pipeline.
Referenced by encode_uri(), and set_uri().
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 |
Definition at line 127 of file playbin.h.
Referenced by emit_video_dimensions_changed_if_changed(), Playbin(), and set_state_and_wait().
core::Signal<void> gstreamer::Playbin::client_disconnected |
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<Bus::Message::Detail::ErrorWarningInfo> gstreamer::Playbin::on_error |
core::Signal<Bus::Message::Detail::ErrorWarningInfo> gstreamer::Playbin::on_info |
core::Connection gstreamer::Playbin::on_new_message_connection_async |
core::Signal<core::ubuntu::media::Player::Orientation> gstreamer::Playbin::on_orientation_changed |
core::Signal<core::ubuntu::media::Player::PlaybackStatus> gstreamer::Playbin::on_playback_status_changed |
core::Signal<std::pair<Bus::Message::Detail::StateChanged,std::string> > gstreamer::Playbin::on_state_changed |
core::Signal<Bus::Message::Detail::Tag> gstreamer::Playbin::on_tag_available |
core::Signal<core::ubuntu::media::video::Dimensions> gstreamer::Playbin::on_video_dimensions_changed |
core::Signal<Bus::Message::Detail::ErrorWarningInfo> gstreamer::Playbin::on_warning |
GstElement* gstreamer::Playbin::pipeline |
Definition at line 119 of file playbin.h.
Referenced by create_video_sink(), duration(), on_new_message_async(), Playbin(), position(), reset_pipeline(), seek(), set_state_and_wait(), set_uri(), set_volume(), setup_pipeline_for_audio_video(), uri(), and ~Playbin().
core::ubuntu::media::Player::Lifetime gstreamer::Playbin::player_lifetime |
Definition at line 129 of file playbin.h.
Referenced by Playbin(), reset(), and set_lifetime().
|
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 |
Referenced by emit_video_dimensions_changed_if_changed(), on_new_message_async(), pipeline_name(), and reset().
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 |
Definition at line 122 of file playbin.h.
Referenced by create_video_sink(), get_video_dimensions(), Playbin(), and setup_pipeline_for_audio_video().
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().