-
Notifications
You must be signed in to change notification settings - Fork 3.5k
[video_player_avfoundation] Split iOS native code into multiple files #8171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
auto-submit
merged 26 commits into
flutter:main
from
leancodepl:feature/video-player-ios-split-native-code-into-files
Dec 4, 2024
Merged
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
82d5333
Extract FVPFrameUpdater and FVPVideoPlayer from plugin file to separa…
FirentisTFW a2d3d9f
Add docs for FVPFrameUpdater and FVPVideoPlayer interfaces
FirentisTFW a74c720
Remove unused imports and #pragma statements
FirentisTFW 9092b71
Add empty lines at the end of files
FirentisTFW add5719
Bump version to 2.6.4 and update changelog
FirentisTFW 9587ad0
Move GLKit import from header file to source file
FirentisTFW 83cec0c
Add FVPVideoPlayerPlugin_Test import to plugin file
FirentisTFW 99123db
Fix parameter type in interface constructor
FirentisTFW 9545fda
Separate plugin and factory classes by pragma mark
FirentisTFW 75b5ab9
Add nullability type specifiers to FVPVideoPlayer interface
FirentisTFW 5ec766f
Make properties not needed in header of FVPVideoPlayer private
FirentisTFW c958a4a
Use nonnull macro for the whole header file
FirentisTFW 0a707a5
Make updatePlayingState private for FVPVideoPlayer
FirentisTFW 0055ea3
Make texture registry private for FVPFrameUpdater
FirentisTFW 717315e
Move code from Plugin_Test file to different files
FirentisTFW 489f2a9
Make changelog description more general
FirentisTFW 599adc8
Add a doc comment for FVPDefaultAVFactory
FirentisTFW 513961c
Make lastKnownAvailableTime property of FVPFrameUpdater readonly
FirentisTFW ff11b63
Add _Test.h file for FVPVideoPlayer
FirentisTFW 7bb02d4
Add back a doc comment for disposeSansEventChannel
FirentisTFW da9048c
Add non-null macros for consistency
FirentisTFW d174f30
Adjust imports to follow the style guide
FirentisTFW 8151a35
Move FlutterStreamHandler and FlutterTexture conformance to the main …
FirentisTFW 591141d
Add a blank line between methods
FirentisTFW ae10006
Move all init methods to the beginning of the class
FirentisTFW faaaeb6
Remove nullable and nonnull annotations from properties in player imp…
FirentisTFW File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
...ndation/darwin/video_player_avfoundation/Sources/video_player_avfoundation/FVPAVFactory.m
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// Copyright 2013 The Flutter Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#import "./include/video_player_avfoundation/FVPAVFactory.h" | ||
|
||
#import <AVFoundation/AVFoundation.h> | ||
|
||
@implementation FVPDefaultAVFactory | ||
- (AVPlayer *)playerWithPlayerItem:(AVPlayerItem *)playerItem { | ||
return [AVPlayer playerWithPlayerItem:playerItem]; | ||
} | ||
|
||
- (AVPlayerItemVideoOutput *)videoOutputWithPixelBufferAttributes: | ||
(NSDictionary<NSString *, id> *)attributes { | ||
return [[AVPlayerItemVideoOutput alloc] initWithPixelBufferAttributes:attributes]; | ||
} | ||
@end |
31 changes: 31 additions & 0 deletions
31
...tion/darwin/video_player_avfoundation/Sources/video_player_avfoundation/FVPFrameUpdater.m
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// Copyright 2013 The Flutter Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#import "./include/video_player_avfoundation/FVPFrameUpdater.h" | ||
|
||
/// FVPFrameUpdater is responsible for notifying the Flutter texture registry | ||
/// when a new video frame is available. | ||
@interface FVPFrameUpdater () | ||
/// The Flutter texture registry used to notify about new frames. | ||
@property(nonatomic, weak, readonly) NSObject<FlutterTextureRegistry> *registry; | ||
@end | ||
|
||
@implementation FVPFrameUpdater | ||
- (FVPFrameUpdater *)initWithRegistry:(NSObject<FlutterTextureRegistry> *)registry { | ||
NSAssert(self, @"super init cannot be nil"); | ||
if (self == nil) return nil; | ||
_registry = registry; | ||
_lastKnownAvailableTime = kCMTimeInvalid; | ||
return self; | ||
} | ||
|
||
- (void)displayLinkFired { | ||
// Only report a new frame if one is actually available. | ||
CMTime outputItemTime = [self.videoOutput itemTimeForHostTime:CACurrentMediaTime()]; | ||
if ([self.videoOutput hasNewPixelBufferForItemTime:outputItemTime]) { | ||
_lastKnownAvailableTime = outputItemTime; | ||
[_registry textureFrameAvailable:_textureId]; | ||
} | ||
} | ||
@end |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.