[Video player] Temporarily disable auto-repeat (#20)

* Disable auto-repat when stream is completed

* Update template

* version 0.9.1
This commit is contained in:
Hidenori Matsubayashi
2021-08-04 14:02:58 +09:00
committed by GitHub
parent 39843c2a0a
commit ccdb4d9d20
5 changed files with 20 additions and 11 deletions
+4
View File
@@ -1,2 +1,6 @@
## 0.9.1
* Temporarily disable auto-repeat.
* Update the elinux template of the example app.
## 0.9.0 ## 0.9.0
* First release. * First release.
@@ -189,8 +189,7 @@ bool GstVideoPlayer::CreatePipeline() {
std::cerr << "Failed to create a bus" << std::endl; std::cerr << "Failed to create a bus" << std::endl;
return false; return false;
} }
gst_bus_set_sync_handler(gst_.bus, (GstBusSyncHandler)HandleGstMessage, this, gst_bus_set_sync_handler(gst_.bus, HandleGstMessage, this, NULL);
NULL);
// Sets properties to fakesink to get the callback of a decoded frame. // Sets properties to fakesink to get the callback of a decoded frame.
g_object_set(G_OBJECT(gst_.video_sink), "sync", TRUE, "qos", FALSE, NULL); g_object_set(G_OBJECT(gst_.video_sink), "sync", TRUE, "qos", FALSE, NULL);
@@ -355,15 +354,21 @@ void GstVideoPlayer::HandoffHandler(GstElement* fakesink, GstBuffer* buf,
} }
// static // static
gboolean GstVideoPlayer::HandleGstMessage(GstBus* bus, GstMessage* message, GstBusSyncReply GstVideoPlayer::HandleGstMessage(GstBus* bus,
gpointer user_data) { GstMessage* message,
gpointer user_data) {
switch (GST_MESSAGE_TYPE(message)) { switch (GST_MESSAGE_TYPE(message)) {
case GST_MESSAGE_EOS: { case GST_MESSAGE_EOS: {
auto* self = reinterpret_cast<GstVideoPlayer*>(user_data); auto* self = reinterpret_cast<GstVideoPlayer*>(user_data);
self->stream_handler_->OnNotifyCompleted(); // TODO: Support auto repeat. If the following is enabled,
// the app will freeze when playback is completed. We need to investigate
// the correct auto-repeat method.
#if 0
if (self->auto_repeat_) { if (self->auto_repeat_) {
self->SetSeek(0); self->SetSeek(0);
} }
#endif
self->stream_handler_->OnNotifyCompleted();
break; break;
} }
case GST_MESSAGE_WARNING: { case GST_MESSAGE_WARNING: {
@@ -391,5 +396,5 @@ gboolean GstVideoPlayer::HandleGstMessage(GstBus* bus, GstMessage* message,
default: default:
break; break;
} }
return TRUE; return GST_BUS_PASS;
} }
@@ -48,8 +48,8 @@ class GstVideoPlayer {
static void HandoffHandler(GstElement* fakesink, GstBuffer* buf, static void HandoffHandler(GstElement* fakesink, GstBuffer* buf,
GstPad* new_pad, gpointer user_data); GstPad* new_pad, gpointer user_data);
static gboolean HandleGstMessage(GstBus* bus, GstMessage* message, static GstBusSyncReply HandleGstMessage(GstBus* bus, GstMessage* message,
gpointer user_data); gpointer user_data);
std::string ParseUri(const std::string& uri); std::string ParseUri(const std::string& uri);
bool CreatePipeline(); bool CreatePipeline();
void DestroyPipeline(); void DestroyPipeline();
@@ -14,8 +14,8 @@
class FlutterEmbedderOptions { class FlutterEmbedderOptions {
public: public:
FlutterEmbedderOptions() { FlutterEmbedderOptions() {
options_.AddString("bundle", "b", "Path to Flutter app bundle", "./bundle", options_.AddString("bundle", "b", "Path to Flutter app bundle", "./",
true); false);
options_.AddWithoutValue("no-cursor", "n", "No mouse cursor/pointer", options_.AddWithoutValue("no-cursor", "n", "No mouse cursor/pointer",
false); false);
#if defined(FLUTTER_TARGET_BACKEND_GBM) || \ #if defined(FLUTTER_TARGET_BACKEND_GBM) || \
+1 -1
View File
@@ -1,6 +1,6 @@
name: video_player_elinux name: video_player_elinux
description: Flutter plugin for displaying inline video with other Flutter widgets on Embedded Linux. description: Flutter plugin for displaying inline video with other Flutter widgets on Embedded Linux.
version: 0.9.0 version: 0.9.1
homepage: https://github.com/sony/flutter-elinux-plugins homepage: https://github.com/sony/flutter-elinux-plugins
repository: https://github.com/sony/flutter-elinux-plugins/tree/main/packages/video_player/video_player repository: https://github.com/sony/flutter-elinux-plugins/tree/main/packages/video_player/video_player