one-k-rmov 0.2.5 → 0.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Rakefile +1 -1
- data/ext/track.c +37 -0
- data/rmov.gemspec +2 -2
- data/spec/quicktime/hd_track_spec.rb +4 -0
- metadata +2 -2
data/Rakefile
CHANGED
@@ -2,7 +2,7 @@ require 'rubygems'
|
|
2
2
|
require 'rake'
|
3
3
|
require 'echoe'
|
4
4
|
|
5
|
-
Echoe.new('rmov', '0.2.
|
5
|
+
Echoe.new('rmov', '0.2.6') do |p|
|
6
6
|
p.summary = "Ruby wrapper for the QuickTime C API."
|
7
7
|
p.description = "Ruby wrapper for the QuickTime C API. Updates by 1K include exposing some movie properties such as codec and audio channel descriptions"
|
8
8
|
p.url = "http://github.com/one-k/rmov"
|
data/ext/track.c
CHANGED
@@ -613,6 +613,42 @@ static VALUE track_encoded_pixel_dimensions(VALUE obj)
|
|
613
613
|
return Qnil;
|
614
614
|
}
|
615
615
|
|
616
|
+
|
617
|
+
/*
|
618
|
+
call-seq: track_display_pixel_dimensions() -> {:width => width, :height => height}
|
619
|
+
|
620
|
+
returns hash of dimensions {:width => width, :height => height} of the encoded pixel
|
621
|
+
dimensions
|
622
|
+
*/
|
623
|
+
static VALUE track_display_pixel_dimensions(VALUE obj)
|
624
|
+
{
|
625
|
+
OSErr osErr = noErr;
|
626
|
+
ImageDescriptionHandle image_description = track_image_description(obj);
|
627
|
+
if (image_description == NULL) goto bail;
|
628
|
+
|
629
|
+
SInt32 width, height;
|
630
|
+
osErr = ICMImageDescriptionGetProperty(image_description, kQTPropertyClass_ImageDescription, kICMImageDescriptionPropertyID_DisplayWidth, sizeof(width), &width, NULL);
|
631
|
+
if (osErr != noErr) goto bail;
|
632
|
+
|
633
|
+
osErr = ICMImageDescriptionGetProperty(image_description, kQTPropertyClass_ImageDescription, kICMImageDescriptionPropertyID_DisplayHeight, sizeof(height), &height, NULL);
|
634
|
+
if (osErr != noErr) goto bail;
|
635
|
+
|
636
|
+
VALUE size_hash = rb_hash_new();
|
637
|
+
|
638
|
+
rb_hash_aset(size_hash, ID2SYM(rb_intern("width")), INT2NUM(width));
|
639
|
+
rb_hash_aset(size_hash, ID2SYM(rb_intern("height")), INT2NUM(height));
|
640
|
+
|
641
|
+
DisposeHandle((Handle)image_description);
|
642
|
+
return size_hash;
|
643
|
+
|
644
|
+
bail:
|
645
|
+
DisposeHandle((Handle)image_description);
|
646
|
+
rb_raise(eQuickTime, "Error %d when getting track_display_pixel_dimensions", osErr);
|
647
|
+
return Qnil;
|
648
|
+
}
|
649
|
+
|
650
|
+
|
651
|
+
|
616
652
|
/*
|
617
653
|
call-seq: track_pixel_aspect_ratio() -> aspect_ratio array [1, 1]
|
618
654
|
*/
|
@@ -654,6 +690,7 @@ void Init_quicktime_track()
|
|
654
690
|
rb_define_method(cTrack, "width", track_width, 0);
|
655
691
|
rb_define_method(cTrack, "height", track_height, 0);
|
656
692
|
rb_define_method(cTrack, "encoded_pixel_dimensions", track_encoded_pixel_dimensions, 0);
|
693
|
+
rb_define_method(cTrack, "display_pixel_dimensions", track_display_pixel_dimensions, 0);
|
657
694
|
rb_define_method(cTrack, "pixel_aspect_ratio", track_pixel_aspect_ratio, 0);
|
658
695
|
|
659
696
|
rb_define_method(cTrack, "channel_count", track_get_audio_channel_count, 0);
|
data/rmov.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{rmov}
|
5
|
-
s.version = "0.2.
|
5
|
+
s.version = "0.2.6"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Ryan Bates, with updates by 1K Studios, LLC"]
|
9
|
-
s.date = %q{2009-03-
|
9
|
+
s.date = %q{2009-03-12}
|
10
10
|
s.description = %q{Ruby wrapper for the QuickTime C API. Updates by 1K include exposing some movie properties such as codec and audio channel descriptions}
|
11
11
|
s.email = %q{ryan (at) railscasts (dot) com}
|
12
12
|
s.extensions = ["ext/extconf.rb"]
|
@@ -72,6 +72,10 @@ describe QuickTime::Track do
|
|
72
72
|
@track.encoded_pixel_dimensions.should == {:width => 720, :height => 480}
|
73
73
|
end
|
74
74
|
|
75
|
+
it "has display pixel size of 720x480" do
|
76
|
+
@track.display_pixel_dimensions.should == {:width => 853, :height => 480}
|
77
|
+
end
|
78
|
+
|
75
79
|
it "has aspect ratio of 1:0.84375" do
|
76
80
|
@track.pixel_aspect_ratio.should == [100000, 84375]
|
77
81
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: one-k-rmov
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Bates, with updates by 1K Studios, LLC
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-03-
|
12
|
+
date: 2009-03-12 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|