| 1 |
/* |
| 2 |
* Copyright (C) 2018 Team Kodi |
| 3 |
* This file is part of Kodi - https://kodi.tv |
| 4 |
* |
| 5 |
* SPDX-License-Identifier: GPL-2.0-or-later |
| 6 |
* See LICENSES/README.md for more information. |
| 7 |
*/ |
| 8 |
|
| 9 |
#include "GameClientStreamSwFramebuffer.h" |
| 10 |
|
| 11 |
#include "addons/kodi-dev-kit/include/kodi/addon-instance/Game.h" |
| 12 |
#include "cores/RetroPlayer/streams/RetroPlayerVideo.h" |
| 13 |
#include "games/addons/GameClientTranslator.h" |
| 14 |
|
| 15 |
using namespace KODI; |
| 16 |
using namespace GAME; |
| 17 |
|
| 18 |
bool CGameClientStreamSwFramebuffer::GetBuffer(unsigned int width, |
| 19 |
unsigned int height, |
| 20 |
game_stream_buffer& buffer) |
| 21 |
{ |
| 22 |
if (m_stream != nullptr) |
| 23 |
{ |
| 24 |
RETRO::VideoStreamBuffer streamBuffer; |
| 25 |
if (m_stream->GetStreamBuffer(width, height, static_cast<RETRO::StreamBuffer&>(streamBuffer))) |
| 26 |
{ |
| 27 |
buffer.type = GAME_STREAM_SW_FRAMEBUFFER; |
| 28 |
|
| 29 |
game_stream_sw_framebuffer_buffer& framebuffer = buffer.sw_framebuffer; |
| 30 |
|
| 31 |
framebuffer.format = CGameClientTranslator::TranslatePixelFormat(streamBuffer.pixfmt); |
| 32 |
framebuffer.data = streamBuffer.data; |
| 33 |
framebuffer.size = streamBuffer.size; |
| 34 |
|
| 35 |
return true; |
| 36 |
} |
| 37 |
} |
| 38 |
|
| 39 |
return false; |
| 40 |
} |