media/omx-plugin/include/froyo/binder/Binder.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/media/omx-plugin/include/froyo/binder/Binder.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,103 @@
     1.4 +/*
     1.5 + * Copyright (C) 2008 The Android Open Source Project
     1.6 + *
     1.7 + * Licensed under the Apache License, Version 2.0 (the "License");
     1.8 + * you may not use this file except in compliance with the License.
     1.9 + * You may obtain a copy of the License at
    1.10 + *
    1.11 + *      http://www.apache.org/licenses/LICENSE-2.0
    1.12 + *
    1.13 + * Unless required by applicable law or agreed to in writing, software
    1.14 + * distributed under the License is distributed on an "AS IS" BASIS,
    1.15 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    1.16 + * See the License for the specific language governing permissions and
    1.17 + * limitations under the License.
    1.18 + */
    1.19 +
    1.20 +#ifndef ANDROID_BINDER_H
    1.21 +#define ANDROID_BINDER_H
    1.22 +
    1.23 +#include <binder/IBinder.h>
    1.24 +
    1.25 +// ---------------------------------------------------------------------------
    1.26 +namespace android {
    1.27 +
    1.28 +class BBinder : public IBinder
    1.29 +{
    1.30 +public:
    1.31 +                        BBinder();
    1.32 +
    1.33 +    virtual const String16& getInterfaceDescriptor() const;
    1.34 +    virtual bool        isBinderAlive() const;
    1.35 +    virtual status_t    pingBinder();
    1.36 +    virtual status_t    dump(int fd, const Vector<String16>& args);
    1.37 +
    1.38 +    virtual status_t    transact(   uint32_t code,
    1.39 +                                    const Parcel& data,
    1.40 +                                    Parcel* reply,
    1.41 +                                    uint32_t flags = 0);
    1.42 +
    1.43 +    virtual status_t    linkToDeath(const sp<DeathRecipient>& recipient,
    1.44 +                                    void* cookie = NULL,
    1.45 +                                    uint32_t flags = 0);
    1.46 +
    1.47 +    virtual status_t    unlinkToDeath(  const wp<DeathRecipient>& recipient,
    1.48 +                                        void* cookie = NULL,
    1.49 +                                        uint32_t flags = 0,
    1.50 +                                        wp<DeathRecipient>* outRecipient = NULL);
    1.51 +
    1.52 +    virtual void        attachObject(   const void* objectID,
    1.53 +                                        void* object,
    1.54 +                                        void* cleanupCookie,
    1.55 +                                        object_cleanup_func func);
    1.56 +    virtual void*       findObject(const void* objectID) const;
    1.57 +    virtual void        detachObject(const void* objectID);
    1.58 +
    1.59 +    virtual BBinder*    localBinder();
    1.60 +
    1.61 +protected:
    1.62 +    virtual             ~BBinder();
    1.63 +
    1.64 +    virtual status_t    onTransact( uint32_t code,
    1.65 +                                    const Parcel& data,
    1.66 +                                    Parcel* reply,
    1.67 +                                    uint32_t flags = 0);
    1.68 +
    1.69 +private:
    1.70 +                        BBinder(const BBinder& o);
    1.71 +            BBinder&    operator=(const BBinder& o);
    1.72 +
    1.73 +    class Extras;
    1.74 +
    1.75 +            Extras*     mExtras;
    1.76 +            void*       mReserved0;
    1.77 +};
    1.78 +
    1.79 +// ---------------------------------------------------------------------------
    1.80 +
    1.81 +class BpRefBase : public virtual RefBase
    1.82 +{
    1.83 +protected:
    1.84 +                            BpRefBase(const sp<IBinder>& o);
    1.85 +    virtual                 ~BpRefBase();
    1.86 +    virtual void            onFirstRef();
    1.87 +    virtual void            onLastStrongRef(const void* id);
    1.88 +    virtual bool            onIncStrongAttempted(uint32_t flags, const void* id);
    1.89 +
    1.90 +    inline  IBinder*        remote()                { return mRemote; }
    1.91 +    inline  IBinder*        remote() const          { return mRemote; }
    1.92 +
    1.93 +private:
    1.94 +                            BpRefBase(const BpRefBase& o);
    1.95 +    BpRefBase&              operator=(const BpRefBase& o);
    1.96 +
    1.97 +    IBinder* const          mRemote;
    1.98 +    RefBase::weakref_type*  mRefs;
    1.99 +    volatile int32_t        mState;
   1.100 +};
   1.101 +
   1.102 +}; // namespace android
   1.103 +
   1.104 +// ---------------------------------------------------------------------------
   1.105 +
   1.106 +#endif // ANDROID_BINDER_H

mercurial