Skip to content
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

[video_player_avfoundation] Split iOS native code into multiple files #8171

Merged
Show file tree
Hide file tree
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 Nov 21, 2024
a2d3d9f
Add docs for FVPFrameUpdater and FVPVideoPlayer interfaces
FirentisTFW Nov 21, 2024
a74c720
Remove unused imports and #pragma statements
FirentisTFW Nov 21, 2024
9092b71
Add empty lines at the end of files
FirentisTFW Nov 21, 2024
add5719
Bump version to 2.6.4 and update changelog
FirentisTFW Nov 21, 2024
9587ad0
Move GLKit import from header file to source file
FirentisTFW Nov 21, 2024
83cec0c
Add FVPVideoPlayerPlugin_Test import to plugin file
FirentisTFW Nov 22, 2024
99123db
Fix parameter type in interface constructor
FirentisTFW Nov 22, 2024
9545fda
Separate plugin and factory classes by pragma mark
FirentisTFW Nov 25, 2024
75b5ab9
Add nullability type specifiers to FVPVideoPlayer interface
FirentisTFW Nov 25, 2024
5ec766f
Make properties not needed in header of FVPVideoPlayer private
FirentisTFW Dec 2, 2024
c958a4a
Use nonnull macro for the whole header file
FirentisTFW Dec 2, 2024
0a707a5
Make updatePlayingState private for FVPVideoPlayer
FirentisTFW Dec 2, 2024
0055ea3
Make texture registry private for FVPFrameUpdater
FirentisTFW Dec 2, 2024
717315e
Move code from Plugin_Test file to different files
FirentisTFW Dec 2, 2024
489f2a9
Make changelog description more general
FirentisTFW Dec 4, 2024
599adc8
Add a doc comment for FVPDefaultAVFactory
FirentisTFW Dec 4, 2024
513961c
Make lastKnownAvailableTime property of FVPFrameUpdater readonly
FirentisTFW Dec 4, 2024
ff11b63
Add _Test.h file for FVPVideoPlayer
FirentisTFW Dec 4, 2024
7bb02d4
Add back a doc comment for disposeSansEventChannel
FirentisTFW Dec 4, 2024
da9048c
Add non-null macros for consistency
FirentisTFW Dec 4, 2024
d174f30
Adjust imports to follow the style guide
FirentisTFW Dec 4, 2024
8151a35
Move FlutterStreamHandler and FlutterTexture conformance to the main …
FirentisTFW Dec 4, 2024
591141d
Add a blank line between methods
FirentisTFW Dec 4, 2024
ae10006
Move all init methods to the beginning of the class
FirentisTFW Dec 4, 2024
faaaeb6
Remove nullable and nonnull annotations from properties in player imp…
FirentisTFW Dec 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 2.6.4

* Refactors native code structure.

## 2.6.3

* Fixes VideoPlayerController.initialize() future never resolving with invalid video file.
Expand Down
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:
FirentisTFW marked this conversation as resolved.
Show resolved Hide resolved
(NSDictionary<NSString *, id> *)attributes {
return [[AVPlayerItemVideoOutput alloc] initWithPixelBufferAttributes:attributes];
}
@end
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
Loading
Loading