/*----------------------------------------------------------------
// Copyright (C) 2025 Beijing All rights reserved.
//
// Author: huachangmiao
// Create Date: 2025/04/11
// Module Describe:
//----------------------------------------------------------------*/
using System;
using LeviathanVideo.Abstractions;
using Unity.Collections;
///
/// Leviathan视频解码器接口
///
internal unsafe interface ILeviathanDecoder : IDisposable
{
// 事件
event Action OnFirstFrameDecoded;
// 属性
long FrameCount { get; }
double FrameInterval { get; }
string CodecName { get; }
long Duration { get; }
long DecodedFrameIndex { get; }
AVFrame* VideoFrame { get; }
bool IsLooping { get; set; }
// 方法
int Init(NativeArray fileData, int beginFrameIndex = 1, bool syncDecodeFirstFrame = true, bool fastDecode = true);
int InternalPlay(int beginFrameIndex = 1, bool syncDecodeFirstFrame = true);
int DecodeNextFrame();
void InternalStop();
void Seek(double ms);
void SeekToFrame(long frame);
void Pause(bool pause);
ref long GetDecodedFrameIndexRef();
// 微信平台特有方法(其他平台提供空实现)
int GetDecoderStatus();
// 优化的分步显示方法
///
/// 将视频帧数据复制到纹理(需要在信号保护下执行)
///
void CopyFrameDataToTextures(UnityEngine.Texture2D[] textures);
///
/// 将纹理数据应用到GPU(可以和下一帧解码并行)
///
void ApplyTextures(UnityEngine.Texture2D[] textures);
}