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

Side by Side Diff: content/common/gpu/media/android_video_encode_accelerator.cc

Issue 1796633002: Revert of content gpu refactor: get rid of gpu related content switches. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/common/gpu/media/android_video_encode_accelerator.h" 5 #include "content/common/gpu/media/android_video_encode_accelerator.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h"
10 #include "base/logging.h" 11 #include "base/logging.h"
11 #include "base/message_loop/message_loop.h" 12 #include "base/message_loop/message_loop.h"
12 #include "base/metrics/histogram.h" 13 #include "base/metrics/histogram.h"
13 #include "content/common/gpu/gpu_channel.h" 14 #include "content/common/gpu/gpu_channel.h"
14 #include "content/common/gpu/media/shared_memory_region.h" 15 #include "content/common/gpu/media/shared_memory_region.h"
16 #include "content/public/common/content_switches.h"
15 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" 17 #include "gpu/command_buffer/service/gles2_cmd_decoder.h"
16 #include "media/base/android/media_codec_util.h" 18 #include "media/base/android/media_codec_util.h"
17 #include "media/base/bitstream_buffer.h" 19 #include "media/base/bitstream_buffer.h"
18 #include "media/base/limits.h" 20 #include "media/base/limits.h"
19 #include "media/video/picture.h" 21 #include "media/video/picture.h"
20 #include "third_party/libyuv/include/libyuv/convert_from.h" 22 #include "third_party/libyuv/include/libyuv/convert_from.h"
21 #include "ui/gl/android/scoped_java_surface.h" 23 #include "ui/gl/android/scoped_java_surface.h"
22 #include "ui/gl/gl_bindings.h" 24 #include "ui/gl/gl_bindings.h"
23 25
24 using media::VideoCodecBridge; 26 using media::VideoCodecBridge;
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 last_set_bitrate_(0) {} 99 last_set_bitrate_(0) {}
98 100
99 AndroidVideoEncodeAccelerator::~AndroidVideoEncodeAccelerator() { 101 AndroidVideoEncodeAccelerator::~AndroidVideoEncodeAccelerator() {
100 DCHECK(thread_checker_.CalledOnValidThread()); 102 DCHECK(thread_checker_.CalledOnValidThread());
101 } 103 }
102 104
103 media::VideoEncodeAccelerator::SupportedProfiles 105 media::VideoEncodeAccelerator::SupportedProfiles
104 AndroidVideoEncodeAccelerator::GetSupportedProfiles() { 106 AndroidVideoEncodeAccelerator::GetSupportedProfiles() {
105 SupportedProfiles profiles; 107 SupportedProfiles profiles;
106 108
109 #if defined(ENABLE_WEBRTC)
110 const base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess();
111 if (cmd_line->HasSwitch(switches::kDisableWebRtcHWEncoding))
112 return profiles;
113 #endif
114
107 const struct { 115 const struct {
108 const media::VideoCodec codec; 116 const media::VideoCodec codec;
109 const media::VideoCodecProfile profile; 117 const media::VideoCodecProfile profile;
110 } kSupportedCodecs[] = { 118 } kSupportedCodecs[] = {
111 { media::kCodecVP8, media::VP8PROFILE_ANY }, 119 { media::kCodecVP8, media::VP8PROFILE_ANY },
112 { media::kCodecH264, media::H264PROFILE_BASELINE }, 120 { media::kCodecH264, media::H264PROFILE_BASELINE },
113 { media::kCodecH264, media::H264PROFILE_MAIN } 121 { media::kCodecH264, media::H264PROFILE_MAIN }
114 }; 122 };
115 123
116 for (const auto& supported_codec : kSupportedCodecs) { 124 for (const auto& supported_codec : kSupportedCodecs) {
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
432 base::MessageLoop::current()->PostTask( 440 base::MessageLoop::current()->PostTask(
433 FROM_HERE, 441 FROM_HERE,
434 base::Bind(&VideoEncodeAccelerator::Client::BitstreamBufferReady, 442 base::Bind(&VideoEncodeAccelerator::Client::BitstreamBufferReady,
435 client_ptr_factory_->GetWeakPtr(), 443 client_ptr_factory_->GetWeakPtr(),
436 bitstream_buffer.id(), 444 bitstream_buffer.id(),
437 size, 445 size,
438 key_frame)); 446 key_frame));
439 } 447 }
440 448
441 } // namespace content 449 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698