#include "MediaEngine.h" #if defined(WINAPI_FAMILY) # if WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP && !defined(AXME_USE_IMFME) # include "media/WmfMediaEngine.h" # else # include "media/MfMediaEngine.h" # endif #elif defined(__APPLE__) # include "media/AvfMediaEngine.h" #elif defined(__ANDROID__) # include "media/AndroidMediaEngine.h" #endif #if defined(AX_ENABLE_VLC_MEDIA) # include "media/VlcMediaEngine.h" #endif namespace axstd { // static_pointer_cast overload for std::shared_ptr using std::static_pointer_cast; // static_pointer_cast overload for std::unique_ptr template std::unique_ptr static_pointer_cast(std::unique_ptr&& r) { (void)static_cast(static_cast(0)); typedef typename std::unique_ptr::element_type E; return std::unique_ptr(static_cast(r.release())); } } // namespace axstd NS_AX_BEGIN std::unique_ptr MediaEngineFactory::create() { #if defined(WINAPI_FAMILY) # if WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP && !defined(AXME_USE_IMFME) return axstd::static_pointer_cast(std::make_unique()); # else return axstd::static_pointer_cast(std::make_unique()); # endif #elif defined(__APPLE__) return axstd::static_pointer_cast(std::make_unique()); #elif defined(__ANDROID__) return axstd::static_pointer_cast(std::make_unique()); #elif defined(__linux__) && defined(AX_ENABLE_VLC_MEDIA) return axstd::static_pointer_cast(std::make_unique()); #else return nullptr; #endif } NS_AX_END