Changeset 6682
- Timestamp:
- 06/21/09 14:14:14 (15 months ago)
- Location:
- trunk/liquidsoap/src/outputs
- Files:
-
- 4 modified
-
external_encoded_shout.ml (modified) (5 diffs)
-
icecast2.ml (modified) (4 diffs)
-
lame_encoded_shout.ml (modified) (3 diffs)
-
ogg_output_shout.ml (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/liquidsoap/src/outputs/external_encoded_shout.ml
r6613 r6682 27 27 28 28 let proto = 29 (Icecast2.proto ~no_mount ~no_name ) @ External_encoded.proto @29 (Icecast2.proto ~no_mount ~no_name ~format:"mp3") @ External_encoded.proto @ 30 30 [ "start", Lang.bool_t, Some (Lang.bool true), 31 31 Some "Start output threads on operator initialization." ; … … 38 38 "icy_metadata", Lang.bool_t, Some (Lang.bool true), 39 39 Some "Send new metadata using the ICY protocol."; 40 "format", Lang.string_t, Some (Lang.string "mp3"),41 Some "Content-type (mime) for the format. \42 \"mp3\" is a short-hand for mpeg audio, \"ogg\" for ogg data.";43 40 "", Lang.source_t, None, None ] 44 41 … … 73 70 let mount = s "mount" in 74 71 let name = s "name" in 75 let format =76 match s "format" with77 | "mp3" -> Cry.mpeg78 | "ogg" -> Cry.ogg_application79 | s -> Cry.content_type_of_string s80 in81 72 let name = 82 73 if name = no_name then … … 93 84 if mount = no_mount then name else mount 94 85 in 95 let protocol =96 let v = List.assoc "protocol" p in97 match Lang.to_string v with98 | "http" -> Cry.Http99 | "icy" -> Cry.Icy100 | _ ->101 raise (Lang.Invalid_value102 (v, "valid values are 'http' (icecast) "^103 "and 'icy' (shoutcast)"))104 in105 86 let icecast_info = 106 87 { … … 115 96 inherit Output.encoded ~autostart ~name:mount ~kind:"output.icecast" source 116 97 inherit 117 Icecast2.output ~format ~protocol 118 ~icecast_info ~mount ~name ~source p as icecast 98 Icecast2.output ~icecast_info ~mount ~name ~source p as icecast 119 99 inherit 120 100 External_encoded.base ~restart_on_new_track ~restart_on_crash -
trunk/liquidsoap/src/outputs/icecast2.ml
r6560 r6682 35 35 let no_multicast = "no_multicast" 36 36 37 let proto ~no_mount ~no_name =37 let proto ~no_mount ~no_name ~format = 38 38 [ "restart", Lang.bool_t, Some (Lang.bool false), 39 39 Some "Restart output after a failure. By default, liquidsoap will stop \ … … 60 60 "headers", Lang.list_t (Lang.product_t Lang.string_t Lang.string_t), 61 61 Some (Lang.list []), Some "Additional headers." ; 62 "format", Lang.string_t, Some (Lang.string format), 63 Some "Content-type (mime) for the format. \ 64 \"mp3\" is a short-hand for mpeg audio, \"ogg\" for ogg data."; 62 65 "dumpfile", Lang.string_t, Some (Lang.string ""), 63 66 Some "Dump stream to file, for debugging purpose. Disabled if empty." … … 70 73 * value for these depends on the format of the stream (ogg/mp3). *) 71 74 class virtual output 72 ?(format=Cry.ogg_audio) ?(protocol=Cry.Http)73 75 ~name ~mount ~source ~icecast_info p = 74 76 … … 76 78 let s v = e Lang.to_string v in 77 79 80 let format = 81 match s "format" with 82 | "mp3" -> Cry.mpeg 83 | "ogg" -> Cry.ogg_application 84 | s -> Cry.content_type_of_string s 85 in 86 let protocol = 87 let v = List.assoc "protocol" p in 88 match Lang.to_string v with 89 | "http" -> Cry.Http 90 | "icy" -> Cry.Icy 91 | _ -> 92 raise (Lang.Invalid_value 93 (v, "valid values are 'http' (icecast) "^ 94 "and 'icy' (shoutcast)")) 95 in 78 96 let restart = e Lang.to_bool "restart" in 79 97 let restart_delay = float_of_int (e Lang.to_int "restart_delay") in -
trunk/liquidsoap/src/outputs/lame_encoded_shout.ml
r6560 r6682 29 29 30 30 let proto = 31 (Icecast2.proto ~no_mount ~no_name ) @31 (Icecast2.proto ~no_mount ~no_name ~format:"mp3") @ 32 32 [ "samplerate", Lang.int_t, Some (Lang.int 44100), None; 33 33 "bitrate", Lang.int_t, Some (Lang.int 128), None; … … 67 67 if mount = no_mount then name else mount 68 68 in 69 let protocol =70 let v = List.assoc "protocol" p in71 match Lang.to_string v with72 | "http" -> Cry.Http73 | "icy" -> Cry.Icy74 | _ ->75 raise (Lang.Invalid_value76 (v, "valid values are 'http' (icecast) \77 and 'icy' (shoutcast)"))78 in79 69 let channels = 80 70 if not stereo then 1 else Fmt.channels () … … 91 81 object (self) 92 82 inherit Output.encoded ~autostart ~name:mount ~kind:"output.icecast" source 93 inherit 94 Icecast2.output ~format:Cry.mpeg ~protocol 95 ~icecast_info ~mount ~name ~source p as icecast 83 inherit Icecast2.output ~icecast_info ~mount ~name ~source p as icecast 96 84 inherit base ~quality ~bitrate ~stereo ~samplerate as base 97 85 -
trunk/liquidsoap/src/outputs/ogg_output_shout.ml
r6560 r6682 27 27 28 28 let proto = 29 (Icecast2.proto ~no_mount ~no_name ) @29 (Icecast2.proto ~no_mount ~no_name ~format:"ogg") @ 30 30 [ "start", Lang.bool_t, Some (Lang.bool true), 31 31 Some "Start output threads on operator initialization." ; … … 58 58 59 59 object (self) 60 inherit 61 Output.encoded ~autostart ~name:mount ~kind:"output.icecast" source 62 inherit Icecast2.output 60 inherit Output.encoded ~autostart ~name:mount ~kind:"output.icecast" source 61 inherit Icecast2.output 63 62 ~mount ~name ~icecast_info 64 63 ~source p as icecast
