// Copyright 2013 The Flutter Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Autogenerated from Pigeon (v26.3.4), do not edit directly.
// See also: https://pub.dev/packages/pigeon

@import Foundation;

@protocol FlutterBinaryMessenger;
@protocol FlutterMessageCodec;
@class FlutterError;
@class FlutterStandardTypedData;

NS_ASSUME_NONNULL_BEGIN

@class FVPMediaSelectionAudioTrackData;
@class FVPMediaSelectionVideoTrackData;
@class FVPAssetVideoTrackData;
@class FVPNativeVideoTrackData;

/// Raw audio track data from AVMediaSelectionOption (for HLS streams).
@interface FVPMediaSelectionAudioTrackData : NSObject
/// `init` unavailable to enforce nonnull fields, see the `make` class method.
- (instancetype)init NS_UNAVAILABLE;
+ (instancetype)makeWithIndex:(NSInteger)index
                  displayName:(nullable NSString *)displayName
                 languageCode:(nullable NSString *)languageCode
                   isSelected:(BOOL)isSelected
          commonMetadataTitle:(nullable NSString *)commonMetadataTitle;
@property(nonatomic, assign) NSInteger index;
@property(nonatomic, copy, nullable) NSString *displayName;
@property(nonatomic, copy, nullable) NSString *languageCode;
@property(nonatomic, assign) BOOL isSelected;
@property(nonatomic, copy, nullable) NSString *commonMetadataTitle;
@end

/// Video track data from AVAssetVariant (HLS variants) for iOS 15+.
@interface FVPMediaSelectionVideoTrackData : NSObject
/// `init` unavailable to enforce nonnull fields, see the `make` class method.
- (instancetype)init NS_UNAVAILABLE;
+ (instancetype)makeWithVariantIndex:(NSInteger)variantIndex
                               label:(nullable NSString *)label
                             bitrate:(nullable NSNumber *)bitrate
                               width:(nullable NSNumber *)width
                              height:(nullable NSNumber *)height
                           frameRate:(nullable NSNumber *)frameRate
                               codec:(nullable NSString *)codec
                          isSelected:(BOOL)isSelected;
@property(nonatomic, assign) NSInteger variantIndex;
@property(nonatomic, copy, nullable) NSString *label;
@property(nonatomic, strong, nullable) NSNumber *bitrate;
@property(nonatomic, strong, nullable) NSNumber *width;
@property(nonatomic, strong, nullable) NSNumber *height;
@property(nonatomic, strong, nullable) NSNumber *frameRate;
@property(nonatomic, copy, nullable) NSString *codec;
@property(nonatomic, assign) BOOL isSelected;
@end

/// Video track data from AVAssetTrack (regular videos).
@interface FVPAssetVideoTrackData : NSObject
/// `init` unavailable to enforce nonnull fields, see the `make` class method.
- (instancetype)init NS_UNAVAILABLE;
+ (instancetype)makeWithTrackId:(NSInteger)trackId
                          label:(nullable NSString *)label
                          width:(nullable NSNumber *)width
                         height:(nullable NSNumber *)height
                      frameRate:(nullable NSNumber *)frameRate
                          codec:(nullable NSString *)codec
                     isSelected:(BOOL)isSelected;
@property(nonatomic, assign) NSInteger trackId;
@property(nonatomic, copy, nullable) NSString *label;
@property(nonatomic, strong, nullable) NSNumber *width;
@property(nonatomic, strong, nullable) NSNumber *height;
@property(nonatomic, strong, nullable) NSNumber *frameRate;
@property(nonatomic, copy, nullable) NSString *codec;
@property(nonatomic, assign) BOOL isSelected;
@end

/// Container for video track data from iOS.
@interface FVPNativeVideoTrackData : NSObject
+ (instancetype)makeWithAssetTracks:(nullable NSArray<FVPAssetVideoTrackData *> *)assetTracks
               mediaSelectionTracks:
                   (nullable NSArray<FVPMediaSelectionVideoTrackData *> *)mediaSelectionTracks;
/// Asset-based tracks (for regular videos)
@property(nonatomic, copy, nullable) NSArray<FVPAssetVideoTrackData *> *assetTracks;
/// Media selection tracks (for HLS variants on iOS 15+)
@property(nonatomic, copy, nullable)
    NSArray<FVPMediaSelectionVideoTrackData *> *mediaSelectionTracks;
@end

/// The codec used by all APIs.
NSObject<FlutterMessageCodec> *FVPGetVideoPlayerInstanceMessagesCodec(void);

@protocol FVPVideoPlayerInstanceApi
- (void)setLooping:(BOOL)looping error:(FlutterError *_Nullable *_Nonnull)error;
- (void)setVolume:(double)volume error:(FlutterError *_Nullable *_Nonnull)error;
- (void)setPlaybackSpeed:(double)speed error:(FlutterError *_Nullable *_Nonnull)error;
- (void)playWithError:(FlutterError *_Nullable *_Nonnull)error;
/// @return `nil` only when `error != nil`.
- (nullable NSNumber *)position:(FlutterError *_Nullable *_Nonnull)error;
- (void)seekTo:(NSInteger)position completion:(void (^)(FlutterError *_Nullable))completion;
- (void)pauseWithError:(FlutterError *_Nullable *_Nonnull)error;
- (void)disposeWithError:(FlutterError *_Nullable *_Nonnull)error;
/// @return `nil` only when `error != nil`.
- (nullable NSArray<FVPMediaSelectionAudioTrackData *> *)getAudioTracks:
    (FlutterError *_Nullable *_Nonnull)error;
- (void)selectAudioTrackAtIndex:(NSInteger)trackIndex
                          error:(FlutterError *_Nullable *_Nonnull)error;
/// Gets the available video tracks for the video.
- (void)getVideoTracks:(void (^)(FVPNativeVideoTrackData *_Nullable,
                                 FlutterError *_Nullable))completion;
/// Selects a video track by setting preferredPeakBitRate.
/// Pass 0 to enable auto quality selection.
- (void)selectVideoTrackWithBitrate:(NSInteger)bitrate
                              error:(FlutterError *_Nullable *_Nonnull)error;
- (void)setPreventsDisplaySleepDuringVideoPlayback:(BOOL)preventsDisplaySleepDuringVideoPlayback
                                             error:(FlutterError *_Nullable *_Nonnull)error;
@end

extern void SetUpFVPVideoPlayerInstanceApi(id<FlutterBinaryMessenger> binaryMessenger,
                                           NSObject<FVPVideoPlayerInstanceApi> *_Nullable api);

extern void SetUpFVPVideoPlayerInstanceApiWithSuffix(
    id<FlutterBinaryMessenger> binaryMessenger, NSObject<FVPVideoPlayerInstanceApi> *_Nullable api,
    NSString *messageChannelSuffix);

NS_ASSUME_NONNULL_END
