SoftMPEG4.h revision 7f616d3cc5366a4b8af20d3d0c768e3de1df0666
1bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber/* 2bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber * Copyright (C) 2011 The Android Open Source Project 3bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber * 4bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber * Licensed under the Apache License, Version 2.0 (the "License"); 5bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber * you may not use this file except in compliance with the License. 6bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber * You may obtain a copy of the License at 7bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber * 8bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber * http://www.apache.org/licenses/LICENSE-2.0 9bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber * 10bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber * Unless required by applicable law or agreed to in writing, software 11bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber * distributed under the License is distributed on an "AS IS" BASIS, 12bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber * See the License for the specific language governing permissions and 14bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber * limitations under the License. 15bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber */ 16bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber 17bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber#ifndef SOFT_MPEG4_H_ 18bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber 19bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber#define SOFT_MPEG4_H_ 20bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber 217f616d3cc5366a4b8af20d3d0c768e3de1df0666Lajos Molnar#include "SoftVideoDecoderOMXComponent.h" 22bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber 23bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huberstruct tagvideoDecControls; 24bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber 25bbba88cb1bdc34705d1477208990a06904c022e7Andreas Hubernamespace android { 26bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber 277f616d3cc5366a4b8af20d3d0c768e3de1df0666Lajos Molnarstruct SoftMPEG4 : public SoftVideoDecoderOMXComponent { 28bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber SoftMPEG4(const char *name, 297f616d3cc5366a4b8af20d3d0c768e3de1df0666Lajos Molnar const char *componentRole, 307f616d3cc5366a4b8af20d3d0c768e3de1df0666Lajos Molnar OMX_VIDEO_CODINGTYPE codingType, 317f616d3cc5366a4b8af20d3d0c768e3de1df0666Lajos Molnar const CodecProfileLevel *profileLevels, 327f616d3cc5366a4b8af20d3d0c768e3de1df0666Lajos Molnar size_t numProfileLevels, 33bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber const OMX_CALLBACKTYPE *callbacks, 34bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber OMX_PTR appData, 35bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber OMX_COMPONENTTYPE **component); 36bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber 37bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huberprotected: 38bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber virtual ~SoftMPEG4(); 39bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber 40bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber virtual void onQueueFilled(OMX_U32 portIndex); 41bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber virtual void onPortFlushCompleted(OMX_U32 portIndex); 42d94e716af0e49d775f0c0c4f36dd2c136ba5f2b2Andreas Huber virtual void onReset(); 43bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber 44bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huberprivate: 45bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber enum { 46bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber kNumInputBuffers = 4, 47bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber kNumOutputBuffers = 2, 48bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber }; 49bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber 50bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber enum { 51bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber MODE_MPEG4, 52bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber MODE_H263, 53bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber } mMode; 54bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber 55bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber tagvideoDecControls *mHandle; 56bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber 57bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber size_t mInputBufferCount; 58bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber 59bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber bool mSignalledError; 60bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber bool mInitialized; 61bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber bool mFramesConfigured; 62bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber 63bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber int32_t mNumSamplesOutput; 64269a355679fce6a71523faeefc2ff575abbd1a8eLajos Molnar int32_t mPvTime; 65269a355679fce6a71523faeefc2ff575abbd1a8eLajos Molnar KeyedVector<int32_t, OMX_TICKS> mPvToOmxTimeMap; 66bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber 67bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber status_t initDecoder(); 68bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber 697f616d3cc5366a4b8af20d3d0c768e3de1df0666Lajos Molnar virtual void updatePortDefinitions(); 70bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber bool portSettingsChanged(); 71bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber 72bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber DISALLOW_EVIL_CONSTRUCTORS(SoftMPEG4); 73bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber}; 74bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber 75bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber} // namespace android 76bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber 77bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber#endif // SOFT_MPEG4_H_ 78bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber 79bbba88cb1bdc34705d1477208990a06904c022e7Andreas Huber 80