LibMedia: Enable EXPLICIT_SYMBOL_EXPORT

This commit is contained in:
ayeteadoe 2025-08-07 14:33:22 -07:00 committed by Andrew Kaster
parent a99c8d05b7
commit 8150fb4cbb
8 changed files with 16 additions and 9 deletions

View File

@ -17,6 +17,7 @@
#include <AK/Stream.h>
#include <AK/StringView.h>
#include <AK/Vector.h>
#include <LibMedia/Export.h>
namespace Audio {
@ -72,7 +73,7 @@ protected:
NonnullOwnPtr<SeekableStream> m_stream;
};
class Loader : public RefCounted<Loader> {
class MEDIA_API Loader : public RefCounted<Loader> {
public:
static ErrorOr<NonnullRefPtr<Loader>> create(StringView path);
static ErrorOr<NonnullRefPtr<Loader>> create(ReadonlyBytes buffer);

View File

@ -12,6 +12,7 @@
#include <AK/Time.h>
#include <LibCore/Forward.h>
#include <LibCore/ThreadedPromise.h>
#include <LibMedia/Export.h>
namespace Audio {
@ -25,7 +26,7 @@ enum class OutputState {
//
// The interface is designed to be simple and robust. All control functions can be called safely from any thread.
// Timing information provided by the class should allow audio timestamps to be tracked with the best accuracy possible.
class PlaybackStream : public AtomicRefCounted<PlaybackStream> {
class MEDIA_API PlaybackStream : public AtomicRefCounted<PlaybackStream> {
public:
using AudioDataRequestCallback = Function<ReadonlyBytes(Bytes buffer, PcmSampleFormat format, size_t sample_count)>;

View File

@ -12,6 +12,7 @@
#include <AK/Error.h>
#include <AK/NonnullRefPtr.h>
#include <AK/Time.h>
#include <LibMedia/Export.h>
#include <LibThreading/Thread.h>
#include <pulse/pulseaudio.h>
@ -35,7 +36,7 @@ using PulseAudioDataRequestCallback = Function<ReadonlyBytes(PulseAudioStream&,
// A wrapper around the PulseAudio main loop and context structs.
// Generally, only one instance of this should be needed for a single process.
class PulseAudioContext
class MEDIA_API PulseAudioContext
: public AtomicRefCounted<PulseAudioContext>
, public Weakable<PulseAudioContext> {
public:

View File

@ -7,6 +7,7 @@
#pragma once
#include <AK/Types.h>
#include <LibMedia/Export.h>
namespace Audio {
@ -21,6 +22,6 @@ enum class PcmSampleFormat : u8 {
};
// Most of the read code only cares about how many bits to read or write
u16 pcm_bits_per_sample(PcmSampleFormat format);
MEDIA_API u16 pcm_bits_per_sample(PcmSampleFormat format);
}

View File

@ -14,7 +14,7 @@ set(SOURCES
VideoFrame.cpp
)
ladybird_lib(LibMedia media)
ladybird_lib(LibMedia media EXPLICIT_SYMBOL_EXPORT)
target_link_libraries(LibMedia PRIVATE LibCore LibCrypto LibIPC LibGfx LibThreading LibUnicode)
target_sources(LibMedia PRIVATE

View File

@ -12,6 +12,7 @@
#include <AK/Optional.h>
#include <LibCore/MappedFile.h>
#include <LibMedia/DecoderError.h>
#include <LibMedia/Export.h>
#include "Document.h"
@ -20,7 +21,7 @@ namespace Media::Matroska {
class SampleIterator;
class Streamer;
class Reader {
class MEDIA_API Reader {
public:
typedef Function<DecoderErrorOr<IterationDecision>(TrackEntry const&)> TrackEntryCallback;
@ -80,7 +81,7 @@ private:
bool m_cues_have_been_parsed { false };
};
class SampleIterator {
class MEDIA_API SampleIterator {
public:
DecoderErrorOr<Block> next_block();
Cluster const& current_cluster() const { return *m_current_cluster; }

View File

@ -7,13 +7,14 @@
#pragma once
#include <LibMedia/CodecID.h>
#include <LibMedia/Export.h>
#include <LibMedia/VideoDecoder.h>
#include "FFmpegForward.h"
namespace Media::FFmpeg {
class FFmpegVideoDecoder final : public VideoDecoder {
class MEDIA_API FFmpegVideoDecoder final : public VideoDecoder {
public:
static DecoderErrorOr<NonnullOwnPtr<FFmpegVideoDecoder>> try_create(CodecID, ReadonlyBytes codec_initialization_data);
FFmpegVideoDecoder(AVCodecContext* codec_context, AVPacket* packet, AVFrame* frame);

View File

@ -14,6 +14,7 @@
#include <LibCore/SharedCircularQueue.h>
#include <LibGfx/Bitmap.h>
#include <LibMedia/Demuxer.h>
#include <LibMedia/Export.h>
#include <LibThreading/ConditionVariable.h>
#include <LibThreading/Mutex.h>
#include <LibThreading/Thread.h>
@ -98,7 +99,7 @@ enum class PlaybackState {
Stopped,
};
class PlaybackManager {
class MEDIA_API PlaybackManager {
AK_MAKE_NONCOPYABLE(PlaybackManager);
AK_MAKE_NONMOVABLE(PlaybackManager);