gssrc: use default blocksize

The blocksize is set to 3 * 1024 * 1024 / 2, which is the default download_size of Google-Cloud-CPP.

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/846

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1246>
This commit is contained in:
Floris 2021-10-25 18:47:46 +02:00 committed by GStreamer Marge Bot
parent 74c75b1e8b
commit 14368c6457

View file

@ -61,7 +61,8 @@ GST_DEBUG_CATEGORY_STATIC(gst_gs_src_debug);
enum { LAST_SIGNAL };
#define DEFAULT_BLOCKSIZE 4 * 1024
// https://github.com/googleapis/google-cloud-cpp/issues/2657
#define DEFAULT_BLOCKSIZE 3 * 1024 * 1024 / 2
enum {
PROP_0,
@ -515,7 +516,6 @@ static gboolean gst_gs_src_get_size(GstBaseSrc* basesrc, guint64* size) {
static gboolean gst_gs_src_start(GstBaseSrc* basesrc) {
GstGsSrc* src = GST_GS_SRC(basesrc);
GError* err = NULL;
guint blocksize = 0;
src->read_position = 0;
src->object_size = 0;
@ -557,12 +557,6 @@ static gboolean gst_gs_src_start(GstBaseSrc* basesrc) {
src->gcs_stream = std::make_unique<GSReadStream>(src);
blocksize = gcs::ClientOptions(nullptr).download_buffer_size();
GST_INFO_OBJECT(src, "Set blocksize to %" G_GUINT32_FORMAT, blocksize);
gst_base_src_set_blocksize(GST_BASE_SRC(src), blocksize);
return TRUE;
}