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

Unified Diff: media/gpu/avda_codec_allocator.cc

Issue 2697643003: media: Clean up MediaCodecBridge and remove subclasses (Closed)
Patch Set: rebase Created 3 years, 10 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/gpu/avda_codec_allocator.h ('k') | media/gpu/avda_codec_allocator_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/gpu/avda_codec_allocator.cc
diff --git a/media/gpu/avda_codec_allocator.cc b/media/gpu/avda_codec_allocator.cc
index bbf96156ea4d85280e8bba9b69dbbd319f80b7c0..0c6cd74fc66bcc019674225faf55c89e67bd0478 100644
--- a/media/gpu/avda_codec_allocator.cc
+++ b/media/gpu/avda_codec_allocator.cc
@@ -34,7 +34,7 @@ constexpr base::TimeDelta kHungTaskDetectionTimeout =
base::TimeDelta::FromMilliseconds(800);
// Delete |codec| and signal |done_event| if it's not null.
-void DeleteMediaCodecAndSignal(std::unique_ptr<VideoCodecBridge> codec,
+void DeleteMediaCodecAndSignal(std::unique_ptr<MediaCodecBridge> codec,
base::WaitableEvent* done_event) {
codec.reset();
if (done_event)
@@ -234,7 +234,7 @@ void AVDACodecAllocator::OnSurfaceDestroyed(int surface_id) {
DLOG(WARNING) << __func__ << ": timed out waiting for MediaCodec#release()";
}
-std::unique_ptr<VideoCodecBridge> AVDACodecAllocator::CreateMediaCodecSync(
+std::unique_ptr<MediaCodecBridge> AVDACodecAllocator::CreateMediaCodecSync(
scoped_refptr<CodecConfig> codec_config) {
TRACE_EVENT0("media", "AVDA::CreateMediaCodecSync");
@@ -245,11 +245,13 @@ std::unique_ptr<VideoCodecBridge> AVDACodecAllocator::CreateMediaCodecSync(
DCHECK(!codec_config->needs_protected_surface || media_crypto);
const bool require_software_codec = codec_config->task_type == SW_CODEC;
- std::unique_ptr<VideoCodecBridge> codec(VideoCodecBridge::CreateDecoder(
- codec_config->codec, codec_config->needs_protected_surface,
- codec_config->initial_expected_coded_size,
- codec_config->surface.j_surface().obj(), media_crypto, codec_config->csd0,
- codec_config->csd1, true, require_software_codec));
+ std::unique_ptr<MediaCodecBridge> codec(
+ MediaCodecBridgeImpl::CreateVideoDecoder(
+ codec_config->codec, codec_config->needs_protected_surface,
+ codec_config->initial_expected_coded_size,
+ codec_config->surface.j_surface().obj(), media_crypto,
+ codec_config->csd0, codec_config->csd1, true,
+ require_software_codec));
return codec;
}
@@ -265,7 +267,7 @@ void AVDACodecAllocator::CreateMediaCodecAsync(
}
void AVDACodecAllocator::ReleaseMediaCodec(
- std::unique_ptr<VideoCodecBridge> media_codec,
+ std::unique_ptr<MediaCodecBridge> media_codec,
TaskType task_type,
int surface_id) {
DCHECK(thread_checker_.CalledOnValidThread());
« no previous file with comments | « media/gpu/avda_codec_allocator.h ('k') | media/gpu/avda_codec_allocator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698