Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🏗 (video): Add VideoKit architecture #575

Merged
merged 2 commits into from
Mar 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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