[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
* First release.
@@ -189,8 +189,7 @@ bool GstVideoPlayer::CreatePipeline() {
std::cerr << "Failed to create a bus" << std::endl;
return false;
}
gst_bus_set_sync_handler(gst_.bus, (GstBusSyncHandler)HandleGstMessage, this,
NULL);
gst_bus_set_sync_handler(gst_.bus, HandleGstMessage, this, NULL);
// 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);
@@ -355,15 +354,21 @@ void GstVideoPlayer::HandoffHandler(GstElement* fakesink, GstBuffer* buf,
}
// static
gboolean GstVideoPlayer::HandleGstMessage(GstBus* bus, GstMessage* message,
gpointer user_data) {
GstBusSyncReply GstVideoPlayer::HandleGstMessage(GstBus* bus,
GstMessage* message,
gpointer user_data) {
switch (GST_MESSAGE_TYPE(message)) {
case GST_MESSAGE_EOS: {
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_) {
self->SetSeek(0);
}
#endif
self->stream_handler_->OnNotifyCompleted();
break;
}
case GST_MESSAGE_WARNING: {
@@ -391,5 +396,5 @@ gboolean GstVideoPlayer::HandleGstMessage(GstBus* bus, GstMessage* message,
default:
break;
}
return TRUE;
return GST_BUS_PASS;
}
@@ -48,8 +48,8 @@ class GstVideoPlayer {
static void HandoffHandler(GstElement* fakesink, GstBuffer* buf,
GstPad* new_pad, gpointer user_data);
static gboolean HandleGstMessage(GstBus* bus, GstMessage* message,
gpointer user_data);
static GstBusSyncReply HandleGstMessage(GstBus* bus, GstMessage* message,
gpointer user_data);
std::string ParseUri(const std::string& uri);
bool CreatePipeline();
void DestroyPipeline();
@@ -14,8 +14,8 @@
class FlutterEmbedderOptions {
public:
FlutterEmbedderOptions() {
options_.AddString("bundle", "b", "Path to Flutter app bundle", "./bundle",
true);
options_.AddString("bundle", "b", "Path to Flutter app bundle", "./",
false);
options_.AddWithoutValue("no-cursor", "n", "No mouse cursor/pointer",
false);
#if defined(FLUTTER_TARGET_BACKEND_GBM) || \
+1 -1
View File
@@ -1,6 +1,6 @@
name: video_player_elinux
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
repository: https://github.com/sony/flutter-elinux-plugins/tree/main/packages/video_player/video_player