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

Wp/arriseos 43803 crash fix/1 #261

Open
wants to merge 2 commits into
base: lgi-master
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -969,11 +969,12 @@ void AppendPipeline::abort()
}
// Drain samples before source buffer state is reset
if (m_appendState == AppendState::Sampling) {
GRefPtr<GstPad> appsrcPad = adoptGRef(gst_element_get_static_pad(m_appsrc.get(), "src"));
GST_DEBUG("ARRISEOS-43952");
/* GRefPtr<GstPad> appsrcPad = adoptGRef(gst_element_get_static_pad(m_appsrc.get(), "src"));
if (appsrcPad) {
GRefPtr<GstQuery> query = adoptGRef(gst_query_new_drain());
gst_pad_peer_query(appsrcPad.get(), query.get());
}
}*/
drainBusIfNeeded();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,15 @@
#define MEDIA_MAX_FRAMERATE 60.0f
#endif

#if PLATFORM(EOS)
#define H264_MAX_SIZE 1920.0f
#elif PLATFORM(EOS2008C)
#define H264_MAX_SIZE 3840.0f
#elif PLATFORM(APOLLO)
#define H264_MAX_SIZE 4096.0f
#else
#define H264_MAX_SIZE 7680.0f
#endif
static const char* dumpReadyState(WebCore::MediaPlayer::ReadyState readyState)
{
switch (readyState) {
Expand Down Expand Up @@ -1077,6 +1086,16 @@ bool MediaPlayerPrivateGStreamerMSE::supportsAllCodecs(const Vector<String>& cod
return true;
}

bool MediaPlayerPrivateGStreamerMSE::isAnyCodecH264AndExceedSupportedSize(const Vector<String>& codecs, float width, float height)
{
for (String codec : codecs) {
if(codec.startsWith("avc") && (width > H264_MAX_SIZE || height > H264_MAX_SIZE)) {
return true;
}
}
return false;
}

FloatSize MediaPlayerPrivateGStreamerMSE::naturalSize() const
{
if (!hasVideo())
Expand Down Expand Up @@ -1120,6 +1139,9 @@ MediaPlayer::SupportsType MediaPlayerPrivateGStreamerMSE::supportsType(const Med
if (width > MEDIA_MAX_WIDTH || height > MEDIA_MAX_HEIGHT)
return result;

if(isAnyCodecH264AndExceedSupportedSize(parameters.type.codecs(), width, height))
return result;

float framerate = parameters.type.parameter("framerate"_s).toFloat(&ok);
if (ok && framerate > MEDIA_MAX_FRAMERATE)
return result;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ class MediaPlayerPrivateGStreamerMSE : public MediaPlayerPrivateGStreamer {

static bool supportsCodec(String codec);
static bool supportsAllCodecs(const Vector<String>& codecs);
static bool isAnyCodecH264AndExceedSupportedSize(const Vector<String>& codecs, float width, float height);

#if ENABLE(ENCRYPTED_MEDIA)
void dispatchDecryptionStructure(GUniquePtr<GstStructure>&&) final;
Expand Down
12 changes: 12 additions & 0 deletions Source/cmake/OptionsWPE.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,18 @@ if (ENABLE_CBCS)
add_definitions(-DENABLE_CBCS=1)
endif()

if (PLATFORM_EOS)
add_definitions(-DWTF_PLATFORM_EOS=1)
endif()

if (PLATFORM_EOS2008C)
add_definitions(-DWTF_PLATFORM_EOS2008C=1)
endif()

if (PLATFORM_APOLLO)
add_definitions(-DWTF_PLATFORM_APOLLO=1)
endif()

add_definitions(-DBUILDING_WPE__=1)
add_definitions(-DGETTEXT_PACKAGE="WPE")
add_definitions(-DJSC_GLIB_API_ENABLED)
Expand Down