Skip to content

Commit

Permalink
Version 1.2.0 and return of full HW Acceleration
Browse files Browse the repository at this point in the history
  • Loading branch information
TheElixZammuto committed Aug 9, 2021
1 parent c82ea5e commit 58fdccf
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Content/SamplePixelShader.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ min16float4 main(PixelShaderInput input) : SV_TARGET
{
float y = luminanceChannel.Sample(defaultSampler, input.texCoord);
float2 uv = chrominanceChannel.Sample(defaultSampler, input.texCoord);
float r = uv.r;
/*float r = uv.r;
uv.r = uv.g;
uv.g = r;
uv.g = r;*/
return min16float4(ConvertYUVtoRGB(float3(y, uv)), 1.f);
}
9 changes: 6 additions & 3 deletions FFmpegDecoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ namespace moonlight_xbox_dx {
decodedFrameNumber++;
if (err == 0 && sharedTexture != NULL && (decodedFrameNumber - renderedFrameNumber) <= 1) {
AVFrame* frame = dec_frames[next_frame];
if (!useSoftwareEncoder) {
/*if (!useSoftwareEncoder) {
int error = av_hwframe_transfer_data(ready_frames[next_frame], dec_frames[next_frame], 0);
if (error < 0) {
char errorstringnew[1024];
Expand All @@ -228,9 +228,12 @@ namespace moonlight_xbox_dx {
unsigned char* texturePointer = (unsigned char*)ms.pData;
memcpy(texturePointer, frame->data[0], luminanceLength);
memcpy((texturePointer + luminanceLength + 1), frame->data[1], chrominanceLength);
ffmpegDeviceContext->Unmap(stagingTexture, 0);
ffmpegDeviceContext->Unmap(stagingTexture, 0);*/
DX::ThrowIfFailed(dxgiMutex->AcquireSync(0, INFINITE));
ffmpegDeviceContext->CopyResource(sharedTexture, stagingTexture);
ID3D11Texture2D* ffmpegTexture = (ID3D11Texture2D*)(frame->data[0]);
int index = (int)(frame->data[1]);
ffmpegDeviceContext->CopySubresourceRegion(sharedTexture, 0, 0, 0, 0, ffmpegTexture, index, NULL);
//ffmpegDeviceContext->CopyResource(sharedTexture, stagingTexture);
DX::ThrowIfFailed(dxgiMutex->ReleaseSync(1));
return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion Package.appxmanifest
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<Identity
Name="50497EliaZammuto.MoonlightUWP"
Publisher="CN=CE07B73A-712E-4E05-932B-D08CE2C8A87C"
Version="1.1.10.0" />
Version="1.2.0.0" />

<mp:PhoneIdentity PhoneProductId="24c51639-c33b-4519-81c5-3f3b697bb5a1" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>

Expand Down

0 comments on commit 58fdccf

Please sign in to comment.