提交 d7b4717c 编写于 作者: Z Zhang Rui

ios: rename classes

上级 b8cfc03f
......@@ -33,8 +33,8 @@
E6903F1217EAF70200CFD954 /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = E6903F1117EAF70200CFD954 /* Default.png */; };
E6903F1417EAF70200CFD954 /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E6903F1317EAF70200CFD954 /* Default@2x.png */; };
E6903F1617EAF70200CFD954 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = E6903F1517EAF70200CFD954 /* Default-568h@2x.png */; };
E6A9B56417EDA72C00A1A500 /* IJKVideoViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E6A9B56217EDA72C00A1A500 /* IJKVideoViewController.m */; };
E6A9B56517EDA72C00A1A500 /* IJKVideoViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = E6A9B56317EDA72C00A1A500 /* IJKVideoViewController.xib */; };
E6A9B56417EDA72C00A1A500 /* IJKMoviePlayerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E6A9B56217EDA72C00A1A500 /* IJKMoviePlayerViewController.m */; };
E6A9B56517EDA72C00A1A500 /* IJKMoviePlayerViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = E6A9B56317EDA72C00A1A500 /* IJKMoviePlayerViewController.xib */; };
E6F727C017F40DC50043623F /* libIJKMediaPlayer.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E6166C7017EDA43C0006B956 /* libIJKMediaPlayer.a */; };
/* End PBXBuildFile section */
......@@ -71,9 +71,9 @@
E6903F1117EAF70200CFD954 /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = "<group>"; };
E6903F1317EAF70200CFD954 /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default@2x.png"; sourceTree = "<group>"; };
E6903F1517EAF70200CFD954 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = "<group>"; };
E6A9B56117EDA72C00A1A500 /* IJKVideoViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IJKVideoViewController.h; sourceTree = "<group>"; };
E6A9B56217EDA72C00A1A500 /* IJKVideoViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IJKVideoViewController.m; sourceTree = "<group>"; };
E6A9B56317EDA72C00A1A500 /* IJKVideoViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = IJKVideoViewController.xib; sourceTree = "<group>"; };
E6A9B56117EDA72C00A1A500 /* IJKMoviePlayerViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IJKMoviePlayerViewController.h; sourceTree = "<group>"; };
E6A9B56217EDA72C00A1A500 /* IJKMoviePlayerViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IJKMoviePlayerViewController.m; sourceTree = "<group>"; };
E6A9B56317EDA72C00A1A500 /* IJKMoviePlayerViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = IJKMoviePlayerViewController.xib; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
......@@ -184,9 +184,9 @@
E6A9B55C17EDA6AC00A1A500 /* View Controllers */ = {
isa = PBXGroup;
children = (
E6A9B56117EDA72C00A1A500 /* IJKVideoViewController.h */,
E6A9B56217EDA72C00A1A500 /* IJKVideoViewController.m */,
E6A9B56317EDA72C00A1A500 /* IJKVideoViewController.xib */,
E6A9B56117EDA72C00A1A500 /* IJKMoviePlayerViewController.h */,
E6A9B56217EDA72C00A1A500 /* IJKMoviePlayerViewController.m */,
E6A9B56317EDA72C00A1A500 /* IJKMoviePlayerViewController.xib */,
E66F8DC917EEDD8B00354D80 /* IJKMediaControl.h */,
E66F8DCA17EEDD8B00354D80 /* IJKMediaControl.m */,
);
......@@ -250,7 +250,7 @@
E6903F1417EAF70200CFD954 /* Default@2x.png in Resources */,
E6903F1617EAF70200CFD954 /* Default-568h@2x.png in Resources */,
E6166C9C17EDA4A20006B956 /* IJKMediaDemo-Prefix.pch in Resources */,
E6A9B56517EDA72C00A1A500 /* IJKVideoViewController.xib in Resources */,
E6A9B56517EDA72C00A1A500 /* IJKMoviePlayerViewController.xib in Resources */,
E66F8DCF17EEDFCB00354D80 /* player_top_control_bg.png in Resources */,
E66F8DD017EEDFCB00354D80 /* player_top_control_bg@2x.png in Resources */,
E66F8DD517EEE01D00354D80 /* btn_player_back_highlighted.png in Resources */,
......@@ -273,7 +273,7 @@
files = (
E6903F0C17EAF70200CFD954 /* main.m in Sources */,
E6903F1017EAF70200CFD954 /* IJKAppDelegate.m in Sources */,
E6A9B56417EDA72C00A1A500 /* IJKVideoViewController.m in Sources */,
E6A9B56417EDA72C00A1A500 /* IJKMoviePlayerViewController.m in Sources */,
E66F8DCB17EEDD8B00354D80 /* IJKMediaControl.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
......
......@@ -7,7 +7,7 @@
//
#import "IJKAppDelegate.h"
#import "IJKVideoViewController.h"
#import "IJKMoviePlayerViewController.h"
@implementation IJKAppDelegate
......
//
// IJKVideoViewController.h
// IJKMoviePlayerController.h
// IJKMediaDemo
//
// Created by ZhangRui on 13-9-21.
......
//
// IJKVideoViewController.m
// IJKMoviePlayerController.m
// IJKMediaDemo
//
// Created by ZhangRui on 13-9-21.
// Copyright (c) 2013年 bilibili. All rights reserved.
//
#import "IJKVideoViewController.h"
#import "IJKMoviePlayerViewController.h"
#import "IJKMediaControl.h"
#import "IJKCommon.h"
......@@ -15,9 +15,9 @@
- (id)initView
{
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
return [self initWithNibName:@"IJKVideoViewController" bundle:nil];
return [self initWithNibName:@"IJKMoviePlayerViewController" bundle:nil];
} else {
return [self initWithNibName:@"IJKVideoViewController" bundle:nil];
return [self initWithNibName:@"IJKMoviePlayerViewController" bundle:nil];
}
}
......@@ -39,11 +39,11 @@
[[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationLandscapeLeft animated:NO];
// NSURL *theMovieURL = [NSURL URLWithString:@"rtsp://l.m.cztv.com:554/hdmi/hntv1hd.stream"];
// NSURL *theMovieURL = [NSURL URLWithString:@"http://edge.v.iask.com/113820563.hlv?KID=sina,viask&Expires=1380124800&ssig=iswfgpZ1Jp"];
// NSURL *theMovieURL = [NSURL URLWithString:@"http://edge.v.iask.com/115380070.hlv?KID=sina,viask&Expires=1380124800&ssig=s5khawIcuO"];
NSURL *theMovieURL = [NSURL URLWithString:@"http://devimages.apple.com/iphone/samples/bipbop/gear1/prog_index.m3u8"];
// NSURL *theMovieURL = [NSURL URLWithString:@"http://edge.v.iask.com/115151121.hlv?KID=sina,viask&Expires=1380297600&ssig=SjfwCmaiLe"];
NSURL *theMovieURL = [NSURL URLWithString:@"http://edge.v.iask.com/115279108.hlv?KID=sina,viask&Expires=1380297600&ssig=KpcdjFjrhW"];
// NSURL *theMovieURL = [NSURL URLWithString:@"http://devimages.apple.com/iphone/samples/bipbop/gear1/prog_index.m3u8"];
self.player = [[IJKFFPlayerController alloc] initWithContentURL:theMovieURL];
self.player = [[IJKFFMoviePlayerController alloc] initWithContentURL:theMovieURL];
self.player.playbackDelegate = self;
self.player.view.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight;
self.player.view.frame = self.view.bounds;
......
......@@ -39,6 +39,7 @@
<int key="NSvFlags">274</int>
<string key="NSFrameSize">{480, 320}</string>
<reference key="NSSuperview"/>
<reference key="NSNextKeyView"/>
<object class="NSColor" key="IBUIBackgroundColor" id="836798887">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MCAwAA</bytes>
......@@ -246,6 +247,7 @@
<int key="NSvFlags">265</int>
<string key="NSFrame">{{330, 61}, {50, 21}}</string>
<reference key="NSSuperview" ref="857327256"/>
<reference key="NSNextKeyView"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
......
......@@ -17,7 +17,7 @@
E63FC2B017F16C0A003551EB /* ijksdl_vout_ios_gles2.m in Sources */ = {isa = PBXBuildFile; fileRef = E63FC2AF17F16C09003551EB /* ijksdl_vout_ios_gles2.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
E63FC2BE17F18469003551EB /* ijksdl_thread_ios.m in Sources */ = {isa = PBXBuildFile; fileRef = E63FC2BD17F18467003551EB /* ijksdl_thread_ios.m */; };
E66F8DC117EEC65200354D80 /* IJKMPMoviePlayerController.m in Sources */ = {isa = PBXBuildFile; fileRef = E66F8DC017EEC65200354D80 /* IJKMPMoviePlayerController.m */; };
E66F8DE717EFD9C300354D80 /* IJKFFPlayerController.m in Sources */ = {isa = PBXBuildFile; fileRef = E66F8DE617EFD9C300354D80 /* IJKFFPlayerController.m */; };
E66F8DE717EFD9C300354D80 /* IJKFFMoviePlayerController.m in Sources */ = {isa = PBXBuildFile; fileRef = E66F8DE617EFD9C300354D80 /* IJKFFMoviePlayerController.m */; };
E66F8DF117EFEA9400354D80 /* ijkplayer.c in Sources */ = {isa = PBXBuildFile; fileRef = E66F8DEF17EFEA9400354D80 /* ijkplayer.c */; };
E66F8E0317EFEEA400354D80 /* ijkplayer_ios.m in Sources */ = {isa = PBXBuildFile; fileRef = E66F8E0117EFEEA400354D80 /* ijkplayer_ios.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
E6903EC217EAF6C500CFD954 /* IJKMediaPlayback.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = E6903EC117EAF6C500CFD954 /* IJKMediaPlayback.h */; };
......@@ -38,10 +38,10 @@
E690403317EAFC6100CFD954 /* ijksdl_timer.c in Sources */ = {isa = PBXBuildFile; fileRef = E690400E17EAFC6100CFD954 /* ijksdl_timer.c */; };
E690403417EAFC6100CFD954 /* ijksdl_vout.c in Sources */ = {isa = PBXBuildFile; fileRef = E690401117EAFC6100CFD954 /* ijksdl_vout.c */; };
E6F727B817F2B1B10043623F /* IJKMediaModule.m in Sources */ = {isa = PBXBuildFile; fileRef = E6F727B717F2B1B10043623F /* IJKMediaModule.m */; };
E6F727BB17F2D9D40043623F /* IJKFFPlayerDef.m in Sources */ = {isa = PBXBuildFile; fileRef = E6F727BA17F2D9D30043623F /* IJKFFPlayerDef.m */; };
E6F727BB17F2D9D40043623F /* IJKFFMoviePlayerDef.m in Sources */ = {isa = PBXBuildFile; fileRef = E6F727BA17F2D9D30043623F /* IJKFFMoviePlayerDef.m */; };
E6F727BC17F40C1C0043623F /* IJKMediaPlayer.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = E66F8DC217EECB1E00354D80 /* IJKMediaPlayer.h */; };
E6F727BD17F40C360043623F /* IJKMPMoviePlayerController.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = E66F8DBF17EEC65200354D80 /* IJKMPMoviePlayerController.h */; };
E6F727BE17F40C390043623F /* IJKFFPlayerController.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = E66F8DE517EFD9C300354D80 /* IJKFFPlayerController.h */; };
E6F727BE17F40C390043623F /* IJKFFMoviePlayerController.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = E66F8DE517EFD9C300354D80 /* IJKFFMoviePlayerController.h */; };
E6F727BF17F40C4A0043623F /* IJKMediaModule.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = E6F727B617F2B1B10043623F /* IJKMediaModule.h */; };
/* End PBXBuildFile section */
......@@ -53,7 +53,7 @@
dstSubfolderSpec = 16;
files = (
E6F727BF17F40C4A0043623F /* IJKMediaModule.h in CopyFiles */,
E6F727BE17F40C390043623F /* IJKFFPlayerController.h in CopyFiles */,
E6F727BE17F40C390043623F /* IJKFFMoviePlayerController.h in CopyFiles */,
E6F727BD17F40C360043623F /* IJKMPMoviePlayerController.h in CopyFiles */,
E6F727BC17F40C1C0043623F /* IJKMediaPlayer.h in CopyFiles */,
E6903EC217EAF6C500CFD954 /* IJKMediaPlayback.h in CopyFiles */,
......@@ -85,8 +85,8 @@
E66F8DBF17EEC65200354D80 /* IJKMPMoviePlayerController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IJKMPMoviePlayerController.h; path = IJKMediaPlayer/IJKMPMoviePlayerController.h; sourceTree = "<group>"; };
E66F8DC017EEC65200354D80 /* IJKMPMoviePlayerController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = IJKMPMoviePlayerController.m; path = IJKMediaPlayer/IJKMPMoviePlayerController.m; sourceTree = "<group>"; };
E66F8DC217EECB1E00354D80 /* IJKMediaPlayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IJKMediaPlayer.h; path = IJKMediaPlayer/IJKMediaPlayer.h; sourceTree = "<group>"; };
E66F8DE517EFD9C300354D80 /* IJKFFPlayerController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IJKFFPlayerController.h; sourceTree = "<group>"; };
E66F8DE617EFD9C300354D80 /* IJKFFPlayerController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IJKFFPlayerController.m; sourceTree = "<group>"; };
E66F8DE517EFD9C300354D80 /* IJKFFMoviePlayerController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IJKFFMoviePlayerController.h; sourceTree = "<group>"; };
E66F8DE617EFD9C300354D80 /* IJKFFMoviePlayerController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IJKFFMoviePlayerController.m; sourceTree = "<group>"; };
E66F8DEE17EFEA9400354D80 /* ijkplayer_internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ijkplayer_internal.h; sourceTree = "<group>"; };
E66F8DEF17EFEA9400354D80 /* ijkplayer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ijkplayer.c; sourceTree = "<group>"; };
E66F8DF017EFEA9400354D80 /* ijkplayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ijkplayer.h; sourceTree = "<group>"; };
......@@ -212,8 +212,8 @@
E690403A17EB079500CFD954 /* loghelp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = loghelp.h; sourceTree = "<group>"; };
E6F727B617F2B1B10043623F /* IJKMediaModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IJKMediaModule.h; path = IJKMediaPlayer/IJKMediaModule.h; sourceTree = "<group>"; };
E6F727B717F2B1B10043623F /* IJKMediaModule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = IJKMediaModule.m; path = IJKMediaPlayer/IJKMediaModule.m; sourceTree = "<group>"; };
E6F727B917F2D9D30043623F /* IJKFFPlayerDef.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IJKFFPlayerDef.h; sourceTree = "<group>"; };
E6F727BA17F2D9D30043623F /* IJKFFPlayerDef.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IJKFFPlayerDef.m; sourceTree = "<group>"; };
E6F727B917F2D9D30043623F /* IJKFFMoviePlayerDef.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IJKFFMoviePlayerDef.h; sourceTree = "<group>"; };
E6F727BA17F2D9D30043623F /* IJKFFMoviePlayerDef.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IJKFFMoviePlayerDef.m; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
......@@ -247,7 +247,7 @@
children = (
E6F727B517F2B1690043623F /* IJKMediaPlayer */,
E66F8DBE17EEC5DE00354D80 /* IJKMPMoviePlayerController */,
E6903EBE17EAF6C500CFD954 /* IJKFFPlayerController */,
E6903EBE17EAF6C500CFD954 /* IJKFFMoviePlayerController */,
);
name = Classes;
sourceTree = "<group>";
......@@ -319,18 +319,18 @@
name = Frameworks;
sourceTree = "<group>";
};
E6903EBE17EAF6C500CFD954 /* IJKFFPlayerController */ = {
E6903EBE17EAF6C500CFD954 /* IJKFFMoviePlayerController */ = {
isa = PBXGroup;
children = (
E66F8DE517EFD9C300354D80 /* IJKFFPlayerController.h */,
E66F8DE617EFD9C300354D80 /* IJKFFPlayerController.m */,
E6F727B917F2D9D30043623F /* IJKFFPlayerDef.h */,
E6F727BA17F2D9D30043623F /* IJKFFPlayerDef.m */,
E66F8DE517EFD9C300354D80 /* IJKFFMoviePlayerController.h */,
E66F8DE617EFD9C300354D80 /* IJKFFMoviePlayerController.m */,
E6F727B917F2D9D30043623F /* IJKFFMoviePlayerDef.h */,
E6F727BA17F2D9D30043623F /* IJKFFMoviePlayerDef.m */,
E6903F7617EAFC2C00CFD954 /* ffmpeg */,
E6903FCC17EAFC6100CFD954 /* ijkmedia */,
E6903EBF17EAF6C500CFD954 /* Supporting Files */,
);
name = IJKFFPlayerController;
name = IJKFFMoviePlayerController;
path = IJKMediaPlayer;
sourceTree = "<group>";
};
......@@ -657,7 +657,7 @@
E690403317EAFC6100CFD954 /* ijksdl_timer.c in Sources */,
E690403417EAFC6100CFD954 /* ijksdl_vout.c in Sources */,
E66F8DC117EEC65200354D80 /* IJKMPMoviePlayerController.m in Sources */,
E66F8DE717EFD9C300354D80 /* IJKFFPlayerController.m in Sources */,
E66F8DE717EFD9C300354D80 /* IJKFFMoviePlayerController.m in Sources */,
E66F8DF117EFEA9400354D80 /* ijkplayer.c in Sources */,
E66F8E0317EFEEA400354D80 /* ijkplayer_ios.m in Sources */,
E63FC26917EFF39E003551EB /* ijksdl_aout_ios_audiounit.m in Sources */,
......@@ -670,7 +670,7 @@
E63FC2B017F16C0A003551EB /* ijksdl_vout_ios_gles2.m in Sources */,
E63FC2BE17F18469003551EB /* ijksdl_thread_ios.m in Sources */,
E6F727B817F2B1B10043623F /* IJKMediaModule.m in Sources */,
E6F727BB17F2D9D40043623F /* IJKFFPlayerDef.m in Sources */,
E6F727BB17F2D9D40043623F /* IJKFFMoviePlayerDef.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......
/*
* IJKFFPlayerController.h
* IJKFFMoviePlayerController.h
*
* Copyright (c) 2013 Zhang Rui <bbcallen@gmail.com>
*
......@@ -22,7 +22,7 @@
#import "IJKMediaPlayback.h"
@interface IJKFFPlayerController : NSObject <IJKMediaPlayback>
@interface IJKFFMoviePlayerController : NSObject <IJKMediaPlayback>
- (id)initWithContentURL:(NSURL *)aUrl;
......
/*
* IJKFFPlayerController.m
* IJKFFMoviePlayerController.m
*
* Copyright (c) 2013 Zhang Rui <bbcallen@gmail.com>
*
......@@ -20,15 +20,15 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#import "IJKFFPlayerController.h"
#import "IJKFFPlayerDef.h"
#import "IJKFFMoviePlayerController.h"
#import "IJKFFMoviePlayerDef.h"
#import "IJKMediaPlayback.h"
@implementation IJKFFPlayerController {
@implementation IJKFFMoviePlayerController {
NSURL *_url;
IjkMediaPlayer *_mediaPlayer;
IJKFFPlayerMessagePool *_msgPool;
IJKFFMoviePlayerMessagePool *_msgPool;
}
@synthesize view = _view;
......@@ -46,7 +46,7 @@
_url = aUrl;
_mediaPlayer = ijkmp_ios_create(media_player_msg_loop);
_msgPool = [[IJKFFPlayerMessagePool alloc] init];
_msgPool = [[IJKFFMoviePlayerMessagePool alloc] init];
ijkmp_set_weak_thiz(_mediaPlayer, (__bridge_retained void *) self);
......@@ -126,7 +126,7 @@
return ret / 1000;
}
- (void)postEvent: (IJKFFPlayerMessage *)msg
- (void)postEvent: (IJKFFMoviePlayerMessage *)msg
{
if (!msg)
return;
......@@ -175,13 +175,13 @@
[delegate playerDidStopBuffering];
break;
case FFP_MSG_BUFFERING_UPDATE:
NSLog(@"FFP_MSG_BUFFERING_UPDATE: %d, %d", avmsg->arg1, avmsg->arg2);
// NSLog(@"FFP_MSG_BUFFERING_UPDATE: %d, %d", avmsg->arg1, avmsg->arg2);
break;
case FFP_MSG_BUFFERING_BYTES_UPDATE:
NSLog(@"FFP_MSG_BUFFERING_BYTES_UPDATE: %d", avmsg->arg1);
// NSLog(@"FFP_MSG_BUFFERING_BYTES_UPDATE: %d", avmsg->arg1);
break;
case FFP_MSG_BUFFERING_TIME_UPDATE:
NSLog(@"FFP_MSG_BUFFERING_TIME_UPDATE: %d", avmsg->arg1);
// NSLog(@"FFP_MSG_BUFFERING_TIME_UPDATE: %d", avmsg->arg1);
break;
case FFP_MSG_SEEK_COMPLETE:
NSLog(@"FFP_MSG_SEEK_COMPLETE:");
......@@ -196,23 +196,23 @@
[_msgPool recycle:msg];
}
- (IJKFFPlayerMessage *) obtainMessage {
- (IJKFFMoviePlayerMessage *) obtainMessage {
return [_msgPool obtain];
}
inline static IJKFFPlayerController *ffplayerRetain(void *arg) {
return (__bridge_transfer IJKFFPlayerController *) arg;
inline static IJKFFMoviePlayerController *ffplayerRetain(void *arg) {
return (__bridge_transfer IJKFFMoviePlayerController *) arg;
}
int media_player_msg_loop(void* arg)
{
@autoreleasepool {
IjkMediaPlayer *mp = (IjkMediaPlayer*)arg;
__weak IJKFFPlayerController *ffpController = ffplayerRetain(ijkmp_set_weak_thiz(mp, NULL));
__weak IJKFFMoviePlayerController *ffpController = ffplayerRetain(ijkmp_set_weak_thiz(mp, NULL));
while (ffpController && true) {
@autoreleasepool {
IJKFFPlayerMessage *msg = [ffpController obtainMessage];
IJKFFMoviePlayerMessage *msg = [ffpController obtainMessage];
if (!msg)
break;
......
/*
* IJKFFPlayerDef.h
* IJKFFMoviePlayerDef.h
*
* Copyright (c) 2013 Zhang Rui <bbcallen@gmail.com>
*
......@@ -23,17 +23,17 @@
#import <Foundation/Foundation.h>
#include "ijkplayer/ios/ijkplayer_ios.h"
@interface IJKFFPlayerMessage : NSObject {
@interface IJKFFMoviePlayerMessage : NSObject {
@public
AVMessage _msg;
}
@end
@interface IJKFFPlayerMessagePool : NSObject
@interface IJKFFMoviePlayerMessagePool : NSObject
- (IJKFFPlayerMessagePool *)init;
- (IJKFFPlayerMessage *) obtain;
- (void) recycle:(IJKFFPlayerMessage *)msg;
- (IJKFFMoviePlayerMessagePool *)init;
- (IJKFFMoviePlayerMessage *) obtain;
- (void) recycle:(IJKFFMoviePlayerMessage *)msg;
@end
/*
* IJKFFPlayerDef.m
* IJKFFMoviePlayerDef.m
*
* Copyright (c) 2013 Zhang Rui <bbcallen@gmail.com>
*
......@@ -20,16 +20,16 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#import "IJKFFPlayerDef.h"
#import "IJKFFMoviePlayerDef.h"
@implementation IJKFFPlayerMessage
@implementation IJKFFMoviePlayerMessage
@end
@implementation IJKFFPlayerMessagePool{
@implementation IJKFFMoviePlayerMessagePool{
NSMutableArray *_array;
}
- (IJKFFPlayerMessagePool *)init
- (IJKFFMoviePlayerMessagePool *)init
{
self = [super init];
if (self) {
......@@ -38,9 +38,9 @@
return self;
}
- (IJKFFPlayerMessage *) obtain
- (IJKFFMoviePlayerMessage *) obtain
{
IJKFFPlayerMessage *msg = nil;
IJKFFMoviePlayerMessage *msg = nil;
@synchronized(self) {
NSUInteger count = [_array count];
......@@ -51,12 +51,12 @@
}
if (!msg)
msg = [[IJKFFPlayerMessage alloc] init];
msg = [[IJKFFMoviePlayerMessage alloc] init];
return msg;
}
- (void) recycle:(IJKFFPlayerMessage *)msg
- (void) recycle:(IJKFFMoviePlayerMessage *)msg
{
if (!msg)
return;
......
......@@ -23,4 +23,4 @@
#import "IJKMediaModule.h"
#import "IJKMediaPlayback.h"
#import "IJKMPMoviePlayerController.h"
#import "IJKFFPlayerController.h"
\ No newline at end of file
#import "IJKFFMoviePlayerController.h"
\ No newline at end of file
......@@ -37,7 +37,7 @@
self = nil;
return nil;
}
self->_spec = *aSpec;
_spec = *aSpec;
AudioComponentDescription desc;
desc.componentType = kAudioUnitType_Output;
......@@ -74,19 +74,19 @@
/* Get the current format */
AudioStreamBasicDescription streamDescription;
streamDescription.mSampleRate = self->_spec.freq;
self->_spec.format = AUDIO_S16SYS;
streamDescription.mSampleRate = _spec.freq;
_spec.format = AUDIO_S16SYS;
streamDescription.mFormatID = kAudioFormatLinearPCM;
streamDescription.mFormatFlags = kLinearPCMFormatFlagIsPacked;
streamDescription.mChannelsPerFrame = self->_spec.channels;
streamDescription.mChannelsPerFrame = _spec.channels;
streamDescription.mFramesPerPacket = 1;
streamDescription.mBitsPerChannel = SDL_AUDIO_BITSIZE(self->_spec.format);
if (SDL_AUDIO_ISBIGENDIAN(self->_spec.format))
streamDescription.mBitsPerChannel = SDL_AUDIO_BITSIZE(_spec.format);
if (SDL_AUDIO_ISBIGENDIAN(_spec.format))
streamDescription.mFormatFlags |= kLinearPCMFormatFlagIsBigEndian;
if (SDL_AUDIO_ISFLOAT(self->_spec.format))
if (SDL_AUDIO_ISFLOAT(_spec.format))
streamDescription.mFormatFlags |= kLinearPCMFormatFlagIsFloat;
if (SDL_AUDIO_ISSIGNED(self->_spec.format))
if (SDL_AUDIO_ISSIGNED(_spec.format))
streamDescription.mFormatFlags |= kLinearPCMFormatFlagIsSignedInteger;
streamDescription.mBytesPerFrame = streamDescription.mBitsPerChannel * streamDescription.mChannelsPerFrame / 8;
......@@ -130,7 +130,7 @@
return nil;
}
SDL_CalculateAudioSpec(&self->_spec);
SDL_CalculateAudioSpec(&_spec);
/* AU initiliaze */
status = AudioUnitInitialize(auUnit);
......@@ -151,7 +151,12 @@
AudioSessionSetProperty(kAudioSessionProperty_AudioCategory, sizeof(sessionCategory), &sessionCategory);
AudioSessionSetActive(true);
self->_auUnit = auUnit;
Float32 preferredBufferDuration = _spec.samples * 1.0f / _spec.freq;
AudioSessionSetProperty(kAudioSessionProperty_PreferredHardwareIOBufferDuration,
sizeof (preferredBufferDuration),
&preferredBufferDuration);
_auUnit = auUnit;
}
return self;
}
......@@ -163,35 +168,35 @@
- (void)play
{
if (!self->_auUnit)
if (!_auUnit)
return;
AudioOutputUnitStart(self->_auUnit);
AudioOutputUnitStart(_auUnit);
AudioSessionSetActive(true);
}
- (void)pause
{
if (!self->_auUnit)
if (!_auUnit)
return;
AudioOutputUnitStop(self->_auUnit);
AudioOutputUnitStop(_auUnit);
AudioSessionSetActive(false);
}
- (void)flush
{
if (!self->_auUnit)
if (!_auUnit)
return;
AudioOutputUnitStop(self->_auUnit);
AudioOutputUnitStop(_auUnit);
}
- (void)stop
{
AudioSessionSetActive(false);
if (!self->_auUnit)
if (!_auUnit)
return;
OSStatus status = AudioOutputUnitStop(_auUnit);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册