Permalink
Browse files

Better log/debug semantics.

  • Loading branch information...
1 parent 9b89ee2 commit f145e00be0322e447e8b6ee92cfe1e43beaa6b57 @toots toots committed Nov 30, 2012
Showing with 7 additions and 8 deletions.
  1. +3 −3 src/encoder/encoder.ml
  2. +1 −2 src/encoder/gstreamer_encoder.ml
  3. +3 −3 src/lang/lang_encoders.ml
View
6 src/encoder/encoder.ml
@@ -432,7 +432,7 @@ struct
muxer : string option;
metadata : string;
pipeline : string option;
- debug : bool
+ log : int
}
let audio_channels m =
@@ -454,7 +454,7 @@ struct
(fun value -> (Printf.sprintf "%s=%S" name value)::l)
value)
in
- Printf.sprintf "%%gstreamer(%s,metadata=%S,has_video=%b,%sdebug=%b)"
+ Printf.sprintf "%%gstreamer(%s,metadata=%S,has_video=%b,%slog=%d)"
(String.concat ","
(pipeline
(pipeline
@@ -465,7 +465,7 @@ struct
m.metadata
m.has_video
(Utils.some_or "" (Utils.maybe (Printf.sprintf "pipeline=%S,") m.pipeline))
- m.debug
+ m.log
end
module Theora =
View
3 src/encoder/gstreamer_encoder.ml
@@ -92,8 +92,7 @@ let encoder id ext =
(Utils.some_or "" video_pipeline)
muxer_pipeline
in
- if ext.debug then
- log#f 3 "Gstreamer encoder pipeline: %s" pipeline;
+ log#f ext.log "Gstreamer encoder pipeline: %s" pipeline;
let bin = Gstreamer.Pipeline.parse_launch pipeline in
let audio_src =
try
View
6 src/lang/lang_encoders.ml
@@ -805,7 +805,7 @@ let mk_gstreamer params =
video = Some "x264enc";
muxer = Some "mpegtsmux";
metadata = "metadata";
- debug = false;
+ log = 5;
pipeline = None
}
in
@@ -829,8 +829,8 @@ let mk_gstreamer params =
{ f with Encoder.GStreamer.muxer = perhaps s }
| ("metadata",{ term = String s }) ->
{ f with Encoder.GStreamer.metadata = s }
- | ("debug",{ term = Bool b }) ->
- { f with Encoder.GStreamer.debug = b }
+ | ("log",{ term = Int i }) ->
+ { f with Encoder.GStreamer.log = i }
| ("pipeline",{ term = String s }) ->
{ f with Encoder.GStreamer.pipeline = perhaps s }
| (_,t) -> raise (generic_error t))

0 comments on commit f145e00

Please sign in to comment.