Skip to content

Commit 9737575

Browse files
janherlingmetafacebook-github-bot
authored andcommitted
Fixed pixel origin in Media::MediaFoundation
Summary: The pixel origin is always in the top-left corner. Reviewed By: enpe Differential Revision: D78194681 Privacy Context Container: L1241821 fbshipit-source-id: f1941a84ed63d96cf0abb378fb4244b50797da92
1 parent 37e4ad3 commit 9737575

3 files changed

Lines changed: 1 addition & 23 deletions

File tree

impl/ocean/media/mediafoundation/MFFrameMedium.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ bool MFFrameMedium::extractMediaFrameType(IMFMediaType* mediaType, MediaFrameTyp
156156
}
157157

158158
const FrameType::PixelFormat pixelFormat = Utilities::mediaSubtypeToPixelFormat(mediaSubType);
159-
const FrameType::PixelOrigin pixelOrigin = Utilities::extractPixelOrigin(mediaSubType);
159+
constexpr FrameType::PixelOrigin pixelOrigin = FrameType::ORIGIN_UPPER_LEFT;
160160

161161
frameType = MediaFrameType(frameType, pixelFormat, pixelOrigin);
162162

impl/ocean/media/mediafoundation/Utilities.cpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -399,21 +399,6 @@ FrameType::PixelFormat Utilities::mediaSubtypeToPixelFormat(const GUID& mediaSub
399399
return FrameType::FORMAT_UNDEFINED;
400400
}
401401

402-
FrameType::PixelOrigin Utilities::extractPixelOrigin(const GUID& mediaSubtype)
403-
{
404-
if (mediaSubtype == MFVideoFormat_RGB24 || mediaSubtype == MFVideoFormat_RGB32)
405-
{
406-
return FrameType::ORIGIN_LOWER_LEFT;
407-
}
408-
409-
if (mediaSubtype == MFVideoFormat_I420 || mediaSubtype == MFVideoFormat_IYUV || mediaSubtype == MFVideoFormat_YUY2 || mediaSubtype == MFVideoFormat_NV12 || mediaSubtype == MFVideoFormat_YV12)
410-
{
411-
return FrameType::ORIGIN_UPPER_LEFT;
412-
}
413-
414-
return FrameType::ORIGIN_INVALID;
415-
}
416-
417402
GUID Utilities::convertPixelFormat(const FrameType::PixelFormat pixelFormat)
418403
{
419404
switch (pixelFormat)

impl/ocean/media/mediafoundation/Utilities.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -131,13 +131,6 @@ class OCEAN_MEDIA_MF_EXPORT Utilities
131131
*/
132132
static FrameType::PixelFormat mediaSubtypeToPixelFormat(const GUID& mediaSubtype);
133133

134-
/**
135-
* Returns the pixel origin of a Media Foundation media subtype.
136-
* @param mediaSubtype Media Foundation media type to return the pixel origin for
137-
* @return Pixel origin
138-
*/
139-
static FrameType::PixelOrigin extractPixelOrigin(const GUID& mediaSubtype);
140-
141134
/**
142135
* Converts a pixel format to a Media Foundation media subtype.
143136
* @param pixelFormat Pixel format

0 commit comments

Comments
 (0)