55#include "util/lock_ops.h"
66#include "util/refcounting.h"
77
8+ #include <gst/video/video-format.h>
9+
810#include "config.h"
911
1012#if !defined(HAVE_EGL_GLES2 )
@@ -65,6 +67,19 @@ struct video_info;
6567struct gstplayer ;
6668struct flutterpi ;
6769
70+ typedef struct _GstStructure GstStructure ;
71+
72+ /// Create a gstreamer video player.
73+ struct gstplayer * gstplayer_new (
74+ struct flutterpi * flutterpi ,
75+ const char * uri ,
76+ void * userdata ,
77+ bool play_video ,
78+ bool play_audio ,
79+ bool subtitles ,
80+ GstStructure * headers
81+ );
82+
6883/// Create a gstreamer video player that loads the video from a flutter asset.
6984/// @arg asset_path The path of the asset inside the asset bundle.
7085/// @arg package_name The name of the package containing the asset
@@ -131,6 +146,11 @@ int gstplayer_pause(struct gstplayer *player);
131146/// @returns Current playback position, in milliseconds from the beginning of the video.
132147int64_t gstplayer_get_position (struct gstplayer * player );
133148
149+ /// Get the duration of the currently playing medium.
150+ /// @returns Duration of the current medium in milliseconds, -1 if the duration
151+ /// is not yet known, or INT64_MAX for live sources.
152+ int64_t gstplayer_get_duration (struct gstplayer * player );
153+
134154/// Set whether the video should loop.
135155/// @arg looping Whether the video should start playing from the beginning when the
136156/// end is reached.
@@ -155,6 +175,14 @@ int gstplayer_step_forward(struct gstplayer *player);
155175
156176int gstplayer_step_backward (struct gstplayer * player );
157177
178+ void gstplayer_set_audio_balance (struct gstplayer * player , float balance );
179+
180+ float gstplayer_get_audio_balance (struct gstplayer * player );
181+
182+ bool gstplayer_release (struct gstplayer * p );
183+
184+ bool gstplayer_preroll (struct gstplayer * p , const char * uri );
185+
158186struct video_info {
159187 int width , height ;
160188
@@ -173,6 +201,17 @@ struct video_info {
173201/// So you need to make sure you do the proper rethreading in the listener callback.
174202struct notifier * gstplayer_get_video_info_notifier (struct gstplayer * player );
175203
204+ struct seeking_info {
205+ bool can_seek ;
206+ int64_t seek_begin_ms , seek_end_ms ;
207+ };
208+
209+ struct notifier * gstplayer_get_seeking_info_notifier (struct gstplayer * player );
210+
211+ struct notifier * gstplayer_get_duration_notifier (struct gstplayer * player );
212+
213+ struct notifier * gstplayer_get_eos_notifier (struct gstplayer * player );
214+
176215/// @brief Get the value notifier for the buffering state.
177216///
178217/// Gets notified with a value of type `struct buffering_state*` when the buffering state changes.
0 commit comments