Skip to content

Commit 4f56328

Browse files
committed
Specify resolution and framerate if using test source
1 parent 881ab3a commit 4f56328

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

samples/kvs_gstreamer_buffer_sample.cpp

+10
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,16 @@ int gstreamer_live_source_init(int argc, char* argv[], CustomData *data, GstElem
512512
/* source filter */
513513
source_filter = gst_element_factory_make("capsfilter", "source-filter");
514514
source_caps = gst_caps_new_simple("video/x-raw", "format", G_TYPE_STRING, "I420", NULL);
515+
516+
// Specify resolution and framerate if using test source.
517+
if (source_type == TEST_SOURCE) {
518+
gst_caps_set_simple(source_caps,
519+
"width", G_TYPE_INT, 1280,
520+
"height", G_TYPE_INT, 720,
521+
"framerate", GST_TYPE_FRACTION, 30, 1,
522+
NULL);
523+
}
524+
515525
g_object_set(G_OBJECT(source_filter), "caps", source_caps, NULL);
516526
gst_caps_unref(source_caps);
517527

0 commit comments

Comments
 (0)