1 /* 2 * Copyright (C) 2016 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 #ifndef OMX_UTILS_H_ 18 #define OMX_UTILS_H_ 19 20 /***** DO NOT USE THIS INCLUDE!!! INTERAL ONLY!!! UNLESS YOU RESIDE IN media/libstagefright *****/ 21 22 // OMXUtils contains omx-specific utility functions for stagefright/omx library 23 // TODO: move ACodec and OMXClient into this library 24 25 namespace android { 26 27 template<class T> InitOMXParams(T * params)28static void InitOMXParams(T *params) { 29 memset(params, 0, sizeof(T)); 30 params->nSize = sizeof(T); 31 params->nVersion.s.nVersionMajor = 1; 32 params->nVersion.s.nVersionMinor = 0; 33 params->nVersion.s.nRevision = 0; 34 params->nVersion.s.nStep = 0; 35 } 36 37 status_t StatusFromOMXError(OMX_ERRORTYPE err); 38 39 } // namespace android 40 41 #endif 42