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

Unified Diff: media/mojo/clients/mojo_decryptor.cc

Issue 2416373002: media: Use native Decryptor enum types in media mojo interfaces (Closed)
Patch Set: Created 4 years, 2 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
Index: media/mojo/clients/mojo_decryptor.cc
diff --git a/media/mojo/clients/mojo_decryptor.cc b/media/mojo/clients/mojo_decryptor.cc
index f9a437c85db1ada775aadbee457f9001c63b6e2e..cba4630fd057a60609282cc0d810135d3ce2d8e1 100644
--- a/media/mojo/clients/mojo_decryptor.cc
+++ b/media/mojo/clients/mojo_decryptor.cc
@@ -75,8 +75,7 @@ void MojoDecryptor::Decrypt(StreamType stream_type,
}
remote_decryptor_->Decrypt(
- static_cast<mojom::DemuxerStream::Type>(stream_type),
- std::move(mojo_buffer),
+ stream_type, std::move(mojo_buffer),
base::Bind(&MojoDecryptor::OnBufferDecrypted, weak_factory_.GetWeakPtr(),
decrypt_cb));
}
@@ -85,8 +84,7 @@ void MojoDecryptor::CancelDecrypt(StreamType stream_type) {
DVLOG(1) << __FUNCTION__;
DCHECK(thread_checker_.CalledOnValidThread());
- remote_decryptor_->CancelDecrypt(
- static_cast<mojom::DemuxerStream::Type>(stream_type));
+ remote_decryptor_->CancelDecrypt(stream_type);
}
void MojoDecryptor::InitializeAudioDecoder(const AudioDecoderConfig& config,
@@ -149,16 +147,14 @@ void MojoDecryptor::ResetDecoder(StreamType stream_type) {
DVLOG(1) << __FUNCTION__;
DCHECK(thread_checker_.CalledOnValidThread());
- remote_decryptor_->ResetDecoder(
- static_cast<mojom::DemuxerStream::Type>(stream_type));
+ remote_decryptor_->ResetDecoder(stream_type);
}
void MojoDecryptor::DeinitializeDecoder(StreamType stream_type) {
DVLOG(1) << __FUNCTION__;
DCHECK(thread_checker_.CalledOnValidThread());
- remote_decryptor_->DeinitializeDecoder(
- static_cast<mojom::DemuxerStream::Type>(stream_type));
+ remote_decryptor_->DeinitializeDecoder(stream_type);
}
void MojoDecryptor::OnKeyAdded() {
@@ -173,11 +169,10 @@ void MojoDecryptor::OnKeyAdded() {
}
void MojoDecryptor::OnBufferDecrypted(const DecryptCB& decrypt_cb,
- mojom::Decryptor::Status status,
+ Status status,
mojom::DecoderBufferPtr buffer) {
- DVLOG_IF(1, status != mojom::Decryptor::Status::SUCCESS)
- << __FUNCTION__ << "(" << status << ")";
- DVLOG_IF(3, status == mojom::Decryptor::Status::SUCCESS) << __FUNCTION__;
+ DVLOG_IF(1, status != kSuccess) << __FUNCTION__ << "(" << status << ")";
+ DVLOG_IF(3, status == kSuccess) << __FUNCTION__;
DCHECK(thread_checker_.CalledOnValidThread());
if (buffer.is_null()) {
@@ -197,11 +192,10 @@ void MojoDecryptor::OnBufferDecrypted(const DecryptCB& decrypt_cb,
void MojoDecryptor::OnAudioDecoded(
const AudioDecodeCB& audio_decode_cb,
- mojom::Decryptor::Status status,
+ Status status,
std::vector<mojom::AudioBufferPtr> audio_buffers) {
- DVLOG_IF(1, status != mojom::Decryptor::Status::SUCCESS)
- << __FUNCTION__ << "(" << status << ")";
- DVLOG_IF(3, status == mojom::Decryptor::Status::SUCCESS) << __FUNCTION__;
+ DVLOG_IF(1, status != kSuccess) << __FUNCTION__ << "(" << status << ")";
+ DVLOG_IF(3, status == kSuccess) << __FUNCTION__;
DCHECK(thread_checker_.CalledOnValidThread());
Decryptor::AudioFrames audio_frames;
@@ -212,11 +206,10 @@ void MojoDecryptor::OnAudioDecoded(
}
void MojoDecryptor::OnVideoDecoded(const VideoDecodeCB& video_decode_cb,
- mojom::Decryptor::Status status,
+ Status status,
mojom::VideoFramePtr video_frame) {
- DVLOG_IF(1, status != mojom::Decryptor::Status::SUCCESS)
- << __FUNCTION__ << "(" << status << ")";
- DVLOG_IF(3, status == mojom::Decryptor::Status::SUCCESS) << __FUNCTION__;
+ DVLOG_IF(1, status != kSuccess) << __FUNCTION__ << "(" << status << ")";
+ DVLOG_IF(3, status == kSuccess) << __FUNCTION__;
DCHECK(thread_checker_.CalledOnValidThread());
if (video_frame.is_null()) {

Powered by Google App Engine
This is Rietveld 408576698