diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-10 18:07:22 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-10 18:07:22 +0000 |
commit | c04dcc2e7d834218ef2d4194331e383402495ae1 (patch) | |
tree | 7333e38d10d75386e60f336b80c2443c1166031d /xbmc/cores/RetroPlayer/messages | |
parent | Initial commit. (diff) | |
download | kodi-c04dcc2e7d834218ef2d4194331e383402495ae1.tar.xz kodi-c04dcc2e7d834218ef2d4194331e383402495ae1.zip |
Adding upstream version 2:20.4+dfsg.upstream/2%20.4+dfsg
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'xbmc/cores/RetroPlayer/messages')
-rw-r--r-- | xbmc/cores/RetroPlayer/messages/CMakeLists.txt | 25 | ||||
-rw-r--r-- | xbmc/cores/RetroPlayer/messages/savestate.fbs | 64 | ||||
-rw-r--r-- | xbmc/cores/RetroPlayer/messages/video.fbs | 43 |
3 files changed, 132 insertions, 0 deletions
diff --git a/xbmc/cores/RetroPlayer/messages/CMakeLists.txt b/xbmc/cores/RetroPlayer/messages/CMakeLists.txt new file mode 100644 index 0000000..e2e5fa1 --- /dev/null +++ b/xbmc/cores/RetroPlayer/messages/CMakeLists.txt @@ -0,0 +1,25 @@ +set(MESSAGES savestate.fbs + video.fbs +) + +foreach(_file ${MESSAGES}) + get_filename_component(FLATC_OUTPUT ${_file} NAME_WE) + set(FLATC_OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${FLATC_OUTPUT}_generated.h) + list(APPEND FLATC_OUTPUTS ${FLATC_OUTPUT}) + + add_custom_command(OUTPUT ${FLATC_OUTPUT} + COMMAND ${FLATBUFFERS_FLATC_EXECUTABLE} + ARGS -c -o "${FLATBUFFERS_MESSAGES_INCLUDE_DIR}/" ${_file} + DEPENDS ${_file} + COMMENT "Building C++ header for ${_file}" + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) +endforeach() + +add_custom_target(retroplayer_messages DEPENDS ${FLATC_OUTPUTS}) +set_target_properties(retroplayer_messages PROPERTIES FOLDER "Generated Messages" + INCLUDE_DIRECTORIES ${CMAKE_CURRENT_BINARY_DIR} + SOURCES "${FLATC_OUTPUTS}") + +if(TARGET flatbuffers::flatbuffers) + add_dependencies(retroplayer_messages flatbuffers::flatbuffers) +endif() diff --git a/xbmc/cores/RetroPlayer/messages/savestate.fbs b/xbmc/cores/RetroPlayer/messages/savestate.fbs new file mode 100644 index 0000000..7f8d805 --- /dev/null +++ b/xbmc/cores/RetroPlayer/messages/savestate.fbs @@ -0,0 +1,64 @@ +// +// Copyright (C) 2018 Team Kodi +// This file is part of Kodi - https://kodi.tv +// +// SPDX-License-Identifier: MIT +// See LICENSES/README.md for more information. +// + +include "video.fbs"; + +namespace KODI.RETRO; + +// Savestate schema +// Version 3 + +file_identifier "SAV_"; + +enum SaveType : uint8 { + Unknown, + Auto, + Manual +} + +table Savestate { + // Schema version + version:uint8 (id: 0); + + // Savestate properties + type:SaveType (id: 1); + slot:uint8 (id: 2); + label:string (id: 3); + caption:string (id: 11); + created:string (id: 4); // W3C date time [ISO 8601 : 1988 (E)] with timezone info + + // Game properties + game_file_name:string (id: 5); + + // Environment properties + timestamp_frames:uint64 (id: 6); + timestamp_wall_clock_ns:uint64 (id: 7); + + // Emulator properties + emulator_addon_id:string (id: 8); + emulator_version:string (id: 9); // Semantic version + + // Video stream properties + pixel_format:PixelFormat (id: 12); + nominal_width:uint16 (id: 13); + nominal_height:uint16 (id: 14); + max_width:uint16 (id: 15); + max_height:uint16 (id: 16); + pixel_aspect_ratio:float (id: 17); + + // Video frame properties + video_data:[uint8] (id: 18); + video_width:uint16 (id: 19); + video_height:uint16 (id: 20); + rotation_ccw:VideoRotation (id: 21); + + // Memory properties + memory_data:[uint8] (id: 10); +} + +root_type Savestate; diff --git a/xbmc/cores/RetroPlayer/messages/video.fbs b/xbmc/cores/RetroPlayer/messages/video.fbs new file mode 100644 index 0000000..f83ba5f --- /dev/null +++ b/xbmc/cores/RetroPlayer/messages/video.fbs @@ -0,0 +1,43 @@ +// +// Copyright (C) 2023 Team Kodi +// This file is part of Kodi - https://kodi.tv +// +// SPDX-License-Identifier: MIT +// See LICENSES/README.md for more information. +// + +namespace KODI.RETRO; + +enum PixelFormat : uint8 { + /// @brief Value for unknown pixel formats + Unknown, + + /// @brief packed RGBA 8:8:8:8, 32bpp, RGBARGBA... + /// This is the preferred format for web compatibility + RGBA_8888, + + /// @brief packed RGB 8:8:8, 32bpp, XRGBXRGB... X=unused/undefined + XRGB_8888, + + /// @brief packed BGR 8:8:8, 32bpp, BGRXBGRX... X=unused/undefined + BGRX_8888, + + /// @brief packed RGB 5:6:5, 16bpp, (msb), 5R 6G 5B(lsb), big-endian + RGB_565_BE, + + /// @brief packed RGB 5:6:5, 16bpp, (msb), 5R 6G 5B(lsb), little-endian + RGB_565_LE, + + /// @brief packed RGB 5:5:5, 16bpp, (msb)1X 5R 5G 5B(lsb), big-endian, X=unused/undefined + RGB_555_BE, + + /// @brief packed RGB 5:5:5, 16bpp, (msb)1X 5R 5G 5B(lsb), little-endian, X=unused/undefined + RGB_555_LE, +} + +enum VideoRotation : uint8 { + CCW_0, + CCW_90, + CCW_180, + CCW_270, +} |