mxfinfo 0.1.3 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/compile_commands.json +52 -0
- data/ext/mxfinfo/mxfinfo.c +14 -7
- data/lib/mxfinfo/version.rb +1 -2
- data/mxfinfo.gemspec +8 -9
- data/spec/info_object_spec.rb +8 -8
- metadata +19 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '0891821de9c4eef60dde42ddc083cc6a118580768198009962ece8957726f284'
|
4
|
+
data.tar.gz: ef9540ce8dd3394e802855220eace91cb64b65fff699574daaa34a13dfff26f8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 689ea935346dfedffa75e9c14945644b42600f23a8984495034ce04ca73f2a9eea5a7d93a25ba01f64bee127be05e9b1d6f0e53fcf56bed8b7e11e354f676932
|
7
|
+
data.tar.gz: de108b7dd52c51ff567df1a3383b7403f32b09ba75e3a8df88034e73c697122d478710b93b6d2d66b171c97e6a83271859825a85a50515f68a470568a3e8b742
|
data/.gitignore
CHANGED
@@ -0,0 +1,52 @@
|
|
1
|
+
[
|
2
|
+
{
|
3
|
+
"arguments": [
|
4
|
+
"gcc",
|
5
|
+
"-c",
|
6
|
+
"-I.",
|
7
|
+
"-I/home/steved/.rbenv/versions/2.5.8/include/ruby-2.5.0/x86_64-linux",
|
8
|
+
"-I/home/steved/.rbenv/versions/2.5.8/include/ruby-2.5.0/ruby/backward",
|
9
|
+
"-I/home/steved/.rbenv/versions/2.5.8/include/ruby-2.5.0",
|
10
|
+
"-I../../../../ext/mxfinfo",
|
11
|
+
"-I/opt/environments/strawberry/include/libMXF-1.0",
|
12
|
+
"--std=gnu99",
|
13
|
+
"-D_GNU_SOURCE",
|
14
|
+
"-Wall",
|
15
|
+
"-I/home/steved/.rbenv/versions/2.5.8/include",
|
16
|
+
"-fPIC",
|
17
|
+
"-O3",
|
18
|
+
"-ggdb3",
|
19
|
+
"-fPIC",
|
20
|
+
"-o",
|
21
|
+
"avid_mxf_info.o",
|
22
|
+
"../../../../ext/mxfinfo/avid_mxf_info.c"
|
23
|
+
],
|
24
|
+
"directory": "/home/steved/Documents/projective/github/mxfinfo/tmp/x86_64-linux/mxfinfo/2.5.8",
|
25
|
+
"file": "../../../../ext/mxfinfo/avid_mxf_info.c"
|
26
|
+
},
|
27
|
+
{
|
28
|
+
"arguments": [
|
29
|
+
"gcc",
|
30
|
+
"-c",
|
31
|
+
"-I.",
|
32
|
+
"-I/home/steved/.rbenv/versions/2.5.8/include/ruby-2.5.0/x86_64-linux",
|
33
|
+
"-I/home/steved/.rbenv/versions/2.5.8/include/ruby-2.5.0/ruby/backward",
|
34
|
+
"-I/home/steved/.rbenv/versions/2.5.8/include/ruby-2.5.0",
|
35
|
+
"-I../../../../ext/mxfinfo",
|
36
|
+
"-I/opt/environments/strawberry/include/libMXF-1.0",
|
37
|
+
"--std=gnu99",
|
38
|
+
"-D_GNU_SOURCE",
|
39
|
+
"-Wall",
|
40
|
+
"-I/home/steved/.rbenv/versions/2.5.8/include",
|
41
|
+
"-fPIC",
|
42
|
+
"-O3",
|
43
|
+
"-ggdb3",
|
44
|
+
"-fPIC",
|
45
|
+
"-o",
|
46
|
+
"mxfinfo.o",
|
47
|
+
"../../../../ext/mxfinfo/mxfinfo.c"
|
48
|
+
],
|
49
|
+
"directory": "/home/steved/Documents/projective/github/mxfinfo/tmp/x86_64-linux/mxfinfo/2.5.8",
|
50
|
+
"file": "../../../../ext/mxfinfo/mxfinfo.c"
|
51
|
+
}
|
52
|
+
]
|
data/ext/mxfinfo/mxfinfo.c
CHANGED
@@ -9,13 +9,12 @@ static
|
|
9
9
|
VALUE rb_time_from_mxf_timestamp(mxfTimestamp *ts)
|
10
10
|
{
|
11
11
|
/*
|
12
|
-
* NOTE: This is probably not thread-safe, since struct tm*
|
13
|
-
* returned by localtime is shared static.
|
12
|
+
* NOTE: This is probably not thread-safe, since struct tm* returned by localtime is shared static.
|
14
13
|
*/
|
15
14
|
time_t t;
|
16
15
|
time(&t);
|
17
16
|
struct tm *tmts;
|
18
|
-
tmts =
|
17
|
+
tmts = gmtime(&t);
|
19
18
|
|
20
19
|
tmts->tm_year = (int) ts->year - 1900;
|
21
20
|
tmts->tm_mon = (int) ts->month - 1;
|
@@ -23,6 +22,7 @@ VALUE rb_time_from_mxf_timestamp(mxfTimestamp *ts)
|
|
23
22
|
tmts->tm_hour = (int) ts->hour;
|
24
23
|
tmts->tm_min = (int) ts->min;
|
25
24
|
tmts->tm_sec = (int) ts->sec;
|
25
|
+
tmts->tm_isdst = -1;
|
26
26
|
|
27
27
|
return rb_time_new(mktime(tmts), ts->qmsec);
|
28
28
|
}
|
@@ -90,6 +90,9 @@ VALUE rb_str_from_label(const unsigned char *lbl, int len)
|
|
90
90
|
|
91
91
|
VALUE m_mxfinfo = Qnil;
|
92
92
|
VALUE c_infoobject = Qnil;
|
93
|
+
VALUE c_error = Qnil;
|
94
|
+
VALUE c_eNotOpAtom = Qnil;
|
95
|
+
VALUE c_eNotReadable = Qnil;
|
93
96
|
|
94
97
|
static
|
95
98
|
void cio_free(void *ptr) {
|
@@ -133,17 +136,17 @@ VALUE cio_new(VALUE class, VALUE path)
|
|
133
136
|
switch(params.result)
|
134
137
|
{
|
135
138
|
case -2:
|
136
|
-
rb_raise(
|
139
|
+
rb_raise(c_eNotReadable, "Failed to open file.");
|
137
140
|
break;
|
138
141
|
case -3:
|
139
|
-
rb_raise(
|
142
|
+
rb_raise(c_eNotReadable, "Failed to read header partition.");
|
140
143
|
break;
|
141
144
|
case -4:
|
142
|
-
rb_raise(
|
145
|
+
rb_raise(c_eNotOpAtom, "File is not OP-Atom.");
|
143
146
|
break;
|
144
147
|
case -1:
|
145
148
|
default:
|
146
|
-
rb_raise(
|
149
|
+
rb_raise(c_eNotReadable, "Failed to read info.");
|
147
150
|
break;
|
148
151
|
}
|
149
152
|
|
@@ -292,6 +295,10 @@ void Init_mxfinfo()
|
|
292
295
|
{
|
293
296
|
m_mxfinfo = rb_define_module("MXFInfo");
|
294
297
|
|
298
|
+
c_error = rb_define_class_under(m_mxfinfo, "Error", rb_eStandardError);
|
299
|
+
c_eNotOpAtom = rb_define_class_under(c_error, "NotOpAtom", c_error);
|
300
|
+
c_eNotReadable = rb_define_class_under(c_error, "NotReadable", c_error);
|
301
|
+
|
295
302
|
c_infoobject = rb_define_class_under(m_mxfinfo, "InfoObject", rb_cObject);
|
296
303
|
rb_define_singleton_method(c_infoobject, "new", cio_new, 1);
|
297
304
|
|
data/lib/mxfinfo/version.rb
CHANGED
data/mxfinfo.gemspec
CHANGED
@@ -1,14 +1,14 @@
|
|
1
|
-
require File.expand_path('
|
1
|
+
require File.expand_path('lib/mxfinfo/version', __dir__)
|
2
2
|
|
3
3
|
Gem::Specification.new do |gem|
|
4
4
|
gem.authors = ['Steve Dierker', 'Malte Rohde']
|
5
|
-
gem.email = ['technology@
|
6
|
-
gem.description =
|
7
|
-
gem.summary =
|
8
|
-
gem.homepage = 'http://github.com/
|
5
|
+
gem.email = ['technology@projective.io']
|
6
|
+
gem.description = 'MXFinfo is a gem that wraps avidmxfinfo from libmxf in a native ruby extension.'
|
7
|
+
gem.summary = 'MXFinfo is a gem that wraps avidmxfinfo from libmxf in a native ruby extension.'
|
8
|
+
gem.homepage = 'http://github.com/projectivetech/mxfinfo'
|
9
9
|
|
10
|
-
gem.files = `git ls-files`.split(
|
11
|
-
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
10
|
+
gem.files = `git ls-files`.split($OUTPUT_RECORD_SEPARATOR)
|
11
|
+
gem.executables = gem.files.grep(%r{^bin/}).map { |f| File.basename(f) }
|
12
12
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
13
13
|
gem.extensions = ['ext/mxfinfo/extconf.rb']
|
14
14
|
gem.name = 'mxfinfo'
|
@@ -18,8 +18,7 @@ Gem::Specification.new do |gem|
|
|
18
18
|
|
19
19
|
gem.required_ruby_version = '>= 1.9.3'
|
20
20
|
|
21
|
+
gem.add_development_dependency 'rake-compiler', '~> 0.9'
|
21
22
|
gem.add_development_dependency 'rspec', '~> 3'
|
22
23
|
gem.add_development_dependency 'rspec-its', '1.2.0'
|
23
|
-
gem.add_development_dependency 'rake-compiler', '~> 0.9'
|
24
24
|
end
|
25
|
-
|
data/spec/info_object_spec.rb
CHANGED
@@ -2,29 +2,29 @@ require 'spec_helper'
|
|
2
2
|
require 'time'
|
3
3
|
|
4
4
|
describe 'MXFInfo::InfoObject' do
|
5
|
-
context '
|
5
|
+
context 'with a valid MXF file' do
|
6
6
|
subject do
|
7
|
-
MXFInfo.scan File.expand_path('
|
7
|
+
MXFInfo.scan File.expand_path('fixtures/IMG_0395.MOV.A14DC7130D.mxf', __dir__)
|
8
8
|
end
|
9
9
|
|
10
10
|
its(:project_name) { should eq('Ballerinas_zippy') }
|
11
11
|
its(:clip_name) { should eq('IMG_0395.MOV') }
|
12
12
|
its(:clip_created_at) { should eq(Time.parse('2011-05-08 22:02:53.000')) }
|
13
|
-
its(:project_edit_rate) { should eq((25/1)) }
|
13
|
+
its(:project_edit_rate) { should eq((25 / 1)) }
|
14
14
|
its(:clip_duration) { should eq(287) }
|
15
|
-
its(:clip_edit_rate) { should eq((25/1)) }
|
15
|
+
its(:clip_edit_rate) { should eq((25 / 1)) }
|
16
16
|
its(:video_tracks) { should eq(1) }
|
17
17
|
its(:audio_tracks) { should eq(1) }
|
18
18
|
its(:clip_track_string) { should eq('V1 A1') }
|
19
19
|
its(:essence_type) { should eq('PCM') }
|
20
20
|
its(:essence_label) { should eq('060e2b34040101010d01030102060200') }
|
21
21
|
its(:track_number) { should eq(1) }
|
22
|
-
its(:edit_rate) { should eq((
|
23
|
-
its(:track_duration) { should eq(
|
24
|
-
its(:segment_duration) { should eq(
|
22
|
+
its(:edit_rate) { should eq((48_000 / 1)) }
|
23
|
+
its(:track_duration) { should eq(551_040) }
|
24
|
+
its(:segment_duration) { should eq(551_040) }
|
25
25
|
its(:segment_offset) { should eq(0) }
|
26
26
|
its(:start_timecode) { should eq(0) }
|
27
|
-
its(:audio_sampling_rate) { should eq((
|
27
|
+
its(:audio_sampling_rate) { should eq((48_000 / 1)) }
|
28
28
|
its(:quantization_bits) { should eq(16) }
|
29
29
|
its(:channel_count) { should eq(1) }
|
30
30
|
its(:material_package_uid) { should eq('060a2b340101010101010f00130000004dc7130d05831a0a060e2b347f7f2a80') }
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mxfinfo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Steve Dierker
|
@@ -9,54 +9,54 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2021-03-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
|
-
name:
|
15
|
+
name: rake-compiler
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
18
|
- - "~>"
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: '
|
20
|
+
version: '0.9'
|
21
21
|
type: :development
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - "~>"
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version: '
|
27
|
+
version: '0.9'
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
|
-
name: rspec
|
29
|
+
name: rspec
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
31
31
|
requirements:
|
32
|
-
- -
|
32
|
+
- - "~>"
|
33
33
|
- !ruby/object:Gem::Version
|
34
|
-
version:
|
34
|
+
version: '3'
|
35
35
|
type: :development
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
|
-
- -
|
39
|
+
- - "~>"
|
40
40
|
- !ruby/object:Gem::Version
|
41
|
-
version:
|
41
|
+
version: '3'
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
|
-
name:
|
43
|
+
name: rspec-its
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
45
45
|
requirements:
|
46
|
-
- -
|
46
|
+
- - '='
|
47
47
|
- !ruby/object:Gem::Version
|
48
|
-
version:
|
48
|
+
version: 1.2.0
|
49
49
|
type: :development
|
50
50
|
prerelease: false
|
51
51
|
version_requirements: !ruby/object:Gem::Requirement
|
52
52
|
requirements:
|
53
|
-
- -
|
53
|
+
- - '='
|
54
54
|
- !ruby/object:Gem::Version
|
55
|
-
version:
|
55
|
+
version: 1.2.0
|
56
56
|
description: MXFinfo is a gem that wraps avidmxfinfo from libmxf in a native ruby
|
57
57
|
extension.
|
58
58
|
email:
|
59
|
-
- technology@
|
59
|
+
- technology@projective.io
|
60
60
|
executables: []
|
61
61
|
extensions:
|
62
62
|
- ext/mxfinfo/extconf.rb
|
@@ -67,6 +67,7 @@ files:
|
|
67
67
|
- LICENSE
|
68
68
|
- README.md
|
69
69
|
- Rakefile
|
70
|
+
- compile_commands.json
|
70
71
|
- ext/mxfinfo/avid_mxf_info.c
|
71
72
|
- ext/mxfinfo/avid_mxf_info.h
|
72
73
|
- ext/mxfinfo/extconf.rb
|
@@ -79,7 +80,7 @@ files:
|
|
79
80
|
- spec/info_object_spec.rb
|
80
81
|
- spec/mxfinfo_spec.rb
|
81
82
|
- spec/spec_helper.rb
|
82
|
-
homepage: http://github.com/
|
83
|
+
homepage: http://github.com/projectivetech/mxfinfo
|
83
84
|
licenses:
|
84
85
|
- MIT
|
85
86
|
metadata: {}
|
@@ -99,7 +100,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
99
100
|
version: '0'
|
100
101
|
requirements: []
|
101
102
|
rubyforge_project:
|
102
|
-
rubygems_version: 2.7.6
|
103
|
+
rubygems_version: 2.7.6.2
|
103
104
|
signing_key:
|
104
105
|
specification_version: 4
|
105
106
|
summary: MXFinfo is a gem that wraps avidmxfinfo from libmxf in a native ruby extension.
|