Class: Bitmovin::Encoding::Encodings::Stream
- Defined in:
- lib/bitmovin/encoding/encodings/stream.rb
Instance Attribute Summary collapse
-
#conditions ⇒ Object
Returns the value of attribute conditions.
-
#create_quality_meta_data ⇒ Object
Returns the value of attribute create_quality_meta_data.
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#description ⇒ Object
Returns the value of attribute description.
-
#encoding_id ⇒ Object
Returns the value of attribute encoding_id.
-
#id ⇒ Object
Returns the value of attribute id.
-
#mode ⇒ Object
Returns the value of attribute mode.
-
#modified_at ⇒ Object
Returns the value of attribute modified_at.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
- #build_input_stream(opts = {}) ⇒ Object
- #build_output(opts = {}) ⇒ Object
- #codec_configuration ⇒ Object
- #codec_configuration=(configuration) ⇒ Object
- #errors ⇒ Object
-
#initialize(encoding_id, hash = {}) ⇒ Stream
constructor
A new instance of Stream.
- #input_analysis ⇒ Object
- #input_details ⇒ Object
- #input_streams ⇒ Object
- #invalid? ⇒ Boolean
- #outputs ⇒ Object
- #save! ⇒ Object
- #valid? ⇒ Boolean
Methods inherited from Resource
#delete!, find, init, #init_instance, #inspect, list, #persisted?
Methods included from Helpers
#camelize_hash, #hash_to_struct, result, #result, #underscore_hash
Constructor Details
#initialize(encoding_id, hash = {}) ⇒ Stream
Returns a new instance of Stream.
8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/bitmovin/encoding/encodings/stream.rb', line 8 def initialize(encoding_id, hash = {}) set_defaults hsh = ActiveSupport::HashWithIndifferentAccess.new(underscore_hash(hash)) @encoding_id = encoding_id init_instance(File.join("/v1/encoding/encodings/", encoding_id, "streams")) super(hash) @outputs = (hsh[:outputs] || []).map { |output| Bitmovin::Encoding::StreamOutput.new(output) } @input_streams = (hsh[:input_streams] || []).map { |input| StreamInput.new(@encoding_id, @id, input) } @errors = [] @conditions = nil @mode = "STANDARD" end |
Instance Attribute Details
#conditions ⇒ Object
Returns the value of attribute conditions.
5 6 7 |
# File 'lib/bitmovin/encoding/encodings/stream.rb', line 5 def conditions @conditions end |
#create_quality_meta_data ⇒ Object
Returns the value of attribute create_quality_meta_data.
22 23 24 |
# File 'lib/bitmovin/encoding/encodings/stream.rb', line 22 def @create_quality_meta_data end |
#created_at ⇒ Object
Returns the value of attribute created_at.
22 23 24 |
# File 'lib/bitmovin/encoding/encodings/stream.rb', line 22 def created_at @created_at end |
#description ⇒ Object
Returns the value of attribute description.
22 23 24 |
# File 'lib/bitmovin/encoding/encodings/stream.rb', line 22 def description @description end |
#encoding_id ⇒ Object
Returns the value of attribute encoding_id.
3 4 5 |
# File 'lib/bitmovin/encoding/encodings/stream.rb', line 3 def encoding_id @encoding_id end |
#id ⇒ Object
Returns the value of attribute id.
4 5 6 |
# File 'lib/bitmovin/encoding/encodings/stream.rb', line 4 def id @id end |
#mode ⇒ Object
Returns the value of attribute mode.
6 7 8 |
# File 'lib/bitmovin/encoding/encodings/stream.rb', line 6 def mode @mode end |
#modified_at ⇒ Object
Returns the value of attribute modified_at.
22 23 24 |
# File 'lib/bitmovin/encoding/encodings/stream.rb', line 22 def modified_at @modified_at end |
#name ⇒ Object
Returns the value of attribute name.
22 23 24 |
# File 'lib/bitmovin/encoding/encodings/stream.rb', line 22 def name @name end |
Instance Method Details
#build_input_stream(opts = {}) ⇒ Object
28 29 30 31 32 |
# File 'lib/bitmovin/encoding/encodings/stream.rb', line 28 def build_input_stream(opts = {}) input = StreamInput.new(@encoding_id, @id, opts) @input_streams << input input end |
#build_output(opts = {}) ⇒ Object
38 39 40 41 42 |
# File 'lib/bitmovin/encoding/encodings/stream.rb', line 38 def build_output(opts = {}) output = Bitmovin::Encoding::StreamOutput.new(opts) @outputs << output output end |
#codec_configuration ⇒ Object
51 52 53 |
# File 'lib/bitmovin/encoding/encodings/stream.rb', line 51 def codec_configuration @codec_config_id end |
#codec_configuration=(configuration) ⇒ Object
44 45 46 47 48 49 50 |
# File 'lib/bitmovin/encoding/encodings/stream.rb', line 44 def codec_configuration=(configuration) if configuration.instance_of?(String) @codec_config_id = configuration else @codec_config_id = configuration.id end end |
#errors ⇒ Object
70 71 72 |
# File 'lib/bitmovin/encoding/encodings/stream.rb', line 70 def errors @errors end |
#input_analysis ⇒ Object
80 81 82 83 84 |
# File 'lib/bitmovin/encoding/encodings/stream.rb', line 80 def input_analysis path = File.join("/v1/encoding/encodings/", @encoding_id, "streams", @id, "inputs") response = Bitmovin.client.get(path) hash_to_struct(result(response)) end |
#input_details ⇒ Object
74 75 76 77 78 |
# File 'lib/bitmovin/encoding/encodings/stream.rb', line 74 def input_details path = File.join("/v1/encoding/encodings/", @encoding_id, "streams", @id, "input") response = Bitmovin.client.get(path) hash_to_struct(result(response)) end |
#input_streams ⇒ Object
24 25 26 |
# File 'lib/bitmovin/encoding/encodings/stream.rb', line 24 def input_streams @input_streams end |
#invalid? ⇒ Boolean
66 67 68 |
# File 'lib/bitmovin/encoding/encodings/stream.rb', line 66 def invalid? !valid? end |
#outputs ⇒ Object
34 35 36 |
# File 'lib/bitmovin/encoding/encodings/stream.rb', line 34 def outputs @outputs end |
#save! ⇒ Object
55 56 57 58 59 |
# File 'lib/bitmovin/encoding/encodings/stream.rb', line 55 def save! if valid? super end end |
#valid? ⇒ Boolean
61 62 63 64 |
# File 'lib/bitmovin/encoding/encodings/stream.rb', line 61 def valid? validate! @errors.empty? end |