diff --git a/AppController_Open.m b/AppController_Open.m index 49b0a31..a5f74e6 100644 --- a/AppController_Open.m +++ b/AppController_Open.m @@ -302,8 +302,7 @@ - (BOOL)openMovie:(NSURL*)movieURL movieClass:(Class)movieClass // open movie NSError* error; MMovie* movie = [self movieFromURL:movieURL withMovieClass:movieClass error:&error]; - if (!movie || ![movie setOpenGLContext:[_movieView openGLContext] - pixelFormat:[_movieView pixelFormat] error:&error]) { + if (!movie) { [self closeMovie]; if ([self isFullScreen]) { NSString* s = [movieURL isFileURL] ? [movieURL path] : [movieURL absoluteString]; diff --git a/English.lproj/MainMenu.nib/designable.nib b/English.lproj/MainMenu.nib/designable.nib index d71fa67..3f93744 100644 --- a/English.lproj/MainMenu.nib/designable.nib +++ b/English.lproj/MainMenu.nib/designable.nib @@ -2,45 +2,48 @@ 1050 - 10J869 - 1305 - 1038.35 - 461.00 + 12A269 + 2549 + 1187 + 624.00 com.apple.InterfaceBuilder.CocoaPlugin - 1305 + 2549 - NSTableHeaderView - NSPopUpButton - NSMenu - NSSliderCell + NSBox NSButton + NSButtonCell NSCustomObject - NSSlider - NSTableView NSCustomView - NSTextField - NSWindowTemplate - NSTextFieldCell - NSButtonCell - NSTableColumn - NSSegmentedControl + NSMenu + NSMenuItem NSOpenGLView - NSBox - NSView + NSPopUpButton NSPopUpButtonCell NSScrollView - NSTabViewItem + NSScroller NSSegmentedCell - NSMenuItem + NSSegmentedControl + NSSlider + NSSliderCell NSTabView - NSScroller + NSTabViewItem + NSTableColumn + NSTableHeaderView + NSTableView + NSTextField + NSTextFieldCell + NSView + NSWindowTemplate com.apple.InterfaceBuilder.CocoaPlugin - + + PluginDependencyRecalculationVersion + + @@ -2036,6 +2039,7 @@ View + 256 @@ -2049,7 +2053,7 @@ YES - 67239424 + 67108864 134217728 @@ -2058,7 +2062,7 @@ 16 - 138690815 + 138690560 2 NSImage @@ -2069,6 +2073,7 @@ 400 75 + NO @@ -2079,7 +2084,7 @@ YES - 67501824 + 67371264 131072 @@ -2099,6 +2104,7 @@ NO NO + NO @@ -2106,10 +2112,9 @@ {{616, 25}, {24, 24}} - YES - 67239424 + 67108864 134217728 @@ -2118,7 +2123,7 @@ 1044 - 141836543 + 141836288 2 NSImage @@ -2129,6 +2134,7 @@ 200 25 + NO @@ -2152,12 +2158,12 @@ YES - 67239424 + 67108864 0 - 141836543 + 141836288 2 NSImage @@ -2168,6 +2174,7 @@ 200 25 + NO @@ -2178,7 +2185,7 @@ {0, 0} - 67239424 + 67108864 0 Box @@ -2210,7 +2217,7 @@ {0, 0} - 67239424 + 67108864 0 Box @@ -2235,13 +2242,13 @@ -1 YES - 67239424 + 67108864 0 -1 - 141836543 + 141836288 2 NSImage @@ -2252,6 +2259,7 @@ 200 25 + NO @@ -2263,13 +2271,13 @@ 1 YES - 67239424 + 67108864 0 1 - 141836543 + 141836288 2 NSImage @@ -2280,6 +2288,7 @@ 200 25 + NO @@ -2294,7 +2303,7 @@ YES - 604372736 + 604242176 131072 @@ -2310,6 +2319,7 @@ NO NO + NO @@ -2320,7 +2330,7 @@ YES - 67239424 + 67108864 67108864 --:--:-- @@ -2338,6 +2348,7 @@ MC4yMTU2ODYyOCAwLjIyMzUyOTQxIDAuMTg0MzEzNzMAA + NO @@ -2348,7 +2359,7 @@ YES - 67239424 + 67108864 0 --:--:-- @@ -2362,6 +2373,7 @@ MC4yMTU2ODYyOCAwLjIyMzUyOTQxIDAuMTg0MzEzNzMAA + NO {{0, 51}, {640, 15}} @@ -2377,7 +2389,7 @@ - 256 + 274 @@ -2388,12 +2400,12 @@ YES - 67239424 + 67108864 134217728 - 138690815 + 138690560 2 NSImage @@ -2408,6 +2420,7 @@ 400 75 + NO @@ -2419,13 +2432,13 @@ -10 YES - 67763712 + 67633152 0 -10 - 141836543 + 141836288 2 NSImage @@ -2436,6 +2449,7 @@ 200 25 + NO @@ -2447,13 +2461,13 @@ 10 YES - 67763712 + 67633152 0 10 - 141836543 + 141836288 2 NSImage @@ -2464,6 +2478,7 @@ 200 25 + NO {103, 45} @@ -2478,7 +2493,7 @@ {0, 0} - 67239424 + 67108864 0 Title @@ -2499,14 +2514,15 @@ NO - {{7, 11}, {640, 340}} + {640, 340} - {{0, 0}, {1440, 878}} - {1e+13, 1e+13} + {{0, 0}, {1440, 900}} + {10000000000000, 10000000000000} MainWindow + YES 129 @@ -2518,6 +2534,7 @@ View + 256 @@ -2529,12 +2546,12 @@ YES - 67239424 + 67108864 134217728 - 138690815 + 138690560 2 NSImage @@ -2545,6 +2562,7 @@ 400 75 + NO @@ -2553,7 +2571,7 @@ YES - 67501824 + 67371264 131072 @@ -2569,6 +2587,7 @@ NO NO + NO @@ -2577,7 +2596,7 @@ YES - 67501824 + 67371264 131072 @@ -2593,6 +2612,7 @@ NO NO + NO @@ -2601,12 +2621,12 @@ YES - 67239424 + 67108864 0 - 141836543 + 141836288 2 NSImage @@ -2621,6 +2641,7 @@ 200 25 + NO @@ -2629,7 +2650,7 @@ YES - 67239424 + 67108864 67108864 00:00:00 @@ -2643,6 +2664,7 @@ MAA + NO @@ -2651,7 +2673,7 @@ YES - 67239424 + 67108864 134348800 Play Panel @@ -2659,6 +2681,7 @@ + NO @@ -2667,12 +2690,12 @@ YES - 67239424 + 67108864 0 - 141836543 + 141836288 2 NSImage @@ -2687,6 +2710,7 @@ 200 25 + NO @@ -2695,7 +2719,7 @@ YES - 67239424 + 67108864 0 00:00:00 @@ -2703,6 +2727,7 @@ + NO @@ -2711,12 +2736,12 @@ YES - 67239424 + 67108864 0 - 141836543 + 141836288 32 NSImage @@ -2727,6 +2752,7 @@ 200 25 + NO @@ -2736,13 +2762,13 @@ -1 YES - 67239424 + 67108864 0 -1 - 141836543 + 141836288 2 NSImage @@ -2757,6 +2783,7 @@ 200 25 + NO @@ -2766,13 +2793,13 @@ 1 YES - 67239424 + 67108864 0 1 - 141836543 + 141836288 2 NSImage @@ -2787,6 +2814,7 @@ 200 25 + NO @@ -2794,7 +2822,7 @@ - 256 + 274 @@ -2803,12 +2831,12 @@ YES - 67239424 + 67108864 134217728 - 138690815 + 138690560 2 NSImage @@ -2823,6 +2851,7 @@ 400 75 + NO @@ -2832,13 +2861,13 @@ -10 YES - 67763712 + 67633152 0 -10 - 141836543 + 141836288 2 NSImage @@ -2853,6 +2882,7 @@ 200 25 + NO @@ -2862,13 +2892,13 @@ 10 YES - 67763712 + 67633152 0 10 - 141836543 + 141836288 2 NSImage @@ -2883,6 +2913,7 @@ 200 25 + NO {106, 36} @@ -2893,7 +2924,7 @@ {0, 0} - 67239424 + 67108864 0 Title @@ -2912,9 +2943,10 @@ {500, 87} - {{0, 0}, {1440, 878}} - {1e+13, 1e+13} + {{0, 0}, {1440, 900}} + {10000000000000, 10000000000000} PlayPanel + YES 145 @@ -2926,6 +2958,7 @@ View + 256 @@ -2948,7 +2981,7 @@ - 256 + 274 @@ -2958,7 +2991,7 @@ 2 YES - 67501824 + 67371264 131072 @@ -2975,6 +3008,7 @@ NO NO + NO @@ -2983,7 +3017,7 @@ YES - 67501824 + 67371264 131072 @@ -2999,6 +3033,7 @@ NO NO + NO @@ -3008,7 +3043,7 @@ 1 YES - 67501824 + 67371264 131072 @@ -3025,6 +3060,7 @@ NO NO + NO @@ -3034,13 +3070,13 @@ 2 YES - 67239424 + 67108864 67108864 2 - 138690815 + 138690560 2 NSImage @@ -3057,6 +3093,7 @@ 200 25 + NO @@ -3065,7 +3102,7 @@ YES - 67239424 + 67108864 4325376 Contrast: @@ -3084,6 +3121,7 @@ MCAwIDAAA + NO @@ -3092,12 +3130,12 @@ YES - 67239424 + 67108864 67108864 - 138690815 + 138690560 2 @@ -3108,6 +3146,7 @@ 200 25 + NO @@ -3117,13 +3156,13 @@ 1 YES - 67239424 + 67108864 67108864 1 - 138690815 + 138690560 2 @@ -3134,6 +3173,7 @@ 200 25 + NO @@ -3142,7 +3182,7 @@ YES - 67239424 + 67108864 4325376 Brightness: @@ -3150,6 +3190,7 @@ + NO @@ -3158,7 +3199,7 @@ YES - 67239424 + 67108864 4325376 Saturation: @@ -3166,6 +3207,7 @@ + NO @@ -3175,7 +3217,7 @@ 3 YES - 67501824 + 67371264 131072 @@ -3192,6 +3234,7 @@ NO NO + NO @@ -3201,13 +3244,13 @@ 3 YES - 67239424 + 67108864 67108864 3 - 138690815 + 138690560 2 @@ -3218,6 +3261,7 @@ 200 25 + NO @@ -3226,7 +3270,7 @@ YES - 67239424 + 67108864 4325376 Hue: @@ -3234,6 +3278,7 @@ + NO {{2, 2}, {132, 186}} @@ -3244,7 +3289,7 @@ {0, 0} - 67239424 + 67108864 0 Video @@ -3266,7 +3311,7 @@ - 256 + 274 @@ -3275,7 +3320,7 @@ YES - 67239424 + 67108864 71434240 Device: @@ -3283,6 +3328,7 @@ + NO @@ -3291,7 +3337,7 @@ YES - 67239424 + 67108864 4325376 ... @@ -3299,6 +3345,7 @@ + NO @@ -3307,7 +3354,7 @@ YES - 67239424 + 67108864 71434240 Current: @@ -3315,6 +3362,7 @@ + NO @@ -3323,7 +3371,7 @@ YES - 67239424 + 67108864 4325376 ... @@ -3331,6 +3379,7 @@ + NO {{2, 2}, {132, 186}} @@ -3341,7 +3390,7 @@ {0, 0} - 67239424 + 67108864 0 Audio @@ -3363,7 +3412,7 @@ - 256 + 274 @@ -3372,7 +3421,7 @@ YES - 67239424 + 67108864 4325376 Sync.: @@ -3380,6 +3429,7 @@ + NO @@ -3388,7 +3438,7 @@ YES - 67239424 + 67108864 4325376 Font Size: @@ -3396,6 +3446,7 @@ + NO @@ -3404,7 +3455,7 @@ YES - 67239424 + 67108864 4325376 V-Margin: @@ -3412,6 +3463,7 @@ + NO @@ -3420,7 +3472,7 @@ YES - 67239424 + 67108864 4325376 Letter Box: @@ -3428,6 +3480,7 @@ + NO @@ -3436,12 +3489,12 @@ YES - 67239424 + 67108864 67108864 - 138690815 + 138690560 2 @@ -3452,6 +3505,7 @@ 200 25 + NO @@ -3461,13 +3515,13 @@ -1 YES - 67763712 + 67633152 134348800 Smaller -1 - -2038152961 + -2038153216 34 @@ -3476,6 +3530,7 @@ 200 25 + NO @@ -3485,13 +3540,13 @@ 1 YES - 67763712 + 67633152 134348800 Bigger 1 - -2038152961 + -2038153216 34 @@ -3500,6 +3555,7 @@ 200 25 + NO @@ -3508,12 +3564,12 @@ YES - 67239424 + 67108864 67108864 - 138690815 + 138690560 2 @@ -3524,6 +3580,7 @@ 200 25 + NO @@ -3533,13 +3590,13 @@ -1 YES - 67763712 + 67633152 134348800 Smaller -1 - -2038152961 + -2038153216 34 @@ -3548,6 +3605,7 @@ 200 25 + NO @@ -3557,13 +3615,13 @@ 1 YES - 67763712 + 67633152 134348800 Bigger 1 - -2038152961 + -2038153216 34 @@ -3572,6 +3630,7 @@ 200 25 + NO @@ -3581,13 +3640,13 @@ 10 YES - 67239424 + 67108864 67108864 10 - 138690815 + 138690560 2 @@ -3598,6 +3657,7 @@ 200 25 + NO @@ -3606,11 +3666,11 @@ YES - -2076049856 + -2076180416 133632 - 109199615 + 109199360 1 @@ -3682,6 +3742,7 @@ YES 1 + NO @@ -3690,7 +3751,7 @@ YES - 67239424 + 67108864 4325376 Position: @@ -3698,6 +3759,7 @@ + NO @@ -3707,13 +3769,13 @@ 10 YES - 67239424 + 67108864 67108864 10 - 138690815 + 138690560 2 @@ -3724,6 +3786,7 @@ 200 25 + NO @@ -3732,11 +3795,11 @@ YES - -2076049856 + -2076180416 133632 - 109199615 + 109199360 1 @@ -3821,6 +3884,7 @@ YES 1 + NO @@ -3829,12 +3893,12 @@ YES - 67239424 + 67108864 67108864 - 138690815 + 138690560 2 @@ -3845,6 +3909,7 @@ 200 25 + NO @@ -3854,13 +3919,13 @@ -1 YES - 67763712 + 67633152 134348800 Later -1 - -2038152961 + -2038153216 34 @@ -3869,6 +3934,7 @@ 200 25 + NO @@ -3878,13 +3944,13 @@ 1 YES - 67763712 + 67633152 134348800 Earlier 1 - -2038152961 + -2038153216 34 @@ -3893,6 +3959,7 @@ 200 25 + NO @@ -3901,7 +3968,7 @@ {0, 0} - 67239424 + 67108864 0 Box @@ -3923,7 +3990,7 @@ YES - 67239424 + 67108864 138543104 ... @@ -3931,6 +3998,7 @@ + NO @@ -3939,7 +4007,7 @@ YES - -2080244224 + -2080374784 131072 @@ -3967,6 +4035,7 @@ 1 + NO {{2, 2}, {132, 277}} @@ -3977,7 +4046,7 @@ {0, 0} - 67239424 + 67108864 0 Subtitle @@ -3999,7 +4068,7 @@ - 256 + 274 @@ -4008,7 +4077,7 @@ YES - 67501824 + 67371264 131072 @@ -4024,6 +4093,7 @@ NO NO + NO @@ -4032,12 +4102,12 @@ YES - 67239424 + 67108864 67108864 - 138690815 + 138690560 2 @@ -4048,6 +4118,7 @@ 200 25 + NO @@ -4056,7 +4127,7 @@ YES - 67239424 + 67108864 4325376 Play Speed: @@ -4064,6 +4135,7 @@ + NO @@ -4072,7 +4144,7 @@ YES - 67239424 + 67108864 272760832 ½x @@ -4083,6 +4155,7 @@ MC4wMDM2NDk2MzUgMCAwAA + NO @@ -4091,7 +4164,7 @@ YES - 67239424 + 67108864 272760832 1x @@ -4102,6 +4175,7 @@ MCAwIDAuMDAzNjQ5NjM1AA + NO @@ -4110,7 +4184,7 @@ YES - 67239424 + 67108864 272760832 2x @@ -4121,6 +4195,7 @@ MCAwIDAuMDAzNjQ5NjM1AA + NO @@ -4129,7 +4204,7 @@ YES - 67239424 + 67108864 272760832 3x @@ -4137,6 +4212,7 @@ + NO @@ -4145,7 +4221,7 @@ YES - 67239424 + 67108864 4325376 Range Repeat: @@ -4156,6 +4232,7 @@ MC4wMDM2NDk2MzUgMC4wMDM2NDk2MzUgMAA + NO @@ -4164,12 +4241,12 @@ YES - 67239424 + 67108864 67108864 - 138690815 + 138690560 2 @@ -4180,6 +4257,7 @@ 200 25 + NO @@ -4189,19 +4267,20 @@ -1 YES - 67239424 + 67108864 134348800 Begin -1 - -2038152961 + -2038153216 34 200 25 + NO @@ -4211,19 +4290,20 @@ 1 YES - 67239424 + 67108864 134348800 End 1 - -2038152961 + -2038153216 34 200 25 + NO @@ -4232,7 +4312,7 @@ YES - 67239424 + 67108864 138543104 --:--:-- @@ -4240,6 +4320,7 @@ + NO @@ -4248,7 +4329,7 @@ YES - 67239424 + 67108864 138543104 --:--:-- @@ -4256,6 +4337,7 @@ + NO {{2, 2}, {275, 70}} @@ -4266,7 +4348,7 @@ {0, 0} - 67239424 + 67108864 0 Playback @@ -4310,6 +4392,8 @@ {411, 187} YES + NO + YES 256 @@ -4330,7 +4414,7 @@ 20 1000 - 75628096 + 75497536 134219776 @@ -4346,7 +4430,7 @@ - 67239424 + 67108864 131072 @@ -4355,7 +4439,7 @@ 16 - 1215582719 + 1215582464 2 NSSwitch @@ -4373,7 +4457,7 @@ 8 1000 - 75628096 + 75497536 2048 Name @@ -4381,7 +4465,7 @@ - 69336641 + 69206081 133120 @@ -4403,7 +4487,7 @@ 10 3.4028234663852886e+38 - 75628096 + 75497536 134219776 Codec @@ -4416,7 +4500,7 @@ - 69336577 + 69206017 134348800 @@ -4433,7 +4517,7 @@ 26 1000 - 75628096 + 75497536 2048 Format @@ -4441,7 +4525,7 @@ - 69336641 + 69206081 133120 @@ -4472,6 +4556,7 @@ 0 YES 0 + 1 {{0, 17}, {411, 187}} @@ -4491,6 +4576,7 @@ -2147483392 {{400, 17}, {11, 187}} + NO 256 _doScroller: @@ -4501,6 +4587,7 @@ -2147483392 {{0, 193}, {400, 11}} + NO 257 _doScroller: @@ -4524,13 +4611,15 @@ {{16, 14}, {411, 204}} - 560 + 133680 - QSAAAEEgAABBmAAAQZgAAA + 0.25 + 4 + 1 @@ -4539,7 +4628,7 @@ YES - 67239488 + 67108928 4196864 Movie File name @@ -4548,6 +4637,7 @@ + NO @@ -4556,12 +4646,12 @@ YES - 67239424 + 67108864 0 - 141836543 + 141836288 32 @@ -4569,6 +4659,7 @@ 200 25 + NO @@ -4577,7 +4668,7 @@ YES - 67239488 + 67108928 71305728 Movie: @@ -4585,6 +4676,7 @@ + NO @@ -4593,7 +4685,7 @@ YES - 67239488 + 67108928 71305728 xx.xx / xx.xx @@ -4602,6 +4694,7 @@ + NO @@ -4610,7 +4703,7 @@ YES - 67239488 + 67108928 71305728 FPS: @@ -4618,6 +4711,7 @@ + NO @@ -4626,7 +4720,7 @@ YES - 67239488 + 67108928 4196864 xxx.xx MB, xxxx.xx kbps @@ -4635,6 +4729,7 @@ + NO @@ -4643,7 +4738,7 @@ YES - 67239488 + 67108928 71305728 Data: @@ -4651,6 +4746,7 @@ + NO {442, 310} @@ -4675,7 +4771,7 @@ YES - 67239424 + 67108864 134348800 Control Panel @@ -4683,6 +4779,7 @@ + NO @@ -4691,12 +4788,12 @@ YES - 67239424 + 67108864 0 - 141836543 + 141836288 32 NSImage @@ -4707,6 +4804,7 @@ 200 25 + NO @@ -4715,7 +4813,7 @@ YES - 67239424 + 67108864 0 @@ -4732,17 +4830,77 @@ -1 + NO {442, 355} - {{0, 0}, {1440, 878}} - {1e+13, 1e+13} + {{0, 0}, {1440, 900}} + {10000000000000, 10000000000000} ControlPanel + YES + + + + 256 + {125, 1} + + + + 256 + {125, 1} + + + terminate: + + + + 139 + + + + orderFrontStandardAboutPanel: + + + + 142 + + + + hideOtherApplications: + + + + 146 + + + + hide: + + + + 152 + + + + unhideAllApplications: + + + + 153 + + + + delegate + + + + 302 + performMiniaturize: @@ -4777,51 +4935,51 @@ - terminate: - - + performZoom: + + - 139 + 198 - orderFrontStandardAboutPanel: - - + selectAll: + + - 142 + 346 - hideOtherApplications: - - + copy: + + - 146 + 1288 - hide: - - + paste: + + - 152 + 1292 - unhideAllApplications: - - + cut: + + - 153 + 2793 - performZoom: + copy: - + - 198 + 2794 @@ -4831,14 +4989,6 @@ 249 - - - delegate - - - - 302 - fullScreenAction: @@ -4847,14 +4997,6 @@ 310 - - - _movieView - - - - 320 - _movieView @@ -4871,14 +5013,6 @@ 327 - - - selectAll: - - - - 346 - muteAction: @@ -4911,14 +5045,6 @@ 384 - - - _movieView - - - - 390 - _muteButton @@ -5031,14 +5157,6 @@ 450 - - - _movieView - - - - 468 - playlistAction: @@ -5071,14 +5189,6 @@ 537 - - - _titleTextField - - - - 546 - controlPanelAction: @@ -5303,14 +5413,6 @@ 660 - - - _appController - - - - 677 - seekAction: @@ -5439,14 +5541,6 @@ 1178 - - - performClose: - - - - 1181 - _reopenWithMenuItem @@ -5623,22 +5717,6 @@ 1287 - - - copy: - - - - 1288 - - - - paste: - - - - 1292 - _altSaveImageMenuItem @@ -5721,155 +5799,35 @@ - _videoBrightnessSlider - - + _propertiesView + + - 1439 + 1447 - - _videoSaturationSlider - - + + subtitleSyncAction: + + - 1440 + 1461 - - _videoContrastSlider - - + + subtitleSyncAction: + + - 1441 + 1462 - - _videoHueSlider - - + + subtitleSyncAction: + + - 1442 - - - - _playbackRateSlider - - - - 1443 - - - - _tabView - - - - 1444 - - - - _movieFilenameTextField - - - - 1445 - - - - _propertiesView - - - - 1447 - - - - videoColorControlsAction: - - - - 1453 - - - - videoColorControlsAction: - - - - 1454 - - - - videoColorControlsAction: - - - - 1455 - - - - videoColorControlsAction: - - - - 1456 - - - - videoColorControlsDefaultsAction: - - - - 1457 - - - - videoColorControlsDefaultsAction: - - - - 1458 - - - - videoColorControlsDefaultsAction: - - - - 1459 - - - - videoColorControlsDefaultsAction: - - - - 1460 - - - - subtitleSyncAction: - - - - 1461 - - - - subtitleSyncAction: - - - - 1462 - - - - subtitleSyncAction: - - - - 1463 + 1463 @@ -5935,30 +5893,6 @@ 1492 - - - dataSource - - - - 1493 - - - - delegate - - - - 1494 - - - - playbackRateAction: - - - - 1496 - _dataSizeBpsTextField @@ -5991,14 +5925,6 @@ 1520 - - - orderOut: - - - - 1521 - rangeRepeatAction: @@ -6183,38 +6109,6 @@ 1567 - - - _seekSlider - - - - 1568 - - - - _seekSlider - - - - 1569 - - - - _segmentedControl - - - - 1573 - - - - segmentedControlAction: - - - - 1575 - volumeAction: @@ -6881,27 +6775,243 @@ - cut: - - + subtitlePositionAction: + + - 2793 + 2899 + + + + _movieView + + + + 320 - copy: - - + performClose: + + - 2794 + 1181 + + + + _seekSlider + + + + 1568 + + + + _movieView + + + + 390 + + + + _titleTextField + + + + 546 + + + + _seekSlider + + + + 1569 + + + + _movieView + + + + 468 + + + + _appController + + + + 677 + + + + _videoBrightnessSlider + + + + 1439 + + + + _videoSaturationSlider + + + + 1440 + + + + _videoContrastSlider + + + + 1441 + + + + _videoHueSlider + + + + 1442 + + + + _playbackRateSlider + + + + 1443 + + + + _tabView + + + + 1444 + + + + _movieFilenameTextField + + + + 1445 - subtitlePositionAction: - - + videoColorControlsAction: + + - 2899 + 1453 + + + + videoColorControlsAction: + + + + 1454 + + + + videoColorControlsAction: + + + + 1455 + + + + videoColorControlsAction: + + + + 1456 + + + + videoColorControlsDefaultsAction: + + + + 1457 + + + + videoColorControlsDefaultsAction: + + + + 1458 + + + + videoColorControlsDefaultsAction: + + + + 1459 + + + + videoColorControlsDefaultsAction: + + + + 1460 + + + + playbackRateAction: + + + + 1496 + + + + orderOut: + + + + 1521 + + + + _segmentedControl + + + + 1573 + + + + segmentedControlAction: + + + + 1575 + + + + dataSource + + + + 1493 + + + + delegate + + + + 1494 @@ -8353,37 +8463,15 @@ 1185 - - - - 256 - {{2, 2}, {125, 1}} - - + - - 1186 - - - 1187 - - - - 256 - {{2, 2}, {125, 1}} - - + - - 1188 - - - 1327 @@ -9832,121 +9920,76 @@ + + 1186 + + + + + 1188 + + + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - HoverButton ToolTip @@ -9957,7 +10000,6 @@ com.apple.InterfaceBuilder.CocoaPlugin - HoverButton ToolTip @@ -9968,183 +10010,99 @@ com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - HUDTabView com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - HUDTableView com.apple.InterfaceBuilder.CocoaPlugin - HUDTableColumn com.apple.InterfaceBuilder.CocoaPlugin - HUDTextFieldCell com.apple.InterfaceBuilder.CocoaPlugin - HUDTableColumn com.apple.InterfaceBuilder.CocoaPlugin - HUDCheckBoxCell com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - HUDTableColumn com.apple.InterfaceBuilder.CocoaPlugin - HUDTextFieldCell com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - HUDTableColumn com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - HUDTextFieldCell com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - HoverButton ToolTip @@ -10155,7 +10113,6 @@ com.apple.InterfaceBuilder.CocoaPlugin - HoverButton ToolTip @@ -10166,294 +10123,241 @@ com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - MMovieView com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - FSSeekSlider com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - TimeTextField com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - ToolTip @@ -10463,12 +10367,9 @@ com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - MainSeekSlider com.apple.InterfaceBuilder.CocoaPlugin - HoverButton ToolTip @@ -10479,38 +10380,22 @@ com.apple.InterfaceBuilder.CocoaPlugin - TimeTextField com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - HoverButton ToolTip @@ -10521,95 +10406,51 @@ com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - TimeTextField com.apple.InterfaceBuilder.CocoaPlugin - TimeTextField com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - @@ -11479,8 +11320,8 @@ {20, 18} {18, 18} {18, 17} - {9, 8} - {7, 2} + {11, 11} + {10, 3} diff --git a/English.lproj/MainMenu.nib/keyedobjects.nib b/English.lproj/MainMenu.nib/keyedobjects.nib index 491649a..40f7750 100644 Binary files a/English.lproj/MainMenu.nib/keyedobjects.nib and b/English.lproj/MainMenu.nib/keyedobjects.nib differ diff --git a/FullScreener_Transition.m b/FullScreener_Transition.m index 709a2ac..0b9ffed 100644 --- a/FullScreener_Transition.m +++ b/FullScreener_Transition.m @@ -56,8 +56,9 @@ - (void)hideMainMenuAndDock else if (p.y < NSMinY(rc)) { // bottom-side dock p.y = NSMinY(rc) + margin; } - CGDisplayMoveCursorToPoint([_movieView displayID], - CGPointMake(p.x, NSMaxY(rc) - p.y)); + // TODO: fix +// CGDisplayMoveCursorToPoint([_movieView displayID], +// CGPointMake(p.x, NSMaxY(rc) - p.y)); } GetSystemUIMode(&_normalSystemUIMode, &_normalSystemUIOptions); if (_autoShowDock) { @@ -73,10 +74,8 @@ - (void)hideMainMenuAndDock - (void)attachMovieViewToFullWindow { [_mainWindow disableScreenUpdatesUntilFlush]; - [_movieView lockDraw]; [_movieView removeFromSuperviewWithoutNeedingDisplay]; [_fullWindow setMovieView:_movieView]; - [_movieView unlockDraw]; if ([_fullWindow level] == DesktopWindowLevel) { [_fullWindow orderBack:nil]; @@ -94,13 +93,10 @@ - (void)detachMovieViewFromFullWindow [_fullWindow orderOut:self]; // move _movieView to _mainWindow from _fullWindow - [_movieView lockDraw]; [_movieView removeFromSuperviewWithoutNeedingDisplay]; [[_mainWindow contentView] addSubview:_movieView]; [_movieView setFrame:_movieViewRect]; [_movieView updateMovieRect:FALSE]; - [_movieView unlockDraw]; - [_movieView display]; [_mainWindow makeFirstResponder:_movieView]; [_mainWindow makeKeyAndOrderFront:nil]; diff --git a/MMovie.m b/MMovie.m index 120b889..ce2b70a 100644 --- a/MMovie.m +++ b/MMovie.m @@ -22,6 +22,7 @@ #import "MMovie.h" #import "FFTrack.h" +#import // Needed to get the AVAssetTrack in the MTrack setEnabled: hack @implementation MTrack @@ -75,7 +76,15 @@ - (void)setAudioSampleRate:(float)rate { _audioSampleRate = rate; } - (BOOL)isEnabled { return [_impl isEnabled]; } - (void)setEnabled:(BOOL)enabled { - [_impl setEnabled:enabled]; + if([_impl isKindOfClass:[AVAssetTrack class]]) + { + // TODO: fix this + // Enabled state of AVAssetTrack is readonly + } + else + { + [_impl setEnabled:enabled]; + } if (enabled) { [_movie trackEnabled:self]; diff --git a/MMovieLayer.h b/MMovieLayer.h new file mode 100644 index 0000000..37aacbe --- /dev/null +++ b/MMovieLayer.h @@ -0,0 +1,16 @@ +// +// MMovieLayer.h +// Movist +// +// Created by Nur Monson on 2/16/13. +// +// + +#import + +@class MMovie; + +@protocol MMovieLayer +- (void)setMovie:(MMovie*)newMovie; +- (MMovie*)movie; +@end diff --git a/MMovieLayer_AVFoundation.h b/MMovieLayer_AVFoundation.h new file mode 100644 index 0000000..d319983 --- /dev/null +++ b/MMovieLayer_AVFoundation.h @@ -0,0 +1,21 @@ +// +// MMovieLayer_AVFoundation.h +// Movist +// +// Created by Nur Monson on 2/18/13. +// +// + +#import +#import "MMovieLayer.h" + +@class MMovie_QuickTime; + +@interface MMovieLayer_AVFoundation : AVPlayerLayer +{ + MMovie_QuickTime* _movie; +} + +- (void)setMovie:(MMovie_QuickTime*)newMovie; +- (MMovie*)movie; +@end diff --git a/MMovieLayer_AVFoundation.m b/MMovieLayer_AVFoundation.m new file mode 100644 index 0000000..03c3af6 --- /dev/null +++ b/MMovieLayer_AVFoundation.m @@ -0,0 +1,28 @@ +// +// MMovieLayer_AVFoundation.m +// Movist +// +// Created by Nur Monson on 2/18/13. +// +// + +#import "MMovieLayer_AVFoundation.h" +#import "MMovie_QuickTime.h" + +@implementation MMovieLayer_AVFoundation + +- (void)setMovie:(MMovie_QuickTime*)newMovie +{ + if(newMovie == _movie) + return; + [_movie release]; + _movie = [newMovie retain]; + self.player = [newMovie player]; +} + +- (MMovie*)movie +{ + return _movie; +} + +@end diff --git a/MMovieLayer_FFMPEG.h b/MMovieLayer_FFMPEG.h new file mode 100644 index 0000000..135e55d --- /dev/null +++ b/MMovieLayer_FFMPEG.h @@ -0,0 +1,40 @@ +// +// Movist +// +// This file is part of Movist. +// +// Movist is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 3 of the License, or +// (at your option) any later version. +// +// Movist is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// + +#import +#import +#import "MMovieLayer.h" + +@class MMovie_FFmpeg; + +@interface MMovieLayer_FFMPEG : NSOpenGLLayer +{ + BOOL _configured; + BOOL _movieNeedsGLContext; + MMovie_FFmpeg* _movie; + CVOpenGLTextureRef _image; + CIContext* _ciContext; + CVDisplayLinkRef _displayLink; + CGDirectDisplayID _displayID; +// NSRecursiveLock* _drawLock; +} + +- (void)setMovie:(MMovie_FFmpeg*)newMovie; +- (MMovie*)movie; +@end diff --git a/MMovieLayer_FFMPEG.m b/MMovieLayer_FFMPEG.m new file mode 100644 index 0000000..6b9af4a --- /dev/null +++ b/MMovieLayer_FFMPEG.m @@ -0,0 +1,216 @@ +// +// MMovieLayer_FFMPEG.m +// Movist +// +// Created by Nur Monson on 7/29/12. +// +// + +#import "MMovieLayer_FFMPEG.h" +#import "MMovie_FFMPEG.h" + +@interface MMovieLayer_FFMPEG () +- (void)configure; +- (CVReturn)updateImage:(const CVTimeStamp*)timeStamp; +@end + +static CVReturn displayLinkOutputCallback(CVDisplayLinkRef displayLink, + const CVTimeStamp* inNow, + const CVTimeStamp* inOutputTime, + CVOptionFlags flagsIn, + CVOptionFlags* flagsOut, + void* displayLinkContext) +{ + //TRACE(@"%s", __PRETTY_FUNCTION__); + return [(MMovieLayer_FFMPEG*)displayLinkContext updateImage:inOutputTime]; +} + +@implementation MMovieLayer_FFMPEG + +- (id)init +{ + if((self = [super init])) + { + [self setOpaque:YES]; + _configured = NO; + CGColorRef blue = CGColorCreateGenericRGB(0.0, 0.5, 1.0, 1.0); + self.backgroundColor = blue; + CGColorRelease(blue); + self.asynchronous = YES; + [self setNeedsDisplayOnBoundsChange:YES]; + + NSNotificationCenter* nc = [NSNotificationCenter defaultCenter]; + [nc addObserver:self selector:@selector(windowMoved:) + name:NSWindowDidMoveNotification object:self.view.window]; + + //[self initCoreVideo]; + } + return self; +} + +- (void)dealloc +{ + [self cleanupCoreVideo]; + CVOpenGLTextureRelease(_image); + [_ciContext release]; + [_movie release]; + + [super dealloc]; +} + +- (BOOL)initCoreVideo +{ + // TODO: not sure we can assume that the current display will be the main display on init + _displayID = CGMainDisplayID(); + CVReturn cvRet = CVDisplayLinkCreateWithCGDisplay(_displayID, &_displayLink); + if (cvRet != kCVReturnSuccess) { + //TRACE(@"CVDisplayLinkCreateWithCGDisplay() failed: %d", cvRet); + return FALSE; + } + CVDisplayLinkSetCurrentCGDisplayFromOpenGLContext(_displayLink, + [[self openGLContext] CGLContextObj], + [[self openGLPixelFormat] CGLPixelFormatObj]); + CVDisplayLinkSetOutputCallback(_displayLink, &displayLinkOutputCallback, self); + CVDisplayLinkStart(_displayLink); + return TRUE; +} + +- (void)cleanupCoreVideo +{ + if (_displayLink) + { + CVDisplayLinkStop(_displayLink); + CVDisplayLinkRelease(_displayLink); + } +} + +- (void)setMovie:(MMovie_FFmpeg*)newMovie +{ + if(newMovie == _movie) + return; + + [_movie release]; + _movie = [newMovie retain]; + _movieNeedsGLContext = YES; +} + +- (MMovie*)movie +{ + return _movie; +} + +- (void)reshape +{ +// //TRACE(@"%s", __PRETTY_FUNCTION__); +// [_drawLock lock]; +// +// NSRect bounds = [self bounds]; +// glViewport(0, 0, bounds.size.width, bounds.size.height); +// +// glMatrixMode(GL_PROJECTION); +// glLoadIdentity(); +// glOrtho(0, bounds.size.width, 0, bounds.size.height, -1.0f, 1.0f); +// +// glMatrixMode(GL_MODELVIEW); +// glLoadIdentity(); +// +// [_drawLock unlock]; +} + +- (CGDirectDisplayID)currentDisplayID +{ + NSDictionary* deviceDesc = [[self.view.window screen] deviceDescription]; + NSNumber* screenNumber = [deviceDesc objectForKey:@"NSScreenNumber"]; + + return (CGDirectDisplayID)[screenNumber intValue]; +} + +- (void)windowMoved:(NSNotification*)aNotification +{ + //TRACE(@"%s", __PRETTY_FUNCTION__); + CGDirectDisplayID displayID = [self currentDisplayID]; + if (displayID != _displayID) + { + CVDisplayLinkSetCurrentCGDisplay(_displayLink, displayID); + _displayID = displayID; + } +} + +- (void)configure +{ + // TODO: put this in copyCGLContextForPixelFormat: + CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); + NSDictionary* dict = [NSDictionary dictionaryWithObjectsAndKeys: + (id)colorSpace, kCIContextOutputColorSpace, + (id)colorSpace, kCIContextWorkingColorSpace, nil]; + _ciContext = [[CIContext contextWithCGLContext:[self.openGLContext CGLContextObj] + pixelFormat:[self.openGLPixelFormat CGLPixelFormatObj] + colorSpace:colorSpace + options:dict] retain]; + CGColorSpaceRelease(colorSpace); + + //GLint swapInterval = 1; + //[[self openGLContext] setValues:&swapInterval forParameter:NSOpenGLCPSwapInterval]; + glClearColor(0.0f, 0.0f, 0.0f, 1.0f); + + _configured = YES; +} + +- (CVReturn)updateImage:(const CVTimeStamp*)timeStamp +{ + if(timeStamp == NULL) + return kCVReturnSuccess; +// if([_drawLock tryLock]) + { + CVOpenGLTextureRef image = [_movie nextImage:timeStamp]; + if(image) + { + CVOpenGLTextureRelease(_image); + _image = image; + } +// [_drawLock unlock]; + } + + return kCVReturnSuccess; +} + +- (void)drawInCGLContext:(CGLContextObj)glContext pixelFormat:(CGLPixelFormatObj)pixelFormat forLayerTime:(CFTimeInterval)timeInterval displayTime:(const CVTimeStamp *)timeStamp +{ +// [_drawLock lock]; + + if(!_configured) + { + [self configure]; + } + if(_movieNeedsGLContext) + { + NSError* error; + if(![_movie setOpenGLContext:self.openGLContext pixelFormat:self.openGLPixelFormat error:&error]) + { + // TODO: return an bool FALSE and the NSError object + NSLog(@"error: %@", error); + } + _movieNeedsGLContext = NO; + } + + // since we're async and not using displaylink callbacks + [self updateImage:timeStamp]; + glClear(GL_COLOR_BUFFER_BIT); + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + glOrtho(0, self.bounds.size.width, 0, self.bounds.size.height, -1.0f, 1.0f); + + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + + if(_image) + { + CIImage* img = [CIImage imageWithCVImageBuffer:_image]; + [_ciContext drawImage:img inRect:self.bounds fromRect:CVImageBufferGetCleanRect(_image)]; + } + +// [[self openGLContext] flushBuffer]; +// [_drawLock unlock]; +} + +@end diff --git a/MMovieOSD.h b/MMovieOSD.h index 2e52f2e..c95e75b 100644 --- a/MMovieOSD.h +++ b/MMovieOSD.h @@ -60,7 +60,6 @@ float _autoSizeWidth; unsigned int _updateMask; // bit-mask of UPDATE_* NSImage* _texImage; // final rendered image for texture - GLuint _texName; // OpenGL texture name for _texImage // for convenience NSAttributedString* _string; diff --git a/MMovieOSD.m b/MMovieOSD.m index f17025b..2b1cc04 100644 --- a/MMovieOSD.m +++ b/MMovieOSD.m @@ -60,7 +60,6 @@ - (id)init _hMargin = _vMargin = 0.0; _updateMask = 0; - _texName = 0; _lock = [[NSRecursiveLock alloc] init]; } @@ -594,46 +593,6 @@ - (BOOL)setTexImage:(NSImage*)texImage return FALSE; } -- (void)makeTexture:(CGLContextObj)glContext -{ - //TRACE(@"%s", __PRETTY_FUNCTION__); - if (!glContext) { - return; - } - // at first, delete previous texture - if (_texName) { - (*glContext->disp.delete_textures)(glContext->rend, 1, &_texName); - _texName = 0; - } - - if (!_texImage) { - return; - } - - NSSize size = [_texImage size]; - NSBitmapImageRep* bmp = [[NSBitmapImageRep alloc] - initWithBitmapDataPlanes:0 - pixelsWide:(int)size.width pixelsHigh:(int)size.height - bitsPerSample:8 samplesPerPixel:4 hasAlpha:TRUE - isPlanar:FALSE colorSpaceName:NSCalibratedRGBColorSpace - bitmapFormat:0 bytesPerRow:(int)size.width * 4 bitsPerPixel:32]; - - [NSGraphicsContext saveGraphicsState]; - [NSGraphicsContext setCurrentContext: - [NSGraphicsContext graphicsContextWithBitmapImageRep:bmp]]; - - [_texImage drawAtPoint:NSMakePoint(0,0) fromRect:NSZeroRect - operation:NSCompositeCopy fraction:1.0]; - - [NSGraphicsContext restoreGraphicsState]; - - // make texture - glGenTextures(1, &_texName); - glBindTexture(GL_TEXTURE_RECTANGLE_EXT, _texName); - glTexImage2D(GL_TEXTURE_RECTANGLE_EXT, 0, GL_RGBA, size.width, size.height, - 0, GL_RGBA, GL_UNSIGNED_BYTE, [bmp bitmapData]); - [bmp release]; -} - (void)updateDrawingRect { @@ -752,19 +711,6 @@ - (void)drawOnScreen _updateMask &= ~UPDATE_DRAWING_RECT; [self updateDrawingRect]; } - - if (_texName) { - glBindTexture(GL_TEXTURE_RECTANGLE_EXT, _texName); - glBegin(GL_QUADS); - NSSize size = [_texImage size]; - float minX = NSMinX(_drawingRect), maxX = NSMaxX(_drawingRect); - float minY = NSMinY(_drawingRect), maxY = NSMaxY(_drawingRect); - glTexCoord2f(0.0, 0.0); glVertex2f(minX, minY); // TL - glTexCoord2f(0.0, size.height); glVertex2f(minX, maxY); // BL - glTexCoord2f(size.width, size.height); glVertex2f(maxX, maxY); // TR - glTexCoord2f(size.width, 0.0); glVertex2f(maxX, minY); // BR - glEnd(); - } } @end diff --git a/MMovieView.h b/MMovieView.h index af1726f..8d3e790 100644 --- a/MMovieView.h +++ b/MMovieView.h @@ -27,18 +27,16 @@ @class MMovie; @class MSubtitle; @class MMovieOSD; +@protocol MMovieLayer; -@interface MMovieView : NSOpenGLView +@interface MMovieView : NSView { - CVDisplayLinkRef _displayLink; - CGDirectDisplayID _displayID; + CGDirectDisplayID _displayID; NSRecursiveLock* _drawLock; - CIContext* _ciContext; CIFilter* _colorFilter; CIFilter* _hueFilter; CIFilter* _cropFilter; // for removing green box - CVOpenGLTextureRef _image; NSSize _movieSize; CGRect _movieRect; CGRect _imageRect; @@ -47,7 +45,9 @@ float _contrastValue; float _hueValue; - MMovie* _movie; + CALayer* _movieLayer; + CALayer* _rootLayer; + CALayer* _iconOSDLayer; // subtitle MSubtitle* _subtitle[3]; @@ -96,13 +96,13 @@ //////////////////////////////////////////////////////////////////////////////// #pragma mark - -- (void)lockDraw; -- (void)unlockDraw; - (void)redisplay; - - (MMovie*)movie; - (float)currentFps; - (void)setMovie:(MMovie*)movie; +// TODO: remove these. They're just here to ease the CoreAnimation conversion process +- (NSOpenGLContext*)openGLContext; +- (NSOpenGLPixelFormat*)pixelFormat; @end @@ -113,8 +113,6 @@ - (CGDirectDisplayID)displayID; -- (BOOL)initCoreVideo; -- (void)cleanupCoreVideo; - (CVReturn)updateImage:(const CVTimeStamp*)timeStamp; - (void)drawImage; @@ -154,7 +152,6 @@ - (void)cleanupOSD; - (void)drawOSD; -- (void)drawDragHighlight; - (void)clearOSD; - (void)updateOSDImageBaseWidth; diff --git a/MMovieView.m b/MMovieView.m index 4097657..f8b15bd 100644 --- a/MMovieView.m +++ b/MMovieView.m @@ -23,6 +23,9 @@ #import "MMovieView.h" #import "MMovie.h" +#import "MMovie_QuickTime.h" +#import "MMovieLayer_FFMPEG.h" +#import "MMovieLayer_AVFoundation.h" #import "MSubtitle.h" #import "MMovieOSD.h" @@ -34,10 +37,6 @@ @implementation MMovieView - (void)awakeFromNib { //TRACE(@"%s", __PRETTY_FUNCTION__); - if (![self initCoreVideo]) { - // FIXME: alert... - return; - } _drawLock = [[NSRecursiveLock alloc] init]; if (![self initCoreImage]) { @@ -67,6 +66,26 @@ - (void)awakeFromNib name:NSWindowDidMoveNotification object:[self window]]; [nc addObserver:self selector:@selector(frameResized:) name:NSViewFrameDidChangeNotification object:self]; + + // add layer + _rootLayer = [CALayer layer]; + CGColorRef orange = CGColorCreateGenericRGB(1.0, 0.5, 0.0, 1.0); + CGColorRef lightBlue = CGColorCreateGenericRGB(0.0, 0.5, 1.0, 1.0); + _rootLayer.backgroundColor = orange; + _rootLayer.layoutManager = [CAConstraintLayoutManager layoutManager]; + _rootLayer.borderColor = lightBlue; + CGColorRelease(lightBlue); + CGColorRelease(orange); + [self setLayer:_rootLayer]; + [self setWantsLayer:YES]; + + _iconOSDLayer = [CALayer layer]; + _iconOSDLayer.zPosition = 1.0; + [_iconOSDLayer addConstraint:[CAConstraint constraintWithAttribute:kCAConstraintMinY relativeTo:@"superlayer" attribute:kCAConstraintMinY offset:0.0]]; + [_iconOSDLayer addConstraint:[CAConstraint constraintWithAttribute:kCAConstraintMaxY relativeTo:@"superlayer" attribute:kCAConstraintMaxY offset:0.0]]; + [_iconOSDLayer addConstraint:[CAConstraint constraintWithAttribute:kCAConstraintMinX relativeTo:@"superlayer" attribute:kCAConstraintMinX offset:0.0]]; + [_iconOSDLayer addConstraint:[CAConstraint constraintWithAttribute:kCAConstraintMaxX relativeTo:@"superlayer" attribute:kCAConstraintMaxX offset:0.0]]; + [_rootLayer addSublayer:_iconOSDLayer]; } - (void)dealloc @@ -74,14 +93,12 @@ - (void)dealloc //TRACE(@"%s", __PRETTY_FUNCTION__); [self invalidateMessageHideTimer]; [self cleanupCoreImage]; - [self cleanupCoreVideo]; [_drawLock release]; [self cleanupOSD]; [_subtitle[0] release]; [_subtitle[1] release]; [_subtitle[2] release]; - [_movie release]; [[NSNotificationCenter defaultCenter] removeObserver:self]; @@ -90,85 +107,29 @@ - (void)dealloc //////////////////////////////////////////////////////////////////////////////// #pragma mark - -#pragma mark OpenGL -- (void)prepareOpenGL -{ - //TRACE(@"%s", __PRETTY_FUNCTION__); - glClearColor(0.0f, 0.0f, 0.0f, 1.0f); - - GLint swapInterval = 1; - [[self openGLContext] setValues:&swapInterval forParameter:NSOpenGLCPSwapInterval]; - /* - const GLubyte* strVersion = glGetString(GL_VERSION); - const GLubyte* strExt = glGetString(GL_EXTENSIONS); - TRACE(@"GL_VERSION = \"%s\"", strVersion); - TRACE(@"GL_EXTENSIONS = \"%s\"", strExt); - - GLboolean b; - b = gluCheckExtension((const GLubyte*)"GL_EXT_framebuffer_object", strExt); - TRACE(@"FBO = %d", b); - - b = gluCheckExtension((const GLubyte*)"GL_APPLE_vertex_array_object", strExt); - TRACE(@"VAO = %d", b); - - b = gluCheckExtension((const GLubyte*)"GL_APPLE_fence", strExt); - TRACE(@"fence = %d", b); - - b = gluCheckExtension((const GLubyte*)"GL_ARB_shading_language_100", strExt); - TRACE(@"shading = %d", b); - */ -} +- (void)redisplay { [self setNeedsDisplay:TRUE]; } -- (void)update +// TODO: remove these. They're just here to ease the CoreAnimation conversion process +- (NSOpenGLContext*)openGLContext { - //TRACE(@"%s", __PRETTY_FUNCTION__); - [_drawLock lock]; - - [super update]; - - [_drawLock unlock]; -} - -- (void)reshape -{ - //TRACE(@"%s", __PRETTY_FUNCTION__); - [_drawLock lock]; - - NSRect bounds = [self bounds]; - glViewport(0, 0, bounds.size.width, bounds.size.height); - - glMatrixMode(GL_PROJECTION); - glLoadIdentity(); - glOrtho(0, bounds.size.width, 0, bounds.size.height, -1.0f, 1.0f); - - glMatrixMode(GL_MODELVIEW); - glLoadIdentity(); - - [_drawLock unlock]; + if([_movieLayer isKindOfClass:[CAOpenGLLayer class]]) + return [(NSOpenGLLayer*)_movieLayer openGLContext]; + return nil; } -- (void)drawRect:(NSRect)rect +- (NSOpenGLPixelFormat*)pixelFormat { - //TRACE(@"%s %@", __PRETTY_FUNCTION__, NSStringFromRect(rect)); - if ([_drawLock tryLock]) { - [self drawImage]; - [_drawLock unlock]; - } + if([_movieLayer isKindOfClass:[CAOpenGLLayer class]]) + return [(NSOpenGLLayer*)_movieLayer openGLPixelFormat]; + return nil; } -- (void)lockDraw { [_drawLock lock]; } -- (void)unlockDraw { [_drawLock unlock]; } -- (void)redisplay { [self setNeedsDisplay:TRUE]; } - -- (BOOL)isOpaque { return TRUE; } -- (BOOL)wantsDefaultClipping { return FALSE; } - //////////////////////////////////////////////////////////////////////////////// #pragma mark - #pragma mark movie -- (MMovie*)movie { return _movie; } +- (MMovie*)movie { return [_movieLayer movie]; } - (float)currentFps { return _currentFps; } - (void)setMovie:(MMovie*)movie @@ -176,21 +137,30 @@ - (void)setMovie:(MMovie*)movie //TRACE(@"%s %@", __PRETTY_FUNCTION__, movie); [_drawLock lock]; - [movie retain], [_movie release], _movie = movie; - [self removeAllSubtitles]; - if (_image) { - CVOpenGLTextureRelease(_image); - _image = nil; - } + [_movieLayer removeFromSuperlayer]; + _movieLayer = nil; + + Class c = [movie class]; + if(c == [MMovie_QuickTime class]) + { + // use AVPlayerLayer + _movieLayer = [[MMovieLayer_AVFoundation alloc] init]; + } + else + { + _movieLayer = [[MMovieLayer_FFMPEG alloc] init]; + } + [_movieLayer setName:@"Movie"]; + // TODO: preserve proper aspect ratio. Probably need to use our own layoutmanager + [_movieLayer addConstraint:[CAConstraint constraintWithAttribute:kCAConstraintMinY relativeTo:@"superlayer" attribute:kCAConstraintMinY offset:0.0]]; + [_movieLayer addConstraint:[CAConstraint constraintWithAttribute:kCAConstraintMaxY relativeTo:@"superlayer" attribute:kCAConstraintMaxY offset:0.0]]; + [_movieLayer addConstraint:[CAConstraint constraintWithAttribute:kCAConstraintMinX relativeTo:@"superlayer" attribute:kCAConstraintMinX offset:0.0]]; + [_movieLayer addConstraint:[CAConstraint constraintWithAttribute:kCAConstraintMaxX relativeTo:@"superlayer" attribute:kCAConstraintMaxX offset:0.0]]; + [_rootLayer addSublayer:[_movieLayer autorelease]]; + [_movieLayer setMovie:movie]; - if (_movie) { - NSSize es = [_movie encodedSize]; - CIVector* vector = [CIVector vectorWithX:1.0 Y:1.0 - Z:es.width - 2.0 W:es.height - 2.0]; - [_cropFilter setValue:vector forKey:@"inputRectangle"]; - [self updateRemoveGreenBox]; - } - [self clearOSD]; + [self removeAllSubtitles]; + [self clearOSD]; [self updateOSDImageBaseWidth]; [self updateLetterBoxHeight]; [self updateMovieRect:TRUE]; @@ -219,7 +189,7 @@ - (void)keyDown:(NSEvent*)event break; case NSCarriageReturnCharacter : // return : toggle full-screen case NSEnterCharacter : // enter (in keypad) - if (_movie) { + if ([_movieLayer movie]) { [[NSApp delegate] fullScreenAction:self]; } break; @@ -230,7 +200,7 @@ - (void)keyDown:(NSEvent*)event else if ([[NSApp delegate] isDesktopBackground]) { [[NSApp delegate] desktopBackgroundAction:self]; } - else if (_movie) { + else if ([_movieLayer movie]) { [[NSApp delegate] closeMovie]; [self showLogo]; } @@ -258,7 +228,7 @@ - (void)keyDown:(NSEvent*)event case '.' : case '>' : [[NSApp delegate] changeSubtitleSync:+1 atIndex:0]; break; case '/' : case '?' : [[NSApp delegate] changeSubtitleSync: 0 atIndex:0]; break; - case 'm' : case 'M' : [[NSApp delegate] setMuted:![_movie muted]]; break; + case 'm' : case 'M' : [[NSApp delegate] setMuted:![[_movieLayer movie] muted]]; break; case 'i' : case 'I' : [self saveCurrentImage:shiftPressed]; break; } @@ -297,7 +267,6 @@ - (void)windowMoved:(NSNotification*)aNotification NSNumber* screenNumber = [deviceDesc objectForKey:@"NSScreenNumber"]; CGDirectDisplayID displayID = (CGDirectDisplayID)[screenNumber intValue]; if (displayID && displayID != _displayID) { - CVDisplayLinkSetCurrentCGDisplay(_displayLink, displayID); _displayID = displayID; TRACE(@"main window moved: display changed"); [self updateLetterBoxHeight]; diff --git a/MMovieView_Image.m b/MMovieView_Image.m index 692413f..8a91355 100644 --- a/MMovieView_Image.m +++ b/MMovieView_Image.m @@ -26,17 +26,6 @@ #import "MSubtitle.h" #import "AppController.h" // for NSApp's delegate -static CVReturn displayLinkOutputCallback(CVDisplayLinkRef displayLink, - const CVTimeStamp* inNow, - const CVTimeStamp* inOutputTime, - CVOptionFlags flagsIn, - CVOptionFlags* flagsOut, - void* displayLinkContext) -{ - //TRACE(@"%s", __PRETTY_FUNCTION__); - return [(MMovieView*)displayLinkContext updateImage:inOutputTime]; -} - //////////////////////////////////////////////////////////////////////////////// #pragma mark - @@ -44,81 +33,53 @@ @implementation MMovieView (Image) - (CGDirectDisplayID)displayID { return _displayID; } -- (BOOL)initCoreVideo -{ - _displayID = CGMainDisplayID(); - CVReturn cvRet = CVDisplayLinkCreateWithCGDisplay(_displayID, &_displayLink); - if (cvRet != kCVReturnSuccess) { - //TRACE(@"CVDisplayLinkCreateWithCGDisplay() failed: %d", cvRet); - return FALSE; - } - CVDisplayLinkSetCurrentCGDisplayFromOpenGLContext(_displayLink, - [[self openGLContext] CGLContextObj], - [[self pixelFormat] CGLPixelFormatObj]); - CVDisplayLinkSetOutputCallback(_displayLink, &displayLinkOutputCallback, self); - CVDisplayLinkStart(_displayLink); - return TRUE; -} - -- (void)cleanupCoreVideo -{ - if (_displayLink) { - CVDisplayLinkStop(_displayLink); - CVDisplayLinkRelease(_displayLink); - } - if (_image) { - CVOpenGLTextureRelease(_image); - _image = nil; - } -} - - (CVReturn)updateImage:(const CVTimeStamp*)timeStamp { //TRACE(@"%s", __PRETTY_FUNCTION__); NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init]; if ([_drawLock tryLock]) { - if (_movie) { - CVOpenGLTextureRef image = [_movie nextImage:timeStamp]; - if (image) { - if (_image) { - CVOpenGLTextureRelease(_image); - } - _image = image; - if (_subtitleVisible) { - [self updateSubtitleOSDAtIndex:0]; - [self updateSubtitleOSDAtIndex:1]; - [self updateSubtitleOSDAtIndex:2]; - } - if ([self canDraw]) { - [self drawImage]; - } - _fpsFrameCount++; - } - else if (_image && _subtitleVisible && _needsSubtitleDrawing) { - if (_needsSubtitleDrawing & 0x01) { - [self updateSubtitleOSDAtIndex:0]; - } - if (_needsSubtitleDrawing & 0x02) { - [self updateSubtitleOSDAtIndex:1]; - } - if (_needsSubtitleDrawing & 0x04) { - [self updateSubtitleOSDAtIndex:2]; - } - if ([self canDraw]) { - [self drawImage]; - } - } - // calc. fps - double ct = (double)timeStamp->videoTime / timeStamp->videoTimeScale; - _fpsElapsedTime += ABS(ct - _lastFpsCheckTime); - _lastFpsCheckTime = ct; - if (1.0 <= _fpsElapsedTime) { - _currentFps = (float)(_fpsFrameCount / _fpsElapsedTime); - _fpsElapsedTime = 0.0; - _fpsFrameCount = 0; - } - } +// if (_movie) { +// CVOpenGLTextureRef image = [_movie nextImage:timeStamp]; +// if (image) { +// if (_image) { +// CVOpenGLTextureRelease(_image); +// } +// _image = image; +// if (_subtitleVisible) { +// [self updateSubtitleOSDAtIndex:0]; +// [self updateSubtitleOSDAtIndex:1]; +// [self updateSubtitleOSDAtIndex:2]; +// } +// if ([self canDraw]) { +// [self drawImage]; +// } +// _fpsFrameCount++; +// } +// else if (_image && _subtitleVisible && _needsSubtitleDrawing) { +// if (_needsSubtitleDrawing & 0x01) { +// [self updateSubtitleOSDAtIndex:0]; +// } +// if (_needsSubtitleDrawing & 0x02) { +// [self updateSubtitleOSDAtIndex:1]; +// } +// if (_needsSubtitleDrawing & 0x04) { +// [self updateSubtitleOSDAtIndex:2]; +// } +// if ([self canDraw]) { +// [self drawImage]; +// } +// } +// // calc. fps +// double ct = (double)timeStamp->videoTime / timeStamp->videoTimeScale; +// _fpsElapsedTime += ABS(ct - _lastFpsCheckTime); +// _lastFpsCheckTime = ct; +// if (1.0 <= _fpsElapsedTime) { +// _currentFps = (float)(_fpsFrameCount / _fpsElapsedTime); +// _fpsElapsedTime = 0.0; +// _fpsFrameCount = 0; +// } +// } [_drawLock unlock]; } @@ -129,102 +90,96 @@ - (CVReturn)updateImage:(const CVTimeStamp*)timeStamp - (void)updateImageRect { - assert(_image != 0); - _imageRect = CVImageBufferGetCleanRect(_image); - if (_removeGreenBox) { - _imageRect.origin.x++, _imageRect.size.width -= 2; - _imageRect.origin.y++, _imageRect.size.height -= 2; - } - - if ([[NSApp delegate] isFullScreen] && _fullScreenFill == FS_FILL_CROP) { - NSSize bs = [self bounds].size; - NSSize ms = [_movie adjustedSizeByAspectRatio]; - if (bs.width / bs.height < ms.width / ms.height) { - float mw = ms.width * bs.height / ms.height; - float dw = (mw - bs.width) * ms.width / mw; - _imageRect.origin.x += dw / 2; - _imageRect.size.width -= dw; - } - else { - float mh = ms.height * bs.width / ms.width; - float dh = (mh - bs.height) * ms.height / mh; - _imageRect.origin.y += dh / 2; - _imageRect.size.height -= dh; - } - } +// assert(_image != 0); +// _imageRect = CVImageBufferGetCleanRect(_image); +// if (_removeGreenBox) { +// _imageRect.origin.x++, _imageRect.size.width -= 2; +// _imageRect.origin.y++, _imageRect.size.height -= 2; +// } +// +// if ([[NSApp delegate] isFullScreen] && _fullScreenFill == FS_FILL_CROP) { +// NSSize bs = [self bounds].size; +// NSSize ms = [self.movie adjustedSizeByAspectRatio]; +// if (bs.width / bs.height < ms.width / ms.height) { +// float mw = ms.width * bs.height / ms.height; +// float dw = (mw - bs.width) * ms.width / mw; +// _imageRect.origin.x += dw / 2; +// _imageRect.size.width -= dw; +// } +// else { +// float mh = ms.height * bs.width / ms.width; +// float dh = (mh - bs.height) * ms.height / mh; +// _imageRect.origin.y += dh / 2; +// _imageRect.size.height -= dh; +// } +// } //TRACE(@"_imageRect=%@", NSStringFromRect(*(NSRect*)&_imageRect)); } - (void)drawImage { - [[self openGLContext] makeCurrentContext]; - if (!_image) { - glClear(GL_COLOR_BUFFER_BIT); - } - else { + return; + + { if (_imageRect.size.width == 0) { [self updateImageRect]; } // draw image - CIImage* img = [CIImage imageWithCVImageBuffer:_image]; - if (_removeGreenBox) { - [_cropFilter setValue:img forKey:@"inputImage"]; - img = [_cropFilter valueForKey:@"outputImage"]; - } - if (_brightnessValue != DEFAULT_BRIGHTNESS || - _saturationValue != DEFAULT_SATURATION || - _contrastValue != DEFAULT_CONTRAST) { - [_colorFilter setValue:img forKey:@"inputImage"]; - img = [_colorFilter valueForKey:@"outputImage"]; - } - if (_hueValue != DEFAULT_HUE) { - [_hueFilter setValue:img forKey:@"inputImage"]; - img = [_hueFilter valueForKey:@"outputImage"]; - } - [_ciContext drawImage:img inRect:_movieRect fromRect:_imageRect]; +// CIImage* img = [CIImage imageWithCVImageBuffer:_image]; +// if (_removeGreenBox) { +// [_cropFilter setValue:img forKey:@"inputImage"]; +// img = [_cropFilter valueForKey:@"outputImage"]; +// } +// if (_brightnessValue != DEFAULT_BRIGHTNESS || +// _saturationValue != DEFAULT_SATURATION || +// _contrastValue != DEFAULT_CONTRAST) { +// [_colorFilter setValue:img forKey:@"inputImage"]; +// img = [_colorFilter valueForKey:@"outputImage"]; +// } +// if (_hueValue != DEFAULT_HUE) { +// [_hueFilter setValue:img forKey:@"inputImage"]; +// img = [_hueFilter valueForKey:@"outputImage"]; +// } +// [_ciContext drawImage:img inRect:_movieRect fromRect:_imageRect]; // clear extra area - NSRect bounds = [self bounds]; - if (NSMinX(bounds) != CGRectGetMinX(_movieRect) || - NSMinY(bounds) != CGRectGetMinY(_movieRect) || - NSMaxX(bounds) != CGRectGetMaxX(_movieRect) || - NSMaxY(bounds) != CGRectGetMaxY(_movieRect)) { - glColor3f(0.0f, 0.0f, 0.0f); - glBegin(GL_QUADS); - float vl = NSMinX(bounds), vr = NSMaxX(bounds); - float vb = NSMinY(bounds), vt = NSMaxY(bounds); - float rl = CGRectGetMinX(_movieRect); - float rr = CGRectGetMaxX(_movieRect); - float rb = CGRectGetMinY(_movieRect); - float rt = CGRectGetMaxY(_movieRect); - if (bounds.size.height != _movieRect.size.height) { - // lower letter-box - glVertex2f(vl, vb), glVertex2f(vl, rb); - glVertex2f(vr, rb), glVertex2f(vr, vb); - // upper letter-box - glVertex2f(vl, rt), glVertex2f(vl, vt); - glVertex2f(vr, vt), glVertex2f(vr, rt); - } - if (bounds.size.width != _movieRect.size.width) { - // left area - glVertex2f(vl, rb), glVertex2f(vl, rt); - glVertex2f(rl, rt), glVertex2f(rl, rb); - // right area - glVertex2f(rr, rb), glVertex2f(rr, rt); - glVertex2f(vr, rt), glVertex2f(vr, rb); - } - glEnd(); - glColor3f(1.0f, 1.0f, 1.0f); - } +// NSRect bounds = [self bounds]; +// if (NSMinX(bounds) != CGRectGetMinX(_movieRect) || +// NSMinY(bounds) != CGRectGetMinY(_movieRect) || +// NSMaxX(bounds) != CGRectGetMaxX(_movieRect) || +// NSMaxY(bounds) != CGRectGetMaxY(_movieRect)) { +// glColor3f(0.0f, 0.0f, 0.0f); +// glBegin(GL_QUADS); +// float vl = NSMinX(bounds), vr = NSMaxX(bounds); +// float vb = NSMinY(bounds), vt = NSMaxY(bounds); +// float rl = CGRectGetMinX(_movieRect); +// float rr = CGRectGetMaxX(_movieRect); +// float rb = CGRectGetMinY(_movieRect); +// float rt = CGRectGetMaxY(_movieRect); +// if (bounds.size.height != _movieRect.size.height) { +// // lower letter-box +// glVertex2f(vl, vb), glVertex2f(vl, rb); +// glVertex2f(vr, rb), glVertex2f(vr, vb); +// // upper letter-box +// glVertex2f(vl, rt), glVertex2f(vl, vt); +// glVertex2f(vr, vt), glVertex2f(vr, rt); +// } +// if (bounds.size.width != _movieRect.size.width) { +// // left area +// glVertex2f(vl, rb), glVertex2f(vl, rt); +// glVertex2f(rl, rt), glVertex2f(rl, rb); +// // right area +// glVertex2f(rr, rb), glVertex2f(rr, rt); +// glVertex2f(vr, rt), glVertex2f(vr, rb); +// } +// glEnd(); +// glColor3f(1.0f, 1.0f, 1.0f); +// } } [self drawOSD]; - if (_dragAction != DRAG_ACTION_NONE) { - [self drawDragHighlight]; - } - [[self openGLContext] flushBuffer]; - [_movie idleTask]; + [self.movie idleTask]; } //////////////////////////////////////////////////////////////////////////////// @@ -233,16 +188,6 @@ - (void)drawImage - (BOOL)initCoreImage { - CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); - NSDictionary* dict = [NSDictionary dictionaryWithObjectsAndKeys: - (id)colorSpace, kCIContextOutputColorSpace, - (id)colorSpace, kCIContextWorkingColorSpace, nil]; - _ciContext = [[CIContext contextWithCGLContext:[[self openGLContext] CGLContextObj] - pixelFormat:[[self pixelFormat] CGLPixelFormatObj] - colorSpace:colorSpace - options:dict] retain]; - CGColorSpaceRelease(colorSpace); - _colorFilter = [[CIFilter filterWithName:@"CIColorControls"] retain]; _hueFilter = [[CIFilter filterWithName:@"CIHueAdjust"] retain]; _cropFilter = [[CIFilter filterWithName:@"CICrop"] retain]; @@ -262,7 +207,6 @@ - (void)cleanupCoreImage [_cropFilter release]; [_hueFilter release]; [_colorFilter release]; - [_ciContext release]; } //////////////////////////////////////////////////////////////////////////////// @@ -284,7 +228,7 @@ - (void)updateMovieRect:(BOOL)display bounds.size.height-= _subtitleScreenMargin * 2; } - if (!_movie) { + if (!self.movie) { [_iconOSD setViewBounds:bounds movieRect:bounds autoSizeWidth:0]; [_messageOSD setViewBounds:bounds movieRect:bounds autoSizeWidth:0]; } @@ -351,7 +295,7 @@ - (NSRect)_calcMovieRectForBoundingRect:(NSRect)boundingRect rect.origin = boundingRect.origin; NSSize bs = boundingRect.size; - NSSize ms = [_movie adjustedSizeByAspectRatio]; + NSSize ms = [self.movie adjustedSizeByAspectRatio]; if (bs.width / bs.height < ms.width / ms.height) { rect.size.width = bs.width; rect.size.height = rect.size.width * ms.height / ms.width; @@ -491,7 +435,7 @@ - (void)setRemoveGreenBox:(BOOL)remove - (void)updateRemoveGreenBox { // needs for QuickTime only. - _removeGreenBox = [_movie isMemberOfClass:[MMovie_QuickTime class]] ? + _removeGreenBox = [self.movie isMemberOfClass:[MMovie_QuickTime class]] ? _removeGreenBoxSetting : FALSE; [self updateMovieRect:TRUE]; } diff --git a/MMovieView_OSD.m b/MMovieView_OSD.m index 8814af0..6c89a6c 100644 --- a/MMovieView_OSD.m +++ b/MMovieView_OSD.m @@ -94,21 +94,6 @@ - (void)cleanupOSD - (void)drawOSD { //TRACE(@"%s", __PRETTY_FUNCTION__); - // set OpenGL states - glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA); - glEnable(GL_BLEND); - glEnable(GL_TEXTURE_RECTANGLE_EXT); - - glMatrixMode(GL_PROJECTION); - glPushMatrix(); - glLoadIdentity(); - glMatrixMode(GL_MODELVIEW); - glPushMatrix(); - glLoadIdentity(); - NSRect frame = [self frame]; - glScalef(2.0f / frame.size.width, -2.0f / frame.size.height, 1.0f); - glTranslatef(-frame.size.width / 2.0f, -frame.size.height / 2.0f, 0.0f); - if ([_iconOSD hasContent]) { [_iconOSD drawOnScreen]; } @@ -129,45 +114,6 @@ - (void)drawOSD if ([_errorOSD hasContent]) { [_errorOSD drawOnScreen]; } - - // restore OpenGL status - glPopMatrix(); // GL_MODELVIEW - glMatrixMode(GL_PROJECTION); - glPopMatrix(); - glMatrixMode(GL_MODELVIEW); - - glDisable(GL_TEXTURE_RECTANGLE_EXT); - glDisable(GL_BLEND); -} - -- (void)drawDragHighlight -{ - //TRACE(@"%s", __PRETTY_FUNCTION__); - glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA); - glEnable(GL_BLEND); - - NSRect rect = [self bounds]; - float x1 = NSMinX(rect), y1 = NSMinY(rect); - float x2 = NSMaxX(rect), y2 = NSMaxY(rect); - float w = 8.0; - glColor4f(0.0, 0.0, 1.0, 0.25); - glBegin(GL_QUADS); - // bottom - glVertex2f(x1, y1); glVertex2f(x2, y1); - glVertex2f(x2, y1 + w); glVertex2f(x1, y1 + w); - // right - glVertex2f(x2 - w, y1 + w); glVertex2f(x2, y1 + w); - glVertex2f(x2, y2 - w); glVertex2f(x2 - w, y2 - w); - // top - glVertex2f(x1, y2 - w); glVertex2f(x2, y2 - w); - glVertex2f(x2, y2); glVertex2f(x1, y2); - // left - glVertex2f(x1, y1 + w); glVertex2f(x1 + w, y1 + w); - glVertex2f(x1 + w, y2 - w); glVertex2f(x1, y2 - w); - glEnd(); - glColor3f(1.0, 1.0, 1.0); - - glDisable(GL_BLEND); } - (void)clearOSD @@ -181,7 +127,7 @@ - (void)clearOSD - (void)updateOSDImageBaseWidth { - float width = (_movie) ? [_movie adjustedSizeByAspectRatio].width : 0; + float width = (self.movie) ? [self.movie adjustedSizeByAspectRatio].width : 0; [_subtitleOSD[0] setImageBaseWidth:width]; [_subtitleOSD[1] setImageBaseWidth:width]; [_subtitleOSD[2] setImageBaseWidth:width]; diff --git a/MMovieView_Subtitle.m b/MMovieView_Subtitle.m index 8a76251..29a3c65 100644 --- a/MMovieView_Subtitle.m +++ b/MMovieView_Subtitle.m @@ -21,6 +21,7 @@ // #import "MMovieView.h" +#import "MMovieLayer.h" #import "MMovie.h" #import "MSubtitle.h" @@ -127,15 +128,15 @@ - (BOOL)updateSubtitleOSDAtIndex:(int)index { BOOL ret = TRUE; [_drawLock lock]; - if (!_movie || !_subtitle[index] || ![_subtitle[index] isEnabled]) { + if (!self.movie || !_subtitle[index] || ![_subtitle[index] isEnabled]) { [_subtitleOSD[index] clearContent]; _needsSubtitleDrawing &= ~(1 << index); [_auxSubtitleOSD[index] clearContent]; } else { BOOL isRendering; - BOOL paused = (0 == [_movie rate]); - float time = [_movie currentTime] + [_subtitleOSD[index] subtitleSync]; + BOOL paused = (0 == [self.movie rate]); + float time = [self.movie currentTime] + [_subtitleOSD[index] subtitleSync]; NSImage* texImage = [_subtitle[index] texImageAtTime:time isSeek:paused isRendering:&isRendering]; [_subtitleOSD[index] setTexImage:texImage]; @@ -364,7 +365,7 @@ - (float)subtitleScreenMargin { return _subtitleScreenMargin; } - (void)updateLetterBoxHeight { - if (!_movie || + if (!self.movie || ((!_subtitle[0] || ![_subtitle[0] isEnabled]) && (!_subtitle[1] || ![_subtitle[0] isEnabled]) && (!_subtitle[2] || ![_subtitle[0] isEnabled]))) { @@ -382,7 +383,7 @@ - (void)updateLetterBoxHeight rect = [self underScannedRect:rect]; } NSSize bs = rect.size; - NSSize ms = [_movie adjustedSizeByAspectRatio]; + NSSize ms = [self.movie adjustedSizeByAspectRatio]; if (bs.width / bs.height < ms.width / ms.height) { float lineHeight = [subtitleOSD adjustedLineHeight:bs.width]; float letterBoxHeight = bs.height - (bs.width * ms.height / ms.width); @@ -440,7 +441,7 @@ - (float)prevSubtitleTime for (i = 0; i < 3; i++) { if (_subtitle[i] && [_subtitle[i] isEnabled]) { t = [_subtitle[i] prevSubtitleTime: - [_movie currentTime] + [_subtitleOSD[i] subtitleSync]]; + [self.movie currentTime] + [_subtitleOSD[i] subtitleSync]]; if (prevTime < t) { prevTime = t; } @@ -451,12 +452,12 @@ - (float)prevSubtitleTime - (float)nextSubtitleTime { - float t, nextTime = [_movie duration]; + float t, nextTime = [self.movie duration]; int i; for (i = 0; i < 3; i++) { if (_subtitle[i] && [_subtitle[i] isEnabled]) { t = [_subtitle[i] nextSubtitleTime: - [_movie currentTime] + [_subtitleOSD[i] subtitleSync]]; + [self.movie currentTime] + [_subtitleOSD[i] subtitleSync]]; if (t < nextTime) { nextTime = t; } diff --git a/MMovie_QuickTime.h b/MMovie_QuickTime.h index bb8f905..ea42e16 100644 --- a/MMovie_QuickTime.h +++ b/MMovie_QuickTime.h @@ -23,12 +23,12 @@ #import "MMovie.h" #import +#import @interface MMovie_QuickTime : MMovie { - QTVisualContextRef _visualContext; - QTMovie* _qtMovie; - + AVPlayer* _avPlayer; + id _playbackPeriodicObserver; NSTimer* _indexingUpdateTimer; } @@ -38,4 +38,5 @@ + (void)checkA52CodecInstalled; + (void)checkPerianInstalled; +- (AVPlayer*)player; @end diff --git a/MMovie_QuickTime.m b/MMovie_QuickTime.m index 8dec2d8..c4fe485 100644 --- a/MMovie_QuickTime.m +++ b/MMovie_QuickTime.m @@ -23,58 +23,60 @@ #import "MMovie_QuickTime.h" #import "UserDefaults.h" -@interface QTTrack (Movist) - -- (NSString*)summary; - -@end - -@implementation QTTrack (Movist) - -- (NSString*)summary -{ - NSString* result = @""; - - ImageDescriptionHandle idh; - idh = (ImageDescriptionHandle)NewHandleClear(sizeof(ImageDescription)); - GetMediaSampleDescription([[self media] quickTimeMedia], 1, - (SampleDescriptionHandle)idh); - - NSString* mediaType = [self attributeForKey:QTTrackMediaTypeAttribute]; - if ([mediaType isEqualToString:QTMediaTypeVideo]) { - CFStringRef s; - if (noErr == ICMImageDescriptionGetProperty(idh, - kQTPropertyClass_ImageDescription, - kICMImageDescriptionPropertyID_SummaryString, - sizeof(CFStringRef), &s, 0)) { - result = [NSString stringWithString:(NSString*)s]; - CFRelease(s); - } - } - else if ([mediaType isEqualToString:QTMediaTypeMPEG]) { - NSRect rc = [[self attributeForKey:QTTrackBoundsAttribute] rectValue]; - NSString* name = [self attributeForKey:QTTrackDisplayNameAttribute]; - result = [NSString stringWithFormat:@"%@, %g x %g", - /*FIXME*/name, rc.size.width, rc.size.height]; - } - else if ([mediaType isEqualToString:QTMediaTypeSound]) { - // temporary impl. : how to get audio properties? - CFStringRef s; - if (noErr == ICMImageDescriptionGetProperty(idh, - kQTPropertyClass_ImageDescription, - kICMImageDescriptionPropertyID_SummaryString, - sizeof(CFStringRef), &s, 0)) { - // remove strange contents after codec name. - NSRange range = [(NSString*)s rangeOfString:@", "]; - result = [(NSString*)s substringToIndex:range.location]; - CFRelease(s); - } - } - DisposeHandle((Handle)idh); - return result; -} - -@end +// TODO: make something like this for AVAssetTrack +// +//@interface QTTrack (Movist) +// +//- (NSString*)summary; +// +//@end +// +//@implementation QTTrack (Movist) +// +//- (NSString*)summary +//{ +// NSString* result = @""; +// +// ImageDescriptionHandle idh; +// idh = (ImageDescriptionHandle)NewHandleClear(sizeof(ImageDescription)); +// GetMediaSampleDescription([[self media] quickTimeMedia], 1, +// (SampleDescriptionHandle)idh); +// +// NSString* mediaType = [self attributeForKey:QTTrackMediaTypeAttribute]; +// if ([mediaType isEqualToString:QTMediaTypeVideo]) { +// CFStringRef s; +// if (noErr == ICMImageDescriptionGetProperty(idh, +// kQTPropertyClass_ImageDescription, +// kICMImageDescriptionPropertyID_SummaryString, +// sizeof(CFStringRef), &s, 0)) { +// result = [NSString stringWithString:(NSString*)s]; +// CFRelease(s); +// } +// } +// else if ([mediaType isEqualToString:QTMediaTypeMPEG]) { +// NSRect rc = [[self attributeForKey:QTTrackBoundsAttribute] rectValue]; +// NSString* name = [self attributeForKey:QTTrackDisplayNameAttribute]; +// result = [NSString stringWithFormat:@"%@, %g x %g", +// /*FIXME*/name, rc.size.width, rc.size.height]; +// } +// else if ([mediaType isEqualToString:QTMediaTypeSound]) { +// // temporary impl. : how to get audio properties? +// CFStringRef s; +// if (noErr == ICMImageDescriptionGetProperty(idh, +// kQTPropertyClass_ImageDescription, +// kICMImageDescriptionPropertyID_SummaryString, +// sizeof(CFStringRef), &s, 0)) { +// // remove strange contents after codec name. +// NSRange range = [(NSString*)s rangeOfString:@", "]; +// result = [(NSString*)s substringToIndex:range.location]; +// CFRelease(s); +// } +// } +// DisposeHandle((Handle)idh); +// return result; +//} +// +//@end //////////////////////////////////////////////////////////////////////////////// #pragma mark - @@ -152,46 +154,18 @@ - (void)cleanupPerianSubtitle } } -- (MTrack*)videoTrackWithIndex:(int)index qtTrack:(QTTrack*)qtTrack +- (MTrack*)videoTrackWithIndex:(NSInteger)index avTrack:(AVAssetTrack*)avTrack { - NSSize displaySize = [[qtTrack attributeForKey:QTTrackDimensionsAttribute] sizeValue]; - NSSize encodedSize = displaySize; - - ImageDescriptionHandle idh = (ImageDescriptionHandle)NewHandleClear(sizeof(ImageDescription)); - if (idh) { - GetMediaSampleDescription([[qtTrack media] quickTimeMedia], 1, (SampleDescriptionHandle)idh); - FixedPoint fp; - if (noErr == ICMImageDescriptionGetProperty(idh, - kQTPropertyClass_ImageDescription, - kICMImageDescriptionPropertyID_CleanApertureDisplayDimensions, - sizeof(fp), &fp, 0)) { - NSSize size = NSMakeSize(FixedToFloat(fp.x), FixedToFloat(fp.y)); - if ((size.width < 10000 && size.height < 10000) && - (displaySize.width != size.width || // check invalid value - displaySize.height != size.height)) { - displaySize = size; - } - } - if (noErr == ICMImageDescriptionGetProperty(idh, - kQTPropertyClass_ImageDescription, - kICMImageDescriptionPropertyID_EncodedPixelsDimensions, - sizeof(fp), &fp, 0)) { - NSSize size = NSMakeSize(FixedToFloat(fp.x), FixedToFloat(fp.y)); - if ((size.width < 10000 && size.height < 10000) && - (encodedSize.width != size.width || // check invalid value - encodedSize.height != size.height)) { - encodedSize = size; - } - } - DisposeHandle((Handle)idh); - } - //TRACE(@"displaySize=%@, encodedSize=%@", - // NSStringFromSize(displaySize), NSStringFromSize(encodedSize)); - - MTrack* newTrack = [MTrack trackWithImpl:qtTrack]; - [newTrack setName:[qtTrack attributeForKey:QTTrackDisplayNameAttribute]]; - [newTrack setSummary:[qtTrack summary]]; - [newTrack setEncodedSize:encodedSize]; + CGSize displaySize = [avTrack naturalSize]; + CGSize encodedSize = displaySize; + + MTrack* newTrack = [MTrack trackWithImpl:avTrack]; + // TODO: replace this line with one that matches old behavior better + //[newTrack setName:[avTrack attributeForKey:QTTrackDisplayNameAttribute]]; + [newTrack setName:avTrack.mediaType]; + // TODO: replace this line with one that works with AVFoundation + //[newTrack setSummary:[avTrack summary]]; + [newTrack setEncodedSize:NSSizeFromCGSize(encodedSize)]; [newTrack setDisplaySize:displaySize]; [newTrack setEnabled:index == 0]; // enable first track only [newTrack setMovie:self]; @@ -203,11 +177,14 @@ - (MTrack*)videoTrackWithIndex:(int)index qtTrack:(QTTrack*)qtTrack return newTrack; } -- (MTrack*)audioTrackWithIndex:(int)index qtTrack:(QTTrack*)qtTrack +- (MTrack*)audioTrackWithIndex:(int)index avTrack:(AVAssetTrack*)avTrack { - MTrack* newTrack = [MTrack trackWithImpl:qtTrack]; - [newTrack setName:[qtTrack attributeForKey:QTTrackDisplayNameAttribute]]; - [newTrack setSummary:[qtTrack summary]]; + MTrack* newTrack = [MTrack trackWithImpl:avTrack]; + // TODO: replace this line with one that matches old behavior better + //[newTrack setName:[qtTrack attributeForKey:QTTrackDisplayNameAttribute]]; + [newTrack setName:avTrack.mediaType]; + // TODO: replace this line with one that works with AVFoundation + //[newTrack setSummary:[qtTrack summary]]; [newTrack setEnabled:index == 0]; // enable first track only [newTrack setMovie:self]; if (index < [_audioTracks count]) { @@ -226,20 +203,27 @@ - (id)initWithURL:(NSURL*)url movieInfo:(MMovieInfo*)movieInfo [self initA52Codec:(digitalAudioOut && movieInfo->hasAC3Codec)]; //TRACE(@"%s %@", __PRETTY_FUNCTION__, [url absoluteString]); - QTMovie* qtMovie; [self initPerianSubtitle]; - if ([url isFileURL]) { - qtMovie = [QTMovie movieWithFile:[url path] error:error]; - } - else { - qtMovie = [QTMovie movieWithURL:url error:error]; - } + AVPlayer* avPlayer = [AVPlayer playerWithURL:url]; [self cleanupPerianSubtitle]; - if (!qtMovie) { + if (!avPlayer) { [self release]; return nil; } - NSSize movieSize = [[qtMovie attributeForKey:QTMovieNaturalSizeAttribute] sizeValue]; + AVPlayerItem* playerItem = [avPlayer currentItem]; + NSArray* videoTracks = [[playerItem asset] tracksWithMediaType:AVMediaTypeVideo]; + if([videoTracks count] == 0) + { + if(error != nil) + { + *error = [NSError errorWithDomain:[MMovie_QuickTime name] + code:ERROR_NO_VIDEO_TRACK_FOUND + userInfo:nil]; + } + [self release]; + return nil; + } + CGSize movieSize = [(AVAssetTrack*)[videoTracks objectAtIndex:0] naturalSize]; if (movieSize.width == 0 || movieSize.height == 0) { NSError* err = [NSError errorWithDomain:[MMovie_QuickTime name] code:ERROR_INVALID_VIDEO_DIMENSION @@ -253,40 +237,45 @@ - (id)initWithURL:(NSURL*)url movieInfo:(MMovieInfo*)movieInfo if ((self = [super initWithURL:url movieInfo:movieInfo digitalAudioOut:digitalAudioOut error:error])) { avformat_close_input(&movieInfo->formatContext); - _qtMovie = [qtMovie retain]; + _avPlayer = [avPlayer retain]; // override video/audio tracks NSMutableArray* vTracks = [NSMutableArray arrayWithCapacity:1]; NSMutableArray* aTracks = [NSMutableArray arrayWithCapacity:1]; NSString* mediaType; - QTTrack* qtTrack; int vi = 0, ai = 0; - NSEnumerator* enumerator = [[_qtMovie tracks] objectEnumerator]; - while ((qtTrack = [enumerator nextObject])) { - mediaType = [qtTrack attributeForKey:QTTrackMediaTypeAttribute]; - if ([mediaType isEqualToString:QTMediaTypeVideo] || - [mediaType isEqualToString:QTMediaTypeMPEG]/* || - [mediaType isEqualToString:QTMediaTypeMovie]*/) { - [vTracks addObject:[self videoTrackWithIndex:vi++ qtTrack:qtTrack]]; - } - else if ([mediaType isEqualToString:QTMediaTypeSound]/* || - [mediaType isEqualToString:QTMediaTypeMusic]*/) { - [aTracks addObject:[self audioTrackWithIndex:ai++ qtTrack:qtTrack]]; - } - } + for(AVAssetTrack* avTrack in [[playerItem asset] tracks]) { + mediaType = [avTrack mediaType]; + if([mediaType isEqualToString:AVMediaTypeVideo]) { + [vTracks addObject:[self videoTrackWithIndex:vi++ avTrack:avTrack]]; + } + else if([mediaType isEqualToString:AVMediaTypeAudio]) { + [aTracks addObject:[self audioTrackWithIndex:ai++ avTrack:avTrack]]; + } + } [_videoTracks setArray:vTracks]; [_audioTracks setArray:aTracks]; [self setAspectRatio:_aspectRatio]; // for _adjustedSize // override _duration & _startTime by QuickTime - QTTime t = [_qtMovie duration]; - _duration = (float)t.timeValue / t.timeScale; + CMTime t = [playerItem duration]; + _duration = CMTimeGetSeconds(t); _startTime = 0; - // override _preferredVolume, _volume & _muted by QuickTime - _preferredVolume = [[_qtMovie attributeForKey:QTMoviePreferredVolumeAttribute] floatValue]; - _volume = [_qtMovie volume]; - _muted = [_qtMovie muted]; + if([_audioTracks count] > 0) + { + AVAssetTrack* audioAsset = (AVAssetTrack*)[(MTrack*)[_audioTracks objectAtIndex:0] impl]; + _preferredVolume = audioAsset.preferredVolume; + } + _volume = _avPlayer.volume; + _muted = _avPlayer.muted; + _playbackPeriodicObserver = [_avPlayer addPeriodicTimeObserverForInterval:CMTimeMakeWithSeconds(1.0, 100) queue:NULL usingBlock:^(CMTime time) { + [[NSNotificationCenter defaultCenter] postNotificationName:MMovieCurrentTimeNotification object:self]; + if(0 == CMTimeCompare(time, _avPlayer.currentItem.duration)) + { + [[NSNotificationCenter defaultCenter] postNotificationName:MMovieEndNotification object:self]; + } + }]; // loading-state cannot be get by QTMovieLoadStateDidChangeNotification. // I think that it may be already posted before _qtMovie is returned. @@ -297,36 +286,15 @@ - (id)initWithURL:(NSURL*)url movieInfo:(MMovieInfo*)movieInfo return self; } +- (AVPlayer*)player +{ + return _avPlayer; +} + - (BOOL)setOpenGLContext:(NSOpenGLContext*)openGLContext pixelFormat:(NSOpenGLPixelFormat*)openGLPixelFormat error:(NSError**)error { - //TRACE(@"%s", __PRETTY_FUNCTION__); - // create visual context - OSStatus ret = QTOpenGLTextureContextCreate(kCFAllocatorDefault, - [openGLContext CGLContextObj], - [openGLPixelFormat CGLPixelFormatObj], - 0, &_visualContext); - if (ret != noErr) { - //TRACE(@"QTOpenGLTextureContextCreate() failed: %d", ret); - if (error) { - NSDictionary* dict = - [NSDictionary dictionaryWithObject:[NSNumber numberWithInt:ret] - forKey:@"returnCode"]; - *error = [NSError errorWithDomain:@"QuickTime" - code:ERROR_VISUAL_CONTEXT_CREATE_FAILED - userInfo:dict]; - } - return FALSE; - } - - SetMovieVisualContext([_qtMovie quickTimeMovie], _visualContext); - - NSNotificationCenter* nc = [NSNotificationCenter defaultCenter]; - [nc addObserver:self selector:@selector(qtMovieRateChanged:) - name:QTMovieRateDidChangeNotification object:_qtMovie]; - [nc addObserver:self selector:@selector(qtMovieEnded:) - name:QTMovieDidEndNotification object:_qtMovie]; return TRUE; } @@ -340,11 +308,8 @@ - (void)cleanup [[NSNotificationCenter defaultCenter] removeObserver:self]; - SetMovieVisualContext([_qtMovie quickTimeMovie], 0); - if (_visualContext) { - CFRelease(_visualContext); - } - [_qtMovie release], _qtMovie = nil; + [_avPlayer release]; + _avPlayer = nil; [self cleanupA52Codec]; [super cleanup]; @@ -355,20 +320,20 @@ - (void)cleanup - (void)updateIndexedDuration:(NSTimer*)timer { - float duration = _indexedDuration; - long ret = GetMovieLoadState([_qtMovie quickTimeMovie]); - if (ret == kMovieLoadStateComplete) { - [_indexingUpdateTimer invalidate]; - _indexingUpdateTimer = nil; - duration = [self duration]; - } - else { - TimeValue tv; - if (noErr == GetMaxLoadedTimeInMovie([_qtMovie quickTimeMovie], &tv)) { - duration = tv / 1000.0; - } - } - [self indexedDurationUpdated:duration]; +// float duration = _indexedDuration; +// long ret = GetMovieLoadState([_qtMovie quickTimeMovie]); +// if (ret == kMovieLoadStateComplete) { +// [_indexingUpdateTimer invalidate]; +// _indexingUpdateTimer = nil; +// duration = [self duration]; +// } +// else { +// TimeValue tv; +// if (noErr == GetMaxLoadedTimeInMovie([_qtMovie quickTimeMovie], &tv)) { +// duration = tv / 1000.0; +// } +// } +// [self indexedDurationUpdated:duration]; } //////////////////////////////////////////////////////////////////////////////// @@ -384,13 +349,13 @@ - (BOOL)supportsDTSDigitalOut { return FALSE; } - (void)setVolume:(float)volume { - [_qtMovie setVolume:volume]; + [_avPlayer setVolume:volume]; [super setVolume:volume]; } - (void)setMuted:(BOOL)muted { - [_qtMovie setMuted:muted]; + [_avPlayer setMuted:muted]; [super setMuted:muted]; } @@ -400,33 +365,37 @@ - (void)setMuted:(BOOL)muted - (float)currentTime { - QTTime t = [_qtMovie currentTime]; - return (float)t.timeValue / t.timeScale; + CMTime t = [_avPlayer currentTime]; + return CMTimeGetSeconds(t); } -- (float)rate { return [_qtMovie rate]; } -- (void)setRate:(float)rate { [_qtMovie setRate:rate]; } -- (void)stepBackward { [_qtMovie stepBackward]; } -- (void)stepForward { [_qtMovie stepForward]; } -- (void)gotoBeginning { [_qtMovie gotoBeginning]; } -- (void)gotoEnd { [_qtMovie gotoEnd]; } +- (float)rate { return [_avPlayer rate]; } +- (void)setRate:(float)rate +{ + [_avPlayer setRate:rate]; + [[NSNotificationCenter defaultCenter] postNotificationName:MMovieRateChangeNotification object:self]; +} +- (void)stepBackward { [[_avPlayer currentItem] stepByCount:-1]; } +- (void)stepForward { [[_avPlayer currentItem] stepByCount:1]; } +- (void)gotoBeginning { [_avPlayer seekToTime:CMTimeMake(0, 100)]; } +- (void)gotoEnd { [_avPlayer seekToTime:[[_avPlayer currentItem] duration]]; } - (void)gotoTime:(float)time { - //TRACE(@"%s %g", __PRETTY_FUNCTION__, time); - QTTime t = [_qtMovie currentTime]; // to fill timeScale & flags - t.timeValue = (long long)(time * t.timeScale); + //TRACE(@"%s %g", __PRETTY_FUNCTION__, time); + CMTime t = [_avPlayer currentTime]; + t = CMTimeMakeWithSeconds(time, t.timescale); - if (t.timeValue < 0) { - [_qtMovie gotoBeginning]; + if (t.value < 0) { + [self gotoBeginning]; } - else if ([_qtMovie duration].timeValue < t.timeValue) { - [_qtMovie gotoEnd]; + else if (CMTimeCompare([[_avPlayer currentItem] duration], t) == -1) { + [self gotoEnd]; } else { - float rate = [_qtMovie rate]; - [_qtMovie setCurrentTime:t]; - [_qtMovie setRate:rate]; // play continue... + float rate = [_avPlayer rate]; + [_avPlayer seekToTime:t]; + [_avPlayer setRate:rate]; // play continue... } } @@ -440,41 +409,11 @@ - (void)seekByTime:(float)dt - (CVOpenGLTextureRef)nextImage:(const CVTimeStamp*)timeStamp { - //TRACE(@"%s", __PRETTY_FUNCTION__); - if (!QTVisualContextIsNewImageAvailable(_visualContext, timeStamp)) { - return 0; - } - - CVOpenGLTextureRef image; - OSStatus ret = QTVisualContextCopyImageForTime(_visualContext, 0, timeStamp, &image); - if (ret != noErr || !image) { - return 0; - } - - [[NSNotificationCenter defaultCenter] - postNotificationName:MMovieCurrentTimeNotification object:self]; - return image; + return 0; } - (void)idleTask { - QTVisualContextTask(_visualContext); -} - -//////////////////////////////////////////////////////////////////////////////// -#pragma mark - -#pragma mark notifications - -- (void)qtMovieRateChanged:(NSNotification*)notification -{ - [[NSNotificationCenter defaultCenter] - postNotificationName:MMovieRateChangeNotification object:self]; -} - -- (void)qtMovieEnded:(NSNotification*)notification -{ - [[NSNotificationCenter defaultCenter] - postNotificationName:MMovieEndNotification object:self]; } @end diff --git a/Movist.h b/Movist.h index 92ce667..4c563f1 100644 --- a/Movist.h +++ b/Movist.h @@ -205,6 +205,7 @@ enum { ERROR_UNSUPPORTED_SUBTITLE_TYPE, ERROR_INVALID_VIDEO_DIMENSION, + ERROR_NO_VIDEO_TRACK_FOUND, ERROR_VISUAL_CONTEXT_CREATE_FAILED, ERROR_FFMPEG_FILE_OPEN_FAILED, diff --git a/Movist.xcodeproj/project.pbxproj b/Movist.xcodeproj/project.pbxproj index cfc905b..81b7e6a 100755 --- a/Movist.xcodeproj/project.pbxproj +++ b/Movist.xcodeproj/project.pbxproj @@ -9,6 +9,11 @@ /* Begin PBXBuildFile section */ 2CC012030DC484910020241D /* FFAudioTrack_Digital.m in Sources */ = {isa = PBXBuildFile; fileRef = 2CC012020DC484910020241D /* FFAudioTrack_Digital.m */; }; 2CDF931B0DC4D1360069B195 /* FFAudioTrack_Analog.m in Sources */ = {isa = PBXBuildFile; fileRef = 2CDF931A0DC4D1360069B195 /* FFAudioTrack_Analog.m */; }; + 3E4EED3F15C5B561000EBFF2 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3E4EED3E15C5B561000EBFF2 /* AVFoundation.framework */; }; + 3E4EED4215C61141000EBFF2 /* MMovieLayer_FFMPEG.m in Sources */ = {isa = PBXBuildFile; fileRef = 3E4EED4115C61141000EBFF2 /* MMovieLayer_FFMPEG.m */; }; + 3E4EED4415C617A6000EBFF2 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 3E4EED4315C617A6000EBFF2 /* libz.dylib */; }; + 3E4EED4615C617B0000EBFF2 /* libbz2.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 3E4EED4515C617B0000EBFF2 /* libbz2.dylib */; }; + 3E4EED4815C617D3000EBFF2 /* CoreMedia.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3E4EED4715C617D3000EBFF2 /* CoreMedia.framework */; }; 3E9FE3E214A565D400B5AEF1 /* libavcodec.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3E9FE3DC14A565D300B5AEF1 /* libavcodec.a */; }; 3E9FE3E314A565D400B5AEF1 /* libavformat.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3E9FE3DD14A565D300B5AEF1 /* libavformat.a */; }; 3E9FE3E414A565D400B5AEF1 /* libavutil.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3E9FE3DE14A565D300B5AEF1 /* libavutil.a */; }; @@ -16,6 +21,7 @@ 3E9FE3E614A565D400B5AEF1 /* libmatroska.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3E9FE3E014A565D300B5AEF1 /* libmatroska.a */; }; 3E9FE3E714A565D400B5AEF1 /* libpostproc.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3E9FE3E114A565D300B5AEF1 /* libpostproc.a */; }; 3E9FE3E914A5667300B5AEF1 /* libswscale.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3E9FE3E814A5667300B5AEF1 /* libswscale.a */; }; + 3EDEB20716D2B84500CA8400 /* MMovieLayer_AVFoundation.m in Sources */ = {isa = PBXBuildFile; fileRef = 3EDEB20616D2B84300CA8400 /* MMovieLayer_AVFoundation.m */; }; 8D11072A0486CEB800E47090 /* MainMenu.nib in Resources */ = {isa = PBXBuildFile; fileRef = 29B97318FDCFA39411CA2CEA /* MainMenu.nib */; }; 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; }; 8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; }; @@ -78,7 +84,6 @@ AF31CFE50B7EF99000676AC6 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AF31CFE10B7EF99000676AC6 /* OpenGL.framework */; }; AF31CFE60B7EF99000676AC6 /* QTKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AF31CFE20B7EF99000676AC6 /* QTKit.framework */; }; AF31CFE70B7EF99000676AC6 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AF31CFE30B7EF99000676AC6 /* QuartzCore.framework */; }; - AF31CFE80B7EF99000676AC6 /* QuickTime.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AF31CFE40B7EF99000676AC6 /* QuickTime.framework */; }; AF34929D0C48851700CBDA34 /* PreferenceController_Advanced.m in Sources */ = {isa = PBXBuildFile; fileRef = AF3492980C48851700CBDA34 /* PreferenceController_Advanced.m */; }; AF34929E0C48851700CBDA34 /* PreferenceController_Audio.m in Sources */ = {isa = PBXBuildFile; fileRef = AF3492990C48851700CBDA34 /* PreferenceController_Audio.m */; }; AF34929F0C48851700CBDA34 /* PreferenceController_General.m in Sources */ = {isa = PBXBuildFile; fileRef = AF34929A0C48851700CBDA34 /* PreferenceController_General.m */; }; @@ -262,6 +267,12 @@ 2CC012020DC484910020241D /* FFAudioTrack_Digital.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FFAudioTrack_Digital.m; sourceTree = ""; }; 2CDF931A0DC4D1360069B195 /* FFAudioTrack_Analog.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FFAudioTrack_Analog.m; sourceTree = ""; }; 32CA4F630368D1EE00C91783 /* Movist_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Movist_Prefix.pch; sourceTree = ""; }; + 3E4EED3E15C5B561000EBFF2 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; }; + 3E4EED4015C61141000EBFF2 /* MMovieLayer_FFMPEG.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMovieLayer_FFMPEG.h; sourceTree = ""; }; + 3E4EED4115C61141000EBFF2 /* MMovieLayer_FFMPEG.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MMovieLayer_FFMPEG.m; sourceTree = ""; }; + 3E4EED4315C617A6000EBFF2 /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; }; + 3E4EED4515C617B0000EBFF2 /* libbz2.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libbz2.dylib; path = usr/lib/libbz2.dylib; sourceTree = SDKROOT; }; + 3E4EED4715C617D3000EBFF2 /* CoreMedia.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMedia.framework; path = System/Library/Frameworks/CoreMedia.framework; sourceTree = SDKROOT; }; 3E9FE3DC14A565D300B5AEF1 /* libavcodec.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libavcodec.a; path = contrib/build/lib/libavcodec.a; sourceTree = ""; }; 3E9FE3DD14A565D300B5AEF1 /* libavformat.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libavformat.a; path = contrib/build/lib/libavformat.a; sourceTree = ""; }; 3E9FE3DE14A565D300B5AEF1 /* libavutil.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libavutil.a; path = contrib/build/lib/libavutil.a; sourceTree = ""; }; @@ -269,6 +280,9 @@ 3E9FE3E014A565D300B5AEF1 /* libmatroska.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libmatroska.a; path = contrib/build/lib/libmatroska.a; sourceTree = ""; }; 3E9FE3E114A565D300B5AEF1 /* libpostproc.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libpostproc.a; path = contrib/build/lib/libpostproc.a; sourceTree = ""; }; 3E9FE3E814A5667300B5AEF1 /* libswscale.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libswscale.a; path = contrib/build/lib/libswscale.a; sourceTree = ""; }; + 3EDEB1FB16D0177200CA8400 /* MMovieLayer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MMovieLayer.h; sourceTree = ""; }; + 3EDEB20516D2B84200CA8400 /* MMovieLayer_AVFoundation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMovieLayer_AVFoundation.h; sourceTree = ""; }; + 3EDEB20616D2B84300CA8400 /* MMovieLayer_AVFoundation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MMovieLayer_AVFoundation.m; sourceTree = ""; }; 8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = ""; }; 8D1107320486CEB800E47090 /* Movist.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Movist.app; sourceTree = BUILT_PRODUCTS_DIR; }; AF010C130C0F190600CA9913 /* PlayPanel.h */ = {isa = PBXFileReference; fileEncoding = 0; lastKnownFileType = sourcecode.c.h; path = PlayPanel.h; sourceTree = ""; }; @@ -589,13 +603,14 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 3E4EED4815C617D3000EBFF2 /* CoreMedia.framework in Frameworks */, 3E4EED4615C617B0000EBFF2 /* libbz2.dylib in Frameworks */, 3E4EED4415C617A6000EBFF2 /* libz.dylib in Frameworks */, + 3E4EED3F15C5B561000EBFF2 /* AVFoundation.framework in Frameworks */, 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */, AF31CFE50B7EF99000676AC6 /* OpenGL.framework in Frameworks */, AF31CFE60B7EF99000676AC6 /* QTKit.framework in Frameworks */, AF31CFE70B7EF99000676AC6 /* QuartzCore.framework in Frameworks */, - AF31CFE80B7EF99000676AC6 /* QuickTime.framework in Frameworks */, AF0439910BEA14EA0016091F /* Carbon.framework in Frameworks */, AF1D1D3A0C2836A200D239EA /* IOKit.framework in Frameworks */, AFFE5EE60C341EAE00516510 /* AudioToolbox.framework in Frameworks */, @@ -651,6 +666,11 @@ AF30E2A40C2EB114009DB59C /* MMovieView_Message.m */, AF0853670DC635440061B8CD /* MMovieView_Capture.m */, AF30E2CD0C2EB3EA009DB59C /* MMovieView_DragDrop.m */, + 3EDEB1FB16D0177200CA8400 /* MMovieLayer.h */, + 3EDEB20516D2B84200CA8400 /* MMovieLayer_AVFoundation.h */, + 3EDEB20616D2B84300CA8400 /* MMovieLayer_AVFoundation.m */, + 3E4EED4015C61141000EBFF2 /* MMovieLayer_FFMPEG.h */, + 3E4EED4115C61141000EBFF2 /* MMovieLayer_FFMPEG.m */, AF07C1B90C4BAA490007D17B /* FullScreen */, AF16C7F70C296F7400AC0A4B /* ControlPanel.h */, AF16C7F80C296F7400AC0A4B /* ControlPanel.m */, @@ -674,6 +694,7 @@ 29B97314FDCFA39411CA2CEA /* Movist */ = { isa = PBXGroup; children = ( + 3E4EED4715C617D3000EBFF2 /* CoreMedia.framework */, 3E4EED4515C617B0000EBFF2 /* libbz2.dylib */, 3E4EED4315C617A6000EBFF2 /* libz.dylib */, 080E96DDFE201D6D7F000001 /* Classes */, @@ -715,6 +736,7 @@ isa = PBXGroup; children = ( 29B97324FDCFA39411CA2CEA /* AppKit.framework */, + 3E4EED3E15C5B561000EBFF2 /* AVFoundation.framework */, 29B97325FDCFA39411CA2CEA /* Foundation.framework */, 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */, AF0439900BEA14EA0016091F /* Carbon.framework */, @@ -1415,6 +1437,8 @@ AF0C1B3210A6BE5700773156 /* ColorConversions.c in Sources */, AF98017210BDA5A4000E471A /* MSubtitleParser_TXT.m in Sources */, AF98017E10BDA93F000E471A /* CSRegex.m in Sources */, + 3E4EED4215C61141000EBFF2 /* MMovieLayer_FFMPEG.m in Sources */, + 3EDEB20716D2B84500CA8400 /* MMovieLayer_AVFoundation.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1502,6 +1526,7 @@ C01FCF4B08A954540054247B /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + ARCHS = "$(ARCHS_STANDARD_64_BIT)"; COPY_PHASE_STRIP = NO; GCC_DYNAMIC_NO_PIC = NO; GCC_ENABLE_OBJC_EXCEPTIONS = YES; @@ -1518,12 +1543,13 @@ "$(inherited)", "$(SRCROOT)/contrib/build/lib", ); + MACOSX_DEPLOYMENT_TARGET = 10.7; OTHER_CFLAGS = ( "-isystem", "\"$(SRCROOT)/contrib/build/include\"", ); PRODUCT_NAME = Movist; - SDKROOT = macosx10.6; + SDKROOT = macosx10.7; WRAPPER_EXTENSION = app; ZERO_LINK = NO; }; @@ -1532,7 +1558,7 @@ C01FCF4C08A954540054247B /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + ARCHS = "$(ARCHS_STANDARD_64_BIT)"; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEPLOYMENT_POSTPROCESSING = YES; @@ -1552,12 +1578,13 @@ "$(inherited)", "$(SRCROOT)/contrib/build/lib", ); + MACOSX_DEPLOYMENT_TARGET = 10.7; OTHER_CFLAGS = ( "-isystem", "\"$(SRCROOT)/contrib/build/include\"", ); PRODUCT_NAME = Movist; - SDKROOT = macosx10.6; + SDKROOT = macosx10.7; SEPARATE_STRIP = YES; STRIP_INSTALLED_PRODUCT = YES; WRAPPER_EXTENSION = app; @@ -1567,22 +1594,26 @@ C01FCF4F08A954540054247B /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + ARCHS = "$(ARCHS_STANDARD_64_BIT)"; GCC_VERSION = 4.0; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; - SDKROOT = macosx10.6; + MACOSX_DEPLOYMENT_TARGET = 10.8; + SDKROOT = macosx10.8; + VALID_ARCHS = x86_64; }; name = Debug; }; C01FCF5008A954540054247B /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + ARCHS = "$(ARCHS_STANDARD_64_BIT)"; GCC_VERSION = 4.0; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; - SDKROOT = macosx10.6; + MACOSX_DEPLOYMENT_TARGET = 10.8; + SDKROOT = macosx10.8; + VALID_ARCHS = x86_64; }; name = Release; };