diff --git a/src/third_party/starboard/rdk/shared/media/gst_media_utils.cc b/src/third_party/starboard/rdk/shared/media/gst_media_utils.cc
index 934c5c8..e6f6753 100644
--- a/src/third_party/starboard/rdk/shared/media/gst_media_utils.cc
+++ b/src/third_party/starboard/rdk/shared/media/gst_media_utils.cc
@@ -203,8 +203,17 @@ std::vector<std::string> CodecToGstCaps(SbMediaAudioCodec codec,
}
case kSbMediaAudioCodecAc3:
- case kSbMediaAudioCodecEac3:
- return {{"audio/x-eac3"}};
+ case kSbMediaAudioCodecEac3: {
+ std::string primary_caps = "audio/x-eac3";
+ if (info)
+ {
+ primary_caps +=
+ ", channels=" + std::to_string(info->number_of_channels);
+ primary_caps += ", rate=" + std::to_string(info->samples_per_second);
+ }
+ SB_LOG(INFO) << "Adding audio caps data: " << primary_caps;
+ return {{primary_caps}};
+ }
case kSbMediaAudioCodecOpus: {
std::string primary_caps = "audio/x-opus, channel-mapping-family=0";
diff --git a/src/third_party/starboard/rdk/shared/player/player_internal.cc b/src/third_party/star
board/rdk/shared/player/player_internal.cc
index d5ce9a6..8b464bb 100644
--- a/src/third_party/starboard/rdk/shared/player/player_internal.cc
+++ b/src/third_party/starboard/rdk/shared/player/player_internal.cc
@@ -1241,6 +1241,7 @@ class PlayerImpl : public Player {
static void SetupElement(GstElement* pipeline,
GstElement* element,
PlayerImpl* self);
+ static void ConfigureLimitedVideoWesterossink(GstElement* element);
static void OnVideoBufferUnderflow(PlayerImpl* self);
bool ChangePipelineState(GstState state) const;
@@ -1272,7 +1273,6 @@ class PlayerImpl : public Player {
void HandleApplicationMessage(GstBus* bus, GstMessage* message);
void WritePendingSamples();
void CheckBuffering(gint64 position);
- void ConfigureLimitedVideo();
void SchedulePlayingStateUpdate();
void AddBufferingProbe(GstClockTime target, int ticket);
@@ -1461,7 +1461,8 @@ PlayerImpl::PlayerImpl(SbPlayer player,
if (max_video_capabilities && *max_video_capabilities) {
max_video_capabilities_ = max_video_capabilities;
- ConfigureLimitedVideo();
+ // Limited video only
+ audio_codec_ = kSbMediaAudioCodecNone;
}
if (audio_codec_ == kSbMediaAudioCodecNone) {
@@ -1929,29 +1930,58 @@ void PlayerImpl::OnVideoBufferUnderflow(PlayerImpl* self)
void PlayerImpl::SetupElement(GstElement* pipeline,
GstElement* element,
PlayerImpl* self) {
- if (GST_IS_BASE_SINK(element)) {
- static bool disable_wait_video = !!getenv("COBALT_AML_DISABLE_WAIT_VIDEO");
- bool has_video = (self->video_codec_ != kSbMediaVideoCodecNone);
- if (has_video && g_str_has_prefix(GST_ELEMENT_NAME(element), "amlhalasink") && !disable_wait_
video) {
- g_object_set(element, "wait-video", TRUE, "a-wait-timeout", 4000, nullptr);
+ if (!self->max_video_capabilities_.empty() && g_str_has_prefix(GST_ELEMENT_NAME(element), "rial
tomsevideosink")) {
+ uint32_t width = 0;
+ uint32_t height = 0;
+ ParseMaxVideoCapabilities(self->max_video_capabilities_.c_str(), &width, &height, nullptr);
+ if (0 != width){
+ if (g_object_class_find_property(G_OBJECT_GET_CLASS(element), "maxVideoWidth")) {
+ GST_INFO("Setting rialtomsevideosink maxVideoWidth to %u", width);
+ g_object_set(element, "maxVideoWidth", width, nullptr);
+ }
}
- else
- if (has_video && g_str_has_prefix(GST_ELEMENT_NAME(element), "westerossink")) {
- if (g_object_class_find_property(G_OBJECT_GET_CLASS(element), "zoom-mode")) {
- GST_INFO("Setting westerossink zoom-mode to 0");
- g_object_set(element, "zoom-mode", 0, nullptr);
+ if (0 != height){
+ if (g_object_class_find_property(G_OBJECT_GET_CLASS(element), "maxVideoHeight")) {
+ GST_INFO("Setting rialtomsevideosink maxVideoHeight to %u", height);
+ g_object_set(element, "maxVideoHeight", height, nullptr);
}
- g_signal_connect_swapped(
- G_OBJECT(element), "buffer-underflow-callback",
- G_CALLBACK(OnVideoBufferUnderflow), self);
}
- else
- if (g_str_has_prefix(GST_ELEMENT_NAME(element), "brcmaudiosink")) {
- g_object_set(G_OBJECT(element), "async", TRUE, nullptr);
+ }
+ else {
+ if (GST_IS_BASE_SINK(element)) {
+ static bool disable_wait_video = !!getenv("COBALT_AML_DISABLE_WAIT_VIDEO");
+ bool has_video = (self->video_codec_ != kSbMediaVideoCodecNone);
+ if (has_video && g_str_has_prefix(GST_ELEMENT_NAME(element), "amlhalasink") && !disable_wai
t_video) {
+ g_object_set(element, "wait-video", TRUE, "a-wait-timeout", 4000, nullptr);
+ }
+ else
+ if (has_video && g_str_has_prefix(GST_ELEMENT_NAME(element), "westerossink")) {
+ if (g_object_class_find_property(G_OBJECT_GET_CLASS(element), "zoom-mode")) {
+ GST_INFO("Setting westerossink zoom-mode to 0");
+ g_object_set(element, "zoom-mode", 0, nullptr);
+ }
+ g_signal_connect_swapped(
+ G_OBJECT(element), "buffer-underflow-callback",
+ G_CALLBACK(OnVideoBufferUnderflow), self);
+ }
+ else
+ if (g_str_has_prefix(GST_ELEMENT_NAME(element), "brcmaudiosink")) {
+ g_object_set(G_OBJECT(element), "async", TRUE, nullptr);
+ }
}
}
}
+// static
+void PlayerImpl::ConfigureLimitedVideoWesterossink(GstElement* element) {
+ if (g_object_class_find_property(G_OBJECT_GET_CLASS(element), "res-usage")) {
+ g_object_set(element, "res-usage", 0x0u, nullptr);
+ }
+ else {
+ GST_WARNING("'westerossink' has no 'res-usage' property, secondary video may steal decoder");
+ }
+}
+
void PlayerImpl::MarkEOS(SbMediaType stream_type) {
GstElement* src = nullptr;
if (stream_type == kSbMediaTypeVideo) {
@@ -2788,29 +2818,6 @@ void PlayerImpl::HandleApplicationMessage(GstBus* bus, GstMessage* message)
{
}
}
-void PlayerImpl::ConfigureLimitedVideo() {
- GstElementFactory* factory = gst_element_factory_find("westerossink");
- if (factory) {
- GstElement* video_sink = gst_element_factory_create(factory, nullptr);
- if (video_sink) {
- if (g_object_class_find_property(G_OBJECT_GET_CLASS(video_sink), "res-usage")) {
- g_object_set(video_sink, "res-usage", 0x0u, nullptr);
- }
- else {
- GST_WARNING("'westerossink' has no 'res-usage' property, secondary video may steal decode
r");
- }
- g_object_set(pipeline_, "video-sink", video_sink, nullptr);
- }
- else {
- GST_DEBUG("Failed to create 'westerossink'");
- }
- gst_object_unref(GST_OBJECT(factory));
- }
-
- // enforce no audio
- audio_codec_ = kSbMediaAudioCodecNone;
-}
-
void PlayerImpl::AddBufferingProbe(GstClockTime target, int ticket) {
struct BufferingProbeData {
GstClockTime target_time; |