Skip to content

Commit

Permalink
Revert 279958 "Revert "Revert 279650 "Add VaapiVideoEncodeAccele..."
Browse files Browse the repository at this point in the history
This once again broke the cros_x86 builder. I think you want the Range to be static_cast<size_t> not static_cast<uint32>.

http://build.chromium.org/p/chromiumos.chromium/builders/X86%20%28chromium%29/builds/333

chromeos-chrome-38.0.2071.0_alpha-r1: ../../../../../../../home/chrome-bot/chrome_root/src/media/filters/h264_bitstream_buffer_unittest.cc:52:226: error: could not convert 'testing::Range(T, T) [with T = long long unsigned int](65ull)' from 'testing::internal::ParamGenerator<long long unsigned int>' to 'testing::internal::ParamGenerator<unsigned int>'
chromeos-chrome-38.0.2071.0_alpha-r1:  INSTANTIATE_TEST_CASE_P(AppendNumBits,


> Revert "Revert 279650 "Add VaapiVideoEncodeAccelerator for HW-accelerate...""
> 
> Fixing the cros_trunk builder compilation failure in
> h264_bitstream_buffer_unittest, for which this was reverted.
> 
> > Revert 279650 "Add VaapiVideoEncodeAccelerator for HW-accelerate..."
> >
> > Broke the Chrome-on-Chrome OS compile
> >
> > http://master.chrome.corp.google.com:8011/builders/cros%20trunk/builds/21417
> >
> > > Add VaapiVideoEncodeAccelerator for HW-accelerated video encode.
> > >
> > > Add an implementation of VideoEncodeAccelerator utilizing VA-API for
> > > hardware encode on Intel-based ChromeOS platforms.
> > >
> > > BUG=378962
> > > TEST=video_encode_accelerator_unittest
> > >
> > > Review URL: https://codereview.chromium.org/333253002
> >
> > TBR=posciak@chromium.org
> >
> > Review URL: https://codereview.chromium.org/350413002
> >
> > git-svn-id: svn://svn.chromium.org/chrome/trunk/src@279733 0039d316-1c4b-4281-b951-d872f2087c98
> 
> TBR=jamescook@chromium.org
> BUG=388778,378962
> 
> Review URL: https://codereview.chromium.org/356903002

TBR=posciak@chromium.org

Review URL: https://codereview.chromium.org/357903003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@280020 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
jamescook@chromium.org committed Jun 26, 2014
1 parent 75b73b2 commit d0d5018
Show file tree
Hide file tree
Showing 26 changed files with 87 additions and 2,186 deletions.
1 change: 0 additions & 1 deletion chrome/browser/chromeos/login/chrome_restart_request.cc
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ std::string DeriveCommandLine(const GURL& start_url,
::switches::kDisableWebRtcHWEncoding,
::switches::kEnableWebRtcHWVp8Encoding,
#endif
::switches::kEnableVaapiAcceleratedVideoEncode,
#if defined(USE_OZONE)
::switches::kOzonePlatform,
#endif
Expand Down
3 changes: 0 additions & 3 deletions content/browser/gpu/gpu_process_host.cc
Original file line number Diff line number Diff line change
Expand Up @@ -981,9 +981,6 @@ bool GpuProcessHost::LaunchGpuProcess(const std::string& channel_id) {
#endif
switches::kEnableLogging,
switches::kEnableShareGroupAsyncTextureUpload,
#if defined(OS_CHROMEOS)
switches::kEnableVaapiAcceleratedVideoEncode,
#endif
switches::kGpuStartupDialog,
switches::kGpuSandboxAllowSysVShm,
switches::kGpuSandboxFailuresFatal,
Expand Down
3 changes: 0 additions & 3 deletions content/browser/renderer_host/render_process_host_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1255,9 +1255,6 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer(
#if defined(OS_WIN)
switches::kDisableDirectWrite,
switches::kEnableHighResolutionTime,
#endif
#if defined(OS_CHROMEOS)
switches::kEnableVaapiAcceleratedVideoEncode,
#endif
};
renderer_cmd->CopySwitchesFrom(browser_cmd, kSwitchNames,
Expand Down
25 changes: 3 additions & 22 deletions content/common/gpu/media/gpu_video_encode_accelerator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,18 @@
#include "content/common/gpu/media/gpu_video_encode_accelerator.h"

#include "base/callback.h"
#include "base/command_line.h"
#include "base/logging.h"
#include "base/memory/shared_memory.h"
#include "base/message_loop/message_loop_proxy.h"
#include "build/build_config.h"
#include "content/common/gpu/gpu_channel.h"
#include "content/common/gpu/gpu_messages.h"
#include "content/public/common/content_switches.h"
#include "ipc/ipc_message_macros.h"
#include "media/base/limits.h"
#include "media/base/video_frame.h"

#if defined(OS_CHROMEOS) && defined(USE_X11)

#if defined(ARCH_CPU_ARMEL)
#if defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) && defined(USE_X11)
#include "content/common/gpu/media/v4l2_video_encode_accelerator.h"
#elif defined(ARCH_CPU_X86_FAMILY)
#include "content/common/gpu/media/vaapi_video_encode_accelerator.h"
#include "ui/gfx/x/x11_types.h"
#endif

#elif defined(OS_ANDROID) && defined(ENABLE_WEBRTC)
#include "content/common/gpu/media/android_video_encode_accelerator.h"
#endif
Expand Down Expand Up @@ -167,12 +158,8 @@ std::vector<media::VideoEncodeAccelerator::SupportedProfile>
GpuVideoEncodeAccelerator::GetSupportedProfiles() {
std::vector<media::VideoEncodeAccelerator::SupportedProfile> profiles;

#if defined(OS_CHROMEOS) && defined(USE_X11)
#if defined(ARCH_CPU_ARMEL)
#if defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) && defined(USE_X11)
profiles = V4L2VideoEncodeAccelerator::GetSupportedProfiles();
#elif defined(ARCH_CPU_X86_FAMILY)
profiles = VaapiVideoEncodeAccelerator::GetSupportedProfiles();
#endif
#elif defined(OS_ANDROID) && defined(ENABLE_WEBRTC)
profiles = AndroidVideoEncodeAccelerator::GetSupportedProfiles();
#endif
Expand All @@ -183,18 +170,12 @@ GpuVideoEncodeAccelerator::GetSupportedProfiles() {

void GpuVideoEncodeAccelerator::CreateEncoder() {
DCHECK(!encoder_);
#if defined(OS_CHROMEOS) && defined(USE_X11)
#if defined(ARCH_CPU_ARMEL)
#if defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) && defined(USE_X11)
scoped_ptr<V4L2Device> device = V4L2Device::Create(V4L2Device::kEncoder);
if (!device.get())
return;

encoder_.reset(new V4L2VideoEncodeAccelerator(device.Pass()));
#elif defined(ARCH_CPU_X86_FAMILY)
const CommandLine* cmd_line = CommandLine::ForCurrentProcess();
if (cmd_line->HasSwitch(switches::kEnableVaapiAcceleratedVideoEncode))
encoder_.reset(new VaapiVideoEncodeAccelerator(gfx::GetXDisplay()));
#endif
#elif defined(OS_ANDROID) && defined(ENABLE_WEBRTC)
encoder_.reset(new AndroidVideoEncodeAccelerator());
#endif
Expand Down
1 change: 0 additions & 1 deletion content/common/gpu/media/h264_dpb.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ struct H264Picture {
int frame_num_wrap;
int long_term_frame_idx;

media::H264SliceHeader::Type type;
bool idr; // IDR picture?
bool ref; // reference picture?
bool long_term; // long term reference picture?
Expand Down
2 changes: 0 additions & 2 deletions content/common/gpu/media/va.sigs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ const char *vaErrorStr(VAStatus error_status);
VAStatus vaGetConfigAttributes(VADisplay dpy, VAProfile profile, VAEntrypoint entrypoint, VAConfigAttrib *attrib_list, int num_attribs);
VAStatus vaInitialize(VADisplay dpy, int *major_version, int *minor_version);
VAStatus vaMapBuffer(VADisplay dpy, VABufferID buf_id, void **pbuf);
int vaMaxNumEntrypoints (VADisplay dpy);
int vaMaxNumProfiles(VADisplay dpy);
VAStatus vaQueryConfigEntrypoints (VADisplay dpy, VAProfile profile, VAEntrypoint *entrypoint_list, int *num_entrypoints);
VAStatus vaQueryConfigProfiles(VADisplay dpy, VAProfile *profile_list, int *num_profiles);
VAStatus vaRenderPicture(VADisplay dpy, VAContextID context, VABufferID *buffers, int num_buffers);
VAStatus vaSetDisplayAttributes(VADisplay dpy, VADisplayAttribute *attr_list, int num_attributes);
Expand Down
4 changes: 2 additions & 2 deletions content/common/gpu/media/vaapi_h264_decoder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -488,8 +488,8 @@ bool VaapiH264Decoder::DecodePicture() {
return false;
}

if (!vaapi_wrapper_->ExecuteAndDestroyPendingBuffers(
dec_surface->va_surface()->id())) {
if (!vaapi_wrapper_->DecodeAndDestroyPendingBuffers(
dec_surface->va_surface()->id())) {
DVLOG(1) << "Failed decoding picture";
return false;
}
Expand Down
3 changes: 1 addition & 2 deletions content/common/gpu/media/vaapi_h264_decoder_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,7 @@ bool VaapiH264DecoderLoop::Initialize(base::FilePath input_file,
media::VideoCodecProfile profile = media::H264PROFILE_BASELINE;
base::Closure report_error_cb =
base::Bind(&LogOnError, VaapiH264Decoder::VAAPI_ERROR);
wrapper_ = VaapiWrapper::Create(
VaapiWrapper::kDecode, profile, x_display_, report_error_cb);
wrapper_ = VaapiWrapper::Create(profile, x_display_, report_error_cb);
if (!wrapper_.get()) {
LOG(ERROR) << "Can't create vaapi wrapper";
return false;
Expand Down
4 changes: 1 addition & 3 deletions content/common/gpu/media/vaapi_video_decode_accelerator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -300,9 +300,7 @@ bool VaapiVideoDecodeAccelerator::Initialize(media::VideoCodecProfile profile,
}

vaapi_wrapper_ = VaapiWrapper::Create(
VaapiWrapper::kDecode,
profile,
x_display_,
profile, x_display_,
base::Bind(&ReportToUMA, content::VaapiH264Decoder::VAAPI_ERROR));

if (!vaapi_wrapper_.get()) {
Expand Down
Loading

0 comments on commit d0d5018

Please sign in to comment.