Class: ScreenRecorder::Options Private
- Inherits:
-
Object
- Object
- ScreenRecorder::Options
- Defined in:
- lib/screen-recorder/options.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Constant Summary collapse
- DEFAULT_LOG_FILE =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
'ffmpeg.log'.freeze
- DEFAULT_FPS =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
15.0
- DEFAULT_MAC_INPUT_PIX_FMT =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
For avfoundation
'uyvy422'.freeze
- DEFAULT_PIX_FMT =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
'yuv420p'.freeze
Instance Attribute Summary collapse
- #all ⇒ Object readonly private
Instance Method Summary collapse
-
#advanced ⇒ Object
private
Returns given values that are optional.
-
#capture_device ⇒ Object
private
Returns capture device in use.
-
#framerate ⇒ Object
private
Returns given framerate.
-
#initialize(options) ⇒ Options
constructor
private
A new instance of Options.
-
#input ⇒ Object
private
Returns given input file or input.
-
#log ⇒ Object
private
Returns given log filename.
-
#output ⇒ Object
private
Returns given output filepath.
-
#parsed ⇒ Object
private
Returns a String with all options parsed and ready for the ffmpeg process to use.
Constructor Details
#initialize(options) ⇒ Options
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Options.
14 15 16 17 18 19 20 |
# File 'lib/screen-recorder/options.rb', line 14 def initialize() # @todo Consider using OpenStruct @all = advanced[:input] = default_advanced_input.merge(advanced_input) advanced[:output] = default_advanced_output.merge(advanced_output) advanced[:log] ||= DEFAULT_LOG_FILE end |
Instance Attribute Details
#all ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
7 8 9 |
# File 'lib/screen-recorder/options.rb', line 7 def all @all end |
Instance Method Details
#advanced ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns given values that are optional
46 47 48 |
# File 'lib/screen-recorder/options.rb', line 46 def advanced @all[:advanced] ||= {} end |
#capture_device ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns capture device in use
32 33 34 |
# File 'lib/screen-recorder/options.rb', line 32 def capture_device determine_capture_device end |
#framerate ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns given framerate
53 54 55 56 |
# File 'lib/screen-recorder/options.rb', line 53 def framerate ScreenRecorder.logger.warn '#framerate will not be available in the next release. Use #advanced instead.' advanced[:output][:framerate] end |
#input ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns given input file or input
25 26 27 |
# File 'lib/screen-recorder/options.rb', line 25 def input @all[:input] end |
#log ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns given log filename
61 62 63 |
# File 'lib/screen-recorder/options.rb', line 61 def log advanced[:log] end |
#output ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns given output filepath
39 40 41 |
# File 'lib/screen-recorder/options.rb', line 39 def output @all[:output] end |
#parsed ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a String with all options parsed and ready for the ffmpeg process to use
69 70 71 72 73 74 75 76 |
# File 'lib/screen-recorder/options.rb', line 69 def parsed vals = "-f #{capture_device} " vals << parse_advanced(advanced_input) vals << "-i #{input} " unless advanced_input[:i] # Input provided by user vals << parse_advanced(advanced) vals << parse_advanced(advanced_output) vals << output end |