5
5
#include "util/lock_ops.h"
6
6
#include "util/refcounting.h"
7
7
8
+ #include <gst/video/video-format.h>
9
+
8
10
#include "config.h"
9
11
10
12
#if !defined(HAVE_EGL_GLES2 )
@@ -65,6 +67,19 @@ struct video_info;
65
67
struct gstplayer ;
66
68
struct flutterpi ;
67
69
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
+
68
83
/// Create a gstreamer video player that loads the video from a flutter asset.
69
84
/// @arg asset_path The path of the asset inside the asset bundle.
70
85
/// @arg package_name The name of the package containing the asset
@@ -131,6 +146,11 @@ int gstplayer_pause(struct gstplayer *player);
131
146
/// @returns Current playback position, in milliseconds from the beginning of the video.
132
147
int64_t gstplayer_get_position (struct gstplayer * player );
133
148
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
+
134
154
/// Set whether the video should loop.
135
155
/// @arg looping Whether the video should start playing from the beginning when the
136
156
/// end is reached.
@@ -155,6 +175,14 @@ int gstplayer_step_forward(struct gstplayer *player);
155
175
156
176
int gstplayer_step_backward (struct gstplayer * player );
157
177
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
+
158
186
struct video_info {
159
187
int width , height ;
160
188
@@ -173,6 +201,17 @@ struct video_info {
173
201
/// So you need to make sure you do the proper rethreading in the listener callback.
174
202
struct notifier * gstplayer_get_video_info_notifier (struct gstplayer * player );
175
203
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
+
176
215
/// @brief Get the value notifier for the buffering state.
177
216
///
178
217
/// Gets notified with a value of type `struct buffering_state*` when the buffering state changes.
0 commit comments