Commit c99a81df authored by amineer@chromium.org's avatar amineer@chromium.org

Revert 276260 "Win Video Capture: Add support for HDYC pixel for..."

Reverting on trunk per author's request to eliminate top crasher.

> Win Video Capture: Add support for HDYC pixel format.
> 
> This pixel format is a synonym of YUYV and is needed
> for at least the DeckLink video capture card.
> This format is not specified in Windows headers
> probably because this is just a synonym of other
> pixel formats, IOW they are all the same except for
> the first word, which is the name read in hex
> backwards:
> 30323449 --> 0x30 0x32 0x34 0x49 -> 024I
> 43594448 --> 0x43 0x59 0x44 0x48 -> CYDH
> 
> and then all the YUV (422 and 420 alike) use the same
> trailing sequence 
> ... 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}}
> 
> HDYC: http://www.fourcc.org/yuv.php#HDYC
> 
> BUG=380939
> 
> Review URL: https://codereview.chromium.org/317073010

TBR=mcasas@chromium.org

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@278555 0039d316-1c4b-4281-b951-d872f2087c98
parent 3e7f51c7
......@@ -7,22 +7,16 @@
#include "base/logging.h"
#include "media/video/capture/win/sink_input_pin_win.h"
namespace media {
// Define GUID for I420. This is the color format we would like to support but
// it is not defined in the DirectShow SDK.
// http://msdn.microsoft.com/en-us/library/dd757532.aspx
// 30323449-0000-0010-8000-00AA00389B71.
GUID kMediaSubTypeI420 = {
0x30323449, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71}
};
// UYVY synonym with BT709 color components, used in HD video. This variation
// might appear in non-USB capture cards and it's implemented as a normal YUV
// pixel format with the characters HDYC encoded in the first array word.
GUID kMediaSubTypeHDYC = {
0x43594448, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
0x30323449, 0x0000, 0x0010, { 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71}
};
namespace media {
SinkFilterObserver::~SinkFilterObserver() {}
SinkFilter::SinkFilter(SinkFilterObserver* observer)
......
......@@ -16,17 +16,13 @@
#include "media/video/capture/win/filter_base_win.h"
#include "media/video/capture/win/sink_filter_observer_win.h"
namespace media {
// Define GUID for I420. This is the color format we would like to support but
// it is not defined in the DirectShow SDK.
// http://msdn.microsoft.com/en-us/library/dd757532.aspx
// 30323449-0000-0010-8000-00AA00389B71.
extern GUID kMediaSubTypeI420;
// UYVY synonym with BT709 color components, used in HD video. This variation
// might appear in non-USB capture cards and it's implemented as a normal YUV
// pixel format with the characters HDYC encoded in the first array word.
extern GUID kMediaSubTypeHDYC;
namespace media {
class SinkInputPin;
......
......@@ -219,22 +219,13 @@ static void GetDeviceSupportedFormatsDirectShow(
continue;
}
std::string id;
device_id.Reset();
hr = prop_bag->Read(L"DevicePath", device_id.Receive(), 0);
if (FAILED(hr) || device_id.type() != VT_BSTR) {
// If there is no clear DevicePath, try with Description and FriendlyName.
ScopedVariant name;
if (SUCCEEDED(prop_bag->Read(L"Description", name.Receive(), 0)) ||
SUCCEEDED(prop_bag->Read(L"FriendlyName", name.Receive(), 0))) {
id = base::SysWideToUTF8(V_BSTR(&name));
}
} else {
DCHECK_EQ(device_id.type(), VT_BSTR);
id = base::SysWideToUTF8(V_BSTR(&device_id));
if (FAILED(hr)) {
DVLOG(1) << "Couldn't read a device's DevicePath.";
return;
}
if (device.id() == id)
if (device.id() == base::SysWideToUTF8(V_BSTR(&device_id)))
break;
moniker.Release();
}
......
......@@ -142,7 +142,6 @@ VideoPixelFormat VideoCaptureDeviceWin::TranslateMediaSubtypeToPixelFormat(
{ MEDIASUBTYPE_MJPG, PIXEL_FORMAT_MJPEG },
{ MEDIASUBTYPE_UYVY, PIXEL_FORMAT_UYVY },
{ MEDIASUBTYPE_ARGB32, PIXEL_FORMAT_ARGB },
{ kMediaSubTypeHDYC, PIXEL_FORMAT_UYVY },
};
for (size_t i = 0; i < ARRAYSIZE_UNSAFE(pixel_formats); ++i) {
if (sub_type == pixel_formats[i].sub_type)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment