Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(141)

Unified Diff: media/mojo/services/mojo_video_decoder_service.cc

Issue 2951233002: media: Implement MojoVideoDecoder::CanReadWithoutStalling(). (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/mojo/interfaces/video_decoder.mojom ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/mojo/services/mojo_video_decoder_service.cc
diff --git a/media/mojo/services/mojo_video_decoder_service.cc b/media/mojo/services/mojo_video_decoder_service.cc
index a6154ec5ff7961d5ac12535a9cf379832a20b905..2c4885c41ab91062702e91c42d1fd9bb7b95cb65 100644
--- a/media/mojo/services/mojo_video_decoder_service.cc
+++ b/media/mojo/services/mojo_video_decoder_service.cc
@@ -36,9 +36,10 @@ void MojoVideoDecoderService::Construct(
mojom::CommandBufferIdPtr command_buffer_id) {
DVLOG(1) << __func__;
- // TODO(sandersd): Close the channel.
- if (decoder_)
+ if (decoder_) {
+ // TODO(sandersd): Close the channel.
return;
+ }
decoder_ = mojo_media_client_->CreateVideoDecoder(
base::ThreadTaskRunnerHandle::Get(), std::move(command_buffer_id),
@@ -106,8 +107,8 @@ void MojoVideoDecoderService::OnDecoderInitialized(
void MojoVideoDecoderService::OnDecoderRead(
const DecodeCallback& callback,
scoped_refptr<DecoderBuffer> buffer) {
- // TODO(sandersd): Close the channel.
if (!buffer) {
+ // TODO(sandersd): Close the channel.
callback.Run(DecodeStatus::DECODE_ERROR);
return;
}
@@ -120,8 +121,6 @@ void MojoVideoDecoderService::OnDecoderRead(
void MojoVideoDecoderService::OnDecoderDecoded(const DecodeCallback& callback,
DecodeStatus status) {
DVLOG(2) << __func__;
- DCHECK(decoder_);
- DCHECK(decoder_->CanReadWithoutStalling());
callback.Run(status);
}
@@ -135,6 +134,7 @@ void MojoVideoDecoderService::OnDecoderOutput(
const scoped_refptr<VideoFrame>& frame) {
DVLOG(2) << __func__;
DCHECK(client_);
+ DCHECK(decoder_);
base::Optional<base::UnguessableToken> release_token;
if (release_cb) {
@@ -142,7 +142,8 @@ void MojoVideoDecoderService::OnDecoderOutput(
release_mailbox_cbs_[*release_token] = std::move(release_cb);
}
- client_->OnVideoFrameDecoded(frame, std::move(release_token));
+ client_->OnVideoFrameDecoded(frame, decoder_->CanReadWithoutStalling(),
+ std::move(release_token));
}
void MojoVideoDecoderService::OnReleaseMailbox(
« no previous file with comments | « media/mojo/interfaces/video_decoder.mojom ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698