return "%llu:%.2llu:%.2llu".printf (hours, minutes, seconds);
}
+ public static Element? create_source_for_uri (string uri) {
+ dynamic Element src = Element.make_from_uri (URIType.SRC, uri, null);
+ if (src != null) {
+ if (src.get_class ().find_property ("blocksize") != null) {
+ // The default is usually 4KiB which is not really big enough
+ // for most cases so we set this to 65KiB.
+ src.blocksize = (long) 65536;
+ }
+
+ if (src.get_class ().find_property ("tcp-timeout") != null) {
+ // For rtspsrc since some RTSP sources takes a while to start
+ // transmitting
+ src.tcp_timeout = (int64) 60000000;
+ }
+ }
+
+ return src;
+ }
+
public static dynamic Element? get_rtp_depayloader (Caps caps) {
if (!need_rtp_depayloader (caps)) {
return null;
dynamic Element src = null;
if (this.uris.size != 0) {
- src = Element.make_from_uri (URIType.SRC, this.uris.get (0), null);
- }
-
- if (src != null) {
- if (src.get_class ().find_property ("blocksize") != null) {
- // The default is usually 4KiB which is not really big enough
- // for most cases so we set this to 65KiB.
- src.blocksize = (long) 65536;
- }
-
- if (src.get_class ().find_property ("tcp-timeout") != null) {
- // For rtspsrc since some RTSP sources takes a while to start
- // transmitting
- src.tcp_timeout = (int64) 60000000;
- }
+ src = GstUtils.create_source_for_uri (this.uris.get (0));
}
return src;