libstagefright.h
Go to the documentation of this file.
00001 #if !defined(libstagefright) && ANDROID_VER>=420
00002 #define libstagefright
00003 
00004 #include "libstagefright_foundation.h"
00005 
00006 namespace android {
00007 
00008 struct ABuffer;
00009 struct ACodec;
00010 struct AMessage;
00011 struct AString;
00012 struct SoftwareRenderer;
00013 class ICrypto;
00014 class Surface;
00015 class IGraphicBufferProducer;
00016 class SurfaceTextureClient;
00017 
00018 struct MediaCodec : public AHandler {
00019     enum ConfigureFlags {
00020         CONFIGURE_FLAG_ENCODE   = 1,
00021     };
00022 
00023     enum BufferFlags {
00024         BUFFER_FLAG_SYNCFRAME   = 1,
00025         BUFFER_FLAG_CODECCONFIG = 2,
00026         BUFFER_FLAG_EOS         = 4,
00027     };
00028 
00029     static sp<MediaCodec> CreateByType(const sp<ALooper> &looper, const char *mime, bool encoder);
00030     #if (ANDROID_VER>=440)
00031         status_t configure(const sp<AMessage> &format, const sp<Surface> &nativeWindow, const sp<ICrypto> &crypto, uint32_t flags);
00032         status_t createInputSurface(sp<IGraphicBufferProducer>* bufferProducer);
00033     #elif (ANDROID_VER>=420)
00034         status_t configure(const sp<AMessage> &format, const sp<SurfaceTextureClient> &st, const sp<ICrypto> &crypto, uint32_t flags);
00035     #elif (ANDROID_VER>=440)
00036     #endif
00037     status_t start();
00038     status_t dequeueOutputBuffer(size_t *index, size_t *offset, size_t *size, int64_t *presentationTimeUs, uint32_t *flags, int64_t timeoutUs = 0ll);
00039     status_t releaseOutputBuffer(size_t index);
00040     status_t getOutputBuffers(Vector<sp<ABuffer> > *buffers) const;
00041     status_t getInputBuffers(Vector<sp<ABuffer> > *buffers) const;
00042     status_t dequeueInputBuffer(size_t *index, int64_t timeoutUs = 0ll);
00043     status_t queueInputBuffer(size_t index, size_t offset, size_t size, int64_t presentationTimeUs, uint32_t flags, AString *errorDetailMsg = NULL);
00044 
00045 protected:
00046     virtual ~MediaCodec();
00047     virtual void onMessageReceived(const sp<AMessage> &msg);
00048 private:
00049     char __data[sizeof(void*)*256];
00050     /*
00051     State mState;
00052     sp<ALooper> mLooper;
00053     sp<ALooper> mCodecLooper;
00054     sp<ACodec> mCodec;
00055     AString mComponentName;
00056     uint32_t mReplyID;
00057     uint32_t mFlags;
00058     sp<Surface> mNativeWindow;
00059     SoftwareRenderer *mSoftRenderer;
00060     sp<AMessage> mOutputFormat;
00061 
00062     List<size_t> mAvailPortBuffers[2];
00063     Vector<BufferInfo> mPortBuffers[2];
00064 
00065     int32_t mDequeueInputTimeoutGeneration;
00066     uint32_t mDequeueInputReplyID;
00067 
00068     int32_t mDequeueOutputTimeoutGeneration;
00069     uint32_t mDequeueOutputReplyID;
00070 
00071     sp<ICrypto> mCrypto;
00072 
00073     List<sp<ABuffer> > mCSD;
00074 
00075     sp<AMessage> mActivityNotify;
00076 
00077     bool mHaveInputSurface;
00078     */
00079 };
00080 
00081 
00082 } //end of namespace android
00083 
00084 #endif //end of lib


dji_ronin
Author(s):
autogenerated on Sat Jun 8 2019 20:15:31