Skip to content

Commit

Permalink
🔀 Merge branch 'yann/feature/videokit/add-videokit-architecture' into…
Browse files Browse the repository at this point in the history
… develop
  • Loading branch information
ladislas committed Mar 15, 2022
2 parents d977989 + d621c28 commit 08e4716
Show file tree
Hide file tree
Showing 6 changed files with 105 additions and 0 deletions.
1 change: 1 addition & 0 deletions libs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ add_subdirectory(${LIBS_DIR}/IOKit)
add_subdirectory(${LIBS_DIR}/LedKit)
add_subdirectory(${LIBS_DIR}/RobotKit)
add_subdirectory(${LIBS_DIR}/UIAnimationKit)
add_subdirectory(${LIBS_DIR}/VideoKit)
add_subdirectory(${LIBS_DIR}/WebKit)

add_subdirectory(${LIBS_DIR}/PrettyPrinter)
Expand Down
29 changes: 29 additions & 0 deletions libs/VideoKit/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Leka - LekaOS
# Copyright 2022 APF France handicap
# SPDX-License-Identifier: Apache-2.0

add_library(VideoKit STATIC)

target_include_directories(VideoKit
PUBLIC
include
)

target_sources(VideoKit
PRIVATE
source/VideoKit.cpp
)

target_link_libraries(VideoKit
CoreLL
CoreSTM32Hal
CoreVideo
)

if (${CMAKE_PROJECT_NAME} STREQUAL "LekaOSUnitTests")

leka_unit_tests_sources(
tests/VideoKit_test.cpp
)

endif()
22 changes: 22 additions & 0 deletions libs/VideoKit/include/VideoKit.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Leka - LekaOS
// Copyright 2022 APF France handicap
// SPDX-License-Identifier: Apache-2.0

#pragma once

namespace leka {

class VideoKit
{
public:
explicit VideoKit() = default;

void initializeScreen() {};

void displayImage(const char *path) {};

void playVideo(const char *path) {};
void stopVideo() {};
};

} // namespace leka
7 changes: 7 additions & 0 deletions libs/VideoKit/source/VideoKit.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// Leka - LekaOS
// Copyright 2022 APF France handicap
// SPDX-License-Identifier: Apache-2.0

#include "VideoKit.h"

using namespace leka;
45 changes: 45 additions & 0 deletions libs/VideoKit/tests/VideoKit_test.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// Leka - LekaOS
// Copyright 2022 APF France handicap
// SPDX-License-Identifier: Apache-2.0

#include "VideoKit.h"

#include "gtest/gtest.h"

using namespace leka;

class VideoKitTest : public ::testing::Test
{
protected:
VideoKitTest() {}

// void SetUp() override {}
// void TearDown() override {}

VideoKit video_kit;
};

TEST_F(VideoKitTest, initialization)
{
EXPECT_NE(&video_kit, nullptr);
}

TEST_F(VideoKitTest, initializeScreen)
{
video_kit.initializeScreen();
}

TEST_F(VideoKitTest, displayImage)
{
video_kit.displayImage("some_image");
}

TEST_F(VideoKitTest, playVideo)
{
video_kit.playVideo("some_video");
}

TEST_F(VideoKitTest, stopVideo)
{
video_kit.stopVideo();
}
1 change: 1 addition & 0 deletions tests/unit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ leka_register_unit_tests_for_library(IOKit)
leka_register_unit_tests_for_library(LedKit)
leka_register_unit_tests_for_library(RobotKit)
leka_register_unit_tests_for_library(UIAnimationKit)
leka_register_unit_tests_for_library(VideoKit)

#
# Mark: - Finish up
Expand Down

0 comments on commit 08e4716

Please sign in to comment.