@ -26,11 +26,8 @@ func (d Encryption) MarshalJSON() ([]byte, error) {
case EncryptionOptional:
out = "optional"
case EncryptionStrict:
out = "strict"
default:
return nil, fmt.Errorf("invalid encryption: %v", d)
}
return json.Marshal(out)
@ -21,11 +21,8 @@ func (d HLSVariant) MarshalJSON() ([]byte, error) {
case HLSVariant(gohlslib.MuxerVariantFMP4):
out = "fmp4"
case HLSVariant(gohlslib.MuxerVariantLowLatency):
out = "lowLatency"
return nil, fmt.Errorf("invalid HLS variant: %v", d)
@ -26,11 +26,8 @@ func (d LogDestinations) MarshalJSON() ([]byte, error) {
case logger.DestinationFile:
v = "file"
case logger.DestinationSyslog:
v = "syslog"
return nil, fmt.Errorf("invalid log destination: %v", p)
out[i] = v
@ -24,11 +24,8 @@ func (d LogLevel) MarshalJSON() ([]byte, error) {
case LogLevel(logger.Info):
out = "info"
case LogLevel(logger.Debug):
out = "debug"
return nil, fmt.Errorf("invalid log level: %v", d)
@ -30,11 +30,8 @@ func (d Protocols) MarshalJSON() ([]byte, error) {
case Protocol(gortsplib.TransportUDPMulticast):
v = "multicast"
case Protocol(gortsplib.TransportTCP):
v = "tcp"
return nil, fmt.Errorf("invalid protocol: %v", p)
@ -21,11 +21,8 @@ func (d RTSPAuthMethods) MarshalJSON() ([]byte, error) {
case headers.AuthBasic:
out[i] = "basic"
case headers.AuthDigestMD5:
out[i] = "digest"
return nil, fmt.Errorf("invalid authentication method: %v", v)
@ -30,11 +30,8 @@ func (d RTSPRangeType) MarshalJSON() ([]byte, error) {
case RTSPRangeTypeSMPTE:
out = "smpte"
case RTSPRangeTypeUndefined:
out = ""
return nil, fmt.Errorf("invalid rtsp range type: %v", d)
@ -26,11 +26,8 @@ func (d RTSPTransport) MarshalJSON() ([]byte, error) {
case gortsplib.TransportUDPMulticast:
out = "multicast"
case gortsplib.TransportTCP:
out = "tcp"
return nil, fmt.Errorf("invalid protocol: %v", d.Transport)