staugaard-transcoding_machine 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
- :patch: 2
2
+ :patch: 3
3
3
  :major: 0
4
4
  :minor: 1
@@ -44,16 +44,12 @@ module TranscodingMachine
44
44
  def start
45
45
  prepare_working_directory
46
46
  get_source_file
47
- source_file_attributes, source_media_format = analyze_source_file
47
+ source_file_attributes, source_media_format, target_media_formats = analyze_source_file
48
48
 
49
49
  thumbnail_file_path = generate_thumbnail(source_file_attributes)
50
50
  storage.put_thumbnail_file(thumbnail_file_path, @source_file_name, @storage_options) if thumbnail_file_path
51
51
 
52
- media_formats = @media_players.map {|mp| mp.best_format_for(source_file_attributes)}.compact.uniq
53
-
54
- media_formats -= [source_media_format]
55
-
56
- media_formats.each do |media_format|
52
+ target_media_formats.each do |media_format|
57
53
  destination_file_path = transcode(source_file_attributes, media_format)
58
54
  put_destination_file(destination_file_path, media_format)
59
55
  end
@@ -80,8 +76,11 @@ module TranscodingMachine
80
76
 
81
77
  source_media_format = @media_formats.find {|mf| mf.matches(source_file_attributes)}
82
78
 
83
- @event_handler.analyzed_source_file(source_file_attributes, source_media_format) if @event_handler
84
- [source_file_attributes, source_media_format]
79
+ target_media_formats = @media_players.map {|mp| mp.best_format_for(source_file_attributes)}.compact.uniq
80
+ target_media_formats -= [source_media_format]
81
+
82
+ @event_handler.analyzed_source_file(source_file_attributes, source_media_format, target_media_formats) if @event_handler
83
+ [source_file_attributes, source_media_format, target_media_formats]
85
84
  end
86
85
 
87
86
  def generate_thumbnail(source_file_attributes)
@@ -20,8 +20,10 @@ module TranscodingMachine
20
20
  push_status(:analyzing)
21
21
  end
22
22
 
23
- def analyzed_source_file(source_file_attributes, source_media_format)
24
- push_status(:analyzed, :media_format => source_media_format.id, :media_attributes => source_file_attributes)
23
+ def analyzed_source_file(source_file_attributes, source_media_format, target_media_formats)
24
+ push_status(:analyzed, :media_format => source_media_format.id,
25
+ :media_attributes => source_file_attributes,
26
+ :target_formats => target_media_formats.map &:id)
25
27
  end
26
28
 
27
29
  def generating_thumbnail_file
@@ -5,7 +5,6 @@ require 'transcoding_machine/media_format_criterium'
5
5
  require 'transcoding_machine/media_player'
6
6
  require 'transcoding_machine/client/job_queue'
7
7
  require 'transcoding_machine/client/result_queue'
8
- require 'transcoding_machine/client/server_manager'
9
8
 
10
9
  module TranscodingMachine
11
10
  version = YAML.load_file(File.expand_path('../VERSION.yml', File.dirname(__FILE__)))
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: staugaard-transcoding_machine
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mick Staugaard