diff options
author | Praveen Chavan <pchavan@codeaurora.org> | 2015-07-02 16:09:10 -0700 |
---|---|---|
committer | Linux Build Service Account <lnxbuild@localhost> | 2015-10-06 03:24:13 -0600 |
commit | f48b75f9c6407a2e5b361ec57cefd812404eb02d (patch) | |
tree | aa96592fc8aa8ced49ac374fbf57ab5601d07834 /include | |
parent | 0eb0c1dadf6b5c9948b7e4c63a5cde1adfa48c53 (diff) | |
download | frameworks_av-f48b75f9c6407a2e5b361ec57cefd812404eb02d.zip frameworks_av-f48b75f9c6407a2e5b361ec57cefd812404eb02d.tar.gz frameworks_av-f48b75f9c6407a2e5b361ec57cefd812404eb02d.tar.bz2 |
Stagefright: Make classes customizable and add AV extensions
Change access modifiers and qualify methods with virtual, to
allow extensions. Add facility for loading customizations
(Extended classes) dynamically.
Conflicts:
media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
Change-Id: Icc8965754fb1c73175a13a9ad24c19665ad60988
Diffstat (limited to 'include')
-rw-r--r-- | include/media/AudioTrack.h | 2 | ||||
-rw-r--r-- | include/media/stagefright/ACodec.h | 11 | ||||
-rw-r--r-- | include/media/stagefright/ExtendedMediaDefs.h | 66 | ||||
-rw-r--r-- | include/media/stagefright/MediaDefs.h | 2 |
4 files changed, 77 insertions, 4 deletions
diff --git a/include/media/AudioTrack.h b/include/media/AudioTrack.h index e02f1b7..82d1c55 100644 --- a/include/media/AudioTrack.h +++ b/include/media/AudioTrack.h @@ -31,6 +31,7 @@ namespace android { struct audio_track_cblk_t; class AudioTrackClientProxy; class StaticAudioTrackClientProxy; +struct ExtendedMediaUtils; // ---------------------------------------------------------------------------- @@ -957,6 +958,7 @@ private: pid_t mClientPid; sp<AudioSystem::AudioDeviceCallback> mDeviceCallback; + friend struct ExtendedMediaUtils; }; class TimedAudioTrack : public AudioTrack diff --git a/include/media/stagefright/ACodec.h b/include/media/stagefright/ACodec.h index 8b5b862..6bd7bc6 100644 --- a/include/media/stagefright/ACodec.h +++ b/include/media/stagefright/ACodec.h @@ -93,8 +93,11 @@ struct ACodec : public AHierarchicalStateMachine, public CodecBase { protected: virtual ~ACodec(); + virtual status_t setupCustomCodec( + status_t err, const char *mime, const sp<AMessage> &msg); + virtual status_t GetVideoCodingTypeFromMime( + const char *mime, OMX_VIDEO_CODINGTYPE *codingType); -private: struct BaseState; struct UninitializedState; struct LoadedState; @@ -300,7 +303,7 @@ private: uint32_t portIndex, IOMX::buffer_id bufferID, ssize_t *index = NULL); - status_t setComponentRole(bool isEncoder, const char *mime); + virtual status_t setComponentRole(bool isEncoder, const char *mime); status_t configureCodec(const char *mime, const sp<AMessage> &msg); status_t configureTunneledVideoPlayback(int32_t audioHwSync, @@ -314,7 +317,7 @@ private: status_t setSupportedOutputFormat(bool getLegacyFlexibleFormat); - status_t setupVideoDecoder( + virtual status_t setupVideoDecoder( const char *mime, const sp<AMessage> &msg, bool usingNativeBuffers); status_t setupVideoEncoder( @@ -408,7 +411,7 @@ private: bool dropIncomplete = false, FrameRenderTracker::Info *until = NULL); void sendFormatChange(const sp<AMessage> &reply); - status_t getPortFormat(OMX_U32 portIndex, sp<AMessage> ¬ify); + virtual status_t getPortFormat(OMX_U32 portIndex, sp<AMessage> ¬ify); void signalError( OMX_ERRORTYPE error = OMX_ErrorUndefined, diff --git a/include/media/stagefright/ExtendedMediaDefs.h b/include/media/stagefright/ExtendedMediaDefs.h new file mode 100644 index 0000000..82c8021 --- /dev/null +++ b/include/media/stagefright/ExtendedMediaDefs.h @@ -0,0 +1,66 @@ +/*Copyright (c) 2015, The Linux Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of The Linux Foundation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef _EXTENDED_MEDIA_DEFS_H_ +#define _EXTENDED_MEDIA_DEFS_H_ + +namespace android { + +extern const char *MEDIA_MIMETYPE_AUDIO_EVRC; +extern const char *MEDIA_MIMETYPE_VIDEO_WMV; +extern const char *MEDIA_MIMETYPE_AUDIO_WMA; +extern const char *MEDIA_MIMETYPE_CONTAINER_ASF; +extern const char *MEDIA_MIMETYPE_VIDEO_DIVX; +extern const char *MEDIA_MIMETYPE_CONTAINER_AAC; +extern const char *MEDIA_MIMETYPE_CONTAINER_QCP; +extern const char *MEDIA_MIMETYPE_VIDEO_DIVX311; +extern const char *MEDIA_MIMETYPE_VIDEO_DIVX4; +extern const char *MEDIA_MIMETYPE_CONTAINER_MPEG2; +extern const char *MEDIA_MIMETYPE_CONTAINER_3G2; +extern const char *MEDIA_MIMETYPE_AUDIO_DTS; +extern const char *MEDIA_MIMETYPE_AUDIO_DTS_LBR; +extern const char *MEDIA_MIMETYPE_AUDIO_AMR_WB_PLUS; +extern const char *MEDIA_MIMETYPE_AUDIO_AIFF; +extern const char *MEDIA_MIMETYPE_AUDIO_ALAC; +extern const char *MEDIA_MIMETYPE_AUDIO_APE; +extern const char *MEDIA_MIMETYPE_CONTAINER_QCAMR_NB; +extern const char *MEDIA_MIMETYPE_CONTAINER_QCAMR_WB; +extern const char *MEDIA_MIMETYPE_CONTAINER_QCMPEG; +extern const char *MEDIA_MIMETYPE_CONTAINER_QCWAV; +extern const char *MEDIA_MIMETYPE_CONTAINER_QCMPEG2TS; +extern const char *MEDIA_MIMETYPE_CONTAINER_QCMPEG2PS; +extern const char *MEDIA_MIMETYPE_CONTAINER_QCMPEG4; +extern const char *MEDIA_MIMETYPE_CONTAINER_QCMATROSKA; +extern const char *MEDIA_MIMETYPE_CONTAINER_QCOGG; +extern const char *MEDIA_MIMETYPE_CONTAINER_QCFLV; +extern const char *MEDIA_MIMETYPE_VIDEO_VPX; +extern const char *MEDIA_MIMETYPE_CONTAINER_QTIFLAC; +extern const char *MEDIA_MIMETYPE_VIDEO_MPEG4_DP; + +} // namespace android + +#endif // _EXTENDED_MEDIA_DEFS_H_ diff --git a/include/media/stagefright/MediaDefs.h b/include/media/stagefright/MediaDefs.h index 21eb04a..8b1e63b 100644 --- a/include/media/stagefright/MediaDefs.h +++ b/include/media/stagefright/MediaDefs.h @@ -68,4 +68,6 @@ extern const char *MEDIA_MIMETYPE_DATA_TIMED_ID3; } // namespace android +#include <media/stagefright/ExtendedMediaDefs.h> + #endif // MEDIA_DEFS_H_ |