SurfaceMediaSource.h revision bdddc659a941afdb7f4958f582c6901c07246097
13399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi/*
23399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi * Copyright (C) 2011 The Android Open Source Project
33399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi *
43399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi * Licensed under the Apache License, Version 2.0 (the "License");
53399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi * you may not use this file except in compliance with the License.
63399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi * You may obtain a copy of the License at
73399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi *
83399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi *      http://www.apache.org/licenses/LICENSE-2.0
93399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi *
103399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi * Unless required by applicable law or agreed to in writing, software
113399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi * distributed under the License is distributed on an "AS IS" BASIS,
123399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
133399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi * See the License for the specific language governing permissions and
143399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi * limitations under the License.
153399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi */
163399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi
171a2fafbaa36390a06cc9a066fcbe147c8c47ea77Pannag Sanketi#ifndef ANDROID_GUI_SURFACEMEDIASOURCE_H
181a2fafbaa36390a06cc9a066fcbe147c8c47ea77Pannag Sanketi#define ANDROID_GUI_SURFACEMEDIASOURCE_H
193399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi
203399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi#include <gui/ISurfaceTexture.h>
21bdddc659a941afdb7f4958f582c6901c07246097Daniel Lam#include <gui/BufferQueue.h>
223399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi
233399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi#include <utils/threads.h>
243399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi#include <utils/Vector.h>
253399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi#include <media/stagefright/MediaSource.h>
263399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi#include <media/stagefright/MediaBuffer.h>
273399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi
283399b7267185646c69b04352211fca4fad9d7547Pannag Sanketinamespace android {
293399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi// ----------------------------------------------------------------------------
303399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi
313399b7267185646c69b04352211fca4fad9d7547Pannag Sanketiclass IGraphicBufferAlloc;
323399b7267185646c69b04352211fca4fad9d7547Pannag Sanketiclass String8;
333399b7267185646c69b04352211fca4fad9d7547Pannag Sanketiclass GraphicBuffer;
343399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi
35bdddc659a941afdb7f4958f582c6901c07246097Daniel Lam// ASSUMPTIONS
36bdddc659a941afdb7f4958f582c6901c07246097Daniel Lam// 1. SurfaceMediaSource is initialized with width*height which
37bdddc659a941afdb7f4958f582c6901c07246097Daniel Lam// can never change.  However, deqeueue buffer does not currently
38bdddc659a941afdb7f4958f582c6901c07246097Daniel Lam// enforce this as in BufferQueue, dequeue can be used by SurfaceTexture
39bdddc659a941afdb7f4958f582c6901c07246097Daniel Lam// which can modify the default width and heght.  Also neither the width
40bdddc659a941afdb7f4958f582c6901c07246097Daniel Lam// nor height can be 0.
41bdddc659a941afdb7f4958f582c6901c07246097Daniel Lam// 2. setSynchronousMode is never used (basically no one should call
42bdddc659a941afdb7f4958f582c6901c07246097Daniel Lam// setSynchronousMode(false)
43bdddc659a941afdb7f4958f582c6901c07246097Daniel Lam// 3. setCrop, setTransform, setScalingMode should never be used
44bdddc659a941afdb7f4958f582c6901c07246097Daniel Lam// 4. queueBuffer returns a filled buffer to the SurfaceMediaSource. In addition, a
45bdddc659a941afdb7f4958f582c6901c07246097Daniel Lam// timestamp must be provided for the buffer. The timestamp is in
46bdddc659a941afdb7f4958f582c6901c07246097Daniel Lam// nanoseconds, and must be monotonically increasing. Its other semantics
47bdddc659a941afdb7f4958f582c6901c07246097Daniel Lam// (zero point, etc) are client-dependent and should be documented by the
48bdddc659a941afdb7f4958f582c6901c07246097Daniel Lam// client.
49bdddc659a941afdb7f4958f582c6901c07246097Daniel Lam// 5. Once disconnected, SurfaceMediaSource can be reused (can not
50bdddc659a941afdb7f4958f582c6901c07246097Daniel Lam// connect again)
51bdddc659a941afdb7f4958f582c6901c07246097Daniel Lam// 6. Stop is a hard stop, the last few frames held by the encoder
52bdddc659a941afdb7f4958f582c6901c07246097Daniel Lam// may be dropped.  It is possible to wait for the buffers to be
53bdddc659a941afdb7f4958f582c6901c07246097Daniel Lam// returned (but not implemented)
54bdddc659a941afdb7f4958f582c6901c07246097Daniel Lam
55bdddc659a941afdb7f4958f582c6901c07246097Daniel Lamclass SurfaceMediaSource : public MediaSource,
56bdddc659a941afdb7f4958f582c6901c07246097Daniel Lam                                public MediaBufferObserver,
57bdddc659a941afdb7f4958f582c6901c07246097Daniel Lam                                protected BufferQueue::ConsumerListener {
583399b7267185646c69b04352211fca4fad9d7547Pannag Sanketipublic:
59bdddc659a941afdb7f4958f582c6901c07246097Daniel Lam    enum { MIN_UNDEQUEUED_BUFFERS = 4};
603399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi
613399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi    struct FrameAvailableListener : public virtual RefBase {
623399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi        // onFrameAvailable() is called from queueBuffer() is the FIFO is
631a2fafbaa36390a06cc9a066fcbe147c8c47ea77Pannag Sanketi        // empty. You can use SurfaceMediaSource::getQueuedCount() to
643399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi        // figure out if there are more frames waiting.
653399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi        // This is called without any lock held can be called concurrently by
663399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi        // multiple threads.
673399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi        virtual void onFrameAvailable() = 0;
683399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi    };
693399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi
70bdddc659a941afdb7f4958f582c6901c07246097Daniel Lam    SurfaceMediaSource(uint32_t bufferWidth, uint32_t bufferHeight);
713399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi
721a2fafbaa36390a06cc9a066fcbe147c8c47ea77Pannag Sanketi    virtual ~SurfaceMediaSource();
733399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi
743399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi    // For the MediaSource interface for use by StageFrightRecorder:
753399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi    virtual status_t start(MetaData *params = NULL);
76bdddc659a941afdb7f4958f582c6901c07246097Daniel Lam
7760c2b4ece6528d6d3f4e9e2c7e45772b65c4b87dJames Dong    virtual status_t stop() { return reset(); }
783399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi    virtual status_t read(
793399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi            MediaBuffer **buffer, const ReadOptions *options = NULL);
803399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi    virtual sp<MetaData> getFormat();
813399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi
82a361483bb5dbd3bbf132c5b99b2df7d197c3fc50Pannag Sanketi    // Pass the metadata over to the buffer, call when you have the lock
83a361483bb5dbd3bbf132c5b99b2df7d197c3fc50Pannag Sanketi    void passMetadataBufferLocked(MediaBuffer **buffer);
84a361483bb5dbd3bbf132c5b99b2df7d197c3fc50Pannag Sanketi    bool checkBufferMatchesSlot(int slot, MediaBuffer *buffer);
85a361483bb5dbd3bbf132c5b99b2df7d197c3fc50Pannag Sanketi
863399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi    // Get / Set the frame rate used for encoding. Default fps = 30
87b33f3407bab0970a7f9241680723a1140b177c50Pannag Sanketi    status_t setFrameRate(int32_t fps) ;
88b33f3407bab0970a7f9241680723a1140b177c50Pannag Sanketi    int32_t getFrameRate( ) const;
893399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi
903399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi    // The call for the StageFrightRecorder to tell us that
913399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi    // it is done using the MediaBuffer data so that its state
923399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi    // can be set to FREE for dequeuing
933399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi    virtual void signalBufferReturned(MediaBuffer* buffer);
943399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi    // end of MediaSource interface
953399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi
963399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi    // getTimestamp retrieves the timestamp associated with the image
97a361483bb5dbd3bbf132c5b99b2df7d197c3fc50Pannag Sanketi    // set by the most recent call to read()
983399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi    //
993399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi    // The timestamp is in nanoseconds, and is monotonically increasing. Its
1003399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi    // other semantics (zero point, etc) are source-dependent and should be
1013399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi    // documented by the source.
1023399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi    int64_t getTimestamp();
1033399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi
1043399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi    // setFrameAvailableListener sets the listener object that will be notified
1053399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi    // when a new frame becomes available.
1063399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi    void setFrameAvailableListener(const sp<FrameAvailableListener>& listener);
1073399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi
1083399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi    // getCurrentBuffer returns the buffer associated with the current image.
1093399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi    sp<GraphicBuffer> getCurrentBuffer() const;
1103399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi
1113399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi    // dump our state in a String
1123399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi    void dump(String8& result) const;
1133399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi    void dump(String8& result, const char* prefix, char* buffer,
1143399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi                                                    size_t SIZE) const;
1153399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi
116b33f3407bab0970a7f9241680723a1140b177c50Pannag Sanketi    // isMetaDataStoredInVideoBuffers tells the encoder whether we will
117b33f3407bab0970a7f9241680723a1140b177c50Pannag Sanketi    // pass metadata through the buffers. Currently, it is force set to true
118b33f3407bab0970a7f9241680723a1140b177c50Pannag Sanketi    bool isMetaDataStoredInVideoBuffers() const;
119b33f3407bab0970a7f9241680723a1140b177c50Pannag Sanketi
120bdddc659a941afdb7f4958f582c6901c07246097Daniel Lam    sp<BufferQueue> getBufferQueue() const { return mBufferQueue; }
121bdddc659a941afdb7f4958f582c6901c07246097Daniel Lam
122b33f3407bab0970a7f9241680723a1140b177c50Pannag Sanketiprotected:
1233399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi
124bdddc659a941afdb7f4958f582c6901c07246097Daniel Lam    // Implementation of the BufferQueue::ConsumerListener interface.  These
125bdddc659a941afdb7f4958f582c6901c07246097Daniel Lam    // calls are used to notify the SurfaceTexture of asynchronous events in the
126bdddc659a941afdb7f4958f582c6901c07246097Daniel Lam    // BufferQueue.
127bdddc659a941afdb7f4958f582c6901c07246097Daniel Lam    virtual void onFrameAvailable();
128bdddc659a941afdb7f4958f582c6901c07246097Daniel Lam
129bdddc659a941afdb7f4958f582c6901c07246097Daniel Lam    // Used as a hook to BufferQueue::disconnect()
130bdddc659a941afdb7f4958f582c6901c07246097Daniel Lam    // This is called by the client side when it is done
131bdddc659a941afdb7f4958f582c6901c07246097Daniel Lam    // TODO: Currently, this also sets mStopped to true which
132bdddc659a941afdb7f4958f582c6901c07246097Daniel Lam    // is needed for unblocking the encoder which might be
133bdddc659a941afdb7f4958f582c6901c07246097Daniel Lam    // waiting to read more frames. So if on the client side,
134bdddc659a941afdb7f4958f582c6901c07246097Daniel Lam    // the same thread supplies the frames and also calls stop
135bdddc659a941afdb7f4958f582c6901c07246097Daniel Lam    // on the encoder, the client has to call disconnect before
136bdddc659a941afdb7f4958f582c6901c07246097Daniel Lam    // it calls stop.
137bdddc659a941afdb7f4958f582c6901c07246097Daniel Lam    // In the case of the camera,
138bdddc659a941afdb7f4958f582c6901c07246097Daniel Lam    // that need not be required since the thread supplying the
139bdddc659a941afdb7f4958f582c6901c07246097Daniel Lam    // frames is separate than the one calling stop.
140bdddc659a941afdb7f4958f582c6901c07246097Daniel Lam    virtual void onBuffersReleased();
141bdddc659a941afdb7f4958f582c6901c07246097Daniel Lam
1423399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi    static bool isExternalFormat(uint32_t format);
1433399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi
1443399b7267185646c69b04352211fca4fad9d7547Pannag Sanketiprivate:
145bdddc659a941afdb7f4958f582c6901c07246097Daniel Lam    // mBufferQueue is the exchange point between the producer and
146bdddc659a941afdb7f4958f582c6901c07246097Daniel Lam    // this consumer
147bdddc659a941afdb7f4958f582c6901c07246097Daniel Lam    sp<BufferQueue> mBufferQueue;
1483399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi
149bdddc659a941afdb7f4958f582c6901c07246097Daniel Lam    // mBufferSlot caches GraphicBuffers from the buffer queue
150bdddc659a941afdb7f4958f582c6901c07246097Daniel Lam    sp<GraphicBuffer> mBufferSlot[BufferQueue::NUM_BUFFER_SLOTS];
1513399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi
1523399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi
153bdddc659a941afdb7f4958f582c6901c07246097Daniel Lam    // The permenent width and height of SMS buffers
154bdddc659a941afdb7f4958f582c6901c07246097Daniel Lam    int mWidth;
155bdddc659a941afdb7f4958f582c6901c07246097Daniel Lam    int mHeight;
1563399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi
1573399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi    // mCurrentSlot is the buffer slot index of the buffer that is currently
1583399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi    // being used by buffer consumer
1591a2fafbaa36390a06cc9a066fcbe147c8c47ea77Pannag Sanketi    // (e.g. StageFrightRecorder in the case of SurfaceMediaSource or GLTexture
1603399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi    // in the case of SurfaceTexture).
1613399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi    // It is initialized to INVALID_BUFFER_SLOT,
1623399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi    // indicating that no buffer slot is currently bound to the texture. Note,
1633399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi    // however, that a value of INVALID_BUFFER_SLOT does not necessarily mean
1643399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi    // that no buffer is bound to the texture. A call to setBufferCount will
1653399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi    // reset mCurrentTexture to INVALID_BUFFER_SLOT.
1663399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi    int mCurrentSlot;
1673399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi
1683399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi    // mCurrentBuf is the graphic buffer of the current slot to be used by
1693399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi    // buffer consumer. It's possible that this buffer is not associated
1703399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi    // with any buffer slot, so we must track it separately in order to
1713399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi    // properly use IGraphicBufferAlloc::freeAllGraphicBuffersExcept.
1723399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi    sp<GraphicBuffer> mCurrentBuf;
1733399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi
1743399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi    // mCurrentTimestamp is the timestamp for the current texture. It
1753399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi    // gets set to mLastQueuedTimestamp each time updateTexImage is called.
1763399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi    int64_t mCurrentTimestamp;
1773399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi
1783399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi    // mFrameAvailableListener is the listener object that will be called when a
1793399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi    // new frame becomes available. If it is not NULL it will be called from
1803399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi    // queueBuffer.
1813399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi    sp<FrameAvailableListener> mFrameAvailableListener;
1823399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi
1833399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi    // mMutex is the mutex used to prevent concurrent access to the member
1841a2fafbaa36390a06cc9a066fcbe147c8c47ea77Pannag Sanketi    // variables of SurfaceMediaSource objects. It must be locked whenever the
1853399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi    // member variables are accessed.
1863399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi    mutable Mutex mMutex;
1873399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi
1883399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi    ////////////////////////// For MediaSource
1893399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi    // Set to a default of 30 fps if not specified by the client side
1903399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi    int32_t mFrameRate;
1913399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi
1920c5c7d2b119d2350c186ae9902919bcf28c3e277Pannag Sanketi    // mStopped is a flag to check if the recording is going on
1930c5c7d2b119d2350c186ae9902919bcf28c3e277Pannag Sanketi    bool mStopped;
1940c5c7d2b119d2350c186ae9902919bcf28c3e277Pannag Sanketi
1950c5c7d2b119d2350c186ae9902919bcf28c3e277Pannag Sanketi    // mNumFramesReceived indicates the number of frames recieved from
1960c5c7d2b119d2350c186ae9902919bcf28c3e277Pannag Sanketi    // the client side
1970c5c7d2b119d2350c186ae9902919bcf28c3e277Pannag Sanketi    int mNumFramesReceived;
1980c5c7d2b119d2350c186ae9902919bcf28c3e277Pannag Sanketi    // mNumFramesEncoded indicates the number of frames passed on to the
1990c5c7d2b119d2350c186ae9902919bcf28c3e277Pannag Sanketi    // encoder
2000c5c7d2b119d2350c186ae9902919bcf28c3e277Pannag Sanketi    int mNumFramesEncoded;
2013399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi
202df4a59c61103e7e0e9332e167a0be67da5d82ff3Eino-Ville Talvala    // mFirstFrameTimestamp is the timestamp of the first received frame.
203df4a59c61103e7e0e9332e167a0be67da5d82ff3Eino-Ville Talvala    // It is used to offset the output timestamps so recording starts at time 0.
204df4a59c61103e7e0e9332e167a0be67da5d82ff3Eino-Ville Talvala    int64_t mFirstFrameTimestamp;
205df4a59c61103e7e0e9332e167a0be67da5d82ff3Eino-Ville Talvala    // mStartTimeNs is the start time passed into the source at start, used to
206df4a59c61103e7e0e9332e167a0be67da5d82ff3Eino-Ville Talvala    // offset timestamps.
207df4a59c61103e7e0e9332e167a0be67da5d82ff3Eino-Ville Talvala    int64_t mStartTimeNs;
208df4a59c61103e7e0e9332e167a0be67da5d82ff3Eino-Ville Talvala
2093399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi    // mFrameAvailableCondition condition used to indicate whether there
2103399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi    // is a frame available for dequeuing
2113399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi    Condition mFrameAvailableCondition;
2123399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi
21360c2b4ece6528d6d3f4e9e2c7e45772b65c4b87dJames Dong    status_t reset();
21460c2b4ece6528d6d3f4e9e2c7e45772b65c4b87dJames Dong
2153399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi    // Avoid copying and equating and default constructor
2161a2fafbaa36390a06cc9a066fcbe147c8c47ea77Pannag Sanketi    DISALLOW_IMPLICIT_CONSTRUCTORS(SurfaceMediaSource);
2173399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi};
2183399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi
2193399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi// ----------------------------------------------------------------------------
2203399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi}; // namespace android
2213399b7267185646c69b04352211fca4fad9d7547Pannag Sanketi
2221a2fafbaa36390a06cc9a066fcbe147c8c47ea77Pannag Sanketi#endif // ANDROID_GUI_SURFACEMEDIASOURCE_H
223