Skip to content

Commit

Permalink
Minor cleanups and CL feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
sideb0ard committed Nov 9, 2024
1 parent 000a09f commit df874e5
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 23 deletions.
8 changes: 5 additions & 3 deletions content/renderer/media/media_permission_dispatcher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,12 @@ void MediaPermissionDispatcher::OnPermissionStatus(
PermissionStatusCB permission_status_cb = std::move(iter->second);
requests_.erase(iter);

#if BUILDFLAG(USE_STARBOARD_MEDIA)
std::move(permission_status_cb).Run(true);
// TODO (SIDEBOARD) - FIX THIS PERMISSION CHECK FOR REAL
// std::move(permission_status_cb)
// .Run(status == blink::mojom::PermissionStatus::GRANTED);
#else // BUILDFLAG(USE_STARBOARD_MEDIA)
std::move(permission_status_cb)
.Run(status == blink::mojom::PermissionStatus::GRANTED);
#endif // BUILDFLAG(USE_STARBOARD_MEDIA)
}

void MediaPermissionDispatcher::OnConnectionError() {
Expand Down
11 changes: 0 additions & 11 deletions media/base/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@ if (is_cobalt) {
import("//starboard/build/buildflags.gni")
}

if (is_cobalt) {
import("//starboard/build/buildflags.gni")
}


source_set("base") {
# Do not expand the visibility here without double-checking with OWNERS, this
# is a roll-up target which is part of the //media component. Most other DEPs
Expand Down Expand Up @@ -413,12 +408,6 @@ source_set("base") {
"//media:subcomponent_config",
]

if (is_cobalt) {
deps += [
"//starboard($starboard_toolchain)",
]
}

if (media_use_ffmpeg) {
deps += [
"//third_party/ffmpeg",
Expand Down
7 changes: 5 additions & 2 deletions media/cdm/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

import("//media/media_options.gni")

if (is_cobalt) {
import("//starboard/build/buildflags.gni")
}

source_set("cdm_api") {
sources = [ "api/content_decryption_module.h" ]
}
Expand Down Expand Up @@ -171,8 +175,7 @@ source_set("cdm") {
deps += [ "//media/fuchsia/common" ]
}

if (is_cobalt) {
import("//starboard/build/buildflags.gni")
if (is_cobalt && use_starboard_media) {
sources += [
"starboard/starboard_cdm.cc",
"starboard/starboard_cdm.h",
Expand Down
14 changes: 7 additions & 7 deletions media/cdm/starboard/starboard_cdm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ void StarboardCdm::CreateSessionAndGenerateRequest(
ticket_to_session_update_request_map_.insert(
std::make_pair(ticket, std::move(session_update_request)));

LOG(INFO) << "YO THOR Generate session update request of drm system ("
<< sb_drm_ << "), type: " << GetInitDataTypeName(init_data_type)
LOG(INFO) << "Generate session update request of drm system (" << sb_drm_
<< "), type: " << GetInitDataTypeName(init_data_type)
<< ", init data size: " << init_data.size()
<< ", ticket: " << ticket;

Expand All @@ -162,7 +162,7 @@ void StarboardCdm::CreateSessionAndGenerateRequest(
void StarboardCdm::LoadSession(CdmSessionType session_type,
const std::string& session_id,
std::unique_ptr<NewSessionCdmPromise> promise) {
DLOG(INFO) << "YO THOR StarboardCdm - Load session - not impl yet!";
LOG(INFO) << "StarboardCdm - Load session - not impl yet!";
}

void StarboardCdm::UpdateSession(const std::string& session_id,
Expand Down Expand Up @@ -197,7 +197,7 @@ void StarboardCdm::UpdateSession(const std::string& session_id,

ticket_to_session_update_map_.insert(std::make_pair(ticket, session_update));

LOG(INFO) << "YO THOR Update session of drm system (" << sb_drm_
LOG(INFO) << "Update session of drm system (" << sb_drm_
<< "), key length: " << response.size() << ", ticket: " << ticket
<< ", session id: " << session_id;

Expand Down Expand Up @@ -229,8 +229,8 @@ void StarboardCdm::CloseSession(const std::string& session_id,
// Runs the parallel steps from https://w3c.github.io/encrypted-media/#remove.
void StarboardCdm::RemoveSession(const std::string& session_id,
std::unique_ptr<SimpleCdmPromise> promise) {
// TODO - DO WE NEED THIS?
LOG(INFO) << "YO THOR2 - STARBOARD CDM - REMOVE SESSION";
// TODO(sideboard) - DO WE NEED THIS?
LOG(INFO) << "STARBOARD CDM - REMOVE SESSION";
auto it = session_map_.find(session_id);
if (it == session_map_.end()) {
promise->reject(CdmPromise::Exception::INVALID_STATE_ERROR, 0,
Expand Down Expand Up @@ -405,7 +405,7 @@ void StarboardCdm::OnSessionUpdateRequestGeneratedFunc(
static_cast<const char*>(session_id) + session_id_size);
}

LOG(INFO) << "YO THOR Receiving session update request notification from drm "
LOG(INFO) << "Receiving session update request notification from drm "
"system ("
<< sb_drm << "), status: " << status << ", type: " << type
<< ", ticket: " << ticket
Expand Down

0 comments on commit df874e5

Please sign in to comment.