video plugins
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
/*----------------------------------------------------------------
|
||||
// Copyright (C) 2025 Beijing All rights reserved.
|
||||
//
|
||||
// Author: huachangmiao
|
||||
// Create Date: 2025/04/11
|
||||
// Module Describe:
|
||||
//----------------------------------------------------------------*/
|
||||
|
||||
using System;
|
||||
using LeviathanVideo.Abstractions;
|
||||
using Unity.Collections;
|
||||
|
||||
/// <summary>
|
||||
/// Leviathan视频解码器接口
|
||||
/// </summary>
|
||||
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<byte> 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();
|
||||
|
||||
// 优化的分步显示方法
|
||||
/// <summary>
|
||||
/// 将视频帧数据复制到纹理(需要在信号保护下执行)
|
||||
/// </summary>
|
||||
void CopyFrameDataToTextures(UnityEngine.Texture2D[] textures);
|
||||
|
||||
/// <summary>
|
||||
/// 将纹理数据应用到GPU(可以和下一帧解码并行)
|
||||
/// </summary>
|
||||
void ApplyTextures(UnityEngine.Texture2D[] textures);
|
||||
}
|
||||
Reference in New Issue
Block a user