Skip to content

Commit

Permalink
LibMedia: Port to Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
stasoid committed Dec 18, 2024
1 parent 74152b2 commit dfeb356
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Libraries/LibMedia/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
if (NOT ANDROID AND NOT WIN32)
if (NOT ANDROID)
include(ffmpeg)
include(pulseaudio)
endif()
Expand All @@ -19,7 +19,7 @@ set(SOURCES
serenity_lib(LibMedia media)
target_link_libraries(LibMedia PRIVATE LibCore LibCrypto LibRIFF LibIPC LibGfx LibThreading LibUnicode)

if (NOT ANDROID AND NOT WIN32)
if (NOT ANDROID)
target_sources(LibMedia PRIVATE
Audio/FFmpegLoader.cpp
FFmpeg/FFmpegVideoDecoder.cpp
Expand Down
11 changes: 11 additions & 0 deletions Libraries/LibMedia/VideoFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,17 @@

#include "VideoFrame.h"

#ifdef AK_OS_WINDOWS
static int posix_memalign(void** memptr, size_t alignment, size_t size)
{
void* ptr = _aligned_malloc(size, alignment);
if (!ptr)
return errno;
*memptr = ptr;
return 0;
}
#endif

namespace Media {

ErrorOr<NonnullOwnPtr<SubsampledYUVFrame>> SubsampledYUVFrame::try_create(
Expand Down

0 comments on commit dfeb356

Please sign in to comment.