summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authortfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-12 20:53:23 +0000
committertfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-12 20:53:23 +0000
commit8ee65baac4ab9e3beb67674adbc6a210e2708604 (patch)
tree44400d118d7813a8d7e16a67f074c6696f8868b3 /media
parentf1094b0275c82ead4b9aabbda24f5c2b3e8b4a1b (diff)
downloadchromium_src-8ee65baac4ab9e3beb67674adbc6a210e2708604.zip
chromium_src-8ee65baac4ab9e3beb67674adbc6a210e2708604.tar.gz
chromium_src-8ee65baac4ab9e3beb67674adbc6a210e2708604.tar.bz2
Include base/win/scoped_comptr.h instead of base/scoped_comptr_win.h.
Fix up all the callers to use the new location and namespace. Also, delete the stub file since it isn't included by anyone more. (Note: This was a TODO for brettw). BUG=None TEST=None R=brettw@chromium.org Review URL: http://codereview.chromium.org/6825055 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81303 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media')
-rw-r--r--media/tools/mfdecoder/main.cc20
-rw-r--r--media/tools/mfdecoder/mfdecoder.cc18
-rw-r--r--media/video/mft_h264_decode_engine.cc26
-rw-r--r--media/video/mft_h264_decode_engine.h7
4 files changed, 36 insertions, 35 deletions
diff --git a/media/tools/mfdecoder/main.cc b/media/tools/mfdecoder/main.cc
index fc576f4..4d35f9d 100644
--- a/media/tools/mfdecoder/main.cc
+++ b/media/tools/mfdecoder/main.cc
@@ -20,8 +20,8 @@
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
#include "base/message_loop.h"
-#include "base/scoped_comptr_win.h"
#include "base/time.h"
+#include "base/win/scoped_comptr.h"
#include "media/base/yuv_convert.h"
#include "media/tools/mfdecoder/mfdecoder.h"
#include "ui/gfx/gdi_util.h"
@@ -166,7 +166,7 @@ static bool PaintMediaBufferOntoWindow(HWND video_window,
static bool PaintD3D9BufferOntoWindow(IDirect3DDevice9* device,
IMFMediaBuffer* video_buffer) {
CHECK(device != NULL);
- ScopedComPtr<IDirect3DSurface9> surface;
+ base::win::ScopedComPtr<IDirect3DSurface9> surface;
HRESULT hr = MFGetService(video_buffer, MR_BUFFER_SERVICE,
IID_PPV_ARGS(surface.Receive()));
if (FAILED(hr)) {
@@ -181,7 +181,7 @@ static bool PaintD3D9BufferOntoWindow(IDirect3DDevice9* device,
LOG(ERROR) << "Device->Clear() failed";
return false;
}
- ScopedComPtr<IDirect3DSurface9> backbuffer;
+ base::win::ScopedComPtr<IDirect3DSurface9> backbuffer;
hr = device->GetBackBuffer(0, 0, D3DBACKBUFFER_TYPE_MONO,
backbuffer.Receive());
if (FAILED(hr)) {
@@ -229,7 +229,7 @@ static bool DrawVideoSample(HWND video_window, media::MFDecoder* decoder,
<< "stream has been reached";
return false;
}
- ScopedComPtr<IMFSample> video_sample;
+ base::win::ScopedComPtr<IMFSample> video_sample;
base::Time decode_time_start(base::Time::Now());
video_sample.Attach(decoder->ReadVideoSample());
if (video_sample.get() == NULL) {
@@ -250,7 +250,7 @@ static bool DrawVideoSample(HWND video_window, media::MFDecoder* decoder,
// For H.264 videos, the number of buffers in the sample is 1.
CHECK_EQ(buffer_count, 1u) << "buffer_count should be equal "
<< "to 1 for H.264 format";
- ScopedComPtr<IMFMediaBuffer> video_buffer;
+ base::win::ScopedComPtr<IMFMediaBuffer> video_buffer;
hr = video_sample->GetBufferByIndex(0, video_buffer.Receive());
if (FAILED(hr)) {
LOG(ERROR) << "Failed to get buffer from sample";
@@ -308,8 +308,8 @@ static IDirect3DDeviceManager9* CreateD3DDevManager(HWND video_window,
CHECK(device != NULL);
int ret = -1;
- ScopedComPtr<IDirect3DDeviceManager9> dev_manager;
- ScopedComPtr<IDirect3D9> d3d;
+ base::win::ScopedComPtr<IDirect3DDeviceManager9> dev_manager;
+ base::win::ScopedComPtr<IDirect3D9> d3d;
d3d.Attach(Direct3DCreate9(D3D_SDK_VERSION));
if (d3d == NULL) {
LOG(ERROR) << "Failed to create D3D9";
@@ -330,7 +330,7 @@ static IDirect3DDeviceManager9* CreateD3DDevManager(HWND video_window,
present_params.FullScreen_RefreshRateInHz = 0;
present_params.PresentationInterval = 0;
- ScopedComPtr<IDirect3DDevice9> temp_device;
+ base::win::ScopedComPtr<IDirect3DDevice9> temp_device;
// D3DCREATE_HARDWARE_VERTEXPROCESSING specifies hardware vertex processing.
HRESULT hr = d3d->CreateDevice(D3DADAPTER_DEFAULT,
@@ -481,8 +481,8 @@ int main(int argc, char** argv) {
LOG(ERROR) << "Failed to create decoder";
return -1;
}
- ScopedComPtr<IDirect3DDeviceManager9> dev_manager;
- ScopedComPtr<IDirect3DDevice9> device;
+ base::win::ScopedComPtr<IDirect3DDeviceManager9> dev_manager;
+ base::win::ScopedComPtr<IDirect3DDevice9> device;
if (decoder->use_dxva2()) {
dev_manager.Attach(CreateD3DDevManager(video_window, device.Receive()));
if (dev_manager.get() == NULL || device.get() == NULL) {
diff --git a/media/tools/mfdecoder/mfdecoder.cc b/media/tools/mfdecoder/mfdecoder.cc
index a2b3ba97..cef40d42 100644
--- a/media/tools/mfdecoder/mfdecoder.cc
+++ b/media/tools/mfdecoder/mfdecoder.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 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.
@@ -16,7 +16,7 @@
#include <windows.h>
#include "base/logging.h"
-#include "base/scoped_comptr_win.h"
+#include "base/win/scoped_comptr.h"
#include "media/tools/mfdecoder/mfdecoder.h"
#pragma comment(lib, "shlwapi.lib")
@@ -89,7 +89,7 @@ bool MFDecoder::Init(const wchar_t* source_url,
IMFSample* MFDecoder::ReadVideoSample() {
CHECK(reader_ != NULL);
CHECK_GE(video_stream_index_, 0);
- ScopedComPtr<IMFSample> video_sample;
+ base::win::ScopedComPtr<IMFSample> video_sample;
DWORD actual_stream_index;
DWORD output_flags;
@@ -153,7 +153,7 @@ bool MFDecoder::InitLibraries() {
bool MFDecoder::InitSourceReader(const wchar_t* source_url,
IDirect3DDeviceManager9* dev_manager) {
CHECK(source_url != NULL);
- ScopedComPtr<IMFAttributes> reader_attributes;
+ base::win::ScopedComPtr<IMFAttributes> reader_attributes;
if (use_dxva2_) {
reader_attributes.Attach(GetDXVA2AttributesForSourceReader(dev_manager));
if (reader_attributes == NULL) {
@@ -176,7 +176,7 @@ IMFAttributes* MFDecoder::GetDXVA2AttributesForSourceReader(
if (!use_dxva2_)
return NULL;
CHECK(dev_manager != NULL);
- ScopedComPtr<IMFAttributes> attributes;
+ base::win::ScopedComPtr<IMFAttributes> attributes;
// Create an attribute store with an initial size of 2.
HRESULT hr = MFCreateAttributes(attributes.Receive(), 2);
@@ -201,7 +201,7 @@ bool MFDecoder::SelectVideoStreamOnly() {
CHECK(reader_ != NULL);
HRESULT hr;
for (DWORD stream_index = 0; ; stream_index++) {
- ScopedComPtr<IMFMediaType> media_type;
+ base::win::ScopedComPtr<IMFMediaType> media_type;
hr = reader_->GetCurrentMediaType(stream_index, media_type.Receive());
if (SUCCEEDED(hr)) {
GUID major_type;
@@ -241,7 +241,7 @@ bool MFDecoder::SelectVideoStreamOnly() {
bool MFDecoder::InitVideoInfo(IDirect3DDeviceManager9* dev_manager) {
CHECK(reader_ != NULL);
CHECK_GE(video_stream_index_, 0);
- ScopedComPtr<IMFMediaType> video_type;
+ base::win::ScopedComPtr<IMFMediaType> video_type;
HRESULT hr = reader_->GetCurrentMediaType(video_stream_index_,
video_type.Receive());
if (FAILED(hr)) {
@@ -267,7 +267,7 @@ bool MFDecoder::InitVideoInfo(IDirect3DDeviceManager9* dev_manager) {
// Try to change to YV12 output format.
const GUID kOutputVideoSubtype = MFVideoFormat_YV12;
- ScopedComPtr<IMFMediaType> output_video_format;
+ base::win::ScopedComPtr<IMFMediaType> output_video_format;
hr = MFCreateMediaType(output_video_format.Receive());
if (FAILED(hr)) {
LOG(ERROR) << "Failed to create a IMFMediaType object for video output";
@@ -301,7 +301,7 @@ bool MFDecoder::InitVideoInfo(IDirect3DDeviceManager9* dev_manager) {
// Send a message to the decoder to tell it to use DXVA2.
if (use_dxva2_) {
// Call GetServiceForStream to get the interface to the video decoder.
- ScopedComPtr<IMFTransform> video_decoder;
+ base::win::ScopedComPtr<IMFTransform> video_decoder;
hr = reader_->GetServiceForStream(video_stream_index_, GUID_NULL,
IID_PPV_ARGS(video_decoder.Receive()));
if (FAILED(hr)) {
diff --git a/media/video/mft_h264_decode_engine.cc b/media/video/mft_h264_decode_engine.cc
index 4acfc7f..e1eb60a 100644
--- a/media/video/mft_h264_decode_engine.cc
+++ b/media/video/mft_h264_decode_engine.cc
@@ -31,7 +31,7 @@ namespace media {
// Creates an empty Media Foundation sample with no buffers.
static IMFSample* CreateEmptySample() {
HRESULT hr;
- ScopedComPtr<IMFSample> sample;
+ base::win::ScopedComPtr<IMFSample> sample;
hr = MFCreateSample(sample.Receive());
if (FAILED(hr)) {
LOG(ERROR) << "Unable to create an empty sample";
@@ -45,11 +45,11 @@ static IMFSample* CreateEmptySample() {
// If |align| is 0, then no alignment is specified.
static IMFSample* CreateEmptySampleWithBuffer(int buffer_length, int align) {
CHECK_GT(buffer_length, 0);
- ScopedComPtr<IMFSample> sample;
+ base::win::ScopedComPtr<IMFSample> sample;
sample.Attach(CreateEmptySample());
if (!sample.get())
return NULL;
- ScopedComPtr<IMFMediaBuffer> buffer;
+ base::win::ScopedComPtr<IMFMediaBuffer> buffer;
HRESULT hr;
if (align == 0) {
// Note that MFCreateMemoryBuffer is same as MFCreateAlignedMemoryBuffer
@@ -84,7 +84,7 @@ static IMFSample* CreateInputSample(const uint8* stream, int size,
int min_size, int alignment) {
CHECK(stream);
CHECK_GT(size, 0);
- ScopedComPtr<IMFSample> sample;
+ base::win::ScopedComPtr<IMFSample> sample;
sample.Attach(CreateEmptySampleWithBuffer(std::max(min_size, size),
alignment));
if (!sample.get()) {
@@ -106,7 +106,7 @@ static IMFSample* CreateInputSample(const uint8* stream, int size,
return NULL;
}
}
- ScopedComPtr<IMFMediaBuffer> buffer;
+ base::win::ScopedComPtr<IMFMediaBuffer> buffer;
hr = sample->GetBufferByIndex(0, buffer.Receive());
if (FAILED(hr)) {
LOG(ERROR) << "Failed to get buffer in sample";
@@ -250,7 +250,7 @@ void MftH264DecodeEngine::ConsumeVideoSample(scoped_refptr<Buffer> buffer) {
if (state_ == kUninitialized) {
LOG(ERROR) << "ConsumeVideoSample: invalid state";
}
- ScopedComPtr<IMFSample> sample;
+ base::win::ScopedComPtr<IMFSample> sample;
PipelineStatistics statistics;
if (!buffer->IsEndOfStream()) {
sample.Attach(
@@ -326,7 +326,7 @@ void MftH264DecodeEngine::ShutdownComLibraries() {
bool MftH264DecodeEngine::EnableDxva() {
IDirect3DDevice9* device = static_cast<IDirect3DDevice9*>(
context_->GetDevice());
- ScopedComPtr<IDirect3DDeviceManager9> device_manager;
+ base::win::ScopedComPtr<IDirect3DDeviceManager9> device_manager;
UINT dev_manager_reset_token = 0;
HRESULT hr = DXVA2CreateDirect3DDeviceManager9(&dev_manager_reset_token,
device_manager.Receive());
@@ -400,7 +400,7 @@ void MftH264DecodeEngine::OnAllocFramesDone() {
}
bool MftH264DecodeEngine::CheckDecodeEngineDxvaSupport() {
- ScopedComPtr<IMFAttributes> attributes;
+ base::win::ScopedComPtr<IMFAttributes> attributes;
HRESULT hr = decode_engine_->GetAttributes(attributes.Receive());
if (FAILED(hr)) {
LOG(ERROR) << "Unlock: Failed to get attributes, hr = "
@@ -427,7 +427,7 @@ bool MftH264DecodeEngine::SetDecodeEngineMediaTypes() {
}
bool MftH264DecodeEngine::SetDecodeEngineInputMediaType() {
- ScopedComPtr<IMFMediaType> media_type;
+ base::win::ScopedComPtr<IMFMediaType> media_type;
HRESULT hr = MFCreateMediaType(media_type.Receive());
if (FAILED(hr)) {
LOG(ERROR) << "Failed to create empty media type object";
@@ -541,7 +541,7 @@ bool MftH264DecodeEngine::DoDecode(const PipelineStatistics& statistics) {
return false;
}
scoped_refptr<VideoFrame> frame;
- ScopedComPtr<IMFSample> output_sample;
+ base::win::ScopedComPtr<IMFSample> output_sample;
if (!use_dxva_) {
output_sample.Attach(
CreateEmptySampleWithBuffer(output_stream_info_.cbSize,
@@ -633,14 +633,14 @@ bool MftH264DecodeEngine::DoDecode(const PipelineStatistics& statistics) {
return true;
}
- ScopedComPtr<IMFMediaBuffer> output_buffer;
+ base::win::ScopedComPtr<IMFMediaBuffer> output_buffer;
hr = output_sample->GetBufferByIndex(0, output_buffer.Receive());
if (FAILED(hr)) {
LOG(ERROR) << "Failed to get buffer from sample";
return true;
}
if (use_dxva_) {
- ScopedComPtr<IDirect3DSurface9, &IID_IDirect3DSurface9> surface;
+ base::win::ScopedComPtr<IDirect3DSurface9, &IID_IDirect3DSurface9> surface;
hr = MFGetService(output_buffer, MR_BUFFER_SERVICE,
IID_PPV_ARGS(surface.Receive()));
if (FAILED(hr)) {
@@ -684,7 +684,7 @@ bool MftH264DecodeEngine::DoDecode(const PipelineStatistics& statistics) {
}
void MftH264DecodeEngine::OnUploadVideoFrameDone(
- ScopedComPtr<IDirect3DSurface9, &IID_IDirect3DSurface9> surface,
+ base::win::ScopedComPtr<IDirect3DSurface9, &IID_IDirect3DSurface9> surface,
scoped_refptr<VideoFrame> frame,
PipelineStatistics statistics) {
// After this method is exited the reference to surface is released.
diff --git a/media/video/mft_h264_decode_engine.h b/media/video/mft_h264_decode_engine.h
index 9ce7935..9a2ca5d 100644
--- a/media/video/mft_h264_decode_engine.h
+++ b/media/video/mft_h264_decode_engine.h
@@ -17,7 +17,7 @@
#include <vector>
#include "base/gtest_prod_util.h"
-#include "base/scoped_comptr_win.h"
+#include "base/win/scoped_comptr.h"
#include "media/video/video_decode_engine.h"
struct IDirect3DSurface9;
@@ -77,11 +77,12 @@ class MftH264DecodeEngine : public media::VideoDecodeEngine {
bool DoDecode(const PipelineStatistics& statistics);
void OnAllocFramesDone();
void OnUploadVideoFrameDone(
- ScopedComPtr<IDirect3DSurface9, &IID_IDirect3DSurface9> surface,
+ base::win::ScopedComPtr<IDirect3DSurface9,
+ &IID_IDirect3DSurface9> surface,
scoped_refptr<media::VideoFrame> frame, PipelineStatistics statistics);
bool use_dxva_;
- ScopedComPtr<IMFTransform> decode_engine_;
+ base::win::ScopedComPtr<IMFTransform> decode_engine_;
MFT_INPUT_STREAM_INFO input_stream_info_;
MFT_OUTPUT_STREAM_INFO output_stream_info_;