diff options
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/chrome.gyp | 4 | ||||
-rw-r--r-- | chrome/common/gpu_messages_internal.h | 4 | ||||
-rw-r--r-- | chrome/common/gpu_video_common.cc | 2 | ||||
-rw-r--r-- | chrome/common/gpu_video_common.h | 3 | ||||
-rw-r--r-- | chrome/gpu/gpu_video_decoder.cc | 28 | ||||
-rw-r--r-- | chrome/gpu/media/mft_angle_video_device.cc | 52 | ||||
-rw-r--r-- | chrome/gpu/media/mft_angle_video_device.h | 42 | ||||
-rw-r--r-- | chrome/renderer/gpu_video_decoder_host.cc | 4 | ||||
-rw-r--r-- | chrome/renderer/media/gles2_video_decode_context.cc | 6 |
9 files changed, 10 insertions, 135 deletions
diff --git a/chrome/chrome.gyp b/chrome/chrome.gyp index 3ccc202..4e2a038 100644 --- a/chrome/chrome.gyp +++ b/chrome/chrome.gyp @@ -787,10 +787,6 @@ ], }, ], - 'sources': [ - 'gpu/media/mft_angle_video_device.cc', - 'gpu/media/mft_angle_video_device.h', - ], }], ['OS=="linux" and target_arch!="arm"', { 'sources': [ diff --git a/chrome/common/gpu_messages_internal.h b/chrome/common/gpu_messages_internal.h index b95a534..f61be25b1 100644 --- a/chrome/common/gpu_messages_internal.h +++ b/chrome/common/gpu_messages_internal.h @@ -348,8 +348,8 @@ IPC_BEGIN_MESSAGES(GpuVideoDecoderHost) // GpuVideoDecoder reports that a video frame is ready to be consumed. IPC_MESSAGE_ROUTED4(GpuVideoDecoderHostMsg_ConsumeVideoFrame, int32, /* Video Frame ID */ - int64, /* Timestamp in microseconds */ - int64, /* Duration in microseconds */ + int64, /* Timestamp in ms */ + int64, /* Duration in ms */ int32) /* Flags */ // Allocate video frames for output of the hardware video decoder. diff --git a/chrome/common/gpu_video_common.cc b/chrome/common/gpu_video_common.cc index 67466b9..e0279de 100644 --- a/chrome/common/gpu_video_common.cc +++ b/chrome/common/gpu_video_common.cc @@ -4,8 +4,6 @@ #include "chrome/common/gpu_video_common.h" -const int32 kGpuVideoInvalidFrameId = -1; - namespace IPC { /////////////////////////////////////////////////////////////////////////////// diff --git a/chrome/common/gpu_video_common.h b/chrome/common/gpu_video_common.h index d5a2ced..17d5498 100644 --- a/chrome/common/gpu_video_common.h +++ b/chrome/common/gpu_video_common.h @@ -10,9 +10,6 @@ #include "chrome/common/common_param_traits.h" #include "media/base/video_frame.h" -// This is used in messages when only buffer flag is meaningful. -extern const int32 kGpuVideoInvalidFrameId; - // Flags assigned to a video buffer for both input and output. enum GpuVideoBufferFlag { kGpuVideoEndOfStream = 1 << 0, diff --git a/chrome/gpu/gpu_video_decoder.cc b/chrome/gpu/gpu_video_decoder.cc index 0cd9d14..86bcd04 100644 --- a/chrome/gpu/gpu_video_decoder.cc +++ b/chrome/gpu/gpu_video_decoder.cc @@ -4,9 +4,7 @@ #include "chrome/gpu/gpu_video_decoder.h" -#include "base/command_line.h" #include "chrome/common/child_thread.h" -#include "chrome/common/chrome_switches.h" #include "chrome/common/gpu_messages.h" #include "chrome/gpu/gpu_channel.h" #include "chrome/gpu/media/fake_gl_video_decode_engine.h" @@ -14,12 +12,6 @@ #include "media/base/data_buffer.h" #include "media/base/video_frame.h" -#if defined(OS_WIN) -#include "chrome/gpu/media/mft_angle_video_device.h" -#include "media/video/mft_h264_decode_engine.h" -#include <d3d9.h> -#endif - void GpuVideoDecoder::OnChannelConnected(int32 peer_pid) { } @@ -113,12 +105,7 @@ void GpuVideoDecoder::ProduceVideoSample(scoped_refptr<Buffer> buffer) { } void GpuVideoDecoder::ConsumeVideoFrame(scoped_refptr<VideoFrame> frame) { - if (frame->IsEndOfStream()) { - SendConsumeVideoFrame(kGpuVideoInvalidFrameId, 0, 0, kGpuVideoEndOfStream); - return; - } - - int32 frame_id = kGpuVideoInvalidFrameId; + int32 frame_id = -1; for (VideoFrameMap::iterator i = video_frame_map_.begin(); i != video_frame_map_.end(); ++i) { if (i->second == frame) { @@ -129,7 +116,8 @@ void GpuVideoDecoder::ConsumeVideoFrame(scoped_refptr<VideoFrame> frame) { DCHECK_NE(-1, frame_id) << "VideoFrame not recognized"; SendConsumeVideoFrame(frame_id, frame->GetTimestamp().InMicroseconds(), - frame->GetDuration().InMicroseconds(), 0); + frame->GetDuration().InMicroseconds(), + frame->IsEndOfStream() ? kGpuVideoEndOfStream : 0); } void* GpuVideoDecoder::GetDevice() { @@ -237,16 +225,8 @@ GpuVideoDecoder::GpuVideoDecoder( // TODO(jiesun): find a better way to determine which VideoDecodeEngine // to return on current platform. -#if defined(OS_WIN) - const CommandLine& command_line = *CommandLine::ForCurrentProcess(); - if (command_line.HasSwitch(switches::kEnableAcceleratedDecoding)) { - decode_engine_.reset(new media::MftH264DecodeEngine(true)); - video_device_.reset(new MftAngleVideoDevice()); - } -#else decode_engine_.reset(new FakeGlVideoDecodeEngine()); video_device_.reset(new FakeGlVideoDevice()); -#endif } void GpuVideoDecoder::OnInitialize(const GpuVideoDecoderInitParam& param) { @@ -255,7 +235,7 @@ void GpuVideoDecoder::OnInitialize(const GpuVideoDecoderInitParam& param) { config_.width = param.width; config_.height = param.height; config_.opaque_context = NULL; - decode_engine_->Initialize(message_loop_, this, this, config_); + decode_engine_->Initialize(NULL, this, this, config_); } void GpuVideoDecoder::OnUninitialize() { diff --git a/chrome/gpu/media/mft_angle_video_device.cc b/chrome/gpu/media/mft_angle_video_device.cc deleted file mode 100644 index 1faf9dc..0000000 --- a/chrome/gpu/media/mft_angle_video_device.cc +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chrome/gpu/media/mft_angle_video_device.h" - -#include <d3d9.h> - -#include "media/base/video_frame.h" -#include "third_party/angle/src/libGLESv2/main.h" - -MftAngleVideoDevice::MftAngleVideoDevice() - : device_(reinterpret_cast<egl::Display*>( - eglGetCurrentDisplay())->getDevice()) { -} - -void* MftAngleVideoDevice::GetDevice() { - return device_; -} - -bool MftAngleVideoDevice::CreateVideoFrameFromGlTextures( - size_t width, size_t height, media::VideoFrame::Format format, - const std::vector<media::VideoFrame::GlTexture>& textures, - scoped_refptr<media::VideoFrame>* frame) { - media::VideoFrame::GlTexture texture_array[media::VideoFrame::kMaxPlanes]; - memset(texture_array, 0, sizeof(texture_array)); - - for (size_t i = 0; i < textures.size(); ++i) { - texture_array[i] = textures[i]; - } - - media::VideoFrame::CreateFrameGlTexture(format, - width, - height, - texture_array, - frame); - return *frame != NULL; -} - -void MftAngleVideoDevice::ReleaseVideoFrame( - const scoped_refptr<media::VideoFrame>& frame) { - // We didn't need to anything here because we didn't allocate any resources - // for the VideoFrame(s) generated. -} - -bool MftAngleVideoDevice::UploadToVideoFrame( - void* buffer, scoped_refptr<media::VideoFrame> frame) { - gl::Context* context = (gl::Context*)eglGetCurrentContext(); - // TODO(hclam): Connect ANGLE to upload the surface to texture when changes - // to ANGLE is done. - return true; -} diff --git a/chrome/gpu/media/mft_angle_video_device.h b/chrome/gpu/media/mft_angle_video_device.h deleted file mode 100644 index fb1e0e8..0000000 --- a/chrome/gpu/media/mft_angle_video_device.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CHROME_GPU_MEDIA_MFT_ANGLE_VIDEO_DEVICE_H_ -#define CHROME_GPU_MEDIA_MFT_ANGLE_VIDEO_DEVICE_H_ - -#include "base/scoped_comptr_win.h" -#include "chrome/gpu/media/gpu_video_device.h" - -struct IDirect3DDevice9; -extern "C" const GUID IID_IDirect3DDevice9; - -namespace media { -class VideoFrame; -} // namespace media - -// This class is used to provide hardware video device, video frames and -// allow video frames to be uploaded to their final render target. -// -// This specifically serves MftH264DecodeEngine in the context of ANGLE. -class MftAngleVideoDevice : public GpuVideoDevice { - public: - MftAngleVideoDevice(); - virtual ~MftAngleVideoDevice() {} - - // GpuVideoDevice implementation. - virtual void* GetDevice(); - virtual bool CreateVideoFrameFromGlTextures( - size_t width, size_t height, media::VideoFrame::Format format, - const std::vector<media::VideoFrame::GlTexture>& textures, - scoped_refptr<media::VideoFrame>* frame); - virtual void ReleaseVideoFrame( - const scoped_refptr<media::VideoFrame>& frame); - virtual bool UploadToVideoFrame(void* buffer, - scoped_refptr<media::VideoFrame> frame); - - private: - ScopedComPtr<IDirect3DDevice9, &IID_IDirect3DDevice9> device_; -}; - -#endif // CHROME_GPU_MEDIA_MFT_ANGLE_VIDEO_DEVICE_H_ diff --git a/chrome/renderer/gpu_video_decoder_host.cc b/chrome/renderer/gpu_video_decoder_host.cc index bf6c79f..ad81004 100644 --- a/chrome/renderer/gpu_video_decoder_host.cc +++ b/chrome/renderer/gpu_video_decoder_host.cc @@ -272,8 +272,8 @@ void GpuVideoDecoderHost::OnConsumeVideoFrame(int32 frame_id, int64 timestamp, frame = video_frame_map_[frame_id]; DCHECK(frame) << "Invalid frame ID received"; - frame->SetDuration(base::TimeDelta::FromMicroseconds(duration)); - frame->SetTimestamp(base::TimeDelta::FromMicroseconds(timestamp)); + frame->SetDuration(base::TimeDelta::FromMilliseconds(duration)); + frame->SetTimestamp(base::TimeDelta::FromMilliseconds(timestamp)); } event_handler_->ConsumeVideoFrame(frame); diff --git a/chrome/renderer/media/gles2_video_decode_context.cc b/chrome/renderer/media/gles2_video_decode_context.cc index e32e22b..bd60ea1 100644 --- a/chrome/renderer/media/gles2_video_decode_context.cc +++ b/chrome/renderer/media/gles2_video_decode_context.cc @@ -56,10 +56,8 @@ void Gles2VideoDecodeContext::AllocateVideoFrames( glGenTextures(planes, textures); for (int j = 0; j < planes; ++j) { glBindTexture(GL_TEXTURE_2D, textures[j]); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexImage2D(GL_TEXTURE_2D, 0, gl_format, width, height, 0, gl_format, GL_UNSIGNED_BYTE, NULL); } |