Files
tysdk-intergration/sdk-intergration/LocalPackages/LeviathanVideo/Runtime/ILeviathanDecoder.cs
2026-03-24 11:43:22 +08:00

52 lines
1.6 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/*----------------------------------------------------------------
// 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);
}