Skip to content

Commit

Permalink
ijkplayer-ios: add FFP_MSG_AUDIO_SEEK_RENDERING_START && FFP_MSG_AUDI…
Browse files Browse the repository at this point in the history
…O_SEEK_RENDERING_START
  • Loading branch information
raymondzheng committed Jan 31, 2018
1 parent 5b48823 commit c1b6a3f
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ios/IJKMediaPlayer/IJKMediaFramework/IJKMediaFramework.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,6 @@ FOUNDATION_EXPORT const unsigned char IJKMediaFrameworkVersionString[];
#define IJKMoviePlayerComponentOpenNotification IJKMPMoviePlayerComponentOpenNotification

#define IJKMPMoviePlayerAccurateSeekCompleteNotification IJKMPMoviePlayerAccurateSeekCompleteNotification
#define IJKMoviePlayerSeekAudioStartNotification IJKMPMoviePlayerSeekAudioStartNotification
#define IJKMoviePlayerSeekVideoStartNotification IJKMPMoviePlayerSeekVideoStartNotification

Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,5 @@ FOUNDATION_EXPORT const unsigned char IJKMediaFrameworkWithSSLVersionString[];
#define IJKMoviePlayerFindStreamInfoNotification IJKMPMoviePlayerFindStreamInfoNotification
#define IJKMoviePlayerComponentOpenNotification IJKMPMoviePlayerComponentOpenNotification
#define IJKMPMoviePlayerAccurateSeekCompleteNotification IJKMPMoviePlayerAccurateSeekCompleteNotification
#define IJKMoviePlayerSeekAudioStartNotification IJKMPMoviePlayerSeekAudioStartNotification
#define IJKMoviePlayerSeekVideoStartNotification IJKMPMoviePlayerSeekVideoStartNotification
20 changes: 20 additions & 0 deletions ios/IJKMediaPlayer/IJKMediaPlayer/IJKFFMoviePlayerController.m
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ @implementation IJKFFMoviePlayerController {
@synthesize monitor = _monitor;
@synthesize shouldShowHudView = _shouldShowHudView;
@synthesize isSeekBuffering = _isSeekBuffering;
@synthesize isAudioSync = _isAudioSync;
@synthesize isVideoSync = _isVideoSync;

#define FFP_IO_STAT_STEP (50 * 1024)

Expand Down Expand Up @@ -1299,6 +1301,24 @@ - (void)postEvent: (IJKFFMoviePlayerMessage *)msg
userInfo:@{IJKMPMoviePlayerDidAccurateSeekCompleteCurPos: @(avmsg->arg1)}];
break;
}
case FFP_MSG_VIDEO_SEEK_RENDERING_START: {
NSLog(@"FFP_MSG_VIDEO_SEEK_RENDERING_START:\n");
_isVideoSync = avmsg->arg1;
[[NSNotificationCenter defaultCenter]
postNotificationName:IJKMPMoviePlayerSeekVideoStartNotification
object:self];
_isVideoSync = 0;
break;
}
case FFP_MSG_AUDIO_SEEK_RENDERING_START: {
NSLog(@"FFP_MSG_AUDIO_SEEK_RENDERING_START:\n");
_isAudioSync = avmsg->arg1;
[[NSNotificationCenter defaultCenter]
postNotificationName:IJKMPMoviePlayerSeekAudioStartNotification
object:self];
_isAudioSync = 0;
break;
}
default:
// NSLog(@"unknown FFP_MSG_xxx(%d)\n", avmsg->what);
break;
Expand Down
4 changes: 4 additions & 0 deletions ios/IJKMediaPlayer/IJKMediaPlayer/IJKMediaPlayback.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ typedef NS_ENUM(NSInteger, IJKMPMovieTimeOption) {
@property(nonatomic, readonly) IJKMPMoviePlaybackState playbackState;
@property(nonatomic, readonly) IJKMPMovieLoadState loadState;
@property(nonatomic, readonly) int isSeekBuffering;
@property(nonatomic, readonly) int isAudioSync;
@property(nonatomic, readonly) int isVideoSync;

@property(nonatomic, readonly) int64_t numberOfBytesTransferred;

Expand Down Expand Up @@ -160,6 +162,8 @@ IJK_EXTERN NSString *const IJKMPMoviePlayerDidSeekCompleteTargetKey;
IJK_EXTERN NSString *const IJKMPMoviePlayerDidSeekCompleteErrorKey;
IJK_EXTERN NSString *const IJKMPMoviePlayerDidAccurateSeekCompleteCurPos;
IJK_EXTERN NSString *const IJKMPMoviePlayerAccurateSeekCompleteNotification;
IJK_EXTERN NSString *const IJKMPMoviePlayerSeekAudioStartNotification;
IJK_EXTERN NSString *const IJKMPMoviePlayerSeekVideoStartNotification;

@end

Expand Down
3 changes: 3 additions & 0 deletions ios/IJKMediaPlayer/IJKMediaPlayer/IJKMediaPlayback.m
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@
NSString *const IJKMPMoviePlayerDidSeekCompleteErrorKey = @"IJKMPMoviePlayerDidSeekCompleteErrorKey";
NSString *const IJKMPMoviePlayerDidAccurateSeekCompleteCurPos = @"IJKMPMoviePlayerDidAccurateSeekCompleteCurPos";

NSString *const IJKMPMoviePlayerSeekAudioStartNotification = @"IJKMPMoviePlayerSeekAudioStartNotification";
NSString *const IJKMPMoviePlayerSeekVideoStartNotification = @"IJKMPMoviePlayerSeekVideoStartNotification";

@implementation IJKMediaUrlOpenData {
NSString *_url;
BOOL _handled;
Expand Down

0 comments on commit c1b6a3f

Please sign in to comment.