Home | History | Annotate | Download | only in tests
      1 /*
      2  * Copyright (C) 2011 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 DUMMY_RECORDER_H_
     18 #define DUMMY_RECORDER_H_
     19 
     20 #include <pthread.h>
     21 #include <utils/String8.h>
     22 #include <media/stagefright/foundation/ABase.h>
     23 
     24 
     25 namespace android {
     26 
     27 struct MediaSource;
     28 class MediaBuffer;
     29 
     30 class DummyRecorder {
     31     public:
     32     // The media source from which this will receive frames
     33     sp<MediaSource> mSource;
     34     bool mStarted;
     35     pthread_t mThread;
     36 
     37     status_t start();
     38     status_t stop();
     39 
     40     // actual entry point for the thread
     41     void readFromSource();
     42 
     43     // static function to wrap the actual thread entry point
     44     static void *threadWrapper(void *pthis);
     45 
     46     explicit DummyRecorder(const sp<MediaSource> &source) : mSource(source)
     47                                                     , mStarted(false) {}
     48     ~DummyRecorder( ) {}
     49 
     50     private:
     51 
     52     DISALLOW_EVIL_CONSTRUCTORS(DummyRecorder);
     53 };
     54 
     55 } // end of namespace android
     56 #endif
     57 
     58 
     59