Bug 797225 - Part 1: Add an OmxPlugin namespace so we can add local definitions of OMX_COLOR enums that are only defined by some toolchains. r=doublec
authorChris Peterson <cpeterson@mozilla.com>
Mon, 24 Sep 2012 12:31:29 -0700
changeset 109627 5c1ee495765f22815ffcd7503ae87a1f1041a3e2
parent 109626 29cb1f0d796c6e996c466f0b907cdb1cfc9c7d65
child 109628 ea218a65affb3b692791656ffc6156b02f885ba4
push id23636
push usergsharp@mozilla.com
push dateMon, 08 Oct 2012 08:08:19 +0000
treeherdermozilla-central@24cf40690042 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdoublec
bugs797225
milestone18.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 797225 - Part 1: Add an OmxPlugin namespace so we can add local definitions of OMX_COLOR enums that are only defined by some toolchains. r=doublec
media/omx-plugin/OmxPlugin.cpp
--- a/media/omx-plugin/OmxPlugin.cpp
+++ b/media/omx-plugin/OmxPlugin.cpp
@@ -99,16 +99,21 @@ status_t MediaStreamSource::getSize(off6
 
   return OK;
 }
 
 }  // namespace android
 
 using namespace android;
 
+namespace OmxPlugin {
+
+const int OMX_QCOM_COLOR_FormatYVU420PackedSemiPlanar32m4ka = 0x7FA30C01;
+const int OMX_QCOM_COLOR_FormatYVU420SemiPlanar = 0x7FA30C00;
+
 class OmxDecoder {
   PluginHost *mPluginHost;
   Decoder *mDecoder;
 #ifndef MOZ_WIDGET_GONK
   OMXClient mClient;
 #endif
   sp<MediaSource> mVideoTrack;
   sp<MediaSource> mVideoSource;
@@ -585,19 +590,16 @@ void OmxDecoder::ToVideoFrame_YVU420Pack
   aFrame->Set(aTimeUs, aKeyFrame,
               aData, aSize, mVideoStride, mVideoSliceHeight, mVideoRotation,
               y, mVideoStride, mVideoWidth, mVideoHeight, 0, 0,
               uv, mVideoStride, mVideoWidth/2, mVideoHeight/2, 1, 1,
               uv, mVideoStride, mVideoWidth/2, mVideoHeight/2, 0, 1);
 }
 
 bool OmxDecoder::ToVideoFrame(VideoFrame *aFrame, int64_t aTimeUs, void *aData, size_t aSize, bool aKeyFrame) {
-  const int OMX_QCOM_COLOR_FormatYVU420SemiPlanar = 0x7FA30C00;
-  const int OMX_QCOM_COLOR_FormatYVU420PackedSemiPlanar32m4ka = 0x7FA30C01;
-
   switch (mVideoColorFormat) {
   case OMX_COLOR_FormatYUV420Planar: // e.g. Asus Transformer, Stagefright's software decoder
     ToVideoFrame_YUV420Planar(aFrame, aTimeUs, aData, aSize, aKeyFrame);
     break;
   case OMX_COLOR_FormatCbYCrY: // e.g. Droid 1
     ToVideoFrame_CbYCrY(aFrame, aTimeUs, aData, aSize, aKeyFrame);
     break;
   case OMX_COLOR_FormatYUV420SemiPlanar: // e.g. Galaxy S III
@@ -826,13 +828,15 @@ static bool CreateDecoder(PluginHost *aP
   aDecoder->HasAudio = HasAudio;
   aDecoder->ReadVideo = ReadVideo;
   aDecoder->ReadAudio = ReadAudio;
   aDecoder->DestroyDecoder = DestroyDecoder;
 
   return true;
 }
 
+} // namespace OmxPlugin
+
 // Export the manifest so MPAPI can find our entry points.
 Manifest MOZ_EXPORT_DATA(MPAPI_MANIFEST) {
-  CanDecode,
-  CreateDecoder
+  OmxPlugin::CanDecode,
+  OmxPlugin::CreateDecoder
 };