删除多余字段

master
Cal 2024-11-19 16:38:14 +08:00
parent ee8166613a
commit 189e80a6f8
1 changed files with 5 additions and 21 deletions

View File

@ -30,8 +30,6 @@ namespace ZC
[SerializeField] private Camera _camera; [SerializeField] private Camera _camera;
private Texture2D _output;
private volatile int _sendData; private volatile int _sendData;
private AsyncGPUReadbackRequest _asyncGPUReadbackRequest; private AsyncGPUReadbackRequest _asyncGPUReadbackRequest;
@ -188,7 +186,7 @@ namespace ZC
$" -loglevel info " + $" -loglevel info " +
$" -map 0:a:0 -map 1:v:0 " + $" -map 0:a:0 -map 1:v:0 " +
$" -c:a aac " + $" -c:a aac " +
$" -c:v:0 libx264 -g 1 -bf 0 -speed 1x -max_delay 0 -vf scale={this._config.resolution} -preset:v ultrafast -tune:v zerolatency -crf 10 -pix_fmt yuv420p -strict -2 " + $" -c:v:0 libx264 -g 1 -bf 0 -max_delay 0 -vf scale={this._config.resolution} -preset:v ultrafast -tune:v zerolatency -crf 10 -pix_fmt yuv420p -strict -2 " +
$" -f flv {this._config.server}{this._config.appName} -bf 0 "; $" -f flv {this._config.server}{this._config.appName} -bf 0 ";
Debug.Log(processStartInfo.Arguments); Debug.Log(processStartInfo.Arguments);
@ -223,7 +221,6 @@ namespace ZC
_isRequesting = true; _isRequesting = true;
SetCamera(camera); SetCamera(camera);
_sendData = 0; _sendData = 0;
Object.Destroy(_output);
this._targetTextureWidth = camera.targetTexture.width; this._targetTextureWidth = camera.targetTexture.width;
this._targetTextureHeight = camera.targetTexture.height; this._targetTextureHeight = camera.targetTexture.height;
var targetTextureByteCount = this._targetTextureWidth * this._targetTextureHeight * 3; var targetTextureByteCount = this._targetTextureWidth * this._targetTextureHeight * 3;
@ -233,8 +230,6 @@ namespace ZC
_bitmapArray = new byte[Bitmap.FileHeaderSize + Bitmap.ImageHeaderSize + targetTextureByteCount]; _bitmapArray = new byte[Bitmap.FileHeaderSize + Bitmap.ImageHeaderSize + targetTextureByteCount];
} }
_output = new Texture2D(this._targetTextureWidth, this._targetTextureHeight);
_frameIndex = _doneFrameIndex = 0; _frameIndex = _doneFrameIndex = 0;
CreateCaptureThread(); CreateCaptureThread();
@ -250,21 +245,10 @@ namespace ZC
public void Dispose() public void Dispose()
{ {
try this._isRequesting = true;
{ _sendData = 0;
this._isRequesting = true; _camera = null;
_sendData = 0; this.DisposeCaptureThread();
_camera = null;
Object.Destroy(_output);
this.DisposeCaptureThread();
}
finally
{
#if UNITY_EDITOR
#else
_textureData.Dispose();
#endif
}
} }
[DllImport("kernel32.dll", SetLastError = true)] [DllImport("kernel32.dll", SetLastError = true)]