Skip to content

Commit

Permalink
av: Missing changes for STE OMX multimedia
Browse files Browse the repository at this point in the history
Change-Id: Id5064e2785e43969372d699bea155d5b88668ebe
  • Loading branch information
Eskuero committed Jul 28, 2013
1 parent 46b3fb5 commit d8f7a18
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 6 deletions.
7 changes: 6 additions & 1 deletion include/media/stagefright/MediaDefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,14 @@ extern const char *MEDIA_MIMETYPE_VIDEO_VPX;
extern const char *MEDIA_MIMETYPE_VIDEO_AVC;
extern const char *MEDIA_MIMETYPE_VIDEO_MPEG4;
extern const char *MEDIA_MIMETYPE_VIDEO_H263;
#ifdef STE_HARDWARE
extern const char *MEDIA_MIMETYPE_VIDEO_H263_SW;
#endif
extern const char *MEDIA_MIMETYPE_VIDEO_MPEG2;
extern const char *MEDIA_MIMETYPE_VIDEO_RAW;

#ifdef STE_HARDWARE
extern const char *MEDIA_MIMETYPE_VIDEO_VC1;
#endif
extern const char *MEDIA_MIMETYPE_AUDIO_AMR_NB;
extern const char *MEDIA_MIMETYPE_AUDIO_AMR_WB;
extern const char *MEDIA_MIMETYPE_AUDIO_MPEG; // layer III
Expand Down
7 changes: 6 additions & 1 deletion media/libstagefright/MediaDefs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,14 @@ const char *MEDIA_MIMETYPE_VIDEO_VPX = "video/x-vnd.on2.vp8";
const char *MEDIA_MIMETYPE_VIDEO_AVC = "video/avc";
const char *MEDIA_MIMETYPE_VIDEO_MPEG4 = "video/mp4v-es";
const char *MEDIA_MIMETYPE_VIDEO_H263 = "video/3gpp";
#ifdef STE_HARDWARE
const char *MEDIA_MIMETYPE_VIDEO_H263_SW = "video/3gpp-sw";
#endif
const char *MEDIA_MIMETYPE_VIDEO_MPEG2 = "video/mpeg2";
const char *MEDIA_MIMETYPE_VIDEO_RAW = "video/raw";

#ifdef STE_HARDWARE
const char *MEDIA_MIMETYPE_VIDEO_VC1 = "video/vc1";
#endif
const char *MEDIA_MIMETYPE_AUDIO_AMR_NB = "audio/3gpp";
const char *MEDIA_MIMETYPE_AUDIO_AMR_WB = "audio/amr-wb";
const char *MEDIA_MIMETYPE_AUDIO_MPEG = "audio/mpeg";
Expand Down
20 changes: 16 additions & 4 deletions media/libstagefright/OMXCodec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,8 @@ uint32_t OMXCodec::OmxToHALFormat(OMX_COLOR_FORMATTYPE omxValue) {
switch (omxValue) {
case OMX_STE_COLOR_FormatYUV420PackedSemiPlanarMB:
return HAL_PIXEL_FORMAT_YCBCR42XMBN;
case OMX_COLOR_FormatYUV420Planar:
return HAL_PIXEL_FORMAT_YCbCr_420_P;
default:
ALOGI("Unknown OMX pixel format (0x%X), passing it on unchanged", omxValue);
return omxValue;
Expand Down Expand Up @@ -312,6 +314,12 @@ uint32_t OMXCodec::getComponentQuirks(
index, "input-buffer-sizes-are-bogus")) {
quirks |= kInputBufferSizesAreBogus;
}
#ifdef STE_HARDWARE
if (list->codecHasQuirk(
index, "requires-store-metadata-before-idle")) {
quirks |= kRequiresStoreMetaDataBeforeIdle;
}
#endif
#ifdef QCOM_HARDWARE
if (list->codecHasQuirk(
index, "requires-global-flush")) {
Expand Down Expand Up @@ -1783,6 +1791,10 @@ void OMXCodec::setComponentRole(
"video_decoder.mpeg4", "video_encoder.mpeg4" },
{ MEDIA_MIMETYPE_VIDEO_H263,
"video_decoder.h263", "video_encoder.h263" },
#ifdef STE_HARDWARE
{ MEDIA_MIMETYPE_VIDEO_VC1,
"video_decoder.vc1", "video_encoder.vc1" },
#endif
{ MEDIA_MIMETYPE_VIDEO_VPX,
"video_decoder.vpx", "video_encoder.vpx" },
{ MEDIA_MIMETYPE_AUDIO_RAW,
Expand Down Expand Up @@ -2184,8 +2196,12 @@ status_t OMXCodec::allocateOutputBuffersFromNativeWindow() {
#endif
#ifdef QCOM_HARDWARE
format
#else
#ifdef STE_HARDWARE
OmxToHALFormat(def.format.video.eColorFormat)
#else
def.format.video.eColorFormat
#endif
#endif
);
#else
Expand Down Expand Up @@ -2227,11 +2243,7 @@ status_t OMXCodec::allocateOutputBuffersFromNativeWindow() {
mNativeWindow.get(),
def.format.video.nFrameWidth,
def.format.video.nFrameHeight,
#ifdef STE_HARDWARE
OmxToHALFormat(def.format.video.eColorFormat));
#else
eColorFormat);
#endif
#endif

if (err != 0) {
Expand Down

0 comments on commit d8f7a18

Please sign in to comment.