├── libstagefrighthw ├── MODULE_LICENSE_APACHE2 ├── Android.mk ├── stagefright_surface_output_msm7x30.cpp ├── QComHardwareRenderer.h ├── QComOMXPlugin.h └── QComHardwareOverlayRenderer.h ├── mm-core ├── omxcore │ ├── inc │ │ ├── OMX_Other.h │ │ ├── OMX_QCOMExtns.h │ │ ├── qc_omx_msg.h │ │ ├── qc_omx_common.h │ │ └── QOMX_AudioIndexExtensions.h │ └── src │ │ └── common │ │ └── qc_omx_core.h └── Android.mk ├── mm-video ├── qdsp6 │ ├── venc │ │ ├── device │ │ │ └── inc │ │ │ │ └── venc_device.h │ │ ├── omx │ │ │ └── src │ │ │ │ └── OMX_Venc.def │ │ ├── common │ │ │ ├── src │ │ │ │ ├── venc_sleep.c │ │ │ │ └── venc_time.c │ │ │ └── inc │ │ │ │ ├── venc_time.h │ │ │ │ ├── venc_sleep.h │ │ │ │ ├── venc_mutex.h │ │ │ │ ├── venc_semaphore.h │ │ │ │ ├── venc_signal.h │ │ │ │ ├── venc_thread.h │ │ │ │ ├── venc_file.h │ │ │ │ └── venc_queue.h │ │ └── test │ │ │ ├── etc │ │ │ └── venctest_Script.cfg │ │ │ └── common │ │ │ ├── src │ │ │ ├── venctest_Time.cpp │ │ │ ├── venctest_Sleeper.cpp │ │ │ ├── venctest_Mutex.cpp │ │ │ └── venctest_Signal.cpp │ │ │ └── inc │ │ │ ├── venctest_Time.h │ │ │ ├── venctest_Sleeper.h │ │ │ ├── venctest_Mutex.h │ │ │ ├── venctest_TestCaseFactory.h │ │ │ ├── venctest_Signal.h │ │ │ ├── venctest_Script.h │ │ │ ├── venctest_TestPmem.h │ │ │ ├── venctest_Pmem.h │ │ │ ├── venctest_TestGetSyntaxHdr.h │ │ │ ├── venctest_Config.h │ │ │ ├── venctest_Thread.h │ │ │ ├── venctest_TestProfileEncode.h │ │ │ ├── venctest_TestEncode.h │ │ │ ├── venctest_TestStatePause.h │ │ │ ├── venctest_TestSerialEncode.h │ │ │ ├── venctest_StatsThread.h │ │ │ ├── venctest_TestChangeQuality.h │ │ │ ├── venctest_TestStateExecutingToIdle.h │ │ │ ├── venctest_Queue.h │ │ │ ├── venctest_TestFlush.h │ │ │ ├── venctest_TestIFrameRequest.h │ │ │ └── venctest_TestChangeIntraPeriod.h │ └── vdec │ │ ├── test │ │ ├── queue.h │ │ └── queue.c │ │ ├── src │ │ ├── pmem.h │ │ ├── omx_vdec_inpbuf.h │ │ ├── omx_vdec_linux.h │ │ ├── qutility.c │ │ └── qtypes.h │ │ └── Makefile ├── vidc │ ├── vdec │ │ ├── inc │ │ │ ├── queue.h │ │ │ ├── message_queue.h │ │ │ ├── decoder_driver_test.h │ │ │ ├── frameparser.h │ │ │ └── qtypes.h │ │ └── src │ │ │ └── queue.c │ └── venc │ │ ├── test │ │ ├── fb_test.c │ │ ├── venc_util.c │ │ └── camera_test.cpp │ │ └── inc │ │ ├── fb_test.h │ │ ├── venc_util.h │ │ ├── camera_test.h │ │ ├── queue.h │ │ ├── omx_video_common.h │ │ ├── omx_video_encoder.h │ │ └── video_encoder_test.h └── Android.mk └── CleanSpec.mk /libstagefrighthw/MODULE_LICENSE_APACHE2: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /mm-core/omxcore/inc/OMX_Other.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redux/android_hardware_qcom_media/gingerbread/mm-core/omxcore/inc/OMX_Other.h -------------------------------------------------------------------------------- /mm-core/omxcore/inc/OMX_QCOMExtns.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redux/android_hardware_qcom_media/gingerbread/mm-core/omxcore/inc/OMX_QCOMExtns.h -------------------------------------------------------------------------------- /mm-video/qdsp6/venc/device/inc/venc_device.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redux/android_hardware_qcom_media/gingerbread/mm-video/qdsp6/venc/device/inc/venc_device.h -------------------------------------------------------------------------------- /libstagefrighthw/Android.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2010 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 | ifeq ($(TARGET_BOARD_PLATFORM),msm7x30) 18 | 19 | LOCAL_PATH := $(call my-dir) 20 | include $(CLEAR_VARS) 21 | 22 | LOCAL_SRC_FILES := \ 23 | stagefright_surface_output_msm7x30.cpp \ 24 | QComHardwareOverlayRenderer.cpp \ 25 | QComOMXPlugin.cpp \ 26 | QComHardwareRenderer.cpp 27 | 28 | 29 | LOCAL_CFLAGS := $(PV_CFLAGS_MINUS_VISIBILITY) 30 | 31 | LOCAL_C_INCLUDES:= \ 32 | $(TOP)/frameworks/base/include/media/stagefright/openmax 33 | 34 | LOCAL_SHARED_LIBRARIES := \ 35 | libbinder \ 36 | libutils \ 37 | libcutils \ 38 | libdl \ 39 | libui \ 40 | libsurfaceflinger_client \ 41 | libhardware 42 | 43 | 44 | LOCAL_MODULE := libstagefrighthw 45 | 46 | include $(BUILD_SHARED_LIBRARY) 47 | 48 | endif 49 | -------------------------------------------------------------------------------- /libstagefrighthw/stagefright_surface_output_msm7x30.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2009 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 | #include 18 | 19 | #include "QComHardwareOverlayRenderer.h" 20 | 21 | using android::sp; 22 | using android::ISurface; 23 | using android::VideoRenderer; 24 | 25 | VideoRenderer *createRendererWithRotation( 26 | const sp &surface, 27 | const char *componentName, 28 | OMX_COLOR_FORMATTYPE colorFormat, 29 | size_t displayWidth, size_t displayHeight, 30 | size_t decodedWidth, size_t decodedHeight, 31 | int32_t rotationDegrees) { 32 | using android::QComHardwareOverlayRenderer; 33 | 34 | if (colorFormat == OMX_COLOR_FormatYUV420SemiPlanar 35 | && !strncmp(componentName, "OMX.qcom.7x30.video.decoder.", 28)) { 36 | return new QComHardwareOverlayRenderer( 37 | surface, displayWidth, displayHeight, 38 | decodedWidth, decodedHeight, 39 | rotationDegrees); 40 | } 41 | return NULL; 42 | } 43 | -------------------------------------------------------------------------------- /mm-video/qdsp6/venc/omx/src/OMX_Venc.def: -------------------------------------------------------------------------------- 1 | ;-------------------------------------------------------------------------- 2 | ;Copyright (c) 2010, Code Aurora Forum. All rights reserved. 3 | 4 | ;Redistribution and use in source and binary forms, with or without 5 | ;modification, are permitted provided that the following conditions are met: 6 | ; * Redistributions of source code must retain the above copyright 7 | ; notice, this list of conditions and the following disclaimer. 8 | ; * Redistributions in binary form must reproduce the above copyright 9 | ; notice, this list of conditions and the following disclaimer in the 10 | ; documentation and/or other materials provided with the distribution. 11 | ; * Neither the name of Code Aurora nor 12 | ; the names of its contributors may be used to endorse or promote 13 | ; products derived from this software without specific prior written 14 | ; permission. 15 | 16 | ;THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | ;AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | ;IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | ;NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | ;CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | ;EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | ;PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | ;OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | ;WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 | ;OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | ;ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | ;-------------------------------------------------------------------------- 28 | 29 | LIBRARY QC_OMXVidEnc 30 | 31 | EXPORTS get_omx_component_factory_fn 32 | -------------------------------------------------------------------------------- /libstagefrighthw/QComHardwareRenderer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2009 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 QCOM_HARDWARE_RENDERER_H_ 18 | 19 | #define QCOM_HARDWARE_RENDERER_H_ 20 | 21 | #include 22 | #include 23 | 24 | namespace android { 25 | 26 | class ISurface; 27 | class MemoryHeapPmem; 28 | 29 | class QComHardwareRenderer : public VideoRenderer { 30 | public: 31 | QComHardwareRenderer( 32 | const sp &surface, 33 | size_t displayWidth, size_t displayHeight, 34 | size_t decodedWidth, size_t decodedHeight, 35 | int32_t rotationDegrees); 36 | 37 | virtual ~QComHardwareRenderer(); 38 | 39 | virtual void render( 40 | const void *data, size_t size, void *platformPrivate); 41 | 42 | private: 43 | sp mISurface; 44 | size_t mDisplayWidth, mDisplayHeight; 45 | size_t mDecodedWidth, mDecodedHeight; 46 | size_t mFrameSize; 47 | int32_t mRotationDegrees; 48 | sp mMemoryHeap; 49 | 50 | bool getOffset(void *platformPrivate, size_t *offset); 51 | void publishBuffers(uint32_t pmem_fd); 52 | 53 | QComHardwareRenderer(const QComHardwareRenderer &); 54 | QComHardwareRenderer &operator=(const QComHardwareRenderer &); 55 | }; 56 | 57 | } // namespace android 58 | 59 | #endif // QCOM_HARDWARE_RENDERER_H_ 60 | -------------------------------------------------------------------------------- /mm-core/Android.mk: -------------------------------------------------------------------------------- 1 | #-------------------------------------------------------------------------- 2 | #Copyright (c) 2009, Code Aurora Forum. All rights reserved. 3 | 4 | #Redistribution and use in source and binary forms, with or without 5 | #modification, are permitted provided that the following conditions are met: 6 | # * Redistributions of source code must retain the above copyright 7 | # notice, this list of conditions and the following disclaimer. 8 | # * Redistributions in binary form must reproduce the above copyright 9 | # notice, this list of conditions and the following disclaimer in the 10 | # documentation and/or other materials provided with the distribution. 11 | # * Neither the name of Code Aurora nor 12 | # the names of its contributors may be used to endorse or promote 13 | # products derived from this software without specific prior written 14 | # permission. 15 | 16 | #THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | #AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | #IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | #NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | #CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | #EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | #PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | #OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | #WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 | #OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | #ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | #-------------------------------------------------------------------------- 28 | 29 | OMX_CORE_PATH := $(call my-dir) 30 | include $(CLEAR_VARS) 31 | 32 | ifneq ($(BUILD_TINY_ANDROID),true) 33 | 34 | ifeq ($(BOARD_USES_QCOM_LIBS),true) 35 | include $(OMX_CORE_PATH)/omxcore/Android.mk 36 | endif 37 | 38 | endif #BUILD_TINY_ANDROID 39 | -------------------------------------------------------------------------------- /mm-video/qdsp6/vdec/test/queue.h: -------------------------------------------------------------------------------- 1 | /*-------------------------------------------------------------------------- 2 | Copyright (c) 2009, Code Aurora Forum. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Code Aurora nor 12 | the names of its contributors may be used to endorse or promote 13 | products derived from this software without specific prior written 14 | permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | --------------------------------------------------------------------------*/ 28 | #ifndef QUEUE_H 29 | #define QUEUE_H 30 | 31 | typedef struct Queue Queue; 32 | 33 | Queue *alloc_queue(); 34 | void free_queue(Queue *q); 35 | void free_queue_and_qelement(Queue *q); 36 | int push(Queue *q, void * element); 37 | void *pop(Queue *q); 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /mm-video/vidc/vdec/inc/queue.h: -------------------------------------------------------------------------------- 1 | /*-------------------------------------------------------------------------- 2 | Copyright (c) 2010, Code Aurora Forum. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Code Aurora nor 12 | the names of its contributors may be used to endorse or promote 13 | products derived from this software without specific prior written 14 | permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | --------------------------------------------------------------------------*/ 28 | #ifndef QUEUE_H 29 | #define QUEUE_H 30 | 31 | typedef struct Queue Queue; 32 | 33 | Queue *alloc_queue(); 34 | void free_queue(Queue *q); 35 | void free_queue_and_qelement(Queue *q); 36 | int push(Queue *q, void * element); 37 | void *pop(Queue *q); 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /mm-video/qdsp6/venc/common/src/venc_sleep.c: -------------------------------------------------------------------------------- 1 | /*-------------------------------------------------------------------------- 2 | Copyright (c) 2010, Code Aurora Forum. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Code Aurora nor 12 | the names of its contributors may be used to endorse or promote 13 | products derived from this software without specific prior written 14 | permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | --------------------------------------------------------------------------*/ 28 | 29 | /*======================================================================== 30 | Include Files 31 | ==========================================================================*/ 32 | #include "venc_sleep.h" 33 | #include 34 | 35 | int venc_sleep(int time_millis) 36 | { 37 | usleep(time_millis * 1000); 38 | return 0; 39 | } 40 | -------------------------------------------------------------------------------- /mm-video/vidc/venc/test/fb_test.c: -------------------------------------------------------------------------------- 1 | /*-------------------------------------------------------------------------- 2 | Copyright (c) 2010, Code Aurora Forum. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Code Aurora nor 12 | the names of its contributors may be used to endorse or promote 13 | products derived from this software without specific prior written 14 | permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | --------------------------------------------------------------------------*/ 28 | #include "fb_test.h" 29 | 30 | int FBTest_Initialize(int nFrameWidth, 31 | int nFrameHeight) 32 | { 33 | return 0; 34 | } 35 | int FBTest_DisplayImage(int nPmemFd, int nOffset) 36 | { 37 | return 0; 38 | } 39 | 40 | int FBTest_Exit() 41 | { 42 | return 0; 43 | } 44 | 45 | int FBTest_RunTest() 46 | { 47 | return 0; 48 | } 49 | -------------------------------------------------------------------------------- /mm-video/vidc/venc/inc/fb_test.h: -------------------------------------------------------------------------------- 1 | /*-------------------------------------------------------------------------- 2 | Copyright (c) 2010, Code Aurora Forum. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Code Aurora nor 12 | the names of its contributors may be used to endorse or promote 13 | products derived from this software without specific prior written 14 | permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | --------------------------------------------------------------------------*/ 28 | #ifndef _FB_TEST_H 29 | #define _FB_TEST_H 30 | 31 | #ifdef __cplusplus 32 | extern "C" { 33 | #endif 34 | 35 | 36 | int FBTest_Initialize(int nFrameWidth, 37 | int nFrameHeight); 38 | int FBTest_DisplayImage(int nPmemFd, int nOffset); 39 | int FBTest_Exit(); 40 | 41 | int FBTest_RunTest(); 42 | 43 | #ifdef __cplusplus 44 | } 45 | #endif 46 | 47 | 48 | #endif // _FB_TEST_H 49 | -------------------------------------------------------------------------------- /mm-video/vidc/venc/inc/venc_util.h: -------------------------------------------------------------------------------- 1 | /*-------------------------------------------------------------------------- 2 | Copyright (c) 2010, Code Aurora Forum. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Code Aurora nor 12 | the names of its contributors may be used to endorse or promote 13 | products derived from this software without specific prior written 14 | permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | --------------------------------------------------------------------------*/ 28 | /*============================================================================ 29 | V E N C _ U T I L. H 30 | 31 | DESCRIPTION 32 | 33 | 34 | REFERENCES 35 | 36 | 37 | ============================================================================*/ 38 | 39 | #ifndef _VENC_UTIL_H 40 | #define _VENC_UTIL_H 41 | 42 | #ifdef __cplusplus 43 | extern "C" { 44 | #endif 45 | 46 | long long GetTimeStamp(); 47 | 48 | 49 | #ifdef __cplusplus 50 | } 51 | #endif 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /mm-video/qdsp6/venc/common/inc/venc_time.h: -------------------------------------------------------------------------------- 1 | /*-------------------------------------------------------------------------- 2 | Copyright (c) 2010, Code Aurora Forum. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Code Aurora nor 12 | the names of its contributors may be used to endorse or promote 13 | products derived from this software without specific prior written 14 | permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | --------------------------------------------------------------------------*/ 28 | 29 | #ifndef _VENC_TIME_H 30 | #define _VENC_TIME_H 31 | 32 | #ifdef __cplusplus 33 | extern "C" { 34 | #endif 35 | /*======================================================================== 36 | 37 | INCLUDE FILES FOR MODULE 38 | 39 | ==========================================================================*/ 40 | 41 | 42 | /** 43 | * @brief Get the timestamp in microseconds 44 | */ 45 | long long venc_time_microsec(); 46 | 47 | #ifdef __cplusplus 48 | } 49 | #endif 50 | 51 | #endif // #ifndef _VENC_TIME_H 52 | -------------------------------------------------------------------------------- /mm-video/vidc/venc/test/venc_util.c: -------------------------------------------------------------------------------- 1 | /*-------------------------------------------------------------------------- 2 | Copyright (c) 2010, Code Aurora Forum. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Code Aurora nor 12 | the names of its contributors may be used to endorse or promote 13 | products derived from this software without specific prior written 14 | permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | --------------------------------------------------------------------------*/ 28 | /*============================================================================ 29 | V E N C _ U T I L. C 30 | 31 | DESCRIPTION 32 | 33 | 34 | REFERENCES 35 | 36 | ============================================================================*/ 37 | 38 | #include "venc_util.h" 39 | #include 40 | #include 41 | 42 | long long GetTimeStamp() 43 | { 44 | struct timeval tv; 45 | long long microsec; 46 | gettimeofday(&tv, NULL); 47 | microsec = (tv.tv_sec * 1000000) + (tv.tv_usec); 48 | return microsec; 49 | 50 | } 51 | 52 | -------------------------------------------------------------------------------- /mm-video/qdsp6/venc/test/etc/venctest_Script.cfg: -------------------------------------------------------------------------------- 1 | #-------------------------------------------------------------------------- 2 | #Copyright (c) 2010, Code Aurora Forum. All rights reserved. 3 | 4 | #Redistribution and use in source and binary forms, with or without 5 | #modification, are permitted provided that the following conditions are met: 6 | # * Redistributions of source code must retain the above copyright 7 | # notice, this list of conditions and the following disclaimer. 8 | # * Redistributions in binary form must reproduce the above copyright 9 | # notice, this list of conditions and the following disclaimer in the 10 | # documentation and/or other materials provided with the distribution. 11 | # * Neither the name of Code Aurora nor 12 | # the names of its contributors may be used to endorse or promote 13 | # products derived from this software without specific prior written 14 | # permission. 15 | 16 | #THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | #AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | #IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | #NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | #CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | #EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | #PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | #OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | #WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 | #OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | #ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | #-------------------------------------------------------------------------- 28 | 29 | ############################################################################## 30 | # Supported Test Types: 31 | # 1. SERIAL_ENCODE 32 | # 2. PROFILE_ENCODE 33 | # 3. IFRAME_REQUEST 34 | # 4. PMEM 35 | # 36 | # Script File Syntax: 37 | # 38 | ############################################################################## 39 | 40 | SERIAL_ENCODE venctest_Config.cfg 1 41 | 42 | # PROFILE_ENCODE venctest_Config.cfg 1 43 | 44 | # IFRAME_REQUEST venctest_Config.cfg 1 45 | 46 | # PMEM venctest_Config.cfg 1 47 | -------------------------------------------------------------------------------- /CleanSpec.mk: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2007 The Android Open Source Project 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | 16 | # If you don't need to do a full clean build but would like to touch 17 | # a file or delete some intermediate files, add a clean step to the end 18 | # of the list. These steps will only be run once, if they haven't been 19 | # run before. 20 | # 21 | # E.g.: 22 | # $(call add-clean-step, touch -c external/sqlite/sqlite3.h) 23 | # $(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/STATIC_LIBRARIES/libz_intermediates) 24 | # 25 | # Always use "touch -c" and "rm -f" or "rm -rf" to gracefully deal with 26 | # files that are missing or have been moved. 27 | # 28 | # Use $(PRODUCT_OUT) to get to the "out/target/product/blah/" directory. 29 | # Use $(OUT_DIR) to refer to the "out" directory. 30 | # 31 | # If you need to re-do something that's already mentioned, just copy 32 | # the command and add it to the bottom of the list. E.g., if a change 33 | # that you made last week required touching a file and a change you 34 | # made today requires touching the same file, just copy the old 35 | # touch step and add it to the end of the list. 36 | # 37 | # ************************************************ 38 | # NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST 39 | # ************************************************ 40 | 41 | # For example: 42 | #$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/APPS/AndroidTests_intermediates) 43 | #$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/JAVA_LIBRARIES/core_intermediates) 44 | #$(call add-clean-step, find $(OUT_DIR) -type f -name "IGTalkSession*" -print0 | xargs -0 rm -f) 45 | #$(call add-clean-step, rm -rf $(PRODUCT_OUT)/data/*) 46 | 47 | # ************************************************ 48 | # NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST 49 | # ************************************************ 50 | -------------------------------------------------------------------------------- /mm-video/qdsp6/venc/common/inc/venc_sleep.h: -------------------------------------------------------------------------------- 1 | /*-------------------------------------------------------------------------- 2 | Copyright (c) 2010, Code Aurora Forum. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Code Aurora nor 12 | the names of its contributors may be used to endorse or promote 13 | products derived from this software without specific prior written 14 | permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | --------------------------------------------------------------------------*/ 28 | 29 | #ifndef _VENC_SLEEPER_H 30 | #define _VENC_SLEEPER_H 31 | 32 | #ifdef __cplusplus 33 | extern "C" { 34 | #endif 35 | /*======================================================================== 36 | 37 | INCLUDE FILES FOR MODULE 38 | 39 | ==========================================================================*/ 40 | 41 | /** 42 | * @brief Sleep for the specified time 43 | * 44 | * @param time_millis The time to sleep in milliseconds 45 | */ 46 | int venc_sleep(int time_millis); 47 | 48 | #ifdef __cplusplus 49 | } 50 | #endif 51 | 52 | #endif // #ifndef _VENC_SLEEPER_H 53 | -------------------------------------------------------------------------------- /mm-video/qdsp6/venc/test/common/src/venctest_Time.cpp: -------------------------------------------------------------------------------- 1 | /*-------------------------------------------------------------------------- 2 | Copyright (c) 2010, Code Aurora Forum. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Code Aurora nor 12 | the names of its contributors may be used to endorse or promote 13 | products derived from this software without specific prior written 14 | permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | --------------------------------------------------------------------------*/ 28 | 29 | /*======================================================================== 30 | Include Files 31 | ==========================================================================*/ 32 | #include "venctest_Time.h" 33 | #include "venc_time.h" 34 | 35 | namespace venctest 36 | { 37 | 38 | ///////////////////////////////////////////////////////////////////////////// 39 | ///////////////////////////////////////////////////////////////////////////// 40 | OMX_TICKS Time::GetTimeMicrosec() 41 | { 42 | return (OMX_TICKS) venc_time_microsec(); 43 | } 44 | 45 | } // namespace venctest 46 | -------------------------------------------------------------------------------- /mm-video/Android.mk: -------------------------------------------------------------------------------- 1 | #-------------------------------------------------------------------------- 2 | #Copyright (c) 2009, Code Aurora Forum. All rights reserved. 3 | 4 | #Redistribution and use in source and binary forms, with or without 5 | #modification, are permitted provided that the following conditions are met: 6 | # * Redistributions of source code must retain the above copyright 7 | # notice, this list of conditions and the following disclaimer. 8 | # * Redistributions in binary form must reproduce the above copyright 9 | # notice, this list of conditions and the following disclaimer in the 10 | # documentation and/or other materials provided with the distribution. 11 | # * Neither the name of Code Aurora nor 12 | # the names of its contributors may be used to endorse or promote 13 | # products derived from this software without specific prior written 14 | # permission. 15 | 16 | #THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | #AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | #IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | #NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | #CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | #EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | #PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | #OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | #WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 | #OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | #ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | #-------------------------------------------------------------------------- 28 | 29 | OMX_VIDEO_PATH := $(call my-dir) 30 | include $(CLEAR_VARS) 31 | 32 | ifneq ($(BUILD_TINY_ANDROID),true) 33 | 34 | ifeq ($(BOARD_USES_QCOM_LIBS),true) 35 | 36 | ifeq ($(TARGET_BOARD_PLATFORM),msm7x30) 37 | include $(OMX_VIDEO_PATH)/vidc/vdec/Android.mk 38 | include $(OMX_VIDEO_PATH)/vidc/venc/Android.mk 39 | endif 40 | 41 | # Decoder is producing artifacts, disabled for now 42 | ifeq ($(TARGET_BOARD_PLATFORM),qsd8k) 43 | # include $(OMX_VIDEO_PATH)/qdsp6/vdec/Android.mk 44 | include $(OMX_VIDEO_PATH)/qdsp6/venc/Android.mk 45 | endif 46 | 47 | endif # BOARD_USES_QCOM_LIBS 48 | 49 | endif #BUILD_TINY_ANDROID 50 | -------------------------------------------------------------------------------- /mm-video/qdsp6/venc/common/src/venc_time.c: -------------------------------------------------------------------------------- 1 | /*-------------------------------------------------------------------------- 2 | Copyright (c) 2010, Code Aurora Forum. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Code Aurora nor 12 | the names of its contributors may be used to endorse or promote 13 | products derived from this software without specific prior written 14 | permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | --------------------------------------------------------------------------*/ 28 | 29 | /*======================================================================== 30 | Include Files 31 | ==========================================================================*/ 32 | #include "venc_time.h" 33 | #include 34 | #include 35 | 36 | ///////////////////////////////////////////////////////////////////////////// 37 | ///////////////////////////////////////////////////////////////////////////// 38 | long long venc_time_microsec() 39 | { 40 | struct timeval time; 41 | long long time_microsec = 0; 42 | 43 | if (gettimeofday(&time, NULL) == 0) 44 | { 45 | time_microsec = ((long long) time.tv_sec * 1000 * 1000) + ((long long) time.tv_usec) ; 46 | } 47 | 48 | return time_microsec; 49 | } 50 | -------------------------------------------------------------------------------- /mm-video/qdsp6/venc/test/common/inc/venctest_Time.h: -------------------------------------------------------------------------------- 1 | /*-------------------------------------------------------------------------- 2 | Copyright (c) 2010, Code Aurora Forum. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Code Aurora nor 12 | the names of its contributors may be used to endorse or promote 13 | products derived from this software without specific prior written 14 | permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | --------------------------------------------------------------------------*/ 28 | 29 | #ifndef _VENC_TEST_TIME_H 30 | #define _VENC_TEST_TIME_H 31 | 32 | /*======================================================================== 33 | 34 | INCLUDE FILES FOR MODULE 35 | 36 | ==========================================================================*/ 37 | #include "OMX_Core.h" 38 | 39 | namespace venctest 40 | { 41 | 42 | /** 43 | * @brief Utility class for sleeping 44 | */ 45 | class Time 46 | { 47 | public: 48 | 49 | /** 50 | * @brief Get the timestamp in microseconds 51 | */ 52 | static OMX_TICKS GetTimeMicrosec(); 53 | 54 | private: 55 | Time() {} 56 | ~Time() {} 57 | }; 58 | } // namespace venctest 59 | 60 | #endif // #ifndef _VENC_TEST_TIME_H 61 | -------------------------------------------------------------------------------- /libstagefrighthw/QComOMXPlugin.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2009 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 QCOM_OMX_PLUGIN_H_ 18 | 19 | #define QCOM_OMX_PLUGIN_H_ 20 | 21 | #include 22 | 23 | namespace android { 24 | 25 | struct QComOMXPlugin : public OMXPluginBase { 26 | QComOMXPlugin(); 27 | virtual ~QComOMXPlugin(); 28 | 29 | virtual OMX_ERRORTYPE makeComponentInstance( 30 | const char *name, 31 | const OMX_CALLBACKTYPE *callbacks, 32 | OMX_PTR appData, 33 | OMX_COMPONENTTYPE **component); 34 | 35 | virtual OMX_ERRORTYPE destroyComponentInstance( 36 | OMX_COMPONENTTYPE *component); 37 | 38 | virtual OMX_ERRORTYPE enumerateComponents( 39 | OMX_STRING name, 40 | size_t size, 41 | OMX_U32 index); 42 | 43 | virtual OMX_ERRORTYPE getRolesOfComponent( 44 | const char *name, 45 | Vector *roles); 46 | 47 | private: 48 | void *mLibHandle; 49 | 50 | typedef OMX_ERRORTYPE (*InitFunc)(); 51 | typedef OMX_ERRORTYPE (*DeinitFunc)(); 52 | typedef OMX_ERRORTYPE (*ComponentNameEnumFunc)( 53 | OMX_STRING, OMX_U32, OMX_U32); 54 | 55 | typedef OMX_ERRORTYPE (*GetHandleFunc)( 56 | OMX_HANDLETYPE *, OMX_STRING, OMX_PTR, OMX_CALLBACKTYPE *); 57 | 58 | typedef OMX_ERRORTYPE (*FreeHandleFunc)(OMX_HANDLETYPE *); 59 | 60 | typedef OMX_ERRORTYPE (*GetRolesOfComponentFunc)( 61 | OMX_STRING, OMX_U32 *, OMX_U8 **); 62 | 63 | InitFunc mInit; 64 | DeinitFunc mDeinit; 65 | ComponentNameEnumFunc mComponentNameEnum; 66 | GetHandleFunc mGetHandle; 67 | FreeHandleFunc mFreeHandle; 68 | GetRolesOfComponentFunc mGetRolesOfComponentHandle; 69 | 70 | QComOMXPlugin(const QComOMXPlugin &); 71 | QComOMXPlugin &operator=(const QComOMXPlugin &); 72 | }; 73 | 74 | } // namespace android 75 | 76 | #endif // QCOM_OMX_PLUGIN_H_ 77 | -------------------------------------------------------------------------------- /libstagefrighthw/QComHardwareOverlayRenderer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2009 The Android Open Source Project 3 | * Copyright (c) 2010, Code Aurora Forum. All rights reserved. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | #ifndef QCOM_HARDWARE_OVERLAY_RENDERER_H_ 19 | 20 | #define QCOM_HARDWARE_OVERLAY_RENDERER_H_ 21 | 22 | #include 23 | #include 24 | #include 25 | #include 26 | 27 | namespace android { 28 | 29 | class ISurface; 30 | class MemoryHeapPmem; 31 | 32 | class QComHardwareOverlayRenderer : public VideoRenderer { 33 | public: 34 | QComHardwareOverlayRenderer( 35 | const sp &surface, 36 | size_t displayWidth, size_t displayHeight, 37 | size_t decodedWidth, size_t decodedHeight, 38 | int32_t rotationDegrees); 39 | 40 | virtual ~QComHardwareOverlayRenderer(); 41 | 42 | virtual void render( 43 | const void *data, size_t size, void *platformPrivate); 44 | 45 | private: 46 | sp mISurface; 47 | size_t mDisplayWidth, mDisplayHeight; 48 | size_t mDecodedWidth, mDecodedHeight; 49 | size_t mFrameSize; 50 | int32_t mRotationDegrees; 51 | sp mMemoryHeap; 52 | 53 | //Statistics profiling 54 | bool mStatistics; 55 | uint32_t mLastFrame; 56 | float mFpsSum; 57 | uint32_t mFrameNumber; 58 | uint32_t mNumFpsSamples; 59 | int64_t mLastFrameTime; 60 | void AverageFPSProfiling(); 61 | void AverageFPSPrint(); 62 | 63 | bool getOffset(void *platformPrivate, size_t *offset); 64 | void publishBuffers(uint32_t pmem_fd); 65 | 66 | QComHardwareOverlayRenderer(const QComHardwareOverlayRenderer &); 67 | QComHardwareOverlayRenderer &operator=(const QComHardwareOverlayRenderer &); 68 | 69 | sp mOverlay; 70 | uint32_t mFd; 71 | }; 72 | 73 | } // namespace android 74 | 75 | #endif // QCOM_HARDWARE_OVERLAY_RENDERER_H_ 76 | -------------------------------------------------------------------------------- /mm-video/qdsp6/venc/common/inc/venc_mutex.h: -------------------------------------------------------------------------------- 1 | /*-------------------------------------------------------------------------- 2 | Copyright (c) 2010, Code Aurora Forum. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Code Aurora nor 12 | the names of its contributors may be used to endorse or promote 13 | products derived from this software without specific prior written 14 | permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | --------------------------------------------------------------------------*/ 28 | 29 | #ifndef _VENC_MUTEX_H 30 | #define _VENC_MUTEX_H 31 | 32 | #ifdef __cplusplus 33 | extern "C" { 34 | #endif 35 | /*======================================================================== 36 | 37 | INCLUDE FILES FOR MODULE 38 | 39 | ==========================================================================*/ 40 | 41 | /** 42 | * @brief Constructor 43 | */ 44 | int venc_mutex_create(void** handle); 45 | 46 | /** 47 | * @brief Destructor 48 | */ 49 | int venc_mutex_destroy(void* handle); 50 | 51 | /** 52 | * @brief Locks the mutex 53 | */ 54 | int venc_mutex_lock(void* handle); 55 | 56 | /** 57 | * @brief Unlocks the mutex 58 | */ 59 | int venc_mutex_unlock(void* handle); 60 | 61 | #ifdef __cplusplus 62 | } 63 | #endif 64 | 65 | #endif // #ifndef _VENC_MUTEX_H 66 | -------------------------------------------------------------------------------- /mm-video/qdsp6/venc/test/common/src/venctest_Sleeper.cpp: -------------------------------------------------------------------------------- 1 | /*-------------------------------------------------------------------------- 2 | Copyright (c) 2010, Code Aurora Forum. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Code Aurora nor 12 | the names of its contributors may be used to endorse or promote 13 | products derived from this software without specific prior written 14 | permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | --------------------------------------------------------------------------*/ 28 | 29 | /*======================================================================== 30 | Include Files 31 | ==========================================================================*/ 32 | #include "venctest_Sleeper.h" 33 | #include "venctest_Debug.h" 34 | #include "venc_sleep.h" 35 | 36 | namespace venctest 37 | { 38 | ///////////////////////////////////////////////////////////////////////////// 39 | ///////////////////////////////////////////////////////////////////////////// 40 | OMX_ERRORTYPE Sleeper::Sleep(OMX_S32 nTimeMillis) 41 | { 42 | OMX_ERRORTYPE result = OMX_ErrorNone; 43 | 44 | if (venc_sleep((int) nTimeMillis) != 0) 45 | { 46 | VENC_TEST_MSG_ERROR("error sleeping"); 47 | result = OMX_ErrorUndefined; 48 | } 49 | 50 | return result; 51 | } 52 | } // namespace venctest 53 | -------------------------------------------------------------------------------- /mm-video/qdsp6/venc/test/common/inc/venctest_Sleeper.h: -------------------------------------------------------------------------------- 1 | /*-------------------------------------------------------------------------- 2 | Copyright (c) 2010, Code Aurora Forum. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Code Aurora nor 12 | the names of its contributors may be used to endorse or promote 13 | products derived from this software without specific prior written 14 | permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | --------------------------------------------------------------------------*/ 28 | 29 | #ifndef _VENC_TEST_SLEEPER_H 30 | #define _VENC_TEST_SLEEPER_H 31 | 32 | /*======================================================================== 33 | 34 | INCLUDE FILES FOR MODULE 35 | 36 | ==========================================================================*/ 37 | #include "OMX_Core.h" 38 | 39 | namespace venctest 40 | { 41 | 42 | /** 43 | * @brief Utility class for sleeping 44 | */ 45 | class Sleeper 46 | { 47 | public: 48 | 49 | /** 50 | * @brief Sleep for the specified time 51 | * 52 | * @param nTimeMillis The time to sleep in milliseconds 53 | */ 54 | static OMX_ERRORTYPE Sleep(OMX_S32 nTimeMillis); 55 | 56 | private: 57 | Sleeper() {} 58 | ~Sleeper() {} 59 | }; 60 | } // namespace venctest 61 | 62 | #endif // #ifndef _VENC_TEST_SLEEPER_H 63 | -------------------------------------------------------------------------------- /mm-video/qdsp6/venc/common/inc/venc_semaphore.h: -------------------------------------------------------------------------------- 1 | /*-------------------------------------------------------------------------- 2 | Copyright (c) 2010, Code Aurora Forum. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Code Aurora nor 12 | the names of its contributors may be used to endorse or promote 13 | products derived from this software without specific prior written 14 | permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | --------------------------------------------------------------------------*/ 28 | 29 | #ifndef _VENC_SEMAPHORE_H 30 | #define _VENC_SEMAPHORE_H 31 | 32 | #ifdef __cplusplus 33 | extern "C" { 34 | #endif 35 | /*======================================================================== 36 | 37 | INCLUDE FILES FOR MODULE 38 | 39 | ==========================================================================*/ 40 | 41 | /** 42 | * @brief Constructor 43 | */ 44 | int venc_semaphore_create(void** handle, int init_count, int max_count); 45 | 46 | /** 47 | * @brief Destructor 48 | */ 49 | int venc_semaphore_destroy(void* handle); 50 | 51 | /** 52 | * @brief Waits for the semaphore 53 | */ 54 | int venc_semaphore_wait(void* handle, int timeout); 55 | 56 | /** 57 | * @brief Posts the semaphore 58 | */ 59 | int venc_semaphore_post(void* handle); 60 | 61 | #ifdef __cplusplus 62 | } 63 | #endif 64 | 65 | #endif // #ifndef _VENC_SEMAPHORE_H 66 | -------------------------------------------------------------------------------- /mm-video/vidc/venc/inc/camera_test.h: -------------------------------------------------------------------------------- 1 | /*-------------------------------------------------------------------------- 2 | Copyright (c) 2010, Code Aurora Forum. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Code Aurora nor 12 | the names of its contributors may be used to endorse or promote 13 | products derived from this software without specific prior written 14 | permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | --------------------------------------------------------------------------*/ 28 | #ifndef _CAMERA_TEST_H 29 | #define _CAMERA_TEST_H 30 | 31 | #define EXTERN_C_START extern "C" { 32 | #define EXTERN_C_END } 33 | 34 | #ifdef __cplusplus 35 | EXTERN_C_START 36 | #endif 37 | 38 | typedef void (*CameraPreviewCallback)(int nFD, 39 | int nOffset, 40 | void* pPhys, 41 | void* pVirt, 42 | long long nTimeStamp); 43 | 44 | 45 | int CameraTest_Initialize(int nFrameRate, 46 | int nFrameWidth, 47 | int nFrameHeight, 48 | CameraPreviewCallback pfnPreviewCallback); 49 | int CameraTest_Run(); 50 | int CameraTest_ReleaseFrame(void* pPhys, void* pVirt); 51 | int CameraTest_Exit(); 52 | 53 | 54 | #ifdef __cplusplus 55 | EXTERN_C_END 56 | #endif 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /mm-video/qdsp6/venc/common/inc/venc_signal.h: -------------------------------------------------------------------------------- 1 | /*-------------------------------------------------------------------------- 2 | Copyright (c) 2010, Code Aurora Forum. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Code Aurora nor 12 | the names of its contributors may be used to endorse or promote 13 | products derived from this software without specific prior written 14 | permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | --------------------------------------------------------------------------*/ 28 | 29 | #ifndef _VENC_SIGNAL_H 30 | #define _VENC_SIGNAL_H 31 | 32 | #ifdef __cplusplus 33 | extern "C" { 34 | #endif 35 | /*======================================================================== 36 | 37 | INCLUDE FILES FOR MODULE 38 | 39 | ==========================================================================*/ 40 | 41 | /** 42 | * @brief Constructor 43 | */ 44 | int venc_signal_create(void** handle); 45 | 46 | /** 47 | * @brief Destructor 48 | */ 49 | int venc_signal_destroy(void* handle); 50 | 51 | /** 52 | * @brief Set a signal 53 | */ 54 | int venc_signal_set(void* handle); 55 | 56 | /** 57 | * @brief Wait for signal to be set 58 | * 59 | * @param timeout Milliseconds before timeout. Specify 0 for infinite. 60 | * 61 | * @return 0 on success, 1 on error, 2 on timeout 62 | */ 63 | int venc_signal_wait(void* handle, int timeout); 64 | 65 | #ifdef __cplusplus 66 | } 67 | #endif 68 | 69 | #endif // #ifndef _VENC_SIGNAL_H 70 | -------------------------------------------------------------------------------- /mm-video/qdsp6/venc/test/common/inc/venctest_Mutex.h: -------------------------------------------------------------------------------- 1 | /*-------------------------------------------------------------------------- 2 | Copyright (c) 2010, Code Aurora Forum. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Code Aurora nor 12 | the names of its contributors may be used to endorse or promote 13 | products derived from this software without specific prior written 14 | permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | --------------------------------------------------------------------------*/ 28 | 29 | #ifndef _VENC_TEST_MUTEX_H 30 | #define _VENC_TEST_MUTEX_H 31 | 32 | /*======================================================================== 33 | 34 | INCLUDE FILES FOR MODULE 35 | 36 | ==========================================================================*/ 37 | #include "OMX_Core.h" 38 | 39 | namespace venctest 40 | { 41 | /** 42 | * @brief Mutex class 43 | */ 44 | class Mutex 45 | { 46 | public: 47 | 48 | /** 49 | * @brief Constructor 50 | */ 51 | Mutex(); 52 | 53 | /** 54 | * @brief Destructor 55 | */ 56 | ~Mutex(); 57 | 58 | /** 59 | * @brief Locks the mutex 60 | */ 61 | OMX_ERRORTYPE Lock(); 62 | 63 | /** 64 | * @brief Unlocks the mutex 65 | */ 66 | OMX_ERRORTYPE UnLock(); 67 | private: 68 | 69 | void* m_pMutex; 70 | }; 71 | } 72 | 73 | #endif // #ifndef _VENC_TEST_MUTEX_H 74 | -------------------------------------------------------------------------------- /mm-core/omxcore/inc/qc_omx_msg.h: -------------------------------------------------------------------------------- 1 | /*-------------------------------------------------------------------------- 2 | Copyright (c) 2009, Code Aurora Forum. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Code Aurora nor 12 | the names of its contributors may be used to endorse or promote 13 | products derived from this software without specific prior written 14 | permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | --------------------------------------------------------------------------*/ 28 | /*========================================================================== 29 | O p e n M A X w r a p p e r s 30 | O p e n M A X C o r e 31 | 32 | *//** @file qc_omx_msg.h 33 | This module contains the definitions of the OpenMAX core. 34 | 35 | *//*========================================================================*/ 36 | 37 | #ifndef _QC_OMX_MSG_H_ 38 | #define _QC_OMX_MSG_H_ 39 | 40 | #ifdef _ENABLE_QC_MSG_LOG_ 41 | #ifdef _ANDROID_ 42 | #include 43 | #define DEBUG_PRINT_ERROR LOGE 44 | #define DEBUG_PRINT LOGI 45 | #define DEBUG_DETAIL LOGV 46 | #else 47 | #define DEBUG_PRINT_ERROR printf 48 | #define DEBUG_PRINT printf 49 | #define DEBUG_DETAIL printf 50 | #endif // _ANDROID_ 51 | #else 52 | #define DEBUG_PRINT_ERROR 53 | #define DEBUG_PRINT 54 | #define DEBUG_DETAIL 55 | #endif // _ENABLE_QC_MSG_LOG_ 56 | 57 | 58 | #endif // _QC_OMX_MSG_H_ 59 | -------------------------------------------------------------------------------- /mm-core/omxcore/inc/qc_omx_common.h: -------------------------------------------------------------------------------- 1 | /*-------------------------------------------------------------------------- 2 | Copyright (c) 2009, Code Aurora Forum. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Code Aurora nor 12 | the names of its contributors may be used to endorse or promote 13 | products derived from this software without specific prior written 14 | permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | --------------------------------------------------------------------------*/ 28 | /*============================================================================ 29 | O p e n M A X w r a p p e r s 30 | O p e n M A X C o r e 31 | 32 | *//** @file qc_omx_common.h 33 | This module contains the definitions of the OpenMAX core. 34 | 35 | *//*========================================================================*/ 36 | 37 | #ifndef QC_OMX_COMMON_H 38 | #define QC_OMX_COMMON_H 39 | 40 | 41 | #include // Standard IO 42 | #include "OMX_Core.h" // OMX API 43 | #include "OMX_QCOMExtns.h" // OMX API 44 | 45 | #define OMX_CORE_MAX_CMP 1 // MAX Components supported 46 | #define OMX_CORE_MAX_CMP_ROLES 1 // MAX Roles per component 47 | #define OMX_SPEC_VERSION 0x00000101 // OMX Version 48 | 49 | #ifdef __cplusplus 50 | extern "C" { 51 | #endif 52 | 53 | typedef void * (*create_qc_omx_component)(void); 54 | 55 | #ifdef _ANDROID_ 56 | #define LOG_TAG "QC_CORE" 57 | #endif 58 | #include "qc_omx_msg.h" 59 | 60 | #ifdef __cplusplus 61 | } 62 | #endif 63 | 64 | #endif 65 | 66 | -------------------------------------------------------------------------------- /mm-video/qdsp6/venc/test/common/inc/venctest_TestCaseFactory.h: -------------------------------------------------------------------------------- 1 | /*-------------------------------------------------------------------------- 2 | Copyright (c) 2010, Code Aurora Forum. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Code Aurora nor 12 | the names of its contributors may be used to endorse or promote 13 | products derived from this software without specific prior written 14 | permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | --------------------------------------------------------------------------*/ 28 | 29 | #ifndef _VENC_TEST_CASE_FACTORY_H 30 | #define _VENC_TEST_CASE_FACTORY_H 31 | 32 | /*======================================================================== 33 | 34 | INCLUDE FILES FOR MODULE 35 | 36 | ==========================================================================*/ 37 | #include "OMX_Core.h" 38 | #include "venctest_ComDef.h" 39 | 40 | namespace venctest 41 | { 42 | 43 | class ITestCase; // forward declaration 44 | 45 | /** 46 | * @brief A test case class factory. All test cases created/destroyed through this class. 47 | */ 48 | class TestCaseFactory 49 | { 50 | public: 51 | 52 | /** 53 | * @brief Allocates a test case object 54 | */ 55 | static ITestCase* AllocTest(OMX_STRING pTestName); 56 | 57 | /** 58 | * @brief Destroys a test case object 59 | */ 60 | static OMX_ERRORTYPE DestroyTest(ITestCase* pTest); 61 | 62 | private: 63 | TestCaseFactory(){} 64 | ~TestCaseFactory(){} 65 | }; 66 | 67 | } // namespace venctest 68 | 69 | #endif // #ifndef _VENC_TEST_CASE_FACTORY_H 70 | -------------------------------------------------------------------------------- /mm-video/qdsp6/vdec/src/pmem.h: -------------------------------------------------------------------------------- 1 | /*-------------------------------------------------------------------------- 2 | Copyright (c) 2009, Code Aurora Forum. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Code Aurora nor 12 | the names of its contributors may be used to endorse or promote 13 | products derived from this software without specific prior written 14 | permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | --------------------------------------------------------------------------*/ 28 | #ifndef _PMEM_SIMPLE_H_ 29 | #define _PMEM_SIMPLE_H_ 30 | 31 | #define pmem_alloc vdec_pmem_alloc 32 | #define pmem_free vdec_pmem_free 33 | 34 | struct pmem { 35 | void *data; 36 | int fd; 37 | 38 | unsigned phys; 39 | unsigned size; 40 | }; 41 | 42 | int pmem_alloc(struct pmem *out, unsigned sz); 43 | void pmem_free(struct pmem *pmem); 44 | 45 | #ifdef USE_PMEM_ADSP_CACHED 46 | 47 | //Cache operation to perform on the pmem region 48 | typedef enum { 49 | PMEM_CACHE_FLUSH = 0, 50 | PMEM_CACHE_INVALIDATE, 51 | PMEM_CACHE_FLUSH_INVALIDATE, 52 | PMEM_CACHE_INVALID_OP 53 | } PMEM_CACHE_OP; 54 | 55 | /** 56 | * This method is used to perform cache operations on the pmem regoin 57 | * in the decoder. 58 | * 59 | * Prerequisite: pmem_alloc should have been called. 60 | * 61 | * @param[in] pmem_id 62 | * id of the pmem region to use. 63 | * 64 | * @param[in] addr 65 | * The virtual addr of the pmem region 66 | * 67 | * @param[in] size 68 | * The size of the region 69 | * 70 | * @param[in] op 71 | * Cache operation to perform as defined by PMEM_CACHE_OP 72 | */ 73 | void pmem_cachemaint(int pmem_id, void *addr, unsigned size, PMEM_CACHE_OP op); 74 | #endif 75 | #endif 76 | -------------------------------------------------------------------------------- /mm-video/qdsp6/venc/test/common/inc/venctest_Signal.h: -------------------------------------------------------------------------------- 1 | /*-------------------------------------------------------------------------- 2 | Copyright (c) 2010, Code Aurora Forum. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Code Aurora nor 12 | the names of its contributors may be used to endorse or promote 13 | products derived from this software without specific prior written 14 | permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | --------------------------------------------------------------------------*/ 28 | 29 | #ifndef _VENC_TEST_SIGNAL_H 30 | #define _VENC_TEST_SIGNAL_H 31 | 32 | /*======================================================================== 33 | 34 | INCLUDE FILES FOR MODULE 35 | 36 | ==========================================================================*/ 37 | #include "OMX_Core.h" 38 | 39 | namespace venctest 40 | { 41 | 42 | /** 43 | * @brief Class for sending signals to threads 44 | * 45 | * Signals behave similarly to binary (not counting) semaphores. 46 | */ 47 | class Signal 48 | { 49 | public: 50 | 51 | /** 52 | * @brief Constructor 53 | */ 54 | Signal(); 55 | 56 | /** 57 | * @brief Destructor 58 | */ 59 | ~Signal(); 60 | 61 | public: 62 | 63 | /** 64 | * @brief Set a signal 65 | */ 66 | OMX_ERRORTYPE Set(); 67 | 68 | /** 69 | * @brief Wait for signal to be set 70 | * 71 | * @param nTimeoutMillis Milliseconds before timeout. Specify 0 for infinite. 72 | */ 73 | OMX_ERRORTYPE Wait(OMX_S32 nTimeoutMillis); 74 | 75 | private: 76 | 77 | void* m_pSignal; 78 | }; 79 | } 80 | 81 | #endif // #ifndef _VENC_TEST_SIGNAL_H 82 | -------------------------------------------------------------------------------- /mm-video/qdsp6/venc/common/inc/venc_thread.h: -------------------------------------------------------------------------------- 1 | /*-------------------------------------------------------------------------- 2 | Copyright (c) 2010, Code Aurora Forum. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Code Aurora nor 12 | the names of its contributors may be used to endorse or promote 13 | products derived from this software without specific prior written 14 | permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | --------------------------------------------------------------------------*/ 28 | 29 | #ifndef _VENC_THREAD_H 30 | #define _VENC_THREAD_H 31 | 32 | #ifdef __cplusplus 33 | extern "C" { 34 | #endif 35 | /*======================================================================== 36 | 37 | INCLUDE FILES FOR MODULE 38 | 39 | ==========================================================================*/ 40 | 41 | /** 42 | * @brief Thread start function pointer 43 | */ 44 | typedef int (*thread_fn_type) (void* thread_data); 45 | 46 | /** 47 | * @brief Starts a thread at the specified function 48 | * 49 | * @param handle Handle to the thread 50 | * @param pfn Pointer to the thread start function 51 | * @param thread_data Arguments passed in to the thread (null is valid) 52 | * @param priority Priority of the thread, unique to each platform. 53 | */ 54 | int venc_thread_create(void** handle, 55 | thread_fn_type pfn, 56 | void* thread_data, 57 | int priority); 58 | 59 | /** 60 | * @brief Destroys a thread. Blocks until thread exits 61 | * 62 | * @return The thread exit code 63 | */ 64 | int venc_thread_destroy(void* handle, int* thread_result); 65 | 66 | #ifdef __cplusplus 67 | } 68 | #endif 69 | 70 | #endif // #ifndef _VENC_THREAD_H 71 | -------------------------------------------------------------------------------- /mm-video/vidc/venc/inc/queue.h: -------------------------------------------------------------------------------- 1 | /*-------------------------------------------------------------------------- 2 | Copyright (c) 2010, Code Aurora Forum. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Code Aurora nor 12 | the names of its contributors may be used to endorse or promote 13 | products derived from this software without specific prior written 14 | permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | --------------------------------------------------------------------------*/ 28 | #ifndef QUEUE_H 29 | #define QUEUE_H 30 | 31 | #include 32 | #include 33 | #include 34 | #include 35 | 36 | /* Message Queue structure */ 37 | struct video_msgq 38 | { 39 | /* Command to be executed */ 40 | unsigned int cmd; 41 | 42 | unsigned int status; 43 | 44 | /* Client-specific data */ 45 | void *clientdata; 46 | }; 47 | 48 | 49 | /* Thread & Message Queue information */ 50 | struct video_queue_context 51 | { 52 | /* Message Queue related members */ 53 | pthread_mutex_t mutex; 54 | sem_t sem_message; 55 | int commandq_size; 56 | int dataq_size; 57 | struct video_msgq *ptr_dataq; 58 | struct video_msgq *ptr_cmdq; 59 | int write_dataq ; 60 | int read_dataq; 61 | int write_comq ; 62 | int read_comq ; 63 | 64 | }; 65 | 66 | int check_if_queue_empty ( unsigned int queuetocheck,void* queuecontext ); 67 | 68 | struct video_msgq * queue_get_cmd ( void* queuecontext ); 69 | 70 | 71 | 72 | int queue_post_cmdq ( void *queuecontext, 73 | struct video_msgq *post_msg 74 | ); 75 | 76 | int queue_post_dataq ( void *queuecontext, 77 | struct video_msgq *post_msg 78 | ); 79 | 80 | #endif /* QUEUE_H */ 81 | -------------------------------------------------------------------------------- /mm-video/vidc/venc/inc/omx_video_common.h: -------------------------------------------------------------------------------- 1 | /*-------------------------------------------------------------------------- 2 | Copyright (c) 2010, Code Aurora Forum. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Code Aurora nor 12 | the names of its contributors may be used to endorse or promote 13 | products derived from this software without specific prior written 14 | permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | --------------------------------------------------------------------------*/ 28 | 29 | #ifndef __OMX_VIDEO_COMMON_H__ 30 | #define __OMX_VIDEO_COMMON_H__ 31 | ////////////////////////////////////////////////////////////////////////////// 32 | // Include Files 33 | ////////////////////////////////////////////////////////////////////////////// 34 | 35 | #include 36 | #include 37 | 38 | #define OMX_VIDEO_DEC_NUM_INPUT_BUFFERS 2 39 | #define OMX_VIDEO_DEC_NUM_OUTPUT_BUFFERS 2 40 | 41 | #ifdef FEATURE_QTV_WVGA_ENABLE 42 | #define OMX_VIDEO_DEC_INPUT_BUFFER_SIZE (256*1024) 43 | #else 44 | #define OMX_VIDEO_DEC_INPUT_BUFFER_SIZE (128*1024) 45 | #endif 46 | 47 | #define OMX_CORE_CONTROL_CMDQ_SIZE 100 48 | #define OMX_CORE_QCIF_HEIGHT 144 49 | #define OMX_CORE_QCIF_WIDTH 176 50 | #define OMX_CORE_VGA_HEIGHT 480 51 | #define OMX_CORE_VGA_WIDTH 640 52 | #define OMX_CORE_WVGA_HEIGHT 480 53 | #define OMX_CORE_WVGA_WIDTH 800 54 | 55 | enum PortIndexType 56 | { 57 | PORT_INDEX_IN = 0, 58 | PORT_INDEX_OUT = 1, 59 | PORT_INDEX_BOTH = -1, 60 | PORT_INDEX_NONE = -2 61 | }; 62 | 63 | struct pmem 64 | { 65 | void *buffer; 66 | int fd; 67 | unsigned offset; 68 | unsigned size; 69 | }; 70 | 71 | #endif // __OMX_VIDEO_COMMON_H__ 72 | 73 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /mm-video/vidc/vdec/inc/message_queue.h: -------------------------------------------------------------------------------- 1 | /*-------------------------------------------------------------------------- 2 | Copyright (c) 2010, Code Aurora Forum. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Code Aurora nor 12 | the names of its contributors may be used to endorse or promote 13 | products derived from this software without specific prior written 14 | permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | --------------------------------------------------------------------------*/ 28 | #ifndef QUEUE_H 29 | #define QUEUE_H 30 | 31 | #include 32 | #include 33 | #include 34 | #include 35 | 36 | /* Message Queue structure */ 37 | struct video_msgq 38 | { 39 | /* Command to be executed */ 40 | unsigned int cmd; 41 | 42 | unsigned int status; 43 | 44 | /* Client-specific data */ 45 | void *clientdata; 46 | }; 47 | 48 | 49 | /* Thread & Message Queue information */ 50 | struct video_queue_context 51 | { 52 | /* Message Queue related members */ 53 | pthread_mutex_t mutex; 54 | sem_t sem_message; 55 | int commandq_size; 56 | int dataq_size; 57 | struct video_msgq *ptr_dataq; 58 | struct video_msgq *ptr_cmdq; 59 | int write_dataq ; 60 | int read_dataq; 61 | int write_comq ; 62 | int read_comq ; 63 | 64 | }; 65 | 66 | int check_if_queue_empty ( unsigned int queuetocheck,void* queuecontext ); 67 | 68 | struct video_msgq * queue_get_cmd ( void* queuecontext ); 69 | 70 | int queue_post_cmdq ( void *queuecontext, 71 | struct video_msgq *post_msg 72 | ); 73 | 74 | int queue_post_dataq ( void *queuecontext, 75 | struct video_msgq *post_msg 76 | ); 77 | 78 | #endif /* QUEUE_H */ 79 | -------------------------------------------------------------------------------- /mm-video/vidc/venc/test/camera_test.cpp: -------------------------------------------------------------------------------- 1 | /*-------------------------------------------------------------------------- 2 | Copyright (c) 2010, Code Aurora Forum. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Code Aurora nor 12 | the names of its contributors may be used to endorse or promote 13 | products derived from this software without specific prior written 14 | permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | --------------------------------------------------------------------------*/ 28 | #include "camera_test.h" 29 | // #include "camera_class.h" 30 | 31 | EXTERN_C_START 32 | 33 | // static android::Camera* pCamera = NULL; 34 | 35 | int CameraTest_Initialize(int nFrameRate, 36 | int nFrameWidth, 37 | int nFrameHeight, 38 | CameraPreviewCallback pfnPreviewCallback) 39 | { 40 | int result = 0; 41 | 42 | // pCamera = new android::Camera; 43 | // if (!pCamera) 44 | // return 1; 45 | 46 | // pCamera->init_camera(nFrameWidth, 47 | // nFrameHeight, 48 | // nFrameRate, 49 | // pfnPreviewCallback); 50 | 51 | return result; 52 | } 53 | 54 | int CameraTest_Run() 55 | { 56 | int result = 0; 57 | 58 | // if (pCamera) 59 | // pCamera->startPreview(); 60 | // else 61 | // return 1; 62 | 63 | return result; 64 | } 65 | 66 | int CameraTest_ReleaseFrame(void* pPhys, void* pVirt) 67 | { 68 | int result = 0; 69 | 70 | // if (pCamera) 71 | // pCamera->releaseFrame(pPhys, pVirt); 72 | // else 73 | // return 1; 74 | 75 | return result; 76 | } 77 | 78 | int CameraTest_Exit() 79 | { 80 | int result = 0; 81 | 82 | // if (pCamera) 83 | // { 84 | // pCamera->stopPreview(); 85 | // delete pCamera; 86 | // } 87 | // pCamera = NULL; 88 | 89 | return result; 90 | } 91 | 92 | 93 | EXTERN_C_END 94 | -------------------------------------------------------------------------------- /mm-video/qdsp6/venc/test/common/inc/venctest_Script.h: -------------------------------------------------------------------------------- 1 | /*-------------------------------------------------------------------------- 2 | Copyright (c) 2010, Code Aurora Forum. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Code Aurora nor 12 | the names of its contributors may be used to endorse or promote 13 | products derived from this software without specific prior written 14 | permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | --------------------------------------------------------------------------*/ 28 | 29 | #ifndef _VENC_TEST_SCRIPT_H 30 | #define _VENC_TEST_SCRIPT_H 31 | 32 | /*======================================================================== 33 | 34 | INCLUDE FILES FOR MODULE 35 | 36 | ==========================================================================*/ 37 | #include "OMX_Core.h" 38 | #include "venctest_ComDef.h" 39 | 40 | namespace venctest 41 | { 42 | class File; // forward declaration 43 | 44 | /** 45 | * @brief Class for parsing test case script file 46 | */ 47 | class Script 48 | { 49 | public: 50 | 51 | /** 52 | * @brief Constructor 53 | */ 54 | Script(); 55 | 56 | /** 57 | * @brief Destructor 58 | */ 59 | ~Script(); 60 | 61 | public: 62 | 63 | /** 64 | * @brief Parses the script file 65 | * 66 | * This method can only be called one time per instantiation of this class 67 | * 68 | * @param pFileName The name of the script file 69 | */ 70 | OMX_ERRORTYPE Configure(OMX_STRING pFileName); 71 | 72 | /** 73 | * @brief Parses the next test from the test script 74 | * 75 | * @return OMX_ErrorNoMore if there are no more tests to run 76 | */ 77 | OMX_ERRORTYPE NextTest(TestDescriptionType* pTestDescription); 78 | 79 | private: 80 | File* m_pFile; 81 | }; 82 | 83 | } // namespace venctest 84 | 85 | #endif // #ifndef _VENC_TEST_SCRIPT_H 86 | -------------------------------------------------------------------------------- /mm-video/vidc/venc/inc/omx_video_encoder.h: -------------------------------------------------------------------------------- 1 | /*-------------------------------------------------------------------------- 2 | Copyright (c) 2010, Code Aurora Forum. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Code Aurora nor 12 | the names of its contributors may be used to endorse or promote 13 | products derived from this software without specific prior written 14 | permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | --------------------------------------------------------------------------*/ 28 | #ifndef __OMX_VENC__H 29 | #define __OMX_VENC__H 30 | 31 | #include "omx_video_base.h" 32 | #include "video_encoder_device.h" 33 | 34 | extern "C" { 35 | OMX_API void * get_omx_component_factory_fn(void); 36 | } 37 | 38 | class omx_venc: public omx_video 39 | { 40 | public: 41 | omx_venc(); //constructor 42 | ~omx_venc(); //des 43 | static int async_message_process (void *context, void* message); 44 | OMX_ERRORTYPE component_init(OMX_STRING role); 45 | OMX_ERRORTYPE set_parameter(OMX_HANDLETYPE hComp, 46 | OMX_INDEXTYPE paramIndex, 47 | OMX_PTR paramData); 48 | OMX_ERRORTYPE set_config(OMX_HANDLETYPE hComp, 49 | OMX_INDEXTYPE configIndex, 50 | OMX_PTR configData); 51 | OMX_ERRORTYPE component_deinit(OMX_HANDLETYPE hComp); 52 | //OMX strucutres 53 | OMX_U32 m_nVenc_format; 54 | class venc_dev *handle; 55 | 56 | private: 57 | OMX_U32 dev_stop(void); 58 | OMX_U32 dev_pause(void); 59 | OMX_U32 dev_start(void); 60 | OMX_U32 dev_flush(unsigned); 61 | OMX_U32 dev_resume(void); 62 | bool dev_use_buf( void *,unsigned); 63 | bool dev_free_buf( void *,unsigned); 64 | bool dev_empty_buf(void *, void *); 65 | bool dev_fill_buf(void *, void *); 66 | bool dev_get_buf_req(OMX_U32 *,OMX_U32 *,OMX_U32 *,OMX_U32); 67 | bool dev_set_buf_req(OMX_U32 *,OMX_U32 *,OMX_U32 *,OMX_U32); 68 | }; 69 | 70 | #endif //__OMX_VENC__H 71 | -------------------------------------------------------------------------------- /mm-core/omxcore/src/common/qc_omx_core.h: -------------------------------------------------------------------------------- 1 | /*-------------------------------------------------------------------------- 2 | Copyright (c) 2009, Code Aurora Forum. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Code Aurora nor 12 | the names of its contributors may be used to endorse or promote 13 | products derived from this software without specific prior written 14 | permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | --------------------------------------------------------------------------*/ 28 | /*============================================================================ 29 | O p e n M A X w r a p p e r s 30 | O p e n M A X C o r e 31 | 32 | This module contains the definitions of the OpenMAX core. 33 | 34 | *//*========================================================================*/ 35 | 36 | #ifndef QC_OMX_CORE_H 37 | #define QC_OMX_CORE_H 38 | 39 | #include "qc_omx_common.h" // OMX API 40 | #include 41 | 42 | #define OMX_COMP_MAX_INST 4 43 | 44 | typedef struct _omx_core_cb_type 45 | { 46 | char* name;// Component name 47 | create_qc_omx_component fn_ptr;// create instance fn ptr 48 | void* inst[OMX_COMP_MAX_INST];// Instance handle 49 | void* so_lib_handle;// So Library handle 50 | char* so_lib_name;// so directory 51 | char* roles[OMX_CORE_MAX_CMP_ROLES];// roles played 52 | }omx_core_cb_type; 53 | 54 | typedef struct 55 | { 56 | OMX_U32 width; 57 | OMX_U32 height; 58 | OMX_U32 profile; 59 | OMX_U32 level; 60 | } VideoOMXConfigParserOutputs; 61 | 62 | 63 | typedef struct 64 | { 65 | OMX_U8* inPtr; //pointer to codec configuration header 66 | OMX_U32 inBytes; //length of codec configuration header 67 | OMX_STRING cComponentRole; //OMX component codec type 68 | OMX_STRING cComponentName; //OMX component name 69 | } OMXConfigParserInputs; 70 | 71 | #endif 72 | 73 | -------------------------------------------------------------------------------- /mm-video/qdsp6/vdec/Makefile: -------------------------------------------------------------------------------- 1 | # --------------------------------------------------------------------------------- 2 | # MM-VIDEO-OSS-8K-VDEC 3 | # --------------------------------------------------------------------------------- 4 | 5 | # cross-compiler flags 6 | CFLAGS += -Wall 7 | CFLAGS += -Wundef 8 | CFLAGS += -Wstrict-prototypes 9 | CFLAGS += -Wno-trigraphs 10 | #CFLAGS += -Werror 11 | 12 | # cross-compile flags specific to shared objects 13 | CFLAGS_SO += -fpic 14 | 15 | # required pre-processor flags 16 | CPPFLAGS += -D__packed__= 17 | CPPFLAGS += -DIMAGE_APPS_PROC 18 | CPPFLAGS += -DFEATURE_Q_SINGLE_LINK 19 | CPPFLAGS += -DFEATURE_Q_NO_SELF_QPTR 20 | CPPFLAGS += -DFEATURE_LINUX 21 | CPPFLAGS += -DFEATURE_NATIVELINUX 22 | CPPFLAGS += -DFEATURE_DSM_DUP_ITEMS 23 | CPPFLAGS += -DPROFILE_DECODER 24 | CPPFLAGS += -DUSE_PMEM_ADSP_CACHED 25 | CPPFLAGS += -Du32="unsigned int" 26 | CPPFLAGS += -Du8="unsigned char" 27 | CPPFLAGS += -Iinc 28 | CPPFLAGS += -Isrc 29 | 30 | # linker flags 31 | LDFLAGS += -L$(SYSROOT)/usr/lib 32 | 33 | # linker flags for shared objects 34 | LDFLAGS_SO += -shared 35 | 36 | # defintions 37 | LIBMAJOR := $(basename $(basename $(LIBVER))) 38 | LIBINSTALLDIR := $(DESTDIR)usr/lib 39 | BININSTALLDIR := $(DESTDIR)usr/bin 40 | 41 | # --------------------------------------------------------------------------------- 42 | # BUILD 43 | # --------------------------------------------------------------------------------- 44 | all: libOmxVdec.so.$(LIBVER) mm-vdec-omx-test 45 | 46 | install: 47 | echo "installing opensource video decoder in $(DESTDIR)" 48 | if [ ! -d $(LIBINSTALLDIR) ]; then mkdir -p $(LIBINSTALLDIR); fi 49 | if [ ! -d $(BININSTALLDIR) ]; then mkdir -p $(BININSTALLDIR); fi 50 | install -m 555 libOmxVdec.so.$(LIBVER) $(LIBINSTALLDIR) 51 | cd $(LIBINSTALLDIR) && ln -s libOmxVdec.so.$(LIBVER) libOmxVdec.so.$(LIBMAJOR) 52 | cd $(LIBINSTALLDIR) && ln -s libOmxVdec.so.$(LIBMAJOR) libOmxVdec.so 53 | install -m 555 mm-vdec-omx-test $(BININSTALLDIR) 54 | 55 | # --------------------------------------------------------------------------------- 56 | # COMPILE LIBRARY 57 | # --------------------------------------------------------------------------------- 58 | SRCS := src/adsp.c 59 | SRCS += src/pmem.c 60 | SRCS += src/qutility.c 61 | SRCS += src/vdec.cpp 62 | SRCS += src/omx_vdec.cpp 63 | SRCS += src/omx_vdec_linux.cpp 64 | SRCS += src/omx_vdec_inpbuf.cpp 65 | SRCS += src/MP4_Utils.cpp 66 | SRCS += src/H264_Utils.cpp 67 | 68 | LDLIBS := -lpthread 69 | LDLIBS += -lrt 70 | LDLIBS += -lstdc++ 71 | LDLIBS += -lOmxCore 72 | 73 | libOmxVdec.so.$(LIBVER): $(SRCS) 74 | $(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_SO) $(LDFLAGS_SO) -Wl,-soname,libOmxVdec.so.$(LIBMAJOR) -o $@ $^ $(LDFLAGS) $(LDLIBS) 75 | 76 | # --------------------------------------------------------------------------------- 77 | # COMPILE TEST APP 78 | # --------------------------------------------------------------------------------- 79 | TEST_LDLIBS := -lpthread 80 | TEST_LDLIBS += -ldl 81 | TEST_LDLIBS += -lOmxCore 82 | 83 | TEST_SRCS := test/omx_vdec_test.cpp 84 | TEST_SRCS += test/queue.c 85 | 86 | mm-vdec-omx-test: libOmxVdec.so.$(LIBVER) $(TEST_SRCS) 87 | $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ $^ $(TEST_LDLIBS) 88 | 89 | # --------------------------------------------------------------------------------- 90 | # END 91 | # --------------------------------------------------------------------------------- 92 | -------------------------------------------------------------------------------- /mm-video/qdsp6/venc/test/common/inc/venctest_TestPmem.h: -------------------------------------------------------------------------------- 1 | /*-------------------------------------------------------------------------- 2 | Copyright (c) 2010, Code Aurora Forum. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Code Aurora nor 12 | the names of its contributors may be used to endorse or promote 13 | products derived from this software without specific prior written 14 | permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | --------------------------------------------------------------------------*/ 28 | 29 | #ifndef _VENC_TEST_PMEM_H 30 | #define _VENC_TEST_PMEM_H 31 | 32 | /*======================================================================== 33 | 34 | INCLUDE FILES FOR MODULE 35 | 36 | ==========================================================================*/ 37 | #include "OMX_Core.h" 38 | #include "venctest_ITestCase.h" 39 | 40 | namespace venctest 41 | { 42 | class Encoder; // forward declaration 43 | 44 | /** 45 | * @brief Test case for both alloc and use buffer models of pmem allocation 46 | */ 47 | class TestPmem : public ITestCase 48 | { 49 | public: 50 | 51 | /** 52 | * @brief Constructor 53 | */ 54 | TestPmem() ; 55 | 56 | /** 57 | * @brief Destructor 58 | */ 59 | virtual ~TestPmem(); 60 | 61 | private: 62 | 63 | virtual OMX_ERRORTYPE Execute(EncoderConfigType* pConfig, 64 | DynamicConfigType* pDynamicConfig); 65 | 66 | virtual OMX_ERRORTYPE ValidateAssumptions(EncoderConfigType* pConfig, 67 | DynamicConfigType* pDynamicConfig); 68 | 69 | 70 | static OMX_ERRORTYPE EBD(OMX_IN OMX_HANDLETYPE hComponent, 71 | OMX_IN OMX_PTR pAppData, 72 | OMX_IN OMX_BUFFERHEADERTYPE* pBuffer); 73 | 74 | static OMX_ERRORTYPE FBD(OMX_IN OMX_HANDLETYPE hComponent, 75 | OMX_IN OMX_PTR pAppData, 76 | OMX_IN OMX_BUFFERHEADERTYPE* pBuffer); 77 | 78 | private: 79 | Encoder* m_pEncoder; 80 | }; 81 | 82 | } // namespace venctest 83 | 84 | #endif // #ifndef _VENC_TEST_PMEM_H 85 | -------------------------------------------------------------------------------- /mm-video/vidc/vdec/inc/decoder_driver_test.h: -------------------------------------------------------------------------------- 1 | /*-------------------------------------------------------------------------- 2 | Copyright (c) 2010, Code Aurora Forum. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Code Aurora nor 12 | the names of its contributors may be used to endorse or promote 13 | products derived from this software without specific prior written 14 | permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | --------------------------------------------------------------------------*/ 28 | #include 29 | #include 30 | #include "message_queue.h" 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | 39 | struct video_decoder_context 40 | { 41 | enum vdec_codec decoder_format; 42 | enum vdec_output_fromat output_format; 43 | struct vdec_picsize video_resoultion; 44 | struct vdec_allocatorproperty input_buffer; 45 | struct vdec_allocatorproperty output_buffer; 46 | struct vdec_bufferpayload **ptr_inputbuffer; 47 | struct vdec_bufferpayload **ptr_outputbuffer; 48 | struct vdec_output_frameinfo **ptr_respbuffer; 49 | struct video_queue_context queue_context; 50 | int video_driver_fd; 51 | 52 | FILE * inputBufferFile; 53 | FILE * outputBufferFile; 54 | 55 | pthread_t videothread_id; 56 | pthread_t asyncthread_id; 57 | sem_t sem_synchronize; 58 | }; 59 | 60 | int init_decoder ( struct video_decoder_context *init_decode ); 61 | int allocate_buffer ( enum vdec_buffer, 62 | struct video_decoder_context *decode_context 63 | ); 64 | int free_buffer ( enum vdec_buffer, 65 | struct video_decoder_context *decode_context 66 | ); 67 | int start_decoding (struct video_decoder_context *decode_context); 68 | int stop_decoding (struct video_decoder_context *decode_context); 69 | int deinit_decoder (struct video_decoder_context *init_decode); 70 | -------------------------------------------------------------------------------- /mm-video/vidc/venc/inc/video_encoder_test.h: -------------------------------------------------------------------------------- 1 | /*-------------------------------------------------------------------------- 2 | Copyright (c) 2010, Code Aurora Forum. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Code Aurora nor 12 | the names of its contributors may be used to endorse or promote 13 | products derived from this software without specific prior written 14 | permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | --------------------------------------------------------------------------*/ 28 | #include 29 | #include 30 | #include "queue.h" 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | 39 | #define INPUT_BUFFER 0 40 | #define OUTPUT_BUFFER 1 41 | 42 | struct video_encoder_context 43 | { 44 | unsigned long input_width; 45 | unsigned long input_height; 46 | unsigned long codectype; 47 | unsigned long fps_num; 48 | unsigned long fps_den; 49 | unsigned long targetbitrate; 50 | unsigned long inputformat; 51 | 52 | struct venc_allocatorproperty input_buffer; 53 | struct venc_allocatorproperty output_buffer; 54 | struct venc_bufferpayload **ptr_inputbuffer; 55 | struct venc_bufferpayload **ptr_outputbuffer; 56 | struct video_queue_context queue_context; 57 | int video_driver_fd; 58 | 59 | FILE * inputBufferFile; 60 | FILE * outputBufferFile; 61 | 62 | pthread_t videothread_id; 63 | pthread_t asyncthread_id; 64 | sem_t sem_synchronize; 65 | }; 66 | 67 | int init_encoder ( struct video_encoder_context *init_decode ); 68 | int allocate_buffer ( unsigned int buffer_dir, 69 | struct video_encoder_context *decode_context 70 | ); 71 | int free_buffer ( unsigned int buffer_dir, 72 | struct video_encoder_context *decode_context 73 | ); 74 | int start_encoding (struct video_encoder_context *decode_context); 75 | int stop_encoding (struct video_encoder_context *decode_context); 76 | int deinit_encoder (struct video_encoder_context *init_decode); 77 | -------------------------------------------------------------------------------- /mm-video/vidc/vdec/inc/frameparser.h: -------------------------------------------------------------------------------- 1 | /*-------------------------------------------------------------------------- 2 | Copyright (c) 2010, Code Aurora Forum. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Code Aurora nor 12 | the names of its contributors may be used to endorse or promote 13 | products derived from this software without specific prior written 14 | permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | --------------------------------------------------------------------------*/ 28 | #ifndef FRAMEPARSER_H 29 | #define FRAMEPARSER_H 30 | 31 | #include "OMX_Core.h" 32 | #include "OMX_QCOMExtns.h" 33 | #include "h264_utils.h" 34 | //#include 35 | 36 | 37 | enum codec_type 38 | { 39 | CODEC_TYPE_MPEG4 = 0, 40 | CODEC_TYPE_H263 = 1, 41 | CODEC_TYPE_H264 = 2, 42 | CODEC_TYPE_VC1 = 3 43 | }; 44 | 45 | enum state_start_code_parse 46 | { 47 | A0, 48 | A1, 49 | A2, 50 | A3, 51 | A4 52 | }; 53 | 54 | enum state_nal_parse 55 | { 56 | NAL_LENGTH_ACC, 57 | NAL_PARSING 58 | }; 59 | 60 | class frame_parse 61 | { 62 | 63 | public: 64 | H264_Utils *mutils; 65 | int init_start_codes (codec_type codec_type_parse); 66 | int parse_mpeg4_frame (OMX_BUFFERHEADERTYPE *source, 67 | OMX_BUFFERHEADERTYPE *dest , 68 | OMX_U32 *partialframe); 69 | int init_nal_length (unsigned int nal_length); 70 | int parse_h264_nallength (OMX_BUFFERHEADERTYPE *source, 71 | OMX_BUFFERHEADERTYPE *dest , 72 | OMX_U32 *partialframe); 73 | void flush (); 74 | void update_metadata (unsigned int time_stamp ,unsigned int flags); 75 | frame_parse (); 76 | ~frame_parse (); 77 | 78 | private: 79 | /*Variables for Start code based Parsing*/ 80 | enum state_start_code_parse parse_state; 81 | unsigned char start_code[4]; 82 | char mask_code[4]; 83 | unsigned char last_byte,prev_one; 84 | 85 | /*Variables for NAL Length Parsing*/ 86 | enum state_nal_parse state_nal; 87 | unsigned int nal_length; 88 | unsigned int accum_length; 89 | unsigned int bytes_tobeparsed; 90 | unsigned int time_stamp; 91 | unsigned int flags; 92 | }; 93 | 94 | #endif /* FRAMEPARSER_H */ 95 | -------------------------------------------------------------------------------- /mm-video/qdsp6/venc/test/common/inc/venctest_Pmem.h: -------------------------------------------------------------------------------- 1 | /*-------------------------------------------------------------------------- 2 | Copyright (c) 2010, Code Aurora Forum. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Code Aurora nor 12 | the names of its contributors may be used to endorse or promote 13 | products derived from this software without specific prior written 14 | permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | --------------------------------------------------------------------------*/ 28 | 29 | #ifndef _VENC_TEST_PMEM_H 30 | #define _VENC_TEST_PMEM_H 31 | 32 | /*======================================================================== 33 | 34 | INCLUDE FILES FOR MODULE 35 | 36 | ==========================================================================*/ 37 | #include "OMX_Core.h" 38 | #include 39 | #include 40 | #include 41 | 42 | #include 43 | #include 44 | #include 45 | #include "venc_debug.h" 46 | 47 | #include 48 | 49 | 50 | namespace venctest 51 | { 52 | 53 | /** 54 | * @brief Class for allocating / deallocating pmem buffers. 55 | * 56 | * Underlying implementation is hidden. Optionally allocate a single pool of 57 | * memory and slice into multiple buffers. 58 | */ 59 | class Pmem 60 | { 61 | public: 62 | 63 | /** 64 | * @brief Constructor 65 | */ 66 | Pmem(OMX_S32 nBuffers); 67 | 68 | /** 69 | * @brief Destructor 70 | */ 71 | ~Pmem(); 72 | 73 | public: 74 | 75 | OMX_ERRORTYPE Allocate(OMX_U8** ppBuffer, 76 | OMX_S32 nBytes, int pmem_region_id); 77 | 78 | OMX_ERRORTYPE Free(OMX_U8* pBuffer); 79 | 80 | private: 81 | 82 | Pmem() {} // don't allow default constructor 83 | OMX_ERRORTYPE pmem_alloc(struct venc_pmem *pBuf, int size, int pmem_region_id); 84 | OMX_ERRORTYPE pmem_free(struct venc_pmem *pBuf); 85 | 86 | private: 87 | 88 | OMX_S32 m_nBuffers; 89 | OMX_S32 m_nBuffersAlloc; 90 | struct venc_pmem* m_pBufferInfo; 91 | 92 | }; 93 | } // namespace venctest 94 | 95 | #endif // #ifndef _VENC_TEST_PMEM_H 96 | -------------------------------------------------------------------------------- /mm-video/qdsp6/vdec/src/omx_vdec_inpbuf.h: -------------------------------------------------------------------------------- 1 | /*-------------------------------------------------------------------------- 2 | Copyright (c) 2009, Code Aurora Forum. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Code Aurora nor 12 | the names of its contributors may be used to endorse or promote 13 | products derived from this software without specific prior written 14 | permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | --------------------------------------------------------------------------*/ 28 | 29 | #ifndef __OMX_VDEC_INPBUF_H__ 30 | #define __OMX_VDEC_INPBUF_H__ 31 | /*============================================================================ 32 | O p e n M A X Component 33 | Video Decoder 34 | 35 | *//** @file omx_vdec_inpbuf.h 36 | This module contains the class definition for openMAX input buffer related logic. 37 | 38 | *//*========================================================================*/ 39 | 40 | 41 | ////////////////////////////////////////////////////////////////////////////// 42 | // Include Files 43 | ////////////////////////////////////////////////////////////////////////////// 44 | 45 | // Number of input buffers defined at one place 46 | #define MAX_NUM_INPUT_BUFFERS 8 47 | #define MAX_INPUT_BUFFERS_BITMASK_SIZE ((MAX_NUM_INPUT_BUFFERS/8) + 1) 48 | 49 | // OMX video decoder input buffer class 50 | class omx_vdec_inpbuf { 51 | public: 52 | omx_vdec_inpbuf(); // constructor 53 | virtual ~ omx_vdec_inpbuf(); // destructor 54 | 55 | bool add_entry(unsigned int index); 56 | int remove_top_entry(); 57 | 58 | // Any buffer pending? 59 | bool is_pending(); 60 | // Is buffer with particular index pending? 61 | bool is_pending(unsigned int index); 62 | int get_first_pending_index(void); 63 | bool push_back_entry(unsigned int index); 64 | 65 | private: 66 | unsigned int m_pend_q[MAX_NUM_INPUT_BUFFERS]; 67 | unsigned int m_read; // read pointer 68 | unsigned int m_write; // write pointer 69 | int m_size; // size 70 | int m_last; // last entry deleted 71 | unsigned char m_flags[MAX_INPUT_BUFFERS_BITMASK_SIZE]; 72 | 73 | }; 74 | 75 | #endif // __OMX_VDEC_H__ 76 | -------------------------------------------------------------------------------- /mm-video/qdsp6/vdec/src/omx_vdec_linux.h: -------------------------------------------------------------------------------- 1 | /*-------------------------------------------------------------------------- 2 | Copyright (c) 2009, Code Aurora Forum. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Code Aurora nor 12 | the names of its contributors may be used to endorse or promote 13 | products derived from this software without specific prior written 14 | permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | --------------------------------------------------------------------------*/ 28 | 29 | #ifndef __OMX_VDEC_LINUX_H__ 30 | #define __OMX_VDEC_LINUX_H__ 31 | /*============================================================================ 32 | O p e n M A X Component 33 | Video Decoder 34 | 35 | *//** @file comx_vdec.h 36 | This module contains the class definition for openMAX decoder component. 37 | 38 | *//*========================================================================*/ 39 | 40 | 41 | ////////////////////////////////////////////////////////////////////////////// 42 | // Include Files 43 | ////////////////////////////////////////////////////////////////////////////// 44 | 45 | /* Uncomment out below line 46 | #define LOG_NDEBUG 0 if we want to see all LOG Verbose messaging */ 47 | 48 | #include 49 | #include 50 | #include 51 | #include 52 | #include 53 | #include "omx_vdec.h" 54 | 55 | class omx_vdec_linux:public omx_vdec { 56 | public: 57 | omx_vdec_linux(); // constructor 58 | virtual ~ omx_vdec_linux(); // destructor 59 | virtual OMX_ERRORTYPE create_msg_thread(); 60 | virtual void post_message(unsigned char id); 61 | virtual void mutex_lock(); 62 | virtual void mutex_unlock(); 63 | virtual void semaphore_wait(); 64 | virtual void semaphore_post(); 65 | 66 | int m_pipe_in; // for communicating with the message thread 67 | int m_pipe_out; // for communicating with the message thread 68 | pthread_t msg_thread_id; 69 | 70 | private: 71 | pthread_mutex_t m_lock; 72 | pthread_mutexattr_t m_lock_attr; 73 | bool is_thread_created; 74 | //sem to handle the minimum procesing of commands 75 | sem_t m_cmd_lock; 76 | }; 77 | 78 | #endif // __OMX_VDEC_LINUX_H__ 79 | -------------------------------------------------------------------------------- /mm-video/qdsp6/venc/test/common/inc/venctest_TestGetSyntaxHdr.h: -------------------------------------------------------------------------------- 1 | /*-------------------------------------------------------------------------- 2 | Copyright (c) 2010, Code Aurora Forum. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Code Aurora nor 12 | the names of its contributors may be used to endorse or promote 13 | products derived from this software without specific prior written 14 | permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | --------------------------------------------------------------------------*/ 28 | 29 | #ifndef _VENC_TEST_GET_SYNTAX_HDR 30 | #define _VENC_TEST_GET_SYNTAX_HDR 31 | 32 | /*======================================================================== 33 | 34 | INCLUDE FILES FOR MODULE 35 | 36 | ==========================================================================*/ 37 | #include "OMX_Core.h" 38 | #include "venctest_ITestCase.h" 39 | 40 | namespace venctest 41 | { 42 | class Encoder; // forward declaration 43 | class SignalQueue; // forward declaration 44 | 45 | /** 46 | * @brief Test case for in-band and out-of-band syntax header. 47 | */ 48 | class TestGetSyntaxHdr : public ITestCase 49 | { 50 | public: 51 | 52 | /** 53 | * @brief Constructor 54 | */ 55 | TestGetSyntaxHdr() ; 56 | 57 | /** 58 | * @brief Destructor 59 | */ 60 | virtual ~TestGetSyntaxHdr(); 61 | 62 | private: 63 | 64 | virtual OMX_ERRORTYPE Execute(EncoderConfigType* pConfig, 65 | DynamicConfigType* pDynamicConfig, 66 | OMX_S32 nTestNum); 67 | 68 | virtual OMX_ERRORTYPE ValidateAssumptions(EncoderConfigType* pConfig, 69 | DynamicConfigType* pDynamicConfig); 70 | 71 | OMX_ERRORTYPE GetInBandSyntaxHeader(OMX_BUFFERHEADERTYPE* pBuffer); 72 | 73 | static OMX_ERRORTYPE EBD(OMX_IN OMX_HANDLETYPE hComponent, 74 | OMX_IN OMX_PTR pAppData, 75 | OMX_IN OMX_BUFFERHEADERTYPE* pBuffer); 76 | 77 | static OMX_ERRORTYPE FBD(OMX_IN OMX_HANDLETYPE hComponent, 78 | OMX_IN OMX_PTR pAppData, 79 | OMX_IN OMX_BUFFERHEADERTYPE* pBuffer); 80 | 81 | private: 82 | Encoder* m_pEncoder; 83 | SignalQueue* m_pSignalQueue; 84 | }; 85 | 86 | } // namespace venctest 87 | 88 | #endif // #ifndef _VENC_TEST_GET_SYNTAX_HDR 89 | -------------------------------------------------------------------------------- /mm-video/qdsp6/vdec/test/queue.c: -------------------------------------------------------------------------------- 1 | /*-------------------------------------------------------------------------- 2 | Copyright (c) 2009, Code Aurora Forum. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Code Aurora nor 12 | the names of its contributors may be used to endorse or promote 13 | products derived from this software without specific prior written 14 | permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | --------------------------------------------------------------------------*/ 28 | /* 29 | Queue with Linked list 30 | */ 31 | 32 | #include "queue.h" 33 | #include 34 | #include 35 | 36 | typedef struct Node 37 | { 38 | void *element; 39 | struct Node *next; 40 | } Node; 41 | 42 | struct Queue 43 | { 44 | Node *head; 45 | Node *tail; 46 | int current_size; 47 | }; 48 | 49 | Queue *alloc_queue() 50 | { 51 | Queue *q = (Queue *) malloc(sizeof(Queue)); 52 | if (q) 53 | { 54 | q->head = q->tail = NULL; 55 | q->current_size = 0; 56 | } 57 | return q; 58 | } 59 | 60 | void free_queue(Queue *q) 61 | { 62 | while (q->current_size) 63 | { 64 | pop(q); 65 | } 66 | } 67 | 68 | void free_queue_and_qelement(Queue *q) 69 | { 70 | while (q->current_size) 71 | { 72 | void *element = pop(q); 73 | if (element) 74 | free(element); 75 | } 76 | } 77 | 78 | int push(Queue *q, void * element) 79 | { 80 | Node *new_node = (Node *) malloc(sizeof(Node)); 81 | 82 | if (new_node == NULL) 83 | return -1; 84 | 85 | new_node->element = element; 86 | new_node->next = NULL; 87 | 88 | if (q->current_size == 0) 89 | { 90 | q->head = new_node; 91 | } 92 | else 93 | { 94 | q->tail->next = new_node; 95 | } 96 | 97 | q->tail = new_node; 98 | q->current_size++; 99 | 100 | return 0; 101 | } 102 | 103 | void *pop(Queue *q) 104 | { 105 | Node *temp; 106 | void *element; 107 | 108 | if (q->current_size == 0) 109 | return NULL; 110 | 111 | temp = q->head; 112 | element = temp->element; 113 | 114 | if (q->current_size == 1) 115 | { 116 | q->head = q->tail = NULL; 117 | } 118 | else 119 | { 120 | q->head = q->head->next; 121 | } 122 | 123 | free(temp); 124 | q->current_size--; 125 | return element; 126 | } 127 | 128 | -------------------------------------------------------------------------------- /mm-video/vidc/vdec/src/queue.c: -------------------------------------------------------------------------------- 1 | /*-------------------------------------------------------------------------- 2 | Copyright (c) 2010, Code Aurora Forum. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Code Aurora nor 12 | the names of its contributors may be used to endorse or promote 13 | products derived from this software without specific prior written 14 | permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | --------------------------------------------------------------------------*/ 28 | /* 29 | Queue with Linked list 30 | */ 31 | 32 | #include "queue.h" 33 | #include 34 | #include 35 | 36 | 37 | typedef struct Node 38 | { 39 | void *element; 40 | struct Node *next; 41 | } Node; 42 | 43 | struct Queue 44 | { 45 | Node *head; 46 | Node *tail; 47 | int current_size; 48 | }; 49 | 50 | Queue *alloc_queue() 51 | { 52 | Queue *q = (Queue *) malloc(sizeof(Queue)); 53 | if (q) 54 | { 55 | q->head = q->tail = NULL; 56 | q->current_size = 0; 57 | } 58 | return q; 59 | } 60 | 61 | void free_queue(Queue *q) 62 | { 63 | while (q->current_size) 64 | { 65 | pop(q); 66 | } 67 | } 68 | 69 | void free_queue_and_qelement(Queue *q) 70 | { 71 | while (q->current_size) 72 | { 73 | void *element = pop(q); 74 | if (element) 75 | free(element); 76 | } 77 | } 78 | 79 | int push(Queue *q, void * element) 80 | { 81 | Node *new_node = (Node *) malloc(sizeof(Node)); 82 | 83 | if (new_node == NULL) 84 | return -1; 85 | 86 | new_node->element = element; 87 | new_node->next = NULL; 88 | 89 | if (q->current_size == 0) 90 | { 91 | q->head = new_node; 92 | } 93 | else 94 | { 95 | q->tail->next = new_node; 96 | } 97 | 98 | q->tail = new_node; 99 | q->current_size++; 100 | 101 | return 0; 102 | } 103 | 104 | void *pop(Queue *q) 105 | { 106 | Node *temp; 107 | void *element; 108 | 109 | if (q->current_size == 0) 110 | return NULL; 111 | 112 | temp = q->head; 113 | element = temp->element; 114 | 115 | if (q->current_size == 1) 116 | { 117 | q->head = q->tail = NULL; 118 | } 119 | else 120 | { 121 | q->head = q->head->next; 122 | } 123 | 124 | free(temp); 125 | q->current_size--; 126 | return element; 127 | } 128 | 129 | -------------------------------------------------------------------------------- /mm-video/qdsp6/venc/common/inc/venc_file.h: -------------------------------------------------------------------------------- 1 | /*-------------------------------------------------------------------------- 2 | Copyright (c) 2010, Code Aurora Forum. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Code Aurora nor 12 | the names of its contributors may be used to endorse or promote 13 | products derived from this software without specific prior written 14 | permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | --------------------------------------------------------------------------*/ 28 | 29 | #ifndef _VENC_FILE_H 30 | #define _VENC_FILE_H 31 | 32 | #ifdef __cplusplus 33 | extern "C" { 34 | #endif 35 | /*======================================================================== 36 | 37 | INCLUDE FILES FOR MODULE 38 | 39 | ==========================================================================*/ 40 | 41 | /** 42 | * @brief Opens the file in read or write mode 43 | * 44 | * @param handle The new file handle 45 | * @param filename The name of the file 46 | * @param readonly Set to 1 for read access, 0 for write access. 47 | */ 48 | int venc_file_open(void** handle, 49 | char* filename, 50 | int readonly); 51 | 52 | /** 53 | * @brief Closes the file 54 | */ 55 | int venc_file_close(void* handle); 56 | 57 | /** 58 | * @brief Reads the file. Only valid in read mode. 59 | * 60 | * @param handle The file handle 61 | * @param buffer The buffer to read into 62 | * @param bytes The number of bytes to read 63 | * @param bytes_read The number of bytes actually read (output) 64 | */ 65 | int venc_file_read(void* handle, 66 | void* buffer, 67 | int bytes); 68 | 69 | /** 70 | * @brief Writes to the file. Only valid in write mode. 71 | * 72 | * @param handle The file handle 73 | * @param buffer The buffer to write from 74 | * @param bytes The number of bytes to write 75 | * @param bytes_write The number of bytes actually written (output) 76 | */ 77 | int venc_file_write(void* handle, 78 | void* buffer, 79 | int bytes); 80 | 81 | /** 82 | * @brief Reposition the file pointer. 83 | * 84 | * @param handle The file handle 85 | * @param bytes The number of bytes from the start of file 86 | */ 87 | int venc_file_seek_start(void* handle, 88 | int bytes); 89 | 90 | #ifdef __cplusplus 91 | } 92 | #endif 93 | 94 | #endif // #ifndef _VENC_FILE_H 95 | -------------------------------------------------------------------------------- /mm-video/qdsp6/vdec/src/qutility.c: -------------------------------------------------------------------------------- 1 | /*-------------------------------------------------------------------------- 2 | Copyright (c) 2009, Code Aurora Forum. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Code Aurora nor 12 | the names of its contributors may be used to endorse or promote 13 | products derived from this software without specific prior written 14 | permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | --------------------------------------------------------------------------*/ 28 | 29 | #include "qutility.h" 30 | 31 | #ifdef T_WINNT 32 | #include 33 | /* 34 | * Number of micro-seconds between the beginning of the Windows epoch 35 | * (Jan. 1, 1601) and the Unix epoch (Jan. 1, 1970). 36 | * 37 | * This assumes all Win32 compilers have 64-bit support. 38 | */ 39 | #if defined(_MSC_VER) || defined(_MSC_EXTENSIONS) || defined(__WATCOMC__) 40 | #define DELTA_EPOCH_IN_USEC 11644473600000000Ui64 41 | #else 42 | #define DELTA_EPOCH_IN_USEC 11644473600000000ULL 43 | #endif 44 | 45 | static usecs_t filetime_to_unix_epoch(const FILETIME * ft) 46 | { 47 | usecs_t res = (usecs_t) ft->dwHighDateTime << 32; 48 | 49 | res |= ft->dwLowDateTime; 50 | res /= 10; /* from 100 nano-sec periods to usec */ 51 | res -= DELTA_EPOCH_IN_USEC; /* from Win epoch to Unix epoch */ 52 | return (res); 53 | } 54 | 55 | int gettimeofday(struct timeval *tv, void *tz) 56 | { 57 | FILETIME ft; 58 | usecs_t tim; 59 | 60 | if (!tv) { 61 | errno = EINVAL; 62 | return (-1); 63 | } 64 | GetSystemTimeAsFileTime(&ft); 65 | tim = filetime_to_unix_epoch(&ft); 66 | tv->tv_sec = (long)(tim / 1000000L); 67 | tv->tv_usec = (long)(tim % 1000000L); 68 | return (0); 69 | } 70 | #endif //T_WINNT 71 | 72 | int fwritex(const void *ptr, int count, FILE * stream) 73 | { 74 | char *ptr1 = (char *)ptr; 75 | int bytes, total_bytes = 0; 76 | printx("\nfwritex(), count: %d, remainder: %d\n", count, count % 1024); 77 | do { 78 | if (count >= 1024) { 79 | bytes = fwrite(ptr1, 1, 1024, stream); 80 | //printx("fwritex: %d\n", bytes); 81 | ptr1 += 1024; 82 | count -= 1024; 83 | total_bytes += bytes; 84 | } else { 85 | bytes = fwrite(ptr1, 1, count, stream); 86 | printx("\nfwritex: %d\n", bytes); 87 | count = 0; 88 | total_bytes += bytes; 89 | } 90 | } while (count); 91 | return total_bytes; 92 | } 93 | -------------------------------------------------------------------------------- /mm-video/qdsp6/venc/test/common/inc/venctest_Config.h: -------------------------------------------------------------------------------- 1 | /*-------------------------------------------------------------------------- 2 | Copyright (c) 2010, Code Aurora Forum. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Code Aurora nor 12 | the names of its contributors may be used to endorse or promote 13 | products derived from this software without specific prior written 14 | permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | --------------------------------------------------------------------------*/ 28 | 29 | #ifndef _VENC_TEST_CONFIG_H 30 | #define _VENC_TEST_CONFIG_H 31 | 32 | /*======================================================================== 33 | 34 | INCLUDE FILES FOR MODULE 35 | 36 | ==========================================================================*/ 37 | #include "OMX_Core.h" 38 | #include "venctest_ComDef.h" 39 | 40 | 41 | namespace venctest 42 | { 43 | class File; // forward declaration 44 | 45 | /** 46 | * @brief Class for configuring video encoder and video encoder test cases 47 | */ 48 | class Config 49 | { 50 | public: 51 | 52 | /** 53 | * @brief Constructor 54 | */ 55 | Config(); 56 | 57 | /** 58 | * @brief Destructor 59 | */ 60 | ~Config(); 61 | 62 | /** 63 | * @brief Parses the config file obtaining the configuration 64 | * 65 | * @param pFileName The name of the config file 66 | * @param pEncoderConfig The encoder config. 67 | * @param pDynamicConfig The dynamic encoder config. Optional (NULL is valid). 68 | */ 69 | OMX_ERRORTYPE Parse(OMX_STRING pFileName, 70 | EncoderConfigType* pEncoderConfig, 71 | DynamicConfigType* pDynamicConfig); 72 | 73 | /** 74 | * @brief Gets the current or default encoder configuration. 75 | * 76 | * @param pEncoderConfig The configuration 77 | */ 78 | OMX_ERRORTYPE GetEncoderConfig(EncoderConfigType* pEncoderConfig); 79 | 80 | /** 81 | * @brief Gets the current or default dynamic encoder configuration. 82 | * 83 | * @param pDynamicConfig The configuration 84 | */ 85 | OMX_ERRORTYPE GetDynamicConfig(DynamicConfigType* pDynamicConfig); 86 | 87 | private: 88 | EncoderConfigType m_sEncoderConfig; 89 | DynamicConfigType m_sDynamicConfig; 90 | }; 91 | } // namespace venctest 92 | 93 | #endif // #ifndef _VENC_TEST_CONFIG_H 94 | -------------------------------------------------------------------------------- /mm-video/qdsp6/venc/test/common/inc/venctest_Thread.h: -------------------------------------------------------------------------------- 1 | /*-------------------------------------------------------------------------- 2 | Copyright (c) 2010, Code Aurora Forum. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Code Aurora nor 12 | the names of its contributors may be used to endorse or promote 13 | products derived from this software without specific prior written 14 | permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | --------------------------------------------------------------------------*/ 28 | 29 | #ifndef _VENC_TEST_THREAD_H 30 | #define _VENC_TEST_THREAD_H 31 | 32 | /*======================================================================== 33 | 34 | INCLUDE FILES FOR MODULE 35 | 36 | ==========================================================================*/ 37 | #include "OMX_Core.h" 38 | #include "venc_thread.h" 39 | 40 | namespace venctest 41 | { 42 | 43 | /** 44 | * @brief Thread class 45 | */ 46 | class Thread 47 | { 48 | public: 49 | 50 | /** 51 | * @brief Thread start function pointer 52 | */ 53 | typedef OMX_ERRORTYPE (*StartFnType) (OMX_PTR pThreadData); 54 | 55 | public: 56 | 57 | /** 58 | * @brief Constructor (NOTE: does not create the thread!) 59 | */ 60 | Thread(); 61 | 62 | /** 63 | * @brief Destructor (NOTE: does not destroty the thread!) 64 | */ 65 | ~Thread(); 66 | 67 | /** 68 | * @brief Starts the thread at the specified function 69 | * 70 | * @param pFn Pointer to the thread start function 71 | * @param pThreadArgs Arguments passed in to the thread (null is valid) 72 | * @param nPriority Priority of the thread, unique to each platform. 73 | */ 74 | OMX_ERRORTYPE Start(StartFnType pFn, 75 | OMX_PTR pThreadArgs, 76 | OMX_S32 nPriority); 77 | 78 | /** 79 | * @brief Joins the thread 80 | * 81 | * Function will block until the thread exits. 82 | * 83 | * @param pThreadResult If not NULL the threads status will be store here 84 | */ 85 | OMX_ERRORTYPE Join(OMX_ERRORTYPE* pThreadResult); 86 | 87 | private: 88 | static int ThreadEntry(void* pThreadData); 89 | 90 | private: 91 | StartFnType m_pFn; 92 | OMX_S32 m_nPriority; 93 | void* m_pThread; 94 | OMX_PTR m_pThreadArgs; 95 | }; 96 | } 97 | 98 | #endif // #ifndef _VENC_TEST_THREAD_H 99 | -------------------------------------------------------------------------------- /mm-video/qdsp6/venc/test/common/src/venctest_Mutex.cpp: -------------------------------------------------------------------------------- 1 | /*-------------------------------------------------------------------------- 2 | Copyright (c) 2010, Code Aurora Forum. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Code Aurora nor 12 | the names of its contributors may be used to endorse or promote 13 | products derived from this software without specific prior written 14 | permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | --------------------------------------------------------------------------*/ 28 | 29 | /*======================================================================== 30 | Include Files 31 | ==========================================================================*/ 32 | #include "venctest_ComDef.h" 33 | #include "venctest_Mutex.h" 34 | #include "venctest_Debug.h" 35 | #include "venc_mutex.h" 36 | 37 | namespace venctest 38 | { 39 | 40 | ///////////////////////////////////////////////////////////////////////////// 41 | ///////////////////////////////////////////////////////////////////////////// 42 | Mutex::Mutex() : 43 | m_pMutex(NULL) 44 | { 45 | if (venc_mutex_create(&m_pMutex) != 0) 46 | { 47 | VENC_TEST_MSG_ERROR("failed to init mutex"); 48 | } 49 | } 50 | 51 | ///////////////////////////////////////////////////////////////////////////// 52 | ///////////////////////////////////////////////////////////////////////////// 53 | Mutex::~Mutex() 54 | { 55 | if (venc_mutex_destroy(m_pMutex) != 0) 56 | { 57 | VENC_TEST_MSG_ERROR("failed to destroy mutex"); 58 | } 59 | } 60 | 61 | ///////////////////////////////////////////////////////////////////////////// 62 | ///////////////////////////////////////////////////////////////////////////// 63 | OMX_ERRORTYPE Mutex::Lock() 64 | { 65 | OMX_ERRORTYPE result = OMX_ErrorNone; 66 | if (venc_mutex_lock(m_pMutex) != 0) 67 | { 68 | VENC_TEST_MSG_ERROR("failed to lock mutex"); 69 | result = OMX_ErrorUndefined; 70 | } 71 | return result; 72 | } 73 | 74 | ///////////////////////////////////////////////////////////////////////////// 75 | ///////////////////////////////////////////////////////////////////////////// 76 | OMX_ERRORTYPE Mutex::UnLock() 77 | { 78 | OMX_ERRORTYPE result = OMX_ErrorNone; 79 | if (venc_mutex_unlock(m_pMutex) != 0) 80 | { 81 | VENC_TEST_MSG_ERROR("failed to unlock mutex"); 82 | result = OMX_ErrorUndefined; 83 | } 84 | return result; 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /mm-core/omxcore/inc/QOMX_AudioIndexExtensions.h: -------------------------------------------------------------------------------- 1 | /*-------------------------------------------------------------------------- 2 | Copyright (c) 2009, Code Aurora Forum. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Code Aurora nor 12 | the names of its contributors may be used to endorse or promote 13 | products derived from this software without specific prior written 14 | permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | --------------------------------------------------------------------------*/ 28 | /*============================================================================ 29 | O p e n M A X w r a p p e r s 30 | O p e n M A X C o r e 31 | 32 | *//** @file QOMX_AudioIndexExtensions.h 33 | This module contains the index extensions for Audio 34 | 35 | *//*========================================================================*/ 36 | 37 | 38 | #ifndef __H_QOMX_AUDIOINDEXEXTENSIONS_H__ 39 | #define __H_QOMX_AUDIOINDEXEXTENSIONS_H__ 40 | 41 | /*======================================================================== 42 | 43 | INCLUDE FILES FOR MODULE 44 | 45 | ========================================================================== */ 46 | #include 47 | 48 | /*======================================================================== 49 | 50 | DEFINITIONS AND DECLARATIONS 51 | 52 | ========================================================================== */ 53 | 54 | #if defined( __cplusplus ) 55 | extern "C" 56 | { 57 | #endif /* end of macro __cplusplus */ 58 | 59 | /** 60 | * Enumeration used to define Qualcomm's vendor extensions for 61 | * audio. The audio extensions occupy a range of 62 | * 0x7F100000-0x7F1FFFFF, inclusive. 63 | */ 64 | typedef enum QOMX_AUDIO_EXTENSIONS_INDEXTYPE 65 | { 66 | QOMX_IndexParamAudioAmrWbPlus = 0x7F200000, /**< "OMX.Qualcomm.index.audio.amrwbplus" */ 67 | QOMX_IndexParamAudioWma10Pro = 0x7F200001, /**< "OMX.Qualcomm.index.audio.wma10pro" */ 68 | QOMX_IndexParamAudioSessionId = 0x7F200002, /**< "OMX.Qualcomm.index.audio.sessionId" */ 69 | QOMX_IndexParamAudioVoiceRecord = 0x7F200003, /**< "OMX.Qualcomm.index.audio.VoiceRecord" */ 70 | QOMX_IndexParamAudioUnused = 0x7F2FFFFF 71 | } QOMX_AUDIO_EXTENSIONS_INDEXTYPE; 72 | 73 | #if defined( __cplusplus ) 74 | } 75 | #endif /* end of macro __cplusplus */ 76 | 77 | #endif /* end of macro __H_QOMX_AUDIOINDEXEXTENSIONS_H__ */ 78 | -------------------------------------------------------------------------------- /mm-video/qdsp6/venc/test/common/inc/venctest_TestProfileEncode.h: -------------------------------------------------------------------------------- 1 | /*-------------------------------------------------------------------------- 2 | Copyright (c) 2010, Code Aurora Forum. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Code Aurora nor 12 | the names of its contributors may be used to endorse or promote 13 | products derived from this software without specific prior written 14 | permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | --------------------------------------------------------------------------*/ 28 | 29 | #ifndef _VENC_TEST_PROFILE_ENCODE_H 30 | #define _VENC_TEST_PROFILE_ENCODE_H 31 | 32 | /*======================================================================== 33 | 34 | INCLUDE FILES FOR MODULE 35 | 36 | ==========================================================================*/ 37 | #include "OMX_Core.h" 38 | #include "venctest_ITestCase.h" 39 | 40 | namespace venctest 41 | { 42 | class FileSource; // forward declaration 43 | class FileSink; // forward declaration 44 | class Encoder; // forward declaration 45 | 46 | /** 47 | * @brief Test case for bitrate and frame rate analysis 48 | */ 49 | class TestProfileEncode : public ITestCase 50 | { 51 | public: 52 | 53 | /** 54 | * @brief Constructor 55 | */ 56 | TestProfileEncode() ; 57 | 58 | /** 59 | * @brief Destructor 60 | */ 61 | virtual ~TestProfileEncode(); 62 | 63 | private: 64 | 65 | virtual OMX_ERRORTYPE Execute(EncoderConfigType* pConfig, 66 | DynamicConfigType* pDynamicConfig); 67 | 68 | virtual OMX_ERRORTYPE ValidateAssumptions(EncoderConfigType* pConfig, 69 | DynamicConfigType* pDynamicConfig); 70 | 71 | 72 | static void SourceDeliveryFn(OMX_BUFFERHEADERTYPE* pBuffer); 73 | 74 | static void SinkReleaseFn(OMX_BUFFERHEADERTYPE* pBuffer); 75 | 76 | static OMX_ERRORTYPE EBD(OMX_IN OMX_HANDLETYPE hComponent, 77 | OMX_IN OMX_PTR pAppData, 78 | OMX_IN OMX_BUFFERHEADERTYPE* pBuffer); 79 | 80 | static OMX_ERRORTYPE FBD(OMX_IN OMX_HANDLETYPE hComponent, 81 | OMX_IN OMX_PTR pAppData, 82 | OMX_IN OMX_BUFFERHEADERTYPE* pBuffer); 83 | 84 | private: 85 | FileSource* m_pSource; 86 | FileSink* m_pSink; 87 | Encoder* m_pEncoder; 88 | OMX_S32 m_nFramesCoded; 89 | OMX_S64 m_nBits; 90 | }; 91 | 92 | } // namespace venctest 93 | 94 | #endif // #ifndef _VENC_TEST_PROFILE_ENCODE_H 95 | -------------------------------------------------------------------------------- /mm-video/qdsp6/venc/test/common/inc/venctest_TestEncode.h: -------------------------------------------------------------------------------- 1 | /*-------------------------------------------------------------------------- 2 | Copyright (c) 2010, Code Aurora Forum. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Code Aurora nor 12 | the names of its contributors may be used to endorse or promote 13 | products derived from this software without specific prior written 14 | permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | --------------------------------------------------------------------------*/ 28 | 29 | #ifndef _VENC_TEST_PROFILE_ENCODE_H 30 | #define _VENC_TEST_PROFILE_ENCODE_H 31 | 32 | /*======================================================================== 33 | 34 | INCLUDE FILES FOR MODULE 35 | 36 | ==========================================================================*/ 37 | #include "OMX_Core.h" 38 | #include "venctest_ITestCase.h" 39 | 40 | namespace venctest 41 | { 42 | class FileSource; // forward declaration 43 | class FileSink; // forward declaration 44 | class Encoder; // forward declaration 45 | 46 | /** 47 | * @brief Test case for bitrate and frame rate analysis 48 | */ 49 | class TestEncode : public ITestCase 50 | { 51 | public: 52 | 53 | /** 54 | * @brief Constructor 55 | */ 56 | TestEncode() ; 57 | 58 | /** 59 | * @brief Destructor 60 | */ 61 | virtual ~TestEncode(); 62 | 63 | private: 64 | 65 | virtual OMX_ERRORTYPE Execute(EncoderConfigType* pConfig, 66 | DynamicConfigType* pDynamicConfig, 67 | OMX_S32 nTestNum); 68 | 69 | virtual OMX_ERRORTYPE ValidateAssumptions(EncoderConfigType* pConfig, 70 | DynamicConfigType* pDynamicConfig); 71 | 72 | 73 | static void SourceDeliveryFn(OMX_BUFFERHEADERTYPE* pBuffer); 74 | 75 | static void SinkReleaseFn(OMX_BUFFERHEADERTYPE* pBuffer); 76 | 77 | static OMX_ERRORTYPE EBD(OMX_IN OMX_HANDLETYPE hComponent, 78 | OMX_IN OMX_PTR pAppData, 79 | OMX_IN OMX_BUFFERHEADERTYPE* pBuffer); 80 | 81 | static OMX_ERRORTYPE FBD(OMX_IN OMX_HANDLETYPE hComponent, 82 | OMX_IN OMX_PTR pAppData, 83 | OMX_IN OMX_BUFFERHEADERTYPE* pBuffer); 84 | 85 | private: 86 | FileSource* m_pSource; 87 | FileSink* m_pSink; 88 | Encoder* m_pEncoder; 89 | OMX_S32 m_nFramesCoded; 90 | OMX_S64 m_nBits; 91 | }; 92 | 93 | } // namespace venctest 94 | 95 | #endif // #ifndef _VENC_TEST_PROFILE_ENCODE_H 96 | -------------------------------------------------------------------------------- /mm-video/qdsp6/vdec/src/qtypes.h: -------------------------------------------------------------------------------- 1 | /*-------------------------------------------------------------------------- 2 | Copyright (c) 2009, Code Aurora Forum. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Code Aurora nor 12 | the names of its contributors may be used to endorse or promote 13 | products derived from this software without specific prior written 14 | permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | --------------------------------------------------------------------------*/ 28 | #ifndef QTYPES_H 29 | #define QTYPES_H 30 | /*=========================================================================== 31 | 32 | Data Declarations 33 | 34 | ===========================================================================*/ 35 | 36 | #ifdef __cplusplus 37 | extern "C" { 38 | #endif 39 | 40 | /* ------------------------------------------------------------------------ 41 | ** Constants 42 | ** ------------------------------------------------------------------------ */ 43 | 44 | #ifdef TRUE 45 | #undef TRUE 46 | #endif 47 | 48 | #ifdef FALSE 49 | #undef FALSE 50 | #endif 51 | 52 | #define TRUE 1 /* Boolean true value. */ 53 | #define FALSE 0 /* Boolean false value. */ 54 | 55 | /* ----------------------------------------------------------------------- 56 | ** Standard Types 57 | ** ----------------------------------------------------------------------- */ 58 | 59 | /* The following definitions are the same accross platforms. This first 60 | ** group are the sanctioned types. 61 | */ 62 | 63 | typedef unsigned char boolean; /* Boolean value type. */ 64 | 65 | typedef unsigned long int uint32; /* Unsigned 32 bit value */ 66 | typedef unsigned short uint16; /* Unsigned 16 bit value */ 67 | typedef unsigned char uint8; /* Unsigned 8 bit value */ 68 | 69 | typedef signed long int int32; /* Signed 32 bit value */ 70 | typedef signed short int16; /* Signed 16 bit value */ 71 | typedef signed char int8; /* Signed 8 bit value */ 72 | 73 | /* This group are the deprecated types. Their use should be 74 | ** discontinued and new code should use the types above 75 | */ 76 | typedef unsigned char byte; /* Unsigned 8 bit value type. */ 77 | typedef unsigned short word; /* Unsinged 16 bit value type. */ 78 | typedef unsigned long dword; /* Unsigned 32 bit value type. */ 79 | 80 | typedef long long int64; 81 | typedef unsigned long long uint64; 82 | 83 | #ifdef __cplusplus 84 | } 85 | #endif 86 | #endif /* QTYPES_H */ 87 | -------------------------------------------------------------------------------- /mm-video/qdsp6/venc/test/common/inc/venctest_TestStatePause.h: -------------------------------------------------------------------------------- 1 | /*-------------------------------------------------------------------------- 2 | Copyright (c) 2010, Code Aurora Forum. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Code Aurora nor 12 | the names of its contributors may be used to endorse or promote 13 | products derived from this software without specific prior written 14 | permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | --------------------------------------------------------------------------*/ 28 | 29 | #ifndef _VENC_TEST_STATE_EXECUTING_TO_PAUSE_H 30 | #define _VENC_TEST_STATE_EXECUTING_TO_PAUSE_H 31 | 32 | /*======================================================================== 33 | 34 | INCLUDE FILES FOR MODULE 35 | 36 | ==========================================================================*/ 37 | #include "OMX_Core.h" 38 | #include "venctest_ITestCase.h" 39 | #include "venctest_ComDef.h" 40 | 41 | namespace venctest 42 | { 43 | class Encoder; // forward declaration 44 | class Queue; // forward declaration 45 | class Mutex; // forward declaration 46 | 47 | /** 48 | * @brief Test case for the pause state. A stress test. 49 | */ 50 | class TestStatePause : public ITestCase 51 | { 52 | public: 53 | 54 | /** 55 | * @brief Constructor 56 | */ 57 | TestStatePause() ; 58 | 59 | /** 60 | * @brief Destructor 61 | */ 62 | virtual ~TestStatePause(); 63 | 64 | private: 65 | 66 | virtual OMX_ERRORTYPE Execute(EncoderConfigType* pConfig, 67 | DynamicConfigType* pDynamicConfig, 68 | OMX_S32 nTestNum); 69 | 70 | virtual OMX_ERRORTYPE ValidateAssumptions(EncoderConfigType* pConfig, 71 | DynamicConfigType* pDynamicConfig); 72 | 73 | OMX_ERRORTYPE DeliverBuffers(OMX_BOOL bDeliverInput, 74 | OMX_BOOL bDeliverOutput, 75 | EncoderConfigType* pConfig); 76 | 77 | static OMX_ERRORTYPE EBD(OMX_IN OMX_HANDLETYPE hComponent, 78 | OMX_IN OMX_PTR pAppData, 79 | OMX_IN OMX_BUFFERHEADERTYPE* pBuffer); 80 | 81 | static OMX_ERRORTYPE FBD(OMX_IN OMX_HANDLETYPE hComponent, 82 | OMX_IN OMX_PTR pAppData, 83 | OMX_IN OMX_BUFFERHEADERTYPE* pBuffer); 84 | 85 | private: 86 | Encoder* m_pEncoder; 87 | Mutex* m_pMutex; 88 | Queue* m_pInputQueue; 89 | Queue* m_pOutputQueue; 90 | OMX_TICKS m_nTimeStamp; 91 | }; 92 | 93 | } // namespace venctest 94 | 95 | #endif // #ifndef _VENC_TEST_STATE_EXECUTING_TO_PAUSE_H 96 | -------------------------------------------------------------------------------- /mm-video/vidc/vdec/inc/qtypes.h: -------------------------------------------------------------------------------- 1 | /*-------------------------------------------------------------------------- 2 | Copyright (c) 2010, Code Aurora Forum. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Code Aurora nor 12 | the names of its contributors may be used to endorse or promote 13 | products derived from this software without specific prior written 14 | permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | --------------------------------------------------------------------------*/ 28 | #ifndef QTYPES_H 29 | #define QTYPES_H 30 | /*=========================================================================== 31 | 32 | Data Declarations 33 | 34 | ===========================================================================*/ 35 | 36 | #ifdef __cplusplus 37 | extern "C" { 38 | #endif 39 | 40 | /* ------------------------------------------------------------------------ 41 | ** Constants 42 | ** ------------------------------------------------------------------------ */ 43 | 44 | #ifdef TRUE 45 | #undef TRUE 46 | #endif 47 | 48 | #ifdef FALSE 49 | #undef FALSE 50 | #endif 51 | 52 | #define TRUE 1 /* Boolean true value. */ 53 | #define FALSE 0 /* Boolean false value. */ 54 | 55 | 56 | 57 | /* ----------------------------------------------------------------------- 58 | ** Standard Types 59 | ** ----------------------------------------------------------------------- */ 60 | 61 | /* The following definitions are the same accross platforms. This first 62 | ** group are the sanctioned types. 63 | */ 64 | 65 | typedef unsigned char boolean; /* Boolean value type. */ 66 | 67 | typedef unsigned long int uint32; /* Unsigned 32 bit value */ 68 | typedef unsigned short uint16; /* Unsigned 16 bit value */ 69 | typedef unsigned char uint8; /* Unsigned 8 bit value */ 70 | 71 | typedef signed long int int32; /* Signed 32 bit value */ 72 | typedef signed short int16; /* Signed 16 bit value */ 73 | typedef signed char int8; /* Signed 8 bit value */ 74 | 75 | /* This group are the deprecated types. Their use should be 76 | ** discontinued and new code should use the types above 77 | */ 78 | typedef unsigned char byte; /* Unsigned 8 bit value type. */ 79 | typedef unsigned short word; /* Unsinged 16 bit value type. */ 80 | typedef unsigned long dword; /* Unsigned 32 bit value type. */ 81 | 82 | typedef long long int64; 83 | typedef unsigned long long uint64; 84 | 85 | 86 | #ifdef __cplusplus 87 | } 88 | #endif 89 | 90 | #endif /* QTYPES_H */ 91 | -------------------------------------------------------------------------------- /mm-video/qdsp6/venc/test/common/inc/venctest_TestSerialEncode.h: -------------------------------------------------------------------------------- 1 | /*-------------------------------------------------------------------------- 2 | Copyright (c) 2010, Code Aurora Forum. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Code Aurora nor 12 | the names of its contributors may be used to endorse or promote 13 | products derived from this software without specific prior written 14 | permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | --------------------------------------------------------------------------*/ 28 | 29 | #ifndef _VENC_TEST_SERIAL_ENCODE_H 30 | #define _VENC_TEST_SERIAL_ENCODE_H 31 | 32 | /*======================================================================== 33 | 34 | INCLUDE FILES FOR MODULE 35 | 36 | ==========================================================================*/ 37 | #include "OMX_Core.h" 38 | #include "venctest_ITestCase.h" 39 | #include "venctest_ComDef.h" 40 | 41 | namespace venctest 42 | { 43 | class Encoder; // forward declaration 44 | class Queue; // forward declaration 45 | class SignalQueue; // forward declaration 46 | class File; // forward declaration 47 | 48 | /** 49 | * @brief Test case that encodes 1 frame at a time (serially). 50 | */ 51 | class TestSerialEncode : public ITestCase 52 | { 53 | public: 54 | 55 | /** 56 | * @brief Constructor 57 | */ 58 | TestSerialEncode() ; 59 | 60 | /** 61 | * @brief Destructor 62 | */ 63 | virtual ~TestSerialEncode(); 64 | 65 | private: 66 | 67 | virtual OMX_ERRORTYPE Execute(EncoderConfigType* pConfig, 68 | DynamicConfigType* pDynamicConfig); 69 | 70 | OMX_ERRORTYPE ProcessSyntaxHeader(); 71 | 72 | virtual OMX_ERRORTYPE ValidateAssumptions(EncoderConfigType* pConfig, 73 | DynamicConfigType* pDynamicConfig); 74 | 75 | OMX_ERRORTYPE EncodeFrames(EncoderConfigType* pEncoderConfig); 76 | 77 | static OMX_ERRORTYPE EBD(OMX_IN OMX_HANDLETYPE hComponent, 78 | OMX_IN OMX_PTR pAppData, 79 | OMX_IN OMX_BUFFERHEADERTYPE* pBuffer); 80 | 81 | static OMX_ERRORTYPE FBD(OMX_IN OMX_HANDLETYPE hComponent, 82 | OMX_IN OMX_PTR pAppData, 83 | OMX_IN OMX_BUFFERHEADERTYPE* pBuffer); 84 | 85 | private: 86 | Encoder* m_pEncoder; 87 | Queue* m_pInputQueue; 88 | Queue* m_pOutputQueue; 89 | SignalQueue* m_pSignalQueue; 90 | File* m_pSource; 91 | File* m_pSink; 92 | }; 93 | 94 | } // namespace venctest 95 | 96 | #endif // #ifndef _VENC_TEST_FILE_ENCODER_H 97 | -------------------------------------------------------------------------------- /mm-video/qdsp6/venc/test/common/inc/venctest_StatsThread.h: -------------------------------------------------------------------------------- 1 | /*-------------------------------------------------------------------------- 2 | Copyright (c) 2010, Code Aurora Forum. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Code Aurora nor 12 | the names of its contributors may be used to endorse or promote 13 | products derived from this software without specific prior written 14 | permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | --------------------------------------------------------------------------*/ 28 | 29 | #ifndef _VENC_TEST_STATS_THREAD_H 30 | #define _VENC_TEST_STATS_THREAD_H 31 | 32 | /*======================================================================== 33 | 34 | INCLUDE FILES FOR MODULE 35 | 36 | ==========================================================================*/ 37 | #include "OMX_Core.h" 38 | 39 | namespace venctest 40 | { 41 | 42 | class Thread; // forward declaration 43 | class Signal; // forward declaration 44 | class Mutex; // forward declaration 45 | 46 | /** 47 | * @brief Collects frame statistics and periodically displays the information 48 | * 49 | */ 50 | class StatsThread 51 | { 52 | public: 53 | 54 | /** 55 | * @brief Constructor 56 | */ 57 | StatsThread(OMX_S32 nSamplePeriodMillis); 58 | 59 | /** 60 | * @brief Destructor 61 | */ 62 | ~StatsThread(); 63 | 64 | public: 65 | 66 | /** 67 | * @brief Starts the stats thread 68 | * 69 | */ 70 | OMX_ERRORTYPE Start(); 71 | 72 | /** 73 | * @brief Tell stats thread to finish 74 | * 75 | * Function will block until the stats thread has exited 76 | */ 77 | OMX_ERRORTYPE Finish(); 78 | 79 | /** 80 | * @brief Set input frame statistics info 81 | */ 82 | OMX_ERRORTYPE SetInputStats(OMX_BUFFERHEADERTYPE* pBuffer); 83 | 84 | /** 85 | * @brief Set output frame statistics info 86 | */ 87 | OMX_ERRORTYPE SetOutputStats(OMX_BUFFERHEADERTYPE* pBuffer); 88 | 89 | private: 90 | static int StatsThreadEntry(OMX_PTR pThreadData); 91 | OMX_ERRORTYPE StatsThreadFn(); 92 | 93 | private: 94 | void *m_pThread; 95 | void *m_pSignal; 96 | void *m_pMutex; 97 | OMX_S32 m_nSamplePeriodMillis; 98 | OMX_S32 m_nInputFrames; 99 | OMX_S32 m_nOutputFrames; 100 | OMX_S64 m_nBits; 101 | }; 102 | 103 | } // namespace venctest 104 | 105 | #endif // #ifndef _VENC_TEST_STATS_THREAD_H 106 | -------------------------------------------------------------------------------- /mm-video/qdsp6/venc/test/common/inc/venctest_TestChangeQuality.h: -------------------------------------------------------------------------------- 1 | /*-------------------------------------------------------------------------- 2 | Copyright (c) 2010, Code Aurora Forum. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Code Aurora nor 12 | the names of its contributors may be used to endorse or promote 13 | products derived from this software without specific prior written 14 | permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | --------------------------------------------------------------------------*/ 28 | 29 | #ifndef _VENC_TEST_CHANGE_QUALITY_H 30 | #define _VENC_TEST_CHANGE_QUALITY_H 31 | 32 | /*======================================================================== 33 | 34 | INCLUDE FILES FOR MODULE 35 | 36 | ==========================================================================*/ 37 | #include "OMX_Core.h" 38 | #include "venctest_ITestCase.h" 39 | 40 | namespace venctest 41 | { 42 | class FileSource; // forward declaration 43 | class FileSink; // forward declaration 44 | class Encoder; // forward declaration 45 | class Mutex; // forward declaration 46 | 47 | /** 48 | * @brief Test case for dynamic quality configuration 49 | */ 50 | class TestChangeQuality : public ITestCase 51 | { 52 | public: 53 | 54 | /** 55 | * @brief Constructor 56 | */ 57 | TestChangeQuality() ; 58 | 59 | /** 60 | * @brief Destructor 61 | */ 62 | virtual ~TestChangeQuality(); 63 | 64 | private: 65 | 66 | virtual OMX_ERRORTYPE Execute(EncoderConfigType* pConfig, 67 | DynamicConfigType* pDynamicConfig, 68 | OMX_S32 nTestNum); 69 | 70 | virtual OMX_ERRORTYPE ValidateAssumptions(EncoderConfigType* pConfig, 71 | DynamicConfigType* pDynamicConfig); 72 | 73 | static void SourceDeliveryFn(OMX_BUFFERHEADERTYPE* pBuffer); 74 | 75 | static void SinkReleaseFn(OMX_BUFFERHEADERTYPE* pBuffer); 76 | 77 | static OMX_ERRORTYPE EBD(OMX_IN OMX_HANDLETYPE hComponent, 78 | OMX_IN OMX_PTR pAppData, 79 | OMX_IN OMX_BUFFERHEADERTYPE* pBuffer); 80 | 81 | static OMX_ERRORTYPE FBD(OMX_IN OMX_HANDLETYPE hComponent, 82 | OMX_IN OMX_PTR pAppData, 83 | OMX_IN OMX_BUFFERHEADERTYPE* pBuffer); 84 | 85 | private: 86 | FileSource* m_pSource; 87 | FileSink* m_pSink; 88 | Encoder* m_pEncoder; 89 | Mutex* m_pMutex; 90 | OMX_S32 m_nFramesCoded; 91 | OMX_S32 m_nFramesDelivered; 92 | OMX_S64 m_nBits; 93 | }; 94 | 95 | } // namespace venctest 96 | 97 | #endif // #ifndef _VENC_TEST_CHANGE_QUALITY_H 98 | -------------------------------------------------------------------------------- /mm-video/qdsp6/venc/test/common/src/venctest_Signal.cpp: -------------------------------------------------------------------------------- 1 | /*-------------------------------------------------------------------------- 2 | Copyright (c) 2010, Code Aurora Forum. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Code Aurora nor 12 | the names of its contributors may be used to endorse or promote 13 | products derived from this software without specific prior written 14 | permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | --------------------------------------------------------------------------*/ 28 | 29 | /*======================================================================== 30 | Include Files 31 | ==========================================================================*/ 32 | #include "venctest_Signal.h" 33 | #include "venctest_Debug.h" 34 | #include "venc_signal.h" 35 | 36 | namespace venctest 37 | { 38 | 39 | ///////////////////////////////////////////////////////////////////////////// 40 | ///////////////////////////////////////////////////////////////////////////// 41 | Signal::Signal() 42 | : m_pSignal(NULL) 43 | { 44 | if (venc_signal_create(&m_pSignal) != 0) 45 | { 46 | VENC_TEST_MSG_ERROR("error creating signal"); 47 | } 48 | } 49 | 50 | ///////////////////////////////////////////////////////////////////////////// 51 | ///////////////////////////////////////////////////////////////////////////// 52 | Signal::~Signal() 53 | { 54 | if (venc_signal_destroy(m_pSignal) != 0) 55 | { 56 | VENC_TEST_MSG_ERROR("error destroying signal"); 57 | } 58 | } 59 | 60 | ///////////////////////////////////////////////////////////////////////////// 61 | ///////////////////////////////////////////////////////////////////////////// 62 | OMX_ERRORTYPE Signal::Set() 63 | { 64 | OMX_ERRORTYPE result = OMX_ErrorNone; 65 | if (venc_signal_set(m_pSignal) != 0) 66 | { 67 | VENC_TEST_MSG_ERROR("error setting signal"); 68 | result = OMX_ErrorUndefined; 69 | } 70 | return result; 71 | } 72 | 73 | ///////////////////////////////////////////////////////////////////////////// 74 | ///////////////////////////////////////////////////////////////////////////// 75 | OMX_ERRORTYPE Signal::Wait(OMX_S32 nTimeoutMillis) 76 | { 77 | OMX_ERRORTYPE result = OMX_ErrorNone; 78 | 79 | int ret = venc_signal_wait(m_pSignal, (int) nTimeoutMillis); 80 | 81 | if (ret == 2) 82 | { 83 | result = OMX_ErrorTimeout; 84 | } 85 | else if (ret != 0) 86 | { 87 | VENC_TEST_MSG_ERROR("error waiting for signal"); 88 | result = OMX_ErrorUndefined; 89 | } 90 | 91 | return result; 92 | } 93 | 94 | } // namespace venctest 95 | -------------------------------------------------------------------------------- /mm-video/qdsp6/venc/test/common/inc/venctest_TestStateExecutingToIdle.h: -------------------------------------------------------------------------------- 1 | /*-------------------------------------------------------------------------- 2 | Copyright (c) 2010, Code Aurora Forum. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Code Aurora nor 12 | the names of its contributors may be used to endorse or promote 13 | products derived from this software without specific prior written 14 | permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | --------------------------------------------------------------------------*/ 28 | 29 | #ifndef _VENC_TEST_STATE_EXECUTING_TO_IDLE_H 30 | #define _VENC_TEST_STATE_EXECUTING_TO_IDLE_H 31 | 32 | /*======================================================================== 33 | 34 | INCLUDE FILES FOR MODULE 35 | 36 | ==========================================================================*/ 37 | #include "OMX_Core.h" 38 | #include "venctest_ITestCase.h" 39 | #include "venctest_ComDef.h" 40 | 41 | namespace venctest 42 | { 43 | class Encoder; // forward declaration 44 | class Queue; // forward declaration 45 | 46 | /** 47 | * @brief Test case for executing to idle. A stress test. 48 | */ 49 | class TestStateExecutingToIdle : public ITestCase 50 | { 51 | public: 52 | 53 | /** 54 | * @brief Constructor 55 | */ 56 | TestStateExecutingToIdle() ; 57 | 58 | /** 59 | * @brief Destructor 60 | */ 61 | virtual ~TestStateExecutingToIdle(); 62 | 63 | private: 64 | 65 | virtual OMX_ERRORTYPE Execute(EncoderConfigType* pConfig, 66 | DynamicConfigType* pDynamicConfig, 67 | OMX_S32 nTestNum); 68 | 69 | virtual OMX_ERRORTYPE ValidateAssumptions(EncoderConfigType* pConfig, 70 | DynamicConfigType* pDynamicConfig); 71 | 72 | 73 | OMX_ERRORTYPE DeliverBuffers(OMX_BOOL bDeliverInput, 74 | OMX_BOOL bDeliverOutput, 75 | EncoderConfigType* pConfig); 76 | 77 | OMX_ERRORTYPE CheckBufferQueues(OMX_S32 nInputBuffers, 78 | OMX_S32 nOutputBuffers); 79 | 80 | static OMX_ERRORTYPE EBD(OMX_IN OMX_HANDLETYPE hComponent, 81 | OMX_IN OMX_PTR pAppData, 82 | OMX_IN OMX_BUFFERHEADERTYPE* pBuffer); 83 | 84 | static OMX_ERRORTYPE FBD(OMX_IN OMX_HANDLETYPE hComponent, 85 | OMX_IN OMX_PTR pAppData, 86 | OMX_IN OMX_BUFFERHEADERTYPE* pBuffer); 87 | 88 | private: 89 | Encoder* m_pEncoder; 90 | Queue* m_pInputQueue; 91 | Queue* m_pOutputQueue; 92 | OMX_TICKS m_nTimeStamp; 93 | }; 94 | 95 | } // namespace venctest 96 | 97 | #endif // #ifndef _VENC_TEST_STATE_EXECUTING_TO_IDLE_H 98 | -------------------------------------------------------------------------------- /mm-video/qdsp6/venc/common/inc/venc_queue.h: -------------------------------------------------------------------------------- 1 | /*-------------------------------------------------------------------------- 2 | Copyright (c) 2010, Code Aurora Forum. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Code Aurora nor 12 | the names of its contributors may be used to endorse or promote 13 | products derived from this software without specific prior written 14 | permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | --------------------------------------------------------------------------*/ 28 | 29 | #ifndef _VENC_QUEUE_H 30 | #define _VENC_QUEUE_H 31 | 32 | #ifdef __cplusplus 33 | extern "C" { 34 | #endif 35 | /*======================================================================== 36 | 37 | INCLUDE FILES FOR MODULE 38 | 39 | ==========================================================================*/ 40 | 41 | /** 42 | * @brief Constructor 43 | * 44 | * @param handle The queue handle 45 | * @param max_queue_size Max number of items in queue (size) 46 | * @param max_data_size Max data size 47 | */ 48 | int venc_queue_create(void** handle, int max_queue_size, int max_data_size); 49 | 50 | /** 51 | * @brief Destructor 52 | * 53 | * @param handle The queue handle 54 | */ 55 | int venc_queue_destroy(void* handle); 56 | 57 | /** 58 | * @brief Pushes an item onto the queue. 59 | * 60 | * @param handle The queue handle 61 | * @param data Pointer to the data 62 | * @param data_size Size of the data in bytes 63 | */ 64 | int venc_queue_push(void* handle, void* data, int data_size); 65 | 66 | /** 67 | * @brief Pops an item from the queue. 68 | * 69 | * @param handle The queue handle 70 | * @param data Pointer to the data 71 | * @param data_size Size of the data buffer in bytes 72 | */ 73 | int venc_queue_pop(void* handle, void* data, int data_size); 74 | 75 | /** 76 | * @brief Peeks at the item at the head of the queue 77 | * 78 | * Nothing will be removed from the queue 79 | * 80 | * @param handle The queue handle 81 | * @param data Pointer to the data 82 | * @param data_size Size of the data in bytes 83 | * 84 | * @return 0 if there is no data 85 | */ 86 | int venc_queue_peek(void* handle, void* data, int data_size); 87 | 88 | /** 89 | * @brief Get the size of the queue. 90 | * 91 | * @param handle The queue handle 92 | */ 93 | int venc_queue_size(void* handle); 94 | 95 | /** 96 | * @brief Check if the queue is full 97 | * 98 | * @param handle The queue handle 99 | */ 100 | int venc_queue_full(void* handle); 101 | 102 | #ifdef __cplusplus 103 | } 104 | #endif 105 | 106 | #endif // #ifndef _VENC_QUEUE_H 107 | -------------------------------------------------------------------------------- /mm-video/qdsp6/venc/test/common/inc/venctest_Queue.h: -------------------------------------------------------------------------------- 1 | /*-------------------------------------------------------------------------- 2 | Copyright (c) 2010, Code Aurora Forum. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Code Aurora nor 12 | the names of its contributors may be used to endorse or promote 13 | products derived from this software without specific prior written 14 | permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | --------------------------------------------------------------------------*/ 28 | 29 | #ifndef _VENC_TEST_QUEUE_H 30 | #define _VENC_TEST_QUEUE_H 31 | /*======================================================================== 32 | 33 | INCLUDE FILES FOR MODULE 34 | 35 | ==========================================================================*/ 36 | #include "OMX_Core.h" 37 | 38 | namespace venctest 39 | { 40 | 41 | /** 42 | * @brief Queue class. 43 | */ 44 | class Queue 45 | { 46 | public: 47 | 48 | /** 49 | * @brief Constructor 50 | * 51 | * @param nMaxQueueSize Max number of items in queue (size) 52 | * @param nMaxDataSize Max data size 53 | */ 54 | Queue(OMX_S32 nMaxQueueSize, 55 | OMX_S32 nMaxDataSize); 56 | 57 | /** 58 | * @brief Destructor 59 | */ 60 | ~Queue(); 61 | 62 | private: 63 | Queue(); // private default constructor 64 | public: 65 | 66 | /** 67 | * @brief Pushes an item onto the queue. 68 | * 69 | * @param pData Pointer to the data 70 | * @param nDataSize Size of the data in bytes 71 | */ 72 | OMX_ERRORTYPE Push(OMX_PTR pData, 73 | OMX_S32 nDataSize); 74 | 75 | /** 76 | * @brief Pops an item from the queue. 77 | * 78 | * @param pData Pointer to the data 79 | * @param nDataSize Size of the data buffer in bytes 80 | */ 81 | OMX_ERRORTYPE Pop(OMX_PTR pData, 82 | OMX_S32 nDataSize); 83 | 84 | /** 85 | * @brief Peeks at the item at the head of the queue 86 | * 87 | * Nothing will be removed from the queue 88 | * 89 | * @param pData Pointer to the data 90 | * @param nDataSize Size of the data in bytes 91 | * 92 | * @return OMX_ErrorNotReady if there is no data 93 | */ 94 | OMX_ERRORTYPE Peek(OMX_PTR pData, 95 | OMX_S32 nDataSize); 96 | 97 | /** 98 | * @brief Get the size of the queue. 99 | */ 100 | OMX_S32 GetSize(); 101 | 102 | private: 103 | OMX_PTR m_pHandle; 104 | }; 105 | } 106 | 107 | #endif // #ifndef _VENC_TEST_QUEUE_H 108 | -------------------------------------------------------------------------------- /mm-video/qdsp6/venc/test/common/inc/venctest_TestFlush.h: -------------------------------------------------------------------------------- 1 | /*-------------------------------------------------------------------------- 2 | Copyright (c) 2010, Code Aurora Forum. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Code Aurora nor 12 | the names of its contributors may be used to endorse or promote 13 | products derived from this software without specific prior written 14 | permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | --------------------------------------------------------------------------*/ 28 | 29 | #ifndef _VENC_TEST_FLUSH_H 30 | #define _VENC_TEST_FLUSH_H 31 | 32 | /*======================================================================== 33 | 34 | INCLUDE FILES FOR MODULE 35 | 36 | ==========================================================================*/ 37 | #include "OMX_Core.h" 38 | #include "venctest_ITestCase.h" 39 | #include "venctest_ComDef.h" 40 | 41 | namespace venctest 42 | { 43 | class Encoder; // forward declaration 44 | class Queue; // forward declaration 45 | class File; // forward declaration 46 | 47 | /** 48 | * @brief Test case that for flushing. A stress test. 49 | */ 50 | class TestFlush : public ITestCase 51 | { 52 | public: 53 | 54 | /** 55 | * @brief Constructor 56 | */ 57 | TestFlush() ; 58 | 59 | /** 60 | * @brief Destructor 61 | */ 62 | virtual ~TestFlush(); 63 | 64 | private: 65 | 66 | virtual OMX_ERRORTYPE Execute(EncoderConfigType* pConfig, 67 | DynamicConfigType* pDynamicConfig, 68 | OMX_S32 nTestNum); 69 | 70 | virtual OMX_ERRORTYPE ValidateAssumptions(EncoderConfigType* pConfig, 71 | DynamicConfigType* pDynamicConfig); 72 | 73 | OMX_ERRORTYPE DeliverBuffers(OMX_BOOL bDeliverInput, 74 | OMX_BOOL bDeliverOutput, 75 | EncoderConfigType* pConfig); 76 | 77 | OMX_ERRORTYPE CheckBufferQueues(OMX_S32 nInputBuffers, 78 | OMX_S32 nOutputBuffers); 79 | 80 | static OMX_ERRORTYPE EBD(OMX_IN OMX_HANDLETYPE hComponent, 81 | OMX_IN OMX_PTR pAppData, 82 | OMX_IN OMX_BUFFERHEADERTYPE* pBuffer); 83 | 84 | static OMX_ERRORTYPE FBD(OMX_IN OMX_HANDLETYPE hComponent, 85 | OMX_IN OMX_PTR pAppData, 86 | OMX_IN OMX_BUFFERHEADERTYPE* pBuffer); 87 | 88 | private: 89 | Encoder* m_pEncoder; 90 | Queue* m_pInputQueue; 91 | Queue* m_pOutputQueue; 92 | File* m_pSource; 93 | File* m_pSink; 94 | OMX_TICKS m_nTimeStamp; 95 | }; 96 | 97 | } // namespace venctest 98 | 99 | #endif // #ifndef _VENC_TEST_FLUSH_H 100 | -------------------------------------------------------------------------------- /mm-video/qdsp6/venc/test/common/inc/venctest_TestIFrameRequest.h: -------------------------------------------------------------------------------- 1 | /*-------------------------------------------------------------------------- 2 | Copyright (c) 2010, Code Aurora Forum. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Code Aurora nor 12 | the names of its contributors may be used to endorse or promote 13 | products derived from this software without specific prior written 14 | permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | --------------------------------------------------------------------------*/ 28 | 29 | #ifndef _VENC_TEST_IFRAME_REQUEST_H 30 | #define _VENC_TEST_IFRAME_REQUEST_H 31 | 32 | /*======================================================================== 33 | 34 | INCLUDE FILES FOR MODULE 35 | 36 | ==========================================================================*/ 37 | #include "OMX_Core.h" 38 | #include "venctest_ITestCase.h" 39 | #include "venctest_ComDef.h" 40 | 41 | namespace venctest 42 | { 43 | class Encoder; // forward declaration 44 | class Queue; // forward declaration 45 | class SignalQueue; // forward declaration 46 | class File; // forward declaration 47 | 48 | /** 49 | * @brief Test case for iframe request verification 50 | */ 51 | class TestIFrameRequest : public ITestCase 52 | { 53 | public: 54 | 55 | /** 56 | * @brief Constructor 57 | */ 58 | TestIFrameRequest() ; 59 | 60 | /** 61 | * @brief Destructor 62 | */ 63 | virtual ~TestIFrameRequest(); 64 | 65 | private: 66 | 67 | virtual OMX_ERRORTYPE Execute(EncoderConfigType* pConfig, 68 | DynamicConfigType* pDynamicConfig, 69 | OMX_S32 nTestNum); 70 | 71 | OMX_ERRORTYPE ProcessSyntaxHeader(); 72 | 73 | virtual OMX_ERRORTYPE ValidateAssumptions(EncoderConfigType* pConfig, 74 | DynamicConfigType* pDynamicConfig); 75 | 76 | 77 | OMX_ERRORTYPE EncodeFrames(EncoderConfigType* pEncoderConfig, 78 | DynamicConfigType* pDynamicConfig); 79 | 80 | static OMX_ERRORTYPE EBD(OMX_IN OMX_HANDLETYPE hComponent, 81 | OMX_IN OMX_PTR pAppData, 82 | OMX_IN OMX_BUFFERHEADERTYPE* pBuffer); 83 | 84 | static OMX_ERRORTYPE FBD(OMX_IN OMX_HANDLETYPE hComponent, 85 | OMX_IN OMX_PTR pAppData, 86 | OMX_IN OMX_BUFFERHEADERTYPE* pBuffer); 87 | 88 | private: 89 | Encoder* m_pEncoder; 90 | Queue* m_pInputQueue; 91 | Queue* m_pOutputQueue; 92 | SignalQueue* m_pSignalQueue; 93 | File* m_pSource; 94 | File* m_pSink; 95 | }; 96 | 97 | } // namespace venctest 98 | 99 | #endif // #ifndef _VENC_TEST_IFRAME_REQUEST_H 100 | -------------------------------------------------------------------------------- /mm-video/qdsp6/venc/test/common/inc/venctest_TestChangeIntraPeriod.h: -------------------------------------------------------------------------------- 1 | /*-------------------------------------------------------------------------- 2 | Copyright (c) 2010, Code Aurora Forum. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of Code Aurora nor 12 | the names of its contributors may be used to endorse or promote 13 | products derived from this software without specific prior written 14 | permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 20 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | --------------------------------------------------------------------------*/ 28 | 29 | #ifndef _VENC_TEST_CHANGE_INTRA_PERIOD_H 30 | #define _VENC_TEST_CHANGE_INTRA_PERIOD_H 31 | 32 | /*======================================================================== 33 | 34 | INCLUDE FILES FOR MODULE 35 | 36 | ==========================================================================*/ 37 | #include "OMX_Core.h" 38 | #include "venctest_ITestCase.h" 39 | #include "venctest_ComDef.h" 40 | 41 | namespace venctest 42 | { 43 | class Encoder; // forward declaration 44 | class Queue; // forward declaration 45 | class SignalQueue; // forward declaration 46 | class File; // forward declaration 47 | 48 | /** 49 | * @brief Test case for dynamic intra period configuration 50 | */ 51 | class TestChangeIntraPeriod : public ITestCase 52 | { 53 | public: 54 | 55 | /** 56 | * @brief Constructor 57 | */ 58 | TestChangeIntraPeriod() ; 59 | 60 | /** 61 | * @brief Destructor 62 | */ 63 | virtual ~TestChangeIntraPeriod(); 64 | 65 | private: 66 | 67 | virtual OMX_ERRORTYPE Execute(EncoderConfigType* pConfig, 68 | DynamicConfigType* pDynamicConfig, 69 | OMX_S32 nTestNum); 70 | 71 | OMX_ERRORTYPE ProcessSyntaxHeader(); 72 | 73 | virtual OMX_ERRORTYPE ValidateAssumptions(EncoderConfigType* pConfig, 74 | DynamicConfigType* pDynamicConfig); 75 | 76 | OMX_ERRORTYPE EncodeFrames(EncoderConfigType* pEncoderConfig, 77 | OMX_S32 nFrames, 78 | OMX_S32 nIntraPeriod); 79 | 80 | static OMX_ERRORTYPE EBD(OMX_IN OMX_HANDLETYPE hComponent, 81 | OMX_IN OMX_PTR pAppData, 82 | OMX_IN OMX_BUFFERHEADERTYPE* pBuffer); 83 | 84 | static OMX_ERRORTYPE FBD(OMX_IN OMX_HANDLETYPE hComponent, 85 | OMX_IN OMX_PTR pAppData, 86 | OMX_IN OMX_BUFFERHEADERTYPE* pBuffer); 87 | 88 | private: 89 | Encoder* m_pEncoder; 90 | Queue* m_pInputQueue; 91 | Queue* m_pOutputQueue; 92 | SignalQueue* m_pSignalQueue; 93 | File* m_pSource; 94 | File* m_pSink; 95 | OMX_TICKS m_nTimeStamp; 96 | }; 97 | 98 | } // namespace venctest 99 | 100 | #endif // #ifndef _VENC_TEST_CHANGE_INTRA_PERIOD_H 101 | --------------------------------------------------------------------------------