set playbin download flag

This commit is contained in:
F. Duncanh
2025-04-26 11:34:28 -04:00
parent 2dfb156c63
commit 3a488897b4

View File

@@ -53,6 +53,23 @@ static gint64 hls_duration;
static gboolean hls_seek_enabled;
static gboolean hls_playing;
typedef enum {
//GST_PLAY_FLAG_VIDEO = (1 << 0),
//GST_PLAY_FLAG_AUDIO = (1 << 1),
//GST_PLAY_FLAG_TEXT = (1 << 2),
//GST_PLAY_FLAG_VIS = (1 << 3),
//GST_PLAY_FLAG_SOFT_VOLUME = (1 << 4),
//GST_PLAY_FLAG_NATIVE_AUDIO = (1 << 5),
//GST_PLAY_FLAG_NATIVE_VIDEO = (1 << 6),
GST_PLAY_FLAG_DOWNLOAD = (1 << 7),
GST_PLAY_FLAG_BUFFERING = (1 << 8),
//GST_PLAY_FLAG_DEINTERLACE = (1 << 9),
//GST_PLAY_FLAG_SOFT_COLORBALANCE = (1 << 10),
//GST_PLAY_FLAG_FORCE_FILTERS = (1 << 11),
//GST_PLAY_FLAG_FORCE_SW_DECODERS = (1 << 12),
} GstPlayFlags;
#define NCODECS 2 /* renderers for h264 and h265 */
struct video_renderer_s {
@@ -268,8 +285,12 @@ void video_renderer_init(logger_t *render_logger, const char *server_name, vide
g_object_set(G_OBJECT (renderer_type[i]->pipeline), "video-sink", playbin_videosink, NULL);
}
}
g_object_set (G_OBJECT (renderer_type[i]->pipeline), "uri", uri, NULL);
gint flags;
g_object_get(renderer_type[i]->pipeline, "flags", &flags, NULL);
flags |= GST_PLAY_FLAG_DOWNLOAD;
flags |= GST_PLAY_FLAG_BUFFERING; // set by default in playbin3, but not in playbin2; is it needed?
g_object_set(renderer_type[i]->pipeline, "flags", flags, NULL);
g_object_set (G_OBJECT (renderer_type[i]->pipeline), "uri", uri, NULL);
} else {
switch (i) {
case 0: